diff --git a/internal/ui/dist/assets/CopyButton-CeHt7WhA.js b/internal/ui/dist/assets/CopyButton-DfD1hFjv.js similarity index 92% rename from internal/ui/dist/assets/CopyButton-CeHt7WhA.js rename to internal/ui/dist/assets/CopyButton-DfD1hFjv.js index 157cd9b5..2ba135b7 100644 --- a/internal/ui/dist/assets/CopyButton-CeHt7WhA.js +++ b/internal/ui/dist/assets/CopyButton-DfD1hFjv.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Mr as t,gi as n,mi as r}from"./index-CL2Ww4um.js";var i=e(n(),1);function a(e={}){let t=e.timeout??2e3,[n,r]=(0,i.useState)(null),[a,o]=(0,i.useState)(!1),s=(0,i.useRef)(null);(0,i.useEffect)(()=>()=>{window.clearTimeout(s.current)},[]);let c=e=>{window.clearTimeout(s.current),s.current=window.setTimeout(()=>o(!1),t),o(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),c(!0)}).catch(e=>{r(e),o(!1)}):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{o(!1),r(null),window.clearTimeout(s.current)},error:n,copied:a}}var o=r(),s={timeout:1e3};function c(e){let{children:n,timeout:r,value:i,...c}=t(`CopyButton`,s,e),l=a({timeout:r});return(0,o.jsx)(o.Fragment,{children:n({copy:()=>l.copy(i),copied:l.copied,...c})})}c.displayName=`@mantine/core/CopyButton`;export{c as t}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Mr as t,gi as n,mi as r}from"./index-CRKDYJaJ.js";var i=e(n(),1);function a(e={}){let t=e.timeout??2e3,[n,r]=(0,i.useState)(null),[a,o]=(0,i.useState)(!1),s=(0,i.useRef)(null);(0,i.useEffect)(()=>()=>{window.clearTimeout(s.current)},[]);let c=e=>{window.clearTimeout(s.current),s.current=window.setTimeout(()=>o(!1),t),o(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),c(!0)}).catch(e=>{r(e),o(!1)}):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{o(!1),r(null),window.clearTimeout(s.current)},error:n,copied:a}}var o=r(),s={timeout:1e3};function c(e){let{children:n,timeout:r,value:i,...c}=t(`CopyButton`,s,e),l=a({timeout:r});return(0,o.jsx)(o.Fragment,{children:n({copy:()=>l.copy(i),copied:l.copied,...c})})}c.displayName=`@mantine/core/CopyButton`;export{c as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/NumberInput-DMNGxCQ3.js b/internal/ui/dist/assets/NumberInput-C4qWjk_e.js similarity index 99% rename from internal/ui/dist/assets/NumberInput-DMNGxCQ3.js rename to internal/ui/dist/assets/NumberInput-C4qWjk_e.js index 93a501dc..e02651e2 100644 --- a/internal/ui/dist/assets/NumberInput-DMNGxCQ3.js +++ b/internal/ui/dist/assets/NumberInput-C4qWjk_e.js @@ -1,4 +1,4 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Ar as t,Er as n,Gr as r,Mr as i,Qr as a,Rr as o,Ur as s,Wr as c,cr as l,ei as u,gi as d,jr as f,mi as p,yr as m,zr as h}from"./index-CL2Ww4um.js";function g(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}var _=p(),v=e(d());function ee(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=s?i+=N(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function te(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=A(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=M(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function F(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var I=x(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),ne=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function re(e,t,n){return Math.min(Math.max(e,t),n)}function ie(e){return Math.max(e.selectionStart,e.selectionEnd)}function ae(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function L(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function R(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function oe(e,t,n,r,i,a,o){o===void 0&&(o=R);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function se(e,t,n,r){var i=e.length;if(t=re(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function ce(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nC.length-o.length||xO||d>e.length-o.length)&&(D=d),e=e.substring(0,D),e=V(ee?`-`+e:e,i),e=(e.match(H(m,!0))||[]).join(``);var k=e.indexOf(m);e=e.replace(new RegExp(E(m),`g`),function(e,t){return t===k?`.`:``});var j=A(e,i),M=j.beforeDecimal,N=j.afterDecimal,P=j.addNegation;return l.end-l.start=s?i+=N(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function te(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=A(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=M(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function F(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var I=x(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),ne=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function re(e,t,n){return Math.min(Math.max(e,t),n)}function ie(e){return Math.max(e.selectionStart,e.selectionEnd)}function ae(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function L(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function R(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function oe(e,t,n,r,i,a,o){o===void 0&&(o=R);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function se(e,t,n,r){var i=e.length;if(t=re(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function ce(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nC.length-o.length||xO||d>e.length-o.length)&&(D=d),e=e.substring(0,D),e=V(ee?`-`+e:e,i),e=(e.match(H(m,!0))||[]).join(``);var k=e.indexOf(m);e=e.replace(new RegExp(E(m),`g`),function(e,t){return t===k?`.`:``});var j=A(e,i),M=j.beforeDecimal,N=j.afterDecimal,P=j.addNegation;return l.end-l.start{let a=i(n,{},r),{classNames:o,className:s,style:c,styles:l,...u}=a,f=h();return(0,_.jsx)(d,{component:e,...v(f,t),...f.getStyles(e,{className:s,classNames:o,style:c,styles:l,props:a}),...u})});return r.displayName=`@mantine/core/${n}`,r.classes=g,r}var b=y(`th`,{columnBorder:!0}),x=y(`td`,{columnBorder:!0}),S=y(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),C=y(`thead`,{stickyHeader:!0}),w=y(`tbody`),T=y(`tfoot`),E=y(`caption`,{captionSide:!0}),D={type:`scrollarea`},O=f((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":o(t),"--table-max-height":o(n),"--table-overflow":r===`native`?`auto`:void 0}})),k=a(e=>{let t=i(`TableScrollContainer`,D,e),{classNames:r,className:a,style:o,styles:c,unstyled:l,vars:u,children:f,minWidth:p,maxHeight:m,type:h,scrollAreaProps:v,attributes:y,...b}=t,x=n({name:`TableScrollContainer`,classes:g,props:t,className:a,style:o,classNames:r,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:O,rootSelector:`scrollContainer`});return(0,_.jsx)(d,{component:h===`scrollarea`?s:`div`,...h===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,_.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});k.classes=g,k.varsResolver=O,k.displayName=`@mantine/core/TableScrollContainer`;function A({data:e}){return(0,_.jsxs)(_.Fragment,{children:[e.caption&&(0,_.jsx)(E,{children:e.caption}),e.head&&(0,_.jsx)(C,{children:(0,_.jsx)(S,{children:e.head.map((e,t)=>(0,_.jsx)(b,{children:e},t))})}),e.body&&(0,_.jsx)(w,{children:e.body.map((e,t)=>(0,_.jsx)(S,{children:e.map((e,t)=>(0,_.jsx)(x,{children:e},t))},t))}),e.foot&&(0,_.jsx)(T,{children:(0,_.jsx)(S,{children:e.foot.map((e,t)=>(0,_.jsx)(b,{children:e},t))})})]})}A.displayName=`@mantine/core/TableDataRenderer`;var j=e(c(),1),M={withRowBorders:!0,verticalSpacing:7},N=f((e,{layout:n,captionSide:i,horizontalSpacing:a,verticalSpacing:s,borderColor:c,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":i,"--table-horizontal-spacing":t(a),"--table-vertical-spacing":t(s),"--table-border-color":c?r(c,e):void 0,"--table-striped-color":d&&l?r(l,e):void 0,"--table-highlight-on-hover-color":f&&u?r(u,e):void 0,"--table-sticky-header-offset":m?o(p):void 0}})),P=a(e=>{let t=i(`Table`,M,e),{classNames:r,className:a,style:o,styles:s,unstyled:c,vars:l,horizontalSpacing:u,verticalSpacing:f,captionSide:p,stripedColor:h,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:k,mod:P,tabularNums:F,attributes:I,...L}=t,R=n({name:`Table`,props:t,className:a,style:o,classes:g,classNames:r,styles:s,unstyled:c,attributes:I,rootSelector:`table`,vars:l,varsResolver:N,stable:!0}),z=y===!0?`odd`:y||void 0,B=p||`bottom`,V=(0,j.useMemo)(()=>({getStyles:R,stickyHeader:O,striped:z,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:B}),[R,O,z,b,x,S,B]);return(0,_.jsx)(m,{value:V,children:(0,_.jsx)(d,{component:`table`,mod:[{withTableBorder:C,tabularNums:F},P],...R(`table`),...L,children:D||!!E&&(0,_.jsx)(A,{data:E})})})});P.classes=g,P.varsResolver=N,P.displayName=`@mantine/core/Table`,P.Td=x,P.Th=b,P.Tr=S,P.Thead=C,P.Tbody=w,P.Tfoot=T,P.Caption=E,P.ScrollContainer=k,P.DataRenderer=A;export{p as n,P as t}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$r as t,Ar as n,Lr as r,Mr as i,Tr as a,ai as o,br as s,gi as c,mi as l,ni as u,wr as d,zr as f}from"./index-CRKDYJaJ.js";function p(){return`development`}var[m,h]=u(`Table component was not found in the tree`),g={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},_=l();function v(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function y(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=a(r=>{let a=i(n,{},r),{classNames:o,className:s,style:c,styles:l,...u}=a,f=h();return(0,_.jsx)(d,{component:e,...v(f,t),...f.getStyles(e,{className:s,classNames:o,style:c,styles:l,props:a}),...u})});return r.displayName=`@mantine/core/${n}`,r.classes=g,r}var b=y(`th`,{columnBorder:!0}),x=y(`td`,{columnBorder:!0}),S=y(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),C=y(`thead`,{stickyHeader:!0}),w=y(`tbody`),T=y(`tfoot`),E=y(`caption`,{captionSide:!0}),D={type:`scrollarea`},O=f((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":o(t),"--table-max-height":o(n),"--table-overflow":r===`native`?`auto`:void 0}})),k=a(e=>{let t=i(`TableScrollContainer`,D,e),{classNames:r,className:a,style:o,styles:c,unstyled:l,vars:u,children:f,minWidth:p,maxHeight:m,type:h,scrollAreaProps:v,attributes:y,...b}=t,x=n({name:`TableScrollContainer`,classes:g,props:t,className:a,style:o,classNames:r,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:O,rootSelector:`scrollContainer`});return(0,_.jsx)(d,{component:h===`scrollarea`?s:`div`,...h===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,_.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});k.classes=g,k.varsResolver=O,k.displayName=`@mantine/core/TableScrollContainer`;function A({data:e}){return(0,_.jsxs)(_.Fragment,{children:[e.caption&&(0,_.jsx)(E,{children:e.caption}),e.head&&(0,_.jsx)(C,{children:(0,_.jsx)(S,{children:e.head.map((e,t)=>(0,_.jsx)(b,{children:e},t))})}),e.body&&(0,_.jsx)(w,{children:e.body.map((e,t)=>(0,_.jsx)(S,{children:e.map((e,t)=>(0,_.jsx)(x,{children:e},t))},t))}),e.foot&&(0,_.jsx)(T,{children:(0,_.jsx)(S,{children:e.foot.map((e,t)=>(0,_.jsx)(b,{children:e},t))})})]})}A.displayName=`@mantine/core/TableDataRenderer`;var j=e(c(),1),M={withRowBorders:!0,verticalSpacing:7},N=f((e,{layout:n,captionSide:i,horizontalSpacing:a,verticalSpacing:s,borderColor:c,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":i,"--table-horizontal-spacing":t(a),"--table-vertical-spacing":t(s),"--table-border-color":c?r(c,e):void 0,"--table-striped-color":d&&l?r(l,e):void 0,"--table-highlight-on-hover-color":f&&u?r(u,e):void 0,"--table-sticky-header-offset":m?o(p):void 0}})),P=a(e=>{let t=i(`Table`,M,e),{classNames:r,className:a,style:o,styles:s,unstyled:c,vars:l,horizontalSpacing:u,verticalSpacing:f,captionSide:p,stripedColor:h,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:k,mod:P,tabularNums:F,attributes:I,...L}=t,R=n({name:`Table`,props:t,className:a,style:o,classes:g,classNames:r,styles:s,unstyled:c,attributes:I,rootSelector:`table`,vars:l,varsResolver:N,stable:!0}),z=y===!0?`odd`:y||void 0,B=p||`bottom`,V=(0,j.useMemo)(()=>({getStyles:R,stickyHeader:O,striped:z,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:B}),[R,O,z,b,x,S,B]);return(0,_.jsx)(m,{value:V,children:(0,_.jsx)(d,{component:`table`,mod:[{withTableBorder:C,tabularNums:F},P],...R(`table`),...L,children:D||!!E&&(0,_.jsx)(A,{data:E})})})});P.classes=g,P.varsResolver=N,P.displayName=`@mantine/core/Table`,P.Td=x,P.Th=b,P.Tr=S,P.Thead=C,P.Tbody=w,P.Tfoot=T,P.Caption=E,P.ScrollContainer=k,P.DataRenderer=A;export{p as n,P as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/Textarea-DySd6X1B.js b/internal/ui/dist/assets/Textarea-CKEKXEtW.js similarity index 96% rename from internal/ui/dist/assets/Textarea-DySd6X1B.js rename to internal/ui/dist/assets/Textarea-CKEKXEtW.js index f7ec642d..6ff8806d 100644 --- a/internal/ui/dist/assets/Textarea-DySd6X1B.js +++ b/internal/ui/dist/assets/Textarea-CKEKXEtW.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{n as t}from"./Table-B_pVYmc3.js";import{Gr as n,Mr as r,Tr as i,cr as a,gi as o,mi as s}from"./index-CL2Ww4um.js";var c=e(o(),1),l=s(),u=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],d={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function f(e){Object.keys(d).forEach(t=>{e.style.setProperty(t,d[t],`important`)})}function p(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of u)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var m=null;function h(e,t,n=1,r=1/0){m||(m=document.createElement(`textarea`),m.setAttribute(`tabindex`,`-1`),m.setAttribute(`aria-hidden`,`true`),m.setAttribute(`aria-label`,`autosize measurement`),f(m)),m.parentNode===null&&document.body.appendChild(m);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{m.style[e]=o[e]}),f(m),m.value=t;let c=s===`border-box`?m.scrollHeight+a:m.scrollHeight-i;m.value=t,c=s===`border-box`?m.scrollHeight+a:m.scrollHeight-i,m.value=`x`;let l=m.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function g({maxRows:e,minRows:t,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,c.useRef)(null),u=n(s,i),d=(0,c.useRef)(0),f=(0,c.useRef)(0),m=()=>{let n=s.current;if(!n)return;let r=p(n);if(!r)return;let[i]=h(r,n.value||n.placeholder||`x`,t,e);d.current!==i&&(d.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},g=(0,c.useEffectEvent)(m),_=e=>{o||m(),r?.(e)};return(0,c.useLayoutEffect)(m),(0,c.useEffect)(()=>{let e=()=>m();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,c.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;f.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==f.current&&(f.current=s.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(g))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,c.useEffect)(()=>{let e=()=>m();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,c.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&m()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,l.jsx)(`textarea`,{rows:t,...a,onChange:_,ref:u})}var _=i(e=>{let{autosize:n,maxRows:i,minRows:o,__staticSelector:s,resize:c,bottomSection:u,bottomSectionProps:d,...f}=r([`Input`,`InputWrapper`,`Textarea`],null,e),p=n&&t()!==`test`,m=p?{maxRows:i,minRows:o}:{};return(0,l.jsx)(a,{component:p?g:`textarea`,...f,__staticSelector:s||`Textarea`,__bottomSection:u,__bottomSectionProps:d,multiline:!0,"data-no-overflow":n&&i===void 0||void 0,__vars:{"--input-resize":c},...m})});_.classes=a.classes,_.displayName=`@mantine/core/Textarea`;export{_ as t}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{n as t}from"./Table-DKSK2CAk.js";import{Gr as n,Mr as r,Tr as i,cr as a,gi as o,mi as s}from"./index-CRKDYJaJ.js";var c=e(o(),1),l=s(),u=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],d={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function f(e){Object.keys(d).forEach(t=>{e.style.setProperty(t,d[t],`important`)})}function p(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of u)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var m=null;function h(e,t,n=1,r=1/0){m||(m=document.createElement(`textarea`),m.setAttribute(`tabindex`,`-1`),m.setAttribute(`aria-hidden`,`true`),m.setAttribute(`aria-label`,`autosize measurement`),f(m)),m.parentNode===null&&document.body.appendChild(m);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{m.style[e]=o[e]}),f(m),m.value=t;let c=s===`border-box`?m.scrollHeight+a:m.scrollHeight-i;m.value=t,c=s===`border-box`?m.scrollHeight+a:m.scrollHeight-i,m.value=`x`;let l=m.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function g({maxRows:e,minRows:t,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,c.useRef)(null),u=n(s,i),d=(0,c.useRef)(0),f=(0,c.useRef)(0),m=()=>{let n=s.current;if(!n)return;let r=p(n);if(!r)return;let[i]=h(r,n.value||n.placeholder||`x`,t,e);d.current!==i&&(d.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},g=(0,c.useEffectEvent)(m),_=e=>{o||m(),r?.(e)};return(0,c.useLayoutEffect)(m),(0,c.useEffect)(()=>{let e=()=>m();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,c.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;f.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==f.current&&(f.current=s.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(g))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,c.useEffect)(()=>{let e=()=>m();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,c.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&m()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,l.jsx)(`textarea`,{rows:t,...a,onChange:_,ref:u})}var _=i(e=>{let{autosize:n,maxRows:i,minRows:o,__staticSelector:s,resize:c,bottomSection:u,bottomSectionProps:d,...f}=r([`Input`,`InputWrapper`,`Textarea`],null,e),p=n&&t()!==`test`,m=p?{maxRows:i,minRows:o}:{};return(0,l.jsx)(a,{component:p?g:`textarea`,...f,__staticSelector:s||`Textarea`,__bottomSection:u,__bottomSectionProps:d,multiline:!0,"data-no-overflow":n&&i===void 0||void 0,__vars:{"--input-resize":c},...m})});_.classes=a.classes,_.displayName=`@mantine/core/Textarea`;export{_ as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/alerts-vRASXpaP.js b/internal/ui/dist/assets/alerts-CDampZkC.js similarity index 97% rename from internal/ui/dist/assets/alerts-vRASXpaP.js rename to internal/ui/dist/assets/alerts-CDampZkC.js index 56d59ed4..ff36b791 100644 --- a/internal/ui/dist/assets/alerts-vRASXpaP.js +++ b/internal/ui/dist/assets/alerts-CDampZkC.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{B as t,G as n,Gn as r,Gt as i,H as ee,Ht as a,I as o,J as s,Jt as c,K as l,Kn as u,Kr as d,Kt as f,L as p,M as m,Mr as h,R as te,Tr as g,Tt as _,U as v,Ur as y,V as b,W as x,Xn as S,Zn as C,Zt as ne,an as w,cr as T,d as E,dr as D,gi as O,jr as k,mi as A,nr as j,or as M,pn as re,pr as ie,qn as N,qt as P,ui as F,wr as I,z as L,zt as ae}from"./index-CL2Ww4um.js";import{t as oe}from"./loading-skeleton-BsD5_HiB.js";import{c as se,i as R,l as z,n as B,o as V,r as H,s as ce,t as le}from"./live-data-meta-CGsP1XrP.js";import{t as U}from"./Table-B_pVYmc3.js";import{t as W}from"./useMutation-BWRBtdcF.js";import{t as G}from"./NumberInput-DMNGxCQ3.js";import{t as K}from"./Textarea-DySd6X1B.js";import{t as ue}from"./discard-zr3DFRDY.js";var q=e(O(),1),J=A(),Y=g(e=>{let t=h([`Input`,`InputWrapper`,`Autocomplete`],{size:`sm`},e),{classNames:n,styles:r,unstyled:i,vars:ee,dropdownOpened:a,defaultDropdownOpened:o,onDropdownClose:s,onDropdownOpen:c,onFocus:l,onBlur:u,onClick:f,onChange:p,data:m,value:te,defaultValue:g,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:v,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:ne,limit:w,withScrollArea:E,maxDropdownHeight:D,floatingHeight:O,size:A,id:j,renderOption:M,autoComplete:re,scrollAreaProps:ie,onClear:N,clearButtonProps:P,error:F,clearable:I,clearSectionMode:L,rightSection:ae,autoSelectOnBlur:oe,openOnFocus:B=!0,attributes:le,...U}=t,W=d(j),G=H({id:W,label:U.label,labelProps:U.labelProps,inputWrapperOrder:U.inputWrapperOrder}),K=z(m),ue=se(K),[Y,X]=y({value:te,defaultValue:g,finalValue:``,onChange:p}),Z=ce({opened:a,defaultOpened:o,onDropdownOpen:()=>{c?.(),v&&Z.selectFirstOption()},onDropdownClose:()=>{s?.(),setTimeout(Z.resetSelectedOption,0)}}),de=e=>{X(e),Z.resetSelectedOption()},{resolvedClassNames:fe,resolvedStyles:Q}=k({props:t,styles:r,classNames:n});(0,q.useEffect)(()=>{_&&Z.selectFirstOption()},[_,Y]);let pe=(0,J.jsx)(V.ClearButton,{...P,onClear:()=>{de(``),N?.()}});return(0,J.jsxs)(V,{store:Z,__staticSelector:`Autocomplete`,classNames:fe,styles:Q,unstyled:i,readOnly:S,size:A,attributes:le,floatingHeight:O,keepMounted:oe,onOptionSubmit:e=>{b?.(e),de(ue[e].label),Z.closeDropdown()},...x,children:[(0,J.jsx)(V.Target,{autoComplete:re,withExpandedAttribute:!0,children:(0,J.jsx)(T,{...U,size:A,__staticSelector:`Autocomplete`,__clearSection:pe,__clearable:I&&!!Y&&!C&&!S,__clearSectionMode:L,rightSection:ae,disabled:C,readOnly:S,value:Y,error:F,onChange:e=>{de(e.currentTarget.value),Z.openDropdown(),_&&Z.selectFirstOption()},onFocus:e=>{B&&Z.openDropdown(),l?.(e)},onBlur:e=>{oe&&Z.clickSelectedOption(),Z.closeDropdown(),u?.(e)},onClick:e=>{Z.openDropdown(),f?.(e)},classNames:fe,styles:Q,unstyled:i,attributes:le,id:W})}),(0,J.jsx)(R,{data:K,hidden:S||C,filter:ne,search:Y,limit:w,hiddenWhenEmpty:!0,withScrollArea:E,maxDropdownHeight:D,unstyled:i,labelId:G,"aria-label":G?void 0:U[`aria-label`],renderOption:M,scrollAreaProps:ie})]})});Y.classes={...T.classes,...V.classes},Y.displayName=`@mantine/core/Autocomplete`;var X=/\b(error_rate|p50|p95|throughput|log_count|z_score|health_score)(_delta)?\b/g;function Z(e){let t=e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,`""`);return[...new Set(Array.from(t.matchAll(X),e=>e[0]))]}var de=new Intl.NumberFormat(`en-US`,{style:`percent`,maximumFractionDigits:2}),fe=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:0}),Q=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2});function pe(e,t){return e===`error_rate`?de.format(t):e===`p50`||e===`p95`?`${Q.format(t)} ms`:e===`throughput`||e===`log_count`?fe.format(t):e?.endsWith(`_delta`)?`${t>0?`+`:``}${Q.format(t)}%`:Q.format(t)}function me(e){let t=e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,`""`),n=/\berror_rate\s*[<>=!]=?\s*(\d+(?:\.\d+)?)/.exec(t)??/(\d+(?:\.\d+)?)\s*[<>=!]=?\s*error_rate\b/.exec(t),r=n?Number(n[1]):0;return r>1?`error_rate runs from 0 to 1, so ${n[1]} can never be reached. For ${n[1]}%, write ${Q.format(r/100)}.`:void 0}var he=[{label:`Error rate`,expression:`error_rate > 0.05 && throughput > 10`},{label:`p95 latency`,expression:`p95 > 500 && throughput > 10`},{label:`Traffic drop`,expression:`throughput_delta < -50`},{label:`Log volume`,expression:`log_count > 1000`}],ge={name:``,description:``,enabled:!0,service:``,expression:``,for_seconds:60,cooldown_s:300,repeat_interval_s:3600,webhook_url:``,webhook_headers:``,webhook_template:``,notify_on_resolve:!1};function _e(e){if(!e)return ge;let{id:t,created_at:n,updated_at:r,email_status:i,email_status_detail:ee,email_status_at:a,...o}=e;return{...ge,...o}}var ve=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ye=e=>[...e].some(e=>{let t=e.charCodeAt(0);return t<32&&t!==9||t===127});function be(e){if(!e?.trim())return;let t;try{t=JSON.parse(e)}catch{return`Enter a JSON object`}if(typeof t!=`object`||!t||Array.isArray(t))return`Enter a JSON object`;for(let[e,n]of Object.entries(t).sort(([e],[t])=>et))){if(!ve.test(e))return`"${e}" is not a valid header name`;if(typeof n!=`string`)return`Header ${e} must be a string`;if(ye(n))return`Header ${e} has a line break or control character`}}var xe=e=>e.split(/[,\s]+/).filter(Boolean),Se=/^[^\s@,<>]+@[^\s@,<>]+$/;function Ce(e,t){let n=e.find(e=>!Se.test(e));return n?`"${n}" is not an email address`:new Set(e.map(e=>e.toLowerCase())).size>t?`Enter at most ${t} addresses`:void 0}function we({rule:e,onClose:r,onSave:ee}){let[a,o]=(0,q.useState)(()=>_e(e)),[s,c]=(0,q.useState)(!1),l=ue(JSON.stringify(a)!==JSON.stringify(_e(e)),r,e?`this rule`:`the new rule`),[d,f]=(0,q.useState)(),p=e=>{o(t=>({...t,...e})),f(void 0)},m=a.webhook_headers===e?.webhook_headers?void 0:be(a.webhook_headers),h=w({queryKey:L,queryFn:({signal:e})=>t(e),staleTime:6e4,retry:!1}),[te,g]=(0,q.useState)(()=>(e?.email_recipients??[]).join(`, `)),_=(e?.email_recipients?.length??0)>0,v=JSON.stringify(a.email_recipients??[])===JSON.stringify(e?.email_recipients??[])?void 0:Ce(a.email_recipients??[],h.data?.max_recipients??10),y=a.name.trim()!==``&&a.expression.trim()!==``&&!m&&!v,b=w({...n,staleTime:6e4,retry:!1}),x=a.service?.trim()??``,ne=x!==``&&b.data!==void 0&&!b.data.includes(x),T=me(a.expression),E=(e,t,n)=>(0,J.jsx)(G,{label:e,description:n,min:0,step:30,value:a[t],onChange:e=>p({[t]:typeof e==`number`?e:0})}),O=async()=>{c(!0);try{await ee({...a,name:a.name.trim(),expression:a.expression.trim()})}catch(e){f(e instanceof Error?e.message:`The rule could not be saved`)}finally{c(!1)}};return(0,J.jsxs)(S,{opened:!0,onClose:()=>{s||l.request()},closeOnEscape:!1,onKeyDown:s?void 0:l.onKeyDown,title:e?`Edit rule · ${e.name}`:`New alert rule`,size:`lg`,children:[l.prompt,(0,J.jsxs)(N,{gap:`sm`,children:[(0,J.jsx)(u,{label:`Name`,required:!0,value:a.name,onChange:e=>p({name:e.currentTarget.value}),"data-autofocus":!0}),(0,J.jsx)(u,{label:`Description`,value:a.description??``,onChange:e=>p({description:e.currentTarget.value})}),(0,J.jsx)(Y,{label:`Service`,description:`Leave empty to evaluate every service.`,data:b.data??[],value:a.service??``,onChange:e=>p({service:e})}),ne&&(0,J.jsxs)(M,{size:`xs`,c:`warn`,mt:-8,role:`status`,children:[`No telemetry from `,x,` in the last hour. Check the name; the rule still saves.`]}),(0,J.jsxs)(N,{gap:4,children:[(0,J.jsxs)(D,{justify:`space-between`,align:`flex-end`,children:[(0,J.jsx)(M,{size:`sm`,fw:500,children:`Expression`}),(0,J.jsxs)(C,{position:`bottom-end`,children:[(0,J.jsx)(C.Target,{children:(0,J.jsx)(j,{size:`compact-xs`,variant:`subtle`,children:`Start from a template`})}),(0,J.jsx)(C.Dropdown,{children:he.map(e=>(0,J.jsxs)(C.Item,{onClick:()=>p({expression:e.expression}),children:[e.label,(0,J.jsx)(M,{size:`xs`,c:`dimmed`,ff:`monospace`,children:e.expression})]},e.label))})]})]}),(0,J.jsx)(K,{"aria-label":`Expression`,required:!0,autosize:!0,minRows:2,ff:`monospace`,value:a.expression,onChange:e=>p({expression:e.currentTarget.value}),description:`A CEL condition over one service's rollup, for example error_rate > 0.05 && throughput > 10. error_rate is 0 to 1; p95 is in milliseconds.`}),T&&(0,J.jsx)(M,{size:`xs`,c:`warn`,role:`status`,children:T})]}),(0,J.jsxs)(D,{grow:!0,align:`flex-start`,children:[E(`Hold for (s)`,`for_seconds`,`Condition must hold this long, from the first check that sees it`),E(`Cooldown (s)`,`cooldown_s`,`Quiet period after resolving`),E(`Repeat every (s)`,`repeat_interval_s`,`0 delivers once`)]}),(0,J.jsxs)(N,{gap:4,children:[(0,J.jsx)(u,{label:`Email recipients`,placeholder:`oncall@example.com, team@example.com`,disabled:!h.data?.available&&!_,value:te,error:v,description:h.data?.available?`Separate addresses with commas, up to ${h.data.max_recipients}.${h.data.default_destination?` Leave this and the webhook empty to use the default destination.`:``}`:void 0,onChange:e=>{let t=e.currentTarget.value,n=xe(t);g(t),p({email_recipients:n.length>0?n:void 0})}}),h.data&&!h.data.available&&(0,J.jsx)(M,{size:`xs`,c:`warn`,role:`status`,children:h.data.message}),h.isError&&(0,J.jsx)(M,{size:`xs`,c:`warn`,role:`status`,children:`Email availability could not be checked.`})]}),(0,J.jsx)(u,{label:`Webhook URL`,value:a.webhook_url??``,onChange:e=>p({webhook_url:e.currentTarget.value})}),(0,J.jsx)(K,{label:`Webhook headers`,description:`A JSON object, for example {"Authorization": "Bearer …"}`,autosize:!0,minRows:1,ff:`monospace`,value:a.webhook_headers??``,error:m,onChange:e=>p({webhook_headers:e.currentTarget.value})}),(0,J.jsx)(K,{label:`Webhook body template`,description:`Go text/template; leave empty for the default payload.`,autosize:!0,minRows:1,ff:`monospace`,value:a.webhook_template??``,onChange:e=>p({webhook_template:e.currentTarget.value})}),(0,J.jsxs)(D,{children:[(0,J.jsx)(B,{label:`Notify when resolved`,checked:a.notify_on_resolve,onChange:e=>p({notify_on_resolve:e.currentTarget.checked})}),(0,J.jsx)(B,{label:`Enabled`,checked:a.enabled,onChange:e=>p({enabled:e.currentTarget.checked})})]}),d&&(0,J.jsx)(I,{children:(0,J.jsx)(i,{tone:`danger`,title:`Not saved`,children:d})}),(0,J.jsxs)(D,{justify:`flex-end`,gap:`xs`,children:[(0,J.jsx)(j,{variant:`default`,disabled:s,onClick:l.request,children:`Cancel`}),(0,J.jsx)(j,{loading:s,disabled:!y,onClick:()=>void O(),children:e?`Save rule`:`Create rule`})]})]})]})}var Te={firing:`danger`,pending:`warning`,resolved:`neutral`},$=e=>e?m(e):`—`,Ee={error_rate:`spans | error_rate()`,p95:`spans | p95(duration)`,throughput:`spans | count()`,log_count:`logs | count()`};function De(e){let[t,n]=Ee[Z(e.expression).map(e=>e.replace(/_delta$/,``)).find(e=>e in Ee)??`throughput`].split(` | `);return e.service?`${t} where service:"${e.service.replaceAll(`"`,`""`)}" | ${n} every auto`:`${t} | ${n} by service every auto`}var Oe=`Open in Explore charts raw telemetry, so values can differ slightly from a rule's rollups. Explore shows error rate as a percent: a rule's 0.05 is 5 there.`,ke={failed:{tone:`danger`,label:`Email failed`},unavailable:{tone:`danger`,label:`Email unavailable`},suppressed:{tone:`warning`,label:`Email suppressed`},retrying:{tone:`warning`,label:`Email retrying`}};function Ae({onExplore:e}){let t=re(),n=_().role!==`viewer`,u=w({queryKey:x,queryFn:({signal:e})=>ee(e),refetchInterval:3e4}),d=w({queryKey:o,queryFn:({signal:e})=>b(e),refetchInterval:3e4}),[m,h]=(0,q.useState)(),[g,y]=(0,q.useState)(),[T,E]=(0,q.useState)(),O=s(),k=(0,q.useRef)(null),A=(0,q.useRef)(new Map),F=e=>O.remember(A.current.get(e.id)??null),I=()=>{h(void 0),O.restore(k.current)},L=()=>{y(void 0),O.restore(k.current)},se=()=>{t.invalidateQueries({queryKey:x}),t.invalidateQueries({queryKey:o})},R=W({mutationFn:e=>v(e.id,{...je(e),enabled:!e.enabled}),onSuccess:se}),z=W({mutationFn:e=>te(e.id),onSuccess:()=>{H.current++,L(),se()}}),V=async e=>{m?.rule?await v(m.rule.id,e):await p(e),I(),se()},H=(0,q.useRef)(0),ce=()=>{H.current++,E(void 0),O.restore(k.current)},G=e=>{let t=++H.current;E({rule:e});let n=n=>{H.current===t&&E({rule:e,...n})};l(e.id).then(e=>n({result:e}),e=>n({error:e instanceof Error?e.message:`The test failed`}))},K=new Map((u.data??[]).map(e=>[e.id,e])),ue=e=>(d.data??[]).filter(t=>t.rule_id===e.id&&t.fired_at).map(e=>e.fired_at).sort().at(-1),Y=e=>(d.data??[]).filter(t=>t.rule_id===e.id&&(t.state===`firing`||t.state===`pending`)),X=[...d.data??[]].sort((e,t)=>(t.fired_at??t.created_at).localeCompare(e.fired_at??e.created_at));return(0,J.jsxs)(N,{gap:`lg`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,maw:1600,mx:`auto`,"data-alerts":!0,children:[(0,J.jsx)(c,{title:`Alerts`,description:`Evaluate service rules and deliver notifications when they fire.`,meta:(0,J.jsx)(le,{updatedAt:d.dataUpdatedAt}),actions:n&&(0,J.jsx)(j,{ref:k,leftSection:(0,J.jsx)(ae,{size:14}),onClick:e=>{O.remember(e.currentTarget),h({})},children:`New rule`})}),(0,J.jsxs)(N,{gap:`xs`,children:[(0,J.jsx)(r,{order:2,fz:18,children:`Rules`}),u.data&&u.data.length>0&&(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:Oe}),u.isLoading?(0,J.jsx)(f,{state:`loading`,loadingLabel:`Loading alert rules`,skeleton:(0,J.jsx)(oe,{shape:`table`,columns:7,rows:4})}):u.error?(0,J.jsx)(f,{state:`error`,error:{message:`Rules could not be loaded: ${u.error.message}`,onRetry:()=>void u.refetch()}}):u.data?.length===0?(0,J.jsx)(f,{state:`empty`,empty:{title:`No rules yet`,description:n?`Create a rule to get notified when a service misbehaves.`:`An operator or admin can create rules.`,action:n&&(0,J.jsx)(j,{onClick:e=>{O.remember(e.currentTarget),h({})},children:`New rule`})}}):(0,J.jsx)(U.ScrollContainer,{minWidth:760,children:(0,J.jsxs)(U,{verticalSpacing:`sm`,children:[(0,J.jsx)(U.Thead,{children:(0,J.jsxs)(U.Tr,{children:[(0,J.jsx)(U.Th,{children:`Rule`}),(0,J.jsx)(U.Th,{children:`Service`}),(0,J.jsx)(U.Th,{children:`Expression`}),(0,J.jsx)(U.Th,{children:`State`}),(0,J.jsx)(U.Th,{children:`Last fired`}),(0,J.jsx)(U.Th,{children:`Enabled`}),(0,J.jsx)(U.Th,{w:48,children:(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:`Actions`})})]})}),(0,J.jsx)(U.Tbody,{children:u.data?.map(t=>{let r=Y(t);return(0,J.jsxs)(U.Tr,{children:[(0,J.jsxs)(U.Td,{children:[(0,J.jsx)(M,{size:`sm`,fw:500,children:t.name}),t.description&&(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:t.description}),t.email_status&&ke[t.email_status]&&(0,J.jsxs)(D,{gap:6,mt:4,role:`status`,children:[(0,J.jsx)(P,{tone:ke[t.email_status].tone,children:ke[t.email_status].label}),t.email_status_detail&&(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:t.email_status_detail})]})]}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,children:t.service||`All services`})}),(0,J.jsxs)(U.Td,{children:[(0,J.jsx)(M,{size:`xs`,ff:`monospace`,children:t.expression}),(0,J.jsx)(j,{size:`compact-xs`,variant:`subtle`,px:0,onClick:()=>e(De(t)),children:`Open in Explore`})]}),(0,J.jsx)(U.Td,{children:t.enabled?d.isSuccess?r.length>0?(0,J.jsx)(D,{gap:4,children:r.map(e=>(0,J.jsxs)(P,{tone:Te[e.state]??`neutral`,children:[e.state.charAt(0).toUpperCase()+e.state.slice(1),` · `,e.service]},e.id))}):(0,J.jsx)(P,{tone:`success`,children:`Ok`}):(0,J.jsx)(P,{tone:`neutral`,children:`Unknown`}):(0,J.jsx)(P,{tone:`neutral`,children:`Disabled`})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:d.isSuccess?$(ue(t)):`—`})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(B,{"aria-label":`Enable ${t.name}`,checked:t.enabled,disabled:!n||R.isPending,onChange:()=>R.mutate(t)})}),(0,J.jsx)(U.Td,{children:n&&(0,J.jsxs)(C,{position:`bottom-end`,children:[(0,J.jsx)(C.Target,{children:(0,J.jsx)(ie,{ref:e=>{e?A.current.set(t.id,e):A.current.delete(t.id)},variant:`subtle`,color:`gray`,"aria-label":`${t.name} actions`,children:(0,J.jsx)(a,{size:18})})}),(0,J.jsxs)(C.Dropdown,{children:[(0,J.jsx)(C.Item,{onClick:()=>{F(t),h({rule:t})},children:`Edit`}),(0,J.jsx)(C.Item,{onClick:()=>{F(t),G(t)},children:`Test against current data`}),(0,J.jsx)(C.Item,{color:`bad`,onClick:()=>{F(t),y(t)},children:`Delete`})]})]})})]},t.id)})})]})}),R.error&&(0,J.jsx)(i,{tone:`danger`,children:R.error.message})]}),(0,J.jsxs)(N,{gap:`xs`,children:[(0,J.jsx)(r,{order:2,fz:18,children:`History`}),d.isLoading?(0,J.jsx)(f,{state:`loading`,loadingLabel:`Loading alert history`,skeleton:(0,J.jsx)(oe,{shape:`table`,columns:7,rows:4})}):d.error?(0,J.jsxs)(i,{tone:`danger`,children:[`Alert history could not be loaded: `,d.error.message]}):X.length===0?(0,J.jsx)(f,{state:`empty`,empty:{title:`Nothing has fired yet`,description:`Alerts appear here when a rule fires.`}}):(0,J.jsx)(U.ScrollContainer,{minWidth:760,scrollAreaProps:{viewportProps:{tabIndex:0,role:`region`,"aria-label":`Alert history`}},children:(0,J.jsxs)(U,{verticalSpacing:`xs`,children:[(0,J.jsx)(U.Thead,{children:(0,J.jsxs)(U.Tr,{children:[(0,J.jsx)(U.Th,{children:`State`}),(0,J.jsx)(U.Th,{children:`Rule`}),(0,J.jsx)(U.Th,{children:`Service`}),(0,J.jsx)(U.Th,{ta:`right`,children:`Value`}),(0,J.jsx)(U.Th,{children:`Fired`}),(0,J.jsx)(U.Th,{children:`Resolved`}),(0,J.jsx)(U.Th,{children:`Delivery`})]})}),(0,J.jsx)(U.Tbody,{children:X.map(e=>(0,J.jsxs)(U.Tr,{children:[(0,J.jsx)(U.Td,{children:(0,J.jsx)(P,{tone:Te[e.state]??`neutral`,children:e.state.charAt(0).toUpperCase()+e.state.slice(1)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,children:K.get(e.rule_id)?.name??e.rule_id})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,children:e.service})}),(0,J.jsx)(U.Td,{ta:`right`,children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:e.value===void 0?`—`:pe(Z(K.get(e.rule_id)?.expression??``)[0],e.value)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:$(e.fired_at)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:$(e.resolved_at)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:e.last_delivery_status?`${e.last_delivery_status} · ${$(e.last_delivery_at)}`:`—`})})]},e.id))})]})})]}),m&&(0,J.jsx)(we,{rule:m.rule,onClose:I,onSave:V}),g&&(0,J.jsxs)(ne,{opened:!0,onClose:L,title:`Delete ${g.name}?`,confirmLabel:`Delete rule`,tone:`danger`,pending:z.isPending?`confirm`:null,error:z.error?.message,onConfirm:()=>z.mutate(g),children:[`The rule `,(0,J.jsx)(M,{span:!0,ff:`monospace`,children:g.name}),` and its alert history are removed. This cannot be undone.`]}),T&&(0,J.jsx)(S,{opened:!0,onClose:ce,closeButtonProps:{"aria-label":`Close test`},title:`Test · ${T.rule.name}`,children:T.error?(0,J.jsx)(i,{tone:`danger`,children:T.error}):T.result?T.result.results?.length?(0,J.jsx)(N,{gap:`xs`,children:T.result.results.map(e=>(0,J.jsxs)(N,{gap:2,children:[(0,J.jsxs)(D,{justify:`space-between`,children:[(0,J.jsx)(M,{size:`sm`,children:e.service}),e.error?(0,J.jsx)(M,{size:`xs`,c:`bad`,children:e.error}):e.no_data?(0,J.jsx)(P,{tone:`warning`,children:`No recent data`}):(0,J.jsx)(P,{tone:e.triggered?`danger`:`success`,children:e.triggered?`Would fire`:`Quiet`})]}),e.no_data?(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:`This service has sent no telemetry recently. Check its name.`}):(0,J.jsx)(M,{size:`xs`,c:`dimmed`,ff:`monospace`,children:Z(T.rule.expression).filter(t=>typeof e.env?.[t]==`number`).map(t=>`${t} ${pe(t,e.env[t])}`).join(` · `)})]},e.service))}):(0,J.jsx)(f,{state:`empty`,empty:{title:`No services have data in the current window.`}}):(0,J.jsx)(f,{state:`loading`,loadingLabel:`Testing the rule`,rows:3})})]})}function je(e){let{id:t,created_at:n,updated_at:r,email_status:i,email_status_detail:ee,email_status_at:a,...o}=e;return o}function Me(){let e=F();return(0,J.jsx)(Ae,{onExplore:t=>void e({to:`/explore`,search:E({q:t,range:`1h`,tab:`query`})})})}export{Me as component}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{B as t,G as n,Gn as r,Gt as i,H as ee,Ht as a,I as o,J as s,Jt as c,K as l,Kn as u,Kr as d,Kt as f,L as p,M as m,Mr as h,R as te,Tr as g,Tt as _,U as v,Ur as y,V as b,W as x,Xn as S,Zn as C,Zt as ne,an as w,cr as T,d as E,dr as D,gi as O,jr as k,mi as A,nr as j,or as M,pn as re,pr as ie,qn as N,qt as P,ui as F,wr as I,z as L,zt as ae}from"./index-CRKDYJaJ.js";import{t as oe}from"./loading-skeleton-BgW8PQ9g.js";import{c as se,i as R,l as z,n as B,o as V,r as H,s as ce,t as le}from"./live-data-meta-D4rcFCF2.js";import{t as U}from"./Table-DKSK2CAk.js";import{t as W}from"./useMutation-C6XBlFap.js";import{t as G}from"./NumberInput-C4qWjk_e.js";import{t as K}from"./Textarea-CKEKXEtW.js";import{t as ue}from"./discard-YoKuewjt.js";var q=e(O(),1),J=A(),Y=g(e=>{let t=h([`Input`,`InputWrapper`,`Autocomplete`],{size:`sm`},e),{classNames:n,styles:r,unstyled:i,vars:ee,dropdownOpened:a,defaultDropdownOpened:o,onDropdownClose:s,onDropdownOpen:c,onFocus:l,onBlur:u,onClick:f,onChange:p,data:m,value:te,defaultValue:g,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:v,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:ne,limit:w,withScrollArea:E,maxDropdownHeight:D,floatingHeight:O,size:A,id:j,renderOption:M,autoComplete:re,scrollAreaProps:ie,onClear:N,clearButtonProps:P,error:F,clearable:I,clearSectionMode:L,rightSection:ae,autoSelectOnBlur:oe,openOnFocus:B=!0,attributes:le,...U}=t,W=d(j),G=H({id:W,label:U.label,labelProps:U.labelProps,inputWrapperOrder:U.inputWrapperOrder}),K=z(m),ue=se(K),[Y,X]=y({value:te,defaultValue:g,finalValue:``,onChange:p}),Z=ce({opened:a,defaultOpened:o,onDropdownOpen:()=>{c?.(),v&&Z.selectFirstOption()},onDropdownClose:()=>{s?.(),setTimeout(Z.resetSelectedOption,0)}}),de=e=>{X(e),Z.resetSelectedOption()},{resolvedClassNames:fe,resolvedStyles:Q}=k({props:t,styles:r,classNames:n});(0,q.useEffect)(()=>{_&&Z.selectFirstOption()},[_,Y]);let pe=(0,J.jsx)(V.ClearButton,{...P,onClear:()=>{de(``),N?.()}});return(0,J.jsxs)(V,{store:Z,__staticSelector:`Autocomplete`,classNames:fe,styles:Q,unstyled:i,readOnly:S,size:A,attributes:le,floatingHeight:O,keepMounted:oe,onOptionSubmit:e=>{b?.(e),de(ue[e].label),Z.closeDropdown()},...x,children:[(0,J.jsx)(V.Target,{autoComplete:re,withExpandedAttribute:!0,children:(0,J.jsx)(T,{...U,size:A,__staticSelector:`Autocomplete`,__clearSection:pe,__clearable:I&&!!Y&&!C&&!S,__clearSectionMode:L,rightSection:ae,disabled:C,readOnly:S,value:Y,error:F,onChange:e=>{de(e.currentTarget.value),Z.openDropdown(),_&&Z.selectFirstOption()},onFocus:e=>{B&&Z.openDropdown(),l?.(e)},onBlur:e=>{oe&&Z.clickSelectedOption(),Z.closeDropdown(),u?.(e)},onClick:e=>{Z.openDropdown(),f?.(e)},classNames:fe,styles:Q,unstyled:i,attributes:le,id:W})}),(0,J.jsx)(R,{data:K,hidden:S||C,filter:ne,search:Y,limit:w,hiddenWhenEmpty:!0,withScrollArea:E,maxDropdownHeight:D,unstyled:i,labelId:G,"aria-label":G?void 0:U[`aria-label`],renderOption:M,scrollAreaProps:ie})]})});Y.classes={...T.classes,...V.classes},Y.displayName=`@mantine/core/Autocomplete`;var X=/\b(error_rate|p50|p95|throughput|log_count|z_score|health_score)(_delta)?\b/g;function Z(e){let t=e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,`""`);return[...new Set(Array.from(t.matchAll(X),e=>e[0]))]}var de=new Intl.NumberFormat(`en-US`,{style:`percent`,maximumFractionDigits:2}),fe=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:0}),Q=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2});function pe(e,t){return e===`error_rate`?de.format(t):e===`p50`||e===`p95`?`${Q.format(t)} ms`:e===`throughput`||e===`log_count`?fe.format(t):e?.endsWith(`_delta`)?`${t>0?`+`:``}${Q.format(t)}%`:Q.format(t)}function me(e){let t=e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,`""`),n=/\berror_rate\s*[<>=!]=?\s*(\d+(?:\.\d+)?)/.exec(t)??/(\d+(?:\.\d+)?)\s*[<>=!]=?\s*error_rate\b/.exec(t),r=n?Number(n[1]):0;return r>1?`error_rate runs from 0 to 1, so ${n[1]} can never be reached. For ${n[1]}%, write ${Q.format(r/100)}.`:void 0}var he=[{label:`Error rate`,expression:`error_rate > 0.05 && throughput > 10`},{label:`p95 latency`,expression:`p95 > 500 && throughput > 10`},{label:`Traffic drop`,expression:`throughput_delta < -50`},{label:`Log volume`,expression:`log_count > 1000`}],ge={name:``,description:``,enabled:!0,service:``,expression:``,for_seconds:60,cooldown_s:300,repeat_interval_s:3600,webhook_url:``,webhook_headers:``,webhook_template:``,notify_on_resolve:!1};function _e(e){if(!e)return ge;let{id:t,created_at:n,updated_at:r,email_status:i,email_status_detail:ee,email_status_at:a,...o}=e;return{...ge,...o}}var ve=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ye=e=>[...e].some(e=>{let t=e.charCodeAt(0);return t<32&&t!==9||t===127});function be(e){if(!e?.trim())return;let t;try{t=JSON.parse(e)}catch{return`Enter a JSON object`}if(typeof t!=`object`||!t||Array.isArray(t))return`Enter a JSON object`;for(let[e,n]of Object.entries(t).sort(([e],[t])=>et))){if(!ve.test(e))return`"${e}" is not a valid header name`;if(typeof n!=`string`)return`Header ${e} must be a string`;if(ye(n))return`Header ${e} has a line break or control character`}}var xe=e=>e.split(/[,\s]+/).filter(Boolean),Se=/^[^\s@,<>]+@[^\s@,<>]+$/;function Ce(e,t){let n=e.find(e=>!Se.test(e));return n?`"${n}" is not an email address`:new Set(e.map(e=>e.toLowerCase())).size>t?`Enter at most ${t} addresses`:void 0}function we({rule:e,onClose:r,onSave:ee}){let[a,o]=(0,q.useState)(()=>_e(e)),[s,c]=(0,q.useState)(!1),l=ue(JSON.stringify(a)!==JSON.stringify(_e(e)),r,e?`this rule`:`the new rule`),[d,f]=(0,q.useState)(),p=e=>{o(t=>({...t,...e})),f(void 0)},m=a.webhook_headers===e?.webhook_headers?void 0:be(a.webhook_headers),h=w({queryKey:L,queryFn:({signal:e})=>t(e),staleTime:6e4,retry:!1}),[te,g]=(0,q.useState)(()=>(e?.email_recipients??[]).join(`, `)),_=(e?.email_recipients?.length??0)>0,v=JSON.stringify(a.email_recipients??[])===JSON.stringify(e?.email_recipients??[])?void 0:Ce(a.email_recipients??[],h.data?.max_recipients??10),y=a.name.trim()!==``&&a.expression.trim()!==``&&!m&&!v,b=w({...n,staleTime:6e4,retry:!1}),x=a.service?.trim()??``,ne=x!==``&&b.data!==void 0&&!b.data.includes(x),T=me(a.expression),E=(e,t,n)=>(0,J.jsx)(G,{label:e,description:n,min:0,step:30,value:a[t],onChange:e=>p({[t]:typeof e==`number`?e:0})}),O=async()=>{c(!0);try{await ee({...a,name:a.name.trim(),expression:a.expression.trim()})}catch(e){f(e instanceof Error?e.message:`The rule could not be saved`)}finally{c(!1)}};return(0,J.jsxs)(S,{opened:!0,onClose:()=>{s||l.request()},closeOnEscape:!1,onKeyDown:s?void 0:l.onKeyDown,title:e?`Edit rule · ${e.name}`:`New alert rule`,size:`lg`,children:[l.prompt,(0,J.jsxs)(N,{gap:`sm`,children:[(0,J.jsx)(u,{label:`Name`,required:!0,value:a.name,onChange:e=>p({name:e.currentTarget.value}),"data-autofocus":!0}),(0,J.jsx)(u,{label:`Description`,value:a.description??``,onChange:e=>p({description:e.currentTarget.value})}),(0,J.jsx)(Y,{label:`Service`,description:`Leave empty to evaluate every service.`,data:b.data??[],value:a.service??``,onChange:e=>p({service:e})}),ne&&(0,J.jsxs)(M,{size:`xs`,c:`warn`,mt:-8,role:`status`,children:[`No telemetry from `,x,` in the last hour. Check the name; the rule still saves.`]}),(0,J.jsxs)(N,{gap:4,children:[(0,J.jsxs)(D,{justify:`space-between`,align:`flex-end`,children:[(0,J.jsx)(M,{size:`sm`,fw:500,children:`Expression`}),(0,J.jsxs)(C,{position:`bottom-end`,children:[(0,J.jsx)(C.Target,{children:(0,J.jsx)(j,{size:`compact-xs`,variant:`subtle`,children:`Start from a template`})}),(0,J.jsx)(C.Dropdown,{children:he.map(e=>(0,J.jsxs)(C.Item,{onClick:()=>p({expression:e.expression}),children:[e.label,(0,J.jsx)(M,{size:`xs`,c:`dimmed`,ff:`monospace`,children:e.expression})]},e.label))})]})]}),(0,J.jsx)(K,{"aria-label":`Expression`,required:!0,autosize:!0,minRows:2,ff:`monospace`,value:a.expression,onChange:e=>p({expression:e.currentTarget.value}),description:`A CEL condition over one service's rollup, for example error_rate > 0.05 && throughput > 10. error_rate is 0 to 1; p95 is in milliseconds.`}),T&&(0,J.jsx)(M,{size:`xs`,c:`warn`,role:`status`,children:T})]}),(0,J.jsxs)(D,{grow:!0,align:`flex-start`,children:[E(`Hold for (s)`,`for_seconds`,`Condition must hold this long, from the first check that sees it`),E(`Cooldown (s)`,`cooldown_s`,`Quiet period after resolving`),E(`Repeat every (s)`,`repeat_interval_s`,`0 delivers once`)]}),(0,J.jsxs)(N,{gap:4,children:[(0,J.jsx)(u,{label:`Email recipients`,placeholder:`oncall@example.com, team@example.com`,disabled:!h.data?.available&&!_,value:te,error:v,description:h.data?.available?`Separate addresses with commas, up to ${h.data.max_recipients}.${h.data.default_destination?` Leave this and the webhook empty to use the default destination.`:``}`:void 0,onChange:e=>{let t=e.currentTarget.value,n=xe(t);g(t),p({email_recipients:n.length>0?n:void 0})}}),h.data&&!h.data.available&&(0,J.jsx)(M,{size:`xs`,c:`warn`,role:`status`,children:h.data.message}),h.isError&&(0,J.jsx)(M,{size:`xs`,c:`warn`,role:`status`,children:`Email availability could not be checked.`})]}),(0,J.jsx)(u,{label:`Webhook URL`,value:a.webhook_url??``,onChange:e=>p({webhook_url:e.currentTarget.value})}),(0,J.jsx)(K,{label:`Webhook headers`,description:`A JSON object, for example {"Authorization": "Bearer …"}`,autosize:!0,minRows:1,ff:`monospace`,value:a.webhook_headers??``,error:m,onChange:e=>p({webhook_headers:e.currentTarget.value})}),(0,J.jsx)(K,{label:`Webhook body template`,description:`Go text/template; leave empty for the default payload.`,autosize:!0,minRows:1,ff:`monospace`,value:a.webhook_template??``,onChange:e=>p({webhook_template:e.currentTarget.value})}),(0,J.jsxs)(D,{children:[(0,J.jsx)(B,{label:`Notify when resolved`,checked:a.notify_on_resolve,onChange:e=>p({notify_on_resolve:e.currentTarget.checked})}),(0,J.jsx)(B,{label:`Enabled`,checked:a.enabled,onChange:e=>p({enabled:e.currentTarget.checked})})]}),d&&(0,J.jsx)(I,{children:(0,J.jsx)(i,{tone:`danger`,title:`Not saved`,children:d})}),(0,J.jsxs)(D,{justify:`flex-end`,gap:`xs`,children:[(0,J.jsx)(j,{variant:`default`,disabled:s,onClick:l.request,children:`Cancel`}),(0,J.jsx)(j,{loading:s,disabled:!y,onClick:()=>void O(),children:e?`Save rule`:`Create rule`})]})]})]})}var Te={firing:`danger`,pending:`warning`,resolved:`neutral`},$=e=>e?m(e):`—`,Ee={error_rate:`spans | error_rate()`,p95:`spans | p95(duration)`,throughput:`spans | count()`,log_count:`logs | count()`};function De(e){let[t,n]=Ee[Z(e.expression).map(e=>e.replace(/_delta$/,``)).find(e=>e in Ee)??`throughput`].split(` | `);return e.service?`${t} where service:"${e.service.replaceAll(`"`,`""`)}" | ${n} every auto`:`${t} | ${n} by service every auto`}var Oe=`Open in Explore charts raw telemetry, so values can differ slightly from a rule's rollups. Explore shows error rate as a percent: a rule's 0.05 is 5 there.`,ke={failed:{tone:`danger`,label:`Email failed`},unavailable:{tone:`danger`,label:`Email unavailable`},suppressed:{tone:`warning`,label:`Email suppressed`},retrying:{tone:`warning`,label:`Email retrying`}};function Ae({onExplore:e}){let t=re(),n=_().role!==`viewer`,u=w({queryKey:x,queryFn:({signal:e})=>ee(e),refetchInterval:3e4}),d=w({queryKey:o,queryFn:({signal:e})=>b(e),refetchInterval:3e4}),[m,h]=(0,q.useState)(),[g,y]=(0,q.useState)(),[T,E]=(0,q.useState)(),O=s(),k=(0,q.useRef)(null),A=(0,q.useRef)(new Map),F=e=>O.remember(A.current.get(e.id)??null),I=()=>{h(void 0),O.restore(k.current)},L=()=>{y(void 0),O.restore(k.current)},se=()=>{t.invalidateQueries({queryKey:x}),t.invalidateQueries({queryKey:o})},R=W({mutationFn:e=>v(e.id,{...je(e),enabled:!e.enabled}),onSuccess:se}),z=W({mutationFn:e=>te(e.id),onSuccess:()=>{H.current++,L(),se()}}),V=async e=>{m?.rule?await v(m.rule.id,e):await p(e),I(),se()},H=(0,q.useRef)(0),ce=()=>{H.current++,E(void 0),O.restore(k.current)},G=e=>{let t=++H.current;E({rule:e});let n=n=>{H.current===t&&E({rule:e,...n})};l(e.id).then(e=>n({result:e}),e=>n({error:e instanceof Error?e.message:`The test failed`}))},K=new Map((u.data??[]).map(e=>[e.id,e])),ue=e=>(d.data??[]).filter(t=>t.rule_id===e.id&&t.fired_at).map(e=>e.fired_at).sort().at(-1),Y=e=>(d.data??[]).filter(t=>t.rule_id===e.id&&(t.state===`firing`||t.state===`pending`)),X=[...d.data??[]].sort((e,t)=>(t.fired_at??t.created_at).localeCompare(e.fired_at??e.created_at));return(0,J.jsxs)(N,{gap:`lg`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,maw:1600,mx:`auto`,"data-alerts":!0,children:[(0,J.jsx)(c,{title:`Alerts`,description:`Evaluate service rules and deliver notifications when they fire.`,meta:(0,J.jsx)(le,{updatedAt:d.dataUpdatedAt}),actions:n&&(0,J.jsx)(j,{ref:k,leftSection:(0,J.jsx)(ae,{size:14}),onClick:e=>{O.remember(e.currentTarget),h({})},children:`New rule`})}),(0,J.jsxs)(N,{gap:`xs`,children:[(0,J.jsx)(r,{order:2,fz:18,children:`Rules`}),u.data&&u.data.length>0&&(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:Oe}),u.isLoading?(0,J.jsx)(f,{state:`loading`,loadingLabel:`Loading alert rules`,skeleton:(0,J.jsx)(oe,{shape:`table`,columns:7,rows:4})}):u.error?(0,J.jsx)(f,{state:`error`,error:{message:`Rules could not be loaded: ${u.error.message}`,onRetry:()=>void u.refetch()}}):u.data?.length===0?(0,J.jsx)(f,{state:`empty`,empty:{title:`No rules yet`,description:n?`Create a rule to get notified when a service misbehaves.`:`An operator or admin can create rules.`,action:n&&(0,J.jsx)(j,{onClick:e=>{O.remember(e.currentTarget),h({})},children:`New rule`})}}):(0,J.jsx)(U.ScrollContainer,{minWidth:760,children:(0,J.jsxs)(U,{verticalSpacing:`sm`,children:[(0,J.jsx)(U.Thead,{children:(0,J.jsxs)(U.Tr,{children:[(0,J.jsx)(U.Th,{children:`Rule`}),(0,J.jsx)(U.Th,{children:`Service`}),(0,J.jsx)(U.Th,{children:`Expression`}),(0,J.jsx)(U.Th,{children:`State`}),(0,J.jsx)(U.Th,{children:`Last fired`}),(0,J.jsx)(U.Th,{children:`Enabled`}),(0,J.jsx)(U.Th,{w:48,children:(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:`Actions`})})]})}),(0,J.jsx)(U.Tbody,{children:u.data?.map(t=>{let r=Y(t);return(0,J.jsxs)(U.Tr,{children:[(0,J.jsxs)(U.Td,{children:[(0,J.jsx)(M,{size:`sm`,fw:500,children:t.name}),t.description&&(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:t.description}),t.email_status&&ke[t.email_status]&&(0,J.jsxs)(D,{gap:6,mt:4,role:`status`,children:[(0,J.jsx)(P,{tone:ke[t.email_status].tone,children:ke[t.email_status].label}),t.email_status_detail&&(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:t.email_status_detail})]})]}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,children:t.service||`All services`})}),(0,J.jsxs)(U.Td,{children:[(0,J.jsx)(M,{size:`xs`,ff:`monospace`,children:t.expression}),(0,J.jsx)(j,{size:`compact-xs`,variant:`subtle`,px:0,onClick:()=>e(De(t)),children:`Open in Explore`})]}),(0,J.jsx)(U.Td,{children:t.enabled?d.isSuccess?r.length>0?(0,J.jsx)(D,{gap:4,children:r.map(e=>(0,J.jsxs)(P,{tone:Te[e.state]??`neutral`,children:[e.state.charAt(0).toUpperCase()+e.state.slice(1),` · `,e.service]},e.id))}):(0,J.jsx)(P,{tone:`success`,children:`Ok`}):(0,J.jsx)(P,{tone:`neutral`,children:`Unknown`}):(0,J.jsx)(P,{tone:`neutral`,children:`Disabled`})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:d.isSuccess?$(ue(t)):`—`})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(B,{"aria-label":`Enable ${t.name}`,checked:t.enabled,disabled:!n||R.isPending,onChange:()=>R.mutate(t)})}),(0,J.jsx)(U.Td,{children:n&&(0,J.jsxs)(C,{position:`bottom-end`,children:[(0,J.jsx)(C.Target,{children:(0,J.jsx)(ie,{ref:e=>{e?A.current.set(t.id,e):A.current.delete(t.id)},variant:`subtle`,color:`gray`,"aria-label":`${t.name} actions`,children:(0,J.jsx)(a,{size:18})})}),(0,J.jsxs)(C.Dropdown,{children:[(0,J.jsx)(C.Item,{onClick:()=>{F(t),h({rule:t})},children:`Edit`}),(0,J.jsx)(C.Item,{onClick:()=>{F(t),G(t)},children:`Test against current data`}),(0,J.jsx)(C.Item,{color:`bad`,onClick:()=>{F(t),y(t)},children:`Delete`})]})]})})]},t.id)})})]})}),R.error&&(0,J.jsx)(i,{tone:`danger`,children:R.error.message})]}),(0,J.jsxs)(N,{gap:`xs`,children:[(0,J.jsx)(r,{order:2,fz:18,children:`History`}),d.isLoading?(0,J.jsx)(f,{state:`loading`,loadingLabel:`Loading alert history`,skeleton:(0,J.jsx)(oe,{shape:`table`,columns:7,rows:4})}):d.error?(0,J.jsxs)(i,{tone:`danger`,children:[`Alert history could not be loaded: `,d.error.message]}):X.length===0?(0,J.jsx)(f,{state:`empty`,empty:{title:`Nothing has fired yet`,description:`Alerts appear here when a rule fires.`}}):(0,J.jsx)(U.ScrollContainer,{minWidth:760,scrollAreaProps:{viewportProps:{tabIndex:0,role:`region`,"aria-label":`Alert history`}},children:(0,J.jsxs)(U,{verticalSpacing:`xs`,children:[(0,J.jsx)(U.Thead,{children:(0,J.jsxs)(U.Tr,{children:[(0,J.jsx)(U.Th,{children:`State`}),(0,J.jsx)(U.Th,{children:`Rule`}),(0,J.jsx)(U.Th,{children:`Service`}),(0,J.jsx)(U.Th,{ta:`right`,children:`Value`}),(0,J.jsx)(U.Th,{children:`Fired`}),(0,J.jsx)(U.Th,{children:`Resolved`}),(0,J.jsx)(U.Th,{children:`Delivery`})]})}),(0,J.jsx)(U.Tbody,{children:X.map(e=>(0,J.jsxs)(U.Tr,{children:[(0,J.jsx)(U.Td,{children:(0,J.jsx)(P,{tone:Te[e.state]??`neutral`,children:e.state.charAt(0).toUpperCase()+e.state.slice(1)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,children:K.get(e.rule_id)?.name??e.rule_id})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,children:e.service})}),(0,J.jsx)(U.Td,{ta:`right`,children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:e.value===void 0?`—`:pe(Z(K.get(e.rule_id)?.expression??``)[0],e.value)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:$(e.fired_at)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`sm`,ff:`monospace`,children:$(e.resolved_at)})}),(0,J.jsx)(U.Td,{children:(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:e.last_delivery_status?`${e.last_delivery_status} · ${$(e.last_delivery_at)}`:`—`})})]},e.id))})]})})]}),m&&(0,J.jsx)(we,{rule:m.rule,onClose:I,onSave:V}),g&&(0,J.jsxs)(ne,{opened:!0,onClose:L,title:`Delete ${g.name}?`,confirmLabel:`Delete rule`,tone:`danger`,pending:z.isPending?`confirm`:null,error:z.error?.message,onConfirm:()=>z.mutate(g),children:[`The rule `,(0,J.jsx)(M,{span:!0,ff:`monospace`,children:g.name}),` and its alert history are removed. This cannot be undone.`]}),T&&(0,J.jsx)(S,{opened:!0,onClose:ce,closeButtonProps:{"aria-label":`Close test`},title:`Test · ${T.rule.name}`,children:T.error?(0,J.jsx)(i,{tone:`danger`,children:T.error}):T.result?T.result.results?.length?(0,J.jsx)(N,{gap:`xs`,children:T.result.results.map(e=>(0,J.jsxs)(N,{gap:2,children:[(0,J.jsxs)(D,{justify:`space-between`,children:[(0,J.jsx)(M,{size:`sm`,children:e.service}),e.error?(0,J.jsx)(M,{size:`xs`,c:`bad`,children:e.error}):e.no_data?(0,J.jsx)(P,{tone:`warning`,children:`No recent data`}):(0,J.jsx)(P,{tone:e.triggered?`danger`:`success`,children:e.triggered?`Would fire`:`Quiet`})]}),e.no_data?(0,J.jsx)(M,{size:`xs`,c:`dimmed`,children:`This service has sent no telemetry recently. Check its name.`}):(0,J.jsx)(M,{size:`xs`,c:`dimmed`,ff:`monospace`,children:Z(T.rule.expression).filter(t=>typeof e.env?.[t]==`number`).map(t=>`${t} ${pe(t,e.env[t])}`).join(` · `)})]},e.service))}):(0,J.jsx)(f,{state:`empty`,empty:{title:`No services have data in the current window.`}}):(0,J.jsx)(f,{state:`loading`,loadingLabel:`Testing the rule`,rows:3})})]})}function je(e){let{id:t,created_at:n,updated_at:r,email_status:i,email_status_detail:ee,email_status_at:a,...o}=e;return o}function Me(){let e=F();return(0,J.jsx)(Ae,{onExplore:t=>void e({to:`/explore`,search:E({q:t,range:`1h`,tab:`query`})})})}export{Me as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat-DPOCuMln.js b/internal/ui/dist/assets/chat-CAv_AvQL.js similarity index 98% rename from internal/ui/dist/assets/chat-DPOCuMln.js rename to internal/ui/dist/assets/chat-CAv_AvQL.js index a9194c97..433713b3 100644 --- a/internal/ui/dist/assets/chat-DPOCuMln.js +++ b/internal/ui/dist/assets/chat-CAv_AvQL.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BWngsxVi.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/index-CL2Ww4um.js","assets/index-BKxggnz9.css"])))=>i.map(i=>d[i]); -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Ar as t,Dt as n,F as r,Gn as i,Gt as a,Jt as o,Kt as s,M as c,Mr as l,Qr as u,Sr as d,St as f,Tr as p,Ut as m,Wt as h,Xt as g,Yn as _,_r as v,_t as y,b,bt as x,ci as ee,dr as S,gi as C,gt as te,ht as ne,in as w,j as T,mi as E,mt as D,nr as O,or as k,pr as A,qn as j,qt as M,vt as N,wr as P,xt as F,yr as I,yt as L,zr as re}from"./index-CL2Ww4um.js";import{t as R}from"./Table-B_pVYmc3.js";import{t as ie}from"./Textarea-DySd6X1B.js";import{n as ae,r as z,t as oe}from"./lib-DeYqVmar.js";import{t as se}from"./dashboard-change-chips-BnO9d30A.js";var B={root:`m_7485cace`},V=E(),ce={strategy:`block`},H=re((e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:u(t,`container-size`)}})),U=p(e=>{let n=l(`Container`,ce,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fluid:u,mod:d,attributes:f,strategy:p,...m}=n,h=t({name:`Container`,classes:B,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,vars:c,varsResolver:H});return(0,V.jsx)(P,{mod:[{fluid:u,strategy:p},d],...h(`root`),...m})});U.classes=B,U.varsResolver=H,U.displayName=`@mantine/core/Container`;var W={root:`m_d08caa0`},G=p(e=>{let n=l(`Typography`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,attributes:c,...u}=n,d=t({name:`Typography`,classes:W,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:c});return(0,V.jsx)(P,{...d(`root`),...u})});G.classes=W,G.displayName=`@mantine/core/Typography`;var K=e(C(),1),le=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,144l-72,72L56,144Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z`}))]]),ue=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),de=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),fe=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),q=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:le}));q.displayName=`ArrowDownIcon`;var pe=q,J=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:ue}));J.displayName=`CaretRightIcon`;var Y=J,X=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:de}));X.displayName=`PaperPlaneTiltIcon`;var me=X,Z=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:fe}));Z.displayName=`StopIcon`;var he=Z;function ge(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function _e(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`,`invalid`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var ve=new WeakSet;function ye(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(ve.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://pitot/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{_e(t.tool_result)}catch{return}return ve.add(t),t}}var be=16,xe=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]);function Se(e){let t=(0,K.useRef)(null),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(e),o=(0,K.useRef)(()=>{}),s=(0,K.useRef)(null),c=(0,K.useRef)(new Set),l=(0,K.useRef)(null),u=(0,K.useRef)(null),[d,f]=(0,K.useState)(!1),p=(0,K.useCallback)(()=>{let e=t.current,n=r.current?.lastElementChild,i=!e||!n||n.getBoundingClientRect().bottom>e.getBoundingClientRect().top+e.clientTop+e.clientHeight+1;f(!!e&&i&&e.scrollHeight-e.clientHeight-e.scrollTop>1)},[]),m=(0,K.useCallback)(()=>{let e=t.current;if(!e)return;let n=e.getBoundingClientRect().top+e.clientTop,r=[...e.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);l.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),h=(0,K.useCallback)((e,t)=>{e.scrollTop=t,u.current=e.scrollTop},[]),g=(0,K.useCallback)(()=>{let e=t.current;if(e){if(r.current){let t=n.current&&parseFloat(getComputedStyle(n.current).paddingBottom)||0;r.current.style.minHeight=`${Math.max(0,e.clientHeight-be-t)}px`,i.current&&h(e,e.scrollTop+r.current.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop-be)}if(!i.current){let t=l.current;t?.node.isConnected&&h(e,e.scrollTop+t.node.getBoundingClientRect().top-t.top),m()}p()}},[m,h,p]),_=(0,K.useCallback)(()=>{let e=t.current,i=n.current;if(!e||!i){s.current?.disconnect(),s.current=null,c.current.clear();return}s.current??=new ResizeObserver(g);let a=new Set([e,i,...i.querySelectorAll(`[data-chat-anchor]`)]);r.current&&a.add(r.current);for(let e of c.current)a.has(e)||s.current.unobserve(e);for(let e of a)c.current.has(e)||s.current.observe(e);c.current=a},[g]),v=(0,K.useCallback)(e=>{if(o.current(),t.current=e,u.current=null,l.current=null,i.current=!0,_(),!e)return;let n=!1,r=()=>{i.current=!1,m()},a=e=>{let t=e.target;!e.defaultPrevented&&xe.has(e.key)&&(t instanceof HTMLElement&&(t.closest(`input, textarea, select, [contenteditable]`)||(e.key===` `?t.closest(`button`):t.closest(`[role=slider]`)))||r())},s=()=>{n=!0},c=()=>{n=!1},d=()=>{n&&e.scrollTop!==u.current&&r(),i.current||m(),p()};e.addEventListener(`scroll`,d,{passive:!0}),e.addEventListener(`wheel`,r,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!0}),e.addEventListener(`keydown`,a),e.addEventListener(`pointerdown`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c),o.current=()=>{e.removeEventListener(`scroll`,d),e.removeEventListener(`wheel`,r),e.removeEventListener(`touchmove`,r),e.removeEventListener(`keydown`,a),e.removeEventListener(`pointerdown`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),o.current=()=>{}},g()},[g,m,_,p]),y=(0,K.useCallback)(e=>{n.current=e,_()},[_]),b=(0,K.useCallback)(e=>{r.current?.style.removeProperty(`min-height`),r.current=e,_()},[_]);return(0,K.useLayoutEffect)(()=>{a.current!==e&&(a.current=e,i.current=!0,l.current=null),_(),g()}),{scrollRef:v,contentRef:y,turnRef:b,showJump:d,jumpToLatest:(0,K.useCallback)(()=>{let e=t.current;e&&(e.focus({preventScroll:!0}),i.current=!1,h(e,e.scrollHeight),m(),p())},[m,h,p])}}function Ce(e=1500){let[t,n]=(0,K.useState)(`idle`),r=(0,K.useRef)(null);(0,K.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var Q=e=>e!==`invalid`&&e!==`not_run`;function we({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:i=!1,initialExpanded:a=!1}){let[o,c]=(0,K.useState)(a),l=(0,K.useId)(),u=e.saved,f=u?.receipt.save_check,p=t=>Object.hasOwn(e.panel_titles,t)?e.panel_titles[t]:t,m=(f?.panels??e.panels).filter(e=>e.status===`invalid`).length,h=[...new Set([...e.explanations.filter(t=>!e.problems.some(e=>t.startsWith(`${p(e.panel_id)}:`))),...e.problems.map(e=>`${p(e.panel_id)}: ${e.message}`)])],g=Object.values(e.stages).filter(e=>e.state===`complete`).length,_=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:r(e.panel_count,`panel`),f?.checked?`Checked in ${T(f.elapsed_ms)}`:void 0,u?`Saved v${u.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,b=[...u?y(u.receipt):[],...new Map(e.corrections.map(e=>[e.panel_id,`Fixed ${e.title}`])).values()];return(0,V.jsx)(v,{"data-build-receipt":e.turn_id,"data-dashboard-result":u?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,V.jsxs)(j,{gap:6,children:[(0,V.jsxs)(S,{gap:`xs`,justify:`space-between`,children:[(0,V.jsxs)(k,{component:`div`,size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[_,m>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(M,{tone:`danger`,children:r(m,`invalid panel`)})]}),(0,V.jsxs)(k,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,r(g,`stage`),` complete`]})]}),(0,V.jsxs)(O,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":o,"aria-controls":l,onClick:()=>c(e=>!e),children:[`Details`,b.length>4?` (+${b.length-4})`:``]})]}),t&&i&&(0,V.jsx)(`div`,{"data-build-running":!0,children:(0,V.jsx)(s,{state:`loading`,loadingLabel:n||`Analyzing your system`,rows:0})}),(0,V.jsx)(se,{labels:b.slice(0,4)}),h.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,V.jsx)(k,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),u&&(0,V.jsx)(O,{renderRoot:e=>(0,V.jsx)(ee,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:u.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,V.jsx)(d,{expanded:o,id:l,children:(0,V.jsxs)(j,{gap:4,children:[u&&(0,V.jsxs)(k,{size:`xs`,children:[u.label,` `,u.name,` · opens the current dashboard`]}),(0,V.jsx)(k,{size:`xs`,fw:600,children:`Build stages`}),Object.entries(e.stages).map(([n,r])=>(0,V.jsxs)(k,{component:`div`,size:`xs`,children:[(0,V.jsxs)(M,{tone:r.state===`failed`?`danger`:r.state===`complete`?`success`:r.state===`interrupted`?`warning`:`neutral`,children:[L[n],`: `,t&&r.state===`incomplete`?`in progress`:r.state]}),r.elapsed_ms!==void 0&&(r.state===`complete`||n===`preview`&&e.panels.some(e=>Q(e.status)))?` · ${T(r.elapsed_ms)}`:``]},n)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,V.jsxs)(k,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,V.jsxs)(k,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,V.jsxs)(k,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),(0,V.jsx)(k,{size:`xs`,fw:600,children:`Panel preview`}),e.panels.map(e=>(0,V.jsxs)(k,{component:`div`,size:`xs`,children:[`Preview · `,p(e.id),`: `,(0,V.jsx)(M,{tone:e.status===`ok`?`success`:e.status===`empty`||e.status===`not_run`?`neutral`:`danger`,children:e.status===`ok`?`Ok`:e.status.charAt(0).toUpperCase()+e.status.slice(1)}),Q(e.status)&&e.elapsed_ms!==void 0?` · ${T(e.elapsed_ms)}`:``]},e.id)),f&&(0,V.jsx)(k,{size:`xs`,fw:600,children:`Save verification`}),f&&(0,V.jsxs)(k,{size:`xs`,children:[`Save check: `,f.checked?`checked`:`incomplete`,f.checked?` · ${T(f.elapsed_ms)}`:``]}),f?.panels.map(e=>(0,V.jsxs)(k,{component:`div`,size:`xs`,children:[`Save · `,p(e.id),`: `,(0,V.jsx)(M,{tone:e.status===`ok`?`success`:e.status===`empty`||e.status===`not_run`?`neutral`:`danger`,children:e.status===`ok`?`Ok`:e.status.charAt(0).toUpperCase()+e.status.slice(1)}),Q(e.status)&&` · ${r(e.rows??0,`row`)}`,Q(e.status)&&e.elapsed_ms!==void 0?` · ${T(e.elapsed_ms)}`:``]},e.id)),b.slice(4).map((e,t)=>(0,V.jsx)(k,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,V.jsxs)(k,{size:`xs`,children:[`Fixed `,e.title,`: `,e.message]},t))]})})]})})}var Te=(0,K.lazy)(()=>b(()=>import(`./mcp-app-frame-BWngsxVi.js`),__vite__mapDeps([0,1,2,3]))),Ee=/^[-+−]?\d[\d,.]*(?:%|\s?(?:ms|s|K|M))?$/,De=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}),Oe=e=>e.tool_result.view.kind===`preset`;function ke(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Oe(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Oe(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=ye(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function Ae(e,t){return Array.isArray(e)?e.flatMap(e=>{if(!f(e)||typeof e.message!=`string`)return[];let n=typeof e.path==`string`?/^panels\[(\d+)\](?:\.|$)/.exec(e.path)?.[1]:void 0,r=n===void 0?void 0:t?.[Number(n)];return[r&&!e.message.startsWith(r)?`${r}: ${e.message}`:e.message]}):[]}function je(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[]){let t=[`create_dashboard`,`replace_dashboard`].includes(e.function.name)?x(e.function.arguments)?.dashboard:void 0,r=f(t)&&Array.isArray(t.panels)?t.panels.map(e=>f(e)&&typeof e.title==`string`?e.title:``):void 0;n.set(e.id,{assistant:i,name:e.function.name,titles:r})}}if(a.role===`tool`){let e=x(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&F.has(o.name)&&N(a))continue;let s=f(e?.error)?e?.error:void 0;if(s?.code===`no_data`||s?.code===`unknown_service`)continue;let c=o?.assistant??i,l=r.get(c)??a.id;r.set(c,l);let u=t.get(l)??[],d=typeof s?.message==`string`?s.message:typeof a.error==`string`&&a.error?a.error:`Could not complete this step. Try again.`,p=[`create_dashboard`,`edit_dashboard`,`replace_dashboard`].includes(o?.name??``)&&(s?.code===`invalid_spec`||s?.code===`dashboard_version_conflict`);u.push({name:D(o?.name??``),message:d,details:p?Ae(e?.problems,o?.titles):[],readOnly:s?.code===`answer_only`,rejected:p}),t.set(l,u)}}return t}function Me({failures:e}){let[t,n]=(0,K.useState)({rejected:!1,failed:!1}),i=e.filter(e=>e.rejected),a=e.filter(e=>!e.readOnly&&!e.rejected),o=[{key:`rejected`,items:i,label:`${r(i.length,`draft`)} rejected`},{key:`failed`,items:a,label:`${r(a.length,`step`)} failed`}];return(0,V.jsxs)(P,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,V.jsx)(k,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),o.map(({key:e,items:r,label:i})=>r.length>0&&(0,V.jsxs)(P,{children:[(0,V.jsxs)(I,{className:`chat-app-toggle`,"aria-expanded":t[e],onClick:()=>n(t=>({...t,[e]:!t[e]})),style:{color:`var(--mantine-color-dimmed)`},children:[(0,V.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t[e]?(0,V.jsx)(z,{size:14}):(0,V.jsx)(Y,{size:14})}),(0,V.jsx)(`span`,{className:`chat-app-summary`,children:i})]}),t[e]&&(0,V.jsx)(j,{gap:`xs`,pl:`md`,children:r.flatMap((e,t)=>(e.details.length?e.details:[`${e.name}: ${e.message}`]).map((e,n)=>(0,V.jsx)(k,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e},`${t}-${n}`)))})]},e))]})}function Ne({view:e}){let[t,n]=(0,K.useState)(e.expanded);(0,K.useEffect)(()=>n(e.expanded),[e.expanded]);let i=e.content.tool_result,a=ge(i),o=[...new Set(i.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),c=i.results.reduce((e,t)=>e+(t.frame?.rows??0),0),l=new Map;for(let e of i.results)e.status!==`ok`&&l.set(e.status,(l.get(e.status)??0)+1);let u=i.dashboard.panels.length>1?Array.from(l,([e,t])=>`${t} ${e}`).join(` · `):l.size?[...l.keys()].join(`, `):r(c,`row`);return(0,V.jsxs)(v,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`md`,style:{overflow:`hidden`},children:[(0,V.jsxs)(I,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,V.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,V.jsx)(z,{size:14}):(0,V.jsx)(Y,{size:14})}),(0,V.jsx)(`span`,{className:`chat-app-summary`,children:[a,o,u].filter(Boolean).join(` · `)})]}),t&&(0,V.jsx)(K.Suspense,{fallback:(0,V.jsx)(s,{state:`loading`,loadingLabel:`Preparing view…`}),children:(0,V.jsx)(Te,{content:e.content})})]})}var Pe=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Fe(){let{agentAvailable:e,messages:t,messageTimes:n,ready:r,running:i,activity:c,stopped:l,error:u,threadMissing:d,send:f,retry:p,reloadThread:m,newThread:h}=te(),g=ne(t),y=t.filter(e=>e.role===`user`).at(-1)?.id,{scrollRef:b,contentRef:x,turnRef:ee,showJump:C,jumpToLatest:w}=Se(y);if(!e)return(0,V.jsx)(U,{size:`sm`,py:96,children:(0,V.jsx)(v,{withBorder:!0,radius:`md`,p:{base:`xl`,sm:40},children:(0,V.jsxs)(j,{gap:`md`,children:[(0,V.jsx)(k,{fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,V.jsx)(o,{title:`Chat`,description:`Chat is not configured`}),(0,V.jsx)(k,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,V.jsx)(O,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let T=ke(t),E=je(t),D=t.filter(e=>T.duplicates.has(e.id)?!1:e.role===`tool`?E.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),M=t.findIndex(e=>e.id===y),N=t.slice(M+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=t.slice(M+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=[];for(let e of D)(e.role===`user`||I.length===0)&&I.push({id:e.id,messages:[]}),I.at(-1).messages.push(e);I.length===0&&I.push({id:`draft`,messages:[]});let L=e=>E.has(e.id)?(0,V.jsx)(Me,{failures:E.get(e.id)},e.id):(0,V.jsxs)(P,{children:[(0,V.jsx)(ze,{message:e,time:n[e.id],appView:T.views.get(e.id)}),g.has(e.id)&&(0,V.jsx)(P,{mt:`sm`,children:(0,V.jsx)(we,{receipt:g.get(e.id),running:i&&e.id===y,awaitingAnswer:!N,activity:c})})]},e.id);return(0,V.jsxs)(P,{className:`chat-pane`,children:[(0,V.jsx)(U,{size:880,w:`100%`,px:{base:`md`,sm:`xl`},py:`md`,children:(0,V.jsx)(o,{title:`Chat`,description:`Investigate your telemetry with Pitot.`})}),(0,V.jsxs)(P,{className:`chat-viewport`,children:[(0,V.jsx)(P,{className:`chat-scroll`,ref:b,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,V.jsxs)(U,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:x,children:[d&&(0,V.jsx)(a,{tone:`warning`,title:`This chat no longer exists`,children:(0,V.jsxs)(S,{justify:`space-between`,children:[(0,V.jsx)(k,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,V.jsx)(O,{size:`compact-sm`,variant:`light`,onClick:h,children:`New chat`})]})}),!d&&!r&&u&&(0,V.jsx)(Ie,{message:u,onRetry:m,onNewThread:h}),!d&&!r&&!u&&(0,V.jsx)(s,{state:`loading`,loadingLabel:`Loading chat`,rows:5}),!d&&r&&(0,V.jsxs)(V.Fragment,{children:[D.length===0&&(0,V.jsx)(Re,{onSelect:f}),(0,V.jsx)(j,{gap:`lg`,children:I.map((e,t)=>(0,V.jsxs)(j,{gap:`lg`,ref:e.id===y?ee:void 0,"data-chat-turn":e.id===y?y:void 0,children:[e.messages.filter(e=>e.id!==F?.id).map(L),t===I.length-1&&(0,V.jsxs)(V.Fragment,{children:[F&&(0,V.jsx)(P,{"data-answer-position":!0,children:(0,V.jsx)(ze,{message:F,time:n[F.id]})},`answer-${y??`draft`}`),i&&!N&&!g.has(y??``)&&(0,V.jsx)(s,{state:`loading`,loadingLabel:c||`Analyzing your system`,rows:0}),l&&(0,V.jsx)(k,{c:`dimmed`,size:`sm`,children:`Stopped`}),u&&(0,V.jsx)(Ie,{message:u,onRetry:p})]})]},e.id))})]})]})}),C&&(0,V.jsx)(_,{label:`Jump to latest`,children:(0,V.jsx)(A,{className:`chat-jump`,variant:`default`,size:36,"aria-label":`Jump to latest`,onClick:w,children:(0,V.jsx)(pe,{size:18,"aria-hidden":`true`})})})]}),!d&&(0,V.jsx)(Le,{})]})}function Ie({message:e,onRetry:t,onNewThread:n}){return(0,V.jsx)(a,{tone:`danger`,title:`Something went wrong`,children:(0,V.jsxs)(S,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,V.jsx)(k,{size:`sm`,children:e}),(0,V.jsxs)(S,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,V.jsx)(O,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,V.jsx)(O,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Le(){let{input:e,setInput:t,inputRef:n,submit:r,send:i,stop:a,ready:o,running:s}=te();return(0,V.jsx)(P,{className:`chat-composer`,children:(0,V.jsxs)(U,{size:880,px:{base:`md`,sm:`xl`},children:[(0,V.jsx)(v,{component:`form`,onSubmit:r,className:`chat-composer-field`,style:{borderColor:`var(--composer-border, var(--labstack-control-border))`},withBorder:!0,radius:`sm`,py:6,pl:`lg`,pr:6,children:(0,V.jsxs)(S,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,V.jsx)(ie,{ref:n,"aria-label":`Message Pitot`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),i(e))},placeholder:s?`Pitot is working…`:`Ask about health, errors, or latency…`,disabled:!o,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),s?(0,V.jsx)(_,{label:`Stop`,children:(0,V.jsx)(A,{type:`button`,variant:`default`,size:40,"aria-label":`Stop`,onClick:a,children:(0,V.jsx)(he,{size:16,weight:`fill`})})}):(0,V.jsx)(A,{type:`submit`,variant:`filled`,size:40,disabled:!e.trim()||!o,"aria-label":`Send message`,children:(0,V.jsx)(me,{size:17,weight:`fill`})})]})}),(0,V.jsx)(k,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function Re({onSelect:e}){return(0,V.jsxs)(j,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,V.jsx)(n,{size:`large`}),(0,V.jsx)(i,{order:2,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,V.jsx)(S,{justify:`center`,gap:`xs`,mt:`xs`,maw:g.prose,children:Pe.map(t=>(0,V.jsx)(O,{variant:`default`,size:`sm`,onClick:()=>void e(t),children:t},t))})]})}function ze({message:e,time:t,appView:n}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,V.jsx)(k,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,V.jsx)(P,{"data-chat-anchor":!0,children:(0,V.jsx)(a,{tone:`danger`,title:`Something went wrong`,children:e.content.message})}):e.activityType===`mcp-app`?n?(0,V.jsx)(Ne,{view:n}):(0,V.jsx)(P,{"data-chat-anchor":!0,children:(0,V.jsx)(a,{tone:`danger`,children:`This view could not be loaded. Please try again.`})}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let r=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!r&&e.role===`assistant`)return null;let i=e.role===`user`,o=t?De.format(new Date(t)):``;return(0,V.jsxs)(P,{className:`chat-message`,"data-chat-anchor":!0,"data-role":i?`user`:`assistant`,children:[i?(0,V.jsx)(v,{radius:`md`,px:`md`,py:`sm`,bg:`var(--labstack-inset)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,V.jsx)(k,{style:{whiteSpace:`pre-wrap`},children:r})}):(0,V.jsx)(G,{className:`chat-markdown`,children:(0,V.jsx)(ae,{remarkPlugins:[oe,Ve],components:He,children:r})}),(o||!i)&&(0,V.jsxs)(S,{className:`chat-message-meta`,gap:6,justify:i?`flex-end`:`flex-start`,mt:4,h:24,children:[o&&t&&(0,V.jsx)(k,{c:`dimmed`,size:`xs`,title:c(t),children:o}),!i&&(0,V.jsx)(Be,{text:r,label:`Copy message`})]})]})}function Be({text:e,label:t}){let{state:n,copy:r}=Ce();return(0,V.jsx)(_,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,V.jsx)(A,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,V.jsx)(h,{size:13,weight:`bold`}):(0,V.jsx)(m,{size:13})})})}function Ve(){return e=>{let t=[],n=e=>{if(e.type===`table`&&e.children){let t=e=>e.value??e.children?.map(t).join(``)??``,n=e.children.slice(1);e.align=(e.children[0]?.children??[]).map((r,i)=>n.length&&n.every(e=>Ee.test(t(e.children?.[i]??{type:`text`}).trim()))?`right`:e.align?.[i]??null)}if(e.type===`heading`&&e.depth!==void 0){let n=e.depth;for(;t.length&&t.at(-1)>=n;)t.pop();t.push(n),e.depth=Math.min(6,t.length+1)}e.children?.forEach(n)};n(e)}}var He={table:({children:e})=>(0,V.jsx)(P,{className:`chat-table`,children:(0,V.jsx)(R,{stickyHeader:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,V.jsx)(R.Thead,{children:e}),tbody:({children:e})=>(0,V.jsx)(R.Tbody,{children:e}),tr:({children:e})=>(0,V.jsx)(R.Tr,{children:e}),th:({children:e,style:t})=>(0,V.jsx)(R.Th,{style:t,children:e}),td:({children:e,style:t})=>(0,V.jsx)(R.Td,{style:t,ta:typeof e==`string`&&Ee.test(e.trim())?`right`:void 0,ff:typeof e==`string`&&/^[-+−]?\d/.test(e.trim())?`monospace`:void 0,children:e}),pre:({children:e})=>(0,V.jsx)(Ue,{children:e}),a:({href:e,children:t})=>(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Ue({children:e}){let t=$(e);return(0,V.jsxs)(P,{className:`chat-code`,pos:`relative`,children:[(0,V.jsx)(P,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,V.jsx)(Be,{text:t,label:`Copy code`})}),(0,V.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{ye as n,Fe as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BzMVY4oB.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/index-CRKDYJaJ.js","assets/index-BKxggnz9.css"])))=>i.map(i=>d[i]); +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Ar as t,Dt as n,F as r,Gn as i,Gt as a,Jt as o,Kt as s,M as c,Mr as l,Qr as u,Sr as d,St as f,Tr as p,Ut as m,Wt as h,Xt as g,Yn as _,_r as v,_t as y,b,bt as x,ci as ee,dr as S,gi as C,gt as te,ht as ne,in as w,j as T,mi as E,mt as D,nr as O,or as k,pr as A,qn as j,qt as M,vt as N,wr as P,xt as F,yr as I,yt as L,zr as re}from"./index-CRKDYJaJ.js";import{t as R}from"./Table-DKSK2CAk.js";import{t as ie}from"./Textarea-CKEKXEtW.js";import{n as ae,r as z,t as oe}from"./lib-DSpv4cMb.js";import{t as se}from"./dashboard-change-chips-CsKsdB0I.js";var B={root:`m_7485cace`},V=E(),ce={strategy:`block`},H=re((e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:u(t,`container-size`)}})),U=p(e=>{let n=l(`Container`,ce,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fluid:u,mod:d,attributes:f,strategy:p,...m}=n,h=t({name:`Container`,classes:B,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,vars:c,varsResolver:H});return(0,V.jsx)(P,{mod:[{fluid:u,strategy:p},d],...h(`root`),...m})});U.classes=B,U.varsResolver=H,U.displayName=`@mantine/core/Container`;var W={root:`m_d08caa0`},G=p(e=>{let n=l(`Typography`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,attributes:c,...u}=n,d=t({name:`Typography`,classes:W,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:c});return(0,V.jsx)(P,{...d(`root`),...u})});G.classes=W,G.displayName=`@mantine/core/Typography`;var K=e(C(),1),le=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,144l-72,72L56,144Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z`}))]]),ue=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),de=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),fe=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),q=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:le}));q.displayName=`ArrowDownIcon`;var pe=q,J=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:ue}));J.displayName=`CaretRightIcon`;var Y=J,X=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:de}));X.displayName=`PaperPlaneTiltIcon`;var me=X,Z=K.forwardRef((e,t)=>K.createElement(w,{ref:t,...e,weights:fe}));Z.displayName=`StopIcon`;var he=Z;function ge(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function _e(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`,`invalid`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var ve=new WeakSet;function ye(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(ve.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://pitot/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{_e(t.tool_result)}catch{return}return ve.add(t),t}}var be=16,xe=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]);function Se(e){let t=(0,K.useRef)(null),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(e),o=(0,K.useRef)(()=>{}),s=(0,K.useRef)(null),c=(0,K.useRef)(new Set),l=(0,K.useRef)(null),u=(0,K.useRef)(null),[d,f]=(0,K.useState)(!1),p=(0,K.useCallback)(()=>{let e=t.current,n=r.current?.lastElementChild,i=!e||!n||n.getBoundingClientRect().bottom>e.getBoundingClientRect().top+e.clientTop+e.clientHeight+1;f(!!e&&i&&e.scrollHeight-e.clientHeight-e.scrollTop>1)},[]),m=(0,K.useCallback)(()=>{let e=t.current;if(!e)return;let n=e.getBoundingClientRect().top+e.clientTop,r=[...e.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);l.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),h=(0,K.useCallback)((e,t)=>{e.scrollTop=t,u.current=e.scrollTop},[]),g=(0,K.useCallback)(()=>{let e=t.current;if(e){if(r.current){let t=n.current&&parseFloat(getComputedStyle(n.current).paddingBottom)||0;r.current.style.minHeight=`${Math.max(0,e.clientHeight-be-t)}px`,i.current&&h(e,e.scrollTop+r.current.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop-be)}if(!i.current){let t=l.current;t?.node.isConnected&&h(e,e.scrollTop+t.node.getBoundingClientRect().top-t.top),m()}p()}},[m,h,p]),_=(0,K.useCallback)(()=>{let e=t.current,i=n.current;if(!e||!i){s.current?.disconnect(),s.current=null,c.current.clear();return}s.current??=new ResizeObserver(g);let a=new Set([e,i,...i.querySelectorAll(`[data-chat-anchor]`)]);r.current&&a.add(r.current);for(let e of c.current)a.has(e)||s.current.unobserve(e);for(let e of a)c.current.has(e)||s.current.observe(e);c.current=a},[g]),v=(0,K.useCallback)(e=>{if(o.current(),t.current=e,u.current=null,l.current=null,i.current=!0,_(),!e)return;let n=!1,r=()=>{i.current=!1,m()},a=e=>{let t=e.target;!e.defaultPrevented&&xe.has(e.key)&&(t instanceof HTMLElement&&(t.closest(`input, textarea, select, [contenteditable]`)||(e.key===` `?t.closest(`button`):t.closest(`[role=slider]`)))||r())},s=()=>{n=!0},c=()=>{n=!1},d=()=>{n&&e.scrollTop!==u.current&&r(),i.current||m(),p()};e.addEventListener(`scroll`,d,{passive:!0}),e.addEventListener(`wheel`,r,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!0}),e.addEventListener(`keydown`,a),e.addEventListener(`pointerdown`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c),o.current=()=>{e.removeEventListener(`scroll`,d),e.removeEventListener(`wheel`,r),e.removeEventListener(`touchmove`,r),e.removeEventListener(`keydown`,a),e.removeEventListener(`pointerdown`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),o.current=()=>{}},g()},[g,m,_,p]),y=(0,K.useCallback)(e=>{n.current=e,_()},[_]),b=(0,K.useCallback)(e=>{r.current?.style.removeProperty(`min-height`),r.current=e,_()},[_]);return(0,K.useLayoutEffect)(()=>{a.current!==e&&(a.current=e,i.current=!0,l.current=null),_(),g()}),{scrollRef:v,contentRef:y,turnRef:b,showJump:d,jumpToLatest:(0,K.useCallback)(()=>{let e=t.current;e&&(e.focus({preventScroll:!0}),i.current=!1,h(e,e.scrollHeight),m(),p())},[m,h,p])}}function Ce(e=1500){let[t,n]=(0,K.useState)(`idle`),r=(0,K.useRef)(null);(0,K.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var Q=e=>e!==`invalid`&&e!==`not_run`;function we({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:i=!1,initialExpanded:a=!1}){let[o,c]=(0,K.useState)(a),l=(0,K.useId)(),u=e.saved,f=u?.receipt.save_check,p=t=>Object.hasOwn(e.panel_titles,t)?e.panel_titles[t]:t,m=(f?.panels??e.panels).filter(e=>e.status===`invalid`).length,h=[...new Set([...e.explanations.filter(t=>!e.problems.some(e=>t.startsWith(`${p(e.panel_id)}:`))),...e.problems.map(e=>`${p(e.panel_id)}: ${e.message}`)])],g=Object.values(e.stages).filter(e=>e.state===`complete`).length,_=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:r(e.panel_count,`panel`),f?.checked?`Checked in ${T(f.elapsed_ms)}`:void 0,u?`Saved v${u.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,b=[...u?y(u.receipt):[],...new Map(e.corrections.map(e=>[e.panel_id,`Fixed ${e.title}`])).values()];return(0,V.jsx)(v,{"data-build-receipt":e.turn_id,"data-dashboard-result":u?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,V.jsxs)(j,{gap:6,children:[(0,V.jsxs)(S,{gap:`xs`,justify:`space-between`,children:[(0,V.jsxs)(k,{component:`div`,size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[_,m>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(M,{tone:`danger`,children:r(m,`invalid panel`)})]}),(0,V.jsxs)(k,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,r(g,`stage`),` complete`]})]}),(0,V.jsxs)(O,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":o,"aria-controls":l,onClick:()=>c(e=>!e),children:[`Details`,b.length>4?` (+${b.length-4})`:``]})]}),t&&i&&(0,V.jsx)(`div`,{"data-build-running":!0,children:(0,V.jsx)(s,{state:`loading`,loadingLabel:n||`Analyzing your system`,rows:0})}),(0,V.jsx)(se,{labels:b.slice(0,4)}),h.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,V.jsx)(k,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),u&&(0,V.jsx)(O,{renderRoot:e=>(0,V.jsx)(ee,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:u.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,V.jsx)(d,{expanded:o,id:l,children:(0,V.jsxs)(j,{gap:4,children:[u&&(0,V.jsxs)(k,{size:`xs`,children:[u.label,` `,u.name,` · opens the current dashboard`]}),(0,V.jsx)(k,{size:`xs`,fw:600,children:`Build stages`}),Object.entries(e.stages).map(([n,r])=>(0,V.jsxs)(k,{component:`div`,size:`xs`,children:[(0,V.jsxs)(M,{tone:r.state===`failed`?`danger`:r.state===`complete`?`success`:r.state===`interrupted`?`warning`:`neutral`,children:[L[n],`: `,t&&r.state===`incomplete`?`in progress`:r.state]}),r.elapsed_ms!==void 0&&(r.state===`complete`||n===`preview`&&e.panels.some(e=>Q(e.status)))?` · ${T(r.elapsed_ms)}`:``]},n)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,V.jsxs)(k,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,V.jsxs)(k,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,V.jsxs)(k,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),(0,V.jsx)(k,{size:`xs`,fw:600,children:`Panel preview`}),e.panels.map(e=>(0,V.jsxs)(k,{component:`div`,size:`xs`,children:[`Preview · `,p(e.id),`: `,(0,V.jsx)(M,{tone:e.status===`ok`?`success`:e.status===`empty`||e.status===`not_run`?`neutral`:`danger`,children:e.status===`ok`?`Ok`:e.status.charAt(0).toUpperCase()+e.status.slice(1)}),Q(e.status)&&e.elapsed_ms!==void 0?` · ${T(e.elapsed_ms)}`:``]},e.id)),f&&(0,V.jsx)(k,{size:`xs`,fw:600,children:`Save verification`}),f&&(0,V.jsxs)(k,{size:`xs`,children:[`Save check: `,f.checked?`checked`:`incomplete`,f.checked?` · ${T(f.elapsed_ms)}`:``]}),f?.panels.map(e=>(0,V.jsxs)(k,{component:`div`,size:`xs`,children:[`Save · `,p(e.id),`: `,(0,V.jsx)(M,{tone:e.status===`ok`?`success`:e.status===`empty`||e.status===`not_run`?`neutral`:`danger`,children:e.status===`ok`?`Ok`:e.status.charAt(0).toUpperCase()+e.status.slice(1)}),Q(e.status)&&` · ${r(e.rows??0,`row`)}`,Q(e.status)&&e.elapsed_ms!==void 0?` · ${T(e.elapsed_ms)}`:``]},e.id)),b.slice(4).map((e,t)=>(0,V.jsx)(k,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,V.jsxs)(k,{size:`xs`,children:[`Fixed `,e.title,`: `,e.message]},t))]})})]})})}var Te=(0,K.lazy)(()=>b(()=>import(`./mcp-app-frame-BzMVY4oB.js`),__vite__mapDeps([0,1,2,3]))),Ee=/^[-+−]?\d[\d,.]*(?:%|\s?(?:ms|s|K|M))?$/,De=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}),Oe=e=>e.tool_result.view.kind===`preset`;function ke(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Oe(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Oe(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=ye(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function Ae(e,t){return Array.isArray(e)?e.flatMap(e=>{if(!f(e)||typeof e.message!=`string`)return[];let n=typeof e.path==`string`?/^panels\[(\d+)\](?:\.|$)/.exec(e.path)?.[1]:void 0,r=n===void 0?void 0:t?.[Number(n)];return[r&&!e.message.startsWith(r)?`${r}: ${e.message}`:e.message]}):[]}function je(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[]){let t=[`create_dashboard`,`replace_dashboard`].includes(e.function.name)?x(e.function.arguments)?.dashboard:void 0,r=f(t)&&Array.isArray(t.panels)?t.panels.map(e=>f(e)&&typeof e.title==`string`?e.title:``):void 0;n.set(e.id,{assistant:i,name:e.function.name,titles:r})}}if(a.role===`tool`){let e=x(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&F.has(o.name)&&N(a))continue;let s=f(e?.error)?e?.error:void 0;if(s?.code===`no_data`||s?.code===`unknown_service`)continue;let c=o?.assistant??i,l=r.get(c)??a.id;r.set(c,l);let u=t.get(l)??[],d=typeof s?.message==`string`?s.message:typeof a.error==`string`&&a.error?a.error:`Could not complete this step. Try again.`,p=[`create_dashboard`,`edit_dashboard`,`replace_dashboard`].includes(o?.name??``)&&(s?.code===`invalid_spec`||s?.code===`dashboard_version_conflict`);u.push({name:D(o?.name??``),message:d,details:p?Ae(e?.problems,o?.titles):[],readOnly:s?.code===`answer_only`,rejected:p}),t.set(l,u)}}return t}function Me({failures:e}){let[t,n]=(0,K.useState)({rejected:!1,failed:!1}),i=e.filter(e=>e.rejected),a=e.filter(e=>!e.readOnly&&!e.rejected),o=[{key:`rejected`,items:i,label:`${r(i.length,`draft`)} rejected`},{key:`failed`,items:a,label:`${r(a.length,`step`)} failed`}];return(0,V.jsxs)(P,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,V.jsx)(k,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),o.map(({key:e,items:r,label:i})=>r.length>0&&(0,V.jsxs)(P,{children:[(0,V.jsxs)(I,{className:`chat-app-toggle`,"aria-expanded":t[e],onClick:()=>n(t=>({...t,[e]:!t[e]})),style:{color:`var(--mantine-color-dimmed)`},children:[(0,V.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t[e]?(0,V.jsx)(z,{size:14}):(0,V.jsx)(Y,{size:14})}),(0,V.jsx)(`span`,{className:`chat-app-summary`,children:i})]}),t[e]&&(0,V.jsx)(j,{gap:`xs`,pl:`md`,children:r.flatMap((e,t)=>(e.details.length?e.details:[`${e.name}: ${e.message}`]).map((e,n)=>(0,V.jsx)(k,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e},`${t}-${n}`)))})]},e))]})}function Ne({view:e}){let[t,n]=(0,K.useState)(e.expanded);(0,K.useEffect)(()=>n(e.expanded),[e.expanded]);let i=e.content.tool_result,a=ge(i),o=[...new Set(i.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),c=i.results.reduce((e,t)=>e+(t.frame?.rows??0),0),l=new Map;for(let e of i.results)e.status!==`ok`&&l.set(e.status,(l.get(e.status)??0)+1);let u=i.dashboard.panels.length>1?Array.from(l,([e,t])=>`${t} ${e}`).join(` · `):l.size?[...l.keys()].join(`, `):r(c,`row`);return(0,V.jsxs)(v,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`md`,style:{overflow:`hidden`},children:[(0,V.jsxs)(I,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,V.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,V.jsx)(z,{size:14}):(0,V.jsx)(Y,{size:14})}),(0,V.jsx)(`span`,{className:`chat-app-summary`,children:[a,o,u].filter(Boolean).join(` · `)})]}),t&&(0,V.jsx)(K.Suspense,{fallback:(0,V.jsx)(s,{state:`loading`,loadingLabel:`Preparing view…`}),children:(0,V.jsx)(Te,{content:e.content})})]})}var Pe=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Fe(){let{agentAvailable:e,messages:t,messageTimes:n,ready:r,running:i,activity:c,stopped:l,error:u,threadMissing:d,send:f,retry:p,reloadThread:m,newThread:h}=te(),g=ne(t),y=t.filter(e=>e.role===`user`).at(-1)?.id,{scrollRef:b,contentRef:x,turnRef:ee,showJump:C,jumpToLatest:w}=Se(y);if(!e)return(0,V.jsx)(U,{size:`sm`,py:96,children:(0,V.jsx)(v,{withBorder:!0,radius:`md`,p:{base:`xl`,sm:40},children:(0,V.jsxs)(j,{gap:`md`,children:[(0,V.jsx)(k,{fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,V.jsx)(o,{title:`Chat`,description:`Chat is not configured`}),(0,V.jsx)(k,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,V.jsx)(O,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let T=ke(t),E=je(t),D=t.filter(e=>T.duplicates.has(e.id)?!1:e.role===`tool`?E.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),M=t.findIndex(e=>e.id===y),N=t.slice(M+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=t.slice(M+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=[];for(let e of D)(e.role===`user`||I.length===0)&&I.push({id:e.id,messages:[]}),I.at(-1).messages.push(e);I.length===0&&I.push({id:`draft`,messages:[]});let L=e=>E.has(e.id)?(0,V.jsx)(Me,{failures:E.get(e.id)},e.id):(0,V.jsxs)(P,{children:[(0,V.jsx)(ze,{message:e,time:n[e.id],appView:T.views.get(e.id)}),g.has(e.id)&&(0,V.jsx)(P,{mt:`sm`,children:(0,V.jsx)(we,{receipt:g.get(e.id),running:i&&e.id===y,awaitingAnswer:!N,activity:c})})]},e.id);return(0,V.jsxs)(P,{className:`chat-pane`,children:[(0,V.jsx)(U,{size:880,w:`100%`,px:{base:`md`,sm:`xl`},py:`md`,children:(0,V.jsx)(o,{title:`Chat`,description:`Investigate your telemetry with Pitot.`})}),(0,V.jsxs)(P,{className:`chat-viewport`,children:[(0,V.jsx)(P,{className:`chat-scroll`,ref:b,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,V.jsxs)(U,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:x,children:[d&&(0,V.jsx)(a,{tone:`warning`,title:`This chat no longer exists`,children:(0,V.jsxs)(S,{justify:`space-between`,children:[(0,V.jsx)(k,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,V.jsx)(O,{size:`compact-sm`,variant:`light`,onClick:h,children:`New chat`})]})}),!d&&!r&&u&&(0,V.jsx)(Ie,{message:u,onRetry:m,onNewThread:h}),!d&&!r&&!u&&(0,V.jsx)(s,{state:`loading`,loadingLabel:`Loading chat`,rows:5}),!d&&r&&(0,V.jsxs)(V.Fragment,{children:[D.length===0&&(0,V.jsx)(Re,{onSelect:f}),(0,V.jsx)(j,{gap:`lg`,children:I.map((e,t)=>(0,V.jsxs)(j,{gap:`lg`,ref:e.id===y?ee:void 0,"data-chat-turn":e.id===y?y:void 0,children:[e.messages.filter(e=>e.id!==F?.id).map(L),t===I.length-1&&(0,V.jsxs)(V.Fragment,{children:[F&&(0,V.jsx)(P,{"data-answer-position":!0,children:(0,V.jsx)(ze,{message:F,time:n[F.id]})},`answer-${y??`draft`}`),i&&!N&&!g.has(y??``)&&(0,V.jsx)(s,{state:`loading`,loadingLabel:c||`Analyzing your system`,rows:0}),l&&(0,V.jsx)(k,{c:`dimmed`,size:`sm`,children:`Stopped`}),u&&(0,V.jsx)(Ie,{message:u,onRetry:p})]})]},e.id))})]})]})}),C&&(0,V.jsx)(_,{label:`Jump to latest`,children:(0,V.jsx)(A,{className:`chat-jump`,variant:`default`,size:36,"aria-label":`Jump to latest`,onClick:w,children:(0,V.jsx)(pe,{size:18,"aria-hidden":`true`})})})]}),!d&&(0,V.jsx)(Le,{})]})}function Ie({message:e,onRetry:t,onNewThread:n}){return(0,V.jsx)(a,{tone:`danger`,title:`Something went wrong`,children:(0,V.jsxs)(S,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,V.jsx)(k,{size:`sm`,children:e}),(0,V.jsxs)(S,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,V.jsx)(O,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,V.jsx)(O,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Le(){let{input:e,setInput:t,inputRef:n,submit:r,send:i,stop:a,ready:o,running:s}=te();return(0,V.jsx)(P,{className:`chat-composer`,children:(0,V.jsxs)(U,{size:880,px:{base:`md`,sm:`xl`},children:[(0,V.jsx)(v,{component:`form`,onSubmit:r,className:`chat-composer-field`,style:{borderColor:`var(--composer-border, var(--labstack-control-border))`},withBorder:!0,radius:`sm`,py:6,pl:`lg`,pr:6,children:(0,V.jsxs)(S,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,V.jsx)(ie,{ref:n,"aria-label":`Message Pitot`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),i(e))},placeholder:s?`Pitot is working…`:`Ask about health, errors, or latency…`,disabled:!o,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),s?(0,V.jsx)(_,{label:`Stop`,children:(0,V.jsx)(A,{type:`button`,variant:`default`,size:40,"aria-label":`Stop`,onClick:a,children:(0,V.jsx)(he,{size:16,weight:`fill`})})}):(0,V.jsx)(A,{type:`submit`,variant:`filled`,size:40,disabled:!e.trim()||!o,"aria-label":`Send message`,children:(0,V.jsx)(me,{size:17,weight:`fill`})})]})}),(0,V.jsx)(k,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function Re({onSelect:e}){return(0,V.jsxs)(j,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,V.jsx)(n,{size:`large`}),(0,V.jsx)(i,{order:2,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,V.jsx)(S,{justify:`center`,gap:`xs`,mt:`xs`,maw:g.prose,children:Pe.map(t=>(0,V.jsx)(O,{variant:`default`,size:`sm`,onClick:()=>void e(t),children:t},t))})]})}function ze({message:e,time:t,appView:n}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,V.jsx)(k,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,V.jsx)(P,{"data-chat-anchor":!0,children:(0,V.jsx)(a,{tone:`danger`,title:`Something went wrong`,children:e.content.message})}):e.activityType===`mcp-app`?n?(0,V.jsx)(Ne,{view:n}):(0,V.jsx)(P,{"data-chat-anchor":!0,children:(0,V.jsx)(a,{tone:`danger`,children:`This view could not be loaded. Please try again.`})}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let r=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!r&&e.role===`assistant`)return null;let i=e.role===`user`,o=t?De.format(new Date(t)):``;return(0,V.jsxs)(P,{className:`chat-message`,"data-chat-anchor":!0,"data-role":i?`user`:`assistant`,children:[i?(0,V.jsx)(v,{radius:`md`,px:`md`,py:`sm`,bg:`var(--labstack-inset)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,V.jsx)(k,{style:{whiteSpace:`pre-wrap`},children:r})}):(0,V.jsx)(G,{className:`chat-markdown`,children:(0,V.jsx)(ae,{remarkPlugins:[oe,Ve],components:He,children:r})}),(o||!i)&&(0,V.jsxs)(S,{className:`chat-message-meta`,gap:6,justify:i?`flex-end`:`flex-start`,mt:4,h:24,children:[o&&t&&(0,V.jsx)(k,{c:`dimmed`,size:`xs`,title:c(t),children:o}),!i&&(0,V.jsx)(Be,{text:r,label:`Copy message`})]})]})}function Be({text:e,label:t}){let{state:n,copy:r}=Ce();return(0,V.jsx)(_,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,V.jsx)(A,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,V.jsx)(h,{size:13,weight:`bold`}):(0,V.jsx)(m,{size:13})})})}function Ve(){return e=>{let t=[],n=e=>{if(e.type===`table`&&e.children){let t=e=>e.value??e.children?.map(t).join(``)??``,n=e.children.slice(1);e.align=(e.children[0]?.children??[]).map((r,i)=>n.length&&n.every(e=>Ee.test(t(e.children?.[i]??{type:`text`}).trim()))?`right`:e.align?.[i]??null)}if(e.type===`heading`&&e.depth!==void 0){let n=e.depth;for(;t.length&&t.at(-1)>=n;)t.pop();t.push(n),e.depth=Math.min(6,t.length+1)}e.children?.forEach(n)};n(e)}}var He={table:({children:e})=>(0,V.jsx)(P,{className:`chat-table`,children:(0,V.jsx)(R,{stickyHeader:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,V.jsx)(R.Thead,{children:e}),tbody:({children:e})=>(0,V.jsx)(R.Tbody,{children:e}),tr:({children:e})=>(0,V.jsx)(R.Tr,{children:e}),th:({children:e,style:t})=>(0,V.jsx)(R.Th,{style:t,children:e}),td:({children:e,style:t})=>(0,V.jsx)(R.Td,{style:t,ta:typeof e==`string`&&Ee.test(e.trim())?`right`:void 0,ff:typeof e==`string`&&/^[-+−]?\d/.test(e.trim())?`monospace`:void 0,children:e}),pre:({children:e})=>(0,V.jsx)(Ue,{children:e}),a:({href:e,children:t})=>(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Ue({children:e}){let t=$(e);return(0,V.jsxs)(P,{className:`chat-code`,pos:`relative`,children:[(0,V.jsx)(P,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,V.jsx)(Be,{text:t,label:`Copy code`})}),(0,V.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{ye as n,Fe as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-BkkPoSrS.js b/internal/ui/dist/assets/chat._threadId-BkkPoSrS.js new file mode 100644 index 00000000..ad600ec9 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-BkkPoSrS.js @@ -0,0 +1 @@ +import{t as e}from"./chat-CAv_AvQL.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DpUkUj48.js b/internal/ui/dist/assets/chat._threadId-DpUkUj48.js deleted file mode 100644 index f5971f3b..00000000 --- a/internal/ui/dist/assets/chat._threadId-DpUkUj48.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-DPOCuMln.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-BkkPoSrS.js b/internal/ui/dist/assets/chat.index-BkkPoSrS.js new file mode 100644 index 00000000..ad600ec9 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-BkkPoSrS.js @@ -0,0 +1 @@ +import{t as e}from"./chat-CAv_AvQL.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-DpUkUj48.js b/internal/ui/dist/assets/chat.index-DpUkUj48.js deleted file mode 100644 index f5971f3b..00000000 --- a/internal/ui/dist/assets/chat.index-DpUkUj48.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-DPOCuMln.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-change-chips-BnO9d30A.js b/internal/ui/dist/assets/dashboard-change-chips-CsKsdB0I.js similarity index 83% rename from internal/ui/dist/assets/dashboard-change-chips-BnO9d30A.js rename to internal/ui/dist/assets/dashboard-change-chips-CsKsdB0I.js index bb942146..05e1fb49 100644 --- a/internal/ui/dist/assets/dashboard-change-chips-BnO9d30A.js +++ b/internal/ui/dist/assets/dashboard-change-chips-CsKsdB0I.js @@ -1 +1 @@ -import{dr as e,mi as t,rr as n}from"./index-CL2Ww4um.js";var r=t();function i({labels:t}){return t.length?(0,r.jsx)(e,{gap:4,"data-edit-chips":!0,children:t.map((e,t)=>(0,r.jsx)(n,{color:`gray`,variant:`light`,size:`sm`,tt:`none`,maw:`100%`,title:e,style:{color:`var(--mantine-color-text)`,height:`auto`,whiteSpace:`normal`,overflowWrap:`anywhere`},children:e},t))}):null}export{i as t}; \ No newline at end of file +import{dr as e,mi as t,rr as n}from"./index-CRKDYJaJ.js";var r=t();function i({labels:t}){return t.length?(0,r.jsx)(e,{gap:4,"data-edit-chips":!0,children:t.map((e,t)=>(0,r.jsx)(n,{color:`gray`,variant:`light`,size:`sm`,tt:`none`,maw:`100%`,title:e,style:{color:`var(--mantine-color-text)`,height:`auto`,whiteSpace:`normal`,overflowWrap:`anywhere`},children:e},t))}):null}export{i as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-BCAT-2yt.js b/internal/ui/dist/assets/dashboards._dashboardId-DFPM3KOZ.js similarity index 69% rename from internal/ui/dist/assets/dashboards._dashboardId-BCAT-2yt.js rename to internal/ui/dist/assets/dashboards._dashboardId-DFPM3KOZ.js index 6fe70c29..b1894938 100644 --- a/internal/ui/dist/assets/dashboards._dashboardId-BCAT-2yt.js +++ b/internal/ui/dist/assets/dashboards._dashboardId-DFPM3KOZ.js @@ -1 +1 @@ -import{_ as e,m as t,mi as n,r,ui as i}from"./index-CL2Ww4um.js";import{t as a}from"./page-CyLCNkgg.js";var o=n();function s(){let{dashboardId:n}=r.useParams(),s=t(r.useSearch()),c=i(),l=(t,r,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:e(r),replace:i,resetScroll:t!==n});return(0,o.jsx)(a,{dashboardId:n,search:s,onSearch:(e,t)=>l(n,e,t),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file +import{_ as e,m as t,mi as n,r,ui as i}from"./index-CRKDYJaJ.js";import{t as a}from"./page-DNINkXnr.js";var o=n();function s(){let{dashboardId:n}=r.useParams(),s=t(r.useSearch()),c=i(),l=(t,r,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:e(r),replace:i,resetScroll:t!==n});return(0,o.jsx)(a,{dashboardId:n,search:s,onSearch:(e,t)=>l(n,e,t),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-8lAZVohG.js b/internal/ui/dist/assets/dashboards.index-DGeIyqk7.js similarity index 61% rename from internal/ui/dist/assets/dashboards.index-8lAZVohG.js rename to internal/ui/dist/assets/dashboards.index-DGeIyqk7.js index 5f6c3034..22008657 100644 --- a/internal/ui/dist/assets/dashboards.index-8lAZVohG.js +++ b/internal/ui/dist/assets/dashboards.index-DGeIyqk7.js @@ -1 +1 @@ -import{_ as e,i as t,m as n,mi as r,ui as i}from"./index-CL2Ww4um.js";import{t as a}from"./page-CyLCNkgg.js";var o=r();function s(){let r=n(t.useSearch()),s=i();return(0,o.jsx)(a,{search:r,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:e(r),replace:n})})}export{s as component}; \ No newline at end of file +import{_ as e,i as t,m as n,mi as r,ui as i}from"./index-CRKDYJaJ.js";import{t as a}from"./page-DNINkXnr.js";var o=r();function s(){let r=n(t.useSearch()),s=i();return(0,o.jsx)(a,{search:r,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:e(r),replace:n})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/discard-zr3DFRDY.js b/internal/ui/dist/assets/discard-YoKuewjt.js similarity index 92% rename from internal/ui/dist/assets/discard-zr3DFRDY.js rename to internal/ui/dist/assets/discard-YoKuewjt.js index 1cff3986..5adcd696 100644 --- a/internal/ui/dist/assets/discard-zr3DFRDY.js +++ b/internal/ui/dist/assets/discard-YoKuewjt.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Zt as t,gi as n,mi as r,or as i}from"./index-CL2Ww4um.js";var a=e(n(),1),o=r();function s(e,n,r){let[s,c]=(0,a.useState)(!1),l=(0,a.useRef)(null),u=()=>{e?(l.current=document.activeElement instanceof HTMLElement?document.activeElement:null,c(!0)):n()},d=()=>{c(!1);let e=l.current?.isConnected&&l.current!==document.body?l.current:null;requestAnimationFrame(()=>e?.focus())};return{request:u,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||e.nativeEvent.isComposing||e.target instanceof Element&&e.target.getAttribute(`aria-expanded`)===`true`||(s?d():u())},prompt:s&&(0,o.jsxs)(t,{opened:s,onClose:d,title:`Discard changes?`,confirmLabel:`Discard changes`,cancelLabel:`Keep editing`,tone:`danger`,onConfirm:n,children:[`Your changes to `,(0,o.jsx)(i,{span:!0,ff:`monospace`,children:r}),` have not been saved.`]})}}export{s as t}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Zt as t,gi as n,mi as r,or as i}from"./index-CRKDYJaJ.js";var a=e(n(),1),o=r();function s(e,n,r){let[s,c]=(0,a.useState)(!1),l=(0,a.useRef)(null),u=()=>{e?(l.current=document.activeElement instanceof HTMLElement?document.activeElement:null,c(!0)):n()},d=()=>{c(!1);let e=l.current?.isConnected&&l.current!==document.body?l.current:null;requestAnimationFrame(()=>e?.focus())};return{request:u,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||e.nativeEvent.isComposing||e.target instanceof Element&&e.target.getAttribute(`aria-expanded`)===`true`||(s?d():u())},prompt:s&&(0,o.jsxs)(t,{opened:s,onClose:d,title:`Discard changes?`,confirmLabel:`Discard changes`,cancelLabel:`Keep editing`,tone:`danger`,onConfirm:n,children:[`Your changes to `,(0,o.jsx)(i,{span:!0,ff:`monospace`,children:r}),` have not been saved.`]})}}export{s as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/explore-Cjwi4NOK.js b/internal/ui/dist/assets/explore-CnEznG3I.js similarity index 63% rename from internal/ui/dist/assets/explore-Cjwi4NOK.js rename to internal/ui/dist/assets/explore-CnEznG3I.js index 0497a893..27cb7c13 100644 --- a/internal/ui/dist/assets/explore-Cjwi4NOK.js +++ b/internal/ui/dist/assets/explore-CnEznG3I.js @@ -1 +1 @@ -import{d as e,mi as t,s as n,u as r,ui as i}from"./index-CL2Ww4um.js";import{t as a}from"./page-D9GXhDXQ.js";var o=t();function s(){let t=r(n.useSearch()),s=i();return(0,o.jsx)(a,{search:t,onSearch:(t,n)=>void s({to:`/explore`,search:e(t),replace:n}),onSaved:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}})})}export{s as component}; \ No newline at end of file +import{d as e,mi as t,s as n,u as r,ui as i}from"./index-CRKDYJaJ.js";import{t as a}from"./page-TqwEGxR8.js";var o=t();function s(){let t=r(n.useSearch()),s=i();return(0,o.jsx)(a,{search:t,onSearch:(t,n)=>void s({to:`/explore`,search:e(t),replace:n}),onSaved:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-CL2Ww4um.js b/internal/ui/dist/assets/index-CRKDYJaJ.js similarity index 95% rename from internal/ui/dist/assets/index-CL2Ww4um.js rename to internal/ui/dist/assets/index-CRKDYJaJ.js index 8237ecf3..8233cc18 100644 --- a/internal/ui/dist/assets/index-CL2Ww4um.js +++ b/internal/ui/dist/assets/index-CRKDYJaJ.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/new-dashboard-CCTJTeSK.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/page-D9GXhDXQ.js","assets/live-data-meta-CGsP1XrP.js","assets/toolbar-BxU8wfSr.js","assets/CopyButton-CeHt7WhA.js","assets/Table-B_pVYmc3.js","assets/lib-DeYqVmar.js","assets/loading-skeleton-BsD5_HiB.js","assets/save-dialog-CVDkqzuX.js","assets/NumberInput-DMNGxCQ3.js","assets/discard-zr3DFRDY.js","assets/alerts-vRASXpaP.js","assets/useMutation-BWRBtdcF.js","assets/Textarea-DySd6X1B.js","assets/explore-Cjwi4NOK.js","assets/logs-DfcxDmmQ.js","assets/search-page-D3PsJ82P.js","assets/settings-781S98c4.js","assets/settings-_ddYdY9A.js","assets/traces-KeYZTd_e.js","assets/chat.index-DpUkUj48.js","assets/chat-DPOCuMln.js","assets/dashboard-change-chips-BnO9d30A.js","assets/chat._threadId-DpUkUj48.js","assets/dashboards.index-8lAZVohG.js","assets/page-CyLCNkgg.js","assets/dashboards._dashboardId-BCAT-2yt.js","assets/settings_.ingest-BOYYaqhX.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/new-dashboard-CFDZmvBm.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/page-TqwEGxR8.js","assets/live-data-meta-D4rcFCF2.js","assets/toolbar-DsH2ghVs.js","assets/CopyButton-DfD1hFjv.js","assets/Table-DKSK2CAk.js","assets/lib-DSpv4cMb.js","assets/loading-skeleton-BgW8PQ9g.js","assets/save-dialog-jF2dwSKX.js","assets/NumberInput-C4qWjk_e.js","assets/discard-YoKuewjt.js","assets/alerts-CDampZkC.js","assets/useMutation-C6XBlFap.js","assets/Textarea-CKEKXEtW.js","assets/explore-CnEznG3I.js","assets/logs-VrTLGNyl.js","assets/search-page-CojucVCz.js","assets/settings-BJGfad4E.js","assets/settings-CfrRZuaG.js","assets/traces-C1mBo8ZL.js","assets/chat.index-BkkPoSrS.js","assets/chat-CAv_AvQL.js","assets/dashboard-change-chips-CsKsdB0I.js","assets/chat._threadId-BkkPoSrS.js","assets/dashboards.index-DGeIyqk7.js","assets/page-DNINkXnr.js","assets/dashboards._dashboardId-DFPM3KOZ.js","assets/settings_.ingest-CVuXQWLV.js"])))=>i.map(i=>d[i]); import{n as e,r as t,t as n}from"./rolldown-runtime-BLXQ4ufn.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;for(e.push(t);0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break t}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1{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=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1_e||(e.current=ge[_e],ge[_e]=null,_e--)}function be(e,t){_e++,ge[_e]=e.current,e.current=t}var xe=ve(null),Se=ve(null),Ce=ve(null),we=ve(null);function Te(e,t){switch(be(Ce,t),be(Se,e),be(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xp(t),e=Sp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ye(xe),be(xe,e)}function Ee(){ye(xe),ye(Se),ye(Ce)}function De(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,be(we,e)),t=xe.current;var n=Sp(t,e.type);t!==n&&(be(Se,e),be(xe,n))}function Oe(e){Se.current===e&&(ye(xe),ye(Se)),we.current===e&&(ye(we),vh._currentValue=he)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1)`:-11&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function v5(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;v5(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var y5=new Set([`type`,`properties`,`required`,`additionalProperties`]),b5=[`oneOf`,`anyOf`];function x5(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function S5(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!y5.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??x5(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}d4(n,r,e.length===1?e[0]:S5(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=x5(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function C5(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of y5)if(t in e)return;let n=t.filter(e=>b5.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=S5(t);else{let e=n[0],i=b5.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>S5([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,f5(e,r))}function w5(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):f5(i,s),f5(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())v5(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])C5(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}f5(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,d4(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:D5(t,`input`,e.processors),output:D5(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function T5(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return T5(r.element,n);if(r.type===`set`)return T5(r.valueType,n);if(r.type===`lazy`)return T5(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return T5(r.innerType,n);if(r.type===`intersection`)return T5(r.left,n)||T5(r.right,n);if(r.type===`record`||r.type===`map`)return T5(r.keyType,n)||T5(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:T5(r.in,n)||T5(r.out,n);if(r.type===`object`){for(let e in r.shape)if(T5(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(T5(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(T5(e,n))return!0;return!!(r.rest&&T5(r.rest,n))}return!1}var E5=(e,t={})=>n=>{let r=p5({...n,processors:t});return h5(e,r),_5(r,e),w5(r,e)},D5=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=p5({...i??{},target:a,io:t,processors:n});return h5(e,o),_5(o,e),w5(o,e)},O5=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},k5=(e,t,n)=>{(e[t]===void 0||n{O5(e,`minimum`,t),k5(e,`maximum`,t)},j5=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},M5=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},N5=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},P5=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},F5=(e,t)=>O5(e,`minimum`,t.minimum),I5=(e,t)=>k5(e,`maximum`,t.maximum),L5=e=>(t,n)=>{P5(t,n.format);let[r,i]=e[n.format];O5(t,`minimum`,r),k5(t,`maximum`,i)},R5={greater_than:(e,t)=>O5(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>k5(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>j5(e,t.value),number_format:L5(j4),bigint_format:L5(M4),min_length:F5,max_length:I5,length_equals:(e,t)=>A5(e,t.length),min_size:F5,max_size:I5,size_equals:(e,t)=>A5(e,t.size),string_format:(e,t)=>{P5(e,t.format),t.pattern&&M5(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>N5(e,t.mime)};function z5(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)R5[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&O5(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&O5(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&k5(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&k5(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&j5(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&N5(t,i.mime);for(let e of i.patterns??[])M5(t,e);return t}var B5={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},V5=new Map([[Nb,p6],[Fb,m6]]),H5=e=>V5.get(e)??e,U5=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=z5(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=B5[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(H5);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},W5=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=z5(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):m5(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},G5=(e,t,n,r)=>{n.type=`boolean`},K5=(e,t,n,r)=>{m5(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},q5=(e,t,n,r)=>{m5(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},J5=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Y5=(e,t,n,r)=>{m5(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},X5=(e,t,n,r)=>{m5(e,t,n,r,`Void cannot be represented in JSON Schema`)},Z5=(e,t,n,r)=>{n.not={}},Q5=(e,t,n,r)=>{},$5=(e,t,n,r)=>{},e7=(e,t,n,r)=>{m5(e,t,n,r,`Date cannot be represented in JSON Schema`)},t7=(e,t,n,r)=>{let i=t4(e._zod.def.entries);i.length===0?n.not={}:(i.every(e=>typeof e==`number`)&&(n.type=`number`),i.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=i)},n7=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(m5(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(m5(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},r7=(e,t,n,r)=>{m5(e,t,n,r,`NaN cannot be represented in JSON Schema`)},i7=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},a7=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=z5(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},o7=(e,t,n,r)=>{n.type=`boolean`},s7=(e,t,n,r)=>{m5(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},c7=(e,t,n,r)=>{m5(e,t,n,r,`Function types cannot be represented in JSON Schema`)},l7=(e,t,n,r)=>{m5(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},u7=(e,t,n,r)=>{m5(e,t,n,r,`Map cannot be represented in JSON Schema`)},d7=(e,t,n,r)=>{m5(e,t,n,r,`Set cannot be represented in JSON Schema`)},f7=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=z5(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=h5(a.element,t,{...r,path:[...r.path,`items`]})};function p7(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?p7(t.out):t.type===`catch`?p7(t.innerType):e._zod.optin}var m7=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&m5(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)d4(i.properties,e,h5(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?p7(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=h5(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},h7=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>h5(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},g7=(e,t,n,r)=>{let i=e._zod.def,a=h5(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=h5(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},_7=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>h5(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?h5(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?p7(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=z5(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function v7(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=v7(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>v7(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?T6:w6).source)),p}var y7=new WeakMap;function b7(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of y7.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=v7(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var x7=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=z5(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=h5(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)d4(i.patternProperties,H5(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=h5(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=y7.get(t);n||(n=[],y7.set(t,n),t.deferred.push(()=>b7(t))),n.push(e)}i.additionalProperties=h5(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&p7(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},S7=(e,t,n,r)=>{let i=e._zod.def,a=h5(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},C7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},w7=Symbol();function T7(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(m5(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),w7):JSON.parse(o)}var E7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=T7(i.defaultValue,e,t,n,r);o!==w7&&(n.default=o)},D7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=T7(i.defaultValue,e,t,n,r);o!==w7&&(n._prefault=o)},O7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{m5(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},k7=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;h5(o,t,r);let s=t.seen.get(e);s.ref=o},A7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},j7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},M7=(e,t,n,r)=>{let i=e._zod.def;h5(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},N7=(e,t,n,r)=>{let i=e._zod.innerType;h5(i,t,r);let a=t.seen.get(e);a.ref=i},P7={string:U5,number:W5,boolean:G5,bigint:K5,symbol:q5,null:J5,undefined:Y5,void:X5,never:Z5,any:Q5,unknown:$5,date:e7,enum:t7,literal:n7,nan:r7,template_literal:i7,file:a7,success:o7,custom:s7,function:c7,transform:l7,map:u7,set:d7,array:f7,object:m7,union:h7,intersection:g7,tuple:_7,record:x7,nullable:S7,nonoptional:C7,default:E7,prefault:D7,catch:O7,pipe:k7,readonly:A7,promise:j7,optional:M7,lazy:N7};function F7(e,t){if(`_idmap`in e){let n=e,r=p5({...t,processors:P7}),i={};for(let e of n._idmap.entries()){let[t,n]=e;h5(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;_5(r,n),d4(a,t,w5(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=p5({...t,processors:P7});return h5(e,n),_5(n,e),w5(n,e)}var I7=new WeakSet([Object.prototype,Error.prototype]);function L7(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var R7=K(`ZodError`,(e,t)=>{D3.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);I7.has(n)||(I7.add(n),L7(n,`format`,e=>t=>A3(e,t)),L7(n,`flatten`,e=>t=>k3(e,t)),L7(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,r4,2)}),L7(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,r4,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),z7=M3(R7),B7=N3(R7),V7=P3(R7),H7=I3(R7),U7=H3(R7),W7=U3(R7),G7=W3(R7),K7=G3(R7),q7=K3(R7),J7=q3(R7),Y7=J3(R7),X7=Y3(R7);function Z7(){b3.localeError||x3($8())}function Q7(){b3.memoizer||x3({memoizer:X8()})}var $7=K(`ZodType`,(e,t)=>(Z7(),Z6.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(v4(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return O4(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(AS(e,t))},superRefine(e,t){return this.check(jS(e,t))},overwrite(e){return this.check(t5(e))},optional(){return cS(this)},exactOptional(){return uS(this)},nullable(){return fS(this)},nullish(){return cS(fS(this))},nonoptional(e){return vS(this,e)},array(){return G9(this)},or(e){return Y9([this,e])},and(e){return $9(this,e)},transform(e){return SS(this,oS(e))},default(e){return mS(this,e)},prefault(e){return gS(this,e)},catch(e){return bS(this,e)},pipe(e){return SS(this,e)},readonly(){return TS(this)},describe(e){let t=this.clone();return rx.add(t,{description:e}),t},meta(...e){if(e.length===0)return rx.get(this);let t=this.clone();return rx.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return n3(this,`~standard`,{...eb(this),jsonSchema:{input:D5(this,`input`),output:D5(this,`output`)}})},set"~standard"(e){t3(this,`~standard`,e)},parse:function e(t,n){return z7(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await B7(this,t,n,{callee:e})},safeParse(e,t){return V7(this,e,t)},async safeParseAsync(e,t){return H7(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){t3(this,`spa`,e)},validate(e,t){return z3(this,e,t)},validateAsync(e,t){return V3(this,e,t)},encode:function e(t,n){return U7(this,t,n,{callee:e})},decode:function e(t,n){return W7(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await G7(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await K7(this,t,n,{callee:e})},safeEncode(e,t){return q7(this,e,t)},safeDecode(e,t){return J7(this,e,t)},async safeEncodeAsync(e,t){return Y7(this,e,t)},async safeDecodeAsync(e,t){return X7(this,e,t)},toJSONSchema(e){return E5(this,{})(e)},get description(){return rx.get(this)?.description},get _def(){return this._zod.def}}),e9=K(`_ZodString`,(e,t)=>{tb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>U5(e,t,n,r)},r3({format:e=>z5(e).format??null,minLength:e=>z5(e).minimum??null,maxLength:e=>z5(e).maximum??null},{regex(...e){return this.check(Yx(...e))},includes(...e){return this.check(Qx(...e))},startsWith(...e){return this.check($x(...e))},endsWith(...e){return this.check(e5(...e))},min(...e){return this.check(qx(...e))},max(...e){return this.check(Kx(...e))},length(...e){return this.check(Jx(...e))},nonempty(...e){return this.check(qx(1,...e))},lowercase(e){return this.check(Xx(e))},uppercase(e){return this.check(Zx(e))},trim(){return this.check(r5())},normalize(...e){return this.check(n5(...e))},toLowerCase(){return this.check(i5())},toUpperCase(){return this.check(a5())},slugify(){return this.check(o5())}})),t9=K(`ZodString`,(e,t)=>{tb.init(e,t),e9.init(e,t)},{email(e){return this.check(ox(s9,e))},url(e){return this.check(fx(d9,e))},jwt(e){return this.check(Dx(D9,e))},emoji(e){return this.check(px(p9,e))},guid(e){return this.check(sx(l9,e))},uuid(e){return this.check(cx(u9,e))},uuidv4(e){return this.check(lx(u9,e))},uuidv6(e){return this.check(ux(u9,e))},uuidv7(e){return this.check(dx(u9,e))},nanoid(e){return this.check(mx(m9,e))},cuid(e){return this.check(hx(h9,e))},cuid2(e){return this.check(gx(g9,e))},ulid(e){return this.check(_x(_9,e))},base64(e){return this.check(wx(w9,e))},base64url(e){return this.check(Tx(T9,e))},xid(e){return this.check(vx(v9,e))},ksuid(e){return this.check(yx(y9,e))},ipv4(e){return this.check(bx(b9,e))},ipv6(e){return this.check(xx(x9,e))},cidrv4(e){return this.check(Sx(S9,e))},cidrv6(e){return this.check(Cx(C9,e))},e164(e){return this.check(Ex(E9,e))},datetime(e){return this.check(Ox(r9,e))},date(e){return this.check(kx(i9,e))},time(e){return this.check(Ax(a9,e))},duration(e){return this.check(jx(o9,e))}});function q(e){return ax(t9,e)}var n9=K(`ZodStringFormat`,(e,t)=>{nb.init(e,t),e9.init(e,t)}),r9=K(`ZodISODateTime`,(e,t)=>{xb.init(e,t),n9.init(e,t)}),i9=K(`ZodISODate`,(e,t)=>{Sb.init(e,t),n9.init(e,t)}),a9=K(`ZodISOTime`,(e,t)=>{Cb.init(e,t),n9.init(e,t)}),o9=K(`ZodISODuration`,(e,t)=>{wb.init(e,t),n9.init(e,t)}),s9=K(`ZodEmail`,(e,t)=>{ab.init(e,t),n9.init(e,t)});function c9(e){return ox(s9,e)}var l9=K(`ZodGUID`,(e,t)=>{rb.init(e,t),n9.init(e,t)}),u9=K(`ZodUUID`,(e,t)=>{ib.init(e,t),n9.init(e,t)}),d9=K(`ZodURL`,(e,t)=>{pb.init(e,t),n9.init(e,t)});function f9(e){return fx(d9,e)}var p9=K(`ZodEmoji`,(e,t)=>{mb.init(e,t),n9.init(e,t)}),m9=K(`ZodNanoID`,(e,t)=>{hb.init(e,t),n9.init(e,t)}),h9=K(`ZodCUID`,(e,t)=>{gb.init(e,t),n9.init(e,t)}),g9=K(`ZodCUID2`,(e,t)=>{_b.init(e,t),n9.init(e,t)}),_9=K(`ZodULID`,(e,t)=>{vb.init(e,t),n9.init(e,t)}),v9=K(`ZodXID`,(e,t)=>{yb.init(e,t),n9.init(e,t)}),y9=K(`ZodKSUID`,(e,t)=>{bb.init(e,t),n9.init(e,t)}),b9=K(`ZodIPv4`,(e,t)=>{Tb.init(e,t),n9.init(e,t)}),x9=K(`ZodIPv6`,(e,t)=>{Ob.init(e,t),n9.init(e,t)}),S9=K(`ZodCIDRv4`,(e,t)=>{kb.init(e,t),n9.init(e,t)}),C9=K(`ZodCIDRv6`,(e,t)=>{jb.init(e,t),n9.init(e,t)}),w9=K(`ZodBase64`,(e,t)=>{Pb.init(e,t),n9.init(e,t)}),T9=K(`ZodBase64URL`,(e,t)=>{Lb.init(e,t),n9.init(e,t)}),E9=K(`ZodE164`,(e,t)=>{Rb.init(e,t),n9.init(e,t)}),D9=K(`ZodJWT`,(e,t)=>{Bb.init(e,t),n9.init(e,t)}),O9=K(`ZodNumber`,(e,t)=>{Vb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>W5(e,t,n,r),e.isFinite=!0},r3({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=z5(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=z5(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=z5(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>z5(e).format??null},{gt(e,t){return this.check(Ux(e,t))},gte(e,t){return this.check(Wx(e,t))},min(e,t){return this.check(Wx(e,t))},lt(e,t){return this.check(Vx(e,t))},lte(e,t){return this.check(Hx(e,t))},max(e,t){return this.check(Hx(e,t))},int(e){return this.check(j9(e))},safe(e){return this.check(j9(e))},positive(e){return this.check(Ux(0,e))},nonnegative(e){return this.check(Wx(0,e))},negative(e){return this.check(Vx(0,e))},nonpositive(e){return this.check(Hx(0,e))},multipleOf(e,t){return this.check(Gx(e,t))},step(e,t){return this.check(Gx(e,t))},finite(){return this}}));function k9(e){return Mx(O9,e)}var A9=K(`ZodNumberFormat`,(e,t)=>{Hb.init(e,t),O9.init(e,t)});function j9(e){return Px(A9,e)}var M9=K(`ZodBoolean`,(e,t)=>{Ub.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G5(e,t,n,r)});function N9(e){return Fx(M9,e)}var P9=K(`ZodUndefined`,(e,t)=>{Wb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y5(e,t,n,r)});function F9(e){return Ix(P9,e)}var I9=K(`ZodNull`,(e,t)=>{Gb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>J5(e,t,n,r)});function L9(e){return Lx(I9,e)}var R9=K(`ZodAny`,(e,t)=>{Kb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function z9(){return Rx(R9)}var B9=K(`ZodUnknown`,(e,t)=>{qb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function V9(){return zx(B9)}var H9=K(`ZodNever`,(e,t)=>{Jb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Z5(e,t,n,r)});function U9(e){return Bx(H9,e)}var W9=K(`ZodArray`,(e,t)=>{Q7(),Qb.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>f7(e,t,n,r),e.element=t.element},{min(e,t){return this.check(qx(e,t))},nonempty(e){return this.check(qx(1,e))},max(e,t){return this.check(Kx(e,t))},length(e,t){return this.check(Jx(e,t))},unwrap(){return this.element}});function G9(e,t){return s5(W9,e,t)}var K9=K(`ZodObject`,(e,t)=>{Q7(),i8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>m7(e,t,n,r),u3(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return rS(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(v4(this._zod.def,{catchall:e}))},passthrough(){return this.clone(v4(this._zod.def,{catchall:V9()}))},loose(){return this.clone(v4(this._zod.def,{catchall:V9()}))},strict(){return this.clone(v4(this._zod.def,{catchall:U9()}))},strip(){return this.clone(v4(this._zod.def,{catchall:void 0}))},extend(e){return I4(this,e)},safeExtend(e){return R4(this,e)},merge(e){return z4(this,e)},pick(e){return N4(this,e)},omit(e){return F4(this,e)},partial(...e){return B4(sS,this,e[0])},exactPartial(...e){return B4(lS,this,e[0],`exactPartial`)},required(...e){return V4(_S,this,e[0])}});function q9(e,t){return new K9({type:`object`,shape:e??{},...G(t)})}function J(e,t){return new K9({type:`object`,shape:e,catchall:V9(),...G(t)})}var J9=K(`ZodUnion`,(e,t)=>{o8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>h7(e,t,n,r),e.options=t.options});function Y9(e,t){return new J9({type:`union`,options:e,...G(t)})}var X9=K(`ZodDiscriminatedUnion`,(e,t)=>{J9.init(e,t),c8.init(e,t)});function Z9(e,t,n){return new X9({type:`union`,options:t,discriminator:e,...G(n)})}var Q9=K(`ZodIntersection`,(e,t)=>{l8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>g7(e,t,n,r)});function $9(e,t){return new Q9({type:`intersection`,left:e,right:t})}var eS=K(`ZodRecord`,(e,t)=>{Q7(),f8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>x7(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function tS(e,t,n){return!t||!t._zod?new eS({type:`record`,keyType:q(),valueType:e,...G(t)}):new eS({type:`record`,keyType:e,valueType:t,...G(n)})}var nS=K(`ZodEnum`,(e,t)=>{p8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>t7(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new nS({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new nS({...t,checks:[],...G(r),entries:i})}});function rS(e,t){return new nS({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var iS=K(`ZodLiteral`,(e,t)=>{m8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n7(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Y(e,t){return new iS({type:`literal`,values:Array.isArray(e)?e:[e],...G(t)})}var aS=K(`ZodTransform`,(e,t)=>{Q7(),h8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>l7(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new y3(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push($4(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push($4(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function oS(e){return new aS({type:`transform`,transform:e})}var sS=K(`ZodOptional`,(e,t)=>{_8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>M7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cS(e){return new sS({type:`optional`,innerType:e})}var lS=K(`ZodExactOptional`,(e,t)=>{v8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>M7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uS(e){return new lS({type:`optional`,innerType:e})}var dS=K(`ZodNullable`,(e,t)=>{y8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>S7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fS(e){return new dS({type:`nullable`,innerType:e})}var pS=K(`ZodDefault`,(e,t)=>{b8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>E7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function mS(e,t){return new pS({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():T4(t)}})}var hS=K(`ZodPrefault`,(e,t)=>{S8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>D7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gS(e,t){return new hS({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():T4(t)}})}var _S=K(`ZodNonOptional`,(e,t)=>{C8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>C7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vS(e,t){return new _S({type:`nonoptional`,innerType:e,...G(t)})}var yS=K(`ZodCatch`,(e,t)=>{E8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>O7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bS(e,t){return new yS({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:f3(t)})}var xS=K(`ZodPipe`,(e,t)=>{D8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>k7(e,t,n,r),e.in=t.in,e.out=t.out});function SS(e,t){return new xS({type:`pipe`,in:e,out:t})}var CS=K(`ZodPreprocess`,(e,t)=>{xS.init(e,t),k8.init(e,t)}),wS=K(`ZodReadonly`,(e,t)=>{A8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>A7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TS(e){return new wS({type:`readonly`,innerType:e})}var ES=K(`ZodLazy`,(e,t)=>{M8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>N7(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function DS(e){return new ES({type:`lazy`,getter:e})}var OS=K(`ZodCustom`,(e,t)=>{N8.init(e,t),$7.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s7(e,t,n,r)});function kS(e,t){return c5(OS,e??(()=>!0),t)}function AS(e,t={}){return l5(OS,e,t)}function jS(e,t){return u5(e,t)}function MS(e,t){return new CS({type:`pipe`,in:oS(e),out:t})}var NS=rS(W),PS=kS(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),FS=q(),IS=rS([`developer`,`system`,`assistant`,`user`]),LS=J({type:Y(W.TEXT_MESSAGE_START),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),role:IS.optional(),name:q().optional()}),RS=J({type:Y(W.TEXT_MESSAGE_CONTENT),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),delta:q()}),zS=J({type:Y(W.TEXT_MESSAGE_END),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q()}),BS=J({type:Y(W.TEXT_MESSAGE_CHUNK),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q().optional(),role:IS.optional(),delta:q().optional(),name:q().optional()}),VS=J({type:Y(W.TOOL_CALL_START),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),toolCallId:q(),toolCallName:q(),parentMessageId:q().optional()}),HS=J({type:Y(W.TOOL_CALL_ARGS),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),toolCallId:q(),delta:q()}),US=J({type:Y(W.TOOL_CALL_END),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),toolCallId:q()}),WS=J({type:Y(W.TOOL_CALL_CHUNK),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),toolCallId:q().optional(),toolCallName:q().optional(),parentMessageId:q().optional(),delta:q().optional()}),GS=J({type:Y(`text`),id:q().optional(),text:q(),metadata:z9().refine(e=>e!==null).optional()}),KS=Z9(`type`,[J({type:Y(`data`),value:q(),mimeType:q()}),J({type:Y(`url`),value:q(),mimeType:q().optional()}),J({type:Y(`file`),value:q(),provider:q().optional(),mimeType:q().optional()})]),qS=Z9(`type`,[GS,J({type:Y(`image`),id:q().optional(),source:KS,metadata:z9().refine(e=>e!==null).optional()}),J({type:Y(`audio`),id:q().optional(),source:KS,metadata:z9().refine(e=>e!==null).optional()}),J({type:Y(`video`),id:q().optional(),source:KS,metadata:z9().refine(e=>e!==null).optional()}),J({type:Y(`document`),id:q().optional(),source:KS,metadata:z9().refine(e=>e!==null).optional()})]),JS=J({type:Y(W.TOOL_CALL_RESULT),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),toolCallId:q(),content:Y9([q(),G9(qS)]),role:Y(`tool`).optional()}),YS=z9(),XS=J({type:Y(W.STATE_SNAPSHOT),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),snapshot:YS.refine(e=>e!==void 0)}),ZS=q().regex(RegExp(`^(/([^/~]|~[01])*)*$`)),QS=G9(Z9(`op`,[J({op:Y(`add`),path:ZS,value:z9().refine(e=>e!==void 0)}).meta({specOpen:!0}),J({op:Y(`remove`),path:ZS}).meta({specOpen:!0}),J({op:Y(`replace`),path:ZS,value:z9().refine(e=>e!==void 0)}).meta({specOpen:!0}),J({op:Y(`move`),from:ZS,path:ZS}).meta({specOpen:!0}),J({op:Y(`copy`),from:ZS,path:ZS}).meta({specOpen:!0}),J({op:Y(`test`),path:ZS,value:z9().refine(e=>e!==void 0)}).meta({specOpen:!0})])),$S=J({type:Y(W.STATE_DELTA),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),delta:QS}),eC=J({subagentRunId:FS.optional(),id:q(),role:Y(`developer`),name:q().optional(),encryptedValue:q().optional(),metadata:PS.optional(),content:q()}),tC=J({subagentRunId:FS.optional(),id:q(),role:Y(`system`),name:q().optional(),encryptedValue:q().optional(),metadata:PS.optional(),content:q()}),nC=J({name:q(),arguments:q()}),rC=J({id:q(),type:Y(`function`),function:nC,encryptedValue:q().optional(),metadata:PS.optional()}),iC=Z9(`role`,[eC,tC,J({subagentRunId:FS.optional(),id:q(),role:Y(`assistant`),name:q().optional(),encryptedValue:q().optional(),metadata:PS.optional(),content:q().optional(),toolCalls:G9(rC).optional()}),J({subagentRunId:FS.optional(),id:q(),role:Y(`user`),name:q().optional(),encryptedValue:q().optional(),metadata:PS.optional(),content:Y9([q(),G9(qS)])}),J({subagentRunId:FS.optional(),id:q(),role:Y(`tool`),content:Y9([q(),G9(qS)]),toolCallId:q(),error:q().optional(),encryptedValue:q().optional(),metadata:PS.optional()}),J({subagentRunId:FS.optional(),id:q(),role:Y(`activity`),activityType:q(),content:kS(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),metadata:PS.optional()}),J({subagentRunId:FS.optional(),id:q(),role:Y(`reasoning`),content:q(),encryptedValue:q().optional(),metadata:PS.optional()})]),aC=J({type:Y(W.MESSAGES_SNAPSHOT),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),messages:G9(iC)}),oC=J({type:Y(W.ACTIVITY_SNAPSHOT),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),activityType:q(),content:kS(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),replace:N9().optional()}),sC=J({type:Y(W.ACTIVITY_DELTA),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),activityType:q(),patch:QS}),cC=J({type:Y(W.RAW),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),event:z9().refine(e=>e!==void 0),source:q().optional()}),lC=J({type:Y(W.CUSTOM),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),name:q(),value:z9().refine(e=>e!==void 0)}),uC=J({name:q(),description:q(),parameters:z9().refine(e=>e!==null).optional(),metadata:PS.optional()}),dC=J({description:q(),value:q()}),fC=J({interruptId:q(),status:rS([`resolved`,`cancelled`]),payload:z9().refine(e=>e!==null).optional(),metadata:PS.optional()}),pC=J({threadId:q(),runId:q(),protocolVersion:q().optional(),parentRunId:q().optional(),state:YS.refine(e=>e!==null).nullable().transform(e=>e??void 0).optional(),messages:G9(iC),tools:G9(uC).default(()=>[]),context:G9(dC).default(()=>[]),forwardedProps:z9().refine(e=>e!==null).optional(),resume:G9(fC).optional()}),mC=J({type:Y(W.RUN_STARTED),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),threadId:q(),runId:q(),protocolVersion:q().optional(),parentRunId:q().optional(),input:pC.optional()}),hC=J({type:Y(`success`),pendingToolCallIds:G9(q()).optional()}),gC=J({subagentRunId:FS.optional(),id:q(),reason:q(),message:q().optional(),toolCallId:q().optional(),responseSchema:kS(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional(),expiresAt:q().optional(),metadata:PS.optional()}),_C=Z9(`type`,[hC,J({type:Y(`interrupt`),interrupts:G9(gC).min(1)}),J({type:Y(`cancelled`)})]),vC=J({provider:q().optional(),model:q().optional(),inputTokens:j9().min(0).max(0x1fffffffffffff).optional(),outputTokens:j9().min(0).max(0x1fffffffffffff).optional(),totalTokens:j9().min(0).max(0x1fffffffffffff).optional(),reasoningTokens:j9().min(0).max(0x1fffffffffffff).optional(),cachedInputTokens:j9().min(0).max(0x1fffffffffffff).optional(),cacheWriteInputTokens:j9().min(0).max(0x1fffffffffffff).optional()}),yC=J({type:Y(W.RUN_FINISHED),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),threadId:q(),runId:q(),result:z9().refine(e=>e!==null).optional(),outcome:_C.optional(),usage:G9(vC).optional()}),bC=J({type:Y(W.RUN_ERROR),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),message:q(),code:q().optional(),usage:G9(vC).optional()}),xC=J({type:Y(W.STEP_STARTED),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),stepName:q()}),SC=J({type:Y(W.STEP_FINISHED),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),stepName:q()}),CC=J({type:Y(W.REASONING_START),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q()}),wC=J({type:Y(W.REASONING_MESSAGE_START),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),role:Y(`reasoning`)}),TC=J({type:Y(W.REASONING_MESSAGE_CONTENT),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q(),delta:q()}),EC=J({type:Y(W.REASONING_MESSAGE_END),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q()}),DC=J({type:Y(W.REASONING_MESSAGE_CHUNK),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q().optional(),delta:q().optional()}),OC=J({type:Y(W.REASONING_END),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),messageId:q()}),kC=rS([`tool-call`,`message`]),AC=J({type:Y(W.REASONING_ENCRYPTED_VALUE),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS.optional(),subtype:kC,entityId:q(),encryptedValue:q()}),jC=J({type:Y(W.SUBAGENT_STARTED),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS,name:q(),description:q().optional(),parentSubagentRunId:FS.optional(),parentToolCallId:q().optional(),parentMessageId:q().optional()}),MC=Z9(`type`,[J({type:Y(`success`)}),J({type:Y(`suspended`),interruptIds:G9(q()).optional()})]),NC=Z9(`type`,[LS,RS,zS,BS,VS,HS,US,WS,JS,XS,$S,aC,oC,sC,cC,lC,mC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,AC,jC,J({type:Y(W.SUBAGENT_FINISHED),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS,result:z9().refine(e=>e!==null).optional(),outcome:MC.optional()}),J({type:Y(W.SUBAGENT_ERROR),timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional(),subagentRunId:FS,message:q(),code:q().optional()})]);rS([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]);var PC=J({name:q(),description:q().optional()}),FC=J({name:q().optional(),type:q().optional(),description:q().optional(),version:q().optional(),provider:q().optional(),documentationUrl:q().optional(),metadata:PS.optional()}),IC=J({streaming:N9().optional(),websocket:N9().optional(),httpBinary:N9().optional(),pushNotifications:N9().optional(),resumable:N9().optional()}),LC=J({supported:N9().optional(),items:G9(uC).optional(),parallelCalls:N9().optional(),clientProvided:N9().optional()}),RC=J({structuredOutput:N9().optional(),supportedMimeTypes:G9(q()).optional()}),zC=J({snapshots:N9().optional(),deltas:N9().optional(),memory:N9().optional(),persistentState:N9().optional()}),BC=J({supported:N9().optional(),delegation:N9().optional(),handoffs:N9().optional(),subagents:G9(PC).optional()}),VC=J({supported:N9().optional(),streaming:N9().optional(),encrypted:N9().optional()}),HC=J({image:N9().optional(),audio:N9().optional(),video:N9().optional(),pdf:N9().optional(),file:N9().optional()}),UC=J({image:N9().optional(),audio:N9().optional()}),WC=J({input:HC.optional(),output:UC.optional()}),GC=J({codeExecution:N9().optional(),sandboxed:N9().optional(),maxIterations:j9().min(0).max(0x1fffffffffffff).optional(),maxExecutionTime:j9().min(0).max(0x1fffffffffffff).optional()}),KC=J({supported:N9().optional(),approvals:N9().optional(),interventions:N9().optional(),feedback:N9().optional(),interrupts:N9().optional(),approveWithEdits:N9().optional()});J({identity:FC.optional(),transport:IC.optional(),tools:LC.optional(),output:RC.optional(),state:zC.optional(),multiAgent:BC.optional(),reasoning:VC.optional(),multimodal:WC.optional(),execution:GC.optional(),humanInTheLoop:KC.optional(),custom:kS(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional()}),J({subagentRunId:FS.optional()}),J({type:NS,timestamp:j9().min(-0x1fffffffffffff).max(0x1fffffffffffff).optional(),rawEvent:z9().refine(e=>e!==null).optional(),metadata:PS.optional()}),J({subagentRunId:FS.optional(),id:q(),role:q(),name:q().optional(),encryptedValue:q().optional(),metadata:PS.optional()}),PS.optional();function qC(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128))this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;else{for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=JC&&(i+=r/JC|0,r%=JC)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?ew(r,i):$C(r,i)}function XC(e,t){let n=$C(e,t),r=n.hi&0x80000000;r&&(n=ew(n.lo,n.hi));let i=ZC(n.lo,n.hi);return r?`-`+i:i}function ZC(e,t){if({lo:e,hi:t}=QC(e,t),t<=2097151)return String(JC*t+e);let n=e&0xffffff,r=(e>>>24|t<<8)&0xffffff,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+tw(o)+tw(a)}function QC(e,t){return{lo:e>>>0,hi:t>>>0}}function $C(e,t){return{lo:e|0,hi:t|0}}function ew(e,t){return t=~t,e?e=~e+1:t+=1,$C(e,t)}var tw=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function nw(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var rw=iw();function iw(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),cw(i)}return sw}function uw(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var dw;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(dw||={});var X=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?uw(e):lw().encodeUtf8Into,this.buffer=mw,this.viewCache=hw,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||fw;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(pw),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-pw,n=_w(t);return n>pw&&(this.ensureCapacity(n-pw),this.buffer.copyWithin(e+n,e+pw,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(yw(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(vw(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=gw){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=_w(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=_w(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return bw(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return yw(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return vw(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return vw(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=rw.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=rw.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=rw.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=rw.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=rw.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},fw=128,pw=1,mw=new Uint8Array,hw=new DataView(mw.buffer),gw=32;function _w(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var Z=class{constructor(e,t=lw().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=qC,this.uint32=nw,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case dw.Varint:for(;this.buf[this.pos++]&128;);break;case dw.Bit64:this.pos+=4;case dw.Bit32:this.pos+=4;break;case dw.LengthDelimited:let r=this.uint32();this.pos+=r;break;case dw.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===dw.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),rw.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),rw.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,rw.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return rw.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return rw.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=gw){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function vw(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>0x7fffffff||e<-0x80000000)throw Error(`invalid int32: `+e)}function yw(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>0xffffffff||e<0)throw Error(`invalid uint32: `+e)}function bw(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(!Number.isFinite(Math.fround(e))&&Number.isFinite(e))throw Error(`invalid float32: `+e)}var xw=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Sw(){return{fields:{}}}var Cw={encode(e,t=new X){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&Tw.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Sw();for(;n.pos>>3){case 1:{if(e!==10)break;let t=Tw.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Cw.fromPartial(e??{})},fromPartial(e){let t=Sw();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=Sw();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function ww(){return{key:``,value:void 0}}var Tw={encode(e,t=new X){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Q.encode(Q.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=ww();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Q.unwrap(Q.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Tw.fromPartial(e??{})},fromPartial(e){let t=ww();return t.key=e.key??``,t.value=e.value??void 0,t}};function Ew(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Q={encode(e,t=new X){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Cw.encode(Cw.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Ow.encode(Ow.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Ew();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=Cw.unwrap(Cw.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=Ow.unwrap(Ow.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Q.fromPartial(e??{})},fromPartial(e){let t=Ew();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=Ew();if(e===null)t.nullValue=xw.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Dw(){return{values:[]}}var Ow={encode(e,t=new X){for(let n of e.values)Q.encode(Q.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Dw();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(Q.unwrap(Q.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ow.fromPartial(e??{})},fromPartial(e){let t=Dw();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=Dw();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},kw=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Aw(){return{op:0,path:``,from:void 0,value:void 0}}var jw={encode(e,t=new X){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Q.encode(Q.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Aw();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=Q.unwrap(Q.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return jw.fromPartial(e??{})},fromPartial(e){let t=Aw();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function Mw(){return{text:``,id:void 0,metadata:void 0}}var Nw={encode(e,t=new X){return e.text!==``&&t.uint32(10).string(e.text),e.id!==void 0&&t.uint32(18).string(e.id),e.metadata!==void 0&&Q.encode(Q.wrap(e.metadata),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Mw();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue;case 2:if(e!==18)break;i.id=n.string();continue;case 3:if(e!==26)break;i.metadata=Q.unwrap(Q.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Nw.fromPartial(e??{})},fromPartial(e){let t=Mw();return t.text=e.text??``,t.id=e.id??void 0,t.metadata=e.metadata??void 0,t}};function Pw(){return{source:void 0,metadata:void 0,id:void 0}}var Fw={encode(e,t=new X){return e.source!==void 0&&Uw.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Q.encode(Q.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Pw();for(;n.pos>>3){case 1:if(e!==10)break;i.source=Uw.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Q.unwrap(Q.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Fw.fromPartial(e??{})},fromPartial(e){let t=Pw();return t.source=e.source!==void 0&&e.source!==null?Uw.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Iw(){return{value:``,mimeType:``}}var Lw={encode(e,t=new X){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Iw();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Lw.fromPartial(e??{})},fromPartial(e){let t=Iw();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function Rw(){return{value:``,mimeType:void 0}}var zw={encode(e,t=new X){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Rw();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return zw.fromPartial(e??{})},fromPartial(e){let t=Rw();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function Bw(){return{value:``,provider:void 0,mimeType:void 0}}var Vw={encode(e,t=new X){return e.value!==``&&t.uint32(10).string(e.value),e.provider!==void 0&&t.uint32(18).string(e.provider),e.mimeType!==void 0&&t.uint32(26).string(e.mimeType),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Bw();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.provider=n.string();continue;case 3:if(e!==26)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Vw.fromPartial(e??{})},fromPartial(e){let t=Bw();return t.value=e.value??``,t.provider=e.provider??void 0,t.mimeType=e.mimeType??void 0,t}};function Hw(){return{data:void 0,url:void 0,file:void 0}}var Uw={encode(e,t=new X){return e.data!==void 0&&Lw.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&zw.encode(e.url,t.uint32(18).fork()).join(),e.file!==void 0&&Vw.encode(e.file,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Hw();for(;n.pos>>3){case 1:if(e!==10)break;i.data=Lw.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=zw.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.file=Vw.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Uw.fromPartial(e??{})},fromPartial(e){let t=Hw();return t.data=e.data!==void 0&&e.data!==null?Lw.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?zw.fromPartial(e.url):void 0,t.file=e.file!==void 0&&e.file!==null?Vw.fromPartial(e.file):void 0,t}};function Ww(){return{source:void 0,metadata:void 0,id:void 0}}var Gw={encode(e,t=new X){return e.source!==void 0&&Uw.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Q.encode(Q.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Ww();for(;n.pos>>3){case 1:if(e!==10)break;i.source=Uw.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Q.unwrap(Q.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Gw.fromPartial(e??{})},fromPartial(e){let t=Ww();return t.source=e.source!==void 0&&e.source!==null?Uw.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Kw(){return{source:void 0,metadata:void 0,id:void 0}}var qw={encode(e,t=new X){return e.source!==void 0&&Uw.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Q.encode(Q.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Kw();for(;n.pos>>3){case 1:if(e!==10)break;i.source=Uw.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Q.unwrap(Q.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return qw.fromPartial(e??{})},fromPartial(e){let t=Kw();return t.source=e.source!==void 0&&e.source!==null?Uw.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Jw(){return{source:void 0,metadata:void 0,id:void 0}}var Yw={encode(e,t=new X){return e.source!==void 0&&Uw.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Q.encode(Q.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Jw();for(;n.pos>>3){case 1:if(e!==10)break;i.source=Uw.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Q.unwrap(Q.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Yw.fromPartial(e??{})},fromPartial(e){let t=Jw();return t.source=e.source!==void 0&&e.source!==null?Uw.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Xw(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Zw={encode(e,t=new X){return e.text!==void 0&&Nw.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Fw.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Gw.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&qw.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Yw.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Xw();for(;n.pos>>3){case 1:if(e!==10)break;i.text=Nw.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=Fw.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=Gw.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=qw.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=Yw.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Zw.fromPartial(e??{})},fromPartial(e){let t=Xw();return t.text=e.text!==void 0&&e.text!==null?Nw.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Fw.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Gw.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?qw.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Yw.fromPartial(e.document):void 0,t}};function Qw(){return{id:``,type:``,function:void 0,metadata:void 0,encryptedValue:void 0}}var $w={encode(e,t=new X){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&tT.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&Cw.encode(Cw.wrap(e.metadata),t.uint32(34).fork()).join(),e.encryptedValue!==void 0&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=Qw();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=tT.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=Cw.unwrap(Cw.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return $w.fromPartial(e??{})},fromPartial(e){let t=Qw();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?tT.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t.encryptedValue=e.encryptedValue??void 0,t}};function eT(){return{name:``,arguments:``}}var tT={encode(e,t=new X){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=eT();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return tT.fromPartial(e??{})},fromPartial(e){let t=eT();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function nT(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0,encryptedValue:void 0,activityType:void 0,activityContent:void 0}}var rT={encode(e,t=new X){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)$w.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)Zw.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&Cw.encode(Cw.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),e.encryptedValue!==void 0&&t.uint32(90).string(e.encryptedValue),e.activityType!==void 0&&t.uint32(98).string(e.activityType),e.activityContent!==void 0&&Cw.encode(Cw.wrap(e.activityContent),t.uint32(106).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=nT();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push($w.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(Zw.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=Cw.unwrap(Cw.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue;case 11:if(e!==90)break;i.encryptedValue=n.string();continue;case 12:if(e!==98)break;i.activityType=n.string();continue;case 13:if(e!==106)break;i.activityContent=Cw.unwrap(Cw.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return rT.fromPartial(e??{})},fromPartial(e){let t=nT();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>$w.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>Zw.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t.encryptedValue=e.encryptedValue??void 0,t.activityType=e.activityType??void 0,t.activityContent=e.activityContent??void 0,t}};function iT(){return{name:``,description:``,parameters:void 0,metadata:void 0}}var aT={encode(e,t=new X){return e.name!==``&&t.uint32(10).string(e.name),e.description!==``&&t.uint32(18).string(e.description),e.parameters!==void 0&&Q.encode(Q.wrap(e.parameters),t.uint32(26).fork()).join(),e.metadata!==void 0&&Cw.encode(Cw.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=iT();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.description=n.string();continue;case 3:if(e!==26)break;i.parameters=Q.unwrap(Q.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Cw.unwrap(Cw.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return aT.fromPartial(e??{})},fromPartial(e){let t=iT();return t.name=e.name??``,t.description=e.description??``,t.parameters=e.parameters??void 0,t.metadata=e.metadata??void 0,t}};function oT(){return{description:``,value:``}}var sT={encode(e,t=new X){return e.description!==``&&t.uint32(10).string(e.description),e.value!==``&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=oT();for(;n.pos>>3){case 1:if(e!==10)break;i.description=n.string();continue;case 2:if(e!==18)break;i.value=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return sT.fromPartial(e??{})},fromPartial(e){let t=oT();return t.description=e.description??``,t.value=e.value??``,t}};function cT(){return{interruptId:``,status:``,payload:void 0,metadata:void 0}}var lT={encode(e,t=new X){return e.interruptId!==``&&t.uint32(10).string(e.interruptId),e.status!==``&&t.uint32(18).string(e.status),e.payload!==void 0&&Q.encode(Q.wrap(e.payload),t.uint32(26).fork()).join(),e.metadata!==void 0&&Cw.encode(Cw.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=cT();for(;n.pos>>3){case 1:if(e!==10)break;i.interruptId=n.string();continue;case 2:if(e!==18)break;i.status=n.string();continue;case 3:if(e!==26)break;i.payload=Q.unwrap(Q.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Cw.unwrap(Cw.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return lT.fromPartial(e??{})},fromPartial(e){let t=cT();return t.interruptId=e.interruptId??``,t.status=e.status??``,t.payload=e.payload??void 0,t.metadata=e.metadata??void 0,t}};function uT(){return{threadId:``,runId:``,parentRunId:void 0,state:void 0,messages:[],tools:[],context:[],forwardedProps:void 0,resume:[],protocolVersion:void 0}}var dT={encode(e,t=new X){e.threadId!==``&&t.uint32(10).string(e.threadId),e.runId!==``&&t.uint32(18).string(e.runId),e.parentRunId!==void 0&&t.uint32(26).string(e.parentRunId),e.state!==void 0&&Q.encode(Q.wrap(e.state),t.uint32(34).fork()).join();for(let n of e.messages)rT.encode(n,t.uint32(42).fork()).join();for(let n of e.tools)aT.encode(n,t.uint32(50).fork()).join();for(let n of e.context)sT.encode(n,t.uint32(58).fork()).join();e.forwardedProps!==void 0&&Q.encode(Q.wrap(e.forwardedProps),t.uint32(66).fork()).join();for(let n of e.resume)lT.encode(n,t.uint32(74).fork()).join();return e.protocolVersion!==void 0&&t.uint32(82).string(e.protocolVersion),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=uT();for(;n.pos>>3){case 1:if(e!==10)break;i.threadId=n.string();continue;case 2:if(e!==18)break;i.runId=n.string();continue;case 3:if(e!==26)break;i.parentRunId=n.string();continue;case 4:if(e!==34)break;i.state=Q.unwrap(Q.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.messages.push(rT.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.tools.push(aT.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.context.push(sT.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.forwardedProps=Q.unwrap(Q.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.resume.push(lT.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return dT.fromPartial(e??{})},fromPartial(e){let t=uT();return t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.state=e.state??void 0,t.messages=e.messages?.map(e=>rT.fromPartial(e))||[],t.tools=e.tools?.map(e=>aT.fromPartial(e))||[],t.context=e.context?.map(e=>sT.fromPartial(e))||[],t.forwardedProps=e.forwardedProps??void 0,t.resume=e.resume?.map(e=>lT.fromPartial(e))||[],t.protocolVersion=e.protocolVersion??void 0,t}};function fT(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var pT={encode(e,t=new X){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&Q.encode(Q.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&Q.encode(Q.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=fT();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=Q.unwrap(Q.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=Q.unwrap(Q.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return pT.fromPartial(e??{})},fromPartial(e){let t=fT();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},mT=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.TEXT_MESSAGE_CHUNK=19]=`TEXT_MESSAGE_CHUNK`,e[e.TOOL_CALL_CHUNK=20]=`TOOL_CALL_CHUNK`,e[e.TOOL_CALL_RESULT=21]=`TOOL_CALL_RESULT`,e[e.ACTIVITY_SNAPSHOT=22]=`ACTIVITY_SNAPSHOT`,e[e.ACTIVITY_DELTA=23]=`ACTIVITY_DELTA`,e[e.REASONING_START=24]=`REASONING_START`,e[e.REASONING_MESSAGE_START=25]=`REASONING_MESSAGE_START`,e[e.REASONING_MESSAGE_CONTENT=26]=`REASONING_MESSAGE_CONTENT`,e[e.REASONING_MESSAGE_END=27]=`REASONING_MESSAGE_END`,e[e.REASONING_MESSAGE_CHUNK=28]=`REASONING_MESSAGE_CHUNK`,e[e.REASONING_END=29]=`REASONING_END`,e[e.REASONING_ENCRYPTED_VALUE=30]=`REASONING_ENCRYPTED_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function hT(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var $={encode(e,t=new X){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Q.encode(Q.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&Cw.encode(Cw.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=hT();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=OE(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=Q.unwrap(Q.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Cw.unwrap(Cw.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return $.fromPartial(e??{})},fromPartial(e){let t=hT();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function gT(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var _T={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=gT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return _T.fromPartial(e??{})},fromPartial(e){let t=gT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function vT(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var yT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=vT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return yT.fromPartial(e??{})},fromPartial(e){let t=vT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function bT(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var xT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=bT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return xT.fromPartial(e??{})},fromPartial(e){let t=bT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function ST(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var CT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=ST();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return CT.fromPartial(e??{})},fromPartial(e){let t=ST();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function wT(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var TT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=wT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return TT.fromPartial(e??{})},fromPartial(e){let t=wT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function ET(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var DT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=ET();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return DT.fromPartial(e??{})},fromPartial(e){let t=ET();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function OT(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var kT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=OT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return kT.fromPartial(e??{})},fromPartial(e){let t=OT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function AT(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var jT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=AT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return jT.fromPartial(e??{})},fromPartial(e){let t=AT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function MT(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,toolCallId:``,content:void 0,role:void 0,contentParts:[]}}var NT={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.toolCallId!==``&&t.uint32(34).string(e.toolCallId),e.content!==void 0&&t.uint32(42).string(e.content),e.role!==void 0&&t.uint32(50).string(e.role);for(let n of e.contentParts)Zw.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=MT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.content=n.string();continue;case 6:if(e!==50)break;i.role=n.string();continue;case 7:if(e!==58)break;i.contentParts.push(Zw.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return NT.fromPartial(e??{})},fromPartial(e){let t=MT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.toolCallId=e.toolCallId??``,t.content=e.content??void 0,t.role=e.role??void 0,t.contentParts=e.contentParts?.map(e=>Zw.fromPartial(e))||[],t}};function PT(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var FT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Q.encode(Q.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=PT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=Q.unwrap(Q.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return FT.fromPartial(e??{})},fromPartial(e){let t=PT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function IT(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var LT={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)jw.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=IT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(jw.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return LT.fromPartial(e??{})},fromPartial(e){let t=IT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>jw.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function RT(){return{baseEvent:void 0,messages:[]}}var zT={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)rT.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=RT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(rT.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return zT.fromPartial(e??{})},fromPartial(e){let t=RT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>rT.fromPartial(e))||[],t}};function BT(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,content:void 0,replace:void 0}}var VT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType),e.content!==void 0&&Cw.encode(Cw.wrap(e.content),t.uint32(42).fork()).join(),e.replace!==void 0&&t.uint32(48).bool(e.replace),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=BT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.content=Cw.unwrap(Cw.decode(n,n.uint32()));continue;case 6:if(e!==48)break;i.replace=n.bool();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return VT.fromPartial(e??{})},fromPartial(e){let t=BT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.content=e.content??void 0,t.replace=e.replace??void 0,t}};function HT(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,patch:[]}}var UT={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType);for(let n of e.patch)jw.encode(n,t.uint32(42).fork()).join();return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=HT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.patch.push(jw.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return UT.fromPartial(e??{})},fromPartial(e){let t=HT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.patch=e.patch?.map(e=>jw.fromPartial(e))||[],t}};function WT(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var GT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Q.encode(Q.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=WT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=Q.unwrap(Q.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return GT.fromPartial(e??{})},fromPartial(e){let t=WT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function KT(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var qT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&Q.encode(Q.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=KT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=Q.unwrap(Q.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return qT.fromPartial(e??{})},fromPartial(e){let t=KT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function JT(){return{baseEvent:void 0,threadId:``,runId:``,parentRunId:void 0,input:void 0,protocolVersion:void 0}}var YT={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.parentRunId!==void 0&&t.uint32(34).string(e.parentRunId),e.input!==void 0&&dT.encode(e.input,t.uint32(42).fork()).join(),e.protocolVersion!==void 0&&t.uint32(50).string(e.protocolVersion),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=JT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.parentRunId=n.string();continue;case 5:if(e!==42)break;i.input=dT.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return YT.fromPartial(e??{})},fromPartial(e){let t=JT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.input=e.input!==void 0&&e.input!==null?dT.fromPartial(e.input):void 0,t.protocolVersion=e.protocolVersion??void 0,t}};function XT(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[],pendingToolCallIds:[]}}var ZT={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&Q.encode(Q.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)pT.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)DE.encode(n,t.uint32(58).fork()).join();for(let n of e.pendingToolCallIds)t.uint32(66).string(n);return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=XT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=Q.unwrap(Q.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(pT.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(DE.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.pendingToolCallIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ZT.fromPartial(e??{})},fromPartial(e){let t=XT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>pT.fromPartial(e))||[],t.usage=e.usage?.map(e=>DE.fromPartial(e))||[],t.pendingToolCallIds=e.pendingToolCallIds?.map(e=>e)||[],t}};function QT(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var $T={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)DE.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=QT();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(DE.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return $T.fromPartial(e??{})},fromPartial(e){let t=QT();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>DE.fromPartial(e))||[],t}};function eE(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var tE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=eE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return tE.fromPartial(e??{})},fromPartial(e){let t=eE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function nE(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var rE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=nE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return rE.fromPartial(e??{})},fromPartial(e){let t=nE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function iE(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var aE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=iE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return aE.fromPartial(e??{})},fromPartial(e){let t=iE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function oE(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,role:``}}var sE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.role!==``&&t.uint32(34).string(e.role),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=oE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.role=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return sE.fromPartial(e??{})},fromPartial(e){let t=oE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.role=e.role??``,t}};function cE(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,delta:``}}var lE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.delta!==``&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=cE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return lE.fromPartial(e??{})},fromPartial(e){let t=cE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function uE(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var dE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=uE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return dE.fromPartial(e??{})},fromPartial(e){let t=uE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function fE(){return{baseEvent:void 0,subagentRunId:void 0,messageId:void 0,delta:void 0}}var pE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==void 0&&t.uint32(26).string(e.messageId),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=fE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return pE.fromPartial(e??{})},fromPartial(e){let t=fE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??void 0,t.delta=e.delta??void 0,t}};function mE(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var hE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=mE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return hE.fromPartial(e??{})},fromPartial(e){let t=mE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function gE(){return{baseEvent:void 0,subagentRunId:void 0,subtype:``,entityId:``,encryptedValue:``}}var _E={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.subtype!==``&&t.uint32(26).string(e.subtype),e.entityId!==``&&t.uint32(34).string(e.entityId),e.encryptedValue!==``&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=gE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.subtype=n.string();continue;case 4:if(e!==34)break;i.entityId=n.string();continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return _E.fromPartial(e??{})},fromPartial(e){let t=gE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.subtype=e.subtype??``,t.entityId=e.entityId??``,t.encryptedValue=e.encryptedValue??``,t}};function vE(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var yE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=vE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return yE.fromPartial(e??{})},fromPartial(e){let t=vE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function bE(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var xE={encode(e,t=new X){e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&Q.encode(Q.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=bE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=Q.unwrap(Q.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return xE.fromPartial(e??{})},fromPartial(e){let t=bE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function SE(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var CE={encode(e,t=new X){return e.baseEvent!==void 0&&$.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=SE();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=$.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return CE.fromPartial(e??{})},fromPartial(e){let t=SE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?$.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function wE(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0,toolCallResult:void 0,activitySnapshot:void 0,activityDelta:void 0,reasoningStart:void 0,reasoningMessageStart:void 0,reasoningMessageContent:void 0,reasoningMessageEnd:void 0,reasoningMessageChunk:void 0,reasoningEnd:void 0,reasoningEncryptedValue:void 0}}var TE={encode(e,t=new X){return e.textMessageStart!==void 0&&_T.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&yT.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&xT.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&TT.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&DT.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&kT.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&FT.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&<.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&zT.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&>.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&qT.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&YT.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&ZT.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&$T.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&tE.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&rE.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&CT.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&jT.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&yE.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&xE.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&CE.encode(e.subagentError,t.uint32(170).fork()).join(),e.toolCallResult!==void 0&&NT.encode(e.toolCallResult,t.uint32(178).fork()).join(),e.activitySnapshot!==void 0&&VT.encode(e.activitySnapshot,t.uint32(186).fork()).join(),e.activityDelta!==void 0&&UT.encode(e.activityDelta,t.uint32(194).fork()).join(),e.reasoningStart!==void 0&&aE.encode(e.reasoningStart,t.uint32(202).fork()).join(),e.reasoningMessageStart!==void 0&&sE.encode(e.reasoningMessageStart,t.uint32(210).fork()).join(),e.reasoningMessageContent!==void 0&&lE.encode(e.reasoningMessageContent,t.uint32(218).fork()).join(),e.reasoningMessageEnd!==void 0&&dE.encode(e.reasoningMessageEnd,t.uint32(226).fork()).join(),e.reasoningMessageChunk!==void 0&&pE.encode(e.reasoningMessageChunk,t.uint32(234).fork()).join(),e.reasoningEnd!==void 0&&hE.encode(e.reasoningEnd,t.uint32(242).fork()).join(),e.reasoningEncryptedValue!==void 0&&_E.encode(e.reasoningEncryptedValue,t.uint32(250).fork()).join(),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=wE();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=_T.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=yT.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=xT.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=TT.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=DT.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=kT.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=FT.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=LT.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=zT.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=GT.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=qT.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=YT.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=ZT.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=$T.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=tE.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=rE.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=CT.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=jT.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=yE.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=xE.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=CE.decode(n,n.uint32());continue;case 22:if(e!==178)break;i.toolCallResult=NT.decode(n,n.uint32());continue;case 23:if(e!==186)break;i.activitySnapshot=VT.decode(n,n.uint32());continue;case 24:if(e!==194)break;i.activityDelta=UT.decode(n,n.uint32());continue;case 25:if(e!==202)break;i.reasoningStart=aE.decode(n,n.uint32());continue;case 26:if(e!==210)break;i.reasoningMessageStart=sE.decode(n,n.uint32());continue;case 27:if(e!==218)break;i.reasoningMessageContent=lE.decode(n,n.uint32());continue;case 28:if(e!==226)break;i.reasoningMessageEnd=dE.decode(n,n.uint32());continue;case 29:if(e!==234)break;i.reasoningMessageChunk=pE.decode(n,n.uint32());continue;case 30:if(e!==242)break;i.reasoningEnd=hE.decode(n,n.uint32());continue;case 31:if(e!==250)break;i.reasoningEncryptedValue=_E.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return TE.fromPartial(e??{})},fromPartial(e){let t=wE();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?_T.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?yT.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?xT.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?TT.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?DT.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?kT.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?FT.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?LT.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?zT.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?GT.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?qT.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?YT.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?ZT.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?$T.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?tE.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?rE.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?CT.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?jT.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?yE.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?xE.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?CE.fromPartial(e.subagentError):void 0,t.toolCallResult=e.toolCallResult!==void 0&&e.toolCallResult!==null?NT.fromPartial(e.toolCallResult):void 0,t.activitySnapshot=e.activitySnapshot!==void 0&&e.activitySnapshot!==null?VT.fromPartial(e.activitySnapshot):void 0,t.activityDelta=e.activityDelta!==void 0&&e.activityDelta!==null?UT.fromPartial(e.activityDelta):void 0,t.reasoningStart=e.reasoningStart!==void 0&&e.reasoningStart!==null?aE.fromPartial(e.reasoningStart):void 0,t.reasoningMessageStart=e.reasoningMessageStart!==void 0&&e.reasoningMessageStart!==null?sE.fromPartial(e.reasoningMessageStart):void 0,t.reasoningMessageContent=e.reasoningMessageContent!==void 0&&e.reasoningMessageContent!==null?lE.fromPartial(e.reasoningMessageContent):void 0,t.reasoningMessageEnd=e.reasoningMessageEnd!==void 0&&e.reasoningMessageEnd!==null?dE.fromPartial(e.reasoningMessageEnd):void 0,t.reasoningMessageChunk=e.reasoningMessageChunk!==void 0&&e.reasoningMessageChunk!==null?pE.fromPartial(e.reasoningMessageChunk):void 0,t.reasoningEnd=e.reasoningEnd!==void 0&&e.reasoningEnd!==null?hE.fromPartial(e.reasoningEnd):void 0,t.reasoningEncryptedValue=e.reasoningEncryptedValue!==void 0&&e.reasoningEncryptedValue!==null?_E.fromPartial(e.reasoningEncryptedValue):void 0,t}};function EE(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0,cacheWriteInputTokens:void 0}}var DE={encode(e,t=new X){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),e.cacheWriteInputTokens!==void 0&&t.uint32(64).int64(e.cacheWriteInputTokens),t},decode(e,t){let n=e instanceof Z?e:new Z(e),r=t===void 0?n.len:n.pos+t,i=EE();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=OE(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=OE(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=OE(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=OE(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=OE(n.int64());continue;case 8:if(e!==64)break;i.cacheWriteInputTokens=OE(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return DE.fromPartial(e??{})},fromPartial(e){let t=EE();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t.cacheWriteInputTokens=e.cacheWriteInputTokens??void 0,t}};function OE(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,AE=e=>Array.isArray(e)?e:[],jE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,ME=()=>{jE()||console.warn(`[ag-ui][proto] Dropped a content part this build does not know: the protocol has a variant this SDK predates.`)};new Set(Object.values(W));var NE={textMessageStart:`TEXT_MESSAGE_START`,textMessageContent:`TEXT_MESSAGE_CONTENT`,textMessageEnd:`TEXT_MESSAGE_END`,textMessageChunk:`TEXT_MESSAGE_CHUNK`,toolCallStart:`TOOL_CALL_START`,toolCallArgs:`TOOL_CALL_ARGS`,toolCallEnd:`TOOL_CALL_END`,toolCallChunk:`TOOL_CALL_CHUNK`,toolCallResult:`TOOL_CALL_RESULT`,stateSnapshot:`STATE_SNAPSHOT`,stateDelta:`STATE_DELTA`,messagesSnapshot:`MESSAGES_SNAPSHOT`,activitySnapshot:`ACTIVITY_SNAPSHOT`,activityDelta:`ACTIVITY_DELTA`,raw:`RAW`,custom:`CUSTOM`,runStarted:`RUN_STARTED`,runFinished:`RUN_FINISHED`,runError:`RUN_ERROR`,stepStarted:`STEP_STARTED`,stepFinished:`STEP_FINISHED`,reasoningStart:`REASONING_START`,reasoningMessageStart:`REASONING_MESSAGE_START`,reasoningMessageContent:`REASONING_MESSAGE_CONTENT`,reasoningMessageEnd:`REASONING_MESSAGE_END`,reasoningMessageChunk:`REASONING_MESSAGE_CHUNK`,reasoningEnd:`REASONING_END`,reasoningEncryptedValue:`REASONING_ENCRYPTED_VALUE`,subagentStarted:`SUBAGENT_STARTED`,subagentFinished:`SUBAGENT_FINISHED`,subagentError:`SUBAGENT_ERROR`},PE=new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),FE=e=>{let t=kE(e);if(t){if([t.data,t.url,t.file].filter(Boolean).length>1)throw Error(`Invalid event: source carries more than one arm`);if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}if(t.file){let e=t.file;return{type:`file`,value:e.value,provider:e.provider,mimeType:e.mimeType}}}},IE=e=>{let t=kE(e);if(t){if([t.text,t.image,t.audio,t.video,t.document].filter(Boolean).length>1)throw Error(`Invalid event: content part carries more than one arm`);if(t.text){let e=t.text;return{type:`text`,id:e.id,text:e.text,metadata:e.metadata}}if(t.image){let e=t.image;return e.source!==void 0&&FE(e.source)===void 0?void 0:{type:`image`,id:e.id,source:FE(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return e.source!==void 0&&FE(e.source)===void 0?void 0:{type:`audio`,id:e.id,source:FE(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return e.source!==void 0&&FE(e.source)===void 0?void 0:{type:`video`,id:e.id,source:FE(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return e.source!==void 0&&FE(e.source)===void 0?void 0:{type:`document`,id:e.id,source:FE(e.source),metadata:e.metadata}}}},LE=new Set([`activity`]),RE=new Set([`user`,`tool`]),zE=new Set([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]),BE=e=>{let t=kE(e)??{},n={...t},r=typeof t.role==`string`?t.role:``,i=zE.has(r),a=i?RE.has(r):AE(t.contentParts).length>0,o=i?LE.has(r):!a&&t.activityContent!==void 0;if(!i&&(t.content===void 0?0:1)+ +(AE(t.contentParts).length>0)+(t.activityContent===void 0?0:1)>1)throw Error(`Invalid event: message carries more than one content form`);if(i){if(!a&&AE(t.contentParts).length>0)throw Error(`Invalid event: message carries content parts for a role that has none`);if(t.activityContent!==void 0&&!o)throw Error(`Invalid event: message carries activity content for a non-activity role`);if(o&&t.content!==void 0)throw Error(`Invalid event: activity content cannot ride with other content forms`);if(a&&t.content!==void 0&&AE(t.contentParts).length>0)throw Error(`Invalid event: message carries both string content and content parts`)}return a&&t.content===void 0&&(n.content=AE(t.contentParts).map(e=>{let t=IE(e);return t===void 0&&ME(),t}).filter(e=>e!==void 0)),o&&t.activityContent!==void 0&&(n.content=t.activityContent),delete n.activityContent,delete n.contentParts,AE(t.toolCalls).length===0&&delete n.toolCalls,Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),n},VE=e=>{if(Array.isArray(e)){for(let t of e)VE(t);return}let t=kE(e);if(t)for(let e of Object.keys(t))t[e]===void 0?delete t[e]:VE(t[e])},HE=e=>{let t=kE(e);if(!t)return;let n={};return t.threadId!==void 0&&(n.threadId=t.threadId),t.runId!==void 0&&(n.runId=t.runId),t.protocolVersion!==void 0&&(n.protocolVersion=t.protocolVersion),t.parentRunId!==void 0&&(n.parentRunId=t.parentRunId),t.state!==void 0&&(n.state=t.state),n.messages=AE(t.messages).map(BE).filter(e=>e!==void 0),n.tools=AE(t.tools),n.context=AE(t.context),t.forwardedProps!==void 0&&(n.forwardedProps=t.forwardedProps),n.resume=AE(t.resume),n},UE={TextMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},BaseEvent:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},TextMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallArgsEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StateSnapshotEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},StateDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`JsonPatchOperation`}},JsonPatchOperation:{singular:new Set([4]),descend:{},google:{4:`google.protobuf.Value`}},MessagesSnapshotEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`Message`}},Message:{singular:new Set([9,13]),descend:{5:`ToolCall`,8:`InputContent`},google:{9:`google.protobuf.Struct`,13:`google.protobuf.Struct`}},ToolCall:{singular:new Set([3,4]),descend:{},google:{4:`google.protobuf.Struct`}},InputContent:{singular:new Set([1,2,3,4,5]),descend:{1:`TextInputPart`,2:`ImageInputPart`,3:`AudioInputPart`,4:`VideoInputPart`,5:`DocumentInputPart`},arms:new Set([1,2,3,4,5])},TextInputPart:{singular:new Set([3]),descend:{},google:{3:`google.protobuf.Value`}},ImageInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},InputContentSource:{singular:new Set([1,2,3]),descend:{},arms:new Set([1,2,3])},AudioInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},VideoInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},DocumentInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},RawEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},CustomEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},RunStartedEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`,5:`RunAgentInput`}},RunAgentInput:{singular:new Set([4,8]),descend:{5:`Message`,6:`Tool`,9:`ResumeEntry`},google:{4:`google.protobuf.Value`,8:`google.protobuf.Value`}},Tool:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},ResumeEntry:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},RunFinishedEvent:{singular:new Set([1,4]),descend:{1:`BaseEvent`,6:`Interrupt`},google:{4:`google.protobuf.Value`}},Interrupt:{singular:new Set([5,7]),descend:{},google:{5:`google.protobuf.Value`,7:`google.protobuf.Value`}},RunErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepFinishedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentFinishedEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},SubagentErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallResultEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,7:`InputContent`}},ActivitySnapshotEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`},google:{5:`google.protobuf.Struct`}},ActivityDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,5:`JsonPatchOperation`}},ReasoningStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEncryptedValueEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},"google.protobuf.Struct":{singular:new Set,descend:{1:`google.protobuf.Struct.FieldsEntry`}},"google.protobuf.Struct.FieldsEntry":{singular:new Set([2]),descend:{2:`google.protobuf.Value`}},"google.protobuf.Value":{singular:new Set([5,6]),descend:{5:`google.protobuf.Struct`,6:`google.protobuf.ListValue`},arms:new Set([1,2,3,4,5,6]),armWireTypes:{1:0,2:1,3:2,4:0,5:2,6:2}},"google.protobuf.ListValue":{singular:new Set,descend:{1:`google.protobuf.Value`}}},WE={1:`TextMessageStartEvent`,2:`TextMessageContentEvent`,3:`TextMessageEndEvent`,4:`ToolCallStartEvent`,5:`ToolCallArgsEvent`,6:`ToolCallEndEvent`,7:`StateSnapshotEvent`,8:`StateDeltaEvent`,9:`MessagesSnapshotEvent`,10:`RawEvent`,11:`CustomEvent`,12:`RunStartedEvent`,13:`RunFinishedEvent`,14:`RunErrorEvent`,15:`StepStartedEvent`,16:`StepFinishedEvent`,17:`TextMessageChunkEvent`,18:`ToolCallChunkEvent`,19:`SubagentStartedEvent`,20:`SubagentFinishedEvent`,21:`SubagentErrorEvent`,22:`ToolCallResultEvent`,23:`ActivitySnapshotEvent`,24:`ActivityDeltaEvent`,25:`ReasoningStartEvent`,26:`ReasoningMessageStartEvent`,27:`ReasoningMessageContentEvent`,28:`ReasoningMessageEndEvent`,29:`ReasoningMessageChunkEvent`,30:`ReasoningEndEvent`,31:`ReasoningEncryptedValueEvent`};function GE(e,t){let n=0,r=0;for(;;){if(t.offset>=e.length)throw Error(`Invalid event`);let i=e[t.offset++];if(r<28?n+=(i&127)*2**r:r===28&&(n+=(i&15)*2**28),r+=7,!(i&128))return n}}function KE(e,t){let n={offset:0},r=0,i=0;for(;n.offsete.length)throw Error(`Invalid event`);if(r===0){if(t.arms?.has(o)){if(i!==0&&i!==o)throw Error(`Invalid event`);i=o}let r=t.descend[o];if(r!==void 0){let t=UE[r];t!==void 0&&KE(e.subarray(n.offset,n.offset+a),t)}}n.offset+=a}else if(s===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}}if(r!==0)throw Error(`Invalid event`)}function qE(e){let t=new Set,n={offset:0},r=0;for(;n.offset0&&!t.has(a))throw Error(`Invalid event`);t.add(a)}if(o===0)GE(e,n);else if(o===1)n.offset+=8;else if(o===2){let t=GE(e,n);if(n.offset+t>e.length)throw Error(`Invalid event`);if(r===0){let r=WE[a];if(r!==void 0){let i=UE[r];i!==void 0&&KE(e.subarray(n.offset,n.offset+t),i)}}n.offset+=t}else if(o===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}}if(r!==0)throw Error(`Invalid event`)}function JE(e){if(e.length===1)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function YE(e,t){let n=new Z(e),r=[],i=new Map,a,o=!1;for(;n.pos1||n!==t){s.push(new X().uint32(e.number*8+2).bytes(n).finish()),o=!0;continue}}s.push(e.raw)}return o?JE(s):e}var XE=class extends Error{constructor(e=`Unknown event type`){super(e),this.name=`AGUIUnknownEventTypeError`}};function ZE(e,t,n,r){let i=0,a=0,o=0;for(;;){if(t.offset>=e.length||o>=n)return-1;let s=e[t.offset++];if(o+=1,o===n&&s>r)return-1;if(i+=(s&127)*2**a,a+=7,!(s&128))return i}}var QE=(e,t)=>ZE(e,t,5,15),$E=(e,t)=>ZE(e,t,10,1);function eD(e){let t={offset:0},n=[];for(;t.offsete.length)return!1;t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0}function tD(e){let t={offset:0},n=[],r=0;for(;t.offsete.length)return!1;if(s){if(PE.has(a)||!eD(e.subarray(t.offset,t.offset+n)))return!1;r+=1}t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0&&r>0}function nD(e){qE(e);let t=TE.decode(YE(e,{singular:PE,descend:WE})),n=Object.entries(t).filter(([,e])=>e!==void 0);if(n.length!==1)throw n.length===0&&tD(e)?new XE:Error(`Invalid event`);let r=n[0],i=NE[r[0]];if(i===void 0)throw Error(`Invalid event`);let a=r[1],o=kE(a.baseEvent);if(!o)throw Error(`Invalid event`);let s=mT[o.type];if(s!==i)throw Error(`Invalid event: envelope carries `+i+` but the base event declares `+String(s));if(a.type=i,a.timestamp=o.timestamp,a.rawEvent=o.rawEvent,o.metadata!==void 0&&(a.metadata=o.metadata),delete a.baseEvent,a.type===`MESSAGES_SNAPSHOT`&&Array.isArray(a.messages)&&(a.messages=a.messages.map(BE).filter(e=>e!==void 0)),a.type===`RUN_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.pendingToolCallIds=e.pendingToolCallIds,delete e.pendingToolCallIds,n.interrupts=e.interrupts,delete e.interrupts,delete e.outcome,t===void 0&&(AE(n.pendingToolCallIds).length>0&&(e.pendingToolCallIds=n.pendingToolCallIds),AE(n.interrupts).length>0&&(e.interrupts=n.interrupts)),t===`success`&&(e.outcome={type:`success`,...AE(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...AE(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t===`interrupt`&&(e.outcome={type:`interrupt`,interrupts:AE(n.interrupts),...AE(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{}}),t===`cancelled`&&(e.outcome={type:`cancelled`,...AE(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...AE(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t!==void 0&&![`success`,`interrupt`,`cancelled`].includes(t)&&(e.outcome={type:t,...AE(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...AE(n.interrupts).length>0?{interrupts:n.interrupts}:{}})}if(a.type===`SUBAGENT_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.interruptIds=e.interruptIds,delete e.interruptIds,delete e.outcome,t===void 0&&AE(n.interruptIds).length>0&&(e.interruptIds=n.interruptIds),t===`success`&&(e.outcome={type:`success`,...AE(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t===`suspended`&&(e.outcome={type:`suspended`,...AE(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t!==void 0&&![`success`,`suspended`].includes(t)&&(e.outcome={type:t,...AE(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}})}if(a.type===`STATE_DELTA`&&Array.isArray(a.delta)&&(a.delta=a.delta.map(e=>{let t=kw[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`ACTIVITY_DELTA`&&Array.isArray(a.patch)&&(a.patch=a.patch.map(e=>{let t=kw[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`RUN_FINISHED`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`RUN_ERROR`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`TOOL_CALL_RESULT`){let e=a;if(e.content!==void 0&&AE(e.contentParts).length>0)throw Error(`Invalid event: content carries both string content and content parts`);e.content===void 0&&(e.content=AE(e.contentParts).map(e=>{let t=IE(e);return t===void 0&&ME(),t}).filter(e=>e!==void 0)),delete e.contentParts}return a.type===`RUN_STARTED`&&a.input!==void 0&&(a.input=HE(a.input)),VE(a),a}var rD=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,iD=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(rD);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},aD=e=>e===`*`||e===`x`||e===`X`,oD=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},sD=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],cD=(e,t)=>{if(aD(e)||aD(t))return 0;let[n,r]=sD(oD(e),oD(t));return n>r?1:n{for(let n=0;n{let n=iD(e),r=iD(t),i=n.pop(),a=r.pop(),o=lD(n,r);return o===0?i&&a?lD(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},dD=e=>typeof e==`string`&&/^[v\d]/.test(e)&&rD.test(e),fD=`@ag-ui/client`;function pD(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,`@ag-ui/client`))return;let t=e.metadata?.[fD];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var mD=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function hD(){return sv()}function gD(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function _D(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&_D(t);return e}var vD=524288;function yD(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function bD(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!yD(t,n,vD),c=s?mD(t):t,l=s?mD(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(_D(c),_D(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=mD(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=mD(e.state),d=!0,n=!0),s&&n&&yD(c,l,vD)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&gD(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?mD(c):c}:{},...d?{state:Object.isFrozen(l)?mD(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function xD(e,t={waiting:0}){return n=>new Vy(r=>{let i=[],a=0,o=!1,s=!1,c,l=()=>{if(o||r.closed)return;if(a===i.length){i.length=0,a=0,s&&r.complete();return}let n=i[a];i[a]=void 0,a+=1,--t.waiting,o=!0;let u;try{u=e(n)}catch(e){r.error(e);return}u.then(e=>{r.closed||(c=e.subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>{c=void 0,o=!1,l()}}))},e=>r.error(e))},u=n.subscribe({next:e=>{i.push(e),t.waiting+=1,l()},error:e=>r.error(e),complete:()=>{s=!0,l()}});return()=>{u.unsubscribe(),c?.unsubscribe()}})}var SD=Symbol(`no key`);function CD(e,t){let n=e?.toolCalls;if(!Array.isArray(n))return!1;for(let e of n)if(e?.id===t)return!0;return!1}var wD=class{constructor(){this.covered=0,this.firstById=new Map,this.firstByToolCallId=new Map,this.idAt=[],this.toolCallIdsAt=[]}indexOf(e,t){this.sync(e);let n=this.firstById.get(t);return n!==void 0&&e[n]?.id!==t&&(this.rebuild(e),n=this.firstById.get(t)),n??-1}find(e,t){let n=this.indexOf(e,t);return n===-1?void 0:e[n]}toolCallOwner(e,t){this.sync(e);let n=this.firstByToolCallId.get(t);return n!==void 0&&!CD(e[n],t)&&(this.rebuild(e),n=this.firstByToolCallId.get(t)),n===void 0?void 0:e[n]}addedToolCall(e,t,n){if(e!==this.list)return;this.sync(e);let r=this.firstByToolCallId.get(n);if(r===void 0||e[r]!==t){if(r===void 0){let r=this.firstById.get(t.id);if(r!==void 0&&e[r]===t){this.firstByToolCallId.set(n,r),(this.toolCallIdsAt[r]??=[]).push(n);return}}this.invalidate()}}insertedBefore(e,t){if(!(e!==this.list||t>=this.covered)){for(let e=this.covered-1;e>=t;e--){this.idAt[e]!==SD&&this.firstById.delete(this.idAt[e]);for(let t of this.toolCallIdsAt[e]??[])this.firstByToolCallId.delete(t)}this.idAt.length=t,this.toolCallIdsAt.length=t,this.covered=t}}invalidate(){this.list=void 0}sync(e){if(e!==this.list||e.lengthtypeof e==`object`&&e?e.role:void 0;function MD(e){if(jD(e)!==`assistant`)return[];let t=e.toolCalls;if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e.id;typeof t==`string`&&n.push(t)}return n}function ND(e){let t=new Map,n=new Map,r=(e,t)=>{t.answered=!0,n.set(e,n.get(e)-1)},i=new Map,a=new Map,o=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},s=-1;for(let c=0;c=0&&u[e].issuer===s;e--)u[e].answered||(d=u[e]);if(d){r(e,d);continue}n.get(e)>0&&o(i,e,c)}else if(u!==`activity`&&u!==`reasoning`){s=c;for(let e of MD(l))o(t,e,{issuer:c,answered:!1}),n.set(e,(n.get(e)??0)+1)}}let c=new Map,l=[],u=(e,t,n)=>{r(e,n),o(c,n.issuer,t),l[t]=!0};for(let[e,n]of i){let r=t.get(e),i=r.length-1;for(let t=n.length-1;t>=0;t--){let a=n[t];for(;i>=0&&(r[i].answered||r[i].issuer>=a);)i--;if(i<0)break;u(e,a,r[i])}}for(let[e,n]of a){let r=t.get(e);r?.length!==1||r[0].answered||u(e,n[0],r[0])}if(c.size===0)return e;for(let e of c.values())e.sort((e,t)=>e-t);let d=[],f,p=()=>{if(f){let t=d.length;for(let e=d.length-1;e>=0;e--){let n=d[e],r=jD(n);if(typeof n==`object`&&n&&r!==`activity`&&r!==`reasoning`)break;r===`reasoning`&&(t=e)}let n=d.splice(t);for(let t of f)d.push(e[t]);for(let e of n)d.push(e)}f=void 0};for(let t=0;te?.function?{...e,function:{...e.function}}:{...e})),t}function FD(e,t,n){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let i of r){let r=i===`content`?n:e[i],a=t[i];if(i===`toolCalls`&&Array.isArray(r)&&Array.isArray(a)){if(!ID(r,a))return!1}else if(r!==a)return!1}return!0}function ID(e,t){if(e.length!==t.length)return!1;for(let n=0;n{let o=ED(i),s=a?.coalesce===!0,c={waiting:0},l=mD(n.messages),u=mD(e.state),d={},f=new wD,p=new Set,m=new Set,h=[],g=new Set,_=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:h.filter(e=>!g.has(e))},v=e=>{e.messages!==void 0&&(l=e.messages,d.messages=e.messages),e.state!==void 0&&(u=e.state,d.state=e.state)},y=new WeakMap,b=e=>e.map(e=>{let t=y.get(e);if(t!==void 0&&FD(t.copy,e,t.content))return t.copy;let n=PD(e);return y.set(e,{copy:n,content:e.content}),n}),x=()=>{if(s&&c.waiting>0)return e2;let e={};return d.messages!==void 0&&(e.messages=b(d.messages)),d.state!==void 0&&(e.state=mD(d.state)),d={},e.messages!==void 0||e.state!==void 0?N2(e):e2};return t.pipe(xD(async t=>{let i=await bD(r,l,u,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(v(i),i.stopPropagation===!0?o?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):o?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return x();switch(t.type){case W.TEXT_MESSAGE_START:{let i=await bD(r,l,u,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=f.find(l,e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),x();let o=a;if(!o){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};l.push(t),o=t}let s=AD(o,t);(!a||s)&&v({messages:l})}return x()}case W.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,o=f.find(l,i);if(!o)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),x();if(o.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),x();let s=await bD(r,l,u,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof o.content==`string`?o.content:``}));return v(s),s.stopPropagation!==!0&&(o.content=`${typeof o.content==`string`?o.content:``}${a}`,AD(o,t),v({messages:l})),x()}case W.TEXT_MESSAGE_END:{let{messageId:i}=t,a=f.find(l,i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),x();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),x();let o=await bD(r,l,u,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return v(o),o.stopPropagation!==!0&&AD(a,t)&&v({messages:l}),await Promise.all(r.map(t=>t.onNewMessage?.({message:a,messages:l,state:u,agent:n,input:e}))),x()}case W.TOOL_CALL_START:{let i=await bD(r,l,u,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;h.includes(e)||h.push(e);let a=f.toolCallOwner(l,e)?.toolCalls?.find(t=>t.id===e);if(p.has(e)||(p.add(e),a&&m.add(e)),a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(AD(a,t)||r)&&v({messages:l}),x()}let o=l.length,s=kD(l,r,e,f);l.length!==o&&f.indexOf(l,s.id)===l.length-1&&i!=null&&s.subagentRunId===void 0&&(s.subagentRunId=i),s.toolCalls??=[];let c={id:e,type:`function`,function:{name:n,arguments:``}};s.toolCalls.push(c),f.addedToolCall(l,s,e),AD(c,t),v({messages:l})}return x()}case W.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,o=f.toolCallOwner(l,i);if(!o)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),x();let s=o.toolCalls?.find(e=>e.id===i);if(!s)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),x();let c=await bD(r,l,u,(r,a,o)=>{let c=m.has(i)?``:s.function.arguments,l=s.function.name,u={};try{u=e4(c)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:a,state:o,agent:n,input:e,toolCallBuffer:c,toolCallName:l,partialToolCallArgs:u})});return v(c),c.stopPropagation!==!0&&(m.delete(i)?s.function.arguments=a:s.function.arguments+=a,AD(s,t),v({messages:l})),x()}case W.TOOL_CALL_END:{let{toolCallId:i}=t,a=f.toolCallOwner(l,i);if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),x();let o=a.toolCalls?.find(e=>e.id===i);if(!o)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),x();let s=await bD(r,l,u,(r,i,a)=>{let s=o.function.arguments,c=o.function.name,l={};try{l=JSON.parse(s)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:c,toolCallArgs:l})});return v(s),s.stopPropagation!==!0&&(p.delete(i),m.delete(i)),s.stopPropagation!==!0&&AD(o,t)&&v({messages:l}),await Promise.all(r.map(t=>t.onNewToolCall?.({toolCall:o,messages:l,state:u,agent:n,input:e}))),x()}case W.TOOL_CALL_RESULT:{let i=await bD(r,l,u,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:o,role:s,subagentRunId:c}=t;g.add(a);let d=e=>e.id===i&&e.role===`tool`&&e.toolCallId===a,p=f.indexOf(l,i),m=p;p!==-1&&!d(l[p])&&(m=l.findIndex((e,t)=>t>p&&d(e)));let h={...m===-1?{}:l[m],id:i,toolCallId:a,role:s||`tool`,content:o,...c!=null&&{subagentRunId:c}};if(c??delete h.subagentRunId,AD(h,t),m!==-1)l[m]=h;else{let t=-1,i=-1,o=!1;for(let e=l.length-1;e>=0;e--){let n=l[e];if(jD(n)===`tool`&&n.toolCallId===a)o=!0;else if(MD(n).includes(a)){if(i===-1&&(i=e),!o){t=e;break}o=!1}}if(t===-1&&(t=i),t===-1)l.push(h);else{let e=t+1;for(;et.onNewMessage?.({message:h,messages:l,state:u,agent:n,input:e})))}v({messages:l})}return x()}case W.STATE_SNAPSHOT:{let i=await bD(r,l,u,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let{snapshot:e}=t;u=mD(e),v({state:u})}return x()}case W.STATE_DELTA:{let i=await bD(r,l,u,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let{delta:e}=t;try{u=Qv.applyPatch(u,mD(e),!0,!1).newDocument,v({state:u})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(u,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return x()}case W.MESSAGES_SNAPSHOT:{let i=await bD(r,l,u,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let e=mD(t.messages).map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),n=new Map(e.map(e=>[e.id,e])),r=pD(t),i=e.some(e=>e.role===`activity`),a=e.some(e=>e.role===`reasoning`),o=e=>e.role===`activity`&&(r?!r.includes(e.activityType):r!==null&&!i)||e.role===`reasoning`&&!a;l=l.filter(e=>n.has(e.id)||o(e)).map(e=>n.get(e.id)??e);let s=new Set(l.map(e=>e.id));for(let t of e)s.has(t.id)||l.push(t);l=ND(l),v({messages:l})}return x()}case W.ACTIVITY_SNAPSHOT:{let i=t,a=f.indexOf(l,i.messageId),o=a>=0?l[a]:void 0,s=o?.role===`activity`?o:void 0,c=i.replace??!0,d=await bD(r,l,u,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:s,existingMessage:o}));if(v(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:mD(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},o,d;a===-1?(l.push(t),o=t,d=t):s?(c&&(l[a]={...s,activityType:i.activityType,content:mD(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete l[a].subagentRunId),d=l[a]):c&&(l[a]=t,o=t,d=t),AD(d,i),v({messages:l}),o&&await Promise.all(r.map(t=>t.onNewMessage?.({message:o,messages:l,state:u,agent:n,input:e})))}return x()}case W.ACTIVITY_DELTA:{let i=t,a=f.indexOf(l,i.messageId);if(a===-1)return x();let o=l[a];if(o.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),x();let s=o,c=await bD(r,l,u,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:s}));if(v(c),c.stopPropagation!==!0)try{AD(s,i)&&v({messages:l});let e=mD(s.content??{}),t=Qv.applyPatch(e,i.patch??[],!0,!1).newDocument;l[a]={...s,content:mD(t),activityType:i.activityType},v({messages:l})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return x()}case W.RAW:return v(await bD(r,l,u,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.CUSTOM:return v(await bD(r,l,u,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.RUN_STARTED:{let i=await bD(r,l,u,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),h=[],g=new Set,i.stopPropagation!==!0){p.clear(),m.clear();let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}f.find(l,e.id)||l.push(e)}v({messages:l})}}return x()}case W.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:_(i)},o=await bD(r,l,u,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return v(o),o.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),x()}case W.RUN_ERROR:return v(await bD(r,l,u,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.STEP_STARTED:return v(await bD(r,l,u,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.STEP_FINISHED:return v(await bD(r,l,u,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case W.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case W.REASONING_START:return v(await bD(r,l,u,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.REASONING_MESSAGE_START:{let i=await bD(r,l,u,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=f.find(l,e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),x();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};l.push(t),i=t}let a=AD(i,t);(!r||a)&&v({messages:l})}return x()}case W.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,o=f.find(l,i);if(!o)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),x();if(o.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),x();let s=await bD(r,l,u,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof o.content==`string`?o.content:``}));return v(s),s.stopPropagation!==!0&&(o.content=`${typeof o.content==`string`?o.content:``}${a}`,AD(o,t),v({messages:l})),x()}case W.REASONING_MESSAGE_END:{let{messageId:i}=t,a=f.find(l,i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),x();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),x();let o=await bD(r,l,u,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return v(o),o.stopPropagation!==!0&&AD(a,t)&&v({messages:l}),await Promise.all(r.map(t=>t.onNewMessage?.({message:a,messages:l,state:u,agent:n,input:e}))),x()}case W.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case W.REASONING_END:return v(await bD(r,l,u,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:o}=t,s=await bD(r,l,u,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(v(s),s.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of l)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=o,e=!0;break}}}else{let t=f.find(l,a);t?.role!==`activity`&&t&&(t.encryptedValue=o,e=!0)}e&&(d.messages=l)}return x()}case W.SUBAGENT_STARTED:return v(await bD(r,l,u,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.SUBAGENT_FINISHED:return v(await bD(r,l,u,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x();case W.SUBAGENT_ERROR:return v(await bD(r,l,u,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),x()}return t.type,x()},c),r.length>0?J2({}):e=>e)};function RD(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}var zD=e=>t=>{let n=ED(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=!1,v=()=>{_=!1,r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new fv(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!s.toolCall.has(n.id))&&s.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new fv(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(z2(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==W.RUN_STARTED)return P2(()=>new fv(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==W.RUN_ERROR&&t!==W.RUN_STARTED)return P2(()=>new fv(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==W.RUN_STARTED&&t!==W.RUN_ERROR)return P2(()=>new fv(`First event must be 'RUN_STARTED'`))}else if(t===W.RUN_STARTED){if(g&&!c&&!l)return P2(()=>new fv(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&v()}if(e.subagentRunId===null){_||(_=!0,RD(`subagentRunId: null`,`an absent field`));let{subagentRunId:t,...n}=e;e=n}if(t===W.SUBAGENT_STARTED||t===W.SUBAGENT_FINISHED||t===W.SUBAGENT_ERROR){let n=t===W.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===W.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return P2(()=>new fv(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return P2(()=>new fv(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return P2(()=>new fv(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return P2(()=>new fv(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===W.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return P2(()=>new fv(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case W.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return P2(()=>new fv(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=s.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return P2(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),N2(e)}case W.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return P2(()=>new fv(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?P2(()=>i):N2(e)}case W.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return P2(()=>new fv(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?P2(()=>i):(r.delete(n),N2(e))}case W.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return P2(()=>new fv(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return P2(()=>new fv(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));o=e}}let c=s.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return P2(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return P2(()=>new fv(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),N2(e)}case W.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return P2(()=>new fv(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?P2(()=>r):N2(e)}case W.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return P2(()=>new fv(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?P2(()=>r):(i.delete(n),N2(e))}case W.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?P2(()=>new fv(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),N2(e))}case W.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return P2(r?()=>new fv(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new fv(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),N2(e)}case W.ACTIVITY_SNAPSHOT:{let t=e.messageId;return s.activity.has(t)&&e.replace===!1||s.activity.set(t,{subagentRunId:e.subagentRunId}),N2(e)}case W.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),N2(e)}case W.REASONING_START:case W.REASONING_MESSAGE_START:{let n=e.messageId,r=t===W.REASONING_START,i=r?a:o;if(i.has(n))return P2(()=>new fv(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=b(t,e.subagentRunId,c,`reasoning message`,n);if(r)return P2(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),N2(e)}case W.REASONING_MESSAGE_CONTENT:case W.REASONING_MESSAGE_END:case W.REASONING_END:{let n=e.messageId,r=t===W.REASONING_END,i=r?a:o;if(!i.has(n))return P2(()=>new fv(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=b(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?P2(()=>c):((t===W.REASONING_END||t===W.REASONING_MESSAGE_END)&&i.delete(n),N2(e))}case W.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=b(t,e.subagentRunId,i,a,n);return o?P2(()=>o):N2(e)}case W.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?P2(()=>r):N2(e)}case W.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return P2(()=>new fv(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return P2(()=>new fv(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?P2(()=>new fv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?P2(()=>new fv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?P2(()=>new fv(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),N2(e))}case W.SUBAGENT_FINISHED:case W.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return P2(()=>new fv(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===W.SUBAGENT_ERROR&&typeof e.message!=`string`)return P2(()=>new fv(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),N2(e)):P2(()=>new fv(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case W.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return P2(()=>t)}return N2(e);case W.RUN_STARTED:g=!0;{let t=y((e.input??{}).messages,!1);if(t)return P2(()=>t)}return N2(e);case W.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return P2(()=>new fv(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return P2(()=>new fv(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return P2(()=>new fv(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return P2(()=>new fv(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return P2(()=>new fv(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return P2(()=>new fv(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,N2(e);case W.RUN_ERROR:return l=!0,N2(e);case W.CUSTOM:default:return N2(e)}}))},BD=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),VD=e=>H2(()=>M2(e())).pipe(X2(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return M2(e.text()).pipe(z2(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,P2(()=>i)}))}let t={type:BD.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Vy(e=>{let r=!1;return e.next(t),(async()=>{try{for(;!e.closed;){let{done:t,value:i}=await n.read();if(t){r=!0;break}let a={type:BD.DATA,data:i};e.next(a)}e.complete()}catch(t){r=!0,e.error(t)}})(),()=>{r||n.cancel().catch(e=>{e?.name!==`AbortError`&&console.warn(`Failed to cancel HTTP response stream:`,e)})}}):P2(()=>Error(`Failed to getReader() from response`))})),HD=0xa00000,UD=(e,t)=>{let n=ED(t),r=new Xy,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==BD.HEADERS&&e.type===BD.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e);if(a.length>HD){r.error(Error(`SSE buffer size exceeded maximum limit of ${HD/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` `),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` `),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},WD=0xa00000,GD=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,KD=(e,t)=>{let n=ED(t),r=new Xy,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==BD.HEADERS&&e.type===BD.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>WD){r.error(Error(`Protobuf message size exceeded maximum limit of ${WD/1048576} MB`));return}if(i.length{let n=ED(t),r=new Xy,i=new $y(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===BD.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?KD(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):UD(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t)}else n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`)r.next({type:W.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();else return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},JD={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},YD=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)};function XD(e,t){return gv(t)&&ZD(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),hv(t)}var ZD=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},QD=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(z2(r=>{switch(r.type){case W.TEXT_MESSAGE_START:{let e=r;return[{type:JD.TextMessageStart,messageId:e.messageId,role:e.role}]}case W.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:JD.TextMessageContent,messageId:e.messageId,content:e.delta}]}case W.TEXT_MESSAGE_END:{let e=r;return[{type:JD.TextMessageEnd,messageId:e.messageId}]}case W.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:JD.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case W.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return ZD(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(e4(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:JD.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case W.TOOL_CALL_END:{let e=r;return[{type:JD.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case W.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&ZD(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:JD.ActionExecutionResult,actionExecutionId:e.toolCallId,result:XD(e.toolCallId,e.content),actionName:t||`unknown`}]}case W.RAW:return f||(f=!0,ZD(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case W.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:JD.MetaEvent,name:e.name,value:e.value}]}case W.STATE_SNAPSHOT:return p(r.snapshot),[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case W.STATE_DELTA:{let c=r,l;try{l=Qv.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return ZD(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case W.MESSAGES_SNAPSHOT:return c=r.messages,[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case W.RUN_STARTED:return[];case W.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=$D(c)}catch(e){return[{type:JD.RunError,message:e.message}]}return[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case W.RUN_ERROR:{let e=r;return[{type:JD.RunError,message:e.message,code:e.code}]}case W.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case W.STEP_FINISHED:return u=[],l=null,[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function $D(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=YD(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:XD(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var eO=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,tO=e=>e===`tool`?`toolCallId`:`messageId`,nO=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},rO=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},iO=(e,t)=>{let n=rO(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},aO=e=>new Set(Object.keys(e.shape)),oO=aO(BS),sO=aO(WS),cO=aO(DC),lO=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},uO=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},dO=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&uO(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},fO=e=>t=>{let n=ED(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:W.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:W.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:W.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&eO(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${tO(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(z2(e=>{switch(e.type){case W.TEXT_MESSAGE_START:case W.TEXT_MESSAGE_CONTENT:case W.TEXT_MESSAGE_END:case W.TOOL_CALL_START:case W.TOOL_CALL_ARGS:case W.TOOL_CALL_END:case W.TOOL_CALL_RESULT:case W.STATE_SNAPSHOT:case W.STATE_DELTA:case W.CUSTOM:case W.STEP_STARTED:case W.STEP_FINISHED:case W.REASONING_START:case W.REASONING_MESSAGE_START:case W.REASONING_MESSAGE_CONTENT:case W.REASONING_MESSAGE_END:case W.REASONING_END:return[...i(e.subagentRunId??void 0),e];case W.RUN_STARTED:case W.RUN_FINISHED:case W.RUN_ERROR:case W.MESSAGES_SNAPSHOT:return[...a(),e];case W.RAW:case W.ACTIVITY_SNAPSHOT:case W.ACTIVITY_DELTA:case W.REASONING_ENCRYPTED_VALUE:case W.SUBAGENT_STARTED:return[e];case W.SUBAGENT_FINISHED:case W.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case W.TEXT_MESSAGE_CHUNK:{let t=e,a=lO(e,oO),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))nO(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),nO(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=rO({type:W.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=iO({...a,type:W.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:W.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return dO(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case W.TOOL_CALL_CHUNK:{let t=e,a=lO(e,sO),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))nO(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),nO(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=rO({type:W.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=iO({...a,type:W.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:W.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return dO(l,a,u,`TOOL_CALL_CHUNK`),l}case W.REASONING_MESSAGE_CHUNK:{let t=e,a=lO(e,cO),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=rO({type:W.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=iO({...a,type:W.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:W.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return dO(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),Y2(()=>{a()}))},pO=1e6;function mO(e){if(e===void 0)return pO;if(e===1/0||Number.isSafeInteger(e)&&e>0)return e;throw new fv(`Invalid enforcement entry budget ${String(e)}: expected a positive integer, or Infinity to disable it.`)}var hO=class extends fv{constructor(e,t){super(`Enforcement limit exceeded at '${t||`(root)`}': the payload has more than ${e} entries to validate. If it is legitimate, raise or disable the limit (maxEnforcedEntries on the agent, or maxEntries in the enforcement options).`),this.name=`AGUIEnforcementLimitError`,this.limit=e,this.path=t}},gO=Symbol(`agui.strip.drop`);function _O(e,t,n){if(e.used+=t,e.used>e.max)throw new hO(e.max,n)}function vO(e){let t=e;for(;;)if(t instanceof sS||t instanceof dS||t instanceof pS||t instanceof wS||t instanceof yS)t=t.unwrap();else if(t instanceof xS)t=t.def.in;else if(t instanceof ES)t=t.def.getter();else return t}function yO(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function bO(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function xO(e){let t=vO(e);return t instanceof iS?bO(t):void 0}function SO(e,t,n,r,i){let a=vO(t);if(a instanceof K9){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=a.shape,o=e,s={},c=a.meta()?.specOpen===!0,l=Object.keys(o);_O(i,l.length,n);for(let e of l){let a=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(a===void 0){if(c){s[e]=o[e];continue}r.push(`${n}/${e}`);continue}let l=r.length,u=SO(o[e],a,`${n}/${e}`,r,i);if(u===gO){if(r.length=l,a.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return gO}s[e]=u}return s}if(a instanceof W9){if(!Array.isArray(e))return e;_O(i,e.length,n);let t=a.element,o=[];return e.forEach((e,a)=>{let s=r.length,c=SO(e,t,`${n}/${a}`,r,i);c===gO?(r.length=s,r.push(`${n}/${a}`)):o.push(c)}),o}if(a instanceof eS){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=a.def.valueType,o=e,s={},c=Object.keys(o);_O(i,c.length,n);for(let e of c){let a=r.length,c=SO(o[e],t,`${n}/${e}`,r,i);c===gO?(r.length=a,r.push(`${n}/${e}`)):s[e]=c}return s}if(a instanceof J9){let t=a.options,o=yO(a);if(o!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let a=Object.prototype.hasOwnProperty.call(e,o)?e[o]:void 0;if(typeof a!=`string`)return{...e,[o]:a};for(let s of t){let t=vO(s);if(t instanceof K9&&xO(t.shape[o])===a)return SO(e,s,n,r,i)}return gO}let s=t.filter(e=>vO(e)instanceof K9),c=typeof e==`object`&&!!e&&!Array.isArray(e);if(s.length>1&&c)return e;for(let a of t){let t=vO(a);if(t instanceof W9&&Array.isArray(e)||t instanceof K9&&c)return SO(e,a,n,r,i)}return e}return e}function CO(e,t,n){let r=[],i=SO(e,t,``,r,{used:0,max:mO(n?.maxEntries)});if(i===gO)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:i,stripped:r}}var wO=new Set(Object.values(W));function TO(e){return wO.has(e.type)}var EO=new Map(NC.options.map(e=>{let t=e.shape;return[String(bO(t.type)),e]})),DO=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function OO(e){DO()||console.warn(`[ag-ui][enforce] ${e}`)}var kO=(e,t)=>{let n=mO(t?.maxEntries);return t=>{let r=ED(e);return t.pipe(z2(e=>{if(!TO(e)){OO(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`);let t={type:e.type};return r?.event(`ENFORCE`,`Unrecognised event dropped:`,t,t),e2}let t=EO.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:i,stripped:a}=CO(e,t,{maxEntries:n});for(let t of a)OO(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return N2(t.parse(i))}))}};function AO(e,t){let n=mO(t?.maxEntries),{value:r,stripped:i}=CO(dv(e,`RunAgentInput`),pC,{maxEntries:n});for(let e of i)OO(`Removed unrecognised material at '${e}' from the outgoing input.`);return pC.parse(r)}var jO=class{runNext(e,t){return t.run(e).pipe(fO(!1))}runNextWithState(e,t){let n=mD(e.messages||[]),r=mD(e.state===void 0?{}:e.state),i=new $y;return LD(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(G2(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:mD(n),state:mD(r)})))}},MO=class extends jO{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function NO(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function PO(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function FO(e){let t=NO(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:(typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function IO(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function LO(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(PO(e)){let n=FO(e);return n.type!==`binary`&&t.some(t=>IO(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var RO=`THINKING_START`,zO=`THINKING_END`,BO=`THINKING_TEXT_MESSAGE_START`,VO=`THINKING_TEXT_MESSAGE_CONTENT`,HO=`THINKING_TEXT_MESSAGE_END`;function UO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var WO={event:[`rawEvent`,`subagentRunId`],[W.RUN_STARTED]:[`parentRunId`,`input`],[W.RUN_FINISHED]:[`result`,`outcome`],[W.RUN_ERROR]:[`usage`],[W.SUBAGENT_FINISHED]:[`result`],[W.TOOL_CALL_START]:[`parentMessageId`],[W.TOOL_CALL_CHUNK]:[`parentMessageId`],[W.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},GO=new Map(Object.entries(WO).filter(([e])=>Object.values(W).includes(e))),KO=e=>RD(e,`an absent field`);function qO(e,t,n,r){if(!UO(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function JO(e,t,n){if(!UO(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function YO(e,t){return JO(e,`content`,e=>{if(!UO(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return qO(e,WO[`input content`],`${e.type} input content`,t);default:return e}})}function XO(e,t=KO){let n=qO(e,WO.RunAgentInput,`RunAgentInput`,t);return n=JO(n,`tools`,e=>qO(e,WO.Tool,`Tool`,t)),n=JO(n,`resume`,e=>qO(e,WO.ResumeEntry,`ResumeEntry`,t)),JO(n,`messages`,e=>YO(e,t))}var ZO=class extends jO{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),RD(e,`an absent field`))}}warn(e,t){RD(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=hD();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(LO),t.run(e).pipe(L2(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===W.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=qO(e,WO.event,void 0,t);let n=GO.get(e.type);switch(n&&(e=qO(e,n,e.type,t)),e.type){case RO:{this.currentReasoningId=hD();let{title:t,...n}=e;return this.warn(RO,W.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${RO}.title ${JSON.stringify(t)}: ${W.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:W.REASONING_START,messageId:this.currentReasoningId}}case BO:return this.currentMessageId=hD(),this.warn(BO,W.REASONING_MESSAGE_START),{...e,type:W.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case VO:{let{delta:t,...n}=e;return this.warn(VO,W.REASONING_MESSAGE_CONTENT),{...n,type:W.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(VO,this.currentMessageId),delta:t}}case HO:{let t=this.mintedContinuationId(HO,this.currentMessageId);return this.currentMessageId=null,this.warn(HO,W.REASONING_MESSAGE_END),{...e,type:W.REASONING_MESSAGE_END,messageId:t}}case zO:{let t=this.mintedContinuationId(zO,this.currentReasoningId);return this.currentReasoningId=null,this.warn(zO,W.REASONING_END),{...e,type:W.REASONING_END,messageId:t}}case W.RUN_FINISHED:{let n=e,r=qO(n.outcome,WO[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return JO(r===n.outcome?n:{...n,outcome:r},`usage`,e=>qO(e,WO[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case W.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case W.RUN_STARTED:{let n=XO(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=YO(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),LO(e))}},QO=()=>e=>H2(()=>{let t=new ZO;return e.pipe(L2(e=>t.transformEvent(e)))});function $O(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function ek(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function tk(e){ek()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function nk(e){ek()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function rk(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return nk(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&tk(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var ik=class extends jO{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(rk)};return this.runNext(i,t)}},ak=`THINKING_START`,ok=`THINKING_END`,sk=`THINKING_TEXT_MESSAGE_START`,ck=`THINKING_TEXT_MESSAGE_CONTENT`,lk=`THINKING_TEXT_MESSAGE_END`,uk=class extends jO{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(L2(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case ak:{this.currentReasoningId=hD();let{title:t,...n}=e;return this.warnAboutTransformation(ak,W.REASONING_START),{...n,type:W.REASONING_START,messageId:this.currentReasoningId}}case sk:return this.currentMessageId=hD(),this.warnAboutTransformation(sk,W.REASONING_MESSAGE_START),{...e,type:W.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case ck:{let{delta:t,...n}=e;return this.warnAboutTransformation(ck,W.REASONING_MESSAGE_CONTENT),{...n,type:W.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??hD(),delta:t}}case lk:{let t=this.currentMessageId??hD();return this.warnAboutTransformation(lk,W.REASONING_MESSAGE_END),{...e,type:W.REASONING_MESSAGE_END,messageId:t}}case ok:{let t=this.currentReasoningId??hD();return this.warnAboutTransformation(ok,W.REASONING_END),{...e,type:W.REASONING_END,messageId:t}}default:return e}}},dk=`SUBAGENT_STARTED`,fk=`SUBAGENT_FINISHED`,pk=`SUBAGENT_ERROR`;function mk(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function hk(e){return e.map(e=>mk(e))}var gk=class extends jO{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>mk(e))};return this.runNext(n,t).pipe(Q2(e=>{let t=e.type;(t===dk||t===fk||t===pk)&&this.warnDroppedLifecycleEvent(t)}),U2(e=>{let t=e.type;return t!==dk&&t!==fk&&t!==pk}),L2(e=>{let t=mk(e);if(t.type===W.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:hk(e.messages)}}if(t.type===W.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>mk(e))}}}if(t.type===W.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:hk(e.input.messages)}}}return t}))}},_k=`1.0.5`,vk=!1,yk=new WeakSet,bk=(e,t)=>/^\d+\.\d+$/.test(e)?uD(e,t)>0?`newer`:`not-newer`:`uninterpretable`,xk=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(bk(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},Sk=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return _k;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return _k;let a=t===`maxProtocolVersion`?n:r;if(!a)return _k;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!vk&&(vk=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=TD(e),this._debugLogger=OD(this._debug)}get threadId(){return this._threadId??=sv()}set threadId(e){this._threadId=e}get maxEnforcedEntries(){return this._maxEnforcedEntries}set maxEnforcedEntries(e){this._maxEnforcedEntries=mO(e)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?OD(TD(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!dD(e))throw new fv(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a,maxEnforcedEntries:o}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this._threadId=n,this.messages=mD(r??[]),this.state=mD(i??{}),this._debug=TD(a),this._debugLogger=OD(this._debug),this._maxEnforcedEntries=mO(o);let s=this.resolvedCeilingDuringConstruction();uD(s,`0.0.39`)<=0&&this.middlewares.unshift(new ik),uD(s,`0.0.45`)<=0&&this.middlewares.unshift(new uk),uD(s,`0.0.57`)<=0&&this.middlewares.unshift(new gk)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new MO(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??sv();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>xk(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];yk.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new Xy;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await I2(zy(()=>[...this.middlewares,new ZO].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),kO(this.debugLogger,{maxEntries:this.maxEnforcedEntries}),fO(this.debugLogger),zD(this.debugLogger),e=>e.pipe(Z2(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),W2(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Y2(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(N2(null)));let s=mD(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new pv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??sv();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>xk(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xy;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await I2(zy(()=>H2(()=>this.connect(n)),e=>kO(this.debugLogger,{maxEntries:this.maxEnforcedEntries})(QO()(e)),fO(this.debugLogger),zD(this.debugLogger),e=>e.pipe(Z2(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),W2(e=>(this.isRunning=!1,e instanceof pv?e2:this.onError(n,e,a))),Y2(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(N2(null)),{defaultValue:void 0});let s=mD(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}applyBeforeSourceError(e,t,n){return H2(()=>{let r,i=t.pipe(W2(e=>(r={error:e},e2)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(q2(H2(()=>{let e=r;return e?P2(()=>e.error):e2})))})}apply(e,t,n,r){return LD(e,t,this,n,this.debugLogger,r)}processApplyEvents(e,t,n){return t.pipe(Q2(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=mD(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=ND(t.filter(e=>e.role!==`activity`));return{threadId:this.threadId,runId:e?.runId||sv(),...uD(this.maxProtocolVersion,_k)>=0&&{protocolVersion:`1.0`},tools:mD(e?.tools??[]),context:mD(e?.context??[]),forwardedProps:mD(e?.forwardedProps??{}),state:mD(this.state),messages:n,...e?.resume===void 0?{}:{resume:mD(e.resume)}}}async onInitialize(e,t){if(yk.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new fv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if($O(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new fv(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await bD(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=ND(n.messages.filter(e=>e.role!==`activity`)),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return M2(bD(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(L2(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await bD(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=mD(this.messages),e.state=mD(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e._maxEnforcedEntries=this._maxEnforcedEntries,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=mD(this.pendingInterrupts),e.resolvingPeerCeiling=!1,e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=mD(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=mD(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??sv();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new ZO].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(kO(this.debugLogger,{maxEntries:this.maxEnforcedEntries}),fO(this.debugLogger),zD(this.debugLogger),QD(this.threadId,t.runId,this.agentId),e=>e.pipe(L2(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function Ck(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var wk=class extends Sk{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(Ck(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=mD(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return qD(VD(()=>this.fetch(this.url,this.requestInit(AO(e,{maxEntries:this.maxEnforcedEntries})))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=mD(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},Tk=d.createContext(!1),Ek=()=>d.useContext(Tk);Tk.Provider;var Dk=d.createContext(void 0),Ok=e=>{let t=d.useContext(Dk);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},kk=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(Dk.Provider,{value:e,children:t}));function Ak(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jk=d.createContext(Ak()),Mk=()=>d.useContext(jk),Nk=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pk=new class extends Nk{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Fk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ik=new class{#e=Fk;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Lk(e){setTimeout(e,0)}var Rk=typeof window>`u`||`Deno`in globalThis;function zk(){}function Bk(e,t){return typeof e==`function`?e(t):e}function Vk(e){return typeof e==`number`&&e>=0&&e!==1/0}function Hk(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Uk(e,t){return typeof e==`function`?e(t):e}function Wk(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Kk(o,t.options))return!1}else if(!Jk(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Gk(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(qk(t.options.mutationKey)!==qk(a))return!1}else if(!Jk(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Kk(e,t){return(t?.queryKeyHashFn||qk)(e)}function qk(e){return JSON.stringify(e,(e,t)=>$k(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Jk(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n500)return t;let r=Qk(e)&&Qk(t);if(!r&&!($k(e)&&$k(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{Ik.setTimeout(t,e)})}function nA(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Xk(e,t)}function rA(e,t,n,r){let i=r?[t,...e]:[...e,t];return n&&i.length>n?r?i.slice(0,n):i.slice(-n):i}var iA=Symbol();function aA(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===iA?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oA(e,t){return typeof e==`function`?e(...t):!!e}var sA=Symbol();function cA(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[sA]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var lA=()=>Rk,uA=()=>lA();function dA(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{cA(e,()=>t.signal,()=>n=!0,l[sA])},d=aA(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options;return{pages:rA(e.pages,o,s,i),pageParams:rA(e.pageParams,r,s,i)}};if(i&&a.length){let e=i===`backward`,t=e?pA:fA,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:fA(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function fA(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pA(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function mA(e,t){return t?fA(e,t)!=null:!1}function hA(e,t){return!t||!e.getPreviousPageParam?!1:pA(e,t)!=null}var gA=Lk;function _A(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=gA,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var vA=_A(),yA=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vk(this.gcTime)&&(this.#e=Ik.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(uA()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Ik.clearTimeout(this.#e),this.#e=void 0)}},bA=new class extends Nk{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xA(e){return Math.min(1e3*2**e,3e4)}function SA(e){return(e??`online`)!==`online`||bA.isOnline()}var CA=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function wA(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(zk);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new CA(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Pk.isFocused()&&(e.networkMode===`always`||bA.isOnline())&&e.canRun(),p=()=>SA(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(uA()?0:3),a=e.retryDelay??xA,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nc()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var TA=class extends yA{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=OA(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=OA(this.options);e.data!==void 0&&(this.setState(DA(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=nA(this.state.data,e,this.options);return this.#u({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#u({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(zk).catch(zk):Promise.resolve()}destroy(){this.cancel({silent:!0}),super.destroy()}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Uk(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===iA||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>Uk(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Hk(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.#l()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#u({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[sA]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=aA(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?dA(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#u({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=wA({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof CA&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#u({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#u({type:`pause`})},onContinue:()=>{this.#u({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof CA){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#u({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.#l()}})();return this.#o=s,o.start(),s}#l(){this.#r.get(this.queryHash)===this&&this.scheduleGc()}#u(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...EA(t.data,this.options),fetchMeta:e.meta??null};case`success`:{let n={...t,...DA(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n}case`error`:{let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:`idle`,status:`error`,isInvalidated:!0}}case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),vA.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function EA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SA(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function DA(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function OA(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var kA=class extends Nk{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),jA(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return MA(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return MA(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Uk(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Zk(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&NA(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Uk(this.options.enabled,this.#t)!==Uk(t.enabled,this.#t)||Uk(this.options.staleTime,this.#t)!==Uk(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Uk(this.options.enabled,this.#t)!==Uk(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Zk(this.getCurrentResult(),n)||(this.#r=n,this.#i=e),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(zk)),t}#h(e){return!uA()&&Uk(this.options.enabled,this.#t)!==!1&&Vk(e)}#g(){this.#b();let e=Uk(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Hk(this.#r.dataUpdatedAt,e)+1;this.#u=Ik.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Uk(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Ik.setInterval(()=>{(this.options.refetchIntervalInBackground||Pk.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Ik.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Ik.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=e===n?this.#n:e.state,{state:s}=e,c={...s},l=!1,u;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&jA(e,t),o=i&&NA(e,n,t,r);(a||o)&&(c={...c,...EA(s.data,e.options)}),t._optimisticResults===`isRestoring`&&(c.fetchStatus=`idle`)}let{error:d,errorUpdatedAt:f,status:p}=c;u=c.data;let m=!1;if(t.placeholderData!==void 0&&u===void 0&&p===`pending`){let e,n=i?.isPlaceholderData&&t.placeholderData===a?.placeholderData;n?(e=i.data,m=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,(n||e!==void 0)&&(p=`success`,u=nA(t.select&&!m?this.#s:i?.data,e,t),l=!0)}if(t.select&&u!==void 0&&!m){if(u===this.#s&&t.select===this.#o)u=this.#c;else try{this.#o=t.select,this.#s=u,u=t.select(u),u=nA(i?.data,u,t),this.#c=u,this.#a=null}catch(e){this.#a=e}}else u===void 0&&(this.#s=void 0,this.#a=null);this.#a&&(d=this.#a,u=this.#c,f=i?.error===d?i.errorUpdatedAt:Date.now(),p=`error`,l=!1);let h=c.fetchStatus===`fetching`,g=p===`pending`,_=p===`error`,v=g&&h,y=u!==void 0;return{status:p,fetchStatus:c.fetchStatus,isPending:g,isSuccess:p===`success`,isError:_,isInitialLoading:v,isLoading:v,data:u,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:_&&!y,isPaused:c.fetchStatus===`paused`,isPlaceholderData:l,isRefetchError:_&&y,isStale:PA(e,t),refetch:this.refetch,isEnabled:Uk(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.options,this.#t.state.data!==void 0&&(this.#l=this.#t),Zk(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();vA.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function AA(e,t){return Uk(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Uk(t.retryOnMount,e)!==!1)}function jA(e,t){return AA(e,t)||e.state.data!==void 0&&MA(e,t,t.refetchOnMount)}function MA(e,t,n){if(Uk(t.enabled,e)!==!1&&Uk(t.staleTime,e)!==`static`){let r=Uk(n,e);return r===`always`||r!==!1&&PA(e,t)}return!1}function NA(e,t,n,r){return(e!==t||Uk(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&PA(e,n)}function PA(e,t){return Uk(t.enabled,e)!==!1&&e.isStaleByTime(Uk(t.staleTime,e))}var FA=class extends kA{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:mA(t,n.data),hasPreviousPage:hA(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},IA=class extends yA{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||LA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.#n.has(this)&&this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=wA({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),vA.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function LA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var RA=class extends Nk{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new IA({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=zA(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){e.destroy();let t=zA(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}has(e){return this.#e.has(e)}canRun(e){let t=zA(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=zA(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){vA.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>e.destroy()),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Gk(t,e))}findAll(e={}){return this.getAll().filter(t=>Gk(e,t))}notify(e){vA.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return vA.batch(()=>Promise.all(e.map(e=>e.continue().catch(zk))))}};function zA(e){return e.options.scope?.id}var BA=class extends Nk{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Kk(r,t),a=this.get(i);return a||(a=new TA({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){vA.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Wk(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Wk(e,t)):t}notify(e){vA.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){vA.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){vA.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},VA=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new BA,this.#t=e.mutationCache||new RA,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Pk.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Uk(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=Bk(t,this.#e.get(r.queryHash)?.state.data);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vA.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;vA.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return vA.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=vA.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(zk).catch(zk)}invalidateQueries(e,t={}){return vA.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=vA.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(zk)),r?Promise.resolve():t}));return Promise.all(r).then(zk)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Uk(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Uk(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(zk).catch(zk)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(zk).catch(zk)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return bA.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(qk(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Jk(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(qk(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Jk(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Kk(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===iA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},HA=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?oA(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},UA=e=>{d.useEffect(()=>{e.clearReset()},[e])},WA=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||oA(n,[e.error,r])),GA=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},KA=(e,t)=>e?.suspense&&t.isPending,qA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JA(e,t,n){let r=Ek(),i=Mk(),a=Ok(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,GA(o),HA(o,i,s),UA(i);let[l]=d.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);d.useEffect(()=>{l.setOptions(o)},[o,l]);let f=!r&&c;if(d.useSyncExternalStore(d.useCallback(e=>{let t=f?l.subscribe(vA.batchCalls(e)):zk;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),KA(o,u))throw qA(o,l,i);if(WA({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function YA(e,t){return JA(e,kA,t)}function XA(e){return e}function ZA(e,t){return JA(e,FA,t)}var QA=(0,d.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),$A=d.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...l}=e,{color:u=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=d.useContext(QA);return d.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??u,viewBox:`0 0 256 256`,transform:o||m?`scale(-1, 1)`:void 0,...h,...l},!!n&&d.createElement(`title`,null,n),s,c.get(a??p))});$A.displayName=`IconBase`;var ej=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),tj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:ej}));tj.displayName=`ArrowCounterClockwiseIcon`;var nj=tj,rj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),ij=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:rj}));ij.displayName=`XIcon`;var aj=ij,oj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),sj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:oj}));sj.displayName=`CheckCircleIcon`;var cj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),lj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:cj}));lj.displayName=`InfoIcon`;var uj=lj,dj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`}))]]),fj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:dj}));fj.displayName=`WarningIcon`;var pj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:pj}));mj.displayName=`XCircleIcon`;var hj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v92H179.31a19.86,19.86,0,0,0-14.14,5.86L147,168H109L90.83,149.86A19.86,19.86,0,0,0,76.69,144H52V52ZM52,204V168H75l18.14,18.14A19.86,19.86,0,0,0,107.31,192h41.38a19.86,19.86,0,0,0,14.14-5.86L181,168h23v36Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48V160H179.31a8,8,0,0,0-5.66,2.34l-19.31,19.32a8,8,0,0,1-5.66,2.34H107.31a8,8,0,0,1-5.66-2.34L82.34,162.34A8,8,0,0,0,76.68,160H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.68A15.89,15.89,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H208a2,2,0,0,1,2,2V154H179.31a13.94,13.94,0,0,0-9.9,4.1L150.1,177.41a2,2,0,0,1-1.41.59H107.31a2,2,0,0,1-1.41-.58L86.59,158.1a13.94,13.94,0,0,0-9.9-4.1H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V166H76.69a2,2,0,0,1,1.41.58L97.41,185.9a13.94,13.94,0,0,0,9.9,4.1h41.38a13.94,13.94,0,0,0,9.9-4.1l19.31-19.31a2,2,0,0,1,1.41-.59H210v42A2,2,0,0,1,208,210Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H208a4,4,0,0,1,4,4V156H179.31a12,12,0,0,0-8.48,3.51l-19.32,19.32a4,4,0,0,1-2.82,1.17H107.31a4,4,0,0,1-2.82-1.17L85.17,159.51A12,12,0,0,0,76.69,156H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V164H76.69a4,4,0,0,1,2.82,1.17l19.32,19.32a12,12,0,0,0,8.48,3.51h41.38a12,12,0,0,0,8.48-3.51l19.32-19.32a4,4,0,0,1,2.82-1.17H212v44A4,4,0,0,1,208,212Z`}))]]),gj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:hj}));gj.displayName=`TrayIcon`;var _j=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),vj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:_j}));vj.displayName=`WarningCircleIcon`;var yj=vj,bj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Zm48,22.74A84.3,84.3,0,0,1,160.11,180H160a83.52,83.52,0,0,1-23.65-3.38l-7.86,7.87A12,12,0,0,1,120,188H108v12a12,12,0,0,1-12,12H84v12a12,12,0,0,1-12,12H40a20,20,0,0,1-20-20V187.31a19.86,19.86,0,0,1,5.86-14.14l53.52-53.52A84,84,0,1,1,244,98.74ZM202.43,53.57A59.48,59.48,0,0,0,158,36c-32,1-58,27.89-58,59.89a59.69,59.69,0,0,0,4.2,22.19,12,12,0,0,1-2.55,13.21L44,189v23H60V200a12,12,0,0,1,12-12H84V176a12,12,0,0,1,12-12h19l9.65-9.65a12,12,0,0,1,13.22-2.55A59.58,59.58,0,0,0,160,156h.08c32,0,58.87-26.07,59.89-58A59.55,59.55,0,0,0,202.43,53.57Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,98.36C230.73,136.92,198.67,168,160.09,168a71.68,71.68,0,0,1-26.92-5.17h0L120,176H96v24H72v24H40a8,8,0,0,1-8-8V187.31a8,8,0,0,1,2.34-5.65l58.83-58.83h0A71.68,71.68,0,0,1,88,95.91c0-38.58,31.08-70.64,69.64-71.87A72,72,0,0,1,232,98.36Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM180,92a16,16,0,1,1,16-16A16,16,0,0,1,180,92Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M213.74,42.26A76,76,0,0,0,88.51,121.84l-57,57A11.93,11.93,0,0,0,28,187.31V216a12,12,0,0,0,12,12H72a4,4,0,0,0,4-4V204H96a4,4,0,0,0,4-4V180h20a4,4,0,0,0,2.83-1.17l11.33-11.34A75.72,75.72,0,0,0,160,172h.1A76,76,0,0,0,213.74,42.26Zm14.22,56c-1.15,36.22-31.6,65.72-67.87,65.77H160a67.52,67.52,0,0,1-25.21-4.83,4,4,0,0,0-4.45.83l-12,12H96a4,4,0,0,0-4,4v20H72a4,4,0,0,0-4,4v20H40a4,4,0,0,1-4-4V187.31a4.06,4.06,0,0,1,1.17-2.83L96,125.66a4,4,0,0,0,.83-4.45A67.51,67.51,0,0,1,92,95.91C92,59.64,121.55,29.19,157.77,28A68,68,0,0,1,228,98.23ZM188,76a8,8,0,1,1-8-8A8,8,0,0,1,188,76Z`}))]]),xj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:bj}));xj.displayName=`KeyIcon`;var Sj={sm:`26rem`,md:`32rem`,lg:`48rem`};function Cj({brand:e,brandPlacement:t=`above`,children:n,footer:r,size:i,aside:a,surface:o=`card`}){let s=a!=null,c=o===`plain`&&!s,l=s&&i===`sm`?`md`:i??(s?`lg`:`sm`),u=e!=null&&(0,R.jsx)(um,{justify:`center`,gap:`xs`,children:typeof e==`string`?(0,R.jsx)(U,{fw:700,size:`lg`,children:e}):e});return(0,R.jsx)(F_,{mih:`100dvh`,px:`md`,py:`xl`,children:(0,R.jsxs)(U0,{gap:`lg`,w:`100%`,maw:Sj[l],children:[t===`above`&&u,(0,R.jsx)(Yf,{"data-labstack-auth-surface":c?`plain`:`card`,withBorder:!c,bg:c?`transparent`:void 0,p:s||c?0:{base:`lg`,sm:`xl`},style:{overflow:`hidden`},children:(0,R.jsxs)(fg,{direction:{base:`column`,sm:`row`},gap:s?0:`lg`,children:[s&&(0,R.jsx)(H,{"data-labstack-auth-aside":!0,visibleFrom:`sm`,p:`md`,style:{flex:`1 1 0`,minWidth:`10rem`,overflowWrap:`anywhere`,background:`var(--labstack-inset, var(--mantine-color-default-hover))`},children:a}),(0,R.jsx)(H,{miw:{base:0,sm:s?`20rem`:0},p:s?{base:`lg`,sm:`xl`}:0,style:{flex:`1 1 0`},children:(0,R.jsxs)(U0,{gap:`lg`,children:[t===`inside`&&u,n]})})]})}),r!=null&&(0,R.jsx)(H,{ta:`center`,fz:`xs`,c:`dimmed`,children:r})]})})}var wj={neutral:`gray`,info:`blue`,success:`green`,warning:`yellow`,danger:`red`};function Tj(e,t){return e.other.labstackTones?.[t]??wj[t]}function Ej(e){return Tj($o(),e)}function Dj(e){return`var(--mantine-color-${e.split(`.`)[0]}-text)`}function Oj(e){return`var(--mantine-color-${e.split(`.`)[0]}-light)`}var kj={neutral:null,info:lj,success:sj,warning:fj,danger:mj};function Aj(e){return kj[e]!=null}function jj({tone:e,size:t=`1em`,weight:n=`regular`}){let r=kj[e];return r?(0,R.jsx)(r,{size:t,weight:n,"aria-hidden":`true`}):null}function Mj({tone:e,title:t,children:n,detail:r,onRetry:i,retryLabel:a=`Try again`,onDismiss:o,dismissLabel:s=`Dismiss`,prominent:c=e===`warning`||e===`danger`,live:l=!0}){let u=Ej(e),d=Ej(`neutral`),f=e===`danger`;return(0,R.jsx)(Yf,{py:`sm`,pl:`sm`,pr:i||o?`xs`:`sm`,bg:c?Oj(u):`var(--mantine-color-default-hover)`,style:{borderInlineStart:`3px solid ${Dj(u)}`,borderStartStartRadius:0,borderEndStartRadius:0},role:l?f?`alert`:`status`:void 0,"aria-live":l?f?`assertive`:`polite`:void 0,children:(0,R.jsxs)(um,{gap:`sm`,align:`flex-start`,wrap:`nowrap`,children:[(0,R.jsx)(U,{component:`span`,lh:1,pt:2,c:Dj(u),flex:`0 0 auto`,children:(0,R.jsx)(jj,{tone:e,size:18,weight:`fill`})}),(0,R.jsxs)(fg,{flex:1,miw:0,gap:`xs`,direction:{base:`column`,sm:`row`},align:`flex-start`,children:[(0,R.jsxs)(H,{flex:1,miw:0,py:1,children:[t!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,fw:600,mb:2,style:{overflowWrap:`anywhere`},children:t}),(0,R.jsxs)(U,{component:`div`,size:`sm`,style:{overflowWrap:`anywhere`},children:[n,r!=null&&(0,R.jsxs)(U,{component:`span`,inherit:!0,c:`dimmed`,children:[` `,r]})]})]}),i&&(0,R.jsx)(N_,{variant:`subtle`,color:d,size:`compact-sm`,leftSection:(0,R.jsx)(tj,{size:14,weight:`bold`,"aria-hidden":`true`}),onClick:i,type:`button`,children:a})]}),o&&(0,R.jsx)(em,{variant:`subtle`,color:d,size:`md`,onClick:o,"aria-label":s,children:(0,R.jsx)(ij,{size:14,"aria-hidden":`true`})})]})})}function Nj({opened:e,onClose:t,title:n,children:r,confirmLabel:i,onConfirm:a,cancelLabel:o=`Cancel`,pending:s=null,error:c,tone:l=`danger`,confirmText:u}){let f=$o(),p=l===`primary`?void 0:Tj(f,l),m=s===`confirm`,h=Xi(`(max-width: 36em)`),[g,_]=(0,d.useState)(``),v=(0,d.useRef)(null);(0,d.useEffect)(()=>{e&&m&&v.current?.focus()},[e,m]),(0,d.useEffect)(()=>{e||_(``)},[e]);let y=u!=null&&g!==u;return(0,R.jsx)(f0,{opened:e,onClose:m?()=>{}:t,title:(0,R.jsx)(U,{component:`span`,fw:600,size:`lg`,style:{overflowWrap:`anywhere`},children:n}),centered:!0,closeOnEscape:!m,closeOnClickOutside:!m,withCloseButton:!m,closeButtonProps:{"aria-label":`Close`},children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),!y&&!m&&a()},children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,ref:v,tabIndex:-1,"data-autofocus":m||void 0,style:{overflowWrap:`anywhere`},children:r}),u!=null&&(0,R.jsx)(W0,{label:(0,R.jsxs)(R.Fragment,{children:[`Type`,` `,(0,R.jsx)(U,{component:`span`,inherit:!0,ff:`monospace`,fw:600,children:u}),` `,`to confirm`]}),value:g,onChange:e=>_(e.currentTarget.value),disabled:m,autoComplete:`off`,"data-autofocus":!m||void 0}),c!=null&&(0,R.jsx)(Mj,{tone:`danger`,children:c}),(0,R.jsxs)(um,{justify:`flex-end`,gap:`sm`,style:h?{flexDirection:`column-reverse`,alignItems:`stretch`}:void 0,children:[(0,R.jsx)(N_,{variant:`default`,"data-autofocus":!m&&u==null||void 0,onClick:t,disabled:m,type:`button`,children:o}),(0,R.jsx)(N_,{color:p,type:`submit`,loading:m,disabled:y,children:i})]})]})})})}var Pj=`calc(var(--mantine-spacing-xs) * 2 + var(--mantine-font-size-sm) * var(--mantine-line-height))`;function Fj({state:e,loadingLabel:t=`Loading…`,rows:n=3,skeleton:r,empty:i,error:a,variant:o=`inline`,children:s}){let c=Ej(`danger`),l=Ej(`neutral`);if(e===`ready`)return s;let u=o===`page`;if(e===`loading`)return r!=null&&r!==!1&&r!==!0&&r!==``?(0,R.jsxs)(H,{role:`status`,children:[(0,R.jsx)(Kf,{children:t}),(0,R.jsx)(H,{"aria-hidden":`true`,inert:!0,children:r})]}):u?(0,R.jsx)(F_,{mih:`60dvh`,p:`xl`,children:(0,R.jsxs)(U0,{align:`center`,gap:`sm`,role:`status`,children:[(0,R.jsx)(Kp,{size:`md`,"aria-hidden":`true`}),(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:t})]})}):(0,R.jsxs)(U0,{gap:`sm`,role:`status`,children:[(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:t}),(0,R.jsx)(U0,{gap:4,children:Array.from({length:n},(e,t)=>(0,R.jsx)(z0,{height:Pj},t))})]});if(e===`empty`){let e=(0,R.jsxs)(U0,{align:`center`,gap:`sm`,ta:`center`,maw:`28rem`,mx:`auto`,children:[(0,R.jsx)(q0,{variant:`light`,color:l,size:u?56:44,children:i?.icon??(0,R.jsx)(gj,{size:u?28:22,"aria-hidden":`true`})}),(0,R.jsx)(U,{component:`div`,fw:600,size:u?`xl`:`lg`,children:i?.title??`Nothing here yet`}),i?.description!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,children:i.description}),i?.action!=null&&(0,R.jsx)(H,{mt:`xs`,children:i.action})]});return u?(0,R.jsx)(F_,{mih:`60dvh`,p:`xl`,children:e}):(0,R.jsx)(Yf,{withBorder:!0,py:`xl`,px:`lg`,children:e})}return u?(0,R.jsx)(F_,{mih:`60dvh`,p:`xl`,children:(0,R.jsxs)(U0,{align:`center`,gap:`sm`,ta:`center`,maw:`28rem`,role:`alert`,children:[(0,R.jsx)(q0,{variant:`light`,color:c,size:56,children:(0,R.jsx)(vj,{size:28,"aria-hidden":`true`})}),(0,R.jsx)(ev,{order:2,size:`h3`,children:a?.title??a?.message??`Something went wrong`}),a?.title!=null&&(0,R.jsx)(U,{component:`div`,c:`dimmed`,children:a.message}),a?.detail!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,children:a.detail}),a?.onRetry&&(0,R.jsx)(N_,{mt:`xs`,leftSection:(0,R.jsx)(tj,{size:16,weight:`bold`,"aria-hidden":`true`}),onClick:a.onRetry,type:`button`,children:a.retryLabel??`Try again`})]})}):(0,R.jsx)(Mj,{tone:`danger`,title:a?.title,detail:a?.detail,onRetry:a?.onRetry,retryLabel:a?.retryLabel,children:a?.message??`Something went wrong.`})}var Ij={emailLabel:`Email`,emailPlaceholder:`you@example.com`,continue:`Continue`,or:`or`,passkey:`Sign in with a passkey`,passkeyUnavailable:`Passkeys are not available on this device. Use an email code.`,passkeyPending:`Complete the passkey request in your browser or password manager.`,useCode:`Use email code instead`,codeTitle:`Check your email`,codeSent:(e,t,n)=>(0,R.jsxs)(R.Fragment,{children:[`If `,e,` can sign in, a `,t,`-digit code is on its way.`,n!=null&&` It works for ${n} minutes.`]}),codeLabel:`Verification code`,verify:`Verify and continue`,verifying:`Verifying…`,incompleteCode:e=>`Enter all ${e} digits of the code.`,resend:`Send a new code`,resendIn:e=>`Send a new code in ${e}`,changeEmail:`Use a different email`};function Lj(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)}`}function Rj({children:e}){return(0,R.jsx)(U,{component:`div`,size:`xs`,fw:600,tt:`uppercase`,lts:`0.08em`,c:`dimmed`,children:e})}function zj({children:e}){return(0,R.jsx)(U,{component:`div`,size:`xs`,c:`dimmed`,ta:`center`,children:e})}function Bj({step:e,title:t=`Sign in`,description:n=`Use your email. No password needed.`,invitation:r,email:i,onEmailChange:a,onSendCode:o,emailError:s,code:c,onCodeChange:l,onVerify:u,codeLength:f=6,autoVerify:p=!0,expiresInMinutes:m,codeNote:h,resendIn:g=0,onResend:_,onChangeEmail:v,pending:y=null,error:b,notice:x,passkey:S,footer:C,stepLabels:w={},labels:T,inputRef:E,autoFocus:D=!0}){let O={...Ij,...T},k=Ej(`neutral`),A=(0,d.useRef)(null),j=(0,d.useRef)(S?.autofill);j.current=S?.autofill;let M=S?.autofill!=null,N=S?.available;(0,d.useEffect)(()=>{if(e!==`email`||!N||!M||y!=null)return;let t=new AbortController;return A.current=t,j.current?.(t.signal),()=>t.abort()},[e,N,M,y]);let P=(0,d.useRef)(null),F=Aa(P,E),ee=(0,d.useRef)(null);(0,d.useEffect)(()=>{c.length{I&&(e.length{ie&&I&&P.current?.focus()},[ie,I]);let ae=(0,R.jsxs)(R.Fragment,{children:[b!=null&&(0,R.jsx)(Mj,{tone:`danger`,children:b}),b==null&&te&&e===`code`&&(0,R.jsx)(Mj,{tone:`danger`,children:O.incompleteCode(f)}),x!=null&&(0,R.jsx)(Mj,{tone:`info`,children:x})]});if(e===`code`){let e=y===`verify`;return(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsxs)(U0,{gap:8,children:[w&&(0,R.jsx)(Rj,{children:w.code??`2 · Code`}),(0,R.jsx)(ev,{order:1,size:`h2`,children:O.codeTitle}),(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:O.codeSent((0,R.jsx)(U,{component:`span`,inherit:!0,c:`var(--mantine-color-text)`,fw:500,style:{overflowWrap:`anywhere`},children:i}),f,m)})]}),(0,R.jsx)(`form`,{noValidate:!0,onSubmit:e=>{e.preventDefault(),re(c)},children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(x0,{ref:F,length:f,type:`number`,oneTimeCode:!0,autoFocus:D,size:`md`,gap:`xs`,placeholder:``,ariaLabel:O.codeLabel,getInputProps:e=>({"aria-label":`${O.codeLabel}, digit ${e+1} of ${f}`}),value:c,onChange:e=>{l(e),ne(!1),e.length0?(0,R.jsx)(U,{size:`sm`,c:`dimmed`,ta:`center`,children:O.resendIn(Lj(g))}):(0,R.jsx)(N_,{variant:`subtle`,size:`sm`,disabled:!I&&y!==`resend`,loading:y===`resend`,onClick:_,type:`button`,children:O.resend})),(0,R.jsx)(N_,{variant:`subtle`,color:k,size:`sm`,disabled:e,onClick:v,type:`button`,children:O.changeEmail})]}),C!=null&&(0,R.jsx)(zj,{children:C})]})}let oe=y===`passkey`;return(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsxs)(U0,{gap:8,children:[w&&(0,R.jsx)(Rj,{children:w.email??`1 · Email`}),(0,R.jsx)(ev,{order:1,size:`h2`,children:t}),n!=null&&(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:n}),r!=null&&(0,R.jsx)(U,{size:`sm`,fw:500,children:r})]}),(0,R.jsx)(`form`,{noValidate:!0,onSubmit:e=>{e.preventDefault(),I&&(A.current?.abort(),o())},children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(W0,{ref:F,size:`md`,label:O.emailLabel,type:`email`,name:`email`,autoComplete:S?`email webauthn`:`email`,autoFocus:D,required:!0,withAsterisk:!1,placeholder:O.emailPlaceholder,value:i,error:s,onChange:e=>a(e.currentTarget.value),disabled:y===`send`||oe}),ae,(0,R.jsx)(N_,{type:`submit`,fullWidth:!0,size:`md`,loading:y===`send`,disabled:oe,children:O.continue})]})}),S&&(0,R.jsxs)(U0,{gap:`sm`,children:[(0,R.jsx)(H_,{label:O.or,labelPosition:`center`}),(0,R.jsx)(N_,{variant:`default`,fullWidth:!0,size:`md`,leftSection:(0,R.jsx)(xj,{size:18,"aria-hidden":`true`}),onClick:()=>{A.current?.abort(),S.onStart()},loading:oe,disabled:!S.available||y===`send`,type:`button`,children:O.passkey}),!S.available&&(0,R.jsx)(U,{size:`sm`,c:`dimmed`,ta:`center`,role:`status`,children:O.passkeyUnavailable}),oe&&(0,R.jsxs)(H,{ta:`center`,children:[(0,R.jsx)(U,{size:`sm`,c:`dimmed`,role:`status`,children:O.passkeyPending}),S.onUseCode&&(0,R.jsx)(N_,{variant:`subtle`,color:k,size:`sm`,mt:4,onClick:S.onUseCode,type:`button`,children:O.useCode})]})]}),C!=null&&(0,R.jsx)(zj,{children:C})]})}function Vj({items:e,label:t,emptyValue:n=`Not set`,layout:r=`columns`,labelWidth:i=`12rem`,withDividers:a=!0}){let o=r===`columns`;return(0,R.jsx)(H,{component:`dl`,"aria-label":t,m:0,children:e.map((e,t)=>(0,R.jsxs)(H,{display:o?{base:`block`,sm:`flex`}:`block`,py:`sm`,style:a&&t>0?{borderTop:`1px solid var(--labstack-border, var(--mantine-color-default-border))`}:void 0,children:[(0,R.jsx)(H,{component:`dt`,w:o?{sm:i}:void 0,miw:o?{sm:i}:void 0,pr:o?{sm:`md`}:void 0,mb:o?{base:4,sm:0}:4,children:(0,R.jsx)(U,{component:`span`,size:`sm`,c:`dimmed`,style:{overflowWrap:`anywhere`},children:e.label})}),(0,R.jsxs)(H,{component:`dd`,m:0,style:{flex:1,minWidth:0},children:[e.value==null||e.value===``?(0,R.jsx)(U,{component:`span`,size:`sm`,c:`dimmed`,fs:`italic`,children:n}):(0,R.jsx)(U,{component:`div`,size:`sm`,fw:500,style:{overflowWrap:`anywhere`},children:e.value}),e.hint!=null&&(0,R.jsx)(U,{component:`div`,size:`xs`,c:`dimmed`,mt:2,style:{overflowWrap:`anywhere`},children:e.hint})]})]},t))})}(0,d.forwardRef)(function({current:e=`page`,active:t,...n},r){return(0,R.jsx)(h0,{ref:r,active:t,"aria-current":t?e:void 0,...n})});function Hj({title:e,eyebrow:t,description:n,meta:r,actions:i,order:a=1,withDivider:o=!1}){let s=(0,R.jsxs)(U0,{component:`header`,gap:a===1?6:4,children:[t!=null&&(0,R.jsx)(U,{component:`div`,size:`xs`,fw:600,tt:`uppercase`,lts:`0.08em`,c:`dimmed`,children:t}),(0,R.jsxs)(um,{justify:`space-between`,align:`flex-start`,wrap:`wrap`,gap:`md`,children:[(0,R.jsxs)(U0,{gap:a===1?6:4,flex:`1 1 24rem`,miw:0,children:[(0,R.jsx)(ev,{order:a,style:{textWrap:`balance`,overflowWrap:`anywhere`},children:e}),n!=null&&(0,R.jsx)(U,{component:`div`,c:`dimmed`,size:a===1?`md`:`sm`,maw:`65ch`,style:{overflowWrap:`anywhere`},children:n}),r!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,mt:2,children:r})]}),i!=null&&(0,R.jsx)(um,{gap:`sm`,wrap:`wrap`,children:i})]})]});return o?(0,R.jsxs)(U0,{gap:`md`,children:[s,(0,R.jsx)(H_,{})]}):s}var Uj={sm:12,md:14,lg:16};function Wj({tone:e,children:t,icon:n,variant:r,size:i=`md`}){let a=Ej(e),o=n===!1?null:n??(Aj(e)?(0,R.jsx)(jj,{tone:e,size:Uj[i],weight:`bold`}):null),s=r??(e===`neutral`?`outline`:`light`),c=s===`outline`&&a===wj.neutral?{root:{"--badge-bd":`1px solid var(--labstack-control-border, var(--mantine-color-default-border))`,"--badge-color":`var(--labstack-muted, var(--mantine-color-dimmed))`}}:void 0;return(0,R.jsx)(x_,{color:a,variant:s,vars:c?()=>c:void 0,size:i,tt:`none`,fw:500,leftSection:o??void 0,styles:{root:{flexShrink:0,maxWidth:`none`},label:{whiteSpace:`nowrap`,overflow:`visible`}},children:t})}function Gj(e){if(!/^#?(?:[\da-f]{3}|[\da-f]{6})$/i.test(e))throw Error(`Expected a 3- or 6-digit hex color, received ${e}`);let t=e.replace(/^#/,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=[0,2,4].map(e=>{let t=Number.parseInt(n.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return r[0]*.2126+r[1]*.7152+r[2]*.0722}function Kj(e,t){let n=Gj(e),r=Gj(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function qj(e){return Kj(e,`#000000`)>Kj(e,`#ffffff`)?`#000000`:`#ffffff`}var Jj={primary:`ink`,accent:[`#F1F0FF`,`#E4E2FF`,`#CDC9FF`,`#B5B0FF`,`#A29CFF`,`#8F8CFF`,`#756DEB`,`#5A50D8`,`#463DAE`,`#332B81`],colors:{ok:[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],warn:[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],bad:[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],info:[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`]},tones:{success:`ok`,warning:`warn`,danger:`bad`,info:`info`},fontFamily:`"Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,fontFamilyMonospace:`"Geist Mono Variable", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,displayWeight:600,radius:`soft`,elevation:`bordered`,density:`compact`,controlSizes:{sm:32,md:36,lg:40},focus:`ring`,surfaces:{light:{ground:`#F5F5F6`,raised:`#FFFFFF`,inset:`#EFEFF1`,hover:`#EDEDEF`,border:`#E3E3E6`,borderSoft:`#ECECEE`,controlBorder:`#6D6D73`,text:`#111113`,muted:`#53535B`},dark:{ground:`#0B0B0C`,raised:`#121214`,inset:`#08080A`,hover:`#1A1A1D`,border:`#232327`,borderSoft:`#1A1A1E`,controlBorder:`#828288`,text:`#EDEDEF`,muted:`#A1A1A9`}},typeScale:{small:12,body:14,title:16,section:20,page:28},chart:{series:{light:[`#2a78d6`,`#eb6834`,`#19a170`,`#4a3aa7`,`#bd8000`,`#ce6d92`],dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`]}}},Yj={micro:11,small:12,body:14,title:16,section:22,page:28},Xj={prose:720,article:960,page:1200,app:1500},Zj={light:7,dark:5},Qj={square:{control:0,surface:0,overlay:0},soft:{control:4,surface:8,overlay:12},round:{control:6,surface:16,overlay:24}};function $j(e){return`#${e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`}function eM(e,t,n){let r=e=>{let t=e.replace(/^#/,``);return t.length===3?[...t].map(e=>e+e).join(``):t},i=r(e),a=r(t);return $j([0,2,4].map(e=>{let t=Number.parseInt(i.slice(e,e+2),16);return t+(Number.parseInt(a.slice(e,e+2),16)-t)*n}))}function tM(e,t){if(typeof e!=`string`||!/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(e))throw Error(`${t} must be opaque 3/6-digit hex`)}var nM=new WeakSet;function rM(e){let t=e.currentTarget;!t.readOnly&&!t.disabled&&t.select()}function iM(e){let t=e.currentTarget;nM.delete(t),t!==t.ownerDocument.activeElement&&!t.readOnly&&!t.disabled&&(nM.add(t),t.select())}function aM(e){nM.delete(e.currentTarget)&&!e.currentTarget.readOnly&&e.currentTarget.select()}function oM(e,t,n){let r=e=>t.every(t=>Kj(e,t)>=n);if(r(e))return e;let i=[`#000000`,`#ffffff`].find(r);if(!i)throw Error(`Neutral surfaces cannot share accessible text`);for(let t=1;t<=100;t++){let n=eM(e,i,t/100);if(r(n))return n}return i}function sM(e,t){if(!Number.isFinite(t))throw Error(`neutralTint hue must be finite`);let n=(t%360+360)%360;return e.map(e=>{let t=[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16)/255),r=(Math.max(...t)+Math.min(...t))/2,i=.08*Math.min(r,1-r);return $j([0,8,4].map(e=>{let t=(e+n/30)%12;return 255*(r-i*Math.max(-1,Math.min(t-3,9-t,1)))}))})}function cM(e,t){let n=go({color:e,theme:t});if(n.isThemeColor)return`var(--labstack-color-${n.color}${n.shade===void 0?``:`-${n.shade}`}-contrast)`;if(/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(e))return qj(e)}var lM=e=>{let t=e.color||e.theme.primaryColor,n=e.variant??`filled`,r=Co({...e,color:t,variant:n});if(n!==`filled`||e.autoContrast===!1)return r;let i=cM(t,e.theme);if(!i)return r;let a=go({color:t,theme:e.theme});return{...r,color:i,...a.isThemeColor&&a.shade!==void 0?{hover:`var(--labstack-color-${a.color}-${a.shade}-hover)`}:a.isThemeColor?{}:{hover:oM(eM(t,`#000000`,.1),[i],4.5)}}};function uM(e,t){return t.iconColor||!(t.autoContrast??e.autoContrast)?void 0:cM(t.color||e.primaryColor,e)}function dM(e){let t=/^var\(--mantine-color-(.+)-(filled|\d)\)$/.exec(e??``);return t?`var(--labstack-color-${t[1]}${t[2]===`filled`?``:`-${t[2]}`}-contrast)`:e&&/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(e)?qj(e):void 0}function fM(e,t){return d.Children.map(e,e=>(0,d.isValidElement)(e)?e.props.__vars?.[`--sc-label-color`]?(0,d.cloneElement)(e,{__vars:{...e.props.__vars,"--sc-label-color":t}}):e.props.children?(0,d.cloneElement)(e,{children:fM(e.props.children,t)}):e:e)}function pM(e,t,n){let{gray:r,dark:i}=e.colors,a=t===`dark`,o=n.surfaces?.[t];if(n.surfaces&&!o)throw Error(`surfaces (${t}) ground/raised/inset/hover are required`);if(o){for(let e of[`ground`,`raised`,`inset`,`hover`])tM(o[e],`surfaces (${t}) ${e}`);for(let[e,n]of Object.entries(o))n!==void 0&&tM(n,`surfaces (${t}) ${e}`)}let s=o?.ground??(a?i[7]:r[0]),c=o?.raised??(a?i[6]:e.white),l=o?.inset??(a?i[8]:r[1]),u=o?.hover??(a?i[5]:r[2]),d=(e,t=!1)=>a?eM(c,e[5],t?.22:.15):e[t?2:1],f=[s,c,l,u],p=[s,c,l,u,...[...new Set([`brand`,...n.accent?[`accent`]:[],...Object.values(e.other.labstackTones).map(t=>go({color:t,theme:e}).color)])].flatMap(t=>{let n=e.colors[t];return n?[d(n),d(n,!0)]:[]})],m=go({color:e.other.labstackTones.danger,theme:e}).color,h=go({color:e.other.labstackTones.neutral,theme:e}).color,g=(e,n,r)=>{let i=o?.[e];if(i===void 0)try{return oM(n,e===`controlBorder`?f:p,r)}catch{throw Error(`surfaces (${t}) ${e} cannot meet ${r}:1 on every surface`)}if(p.some(e=>Kj(i,e)[`--labstack-${e}`,t]));if(o?.borderSoft!==void 0&&(n.primary===`ink`||Object.values(e.other.labstackTones).some(t=>go({color:t,theme:e}).color===`ink`)))for(let e of[v.hover,v[`border-soft`]]){let n=Kj(v.text,e);if(n<4.5)throw Error(`surfaces (${t}) borderSoft makes ink light hover text ${n.toFixed(2)}:1; need 4.5:1`)}n.elevation===`ring`&&(y[`--labstack-ring`]=a?`0 0 0 1px rgba(255,255,255,.09), 0 2px 2px rgba(0,0,0,.12)`:`0 0 0 1px rgba(0,0,0,.08), 0 2px 2px rgba(0,0,0,.04)`);let b=e=>`var(--labstack-${e})`;Object.assign(y,{"--mantine-color-body":b(`ground`),"--mantine-color-text":b(`text`),"--mantine-color-dimmed":b(`muted`),"--mantine-color-placeholder":b(`muted`),"--mantine-color-anchor":`var(--mantine-color-${n.accent?`accent`:`brand`}-text)`,"--labstack-focus":`var(--mantine-color-${n.accent?`accent`:`brand`}-text)`,"--labstack-selected":`var(--mantine-color-${n.accent?`accent`:`brand`}-light)`,"--labstack-selected-text":`var(--mantine-color-${n.accent?`accent`:`brand`}-text)`,"--mantine-color-disabled":b(`inset`),"--mantine-color-disabled-color":b(`faint`),"--mantine-color-disabled-border":b(`border`),...n.controlSizes?{"--labstack-control-sm":`${n.controlSizes.sm}px`,"--labstack-control-md":`${n.controlSizes.md}px`,"--labstack-control-lg":`${n.controlSizes.lg}px`}:{},"--mantine-color-default":b(`raised`),"--mantine-color-default-hover":b(`hover`),"--mantine-color-default-color":b(`text`),"--mantine-color-default-border":b(`control-border`),"--mantine-color-error":`var(--mantine-color-${m}-text)`,"--mantine-primary-color-contrast":`var(--labstack-color-brand-contrast)`});for(let[n,o]of Object.entries(e.colors)){let s=Zj[t];if((n===m||n===`red`)&&qj(o[s])===`#000000`){for(let e=s+1;e<=9;e++)if(Kj(`#ffffff`,o[e])>=4.5){s=e;break}}let c=s,l=o[c],u=(n===m||n===`red`)&&Kj(`#ffffff`,l)>=4.5?`#ffffff`:qj(l),g=e=>o[e===9?8:e+1],_=d(o),v=d(o,!0),b=o[a?Math.max(c-4,0):c],x=[...n===`brand`||n===`accent`||n===h||n===m?p:f,_,v,...n===m?[a?i[6]:e.white,a?i[5]:r[1]]:[],...f.map(e=>eM(e,b,.05))],S;for(let e=c;e>=0&&e<=9;e+=a?-1:1)if(x.every(t=>Kj(o[e],t)>=4.5)){S=o[e];break}S??=oM(a?o[2]:o[9],x,4.5),Object.assign(y,{[`--labstack-color-${n}-contrast`]:u,[`--mantine-color-${n}-filled`]:l,[`--mantine-color-${n}-filled-hover`]:oM(g(c),[u],4.5),[`--mantine-color-${n}-text`]:S,[`--mantine-color-${n}-light`]:_,[`--mantine-color-${n}-light-hover`]:v,[`--mantine-color-${n}-light-color`]:S,[`--mantine-color-${n}-outline`]:S}),o.forEach((e,t)=>{let r=qj(e);y[`--labstack-color-${n}-${t}-contrast`]=r,y[`--labstack-color-${n}-${t}-hover`]=oM(g(t),[r],4.5)})}for(let t of[...n.primary===`ink`?[`brand`]:[],...Object.values(e.other.labstackTones).includes(`ink`)?[`ink`]:[]]){let e=v.text,n=qj(e);Object.assign(y,{[`--mantine-color-${t}-filled`]:e,[`--mantine-color-${t}-filled-hover`]:oM(v.muted,[n],4.5),[`--labstack-color-${t}-contrast`]:n,[`--mantine-color-${t}-text`]:e,[`--mantine-color-${t}-light-color`]:e,[`--mantine-color-${t}-outline`]:e,[`--mantine-color-${t}-light`]:v.hover,[`--mantine-color-${t}-light-hover`]:v[`border-soft`]})}if(o)for(let e of[`gray`,`dark`])Object.assign(y,{[`--mantine-color-${e}-light`]:v.hover,[`--mantine-color-${e}-light-hover`]:v[`border-soft`],[`--mantine-color-${e}-light-color`]:v.text});for(let[e,r]of Object.entries(n.variants??{})){let n=r[t];for(let[r,i]of Object.entries(n))if(i!==void 0&&(r!==`background`&&r!==`hover`||i!==`transparent`)&&!/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(i))throw Error(`Variant ${e} (${t}) ${r} must be opaque hex`);let i=[n.background,n.hover??n.background].flatMap(e=>e===`transparent`?f:[e]),a=n.color??(n.background===`transparent`?v.text:qj(n.background));if(i.some(e=>Kj(a,e)<4.5))throw Error(`Variant ${e} (${t}) text must meet 4.5:1 at rest and hover`);let o=n.border;if(o&&[...f,...i].some(e=>Kj(o,e)<3))throw Error(`Variant ${e} (${t}) border must meet 3:1`);Object.assign(y,{[`--labstack-variant-${e}-background`]:n.background,[`--labstack-variant-${e}-hover`]:n.hover??n.background,[`--labstack-variant-${e}-color`]:a,[`--labstack-variant-${e}-border`]:n.border??`transparent`})}return y}var mM=[`NavLink`,`Tabs`,`Checkbox`,`Radio`,`Switch`,`Pagination`,`Chip`,`Stepper`,`Slider`,`RangeSlider`];function hM(e=Jj){if(!e.displayFont&&(e.displayWeight===700||e.displayTracking===-.03))throw Error(`Weight 700 and tracking -0.03em require displayFont`);let t=new Set([`filled`,`light`,`outline`,`subtle`,`transparent`,`white`,`default`,`gradient`]);for(let n of Object.keys(e.variants??{}))if(!/^[a-z][a-z0-9-]*$/.test(n)||t.has(n))throw Error(`Variant ${n} must be a new kebab-case name`);let n=e.lineWeight===void 0||e.lineWeight===1?{}:{borderWidth:`${e.lineWeight}px`},r=e.displayFont?{fontFamily:e.displayFont,fontWeight:e.displayWeight??650}:{},i=`${e.displayTracking??-.02}em`,a=Object.fromEntries(Object.entries(wj).map(([t,n])=>[t,e.tones?.[t]??n]));for(let[t,n]of Object.entries(e.colors??{})){if([`brand`,`ink`,`accent`].includes(t)||Object.hasOwn(Go.colors,t))throw Error(`colors ${t} cannot replace a built-in palette`);if(!Array.isArray(n)||n.length!==10)throw Error(`colors ${t} must have exactly ten colors`);for(let e of n)tM(e,`colors ${t}`)}if(e.accent!==void 0){if(!Array.isArray(e.accent)||e.accent.length!==10)throw Error(`accent must have exactly ten colors`);for(let t of e.accent)tM(t,`accent`)}if(e.surfaces){let t=new Set([...Object.keys(Go.colors),`brand`,`ink`,...e.accent?[`accent`]:[],...Object.keys(e.colors??{})]);for(let[n,r]of Object.entries({...a,...typeof e.primary==`string`?{primary:e.primary}:{}})){let e=r.replace(/\.\d$/,``);if(!t.has(e))throw Error(`tones ${n} uses unregistered palette ${e}; pass it in brand.colors`)}}let o={...Yj};for(let t of[`small`,`body`,`title`,`section`,`page`])o[t]=e.typeScale?.[t]??Yj[t];for(let t of Object.keys(e.typeScale??{}))if(![`small`,`body`,`title`,`section`,`page`].includes(t))throw Error(`typeScale ${t} is not a brand input`);let s={small:[12,14],body:[14,16],title:[16,20],section:[20,28],page:[28,36]},c=0;for(let e of Object.keys(s)){let t=o[e],[n,r]=s[e];if(!Number.isInteger(t)||tr||t<=c&&(e!==`body`||t!==14||c!==14))throw Error(`typeScale ${e} must be an integer in ${n}–${r} and increase strictly (small/body may both be 14)`);c=t}let l=typeof e.radius==`object`?e.radius:Qj[e.radius??`soft`],u=0;for(let e of[`control`,`surface`,`overlay`]){if(!l||!Number.isInteger(l[e])||l[e]32)throw Error(`radius ${e} must be an integer with 0 ≤ control ≤ surface ≤ overlay ≤ 32`);u=l[e]}if(e.density!==void 0&&![`default`,`compact`].includes(e.density))throw Error(`density must be default or compact`);if(e.focus!==void 0&&![`ring`,`border`].includes(e.focus))throw Error(`focus input must be ring or border`);if(e.elevation!==void 0&&![`bordered`,`shadow`,`ring`].includes(e.elevation))throw Error(`elevation must be bordered, shadow or ring`);if(e.controlSizes){let t=23;for(let n of[`sm`,`md`,`lg`]){let r=e.controlSizes[n];if(!Number.isInteger(r)||r<=t||r>56)throw Error(`controlSizes ${n} must be an integer with 24 ≤ sm < md < lg ≤ 56`);t=r}}let f=e.density===`compact`?{size:`sm`}:{},p=l.control===0?{radius:0}:{},m=t=>e.controlSizes?Object.fromEntries([`xs`,`sm`,`md`,`lg`,`xl`].map(n=>[`--${t}-${n}`,`${e.controlSizes?.[n===`xs`?`sm`:n===`xl`?`lg`:n]}px`])):{},h=e=>`${e/16}rem`,g=e.elevation===`shadow`,_=typeof e.neutralTint==`number`?{gray:sM(Go.colors.gray,e.neutralTint),dark:sM(Go.colors.dark,e.neutralTint)}:e.neutralTint,v={defaultProps:{radius:l.surface,withBorder:!g&&e.elevation!==`ring`,shadow:g?`xs`:`none`},styles:(t,r)=>({root:{backgroundColor:`var(--labstack-raised)`,borderColor:`var(--labstack-border)`,...n,...r.variant===`outline`?{border:`${e.lineWeight??1}px solid var(--labstack-border)`,boxShadow:`none`}:r.variant===`flat`?{backgroundColor:`var(--labstack-inset)`,border:`none`,boxShadow:`none`}:e.elevation===`ring`&&(r.shadow??`none`)===`none`?{boxShadow:`var(--labstack-ring)`}:{}}})},y=ms({primaryColor:`brand`,primaryShade:Zj,colors:{...e.colors,...e.accent?{accent:e.accent}:{},..._,...Object.values(a).includes(`ink`)?{ink:_?.gray??Go.colors.gray}:{},brand:e.primary===`ink`?_?.gray??Go.colors.gray:e.primary},fontFamily:e.fontFamily??Go.fontFamily,fontFamilyMonospace:e.fontFamilyMonospace??Go.fontFamilyMonospace,fontSizes:{xs:h(o.small),sm:h(o.body),md:h(o.body),lg:h(o.title),xl:h(o.section)},lineHeights:{xs:`1.5`,sm:`1.5`,md:`1.5`,lg:`1.5`,xl:`1.5`},headings:{...e.displayFont?{fontFamily:e.displayFont}:{},fontWeight:String(e.displayWeight??650),textWrap:`balance`,sizes:{h1:{fontSize:h(o.page),lineHeight:`1.25`},h2:{fontSize:h(o.section),lineHeight:`1.25`},h3:{fontSize:h(o.title),lineHeight:`1.25`},h4:{fontSize:h(o.body),lineHeight:`1.25`},h5:{fontSize:h(o.small),lineHeight:`1.25`},h6:{fontSize:h(o.small),lineHeight:`1.25`}}},defaultRadius:`sm`,radius:{xs:`${l.control}px`,sm:`${l.control}px`,md:`${l.surface}px`,lg:`${l.overlay}px`,xl:`${l.overlay}px`},respectReducedMotion:!0,autoContrast:!0,variantColorResolver:t=>{let n=t.variant??`filled`;if(!Object.hasOwn(e.variants??{},n))return lM(t);let r=e=>`var(--labstack-variant-${n}-${e})`;return{background:r(`background`),hover:r(`hover`),color:r(`color`),border:`${e.lineWeight??1}px solid ${r(`border`)}`}},components:{Paper:v,Card:v,Button:{defaultProps:{radius:l.control,...f},...e.controlSizes?{vars:()=>({root:m(`button-height`)})}:{},styles:(t,i)=>({root:{...r,...n,...e.variants?.[i.variant??`filled`]?.underline?{textDecoration:`underline`,textUnderlineOffset:`0.2em`}:{}}})},Accordion:{styles:{control:r,item:n}},Text:{styles:(e,t)=>({root:t.variant===`numeral`?{...r,letterSpacing:i,fontVariantNumeric:`tabular-nums`}:{}})},Select:{defaultProps:{...f,checkIconPosition:`right`,onFocus:rM,onMouseDown:iM,onClick:aM}},Autocomplete:{defaultProps:{...f,onFocus:rM,onMouseDown:iM,onClick:aM}},...e.density===`compact`?{TextInput:{defaultProps:f},MultiSelect:{defaultProps:f},NumberInput:{defaultProps:f},PasswordInput:{defaultProps:f},Textarea:{defaultProps:f},TagsInput:{defaultProps:f},PillsInput:{defaultProps:f},JsonInput:{defaultProps:f},NativeSelect:{defaultProps:f},ColorInput:{defaultProps:f},FileInput:{defaultProps:f}}:{},Anchor:{defaultProps:{underline:`always`}},Blockquote:{vars:(e,t)=>t.color?{root:{}}:{root:{"--bq-bd":`var(--labstack-border)`,"--bq-bg-light":`transparent`,"--bq-bg-dark":`transparent`}}},Code:{styles:{root:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,color:`var(--mantine-color-text)`}}},InputWrapper:{styles:{label:r},defaultProps:{inputWrapperOrder:[`label`,`input`,`description`,`error`]}},PinInput:{defaultProps:{placeholder:``}},Rating:{defaultProps:{color:a.warning}},Table:{defaultProps:{verticalSpacing:`xs`,horizontalSpacing:`sm`,...e.density===`compact`?{fz:`sm`}:{}},vars:(e,t)=>({table:{"--table-border-color":t.borderColor?void 0:`var(--labstack-border)`,"--table-striped-color":t.stripedColor?void 0:`color-mix(in srgb, var(--labstack-text) 4%, transparent)`,"--table-highlight-on-hover-color":t.highlightOnHoverColor?void 0:`var(--labstack-hover)`}}),styles:{td:{fontVariantNumeric:`tabular-nums`},th:{whiteSpace:`nowrap`,...e.lineWeight&&e.lineWeight!==1?{borderBottom:`${e.lineWeight}px solid var(--labstack-border)`}:{}}}},ActionIcon:{defaultProps:{radius:l.control,...f},...e.controlSizes?{vars:()=>({root:{...m(`ai-size`),...m(`ai-size-input`)}})}:{},styles:{root:n}},...e.focus===`border`?{PinInput:{defaultProps:{placeholder:``},classNames:{input:`labstack-border-focus`}},Combobox:{classNames:{search:`labstack-border-focus`}}}:{},Input:{...e.focus===`border`?{classNames:{input:`labstack-border-focus`}}:{},styles:{input:n},defaultProps:{radius:l.control,...f},vars:(e,t)=>({wrapper:{...m(`input-height`),"--input-bg":(t.variant??`default`)==="default"&&!t.disabled?`var(--labstack-raised)`:void 0,"--input-bd":(t.variant??`default`)==="default"&&!t.disabled&&!t.error&&!t.success?`var(--labstack-control-border)`:void 0}})},Skeleton:{defaultProps:{radius:l.control},classNames:{root:`labstack-Skeleton-root`}},ThemeIcon:{defaultProps:{radius:l.control}},Title:{styles:{root:{letterSpacing:i}}},Badge:{defaultProps:{variant:`light`,fw:600,tt:`none`,...f},styles:{root:{height:`auto`,maxWidth:`100%`,minHeight:`var(--badge-height)`},label:{whiteSpace:`normal`,overflowWrap:`anywhere`}},vars:(t,n)=>({root:{...[`xs`,`sm`,`md`].includes(n.size??`md`)?{"--badge-fz":`calc(0.75rem * var(--mantine-scale))`}:{},...e.primary===`ink`&&n.color===void 0&&(n.variant??`light`)===`light`?{"--badge-bg":`var(--labstack-inset)`,"--badge-color":`var(--labstack-text)`,"--badge-bd":`1px solid var(--labstack-border)`}:{}}})},Modal:{defaultProps:{centered:!0,radius:l.overlay,shadow:`lg`,overlayProps:{blur:3},closeButtonProps:{"aria-label":`Close`}},styles:{header:{background:`var(--labstack-raised)`},title:{fontWeight:e.displayWeight??650,fontSize:h(o.title)}}},Drawer:{defaultProps:{shadow:`lg`,closeButtonProps:{"aria-label":`Close`}},styles:{header:{background:`var(--labstack-raised)`},title:{fontWeight:e.displayWeight??650,fontSize:h(o.title)}}},Tooltip:{defaultProps:{radius:l.control},styles:{tooltip:{fontSize:h(o.small)}}},Alert:{defaultProps:{color:a.info,variant:`light`}},MultiSelect:{defaultProps:{checkIconPosition:`right`,...f}},Menu:{defaultProps:{withInitialFocusPlaceholder:!1,radius:l.overlay,shadow:`md`},styles:{dropdown:{background:`var(--labstack-raised)`,borderColor:`var(--labstack-border)`,...n}}},Popover:{defaultProps:{radius:l.overlay,shadow:`md`},styles:{dropdown:{background:`var(--labstack-raised)`,borderColor:`var(--labstack-border)`,...n}}},Divider:{vars:(e,t)=>({root:{"--divider-color":t.color?void 0:`var(--labstack-border-soft)`}})},Switch:{classNames:{track:`labstack-Switch-track`},defaultProps:{withThumbIndicator:!1,...p},vars:(e,t)=>({track:{"--labstack-switch-contrast":e.autoContrast?cM(t.color||e.primaryColor,e):void 0}})},Checkbox:{styles:{input:n,label:r},vars:(e,t)=>({root:{"--checkbox-icon-color":uM(e,t)}})},CheckboxIndicator:{vars:(e,t)=>({indicator:{"--checkbox-icon-color":uM(e,t)}})},Radio:{styles:{radio:n,label:{...r,overflowWrap:`anywhere`},description:{overflowWrap:`anywhere`}},vars:(e,t)=>({root:{"--radio-icon-color":uM(e,t)}})},RadioGroup:{styles:{label:{overflowWrap:`anywhere`}}},RadioIndicator:{vars:(e,t)=>({indicator:{"--radio-icon-color":uM(e,t)}})},SegmentedControl:{styles:{label:r},vars:(e,t)=>({root:{"--labstack-sc-contrast":t.color&&(t.autoContrast??e.autoContrast)?cM(t.color,e):void 0}}),defaultProps:{...f,renderRoot:e=>{let t=e.style?.[`--labstack-sc-contrast`];return(0,d.createElement)(`div`,e,t?fM(e.children,t):e.children)}}},Stepper:{vars:(e,t)=>({root:{"--stepper-icon-color":t.autoContrast??e.autoContrast?cM(t.color||e.primaryColor,e):void 0,"--labstack-step-icon-opt-out":t.autoContrast??e.autoContrast?void 0:`var(--mantine-color-white)`}})},StepperStep:{defaultProps:{renderRoot:e=>{let t=e.style,n=dM(t?.[`--step-color`]);return(0,d.createElement)(`button`,{type:`button`,...e,style:{...n?{"--stepper-icon-color":`var(--labstack-step-icon-opt-out, ${n})`}:{},...t}})}}},ProgressSection:{defaultProps:{renderRoot:e=>{let t=e.style,n=dM(t?.[`--progress-section-color`]);return(0,d.createElement)(`div`,{...e,style:{...t,...n&&t?.[`--progress-label-color`]?{"--progress-label-color":n}:{}}})}}},Tabs:{vars:(e,t)=>({root:{"--tabs-text-color":cM(t.color||e.primaryColor,e)}})},TabsTab:{defaultProps:{styles:(e,t)=>({tab:{"--tabs-text-color":t.color?cM(t.color,e):void 0}})}},...e.controlSizes?{Avatar:{vars:()=>({root:{"--avatar-size-sm":`${e.controlSizes?.sm}px`,"--avatar-size-md":`${e.controlSizes?.md}px`,"--avatar-size-lg":`${e.controlSizes?.lg}px`}})}}:{},Slider:{defaultProps:{...p}},RangeSlider:{defaultProps:{...p}},Chip:{defaultProps:{variant:`filled`,...f,...p},...e.controlSizes?{vars:()=>({root:m(`chip-size`)})}:{}},Pagination:{defaultProps:{...f,getControlProps:e=>({"aria-label":{first:`First page`,previous:`Previous page`,next:`Next page`,last:`Last page`}[e]})},vars:(e,t)=>({root:{...m(`pagination-control-size`),"--pagination-active-color":cM(t.color||e.primaryColor,e)}})}},other:{labstackTones:a,labstack:{typeScale:o,contentWidths:Xj}}});if(e.accent){y.components??={};let e=y.components,t=e.SegmentedControl??{},n=t.vars;e.SegmentedControl={...t,vars:(e,t,r)=>{let i=(typeof n==`function`?n(e,t,r):n)??{};return t.color?i:{...i,root:{...i.root,"--sc-color":`var(--mantine-color-accent-light)`,"--sc-label-color":`var(--mantine-color-accent-text)`}}}};for(let t of mM){let n=e[t]??{};e[t]={...n,defaultProps:{...n.defaultProps,color:`accent`}}}}let b=Xo(Go,y),x=t=>{let n=pM(b,t,e),r=e.chart?.series?.[t];if(e.chart?.series&&!r)throw Error(`chart.series.${t} is required`);let i=r??(t===`light`?[`#2a78d6`,`#eb6834`,`#1aa674`,`#4a3aa7`,`#c28400`,`#d57197`]:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`]);if(i.length!==6)throw Error(`chart.series (${t}) series must have exactly six colors`);let a=Array.from(i,(e,i)=>{if(tM(e,`chart.series (${t}) series[${i}]`),!r)return oM(e,[n[`--labstack-raised`]],3);if(Kj(e,n[`--labstack-raised`])<3)throw Error(`chart.series (${t}) series[${i}] must meet 3:1 on raised`);return e});return{text:n[`--labstack-text`],muted:n[`--labstack-muted`],grid:n[`--labstack-border-soft`],surface:n[`--labstack-raised`],border:n[`--labstack-border`],series:a}};return{theme:y,chart:{light:x(`light`),dark:x(`dark`)},cssVariablesResolver:t=>({variables:{},light:pM(t,`light`,e),dark:pM(t,`dark`,e)})}}var gM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),_M=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z`}))]]),vM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),yM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z`}))]]),bM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),xM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212ZM163.27,77l-56,24a12,12,0,0,0-6.3,6.3l-24,56A12,12,0,0,0,92.73,179l56-24a12,12,0,0,0,6.3-6.3l24-56A12,12,0,0,0,163.27,77Zm-28.41,57.89-24,10.29,10.29-24,24-10.29Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32Zm16,112L80,176l32-64,64-32Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm51.58,57.79-32,64a4.08,4.08,0,0,1-1.79,1.79l-64,32a4,4,0,0,1-5.37-5.37l32-64a4.08,4.08,0,0,1,1.79-1.79l64-32A4,4,0,0,1,179.58,81.79Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM173.32,74.63l-64,32a6,6,0,0,0-2.69,2.69l-32,64A6,6,0,0,0,80,182a6.06,6.06,0,0,0,2.68-.63l64-32a6,6,0,0,0,2.69-2.69l32-64a6,6,0,0,0-8.05-8.05Zm-33.79,64.9L93.42,162.58l23-46.11,46.11-23Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220ZM174.21,76.42l-64,32a4.08,4.08,0,0,0-1.79,1.79l-32,64A4,4,0,0,0,80,180a4.05,4.05,0,0,0,1.79-.42l64-32a4.08,4.08,0,0,0,1.79-1.79l32-64a4,4,0,0,0-5.37-5.37ZM141,141l-52.08,26L115,115l52.08-26Z`}))]]),SM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),CM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),wM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm92-27.21v-1.58l14-17.51a12,12,0,0,0,2.23-10.59A111.75,111.75,0,0,0,225,71.89,12,12,0,0,0,215.89,66L193.61,63.5l-1.11-1.11L190,40.1A12,12,0,0,0,184.11,31a111.67,111.67,0,0,0-27.23-11.27A12,12,0,0,0,146.3,22L128.79,36h-1.58L109.7,22a12,12,0,0,0-10.59-2.23A111.75,111.75,0,0,0,71.89,31.05,12,12,0,0,0,66,40.11L63.5,62.39,62.39,63.5,40.1,66A12,12,0,0,0,31,71.89,111.67,111.67,0,0,0,19.77,99.12,12,12,0,0,0,22,109.7l14,17.51v1.58L22,146.3a12,12,0,0,0-2.23,10.59,111.75,111.75,0,0,0,11.29,27.22A12,12,0,0,0,40.11,190l22.28,2.48,1.11,1.11L66,215.9A12,12,0,0,0,71.89,225a111.67,111.67,0,0,0,27.23,11.27A12,12,0,0,0,109.7,234l17.51-14h1.58l17.51,14a12,12,0,0,0,10.59,2.23A111.75,111.75,0,0,0,184.11,225a12,12,0,0,0,5.91-9.06l2.48-22.28,1.11-1.11L215.9,190a12,12,0,0,0,9.06-5.91,111.67,111.67,0,0,0,11.27-27.23A12,12,0,0,0,234,146.3Zm-24.12-4.89a70.1,70.1,0,0,1,0,8.2,12,12,0,0,0,2.61,8.22l12.84,16.05A86.47,86.47,0,0,1,207,166.86l-20.43,2.27a12,12,0,0,0-7.65,4,69,69,0,0,1-5.8,5.8,12,12,0,0,0-4,7.65L166.86,207a86.47,86.47,0,0,1-10.49,4.35l-16.05-12.85a12,12,0,0,0-7.5-2.62c-.24,0-.48,0-.72,0a70.1,70.1,0,0,1-8.2,0,12.06,12.06,0,0,0-8.22,2.6L99.63,211.33A86.47,86.47,0,0,1,89.14,207l-2.27-20.43a12,12,0,0,0-4-7.65,69,69,0,0,1-5.8-5.8,12,12,0,0,0-7.65-4L49,166.86a86.47,86.47,0,0,1-4.35-10.49l12.84-16.05a12,12,0,0,0,2.61-8.22,70.1,70.1,0,0,1,0-8.2,12,12,0,0,0-2.61-8.22L44.67,99.63A86.47,86.47,0,0,1,49,89.14l20.43-2.27a12,12,0,0,0,7.65-4,69,69,0,0,1,5.8-5.8,12,12,0,0,0,4-7.65L89.14,49a86.47,86.47,0,0,1,10.49-4.35l16.05,12.85a12.06,12.06,0,0,0,8.22,2.6,70.1,70.1,0,0,1,8.2,0,12,12,0,0,0,8.22-2.6l16.05-12.85A86.47,86.47,0,0,1,166.86,49l2.27,20.43a12,12,0,0,0,4,7.65,69,69,0,0,1,5.8,5.8,12,12,0,0,0,7.65,4L207,89.14a86.47,86.47,0,0,1,4.35,10.49l-12.84,16.05A12,12,0,0,0,195.88,123.9Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M207.86,123.18l16.78-21a99.14,99.14,0,0,0-10.07-24.29l-26.7-3a81,81,0,0,0-6.81-6.81l-3-26.71a99.43,99.43,0,0,0-24.3-10l-21,16.77a81.59,81.59,0,0,0-9.64,0l-21-16.78A99.14,99.14,0,0,0,77.91,41.43l-3,26.7a81,81,0,0,0-6.81,6.81l-26.71,3a99.43,99.43,0,0,0-10,24.3l16.77,21a81.59,81.59,0,0,0,0,9.64l-16.78,21a99.14,99.14,0,0,0,10.07,24.29l26.7,3a81,81,0,0,0,6.81,6.81l3,26.71a99.43,99.43,0,0,0,24.3,10l21-16.77a81.59,81.59,0,0,0,9.64,0l21,16.78a99.14,99.14,0,0,0,24.29-10.07l3-26.7a81,81,0,0,0,6.81-6.81l26.71-3a99.43,99.43,0,0,0,10-24.3l-16.77-21A81.59,81.59,0,0,0,207.86,123.18ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8.06,8.06,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8.06,8.06,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,130.16q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm83.93-32.49q.13-3.51,0-7l15.83-19.79a4,4,0,0,0,.75-3.53A103.64,103.64,0,0,0,218,75.9a4,4,0,0,0-3-2l-25.19-2.8c-1.58-1.71-3.24-3.37-4.95-4.95L182.07,41a4,4,0,0,0-2-3A104,104,0,0,0,154.82,27.5a4,4,0,0,0-3.53.74L131.51,44.07q-3.51-.14-7,0L104.7,28.24a4,4,0,0,0-3.53-.75A103.64,103.64,0,0,0,75.9,38a4,4,0,0,0-2,3l-2.8,25.19c-1.71,1.58-3.37,3.24-4.95,4.95L41,73.93a4,4,0,0,0-3,2A104,104,0,0,0,27.5,101.18a4,4,0,0,0,.74,3.53l15.83,19.78q-.14,3.51,0,7L28.24,151.3a4,4,0,0,0-.75,3.53A103.64,103.64,0,0,0,38,180.1a4,4,0,0,0,3,2l25.19,2.8c1.58,1.71,3.24,3.37,4.95,4.95l2.8,25.2a4,4,0,0,0,2,3,104,104,0,0,0,25.28,10.46,4,4,0,0,0,3.53-.74l19.78-15.83q3.51.13,7,0l19.79,15.83a4,4,0,0,0,2.5.88,4,4,0,0,0,1-.13A103.64,103.64,0,0,0,180.1,218a4,4,0,0,0,2-3l2.8-25.19c1.71-1.58,3.37-3.24,4.95-4.95l25.2-2.8a4,4,0,0,0,3-2,104,104,0,0,0,10.46-25.28,4,4,0,0,0-.74-3.53Zm.17,42.83-24.67,2.74a4,4,0,0,0-2.55,1.32,76.2,76.2,0,0,1-6.48,6.48,4,4,0,0,0-1.32,2.55l-2.74,24.66a95.45,95.45,0,0,1-19.64,8.15l-19.38-15.51a4,4,0,0,0-2.5-.87h-.24a73.67,73.67,0,0,1-9.16,0,4,4,0,0,0-2.74.87l-19.37,15.5a95.33,95.33,0,0,1-19.65-8.13l-2.74-24.67a4,4,0,0,0-1.32-2.55,76.2,76.2,0,0,1-6.48-6.48,4,4,0,0,0-2.55-1.32l-24.66-2.74a95.45,95.45,0,0,1-8.15-19.64l15.51-19.38a4,4,0,0,0,.87-2.74,77.76,77.76,0,0,1,0-9.16,4,4,0,0,0-.87-2.74l-15.5-19.37A95.33,95.33,0,0,1,43.9,81.66l24.67-2.74a4,4,0,0,0,2.55-1.32,76.2,76.2,0,0,1,6.48-6.48,4,4,0,0,0,1.32-2.55l2.74-24.66a95.45,95.45,0,0,1,19.64-8.15l19.38,15.51a4,4,0,0,0,2.74.87,73.67,73.67,0,0,1,9.16,0,4,4,0,0,0,2.74-.87l19.37-15.5a95.33,95.33,0,0,1,19.65,8.13l2.74,24.67a4,4,0,0,0,1.32,2.55,76.2,76.2,0,0,1,6.48,6.48,4,4,0,0,0,2.55,1.32l24.66,2.74a95.45,95.45,0,0,1,8.15,19.64l-15.51,19.38a4,4,0,0,0-.87,2.74,77.76,77.76,0,0,1,0,9.16,4,4,0,0,0,.87,2.74l15.5,19.37A95.33,95.33,0,0,1,212.1,174.34Z`}))]]),TM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),EM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),DM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),OM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),kM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z`}))]]),AM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),jM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),MM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),NM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),PM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z`}))]]),FM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),IM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),LM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z`}))]]),RM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z`}))]]),zM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),BM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),VM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),HM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:gM}));HM.displayName=`ArrowRightIcon`;var UM=HM,WM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:_M}));WM.displayName=`BellIcon`;var GM=WM,KM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:vM}));KM.displayName=`BookOpenIcon`;var qM=KM,JM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:yM}));JM.displayName=`ChatCircleIcon`;var YM=JM,XM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:bM}));XM.displayName=`CheckIcon`;var ZM=XM,QM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:xM}));QM.displayName=`CompassIcon`;var $M=QM,eN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:SM}));eN.displayName=`CopyIcon`;var tN=eN,nN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:CM}));nN.displayName=`DotsThreeIcon`;var rN=nN,iN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:wM}));iN.displayName=`GearIcon`;var aN=iN,oN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:TM}));oN.displayName=`KeyboardIcon`;var sN=oN,cN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:EM}));cN.displayName=`ListMagnifyingGlassIcon`;var lN=cN,uN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:DM}));uN.displayName=`MagnifyingGlassIcon`;var dN=uN,fN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:OM}));fN.displayName=`MoonIcon`;var pN=fN,mN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:kM}));mN.displayName=`PathIcon`;var hN=mN,gN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:AM}));gN.displayName=`PencilSimpleIcon`;var _N=gN,vN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:jM}));vN.displayName=`PlugsConnectedIcon`;var yN=vN,bN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:MM}));bN.displayName=`PlusIcon`;var xN=bN,SN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:NM}));SN.displayName=`QuestionIcon`;var CN=SN,wN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:PM}));wN.displayName=`SidebarSimpleIcon`;var TN=wN,EN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:FM}));EN.displayName=`SignOutIcon`;var DN=EN,ON=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:IM}));ON.displayName=`SparkleIcon`;var kN=ON,AN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:LM}));AN.displayName=`SquaresFourIcon`;var jN=AN,MN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:RM}));MN.displayName=`StarIcon`;var NN=MN,PN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:zM}));PN.displayName=`SunIcon`;var FN=PN,IN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:BM}));IN.displayName=`TrashIcon`;var LN=IN,RN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:VM}));RN.displayName=`UserPlusIcon`;var zN=RN,BN=class extends Error{status;problems;code;constructor(e,t,n=[],r=``){super(e),this.status=t,this.problems=n,this.code=r}},VN=`pitot:unauthorized`,HN=`/settings/ingest`;function UN(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`&&t.pathname!==HN?``:`${t.pathname}${t.search}`}function WN(){return UN()||(window.location.pathname===HN?HN:``)}function GN(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function KN(){window.dispatchEvent(new Event(VN))}async function qN(e,t={}){let n=new Headers(t.headers);n.set(`Pitot-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&KN(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new BN(e.message??`You do not have permission to perform this action.`,r.status,[],e.code??``)}return r}async function JN(){let e=await qN(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&KN(),window.location.assign(`/`)}var YN=[`#F1F0FF`,`#E4E2FF`,`#CDC9FF`,`#B5B0FF`,`#A29CFF`,`#8F8CFF`,`#756DEB`,`#5A50D8`,`#463DAE`,`#332B81`],XN={dark:{ground:`#0B0B0C`,raised:`#121214`,inset:`#08080A`,hover:`#1A1A1D`,border:`#232327`,borderSoft:`#1A1A1E`,controlBorder:`#828288`,text:`#EDEDEF`,muted:`#A1A1A9`},light:{ground:`#F5F5F6`,raised:`#FFFFFF`,inset:`#EFEFF1`,hover:`#EDEDEF`,border:`#E3E3E6`,borderSoft:`#ECECEE`,controlBorder:`#6D6D73`,text:`#111113`,muted:`#53535B`}},ZN=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],QN=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],$N=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],eP=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],tP={micro:11,small:12,body:14,title:16,section:20,page:28},nP={display:`"Geist Mono Variable", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},rP={small:{fontSize:15,gap:12},regular:{fontSize:18,gap:14},large:{fontSize:22,gap:16}};function iP({size:e=`regular`}){let t=rP[e];return(0,R.jsxs)(um,{component:`span`,gap:t.gap,wrap:`nowrap`,"aria-label":`Pitot`,children:[(0,R.jsx)(aP,{size:e}),(0,R.jsx)(U,{component:`span`,ff:nP.body,fz:t.fontSize,fw:600,lh:1,lts:`-0.045em`,children:`pitot`})]})}function aP({size:e=`regular`}){let t={small:32,regular:46,large:50}[e];return(0,R.jsx)(q0,{size:t,variant:`transparent`,"aria-hidden":`true`,children:(0,R.jsx)(oP,{})})}function oP(){let e=Ho(`light`)===`dark`,t=XN[e?`dark`:`light`].text;return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`100%`,height:`100%`,"aria-hidden":`true`,children:(0,R.jsxs)(`g`,{fill:`none`,strokeWidth:`2.6`,strokeLinecap:`round`,children:[(0,R.jsx)(`path`,{stroke:YN[e?5:7],d:`M3.3 4.5H20.7`}),(0,R.jsx)(`path`,{stroke:t,d:`M7 9.5H16.5`}),(0,R.jsx)(`path`,{stroke:t,d:`M7 14.5H11.5`}),(0,R.jsx)(`path`,{stroke:e?`#4A4A52`:`#B4B4BB`,d:`M10.5 19.5H17`})]})})}var sP={home:`https://pitot.dev/docs`,ingest:`https://pitot.dev/docs/get-started/send-telemetry`,connect:`https://pitot.dev/docs/guides/mcp`,authentication:`https://pitot.dev/docs/concepts/authentication`},cP=(0,d.createContext)(null);function lP(){let e=(0,d.useContext)(cP);if(!e)throw Error(`Pitot runtime status is unavailable`);return e}var uP=(0,d.createContext)(null);function dP(){let e=(0,d.useContext)(uP);if(!e)throw Error(`Pitot viewer is unavailable`);return e}function fP(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function pP(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??`Request failed (${n.status})`);return r}function mP(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function hP(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function gP({children:e}){let t=xr(),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(`none`),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(mP),[y,b]=(0,d.useState)(hP),[x,S]=(0,d.useState)(``),[C,w]=(0,d.useState)(!1),[T,E]=(0,d.useState)(0),[D,O]=(0,d.useState)(()=>Date.now()),[k,A]=(0,d.useState)(null),[j,M]=(0,d.useState)(!1),[N,P]=(0,d.useState)(``),[F,ee]=(0,d.useState)(null),[I,te]=(0,d.useState)(!1),ne=(0,d.useRef)(null),re=UN(),ie=o===`user`;async function ae(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(GN(t)),l(fP(t))}async function oe(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(fP(await e.json().catch(()=>null)))}catch{}}(0,d.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,d.useEffect)(()=>{pP(`/api/auth/status`).then(r).catch(e=>P(String(e))).finally(()=>a(!0)),ae().catch(()=>s(`none`)).finally(()=>f(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(VN,e),()=>window.removeEventListener(VN,e)},[]),(0,d.useEffect)(()=>{u&&o===`none`&&y&&(M(!0),P(``),pP(`/api/auth/link/verify`,{token:y}).then(()=>{s(`user`),oe()}).catch(e=>P(e instanceof Error?e.message:String(e))).finally(()=>{b(``),M(!1)}))},[y,u,o]),(0,d.useEffect)(()=>{ie&&u&&re&&window.location.replace(re)},[ie,re,u]),(0,d.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{O(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let se=Math.max(0,Math.ceil((T-D)/1e3));async function ce(e){try{await navigator.clipboard.writeText(e),te(!0)}catch{P(`Clipboard access failed. Select and copy the token manually.`)}}if(F?.ingest_token)return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(aP,{}),footer:(0,R.jsx)(bg,{href:sP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),size:`lg`,children:(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsx)(Hj,{eyebrow:`Setup complete`,title:`Save your ingest token`}),(0,R.jsx)(U,{c:`dimmed`,children:`Pitot shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(U0,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(R_,{block:!0,children:F.suggested_endpoint??window.location.origin})]}),(0,R.jsxs)(U0,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(R_,{block:!0,children:[F.ingest_header_name??`Authorization`,`: Bearer `,F.ingest_token]})]}),N&&(0,R.jsx)(Mj,{tone:`danger`,children:N}),(0,R.jsxs)(um,{grow:!0,align:`stretch`,children:[(0,R.jsx)(N_,{variant:`light`,radius:`md`,leftSection:I?(0,R.jsx)(ZM,{size:16,weight:`bold`}):(0,R.jsx)(tN,{size:16}),onClick:()=>void ce(`${F.ingest_header_name??`Authorization`}: Bearer ${F.ingest_token}`),children:I?`Copied`:`Copy header`}),(0,R.jsx)(N_,{radius:`md`,rightSection:(0,R.jsx)(UM,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ee(null),oe()},children:`Continue to Pitot`})]}),(0,R.jsx)(N_,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ce(F.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||y)return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(aP,{}),footer:(0,R.jsx)(bg,{href:sP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsx)(Fj,{state:`loading`,loadingLabel:`Loading sign-in`,rows:4})});if(!n)return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(aP,{}),footer:(0,R.jsx)(bg,{href:sP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsx)(Hj,{title:`Pitot is unavailable`}),(0,R.jsx)(Mj,{tone:`danger`,children:N||`Authentication status could not be loaded.`})]})});if(ie&&re)return null;if(ie)return(0,R.jsx)(cP.Provider,{value:n,children:(0,R.jsx)(uP.Provider,{value:c??{id:``,email:p,display_name:h,status:`active`,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=WN(),t=e?`/api/auth/oidc/start?return_to=${encodeURIComponent(e)}`:`/api/auth/oidc/start`;return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(aP,{}),footer:(0,R.jsx)(bg,{href:sP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsxs)(U0,{gap:28,children:[(0,R.jsx)(Hj,{title:`Sign in to Pitot`,description:`Use your organization’s identity provider to continue.`}),N&&(0,R.jsx)(Mj,{tone:`danger`,children:N}),(0,R.jsx)(N_,{component:`a`,href:t,size:`md`,radius:`md`,rightSection:(0,R.jsx)(UM,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function le(){if(!(j||!n?.smtp_configured||C&&se>0)){M(!0),A(C?`resend`:`send`),P(``);try{await pP(`/api/auth/code/send`,{email:p}),w(!0),S(``),E(Date.now()+3e4),O(Date.now())}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1),A(null)}}}async function ue(e){if(!(j||e.length!==6)){M(!0),A(`verify`),P(``);try{await pP(`/api/auth/code/verify`,{email:p,code:e}),s(`user`),w(!1),S(``),E(0),oe()}catch(e){S(``),P(e instanceof Error?e.message:String(e))}finally{M(!1),A(null)}}}function de(){w(!1),S(``),E(0),P(``)}async function fe(e){e.preventDefault(),M(!0),P(``);try{let e=await pP(`/api/auth/setup`,{email:p,display_name:h,setup_token:_});e.ingest_token?ee(e):(s(`user`),oe())}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1)}}return n.setup_required?(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(aP,{}),footer:(0,R.jsx)(bg,{href:sP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsxs)(U0,{gap:28,children:[(0,R.jsx)(Hj,{eyebrow:`One-time setup`,title:`Create the first admin`,description:`Use the one-time token printed by the Pitot process.`}),(0,R.jsx)(`form`,{onSubmit:fe,children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(W0,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:p,onChange:e=>m(e.currentTarget.value),autoFocus:!0}),(0,R.jsx)(W0,{label:`Display name`,placeholder:`Your display name`,value:h,onChange:e=>g(e.currentTarget.value)}),(0,R.jsx)(W0,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:_,onChange:e=>v(e.currentTarget.value),autoComplete:`one-time-code`}),N&&(0,R.jsx)(Mj,{tone:`danger`,children:N}),(0,R.jsx)(N_,{type:`submit`,loading:j,leftSection:(0,R.jsx)(zN,{size:17,weight:`bold`}),children:`Create admin`})]})})]})}):(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(aP,{}),footer:(0,R.jsx)(bg,{href:sP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsx)(`fieldset`,{disabled:!n.smtp_configured,style:{border:0,padding:0,margin:0,minWidth:0},children:(0,R.jsx)(Bj,{step:C?`code`:`email`,title:`Sign in to Pitot`,description:n.smtp_configured?n.self_signup?`We'll email you a 6-digit code. New here? This creates your account.`:`We'll email you a 6-digit code.`:`Email delivery is not configured. Ask the operator to run pitot login-link with your email address.`,email:p,onEmailChange:m,inputRef:ne,onSendCode:()=>{ne.current?.reportValidity()&&le()},code:x,onCodeChange:S,onVerify:e=>void ue(e),onChangeEmail:de,onResend:()=>void le(),resendIn:se,pending:k,error:N||void 0,stepLabels:!1,expiresInMinutes:5,codeNote:(0,R.jsx)(U,{size:`xs`,c:`dimmed`,children:`Codes expire in 5 minutes. Check your spam folder if the email hasn’t arrived.`}),labels:{continue:`Continue with email`,verify:`Verify code`,resend:`Resend code`,changeEmail:`Change email`,codeSent:()=>(0,R.jsxs)(R.Fragment,{children:[`Enter the code sent to `,(0,R.jsx)(U,{span:!0,inherit:!0,fw:700,children:p}),`.`]}),resendIn:e=>`Resend in ${e}`}})})})}var _P=[`agent-threads`];async function vP(e){let t=await qN(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var yP=new Set([`create_dashboard`,`edit_dashboard`,`replace_dashboard`,`restore_dashboard_version`]);function bP(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function xP(e){if(typeof e==`string`)try{let t=JSON.parse(e);if(bP(t))return t}catch{}}var SP=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),CP=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function wP(e){return bP(e)&&typeof e.id==`string`&&[`ok`,`empty`,`error`,`invalid`,`not_run`,`partial`,`stale`].includes(String(e.status))&&(e.rows===void 0||CP(e.rows))&&(e.elapsed_ms===void 0||CP(e.elapsed_ms))&&(e.diagnosis===void 0||typeof e.diagnosis==`string`)&&(e.error===void 0||typeof e.error==`string`)}function TP(e){if(!bP(e)||!Number.isInteger(e.base_version)||Number(e.base_version)<0||!Number.isInteger(e.version)||Number(e.version)<1||!Array.isArray(e.changes)||typeof e.layout_changed!=`boolean`||e.dashboard_fields!==void 0&&!SP(e.dashboard_fields)||!e.changes.every(e=>bP(e)&&typeof e.panel_id==`string`&&typeof e.title==`string`&&[`added`,`changed`,`removed`].includes(String(e.kind))&&(e.fields===void 0||SP(e.fields)&&!e.fields.includes(`grid`))&&(e.position_changed===void 0||typeof e.position_changed==`boolean`)))return!1;let t=e.save_check;return bP(t)&&typeof t.checked==`boolean`&&CP(t.elapsed_ms)&&Array.isArray(t.panels)&&t.panels.every(e=>wP(e)&&Number.isInteger(e.rows)&&Number(e.rows)>=0)&&new Set(t.panels.map(e=>e.id)).size===t.panels.length&&(t.reason===void 0||typeof t.reason==`string`)&&(!t.checked||t.panels.every(e=>e.status!==`not_run`))}function EP(e,t,n){let r=-1;n.forEach((n,i)=>{n.role===`tool`&&n.toolCallId===e&&n.content===t&&(r=i)});let i=r<0?n.length:r,a=-1;if(n.slice(0,i).forEach((e,t)=>{e.role===`user`&&(a=t)}),a<0)return null;let o=n.slice(a+1,i).flatMap(e=>e.role===`assistant`?e.toolCalls??[]:[]).filter(t=>t.id===e),s=o.length===1?o[0].function.name:void 0;if(!s||!yP.has(s))return null;let c=xP(t),l=c?.dashboard,u=c?.receipt;return!c||c.error||c.isError||!bP(l)||typeof l.id!=`string`||!l.id||typeof l.name!=`string`||!l.name||!TP(u)||l.version!==u.version||r>=0&&n[r].error?null:{id:l.id,name:l.name,version:u.version,label:s===`create_dashboard`?`Created`:s===`restore_dashboard_version`?`Restored`:`Updated`,receipt:u}}var DP={viz:`chart type`,sql:`SQL`,content:`text`,x_unit:`x-axis unit`,options:`display options`,drill:`drill-down`,click:`click action`,time:`time range`,annotations:`markers`,better:`better direction`,reduce:`summary`,min:`minimum`,max:`maximum`},OP=e=>Object.hasOwn(DP,e)?DP[e]:e.replaceAll(`_`,` `),kP=e=>e.kind===`added`?`+ ${e.title}`:e.kind===`removed`?`− ${e.title}`:`~ ${e.title}${e.fields?.length?`: `+e.fields.map(OP).join(`, `):``}${e.position_changed?` · moved`:``}`;function AP(e){return[...e.changes.map(kP),...e.layout_changed?[`Layout adjusted`]:[],...e.dashboard_fields?.map(e=>`Dashboard: ${OP(e)}`)??[]]}function jP(e,t,n){return e.filter(e=>n.has(e.panel_id)&&!t.some(t=>t.panel_id===e.panel_id&&t.path===e.path))}var MP={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},NP=new Set([`get_insights`,`query_telemetry`,`get_overview`,`get_service_topology`,`get_service_dependencies`,`get_service_performance`,`inspect_trace`,`search_logs`]),PP=(e,t)=>Array.isArray(e)?e.flatMap(e=>bP(e)&&typeof e.path==`string`&&typeof e.message==`string`?[{panel_id:t,path:e.path,message:e.message}]:[]):[],FP=e=>{let t=xP(e)?.error;return bP(t)?t.code:void 0},IP=e=>e.role===`tool`&&FP(e.content)===`interrupted`,LP=e=>![`invalid`,`not_run`].includes(e.status);function RP(e,t){let n=e.findIndex(e=>e.id===t&&e.role===`user`);if(n<0)return null;let r=e.findIndex((e,t)=>t>n&&e.role===`user`),i=e.slice(n+1,r<0?void 0:r),a=new Set(i.flatMap(e=>e.role===`tool`&&FP(e.content)===`answer_only`?[e.toolCallId]:[])),o=i.flatMap((e,t)=>e.role===`assistant`?(e.toolCalls??[]).map(e=>({call:e,index:t})):[]).filter(({call:e})=>!a.has(e.id));if(!o.some(({call:e})=>yP.has(e.function.name)||e.function.name===`preview_panels`))return null;let s={schema:{state:`unobserved`},context:{state:`unobserved`},draft:{state:`unobserved`},validation:{state:`unobserved`},preview:{state:`unobserved`},save:{state:`unobserved`}},c={turn_id:t,stages:s,panel_titles:{},panels:[],problems:[],corrections:[],save_attempts:[],explanations:[],context_counts:{deploys:0,anomalies:0}},l=new Map,u=new Map;for(let{call:e}of o)l.set(e.id,(l.get(e.id)??0)+1);i.forEach((e,t)=>{if(e.role===`tool`){let n=u.get(e.toolCallId)??[];n.push({index:t,message:e}),u.set(e.toolCallId,n)}});let d=new Map,f=new Map,p=[],m,h=!1,g=!1,_=(e,t)=>{for(let n of jP(y.get(e)??[],t,new Set([e])))p.some(e=>e.panel_id===n.panel_id&&e.path===n.path)||p.push(n);y.set(e,t)},v=new Map,y=new Map,b=new Set,x=!1,S=!1;for(let{call:t,index:n}of o){if(l.get(t.id)!==1)continue;let r=t.function.name,i=xP(t.function.arguments),a=(u.get(t.id)??[]).filter(e=>e.index>n),o=a.length===1||yP.has(r)&&a.length>1&&a.slice(0,-1).every(e=>IP(e.message))?a.at(-1).message:void 0,C=o&&xP(o.content),w=!!C&&o?.role===`tool`&&!o.error&&!C.error&&!C.isError,T=o?w?`complete`:`failed`:`incomplete`;if(r===`get_telemetry_schema`&&(s.schema={state:T}),NP.has(r)){let e=o?.role===`tool`&&!o.error&&!C?.error&&!C?.isError&&typeof o.content==`string`&&o.content.length>0;if(s.context={state:o?e?`complete`:`failed`:`incomplete`},w)for(let[e,t]of[[`deploys`,[`deploys`,`deployments`]],[`anomalies`,[`anomalies`]]])for(let n of t)Array.isArray(C[n])&&(c.context_counts[e]+=C[n].length)}if(r===`preview_panels`||r===`create_dashboard`||r===`replace_dashboard`){let e=r===`preview_panels`?i?.panels:bP(i?.dashboard)?i.dashboard.panels:void 0;if(Array.isArray(e)){c.panel_count=e.length,s.draft={state:`complete`};for(let t of e)bP(t)&&typeof t.id==`string`&&typeof t.title==`string`&&t.title.trim()&&f.set(t.id,t.title)}}if(r===`preview_panels`){x=!0;let e=Array.isArray(i?.panels)?i.panels.flatMap(e=>bP(e)&&typeof e.id==`string`?[e.id]:[]):[];for(let t of e)v.set(t,{id:t,status:`not_run`});let t=w&&Array.isArray(C.panels)&&C.panels.every(wP)?C.panels:void 0,n=typeof C?.elapsed_ms==`number`&&C.elapsed_ms>=0?C.elapsed_ms:void 0;if(s.validation={state:t?t.some(e=>e.status===`invalid`||e.status===`not_run`)||PP(C?.problems,`dashboard`).length?`failed`:`complete`:T===`complete`?`failed`:T},s.preview={state:t?t.every(LP)?`complete`:`incomplete`:T===`complete`?`failed`:T,elapsed_ms:n},!t||e.length===0||t.length!==e.length||new Set(t.map(e=>e.id)).size!==e.length||t.some(t=>!e.includes(t.id))){S=e.length===0;for(let t of e)o&&b.add(t);continue}S=!1;for(let t of e)b.delete(t);for(let e of t){let t=PP(e.problems,e.id);if(e.status!==`not_run`)_(e.id,t);else{let n=y.get(e.id)??[];y.set(e.id,[...n,...t.filter(e=>!n.some(t=>t.path===e.path))])}v.set(e.id,e)}c.problems=[...y.values()].flat().concat(PP(C?.problems,`dashboard`))}if(yP.has(r)){let n=o&&EP(t.id,o.content,e),r=!!o&&IP(o),i=!r&&o?.role===`tool`&&(!!o.error||!!C?.error||!!C?.isError);if(g=!!i,h=!!o&&!n&&!i&&!r,s.save={state:n?`complete`:r?`interrupted`:i?`failed`:`incomplete`},n)for(let e of c.save_attempts)e.state===`failed`&&(e.state=`retried`);if(c.save_attempts.push({call_id:t.id,state:s.save.state}),n){m?.id!==n.id&&(m=n,d.clear());for(let e of n.receipt.changes){e.title.trim()&&f.set(e.panel_id,e.title);let t=d.get(e.panel_id);t?.kind===`added`&&e.kind===`removed`?d.delete(e.panel_id):t?.kind===`added`?d.set(e.panel_id,{panel_id:e.panel_id,title:e.title,kind:`added`}):e.kind===`removed`?d.set(e.panel_id,e):t&&e.kind===`changed`?d.set(e.panel_id,{...e,fields:[...new Set([...t.fields??[],...e.fields??[]])].sort(),position_changed:t.position_changed||e.position_changed}):d.set(e.panel_id,t?.kind===`removed`&&e.kind===`added`?{...e,kind:`changed`}:e)}let e=C?.dashboard,t=bP(e)?e.spec:void 0;if(bP(t)&&Array.isArray(t.panels))for(let e of t.panels)bP(e)&&typeof e.id==`string`&&typeof e.title==`string`&&e.title.trim()&&f.set(e.id,e.title);let r=c.saved?.id===n.id?c.saved.receipt:void 0;c.saved={...n,label:m.label,receipt:{...n.receipt,base_version:m.receipt.base_version,changes:[...d.values()],layout_changed:m.receipt.base_version!==0&&(n.receipt.layout_changed||!!r?.layout_changed),dashboard_fields:m.receipt.base_version===0?void 0:[...new Set([...r?.dashboard_fields??[],...n.receipt.dashboard_fields??[]])].sort()}},c.panel_count=n.receipt.save_check.panels.length,s.draft={state:`complete`};let i=new Set(n.receipt.save_check.panels.map(e=>e.id));for(let e of n.receipt.save_check.panels)e.status===`invalid`?_(e.id,PP(e.problems,e.id)):LP(e)&&(_(e.id,[]),b.delete(e.id));p=p.filter(e=>i.has(e.panel_id)),c.problems=[...y.values()].flat().filter(e=>i.has(e.panel_id))}}}if(h)return null;c.panel_titles=Object.fromEntries(f),c.corrections=p.map(e=>({...e,title:f.get(e.panel_id)??e.panel_id}));let C=c.saved?new Set(c.saved.receipt.save_check.panels.map(e=>e.id)):void 0;if(c.panels=[...v.values()].filter(e=>!C||C.has(e.id)),x){let e=S||[...b].some(e=>!C||C.has(e)),t=c.panels.some(e=>e.status===`not_run`),n=c.problems.length>0;s.validation.state=e||n?`failed`:t?`incomplete`:`complete`,s.preview.state=e?`failed`:t||n||c.panels.some(e=>e.status===`invalid`)?`incomplete`:`complete`}let w=c.saved?.receipt.save_check;w&&!w.checked&&c.explanations.push(`Save check incomplete: ${w.reason||`Panels were not checked`}`);for(let e of w?.panels??c.panels)e.status!==`ok`&&c.explanations.push(`${f.get(e.id)??e.id}: ${e.status}${e.error||e.diagnosis?` — ${e.error||e.diagnosis}`:``}`);for(let e of c.problems)c.explanations.push(`${f.get(e.panel_id)??e.panel_id}: ${e.message}`);let T=Object.entries(s).filter(([,e])=>e.state===`incomplete`||e.state===`failed`).map(([e,t])=>`${MP[e]}: ${t.state}`);return T.length&&c.explanations.push(T.join(` · `)),s.save.state===`interrupted`&&c.explanations.push(`Save interrupted · outcome unknown`),g&&c.explanations.push(c.saved?`A later change failed; v${c.saved.version} remains saved`:`Save failed · dashboard was not saved`),c}var zP=(0,d.createContext)(null);function BP(){let e=(0,d.useContext)(zP);if(!e)throw Error(`Pitot app context is unavailable`);return e}var VP=`Build me a dashboard for my services, showing request volume, latency, and errors. Ask me which services to monitor first.`,HP={query_telemetry:{activity:`Querying telemetry…`,title:`Telemetry panels`},get_overview:{activity:`Checking system health…`,title:`System health`},get_service_topology:{activity:`Mapping service dependencies…`,title:`Service map`},get_service_dependencies:{activity:`Tracing service dependencies…`,title:`Service dependencies`},list_panel_exemplars:{activity:`Finding example traces…`,title:`Example traces`},resolve_panel_variables:{activity:`Reading filter choices…`,title:`Filter choices`},query_panel_fragment:{activity:`Refreshing panels…`,title:`Panel refresh`},get_service_performance:{activity:`Reading performance signals…`,title:`Performance`},inspect_trace:{activity:`Inspecting a trace…`,title:`Trace lookup`},search_logs:{activity:`Searching logs…`,title:`Logs`},get_insights:{activity:`Reviewing detected anomalies…`,title:`Detected anomalies`},get_telemetry_schema:{activity:`Reading what telemetry exists…`,title:`Telemetry discovery`},preview_panels:{activity:`Checking dashboard panels…`,title:`Panel check`},list_dashboards:{activity:`Looking through your dashboards…`,title:`Dashboards`},get_dashboard:{activity:`Opening your dashboard…`,title:`Dashboard`},create_dashboard:{activity:`Building your dashboard…`,title:`Dashboard save`},edit_dashboard:{activity:`Updating your dashboard…`,title:`Dashboard save`},replace_dashboard:{activity:`Redesigning your dashboard…`,title:`Dashboard save`},list_dashboard_versions:{activity:`Reading your dashboard history…`,title:`Dashboard history`},restore_dashboard_version:{activity:`Restoring your dashboard…`,title:`Dashboard`}};function UP(e){return HP[e]?.activity??`Working on it…`}function WP(e){return HP[e]?.title??`Analysis step`}function GP(e){switch(e){case`provider_unavailable`:return`Pitot could not reach the model provider. Please try again.`;case`step_limit`:return`Pitot reached its step limit before finishing. Try a narrower question.`;case`time_limit`:return`Pitot reached its 5-minute time limit. Try a smaller request.`;default:return`Pitot could not complete this analysis. Please try again.`}}function KP(e){let t=(0,d.useRef)(new Map);return(0,d.useMemo)(()=>{let n=new Map,r=new Set,i=e.flatMap((e,t)=>e.role===`user`?[t]:[]);i.forEach((a,o)=>{let s=i[o+1]??e.length,c=e[a],l=e[s-1];r.add(c.id);let u=t.current.get(c.id),d=u&&u.last===l&&u.length===s-a?u.receipt:RP(e.slice(a,s),c.id);oe.msecs?(e.seq=tF(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function eF(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=tF(e),r[i++]=t/0x10000000000&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function tF(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function nF(){return QP()}var rF=[`dashboards`],iF=e=>[`dashboard`,e],aF=e=>[`dashboard-versions`,e],oF=3e4;async function sF(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await qN(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw cF(o,s);return s}var cF=(e,t)=>new BN(t.message??`Request failed (${e.status})`,e.status,t.problems??[],t.code??``),lF=e=>`/api/dashboards/${encodeURIComponent(e)}`,uF=()=>sF(`/api/dashboards`).then(e=>e.dashboards),dF=(e,t)=>sF(lF(e),{signal:t}),fF=(e,t)=>sF(`${lF(e)}/versions`,{signal:t}).then(e=>e.versions),pF=(e,t,n)=>sF(`${lF(e)}/versions/${t}`,{signal:n}),mF=(e,t)=>sF(`${lF(e)}/versions/${t}/restore`,{method:`POST`}),hF=(e,t,n,r)=>sF(lF(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),gF=(e,t,n,r)=>sF(lF(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}});async function _F(e,t,n,r=!1){let i=r?{"cache-control":`no-cache`}:{};if(!n)return sF(`/api/queries/run`,{method:`POST`,headers:i,json:e,signal:t}).then(e=>e.results);let a=await qN(`/api/queries/run`,{method:`POST`,headers:{...i,"content-type":`application/json`,accept:`application/x-ndjson`},body:JSON.stringify(e),signal:t});if(!a.ok)throw cF(a,await a.json().catch(()=>({})));let o=[],s=a.body.pipeThrough(new TextDecoderStream).getReader(),c=``;try{for(;;){let{done:e,value:t}=await s.read();c+=t??``;let r;for(;(r=c.indexOf(` -`))>=0;){let e=c.slice(0,r);if(c=c.slice(r+1),!e.trim())continue;let t=JSON.parse(e);o.push(t),n(t)}if(e)return o}}catch(e){throw s.cancel().catch(()=>{}),e}}var vF=e=>sF(`/api/dashboards`,{method:`POST`,json:{spec:e}}),yF=e=>sF(`/api/telemetry/schema`,{signal:e}),bF=XA({queryKey:[`telemetry-schema`],queryFn:({signal:e})=>yF(e),staleTime:6e4,retry:!1}),xF=(e,t)=>sF(`/api/annotations/query`,{method:`POST`,json:e,signal:t}),SF=(e,t)=>sF(`/api/queries/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),CF=(e,t)=>sF(`/api/queries/exemplars`,{method:`POST`,json:e,signal:t});function wF(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`500`});return sF(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function TF(){let{setColorScheme:e}=zo(),t=Ho(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,d.useState)(!1);return(0,R.jsx)(F0,{label:`Switch to ${n} theme`,opened:r,children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,R.jsx)(FN,{size:17,weight:`bold`}):(0,R.jsx)(pN,{size:17,weight:`bold`})})})}function EF(){let e=(0,d.useRef)(null);return(0,d.useRef)({remember(t){e.current=t instanceof HTMLElement?t:null},restore(t){let n=e.current;requestAnimationFrame(()=>(n?.isConnected?n:t)?.focus())}}).current}var DF=`pitot:shortcuts`,OF=0,kF=new Set,AF=()=>{for(let e of kF)e()};function jF(e){(0,d.useEffect)(()=>(window.addEventListener(DF,e),OF+=1,AF(),()=>{window.removeEventListener(DF,e),--OF,AF()}),[e])}function MF(){return(0,d.useSyncExternalStore)(e=>(kF.add(e),()=>kF.delete(e)),()=>OF>0,()=>!1)}function NF(){let e=MF(),t=(0,d.useRef)(null);return(0,R.jsxs)(X1,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(F0,{label:`Help`,children:(0,R.jsx)(em,{ref:t,variant:`subtle`,color:`gray`,"aria-label":`Help`,children:(0,R.jsx)(CN,{size:18,weight:`bold`})})})}),(0,R.jsxs)(X1.Dropdown,{children:[(0,R.jsx)(X1.Item,{component:`a`,href:sP.home,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(qM,{size:15}),children:`Documentation`}),e&&(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(sN,{size:15}),rightSection:(0,R.jsx)(d1,{size:`xs`,children:`?`}),onClick:()=>{t.current?.focus(),window.dispatchEvent(new Event(DF))},children:`Keyboard shortcuts`})]})]})}var PF=[`alerting`,`rules`],FF=[`alerting`,`alerts`],IF=[`alerting`,`email`],LF=e=>`/api/alerting/rules/${encodeURIComponent(e)}`,RF=e=>sF(`/api/alerting/rules`,{signal:e}).then(e=>e.rules),zF=e=>sF(`/api/alerting/alerts`,{signal:e}).then(e=>e.alerts),BF=e=>sF(`/api/alerting/email`,{signal:e}),VF=e=>sF(`/api/alerting/rules`,{method:`POST`,json:e}),HF=(e,t)=>sF(LF(e),{method:`PUT`,json:t}),UF=e=>sF(LF(e),{method:`DELETE`}),WF=e=>sF(`/api/telemetry/schema?window=1h`,{signal:e}).then(e=>(e.services??[]).map(e=>e.value)),GF={queryKey:[`services`,`1h`],queryFn:({signal:e})=>WF(e)},KF=e=>sF(`${LF(e)}/test`,{method:`POST`}),qF=(e,t)=>`${e} ${t}${e===1?``:`s`}`,JF=(e,t)=>String(Number(e.toFixed(t))),YF=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function XF(e){return Number.isFinite(e)?e>0&&e<1e-4?`<0.01%`:`${(e*100).toFixed(e>=.1?1:2)}%`:`—`}function ZF(e){if(!Number.isFinite(e))return`—`;if(e<0)return`-${ZF(-e)}`;if(e===0)return`0 ms`;if(e<.01)return`<0.01 ms`;if(e<1)return`${JF(e,2)} ms`;if(Math.round(e*10)/10<100)return`${JF(e,1)} ms`;if(Math.round(e)<1e3)return`${Math.round(e)} ms`;let t=Math.round(e/100)/10;if(t<10)return`${JF(e/1e3,2)} s`;if(t<60)return`${JF(t,1)} s`;let n=Math.round(e/1e3),r=Math.floor(n/60),i=n%60;if(r<60)return i===0?`${r} m`:`${r} m ${i} s`;let a=Math.floor(r/60),o=r%60;return o===0?`${a} h`:`${a} h ${o} m`}function QF(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toLocaleString([],{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,second:`2-digit`,timeZoneName:`short`})}var $F=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),eI=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function tI(e){return Math.abs(e)<1e-4?e.toExponential(2).replace(/\.?(0+)(?=e)/,``):String(Number(e.toPrecision(3)))}function nI(e,t=eI){return e!==0&&Math.abs(e)<1?tI(e):t.format(e)}function rI(e,t){let n=t===`s`?e*1e3:t===`ns`?e/1e6:e;return e!==0&&n===0?`${tI(e)} ${t}`:n!==0&&Math.abs(n)<1?`${tI(n)} ms`:ZF(n)}var iI=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function aI(e){let t=e,n=0;for(;Math.abs(t)>=1024&&n=1e4?$F:eI)}}var sI={ms:1,s:1e3,ns:1e-6},cI=[[36e5,`h`],[6e4,`m`],[1e3,`s`],[1,`ms`]];function lI(e,t){let n=e===void 0?void 0:sI[e];if(e===`bytes`&&t&&t.interval>0){let e=Math.max(Math.abs(t.min),Math.abs(t.max)),n=[4,3,2,1].find(n=>e>=1024**n&&Math.abs(t.interval/1024**n*100-Math.round(t.interval/1024**n*100))<1e-6)??0;return e=>Number.isFinite(e)?`${nI(e/1024**n)} ${iI[n]}`:`—`}if(e===`percent`&&t&&t.interval>0){let e=[0,1,2,3,4].find(e=>{let n=t.interval*10**e;return Math.round(n)!==0&&Math.abs(n-Math.round(n))<1e-6*Math.abs(n)});if(e!==void 0){let t=new Intl.NumberFormat(`en`,{minimumFractionDigits:e,maximumFractionDigits:e});return e=>Number.isFinite(e)?`${t.format(e)}%`:`—`}}if(n!==void 0&&t&&t.interval>0){let e=Math.max(Math.abs(t.min),Math.abs(t.max))*n,r=t.interval*n,[i,a]=cI.find(([t])=>e>=t&&Math.abs(r/t*100-Math.round(r/t*100))<1e-6)??[1,`ms`];return e=>Number.isFinite(e)?`${nI(e*n/i)} ${a}`:`—`}return t=>(!e||e===`count`)&&Math.abs(t)>=1e3?nI(t,$F):e===`ms`||e===`s`||e===`ns`?oI(e,t).replace(/(\.\d*?)0+([a-z]*)$/,`$1$2`).replace(/\.([a-z]*)$/,`$1`):oI(e,t)}function uI(e){return e!==void 0&&e!==`count`&&/[^\d\s]$/.test(lI(e)(1).trim())}function dI(e,t,n){return lI(e,n)(t??NaN).replace(/(?<=\d)(ms|ns|s|m|h)\b/g,` $1`)}function fI(e){return Math.max(3,Math.min(10,Math.round(e/70)))-1}function pI(e,t){let n=t===`ms`?1:t===`s`?1e3:t===`ns`?1e-6:void 0,r=e=>{let t=10**Math.floor(Math.log10(e));return[1,2,5,10].map(e=>e*t).find(t=>t>=e)};if(t===`bytes`){let t=Math.min(4,Math.max(0,Math.floor(Math.log(e)/Math.log(1024)))),n=r(Math.max(e/1024**t,+(t===0)));return(n>=1e3&&t<4?1024:n)*1024**t}if(n===void 0)return r(e);let i=e*n,a=[1,10,100,1e3,1e4,6e4,6e5,36e5,36e6].flatMap(e=>[1,2,5].map(t=>e*t)).sort((e,t)=>e-t);return(i<1?r(i):a.find(e=>e>=i)??r(i/36e5)*36e5)/n}function mI(e,t,n,r){e=Number.isFinite(e)?Math.min(0,e):0,t=Number.isFinite(t)?Math.max(0,t):1,t===e&&(t=e+1);let i=fI(r),a=pI(Math.max(t-e,2**-52)/i,n);for(let r=0;r<64&&Math.ceil(t/a)-Math.floor(e/a)>i;r++)a=pI(a*1.01,n);return{min:Math.floor(e/a)*a,max:Math.ceil(t/a)*a,interval:a,splitNumber:i,pitot_unit:n}}function hI(e,t){if(e.type!==`value`&&e.type!==`log`)return e;if(e.type!==`value`||typeof e.min!=`number`||typeof e.max!=`number`)return{...e,splitNumber:fI(t)};let n=typeof e.pitot_unit==`string`?e.pitot_unit:void 0,r=mI(e.min,e.max,n,t);return{...e,...r,...n&&(n in sI||n===`bytes`||n===`percent`)?{axisLabel:{...e.axisLabel,formatter:lI(n,r)}}:{}}}function gI(e,t,n){let r=e=>oI(n,e),i=``;if(n===`ms`||n===`s`||n===`ns`){let a=n===`s`?1e3:n===`ns`?1e-6:1,o=Math.abs((e??t??0)*a),s=o>=6e4?6e4:o>=1e3?1e3:1;i=s===6e4?` min`:s===1e3?` s`:` ms`;let c=s===6e4?1:s===1e3?+(o<1e4):2,l=new Intl.NumberFormat(void 0,{maximumFractionDigits:c});r=e=>l.format(e*a/s)}return t===null&&e!==null?`≥${r(e)}${i}`:(e===null||e===0)&&t!==null?`<${r(t)}${i}`:`${e===null?`−∞`:r(e)}–${t===null?`∞`:r(t)}${i}`}function _I(e){let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0?t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}):t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}function vI(e,t=new Date,n){let r=new Date(e);if(!Number.isFinite(r.getTime()))return`—`;let i=new Intl.DateTimeFormat(n,{month:`short`,day:`numeric`,...r.getFullYear()===t.getFullYear()?{}:{year:`numeric`},hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(r),a=i.filter(e=>[`month`,`day`,`year`].includes(e.type)).map(e=>e.value),o=i.filter(e=>[`hour`,`minute`,`second`].includes(e.type)).map(e=>e.value);return`${a.join(` `)} ${o.join(`:`)}`}var yI=[{path:`/explore`,label:`Explore`,Icon:$M},{path:`/logs`,label:`Logs`,Icon:lN},{path:`/traces`,label:`Traces`,Icon:hN},{path:`/alerts`,label:`Alerts`,Icon:GM},{path:`/settings`,label:`Settings`,Icon:aN}];async function bI(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await qN(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function xI({collapsed:e=!1,agentAvailable:t,activeThreadID:n,activeDashboardID:r,activePath:i,autoFocusSearch:a=!1,onNewChat:o,onSelectThread:s,onDeletedThread:c,onSelectDashboard:l,onCreateDashboard:u,onNewDashboard:f,onNavigate:p,onInvestigateService:m,ref:h}){let g=Ok(),[_,v]=(0,d.useState)(``),[y]=Qi(_.trim(),250),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(``),[E,D]=(0,d.useState)(``),[O,k]=(0,d.useState)(!1),A=(0,d.useRef)(null);(0,d.useImperativeHandle)(h,()=>({focusSearch:()=>A.current?.focus()}),[]),(0,d.useEffect)(()=>{a&&requestAnimationFrame(()=>A.current?.focus())},[a]);let j=ZA({queryKey:[..._P,y],queryFn:({pageParam:e})=>bI(y,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:t}),M=YA({queryKey:rF,queryFn:uF,refetchInterval:3e4,staleTime:oF}),N=(0,d.useMemo)(()=>j.data?.pages.flatMap(e=>e.items)??[],[j.data]),P=(0,d.useMemo)(()=>DI(N),[N]),F=YA({...GF,enabled:t&&!!y&&!!m,staleTime:6e4}),ee=(0,d.useMemo)(()=>{if(!y)return[];let e=y.toLowerCase();return(F.data??[]).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[F.data,y]),I=(0,d.useMemo)(()=>{let e=M.data??[],t=y.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[M.data,y]);function te(e){D(``),T(e.title),x(e)}async function ne(){if(b&&w.trim()){k(!0),D(``);try{let e=await qN(`/api/agent/threads/${encodeURIComponent(b.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:w.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await g.invalidateQueries({queryKey:_P}),x(null)}catch(e){D(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{k(!1)}}}async function re(){if(S){k(!0),D(``);try{let e=await qN(`/api/agent/threads/${encodeURIComponent(S.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=S.id;C(null),await g.invalidateQueries({queryKey:_P}),await g.invalidateQueries({queryKey:rF}),c(t)}catch(e){D(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{k(!1)}}}return e?(0,R.jsxs)(U0,{gap:4,component:`nav`,"aria-label":`Navigation`,children:[t&&(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:46,"aria-label":`New chat`,title:`New chat`,onClick:o,children:(0,R.jsx)(xN,{size:18})}),t&&(0,R.jsxs)(X1,{position:`right-start`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:46,"aria-label":`Chats`,title:`Chats`,className:`rail-row`,"data-active":!!n||void 0,children:(0,R.jsx)(YM,{size:18})})}),(0,R.jsxs)(X1.Dropdown,{maw:280,children:[(0,R.jsx)(X1.Label,{children:`Recent chats`}),j.isPending?(0,R.jsx)(X1.Item,{disabled:!0,children:`Loading chats…`}):j.isError?(0,R.jsx)(X1.Item,{onClick:()=>void j.refetch(),children:`Chats could not be loaded. Retry`}):N.length===0&&(0,R.jsx)(X1.Item,{disabled:!0,children:`No chats yet`}),N.slice(0,10).map(e=>(0,R.jsx)(X1.Item,{"aria-current":e.id===n?`page`:void 0,fw:e.id===n?600:void 0,onClick:()=>s(e.id),children:(0,R.jsx)(U,{size:`sm`,truncate:!0,children:e.title||`Untitled chat`})},e.id))]})]}),yI.map(({path:e,label:t,Icon:n})=>(0,R.jsx)(em,{component:`a`,href:e,title:t,"aria-label":t,"aria-current":i===e||i?.startsWith(`${e}/`)?`page`:void 0,className:`rail-row`,"data-active":i===e||i?.startsWith(`${e}/`)||void 0,variant:`subtle`,color:`gray`,size:46,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),p(e))},children:(0,R.jsx)(n,{size:18})},e)),(0,R.jsxs)(X1,{position:`right-start`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:46,"aria-label":`Dashboards`,title:`Dashboards`,className:`rail-row`,"data-active":!!r||void 0,children:(0,R.jsx)(jN,{size:18})})}),(0,R.jsxs)(X1.Dropdown,{maw:280,children:[(0,R.jsx)(X1.Label,{children:`Dashboards`}),M.isPending&&(0,R.jsx)(X1.Item,{disabled:!0,children:`Loading dashboards…`}),M.isError&&(0,R.jsx)(X1.Item,{onClick:()=>void M.refetch(),children:`Dashboards could not be loaded. Retry`}),(M.data??[]).map(e=>(0,R.jsx)(X1.Item,{"aria-current":e.id===r?`page`:void 0,fw:e.id===r?600:void 0,onClick:()=>l(e.id),children:(0,R.jsx)(U,{size:`sm`,truncate:!0,children:e.name})},e.id)),M.data?.length?(0,R.jsx)(X1.Divider,{}):null,(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(xN,{size:14}),onClick:f,children:`New dashboard`})]})]})]}):(0,R.jsxs)(U0,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[t&&(0,R.jsx)(N_,{leftSection:(0,R.jsx)(xN,{size:16,weight:`bold`}),onClick:o,children:`New chat`}),(0,R.jsx)(Bf,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(U0,{gap:`lg`,pb:`sm`,children:[t&&(0,R.jsxs)(U0,{gap:4,children:[(0,R.jsx)(SI,{children:`Chats`}),j.isLoading&&(0,R.jsx)(Fj,{state:`loading`,rows:3}),j.isError&&(0,R.jsx)(Fj,{state:`error`,error:{message:`Chats could not be loaded.`,onRetry:()=>void j.refetch()}}),!j.isLoading&&!j.isError&&N.length===0&&(0,R.jsx)(U,{size:`xs`,c:`dimmed`,px:`sm`,children:y?`No matching chats. Try another name.`:`No chats yet. Start one above.`}),P.map(e=>(0,R.jsxs)(U0,{gap:2,children:[P.length>1&&(0,R.jsx)(U,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(CI,{thread:e,active:(i?i.startsWith(`/chat/`):!r)&&e.id===n,onSelect:()=>s(e.id),onRename:()=>te(e),onDelete:()=>{D(``),C(e)}},e.id))]},e.label)),j.hasNextPage&&(0,R.jsx)(N_,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:j.isFetchingNextPage,onClick:()=>void j.fetchNextPage(),children:`See all`})]}),t&&y&&m&&F.isLoading&&(0,R.jsx)(Fj,{state:`loading`,rows:3}),t&&y&&m&&(F.isSuccess||F.isError)&&(0,R.jsxs)(U0,{gap:4,children:[(0,R.jsx)(SI,{children:`Services`}),F.isError&&(0,R.jsx)(U,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),F.isSuccess&&ee.length===0&&(0,R.jsx)(Fj,{state:`empty`,variant:`inline`,empty:{title:`No matching services`,description:`Try a different service name.`,action:(0,R.jsx)(N_,{variant:`subtle`,size:`compact-xs`,onClick:()=>v(``),children:`Clear search`})}}),ee.map(e=>(0,R.jsx)(Wf,{className:`rail-row`,p:`sm`,onClick:()=>m(e),children:(0,R.jsx)(U,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,R.jsx)(U0,{gap:0,children:yI.map(({path:e,label:t,Icon:n})=>{let r=i===e;return(0,R.jsx)(Wf,{component:`a`,href:e,className:`rail-row`,"data-active":r||void 0,"aria-current":r?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),p(e))},children:(0,R.jsxs)(um,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(n,{size:16}),(0,R.jsx)(U,{size:`sm`,fw:r?600:500,children:t})]})},e)})}),(0,R.jsxs)(U0,{gap:4,children:[(0,R.jsx)(SI,{children:`Dashboards`}),M.isLoading&&(0,R.jsx)(Fj,{state:`loading`,rows:3}),M.isError&&(0,R.jsx)(Mj,{tone:`danger`,children:`Dashboards could not be loaded.`}),!M.isLoading&&!M.isError&&y&&I.length===0&&(0,R.jsx)(Fj,{state:`empty`,variant:`inline`,empty:{title:`No matching dashboards`,description:`Try a different dashboard name.`,action:(0,R.jsx)(N_,{variant:`subtle`,size:`compact-xs`,onClick:()=>v(``),children:`Clear search`})}}),I.map(e=>{let n=(!i||i.startsWith(`/dashboards`))&&e.id===r;return(0,R.jsxs)(U0,{gap:0,children:[(0,R.jsx)(Wf,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":n||void 0,"aria-current":n?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),l(e.id))},children:(0,R.jsxs)(um,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsxs)(um,{gap:`xs`,wrap:`nowrap`,style:{minWidth:0,flex:1},children:[(0,R.jsx)(jN,{size:16,style:{flexShrink:0}}),(0,R.jsx)(U,{size:`sm`,fw:n?600:500,truncate:!0,title:e.name,children:e.name})]}),e.is_default&&(0,R.jsx)(F0,{label:`Default`,children:(0,R.jsx)(q0,{size:16,variant:`light`,color:`gray`,role:`img`,"aria-label":`Default`,style:{flexShrink:0},children:(0,R.jsx)(NN,{size:12,weight:`fill`,"aria-hidden":`true`})})})]})}),t&&e.origin&&(0,R.jsx)(Wf,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.origin.thread_id))},children:(0,R.jsxs)(U,{size:`xs`,c:`dimmed`,lineClamp:2,title:`Built from: ${e.origin.request_excerpt}`,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),(0,R.jsx)(N_,{variant:`subtle`,color:`gray`,size:`sm`,px:`sm`,justify:`flex-start`,leftSection:(0,R.jsx)(xN,{size:14}),onClick:f,children:`New dashboard`}),t&&(0,R.jsx)(N_,{variant:`subtle`,color:`gray`,size:`sm`,px:`sm`,justify:`flex-start`,leftSection:(0,R.jsx)(kN,{size:14,weight:`fill`}),onClick:u,children:`Create with AI`})]})]})}),(0,R.jsx)(W0,{ref:A,value:_,onChange:e=>v(e.currentTarget.value),leftSection:(0,R.jsx)(dN,{size:15}),rightSection:(0,R.jsx)(d1,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,R.jsx)(f0,{opened:b!==null,onClose:()=>!O&&x(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(U0,{children:[(0,R.jsx)(W0,{label:`Name`,value:w,onChange:e=>T(e.currentTarget.value),maxLength:120,autoFocus:!0}),E&&(0,R.jsx)(Mj,{tone:`danger`,children:E}),(0,R.jsxs)(um,{justify:`flex-end`,children:[(0,R.jsx)(N_,{variant:`default`,onClick:()=>x(null),disabled:O,children:`Cancel`}),(0,R.jsx)(N_,{type:`submit`,loading:O,disabled:!w.trim(),children:`Save`})]})]})})}),(0,R.jsxs)(Nj,{opened:S!==null,onClose:()=>C(null),title:`Delete chat?`,confirmLabel:`Delete chat`,tone:`danger`,pending:O?`confirm`:null,error:E||void 0,onConfirm:()=>void re(),children:[`This permanently removes `,(0,R.jsx)(U,{span:!0,ff:`monospace`,children:S?.title}),` and its saved messages.`]})]})}function SI({children:e}){return(0,R.jsx)(U,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function CI({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(H,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(um,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(Wf,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(U0,{gap:0,pl:24,style:{position:`relative`},children:[(0,R.jsx)(YM,{size:16,style:{position:`absolute`,left:0,top:2}}),(0,R.jsx)(U,{size:`sm`,fw:t?600:500,truncate:!0,title:e.title,children:e.title}),(0,R.jsx)(U,{c:`dimmed`,size:`xs`,ff:`monospace`,children:OI(e.updated_at)})]})}),(0,R.jsxs)(X1,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(rN,{size:18,weight:`bold`})})}),(0,R.jsxs)(X1.Dropdown,{children:[(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(_N,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(X1.Item,{color:`bad`,leftSection:(0,R.jsx)(LN,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function wI(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function TI(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var EI=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function DI(e){let t=TI(new Date),n=new Map;for(let r of e){let e=Math.floor((t-TI(wI(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return EI.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function OI(e){return vI(wI(e).valueOf())}var kI=`modulepreload`,AI=function(e){return`/`+e},jI={},MI={},NI=function(e){return e.pathname.endsWith(`.css`)},PI=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},FI=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)},a,o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{e=AI(e,n);let t=i(e),r=NI(t);return PI(jI,t.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}let e=r?a.styles:a.all,n=r?MI[t.href]:void 0;if(!n&&e.has(t.href))return;let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:kI,r||(i.as=`script`),i.crossOrigin=``,i.href=t.href,s&&i.setAttribute(`nonce`,s),n&&delete MI[t.href],n?.isConnected?n.replaceWith(i):document.head.appendChild(i),r)return new Promise((e,n)=>{let r=a=>{i.removeEventListener(`load`,r),i.removeEventListener(`error`,r),a.type===`error`?(MI[t.href]=i,n(Error(`Unable to preload CSS for ${t}`))):e(a)};i.addEventListener(`load`,r),i.addEventListener(`error`,r)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},II=(0,d.lazy)(()=>FI(()=>import(`./new-dashboard-CCTJTeSK.js`).then(e=>({default:e.NewDashboard})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));function LI({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=BP(),s=xr(),c=ui({select:e=>e.location.pathname}),{dashboardId:l}=yr({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[f,p]=Na(!1),[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(``),[b,x]=(0,d.useState)(!1),S=(0,d.useRef)(null),C=(0,d.useRef)(null),w=EF(),T=Xi(`(max-width: 62em)`),E=Xi(`(max-width: 48em)`),D=(0,d.useRef)(T),O=()=>{T?(_(!0),p.open()):(h(!1),requestAnimationFrame(()=>S.current?.focusSearch()))};D.current=T,(0,d.useEffect)(()=>{p.close()},[c]),(0,d.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),D.current?(_(!0),p.open()):(h(!1),requestAnimationFrame(()=>S.current?.focusSearch())))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let k={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,activePath:c,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(VP),onNewDashboard:()=>{w.remember(D.current?C.current:document.activeElement),p.close(),x(!0)},onNavigate:e=>void s({to:e}),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)},A=()=>{x(!1),w.restore()};return(0,R.jsxs)(o_,{header:{height:56},navbar:{width:m?56:248,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,R.jsx)(o_.Header,{children:(0,R.jsxs)(um,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(um,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(w_,{ref:C,hiddenFrom:`md`,opened:f,"aria-expanded":f,onClick:()=>{_(!1),p.toggle()},size:`sm`,"aria-label":f?`Close navigation`:`Open navigation`}),(0,R.jsx)(em,{visibleFrom:`md`,variant:`subtle`,color:`gray`,"aria-label":m?`Expand navigation`:`Collapse navigation`,"aria-expanded":!m,onClick:()=>h(e=>!e),children:(0,R.jsx)(TN,{size:18})}),(0,R.jsx)(iP,{size:`small`})]}),E?(0,R.jsx)(em,{variant:`default`,size:`lg`,"aria-label":`Search`,onClick:O,children:(0,R.jsx)(dN,{size:16})}):(0,R.jsx)(N_,{variant:`default`,color:`gray`,leftSection:(0,R.jsx)(dN,{size:16}),onClick:O,children:`Search · ⌘K`}),(0,R.jsx)(H,{id:`shell-time-range`,visibleFrom:`sm`}),(0,R.jsxs)(um,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(NF,{}),(0,R.jsx)(TF,{}),(0,R.jsx)(RI,{onError:y})]})]})}),(0,R.jsx)(o_.Navbar,{p:m?4:`sm`,children:(0,R.jsx)(xI,{ref:S,...k,collapsed:m})}),(0,R.jsx)(c1,{opened:f,onClose:p.close,returnFocus:!b,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(iP,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(xI,{...k,autoFocusSearch:f&&g})}),(0,R.jsxs)(o_.Main,{id:`main`,tabIndex:-1,children:[v&&(0,R.jsx)(Mj,{tone:`danger`,onDismiss:()=>y(``),children:v}),e]}),b&&(0,R.jsx)(d.Suspense,{fallback:null,children:(0,R.jsx)(II,{onClose:A,onCreated:e=>{x(!1),s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}})}})})]})}function RI({onError:e}){let t=xr(),n=dP(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(X1,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`${r} account menu`,children:(0,R.jsx)(v_,{size:26,radius:`xl`,color:`gray`,children:r})})}),(0,R.jsxs)(X1.Dropdown,{children:[(0,R.jsx)(X1.Label,{children:n.email||`Signed in`}),(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(yN,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,R.jsx)(X1.Divider,{}),(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(DN,{size:15}),onClick:()=>void JN().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function zI(){let{agent_available:e}=lP(),t=xr(),n=Ok(),{threadId:r}=yr({strict:!1}),[i,a]=(0,d.useState)(nF),o=(0,d.useRef)(new Set),s=r??i,[c,l]=(0,d.useState)([]),[u,f]=(0,d.useState)({}),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(!1),[_,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(!1),C=(0,d.useRef)(!1),[w,T]=(0,d.useState)(``),[E,D]=(0,d.useState)(``),[O,k]=(0,d.useState)(0),A=(0,d.useRef)(null),j=(0,d.useRef)({}),M=(0,d.useRef)(null),N=(0,d.useRef)(new Map),P=(0,d.useMemo)(()=>new wk({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>qN(e,t)}),[s]),F=!e||p===s;function ee(){N.current.clear(),b(``)}function I(e){return C.current||e instanceof Error&&e.name===`AbortError`}function te(e){e===void 0?(D(``),S(!0)):D(e),v(!1),ee()}(0,d.useEffect)(()=>{let t=!0;if(l([]),j.current={},f({}),m(``),g(!1),v(!1),C.current=!1,S(!1),ee(),D(``),!e){m(s);return}!r||o.current.has(s)?(P.setMessages([]),m(s)):qN(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{t&&(e===null?(g(!0),m(s)):(P.setMessages(e.messages??[]),l(e.messages??[]),m(s)))}).catch(()=>{t&&(A.current=null,D(`This chat could not be restored. Start a new chat or try again.`))});let i=P.subscribe({onMessagesChanged:({messages:e})=>l([...e]),onRunInitialized:()=>{C.current=!1,S(!1),v(!0),D(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&b(``)},onToolCallStartEvent:({event:e})=>{N.current.set(e.toolCallId,UP(e.toolCallName)),b(UP(e.toolCallName))},onToolCallResultEvent:({event:e,messages:t})=>{N.current.delete(e.toolCallId),b([...N.current.values()].at(-1)??`Analyzing your system`);let r=EP(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:rF}),n.invalidateQueries({queryKey:iF(r.id)}),n.invalidateQueries({queryKey:aF(r.id)}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||C.current?te():(console.warn(`Agent run error`,e.code),te(GP(e.code)))},onRunFinalized:({messages:e})=>{let t=[...e];l(t),f(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),v(!1),ee(),o.current.delete(s),n.invalidateQueries({queryKey:_P})},onRunFailed:e=>{I(e.error)?te():(console.error(`Agent run failed`,e),te(GP())),o.current.delete(s),n.invalidateQueries({queryKey:_P})}});return()=>{t=!1,i.unsubscribe(),P.abortRun()}},[P,e,n,O,s]),(0,d.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>M.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>M.current?.focus()))),e.key===`Escape`&&n===M.current&&(T(``),M.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ne(){v(!0),D(``);try{let{context:e=[],...t}=j.current;await P.runAgent({context:e,forwardedProps:t})}catch(e){I(e)?te():(console.error(`Agent run failed`,e),te(GP())),o.current.delete(s)}}async function re(n,i){let a=n.trim();if(!e||!a||_||!F||h)return;j.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:nF(),role:`user`,content:a};P.addMessage(c),l([...P.messages]),f(e=>({...e,[c.id]:Date.now()})),T(``),await ne()}(0,d.useEffect)(()=>{let e=A.current;F&&r&&e&&(A.current=null,re(e.text,e.options))},[F,r,s]);function ie(e){e.preventDefault(),re(w)}function ae(){C.current=!0,te(),P.abortRun(),o.current.delete(s)}function oe(){!_&&P.messages.some(e=>e.role===`user`)&&ne()}function se(n,r){if(!e)return;let i=nF();o.current.add(i),A.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function ce(){P.abortRun(),A.current=null,j.current={},a(nF()),t({to:`/chat`})}function le(e){A.current=null,j.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function ue(){k(e=>e+1)}return(0,R.jsx)(zP.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:h,messages:c,messageTimes:u,ready:F,running:_,activity:y,stopped:x,input:w,setInput:T,error:E,inputRef:M,send:re,submit:ie,stop:ae,retry:oe,reloadThread:ue,openChat:se,newThread:ce,selectThread:le},children:(0,R.jsx)(LI,{children:(0,R.jsx)(ei,{})})})}function BI(){let e=(0,d.useMemo)(()=>new VA,[]);return(0,R.jsx)(kk,{client:e,children:(0,R.jsx)(gP,{children:(0,R.jsx)(zI,{})})})}var VI=Hr({component:BI,notFoundComponent:()=>(0,R.jsx)(Sr,{to:`/`,replace:!0})}),HI=Ur(`/`)({component:Wr(()=>FI(()=>import(`./routes-DtOHorVT.js`),[]),`component`)}),UI=Ur(`/alerts`)({component:Wr(()=>FI(()=>import(`./alerts-vRASXpaP.js`),__vite__mapDeps([12,1,8,3,6,13,10,14,11])),`component`)});function WI(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function GI(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return WI(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function KI(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function qI(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var JI=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],YI=[`off`,`10s`,`30s`,`1m`,`5m`],XI=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},ZI=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function QI(e){let t={};typeof e.range==`string`&&JI.includes(e.range)?t.range=e.range:XI(e.from)&&XI(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=ZI(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=WI(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function $I(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function eL(e,t){let n=new URL(e);return n.search=KI($I({...QI(qI(n.search)),drill:JSON.stringify(t)})),n.href}function tL(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var nL=[`stat`,`gauge`,`timeseries`,`bar`,`table`,`heatmap`,`histogram`,`scatter`,`state_timeline`,`logs`,`log_patterns`,`traces`,`service_map`,`health`],rL=9999999,iL=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function aL(e){let t={q:``,range:`1h`,tab:`query`};if(e.v!==void 0&&String(e.v)!==`1`)return t;typeof e.q==`string`&&(t.q=e.q),typeof e.viz==`string`&&nL.includes(e.viz)&&(t.viz=e.viz),typeof e.range==`string`&&JI.includes(e.range)&&(t.range=e.range),XI(e.from)&&XI(e.to)&&Date.parse(e.from)0&&(t.picks=n);let r=WI(e.drill);return r&&(t.drill=JSON.stringify(r)),typeof e.sort==`string`&&/^\+?[a-z_]{1,40}$/.test(e.sort)&&(t.sort=e.sort),t}function oL(e){let t={v:`1`};e.q&&(t.q=e.q),e.viz&&(t.viz=e.viz),e.from&&e.to?(t.from=e.from,t.to=e.to):e.range!==`1h`&&(t.range=e.range),e.tab!==`query`&&(t.tab=e.tab),e.sql&&(t.sql=e.sql),e.sort&&(t.sort=e.sort),e.drill&&(t.drill=JSON.parse(e.drill));for(let[n,r]of Object.entries(e.picks??{}))r&&(t[n]=r);return t}function sL(e){return e.from&&e.to?{from:e.from,to:e.to,refresh:`off`}:{range:e.range,refresh:`off`}}var cL=Ur(`/explore`)({component:Wr(()=>FI(()=>import(`./explore-Cjwi4NOK.js`),__vite__mapDeps([15,2,1,3,4,5,6,7,8,9,10])),`component`),validateSearch:e=>oL(aL(e))}),lL=Ur(`/logs`)({component:Wr(()=>FI(()=>import(`./logs-DfcxDmmQ.js`),__vite__mapDeps([16,17,1,3,10,4,5,6,7,8,9])),`component`),validateSearch:e=>oL(aL(e))}),uL=Ur(`/settings`)({component:Wr(()=>FI(()=>import(`./settings-781S98c4.js`),__vite__mapDeps([18,19,1,8,13,5])),`component`)}),dL=Ur(`/traces`)({component:Wr(()=>FI(()=>import(`./traces-KeYZTd_e.js`),__vite__mapDeps([20,17,1,3,10,4,5,6,7,8,9])),`component`),validateSearch:e=>oL(aL(e))}),fL=Ur(`/chat/`)({component:Wr(()=>FI(()=>import(`./chat.index-DpUkUj48.js`),__vite__mapDeps([21,22,1,6,14,7,23])),`component`)}),pL=Ur(`/chat/$threadId`)({component:Wr(()=>FI(()=>import(`./chat._threadId-DpUkUj48.js`),__vite__mapDeps([24,22,1,6,14,7,23])),`component`)}),mL=Ur(`/dashboards/`)({component:Wr(()=>FI(()=>import(`./dashboards.index-8lAZVohG.js`),__vite__mapDeps([25,26,1,8,3,13,4,5,6,7,23])),`component`),validateSearch:e=>$I(QI(e))}),hL=Ur(`/dashboards/$dashboardId`)({component:Wr(()=>FI(()=>import(`./dashboards._dashboardId-BCAT-2yt.js`),__vite__mapDeps([27,26,1,8,3,13,4,5,6,7,23])),`component`),validateSearch:e=>$I(QI(e))}),gL=Ur(`/settings_/ingest`)({component:Wr(()=>FI(()=>import(`./settings_.ingest-BOYYaqhX.js`),__vite__mapDeps([28,19,1,8,13,5])),`component`)}),_L=HI.update({id:`/`,path:`/`,getParentRoute:()=>VI}),vL=UI.update({id:`/alerts`,path:`/alerts`,getParentRoute:()=>VI}),yL=cL.update({id:`/explore`,path:`/explore`,getParentRoute:()=>VI}),bL=lL.update({id:`/logs`,path:`/logs`,getParentRoute:()=>VI}),xL=uL.update({id:`/settings`,path:`/settings`,getParentRoute:()=>VI}),SL=dL.update({id:`/traces`,path:`/traces`,getParentRoute:()=>VI}),CL=fL.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>VI}),wL=pL.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>VI}),TL=mL.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>VI}),EL={IndexRoute:_L,AlertsRoute:vL,ExploreRoute:yL,LogsRoute:bL,SettingsRoute:xL,TracesRoute:SL,ChatThreadIdRoute:wL,DashboardsDashboardIdRoute:hL.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>VI}),SettingsIngestRoute:gL.update({id:`/settings_/ingest`,path:`/settings/ingest`,getParentRoute:()=>VI}),ChatIndexRoute:CL,DashboardsIndexRoute:TL},DL=oi({routeTree:VI._addFileChildren(EL)._addFileTypes(),parseSearch:qI,stringifySearch:KI,defaultPreload:`intent`,scrollRestoration:!0}),OL=hM(),kL=OL.theme,AL=OL.cssVariablesResolver,jL=OL.chart,ML={light:jL.light.series,dark:jL.dark.series};(0,cv.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(d.StrictMode,{children:(0,R.jsx)(ps,{theme:kL,defaultColorScheme:`auto`,cssVariablesResolver:AL,children:(0,R.jsx)(li,{router:DL})})}));export{dF as $,c1 as $n,Fi as $r,Vj as $t,fI as A,k9 as An,As as Ar,nP as At,BF as B,F7 as Bn,Ya as Br,_N as Bt,gI as C,Z9 as Cn,xc as Cr,vP as Ct,oI as D,Y as Dn,sc as Dr,aP as Dt,vI as E,DS as En,fc as Er,sP as Et,qF as F,q as Fn,Io as Fr,QN as Ft,GF as G,ev as Gn,Aa as Gr,Mj as Gt,RF as H,kx as Hn,Ma as Hr,rN as Ht,FF as I,Y9 as In,wo as Ir,qN as It,EF as J,z0 as Jn,Gi as Jr,Hj as Jt,KF as K,W0 as Kn,Ea as Kr,Fj as Kt,VF as L,V9 as Ln,_o as Lr,BN as Lt,QF as M,cS as Mn,B as Mr,ZN as Mt,YF as N,MS as Nn,$o as Nr,XN as Nt,uI as O,J as On,Rs as Or,YN as Ot,XF as P,tS as Pn,Ho as Pr,tP as Pt,rF as Q,d1 as Qn,Pi as Qr,Kj as Qt,UF as R,f9 as Rn,Qa as Rr,LN as Rt,lI as S,N9 as Sn,Cc as Sr,bP as St,_I as T,$9 as Tn,V as Tr,dP as Tt,HF as U,Ox as Un,ja as Ur,tN as Ut,zF as V,Nx as Vn,Ja as Vr,sN as Vt,PF as W,m3 as Wn,Oa as Wr,ZM as Wt,iF as X,f0 as Xn,Li as Xr,Xj as Xt,vF as Y,F0 as Yn,Hi as Yr,Ej as Yt,aF as Z,X1 as Zn,Ii as Zr,Nj as Zt,$I as _,rS as _n,Yf as _r,AP as _t,dL as a,z as ai,YA as an,bg as ar,xF as at,FI as b,z9 as bn,Bf as br,xP as bt,sL as c,Lr as ci,qk as cn,lg as cr,hF as ct,oL as d,pr as di,oA as dn,um as dr,mF as dt,Mi as ei,yj as en,R_ as er,wF as et,eL as f,rr as fi,Nk as fn,am as fr,bF as ft,YI as g,i as gi,O9 as gn,Dp as gr,BP as gt,JI as h,c as hi,r9 as hn,Rp as hr,KP as ht,mL as i,xi as ii,$A as in,s_ as ir,gF as it,ZF as j,q9 as jn,hs as jr,eP as jt,mI as k,U9 as kn,Fs as kr,$N as kt,rL as l,Sr as li,zk as ln,og as lr,sF as lt,QI as m,jn as mi,i9 as mn,Kp as mr,WP as mt,ML as n,wi as ni,aj as nn,N_ as nr,uF as nt,lL as o,_i as oi,LA as on,U as or,CF as ot,tL as p,or as pi,Ok as pn,em as pr,VP as pt,jF as q,U0 as qn,Xi as qr,Wj as qt,hL as r,Ci as ri,nj as rn,x_ as rr,fF as rt,cL as s,di as si,vA as sn,pg as sr,_F as st,jL as t,ki as ti,uj as tn,F_ as tr,pF as tt,aL as u,xr as ui,Zk as un,Hh as ur,SF as ut,GI as v,L9 as vn,Kf as vr,IP as vt,dI as w,c9 as wn,H as wr,lP as wt,hI as x,G9 as xn,Rc as xr,yP as xt,WI as y,F9 as yn,Wf as yr,MP as yt,IF as z,V7 as zn,Xa as zr,xN as zt}; \ No newline at end of file +`)};function XD(e,t){return gv(t)&&ZD(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),hv(t)}var ZD=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},QD=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(z2(r=>{switch(r.type){case W.TEXT_MESSAGE_START:{let e=r;return[{type:JD.TextMessageStart,messageId:e.messageId,role:e.role}]}case W.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:JD.TextMessageContent,messageId:e.messageId,content:e.delta}]}case W.TEXT_MESSAGE_END:{let e=r;return[{type:JD.TextMessageEnd,messageId:e.messageId}]}case W.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:JD.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case W.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return ZD(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(e4(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:JD.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case W.TOOL_CALL_END:{let e=r;return[{type:JD.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case W.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&ZD(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:JD.ActionExecutionResult,actionExecutionId:e.toolCallId,result:XD(e.toolCallId,e.content),actionName:t||`unknown`}]}case W.RAW:return f||(f=!0,ZD(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case W.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:JD.MetaEvent,name:e.name,value:e.value}]}case W.STATE_SNAPSHOT:return p(r.snapshot),[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case W.STATE_DELTA:{let c=r,l;try{l=Qv.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return ZD(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case W.MESSAGES_SNAPSHOT:return c=r.messages,[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case W.RUN_STARTED:return[];case W.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=$D(c)}catch(e){return[{type:JD.RunError,message:e.message}]}return[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case W.RUN_ERROR:{let e=r;return[{type:JD.RunError,message:e.message,code:e.code}]}case W.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case W.STEP_FINISHED:return u=[],l=null,[{type:JD.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function $D(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=YD(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:XD(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var eO=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,tO=e=>e===`tool`?`toolCallId`:`messageId`,nO=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},rO=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},iO=(e,t)=>{let n=rO(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},aO=e=>new Set(Object.keys(e.shape)),oO=aO(BS),sO=aO(WS),cO=aO(DC),lO=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},uO=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},dO=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&uO(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},fO=e=>t=>{let n=ED(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:W.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:W.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:W.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&eO(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${tO(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(z2(e=>{switch(e.type){case W.TEXT_MESSAGE_START:case W.TEXT_MESSAGE_CONTENT:case W.TEXT_MESSAGE_END:case W.TOOL_CALL_START:case W.TOOL_CALL_ARGS:case W.TOOL_CALL_END:case W.TOOL_CALL_RESULT:case W.STATE_SNAPSHOT:case W.STATE_DELTA:case W.CUSTOM:case W.STEP_STARTED:case W.STEP_FINISHED:case W.REASONING_START:case W.REASONING_MESSAGE_START:case W.REASONING_MESSAGE_CONTENT:case W.REASONING_MESSAGE_END:case W.REASONING_END:return[...i(e.subagentRunId??void 0),e];case W.RUN_STARTED:case W.RUN_FINISHED:case W.RUN_ERROR:case W.MESSAGES_SNAPSHOT:return[...a(),e];case W.RAW:case W.ACTIVITY_SNAPSHOT:case W.ACTIVITY_DELTA:case W.REASONING_ENCRYPTED_VALUE:case W.SUBAGENT_STARTED:return[e];case W.SUBAGENT_FINISHED:case W.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case W.TEXT_MESSAGE_CHUNK:{let t=e,a=lO(e,oO),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))nO(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),nO(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=rO({type:W.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=iO({...a,type:W.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:W.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return dO(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case W.TOOL_CALL_CHUNK:{let t=e,a=lO(e,sO),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))nO(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),nO(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=rO({type:W.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=iO({...a,type:W.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:W.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return dO(l,a,u,`TOOL_CALL_CHUNK`),l}case W.REASONING_MESSAGE_CHUNK:{let t=e,a=lO(e,cO),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=rO({type:W.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=iO({...a,type:W.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:W.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return dO(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),Y2(()=>{a()}))},pO=1e6;function mO(e){if(e===void 0)return pO;if(e===1/0||Number.isSafeInteger(e)&&e>0)return e;throw new fv(`Invalid enforcement entry budget ${String(e)}: expected a positive integer, or Infinity to disable it.`)}var hO=class extends fv{constructor(e,t){super(`Enforcement limit exceeded at '${t||`(root)`}': the payload has more than ${e} entries to validate. If it is legitimate, raise or disable the limit (maxEnforcedEntries on the agent, or maxEntries in the enforcement options).`),this.name=`AGUIEnforcementLimitError`,this.limit=e,this.path=t}},gO=Symbol(`agui.strip.drop`);function _O(e,t,n){if(e.used+=t,e.used>e.max)throw new hO(e.max,n)}function vO(e){let t=e;for(;;)if(t instanceof sS||t instanceof dS||t instanceof pS||t instanceof wS||t instanceof yS)t=t.unwrap();else if(t instanceof xS)t=t.def.in;else if(t instanceof ES)t=t.def.getter();else return t}function yO(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function bO(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function xO(e){let t=vO(e);return t instanceof iS?bO(t):void 0}function SO(e,t,n,r,i){let a=vO(t);if(a instanceof K9){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=a.shape,o=e,s={},c=a.meta()?.specOpen===!0,l=Object.keys(o);_O(i,l.length,n);for(let e of l){let a=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(a===void 0){if(c){s[e]=o[e];continue}r.push(`${n}/${e}`);continue}let l=r.length,u=SO(o[e],a,`${n}/${e}`,r,i);if(u===gO){if(r.length=l,a.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return gO}s[e]=u}return s}if(a instanceof W9){if(!Array.isArray(e))return e;_O(i,e.length,n);let t=a.element,o=[];return e.forEach((e,a)=>{let s=r.length,c=SO(e,t,`${n}/${a}`,r,i);c===gO?(r.length=s,r.push(`${n}/${a}`)):o.push(c)}),o}if(a instanceof eS){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=a.def.valueType,o=e,s={},c=Object.keys(o);_O(i,c.length,n);for(let e of c){let a=r.length,c=SO(o[e],t,`${n}/${e}`,r,i);c===gO?(r.length=a,r.push(`${n}/${e}`)):s[e]=c}return s}if(a instanceof J9){let t=a.options,o=yO(a);if(o!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let a=Object.prototype.hasOwnProperty.call(e,o)?e[o]:void 0;if(typeof a!=`string`)return{...e,[o]:a};for(let s of t){let t=vO(s);if(t instanceof K9&&xO(t.shape[o])===a)return SO(e,s,n,r,i)}return gO}let s=t.filter(e=>vO(e)instanceof K9),c=typeof e==`object`&&!!e&&!Array.isArray(e);if(s.length>1&&c)return e;for(let a of t){let t=vO(a);if(t instanceof W9&&Array.isArray(e)||t instanceof K9&&c)return SO(e,a,n,r,i)}return e}return e}function CO(e,t,n){let r=[],i=SO(e,t,``,r,{used:0,max:mO(n?.maxEntries)});if(i===gO)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:i,stripped:r}}var wO=new Set(Object.values(W));function TO(e){return wO.has(e.type)}var EO=new Map(NC.options.map(e=>{let t=e.shape;return[String(bO(t.type)),e]})),DO=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function OO(e){DO()||console.warn(`[ag-ui][enforce] ${e}`)}var kO=(e,t)=>{let n=mO(t?.maxEntries);return t=>{let r=ED(e);return t.pipe(z2(e=>{if(!TO(e)){OO(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`);let t={type:e.type};return r?.event(`ENFORCE`,`Unrecognised event dropped:`,t,t),e2}let t=EO.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:i,stripped:a}=CO(e,t,{maxEntries:n});for(let t of a)OO(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return N2(t.parse(i))}))}};function AO(e,t){let n=mO(t?.maxEntries),{value:r,stripped:i}=CO(dv(e,`RunAgentInput`),pC,{maxEntries:n});for(let e of i)OO(`Removed unrecognised material at '${e}' from the outgoing input.`);return pC.parse(r)}var jO=class{runNext(e,t){return t.run(e).pipe(fO(!1))}runNextWithState(e,t){let n=mD(e.messages||[]),r=mD(e.state===void 0?{}:e.state),i=new $y;return LD(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(G2(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:mD(n),state:mD(r)})))}},MO=class extends jO{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function NO(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function PO(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function FO(e){let t=NO(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:(typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function IO(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function LO(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(PO(e)){let n=FO(e);return n.type!==`binary`&&t.some(t=>IO(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var RO=`THINKING_START`,zO=`THINKING_END`,BO=`THINKING_TEXT_MESSAGE_START`,VO=`THINKING_TEXT_MESSAGE_CONTENT`,HO=`THINKING_TEXT_MESSAGE_END`;function UO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var WO={event:[`rawEvent`,`subagentRunId`],[W.RUN_STARTED]:[`parentRunId`,`input`],[W.RUN_FINISHED]:[`result`,`outcome`],[W.RUN_ERROR]:[`usage`],[W.SUBAGENT_FINISHED]:[`result`],[W.TOOL_CALL_START]:[`parentMessageId`],[W.TOOL_CALL_CHUNK]:[`parentMessageId`],[W.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},GO=new Map(Object.entries(WO).filter(([e])=>Object.values(W).includes(e))),KO=e=>RD(e,`an absent field`);function qO(e,t,n,r){if(!UO(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function JO(e,t,n){if(!UO(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function YO(e,t){return JO(e,`content`,e=>{if(!UO(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return qO(e,WO[`input content`],`${e.type} input content`,t);default:return e}})}function XO(e,t=KO){let n=qO(e,WO.RunAgentInput,`RunAgentInput`,t);return n=JO(n,`tools`,e=>qO(e,WO.Tool,`Tool`,t)),n=JO(n,`resume`,e=>qO(e,WO.ResumeEntry,`ResumeEntry`,t)),JO(n,`messages`,e=>YO(e,t))}var ZO=class extends jO{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),RD(e,`an absent field`))}}warn(e,t){RD(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=hD();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(LO),t.run(e).pipe(L2(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===W.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=qO(e,WO.event,void 0,t);let n=GO.get(e.type);switch(n&&(e=qO(e,n,e.type,t)),e.type){case RO:{this.currentReasoningId=hD();let{title:t,...n}=e;return this.warn(RO,W.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${RO}.title ${JSON.stringify(t)}: ${W.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:W.REASONING_START,messageId:this.currentReasoningId}}case BO:return this.currentMessageId=hD(),this.warn(BO,W.REASONING_MESSAGE_START),{...e,type:W.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case VO:{let{delta:t,...n}=e;return this.warn(VO,W.REASONING_MESSAGE_CONTENT),{...n,type:W.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(VO,this.currentMessageId),delta:t}}case HO:{let t=this.mintedContinuationId(HO,this.currentMessageId);return this.currentMessageId=null,this.warn(HO,W.REASONING_MESSAGE_END),{...e,type:W.REASONING_MESSAGE_END,messageId:t}}case zO:{let t=this.mintedContinuationId(zO,this.currentReasoningId);return this.currentReasoningId=null,this.warn(zO,W.REASONING_END),{...e,type:W.REASONING_END,messageId:t}}case W.RUN_FINISHED:{let n=e,r=qO(n.outcome,WO[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return JO(r===n.outcome?n:{...n,outcome:r},`usage`,e=>qO(e,WO[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case W.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case W.RUN_STARTED:{let n=XO(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=YO(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),LO(e))}},QO=()=>e=>H2(()=>{let t=new ZO;return e.pipe(L2(e=>t.transformEvent(e)))});function $O(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function ek(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function tk(e){ek()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function nk(e){ek()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function rk(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return nk(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&tk(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var ik=class extends jO{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(rk)};return this.runNext(i,t)}},ak=`THINKING_START`,ok=`THINKING_END`,sk=`THINKING_TEXT_MESSAGE_START`,ck=`THINKING_TEXT_MESSAGE_CONTENT`,lk=`THINKING_TEXT_MESSAGE_END`,uk=class extends jO{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(L2(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case ak:{this.currentReasoningId=hD();let{title:t,...n}=e;return this.warnAboutTransformation(ak,W.REASONING_START),{...n,type:W.REASONING_START,messageId:this.currentReasoningId}}case sk:return this.currentMessageId=hD(),this.warnAboutTransformation(sk,W.REASONING_MESSAGE_START),{...e,type:W.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case ck:{let{delta:t,...n}=e;return this.warnAboutTransformation(ck,W.REASONING_MESSAGE_CONTENT),{...n,type:W.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??hD(),delta:t}}case lk:{let t=this.currentMessageId??hD();return this.warnAboutTransformation(lk,W.REASONING_MESSAGE_END),{...e,type:W.REASONING_MESSAGE_END,messageId:t}}case ok:{let t=this.currentReasoningId??hD();return this.warnAboutTransformation(ok,W.REASONING_END),{...e,type:W.REASONING_END,messageId:t}}default:return e}}},dk=`SUBAGENT_STARTED`,fk=`SUBAGENT_FINISHED`,pk=`SUBAGENT_ERROR`;function mk(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function hk(e){return e.map(e=>mk(e))}var gk=class extends jO{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>mk(e))};return this.runNext(n,t).pipe(Q2(e=>{let t=e.type;(t===dk||t===fk||t===pk)&&this.warnDroppedLifecycleEvent(t)}),U2(e=>{let t=e.type;return t!==dk&&t!==fk&&t!==pk}),L2(e=>{let t=mk(e);if(t.type===W.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:hk(e.messages)}}if(t.type===W.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>mk(e))}}}if(t.type===W.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:hk(e.input.messages)}}}return t}))}},_k=`1.0.5`,vk=!1,yk=new WeakSet,bk=(e,t)=>/^\d+\.\d+$/.test(e)?uD(e,t)>0?`newer`:`not-newer`:`uninterpretable`,xk=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(bk(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},Sk=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return _k;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return _k;let a=t===`maxProtocolVersion`?n:r;if(!a)return _k;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!vk&&(vk=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=TD(e),this._debugLogger=OD(this._debug)}get threadId(){return this._threadId??=sv()}set threadId(e){this._threadId=e}get maxEnforcedEntries(){return this._maxEnforcedEntries}set maxEnforcedEntries(e){this._maxEnforcedEntries=mO(e)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?OD(TD(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!dD(e))throw new fv(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a,maxEnforcedEntries:o}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this._threadId=n,this.messages=mD(r??[]),this.state=mD(i??{}),this._debug=TD(a),this._debugLogger=OD(this._debug),this._maxEnforcedEntries=mO(o);let s=this.resolvedCeilingDuringConstruction();uD(s,`0.0.39`)<=0&&this.middlewares.unshift(new ik),uD(s,`0.0.45`)<=0&&this.middlewares.unshift(new uk),uD(s,`0.0.57`)<=0&&this.middlewares.unshift(new gk)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new MO(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??sv();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>xk(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];yk.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new Xy;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await I2(zy(()=>[...this.middlewares,new ZO].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),kO(this.debugLogger,{maxEntries:this.maxEnforcedEntries}),fO(this.debugLogger),zD(this.debugLogger),e=>e.pipe(Z2(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),W2(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Y2(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(N2(null)));let s=mD(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new pv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??sv();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>xk(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xy;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await I2(zy(()=>H2(()=>this.connect(n)),e=>kO(this.debugLogger,{maxEntries:this.maxEnforcedEntries})(QO()(e)),fO(this.debugLogger),zD(this.debugLogger),e=>e.pipe(Z2(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),W2(e=>(this.isRunning=!1,e instanceof pv?e2:this.onError(n,e,a))),Y2(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(N2(null)),{defaultValue:void 0});let s=mD(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}applyBeforeSourceError(e,t,n){return H2(()=>{let r,i=t.pipe(W2(e=>(r={error:e},e2)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(q2(H2(()=>{let e=r;return e?P2(()=>e.error):e2})))})}apply(e,t,n,r){return LD(e,t,this,n,this.debugLogger,r)}processApplyEvents(e,t,n){return t.pipe(Q2(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=mD(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=ND(t.filter(e=>e.role!==`activity`));return{threadId:this.threadId,runId:e?.runId||sv(),...uD(this.maxProtocolVersion,_k)>=0&&{protocolVersion:`1.0`},tools:mD(e?.tools??[]),context:mD(e?.context??[]),forwardedProps:mD(e?.forwardedProps??{}),state:mD(this.state),messages:n,...e?.resume===void 0?{}:{resume:mD(e.resume)}}}async onInitialize(e,t){if(yk.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new fv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if($O(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new fv(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await bD(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=ND(n.messages.filter(e=>e.role!==`activity`)),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return M2(bD(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(L2(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await bD(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=mD(this.messages),e.state=mD(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e._maxEnforcedEntries=this._maxEnforcedEntries,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=mD(this.pendingInterrupts),e.resolvingPeerCeiling=!1,e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=mD(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=mD(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??sv();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new ZO].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(kO(this.debugLogger,{maxEntries:this.maxEnforcedEntries}),fO(this.debugLogger),zD(this.debugLogger),QD(this.threadId,t.runId,this.agentId),e=>e.pipe(L2(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function Ck(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var wk=class extends Sk{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(Ck(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=mD(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return qD(VD(()=>this.fetch(this.url,this.requestInit(AO(e,{maxEntries:this.maxEnforcedEntries})))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=mD(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},Tk=d.createContext(!1),Ek=()=>d.useContext(Tk);Tk.Provider;var Dk=d.createContext(void 0),Ok=e=>{let t=d.useContext(Dk);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},kk=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(Dk.Provider,{value:e,children:t}));function Ak(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jk=d.createContext(Ak()),Mk=()=>d.useContext(jk),Nk=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pk=new class extends Nk{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Fk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ik=new class{#e=Fk;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Lk(e){setTimeout(e,0)}var Rk=typeof window>`u`||`Deno`in globalThis;function zk(){}function Bk(e,t){return typeof e==`function`?e(t):e}function Vk(e){return typeof e==`number`&&e>=0&&e!==1/0}function Hk(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Uk(e,t){return typeof e==`function`?e(t):e}function Wk(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Kk(o,t.options))return!1}else if(!Jk(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Gk(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(qk(t.options.mutationKey)!==qk(a))return!1}else if(!Jk(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Kk(e,t){return(t?.queryKeyHashFn||qk)(e)}function qk(e){return JSON.stringify(e,(e,t)=>$k(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Jk(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n500)return t;let r=Qk(e)&&Qk(t);if(!r&&!($k(e)&&$k(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{Ik.setTimeout(t,e)})}function nA(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Xk(e,t)}function rA(e,t,n,r){let i=r?[t,...e]:[...e,t];return n&&i.length>n?r?i.slice(0,n):i.slice(-n):i}var iA=Symbol();function aA(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===iA?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oA(e,t){return typeof e==`function`?e(...t):!!e}var sA=Symbol();function cA(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[sA]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var lA=()=>Rk,uA=()=>lA();function dA(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{cA(e,()=>t.signal,()=>n=!0,l[sA])},d=aA(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options;return{pages:rA(e.pages,o,s,i),pageParams:rA(e.pageParams,r,s,i)}};if(i&&a.length){let e=i===`backward`,t=e?pA:fA,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:fA(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function fA(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pA(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function mA(e,t){return t?fA(e,t)!=null:!1}function hA(e,t){return!t||!e.getPreviousPageParam?!1:pA(e,t)!=null}var gA=Lk;function _A(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=gA,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var vA=_A(),yA=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vk(this.gcTime)&&(this.#e=Ik.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(uA()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Ik.clearTimeout(this.#e),this.#e=void 0)}},bA=new class extends Nk{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xA(e){return Math.min(1e3*2**e,3e4)}function SA(e){return(e??`online`)!==`online`||bA.isOnline()}var CA=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function wA(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(zk);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new CA(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Pk.isFocused()&&(e.networkMode===`always`||bA.isOnline())&&e.canRun(),p=()=>SA(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(uA()?0:3),a=e.retryDelay??xA,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nc()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var TA=class extends yA{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=OA(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=OA(this.options);e.data!==void 0&&(this.setState(DA(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=nA(this.state.data,e,this.options);return this.#u({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#u({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(zk).catch(zk):Promise.resolve()}destroy(){this.cancel({silent:!0}),super.destroy()}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Uk(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===iA||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>Uk(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Hk(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.#l()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#u({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[sA]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=aA(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?dA(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#u({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=wA({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof CA&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#u({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#u({type:`pause`})},onContinue:()=>{this.#u({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof CA){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#u({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.#l()}})();return this.#o=s,o.start(),s}#l(){this.#r.get(this.queryHash)===this&&this.scheduleGc()}#u(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...EA(t.data,this.options),fetchMeta:e.meta??null};case`success`:{let n={...t,...DA(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n}case`error`:{let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:`idle`,status:`error`,isInvalidated:!0}}case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),vA.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function EA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SA(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function DA(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function OA(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var kA=class extends Nk{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),jA(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return MA(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return MA(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Uk(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Zk(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&NA(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Uk(this.options.enabled,this.#t)!==Uk(t.enabled,this.#t)||Uk(this.options.staleTime,this.#t)!==Uk(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Uk(this.options.enabled,this.#t)!==Uk(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Zk(this.getCurrentResult(),n)||(this.#r=n,this.#i=e),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(zk)),t}#h(e){return!uA()&&Uk(this.options.enabled,this.#t)!==!1&&Vk(e)}#g(){this.#b();let e=Uk(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Hk(this.#r.dataUpdatedAt,e)+1;this.#u=Ik.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Uk(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Ik.setInterval(()=>{(this.options.refetchIntervalInBackground||Pk.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Ik.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Ik.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=e===n?this.#n:e.state,{state:s}=e,c={...s},l=!1,u;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&jA(e,t),o=i&&NA(e,n,t,r);(a||o)&&(c={...c,...EA(s.data,e.options)}),t._optimisticResults===`isRestoring`&&(c.fetchStatus=`idle`)}let{error:d,errorUpdatedAt:f,status:p}=c;u=c.data;let m=!1;if(t.placeholderData!==void 0&&u===void 0&&p===`pending`){let e,n=i?.isPlaceholderData&&t.placeholderData===a?.placeholderData;n?(e=i.data,m=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,(n||e!==void 0)&&(p=`success`,u=nA(t.select&&!m?this.#s:i?.data,e,t),l=!0)}if(t.select&&u!==void 0&&!m){if(u===this.#s&&t.select===this.#o)u=this.#c;else try{this.#o=t.select,this.#s=u,u=t.select(u),u=nA(i?.data,u,t),this.#c=u,this.#a=null}catch(e){this.#a=e}}else u===void 0&&(this.#s=void 0,this.#a=null);this.#a&&(d=this.#a,u=this.#c,f=i?.error===d?i.errorUpdatedAt:Date.now(),p=`error`,l=!1);let h=c.fetchStatus===`fetching`,g=p===`pending`,_=p===`error`,v=g&&h,y=u!==void 0;return{status:p,fetchStatus:c.fetchStatus,isPending:g,isSuccess:p===`success`,isError:_,isInitialLoading:v,isLoading:v,data:u,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:_&&!y,isPaused:c.fetchStatus===`paused`,isPlaceholderData:l,isRefetchError:_&&y,isStale:PA(e,t),refetch:this.refetch,isEnabled:Uk(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.options,this.#t.state.data!==void 0&&(this.#l=this.#t),Zk(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();vA.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function AA(e,t){return Uk(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Uk(t.retryOnMount,e)!==!1)}function jA(e,t){return AA(e,t)||e.state.data!==void 0&&MA(e,t,t.refetchOnMount)}function MA(e,t,n){if(Uk(t.enabled,e)!==!1&&Uk(t.staleTime,e)!==`static`){let r=Uk(n,e);return r===`always`||r!==!1&&PA(e,t)}return!1}function NA(e,t,n,r){return(e!==t||Uk(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&PA(e,n)}function PA(e,t){return Uk(t.enabled,e)!==!1&&e.isStaleByTime(Uk(t.staleTime,e))}var FA=class extends kA{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:mA(t,n.data),hasPreviousPage:hA(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},IA=class extends yA{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||LA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.#n.has(this)&&this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=wA({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),vA.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function LA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var RA=class extends Nk{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new IA({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=zA(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){e.destroy();let t=zA(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}has(e){return this.#e.has(e)}canRun(e){let t=zA(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=zA(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){vA.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>e.destroy()),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Gk(t,e))}findAll(e={}){return this.getAll().filter(t=>Gk(e,t))}notify(e){vA.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return vA.batch(()=>Promise.all(e.map(e=>e.continue().catch(zk))))}};function zA(e){return e.options.scope?.id}var BA=class extends Nk{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Kk(r,t),a=this.get(i);return a||(a=new TA({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){vA.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Wk(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Wk(e,t)):t}notify(e){vA.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){vA.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){vA.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},VA=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new BA,this.#t=e.mutationCache||new RA,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Pk.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Uk(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=Bk(t,this.#e.get(r.queryHash)?.state.data);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vA.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;vA.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return vA.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=vA.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(zk).catch(zk)}invalidateQueries(e,t={}){return vA.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=vA.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(zk)),r?Promise.resolve():t}));return Promise.all(r).then(zk)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Uk(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Uk(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(zk).catch(zk)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(zk).catch(zk)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return bA.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(qk(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Jk(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(qk(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Jk(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Kk(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===iA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},HA=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?oA(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},UA=e=>{d.useEffect(()=>{e.clearReset()},[e])},WA=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||oA(n,[e.error,r])),GA=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},KA=(e,t)=>e?.suspense&&t.isPending,qA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JA(e,t,n){let r=Ek(),i=Mk(),a=Ok(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,GA(o),HA(o,i,s),UA(i);let[l]=d.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);d.useEffect(()=>{l.setOptions(o)},[o,l]);let f=!r&&c;if(d.useSyncExternalStore(d.useCallback(e=>{let t=f?l.subscribe(vA.batchCalls(e)):zk;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),KA(o,u))throw qA(o,l,i);if(WA({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function YA(e,t){return JA(e,kA,t)}function XA(e){return e}function ZA(e,t){return JA(e,FA,t)}var QA=(0,d.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),$A=d.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...l}=e,{color:u=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=d.useContext(QA);return d.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??u,viewBox:`0 0 256 256`,transform:o||m?`scale(-1, 1)`:void 0,...h,...l},!!n&&d.createElement(`title`,null,n),s,c.get(a??p))});$A.displayName=`IconBase`;var ej=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),tj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:ej}));tj.displayName=`ArrowCounterClockwiseIcon`;var nj=tj,rj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),ij=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:rj}));ij.displayName=`XIcon`;var aj=ij,oj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),sj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:oj}));sj.displayName=`CheckCircleIcon`;var cj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),lj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:cj}));lj.displayName=`InfoIcon`;var uj=lj,dj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`}))]]),fj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:dj}));fj.displayName=`WarningIcon`;var pj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:pj}));mj.displayName=`XCircleIcon`;var hj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v92H179.31a19.86,19.86,0,0,0-14.14,5.86L147,168H109L90.83,149.86A19.86,19.86,0,0,0,76.69,144H52V52ZM52,204V168H75l18.14,18.14A19.86,19.86,0,0,0,107.31,192h41.38a19.86,19.86,0,0,0,14.14-5.86L181,168h23v36Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48V160H179.31a8,8,0,0,0-5.66,2.34l-19.31,19.32a8,8,0,0,1-5.66,2.34H107.31a8,8,0,0,1-5.66-2.34L82.34,162.34A8,8,0,0,0,76.68,160H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.68A15.89,15.89,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H208a2,2,0,0,1,2,2V154H179.31a13.94,13.94,0,0,0-9.9,4.1L150.1,177.41a2,2,0,0,1-1.41.59H107.31a2,2,0,0,1-1.41-.58L86.59,158.1a13.94,13.94,0,0,0-9.9-4.1H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V166H76.69a2,2,0,0,1,1.41.58L97.41,185.9a13.94,13.94,0,0,0,9.9,4.1h41.38a13.94,13.94,0,0,0,9.9-4.1l19.31-19.31a2,2,0,0,1,1.41-.59H210v42A2,2,0,0,1,208,210Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H208a4,4,0,0,1,4,4V156H179.31a12,12,0,0,0-8.48,3.51l-19.32,19.32a4,4,0,0,1-2.82,1.17H107.31a4,4,0,0,1-2.82-1.17L85.17,159.51A12,12,0,0,0,76.69,156H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V164H76.69a4,4,0,0,1,2.82,1.17l19.32,19.32a12,12,0,0,0,8.48,3.51h41.38a12,12,0,0,0,8.48-3.51l19.32-19.32a4,4,0,0,1,2.82-1.17H212v44A4,4,0,0,1,208,212Z`}))]]),gj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:hj}));gj.displayName=`TrayIcon`;var _j=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),vj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:_j}));vj.displayName=`WarningCircleIcon`;var yj=vj,bj=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Zm48,22.74A84.3,84.3,0,0,1,160.11,180H160a83.52,83.52,0,0,1-23.65-3.38l-7.86,7.87A12,12,0,0,1,120,188H108v12a12,12,0,0,1-12,12H84v12a12,12,0,0,1-12,12H40a20,20,0,0,1-20-20V187.31a19.86,19.86,0,0,1,5.86-14.14l53.52-53.52A84,84,0,1,1,244,98.74ZM202.43,53.57A59.48,59.48,0,0,0,158,36c-32,1-58,27.89-58,59.89a59.69,59.69,0,0,0,4.2,22.19,12,12,0,0,1-2.55,13.21L44,189v23H60V200a12,12,0,0,1,12-12H84V176a12,12,0,0,1,12-12h19l9.65-9.65a12,12,0,0,1,13.22-2.55A59.58,59.58,0,0,0,160,156h.08c32,0,58.87-26.07,59.89-58A59.55,59.55,0,0,0,202.43,53.57Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,98.36C230.73,136.92,198.67,168,160.09,168a71.68,71.68,0,0,1-26.92-5.17h0L120,176H96v24H72v24H40a8,8,0,0,1-8-8V187.31a8,8,0,0,1,2.34-5.65l58.83-58.83h0A71.68,71.68,0,0,1,88,95.91c0-38.58,31.08-70.64,69.64-71.87A72,72,0,0,1,232,98.36Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM180,92a16,16,0,1,1,16-16A16,16,0,0,1,180,92Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M213.74,42.26A76,76,0,0,0,88.51,121.84l-57,57A11.93,11.93,0,0,0,28,187.31V216a12,12,0,0,0,12,12H72a4,4,0,0,0,4-4V204H96a4,4,0,0,0,4-4V180h20a4,4,0,0,0,2.83-1.17l11.33-11.34A75.72,75.72,0,0,0,160,172h.1A76,76,0,0,0,213.74,42.26Zm14.22,56c-1.15,36.22-31.6,65.72-67.87,65.77H160a67.52,67.52,0,0,1-25.21-4.83,4,4,0,0,0-4.45.83l-12,12H96a4,4,0,0,0-4,4v20H72a4,4,0,0,0-4,4v20H40a4,4,0,0,1-4-4V187.31a4.06,4.06,0,0,1,1.17-2.83L96,125.66a4,4,0,0,0,.83-4.45A67.51,67.51,0,0,1,92,95.91C92,59.64,121.55,29.19,157.77,28A68,68,0,0,1,228,98.23ZM188,76a8,8,0,1,1-8-8A8,8,0,0,1,188,76Z`}))]]),xj=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:bj}));xj.displayName=`KeyIcon`;var Sj={sm:`26rem`,md:`32rem`,lg:`48rem`};function Cj({brand:e,brandPlacement:t=`above`,children:n,footer:r,size:i,aside:a,surface:o=`card`}){let s=a!=null,c=o===`plain`&&!s,l=s&&i===`sm`?`md`:i??(s?`lg`:`sm`),u=e!=null&&(0,R.jsx)(um,{justify:`center`,gap:`xs`,children:typeof e==`string`?(0,R.jsx)(U,{fw:700,size:`lg`,children:e}):e});return(0,R.jsx)(F_,{mih:`100dvh`,px:`md`,py:`xl`,children:(0,R.jsxs)(U0,{gap:`lg`,w:`100%`,maw:Sj[l],children:[t===`above`&&u,(0,R.jsx)(Yf,{"data-labstack-auth-surface":c?`plain`:`card`,withBorder:!c,bg:c?`transparent`:void 0,p:s||c?0:{base:`lg`,sm:`xl`},style:{overflow:`hidden`},children:(0,R.jsxs)(fg,{direction:{base:`column`,sm:`row`},gap:s?0:`lg`,children:[s&&(0,R.jsx)(H,{"data-labstack-auth-aside":!0,visibleFrom:`sm`,p:`md`,style:{flex:`1 1 0`,minWidth:`10rem`,overflowWrap:`anywhere`,background:`var(--labstack-inset, var(--mantine-color-default-hover))`},children:a}),(0,R.jsx)(H,{miw:{base:0,sm:s?`20rem`:0},p:s?{base:`lg`,sm:`xl`}:0,style:{flex:`1 1 0`},children:(0,R.jsxs)(U0,{gap:`lg`,children:[t===`inside`&&u,n]})})]})}),r!=null&&(0,R.jsx)(H,{ta:`center`,fz:`xs`,c:`dimmed`,children:r})]})})}var wj={neutral:`gray`,info:`blue`,success:`green`,warning:`yellow`,danger:`red`};function Tj(e,t){return e.other.labstackTones?.[t]??wj[t]}function Ej(e){return Tj($o(),e)}function Dj(e){return`var(--mantine-color-${e.split(`.`)[0]}-text)`}function Oj(e){return`var(--mantine-color-${e.split(`.`)[0]}-light)`}var kj={neutral:null,info:lj,success:sj,warning:fj,danger:mj};function Aj(e){return kj[e]!=null}function jj({tone:e,size:t=`1em`,weight:n=`regular`}){let r=kj[e];return r?(0,R.jsx)(r,{size:t,weight:n,"aria-hidden":`true`}):null}function Mj({tone:e,title:t,children:n,detail:r,onRetry:i,retryLabel:a=`Try again`,onDismiss:o,dismissLabel:s=`Dismiss`,prominent:c=e===`warning`||e===`danger`,live:l=!0}){let u=Ej(e),d=Ej(`neutral`),f=e===`danger`;return(0,R.jsx)(Yf,{py:`sm`,pl:`sm`,pr:i||o?`xs`:`sm`,bg:c?Oj(u):`var(--mantine-color-default-hover)`,style:{borderInlineStart:`3px solid ${Dj(u)}`,borderStartStartRadius:0,borderEndStartRadius:0},role:l?f?`alert`:`status`:void 0,"aria-live":l?f?`assertive`:`polite`:void 0,children:(0,R.jsxs)(um,{gap:`sm`,align:`flex-start`,wrap:`nowrap`,children:[(0,R.jsx)(U,{component:`span`,lh:1,pt:2,c:Dj(u),flex:`0 0 auto`,children:(0,R.jsx)(jj,{tone:e,size:18,weight:`fill`})}),(0,R.jsxs)(fg,{flex:1,miw:0,gap:`xs`,direction:{base:`column`,sm:`row`},align:`flex-start`,children:[(0,R.jsxs)(H,{flex:1,miw:0,py:1,children:[t!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,fw:600,mb:2,style:{overflowWrap:`anywhere`},children:t}),(0,R.jsxs)(U,{component:`div`,size:`sm`,style:{overflowWrap:`anywhere`},children:[n,r!=null&&(0,R.jsxs)(U,{component:`span`,inherit:!0,c:`dimmed`,children:[` `,r]})]})]}),i&&(0,R.jsx)(N_,{variant:`subtle`,color:d,size:`compact-sm`,leftSection:(0,R.jsx)(tj,{size:14,weight:`bold`,"aria-hidden":`true`}),onClick:i,type:`button`,children:a})]}),o&&(0,R.jsx)(em,{variant:`subtle`,color:d,size:`md`,onClick:o,"aria-label":s,children:(0,R.jsx)(ij,{size:14,"aria-hidden":`true`})})]})})}function Nj({opened:e,onClose:t,title:n,children:r,confirmLabel:i,onConfirm:a,cancelLabel:o=`Cancel`,pending:s=null,error:c,tone:l=`danger`,confirmText:u}){let f=$o(),p=l===`primary`?void 0:Tj(f,l),m=s===`confirm`,h=Xi(`(max-width: 36em)`),[g,_]=(0,d.useState)(``),v=(0,d.useRef)(null);(0,d.useEffect)(()=>{e&&m&&v.current?.focus()},[e,m]),(0,d.useEffect)(()=>{e||_(``)},[e]);let y=u!=null&&g!==u;return(0,R.jsx)(f0,{opened:e,onClose:m?()=>{}:t,title:(0,R.jsx)(U,{component:`span`,fw:600,size:`lg`,style:{overflowWrap:`anywhere`},children:n}),centered:!0,closeOnEscape:!m,closeOnClickOutside:!m,withCloseButton:!m,closeButtonProps:{"aria-label":`Close`},children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),!y&&!m&&a()},children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,ref:v,tabIndex:-1,"data-autofocus":m||void 0,style:{overflowWrap:`anywhere`},children:r}),u!=null&&(0,R.jsx)(W0,{label:(0,R.jsxs)(R.Fragment,{children:[`Type`,` `,(0,R.jsx)(U,{component:`span`,inherit:!0,ff:`monospace`,fw:600,children:u}),` `,`to confirm`]}),value:g,onChange:e=>_(e.currentTarget.value),disabled:m,autoComplete:`off`,"data-autofocus":!m||void 0}),c!=null&&(0,R.jsx)(Mj,{tone:`danger`,children:c}),(0,R.jsxs)(um,{justify:`flex-end`,gap:`sm`,style:h?{flexDirection:`column-reverse`,alignItems:`stretch`}:void 0,children:[(0,R.jsx)(N_,{variant:`default`,"data-autofocus":!m&&u==null||void 0,onClick:t,disabled:m,type:`button`,children:o}),(0,R.jsx)(N_,{color:p,type:`submit`,loading:m,disabled:y,children:i})]})]})})})}var Pj=`calc(var(--mantine-spacing-xs) * 2 + var(--mantine-font-size-sm) * var(--mantine-line-height))`;function Fj({state:e,loadingLabel:t=`Loading…`,rows:n=3,skeleton:r,empty:i,error:a,variant:o=`inline`,children:s}){let c=Ej(`danger`),l=Ej(`neutral`);if(e===`ready`)return s;let u=o===`page`;if(e===`loading`)return r!=null&&r!==!1&&r!==!0&&r!==``?(0,R.jsxs)(H,{role:`status`,children:[(0,R.jsx)(Kf,{children:t}),(0,R.jsx)(H,{"aria-hidden":`true`,inert:!0,children:r})]}):u?(0,R.jsx)(F_,{mih:`60dvh`,p:`xl`,children:(0,R.jsxs)(U0,{align:`center`,gap:`sm`,role:`status`,children:[(0,R.jsx)(Kp,{size:`md`,"aria-hidden":`true`}),(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:t})]})}):(0,R.jsxs)(U0,{gap:`sm`,role:`status`,children:[(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:t}),(0,R.jsx)(U0,{gap:4,children:Array.from({length:n},(e,t)=>(0,R.jsx)(z0,{height:Pj},t))})]});if(e===`empty`){let e=(0,R.jsxs)(U0,{align:`center`,gap:`sm`,ta:`center`,maw:`28rem`,mx:`auto`,children:[(0,R.jsx)(q0,{variant:`light`,color:l,size:u?56:44,children:i?.icon??(0,R.jsx)(gj,{size:u?28:22,"aria-hidden":`true`})}),(0,R.jsx)(U,{component:`div`,fw:600,size:u?`xl`:`lg`,children:i?.title??`Nothing here yet`}),i?.description!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,children:i.description}),i?.action!=null&&(0,R.jsx)(H,{mt:`xs`,children:i.action})]});return u?(0,R.jsx)(F_,{mih:`60dvh`,p:`xl`,children:e}):(0,R.jsx)(Yf,{withBorder:!0,py:`xl`,px:`lg`,children:e})}return u?(0,R.jsx)(F_,{mih:`60dvh`,p:`xl`,children:(0,R.jsxs)(U0,{align:`center`,gap:`sm`,ta:`center`,maw:`28rem`,role:`alert`,children:[(0,R.jsx)(q0,{variant:`light`,color:c,size:56,children:(0,R.jsx)(vj,{size:28,"aria-hidden":`true`})}),(0,R.jsx)(ev,{order:2,size:`h3`,children:a?.title??a?.message??`Something went wrong`}),a?.title!=null&&(0,R.jsx)(U,{component:`div`,c:`dimmed`,children:a.message}),a?.detail!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,children:a.detail}),a?.onRetry&&(0,R.jsx)(N_,{mt:`xs`,leftSection:(0,R.jsx)(tj,{size:16,weight:`bold`,"aria-hidden":`true`}),onClick:a.onRetry,type:`button`,children:a.retryLabel??`Try again`})]})}):(0,R.jsx)(Mj,{tone:`danger`,title:a?.title,detail:a?.detail,onRetry:a?.onRetry,retryLabel:a?.retryLabel,children:a?.message??`Something went wrong.`})}var Ij={emailLabel:`Email`,emailPlaceholder:`you@example.com`,continue:`Continue`,or:`or`,passkey:`Sign in with a passkey`,passkeyUnavailable:`Passkeys are not available on this device. Use an email code.`,passkeyPending:`Complete the passkey request in your browser or password manager.`,useCode:`Use email code instead`,codeTitle:`Check your email`,codeSent:(e,t,n)=>(0,R.jsxs)(R.Fragment,{children:[`If `,e,` can sign in, a `,t,`-digit code is on its way.`,n!=null&&` It works for ${n} minutes.`]}),codeLabel:`Verification code`,verify:`Verify and continue`,verifying:`Verifying…`,incompleteCode:e=>`Enter all ${e} digits of the code.`,resend:`Send a new code`,resendIn:e=>`Send a new code in ${e}`,changeEmail:`Use a different email`};function Lj(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)}`}function Rj({children:e}){return(0,R.jsx)(U,{component:`div`,size:`xs`,fw:600,tt:`uppercase`,lts:`0.08em`,c:`dimmed`,children:e})}function zj({children:e}){return(0,R.jsx)(U,{component:`div`,size:`xs`,c:`dimmed`,ta:`center`,children:e})}function Bj({step:e,title:t=`Sign in`,description:n=`Use your email. No password needed.`,invitation:r,email:i,onEmailChange:a,onSendCode:o,emailError:s,code:c,onCodeChange:l,onVerify:u,codeLength:f=6,autoVerify:p=!0,expiresInMinutes:m,codeNote:h,resendIn:g=0,onResend:_,onChangeEmail:v,pending:y=null,error:b,notice:x,passkey:S,footer:C,stepLabels:w={},labels:T,inputRef:E,autoFocus:D=!0}){let O={...Ij,...T},k=Ej(`neutral`),A=(0,d.useRef)(null),j=(0,d.useRef)(S?.autofill);j.current=S?.autofill;let M=S?.autofill!=null,N=S?.available;(0,d.useEffect)(()=>{if(e!==`email`||!N||!M||y!=null)return;let t=new AbortController;return A.current=t,j.current?.(t.signal),()=>t.abort()},[e,N,M,y]);let P=(0,d.useRef)(null),F=Aa(P,E),ee=(0,d.useRef)(null);(0,d.useEffect)(()=>{c.length{I&&(e.length{ie&&I&&P.current?.focus()},[ie,I]);let ae=(0,R.jsxs)(R.Fragment,{children:[b!=null&&(0,R.jsx)(Mj,{tone:`danger`,children:b}),b==null&&te&&e===`code`&&(0,R.jsx)(Mj,{tone:`danger`,children:O.incompleteCode(f)}),x!=null&&(0,R.jsx)(Mj,{tone:`info`,children:x})]});if(e===`code`){let e=y===`verify`;return(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsxs)(U0,{gap:8,children:[w&&(0,R.jsx)(Rj,{children:w.code??`2 · Code`}),(0,R.jsx)(ev,{order:1,size:`h2`,children:O.codeTitle}),(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:O.codeSent((0,R.jsx)(U,{component:`span`,inherit:!0,c:`var(--mantine-color-text)`,fw:500,style:{overflowWrap:`anywhere`},children:i}),f,m)})]}),(0,R.jsx)(`form`,{noValidate:!0,onSubmit:e=>{e.preventDefault(),re(c)},children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(x0,{ref:F,length:f,type:`number`,oneTimeCode:!0,autoFocus:D,size:`md`,gap:`xs`,placeholder:``,ariaLabel:O.codeLabel,getInputProps:e=>({"aria-label":`${O.codeLabel}, digit ${e+1} of ${f}`}),value:c,onChange:e=>{l(e),ne(!1),e.length0?(0,R.jsx)(U,{size:`sm`,c:`dimmed`,ta:`center`,children:O.resendIn(Lj(g))}):(0,R.jsx)(N_,{variant:`subtle`,size:`sm`,disabled:!I&&y!==`resend`,loading:y===`resend`,onClick:_,type:`button`,children:O.resend})),(0,R.jsx)(N_,{variant:`subtle`,color:k,size:`sm`,disabled:e,onClick:v,type:`button`,children:O.changeEmail})]}),C!=null&&(0,R.jsx)(zj,{children:C})]})}let oe=y===`passkey`;return(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsxs)(U0,{gap:8,children:[w&&(0,R.jsx)(Rj,{children:w.email??`1 · Email`}),(0,R.jsx)(ev,{order:1,size:`h2`,children:t}),n!=null&&(0,R.jsx)(U,{size:`sm`,c:`dimmed`,children:n}),r!=null&&(0,R.jsx)(U,{size:`sm`,fw:500,children:r})]}),(0,R.jsx)(`form`,{noValidate:!0,onSubmit:e=>{e.preventDefault(),I&&(A.current?.abort(),o())},children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(W0,{ref:F,size:`md`,label:O.emailLabel,type:`email`,name:`email`,autoComplete:S?`email webauthn`:`email`,autoFocus:D,required:!0,withAsterisk:!1,placeholder:O.emailPlaceholder,value:i,error:s,onChange:e=>a(e.currentTarget.value),disabled:y===`send`||oe}),ae,(0,R.jsx)(N_,{type:`submit`,fullWidth:!0,size:`md`,loading:y===`send`,disabled:oe,children:O.continue})]})}),S&&(0,R.jsxs)(U0,{gap:`sm`,children:[(0,R.jsx)(H_,{label:O.or,labelPosition:`center`}),(0,R.jsx)(N_,{variant:`default`,fullWidth:!0,size:`md`,leftSection:(0,R.jsx)(xj,{size:18,"aria-hidden":`true`}),onClick:()=>{A.current?.abort(),S.onStart()},loading:oe,disabled:!S.available||y===`send`,type:`button`,children:O.passkey}),!S.available&&(0,R.jsx)(U,{size:`sm`,c:`dimmed`,ta:`center`,role:`status`,children:O.passkeyUnavailable}),oe&&(0,R.jsxs)(H,{ta:`center`,children:[(0,R.jsx)(U,{size:`sm`,c:`dimmed`,role:`status`,children:O.passkeyPending}),S.onUseCode&&(0,R.jsx)(N_,{variant:`subtle`,color:k,size:`sm`,mt:4,onClick:S.onUseCode,type:`button`,children:O.useCode})]})]}),C!=null&&(0,R.jsx)(zj,{children:C})]})}function Vj({items:e,label:t,emptyValue:n=`Not set`,layout:r=`columns`,labelWidth:i=`12rem`,withDividers:a=!0}){let o=r===`columns`;return(0,R.jsx)(H,{component:`dl`,"aria-label":t,m:0,children:e.map((e,t)=>(0,R.jsxs)(H,{display:o?{base:`block`,sm:`flex`}:`block`,py:`sm`,style:a&&t>0?{borderTop:`1px solid var(--labstack-border, var(--mantine-color-default-border))`}:void 0,children:[(0,R.jsx)(H,{component:`dt`,w:o?{sm:i}:void 0,miw:o?{sm:i}:void 0,pr:o?{sm:`md`}:void 0,mb:o?{base:4,sm:0}:4,children:(0,R.jsx)(U,{component:`span`,size:`sm`,c:`dimmed`,style:{overflowWrap:`anywhere`},children:e.label})}),(0,R.jsxs)(H,{component:`dd`,m:0,style:{flex:1,minWidth:0},children:[e.value==null||e.value===``?(0,R.jsx)(U,{component:`span`,size:`sm`,c:`dimmed`,fs:`italic`,children:n}):(0,R.jsx)(U,{component:`div`,size:`sm`,fw:500,style:{overflowWrap:`anywhere`},children:e.value}),e.hint!=null&&(0,R.jsx)(U,{component:`div`,size:`xs`,c:`dimmed`,mt:2,style:{overflowWrap:`anywhere`},children:e.hint})]})]},t))})}(0,d.forwardRef)(function({current:e=`page`,active:t,...n},r){return(0,R.jsx)(h0,{ref:r,active:t,"aria-current":t?e:void 0,...n})});function Hj({title:e,eyebrow:t,description:n,meta:r,actions:i,order:a=1,withDivider:o=!1}){let s=(0,R.jsxs)(U0,{component:`header`,gap:a===1?6:4,children:[t!=null&&(0,R.jsx)(U,{component:`div`,size:`xs`,fw:600,tt:`uppercase`,lts:`0.08em`,c:`dimmed`,children:t}),(0,R.jsxs)(um,{justify:`space-between`,align:`flex-start`,wrap:`wrap`,gap:`md`,children:[(0,R.jsxs)(U0,{gap:a===1?6:4,flex:`1 1 24rem`,miw:0,children:[(0,R.jsx)(ev,{order:a,style:{textWrap:`balance`,overflowWrap:`anywhere`},children:e}),n!=null&&(0,R.jsx)(U,{component:`div`,c:`dimmed`,size:a===1?`md`:`sm`,maw:`65ch`,style:{overflowWrap:`anywhere`},children:n}),r!=null&&(0,R.jsx)(U,{component:`div`,size:`sm`,c:`dimmed`,mt:2,children:r})]}),i!=null&&(0,R.jsx)(um,{gap:`sm`,wrap:`wrap`,children:i})]})]});return o?(0,R.jsxs)(U0,{gap:`md`,children:[s,(0,R.jsx)(H_,{})]}):s}var Uj={sm:12,md:14,lg:16};function Wj({tone:e,children:t,icon:n,variant:r,size:i=`md`}){let a=Ej(e),o=n===!1?null:n??(Aj(e)?(0,R.jsx)(jj,{tone:e,size:Uj[i],weight:`bold`}):null),s=r??(e===`neutral`?`outline`:`light`),c=s===`outline`&&a===wj.neutral?{root:{"--badge-bd":`1px solid var(--labstack-control-border, var(--mantine-color-default-border))`,"--badge-color":`var(--labstack-muted, var(--mantine-color-dimmed))`}}:void 0;return(0,R.jsx)(x_,{color:a,variant:s,vars:c?()=>c:void 0,size:i,tt:`none`,fw:500,leftSection:o??void 0,styles:{root:{flexShrink:0,maxWidth:`none`},label:{whiteSpace:`nowrap`,overflow:`visible`}},children:t})}function Gj(e){if(!/^#?(?:[\da-f]{3}|[\da-f]{6})$/i.test(e))throw Error(`Expected a 3- or 6-digit hex color, received ${e}`);let t=e.replace(/^#/,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=[0,2,4].map(e=>{let t=Number.parseInt(n.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return r[0]*.2126+r[1]*.7152+r[2]*.0722}function Kj(e,t){let n=Gj(e),r=Gj(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function qj(e){return Kj(e,`#000000`)>Kj(e,`#ffffff`)?`#000000`:`#ffffff`}var Jj={primary:`ink`,accent:[`#F1F0FF`,`#E4E2FF`,`#CDC9FF`,`#B5B0FF`,`#A29CFF`,`#8F8CFF`,`#756DEB`,`#5A50D8`,`#463DAE`,`#332B81`],colors:{ok:[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],warn:[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],bad:[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],info:[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`]},tones:{success:`ok`,warning:`warn`,danger:`bad`,info:`info`},fontFamily:`"Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,fontFamilyMonospace:`"Geist Mono Variable", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,displayWeight:600,radius:`soft`,elevation:`bordered`,density:`compact`,controlSizes:{sm:32,md:36,lg:40},focus:`ring`,surfaces:{light:{ground:`#F5F5F6`,raised:`#FFFFFF`,inset:`#EFEFF1`,hover:`#EDEDEF`,border:`#E3E3E6`,borderSoft:`#ECECEE`,controlBorder:`#6D6D73`,text:`#111113`,muted:`#53535B`},dark:{ground:`#0B0B0C`,raised:`#121214`,inset:`#08080A`,hover:`#1A1A1D`,border:`#232327`,borderSoft:`#1A1A1E`,controlBorder:`#828288`,text:`#EDEDEF`,muted:`#A1A1A9`}},typeScale:{small:12,body:14,title:16,section:20,page:28},chart:{series:{light:[`#2a78d6`,`#eb6834`,`#19a170`,`#4a3aa7`,`#bd8000`,`#ce6d92`],dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`]}}},Yj={micro:11,small:12,body:14,title:16,section:22,page:28},Xj={prose:720,article:960,page:1200,app:1500},Zj={light:7,dark:5},Qj={square:{control:0,surface:0,overlay:0},soft:{control:4,surface:8,overlay:12},round:{control:6,surface:16,overlay:24}};function $j(e){return`#${e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`}function eM(e,t,n){let r=e=>{let t=e.replace(/^#/,``);return t.length===3?[...t].map(e=>e+e).join(``):t},i=r(e),a=r(t);return $j([0,2,4].map(e=>{let t=Number.parseInt(i.slice(e,e+2),16);return t+(Number.parseInt(a.slice(e,e+2),16)-t)*n}))}function tM(e,t){if(typeof e!=`string`||!/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(e))throw Error(`${t} must be opaque 3/6-digit hex`)}var nM=new WeakSet;function rM(e){let t=e.currentTarget;!t.readOnly&&!t.disabled&&t.select()}function iM(e){let t=e.currentTarget;nM.delete(t),t!==t.ownerDocument.activeElement&&!t.readOnly&&!t.disabled&&(nM.add(t),t.select())}function aM(e){nM.delete(e.currentTarget)&&!e.currentTarget.readOnly&&e.currentTarget.select()}function oM(e,t,n){let r=e=>t.every(t=>Kj(e,t)>=n);if(r(e))return e;let i=[`#000000`,`#ffffff`].find(r);if(!i)throw Error(`Neutral surfaces cannot share accessible text`);for(let t=1;t<=100;t++){let n=eM(e,i,t/100);if(r(n))return n}return i}function sM(e,t){if(!Number.isFinite(t))throw Error(`neutralTint hue must be finite`);let n=(t%360+360)%360;return e.map(e=>{let t=[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16)/255),r=(Math.max(...t)+Math.min(...t))/2,i=.08*Math.min(r,1-r);return $j([0,8,4].map(e=>{let t=(e+n/30)%12;return 255*(r-i*Math.max(-1,Math.min(t-3,9-t,1)))}))})}function cM(e,t){let n=go({color:e,theme:t});if(n.isThemeColor)return`var(--labstack-color-${n.color}${n.shade===void 0?``:`-${n.shade}`}-contrast)`;if(/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(e))return qj(e)}var lM=e=>{let t=e.color||e.theme.primaryColor,n=e.variant??`filled`,r=Co({...e,color:t,variant:n});if(n!==`filled`||e.autoContrast===!1)return r;let i=cM(t,e.theme);if(!i)return r;let a=go({color:t,theme:e.theme});return{...r,color:i,...a.isThemeColor&&a.shade!==void 0?{hover:`var(--labstack-color-${a.color}-${a.shade}-hover)`}:a.isThemeColor?{}:{hover:oM(eM(t,`#000000`,.1),[i],4.5)}}};function uM(e,t){return t.iconColor||!(t.autoContrast??e.autoContrast)?void 0:cM(t.color||e.primaryColor,e)}function dM(e){let t=/^var\(--mantine-color-(.+)-(filled|\d)\)$/.exec(e??``);return t?`var(--labstack-color-${t[1]}${t[2]===`filled`?``:`-${t[2]}`}-contrast)`:e&&/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(e)?qj(e):void 0}function fM(e,t){return d.Children.map(e,e=>(0,d.isValidElement)(e)?e.props.__vars?.[`--sc-label-color`]?(0,d.cloneElement)(e,{__vars:{...e.props.__vars,"--sc-label-color":t}}):e.props.children?(0,d.cloneElement)(e,{children:fM(e.props.children,t)}):e:e)}function pM(e,t,n){let{gray:r,dark:i}=e.colors,a=t===`dark`,o=n.surfaces?.[t];if(n.surfaces&&!o)throw Error(`surfaces (${t}) ground/raised/inset/hover are required`);if(o){for(let e of[`ground`,`raised`,`inset`,`hover`])tM(o[e],`surfaces (${t}) ${e}`);for(let[e,n]of Object.entries(o))n!==void 0&&tM(n,`surfaces (${t}) ${e}`)}let s=o?.ground??(a?i[7]:r[0]),c=o?.raised??(a?i[6]:e.white),l=o?.inset??(a?i[8]:r[1]),u=o?.hover??(a?i[5]:r[2]),d=(e,t=!1)=>a?eM(c,e[5],t?.22:.15):e[t?2:1],f=[s,c,l,u],p=[s,c,l,u,...[...new Set([`brand`,...n.accent?[`accent`]:[],...Object.values(e.other.labstackTones).map(t=>go({color:t,theme:e}).color)])].flatMap(t=>{let n=e.colors[t];return n?[d(n),d(n,!0)]:[]})],m=go({color:e.other.labstackTones.danger,theme:e}).color,h=go({color:e.other.labstackTones.neutral,theme:e}).color,g=(e,n,r)=>{let i=o?.[e];if(i===void 0)try{return oM(n,e===`controlBorder`?f:p,r)}catch{throw Error(`surfaces (${t}) ${e} cannot meet ${r}:1 on every surface`)}if(p.some(e=>Kj(i,e)[`--labstack-${e}`,t]));if(o?.borderSoft!==void 0&&(n.primary===`ink`||Object.values(e.other.labstackTones).some(t=>go({color:t,theme:e}).color===`ink`)))for(let e of[v.hover,v[`border-soft`]]){let n=Kj(v.text,e);if(n<4.5)throw Error(`surfaces (${t}) borderSoft makes ink light hover text ${n.toFixed(2)}:1; need 4.5:1`)}n.elevation===`ring`&&(y[`--labstack-ring`]=a?`0 0 0 1px rgba(255,255,255,.09), 0 2px 2px rgba(0,0,0,.12)`:`0 0 0 1px rgba(0,0,0,.08), 0 2px 2px rgba(0,0,0,.04)`);let b=e=>`var(--labstack-${e})`;Object.assign(y,{"--mantine-color-body":b(`ground`),"--mantine-color-text":b(`text`),"--mantine-color-dimmed":b(`muted`),"--mantine-color-placeholder":b(`muted`),"--mantine-color-anchor":`var(--mantine-color-${n.accent?`accent`:`brand`}-text)`,"--labstack-focus":`var(--mantine-color-${n.accent?`accent`:`brand`}-text)`,"--labstack-selected":`var(--mantine-color-${n.accent?`accent`:`brand`}-light)`,"--labstack-selected-text":`var(--mantine-color-${n.accent?`accent`:`brand`}-text)`,"--mantine-color-disabled":b(`inset`),"--mantine-color-disabled-color":b(`faint`),"--mantine-color-disabled-border":b(`border`),...n.controlSizes?{"--labstack-control-sm":`${n.controlSizes.sm}px`,"--labstack-control-md":`${n.controlSizes.md}px`,"--labstack-control-lg":`${n.controlSizes.lg}px`}:{},"--mantine-color-default":b(`raised`),"--mantine-color-default-hover":b(`hover`),"--mantine-color-default-color":b(`text`),"--mantine-color-default-border":b(`control-border`),"--mantine-color-error":`var(--mantine-color-${m}-text)`,"--mantine-primary-color-contrast":`var(--labstack-color-brand-contrast)`});for(let[n,o]of Object.entries(e.colors)){let s=Zj[t];if((n===m||n===`red`)&&qj(o[s])===`#000000`){for(let e=s+1;e<=9;e++)if(Kj(`#ffffff`,o[e])>=4.5){s=e;break}}let c=s,l=o[c],u=(n===m||n===`red`)&&Kj(`#ffffff`,l)>=4.5?`#ffffff`:qj(l),g=e=>o[e===9?8:e+1],_=d(o),v=d(o,!0),b=o[a?Math.max(c-4,0):c],x=[...n===`brand`||n===`accent`||n===h||n===m?p:f,_,v,...n===m?[a?i[6]:e.white,a?i[5]:r[1]]:[],...f.map(e=>eM(e,b,.05))],S;for(let e=c;e>=0&&e<=9;e+=a?-1:1)if(x.every(t=>Kj(o[e],t)>=4.5)){S=o[e];break}S??=oM(a?o[2]:o[9],x,4.5),Object.assign(y,{[`--labstack-color-${n}-contrast`]:u,[`--mantine-color-${n}-filled`]:l,[`--mantine-color-${n}-filled-hover`]:oM(g(c),[u],4.5),[`--mantine-color-${n}-text`]:S,[`--mantine-color-${n}-light`]:_,[`--mantine-color-${n}-light-hover`]:v,[`--mantine-color-${n}-light-color`]:S,[`--mantine-color-${n}-outline`]:S}),o.forEach((e,t)=>{let r=qj(e);y[`--labstack-color-${n}-${t}-contrast`]=r,y[`--labstack-color-${n}-${t}-hover`]=oM(g(t),[r],4.5)})}for(let t of[...n.primary===`ink`?[`brand`]:[],...Object.values(e.other.labstackTones).includes(`ink`)?[`ink`]:[]]){let e=v.text,n=qj(e);Object.assign(y,{[`--mantine-color-${t}-filled`]:e,[`--mantine-color-${t}-filled-hover`]:oM(v.muted,[n],4.5),[`--labstack-color-${t}-contrast`]:n,[`--mantine-color-${t}-text`]:e,[`--mantine-color-${t}-light-color`]:e,[`--mantine-color-${t}-outline`]:e,[`--mantine-color-${t}-light`]:v.hover,[`--mantine-color-${t}-light-hover`]:v[`border-soft`]})}if(o)for(let e of[`gray`,`dark`])Object.assign(y,{[`--mantine-color-${e}-light`]:v.hover,[`--mantine-color-${e}-light-hover`]:v[`border-soft`],[`--mantine-color-${e}-light-color`]:v.text});for(let[e,r]of Object.entries(n.variants??{})){let n=r[t];for(let[r,i]of Object.entries(n))if(i!==void 0&&(r!==`background`&&r!==`hover`||i!==`transparent`)&&!/^#(?:[\da-f]{3}|[\da-f]{6})$/i.test(i))throw Error(`Variant ${e} (${t}) ${r} must be opaque hex`);let i=[n.background,n.hover??n.background].flatMap(e=>e===`transparent`?f:[e]),a=n.color??(n.background===`transparent`?v.text:qj(n.background));if(i.some(e=>Kj(a,e)<4.5))throw Error(`Variant ${e} (${t}) text must meet 4.5:1 at rest and hover`);let o=n.border;if(o&&[...f,...i].some(e=>Kj(o,e)<3))throw Error(`Variant ${e} (${t}) border must meet 3:1`);Object.assign(y,{[`--labstack-variant-${e}-background`]:n.background,[`--labstack-variant-${e}-hover`]:n.hover??n.background,[`--labstack-variant-${e}-color`]:a,[`--labstack-variant-${e}-border`]:n.border??`transparent`})}return y}var mM=[`NavLink`,`Tabs`,`Checkbox`,`Radio`,`Switch`,`Pagination`,`Chip`,`Stepper`,`Slider`,`RangeSlider`];function hM(e=Jj){if(!e.displayFont&&(e.displayWeight===700||e.displayTracking===-.03))throw Error(`Weight 700 and tracking -0.03em require displayFont`);let t=new Set([`filled`,`light`,`outline`,`subtle`,`transparent`,`white`,`default`,`gradient`]);for(let n of Object.keys(e.variants??{}))if(!/^[a-z][a-z0-9-]*$/.test(n)||t.has(n))throw Error(`Variant ${n} must be a new kebab-case name`);let n=e.lineWeight===void 0||e.lineWeight===1?{}:{borderWidth:`${e.lineWeight}px`},r=e.displayFont?{fontFamily:e.displayFont,fontWeight:e.displayWeight??650}:{},i=`${e.displayTracking??-.02}em`,a=Object.fromEntries(Object.entries(wj).map(([t,n])=>[t,e.tones?.[t]??n]));for(let[t,n]of Object.entries(e.colors??{})){if([`brand`,`ink`,`accent`].includes(t)||Object.hasOwn(Go.colors,t))throw Error(`colors ${t} cannot replace a built-in palette`);if(!Array.isArray(n)||n.length!==10)throw Error(`colors ${t} must have exactly ten colors`);for(let e of n)tM(e,`colors ${t}`)}if(e.accent!==void 0){if(!Array.isArray(e.accent)||e.accent.length!==10)throw Error(`accent must have exactly ten colors`);for(let t of e.accent)tM(t,`accent`)}if(e.surfaces){let t=new Set([...Object.keys(Go.colors),`brand`,`ink`,...e.accent?[`accent`]:[],...Object.keys(e.colors??{})]);for(let[n,r]of Object.entries({...a,...typeof e.primary==`string`?{primary:e.primary}:{}})){let e=r.replace(/\.\d$/,``);if(!t.has(e))throw Error(`tones ${n} uses unregistered palette ${e}; pass it in brand.colors`)}}let o={...Yj};for(let t of[`small`,`body`,`title`,`section`,`page`])o[t]=e.typeScale?.[t]??Yj[t];for(let t of Object.keys(e.typeScale??{}))if(![`small`,`body`,`title`,`section`,`page`].includes(t))throw Error(`typeScale ${t} is not a brand input`);let s={small:[12,14],body:[14,16],title:[16,20],section:[20,28],page:[28,36]},c=0;for(let e of Object.keys(s)){let t=o[e],[n,r]=s[e];if(!Number.isInteger(t)||tr||t<=c&&(e!==`body`||t!==14||c!==14))throw Error(`typeScale ${e} must be an integer in ${n}–${r} and increase strictly (small/body may both be 14)`);c=t}let l=typeof e.radius==`object`?e.radius:Qj[e.radius??`soft`],u=0;for(let e of[`control`,`surface`,`overlay`]){if(!l||!Number.isInteger(l[e])||l[e]32)throw Error(`radius ${e} must be an integer with 0 ≤ control ≤ surface ≤ overlay ≤ 32`);u=l[e]}if(e.density!==void 0&&![`default`,`compact`].includes(e.density))throw Error(`density must be default or compact`);if(e.focus!==void 0&&![`ring`,`border`].includes(e.focus))throw Error(`focus input must be ring or border`);if(e.elevation!==void 0&&![`bordered`,`shadow`,`ring`].includes(e.elevation))throw Error(`elevation must be bordered, shadow or ring`);if(e.controlSizes){let t=23;for(let n of[`sm`,`md`,`lg`]){let r=e.controlSizes[n];if(!Number.isInteger(r)||r<=t||r>56)throw Error(`controlSizes ${n} must be an integer with 24 ≤ sm < md < lg ≤ 56`);t=r}}let f=e.density===`compact`?{size:`sm`}:{},p=l.control===0?{radius:0}:{},m=t=>e.controlSizes?Object.fromEntries([`xs`,`sm`,`md`,`lg`,`xl`].map(n=>[`--${t}-${n}`,`${e.controlSizes?.[n===`xs`?`sm`:n===`xl`?`lg`:n]}px`])):{},h=e=>`${e/16}rem`,g=e.elevation===`shadow`,_=typeof e.neutralTint==`number`?{gray:sM(Go.colors.gray,e.neutralTint),dark:sM(Go.colors.dark,e.neutralTint)}:e.neutralTint,v={defaultProps:{radius:l.surface,withBorder:!g&&e.elevation!==`ring`,shadow:g?`xs`:`none`},styles:(t,r)=>({root:{backgroundColor:`var(--labstack-raised)`,borderColor:`var(--labstack-border)`,...n,...r.variant===`outline`?{border:`${e.lineWeight??1}px solid var(--labstack-border)`,boxShadow:`none`}:r.variant===`flat`?{backgroundColor:`var(--labstack-inset)`,border:`none`,boxShadow:`none`}:e.elevation===`ring`&&(r.shadow??`none`)===`none`?{boxShadow:`var(--labstack-ring)`}:{}}})},y=ms({primaryColor:`brand`,primaryShade:Zj,colors:{...e.colors,...e.accent?{accent:e.accent}:{},..._,...Object.values(a).includes(`ink`)?{ink:_?.gray??Go.colors.gray}:{},brand:e.primary===`ink`?_?.gray??Go.colors.gray:e.primary},fontFamily:e.fontFamily??Go.fontFamily,fontFamilyMonospace:e.fontFamilyMonospace??Go.fontFamilyMonospace,fontSizes:{xs:h(o.small),sm:h(o.body),md:h(o.body),lg:h(o.title),xl:h(o.section)},lineHeights:{xs:`1.5`,sm:`1.5`,md:`1.5`,lg:`1.5`,xl:`1.5`},headings:{...e.displayFont?{fontFamily:e.displayFont}:{},fontWeight:String(e.displayWeight??650),textWrap:`balance`,sizes:{h1:{fontSize:h(o.page),lineHeight:`1.25`},h2:{fontSize:h(o.section),lineHeight:`1.25`},h3:{fontSize:h(o.title),lineHeight:`1.25`},h4:{fontSize:h(o.body),lineHeight:`1.25`},h5:{fontSize:h(o.small),lineHeight:`1.25`},h6:{fontSize:h(o.small),lineHeight:`1.25`}}},defaultRadius:`sm`,radius:{xs:`${l.control}px`,sm:`${l.control}px`,md:`${l.surface}px`,lg:`${l.overlay}px`,xl:`${l.overlay}px`},respectReducedMotion:!0,autoContrast:!0,variantColorResolver:t=>{let n=t.variant??`filled`;if(!Object.hasOwn(e.variants??{},n))return lM(t);let r=e=>`var(--labstack-variant-${n}-${e})`;return{background:r(`background`),hover:r(`hover`),color:r(`color`),border:`${e.lineWeight??1}px solid ${r(`border`)}`}},components:{Paper:v,Card:v,Button:{defaultProps:{radius:l.control,...f},...e.controlSizes?{vars:()=>({root:m(`button-height`)})}:{},styles:(t,i)=>({root:{...r,...n,...e.variants?.[i.variant??`filled`]?.underline?{textDecoration:`underline`,textUnderlineOffset:`0.2em`}:{}}})},Accordion:{styles:{control:r,item:n}},Text:{styles:(e,t)=>({root:t.variant===`numeral`?{...r,letterSpacing:i,fontVariantNumeric:`tabular-nums`}:{}})},Select:{defaultProps:{...f,checkIconPosition:`right`,onFocus:rM,onMouseDown:iM,onClick:aM}},Autocomplete:{defaultProps:{...f,onFocus:rM,onMouseDown:iM,onClick:aM}},...e.density===`compact`?{TextInput:{defaultProps:f},MultiSelect:{defaultProps:f},NumberInput:{defaultProps:f},PasswordInput:{defaultProps:f},Textarea:{defaultProps:f},TagsInput:{defaultProps:f},PillsInput:{defaultProps:f},JsonInput:{defaultProps:f},NativeSelect:{defaultProps:f},ColorInput:{defaultProps:f},FileInput:{defaultProps:f}}:{},Anchor:{defaultProps:{underline:`always`}},Blockquote:{vars:(e,t)=>t.color?{root:{}}:{root:{"--bq-bd":`var(--labstack-border)`,"--bq-bg-light":`transparent`,"--bq-bg-dark":`transparent`}}},Code:{styles:{root:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,color:`var(--mantine-color-text)`}}},InputWrapper:{styles:{label:r},defaultProps:{inputWrapperOrder:[`label`,`input`,`description`,`error`]}},PinInput:{defaultProps:{placeholder:``}},Rating:{defaultProps:{color:a.warning}},Table:{defaultProps:{verticalSpacing:`xs`,horizontalSpacing:`sm`,...e.density===`compact`?{fz:`sm`}:{}},vars:(e,t)=>({table:{"--table-border-color":t.borderColor?void 0:`var(--labstack-border)`,"--table-striped-color":t.stripedColor?void 0:`color-mix(in srgb, var(--labstack-text) 4%, transparent)`,"--table-highlight-on-hover-color":t.highlightOnHoverColor?void 0:`var(--labstack-hover)`}}),styles:{td:{fontVariantNumeric:`tabular-nums`},th:{whiteSpace:`nowrap`,...e.lineWeight&&e.lineWeight!==1?{borderBottom:`${e.lineWeight}px solid var(--labstack-border)`}:{}}}},ActionIcon:{defaultProps:{radius:l.control,...f},...e.controlSizes?{vars:()=>({root:{...m(`ai-size`),...m(`ai-size-input`)}})}:{},styles:{root:n}},...e.focus===`border`?{PinInput:{defaultProps:{placeholder:``},classNames:{input:`labstack-border-focus`}},Combobox:{classNames:{search:`labstack-border-focus`}}}:{},Input:{...e.focus===`border`?{classNames:{input:`labstack-border-focus`}}:{},styles:{input:n},defaultProps:{radius:l.control,...f},vars:(e,t)=>({wrapper:{...m(`input-height`),"--input-bg":(t.variant??`default`)==="default"&&!t.disabled?`var(--labstack-raised)`:void 0,"--input-bd":(t.variant??`default`)==="default"&&!t.disabled&&!t.error&&!t.success?`var(--labstack-control-border)`:void 0}})},Skeleton:{defaultProps:{radius:l.control},classNames:{root:`labstack-Skeleton-root`}},ThemeIcon:{defaultProps:{radius:l.control}},Title:{styles:{root:{letterSpacing:i}}},Badge:{defaultProps:{variant:`light`,fw:600,tt:`none`,...f},styles:{root:{height:`auto`,maxWidth:`100%`,minHeight:`var(--badge-height)`},label:{whiteSpace:`normal`,overflowWrap:`anywhere`}},vars:(t,n)=>({root:{...[`xs`,`sm`,`md`].includes(n.size??`md`)?{"--badge-fz":`calc(0.75rem * var(--mantine-scale))`}:{},...e.primary===`ink`&&n.color===void 0&&(n.variant??`light`)===`light`?{"--badge-bg":`var(--labstack-inset)`,"--badge-color":`var(--labstack-text)`,"--badge-bd":`1px solid var(--labstack-border)`}:{}}})},Modal:{defaultProps:{centered:!0,radius:l.overlay,shadow:`lg`,overlayProps:{blur:3},closeButtonProps:{"aria-label":`Close`}},styles:{header:{background:`var(--labstack-raised)`},title:{fontWeight:e.displayWeight??650,fontSize:h(o.title)}}},Drawer:{defaultProps:{shadow:`lg`,closeButtonProps:{"aria-label":`Close`}},styles:{header:{background:`var(--labstack-raised)`},title:{fontWeight:e.displayWeight??650,fontSize:h(o.title)}}},Tooltip:{defaultProps:{radius:l.control},styles:{tooltip:{fontSize:h(o.small)}}},Alert:{defaultProps:{color:a.info,variant:`light`}},MultiSelect:{defaultProps:{checkIconPosition:`right`,...f}},Menu:{defaultProps:{withInitialFocusPlaceholder:!1,radius:l.overlay,shadow:`md`},styles:{dropdown:{background:`var(--labstack-raised)`,borderColor:`var(--labstack-border)`,...n}}},Popover:{defaultProps:{radius:l.overlay,shadow:`md`},styles:{dropdown:{background:`var(--labstack-raised)`,borderColor:`var(--labstack-border)`,...n}}},Divider:{vars:(e,t)=>({root:{"--divider-color":t.color?void 0:`var(--labstack-border-soft)`}})},Switch:{classNames:{track:`labstack-Switch-track`},defaultProps:{withThumbIndicator:!1,...p},vars:(e,t)=>({track:{"--labstack-switch-contrast":e.autoContrast?cM(t.color||e.primaryColor,e):void 0}})},Checkbox:{styles:{input:n,label:r},vars:(e,t)=>({root:{"--checkbox-icon-color":uM(e,t)}})},CheckboxIndicator:{vars:(e,t)=>({indicator:{"--checkbox-icon-color":uM(e,t)}})},Radio:{styles:{radio:n,label:{...r,overflowWrap:`anywhere`},description:{overflowWrap:`anywhere`}},vars:(e,t)=>({root:{"--radio-icon-color":uM(e,t)}})},RadioGroup:{styles:{label:{overflowWrap:`anywhere`}}},RadioIndicator:{vars:(e,t)=>({indicator:{"--radio-icon-color":uM(e,t)}})},SegmentedControl:{styles:{label:r},vars:(e,t)=>({root:{"--labstack-sc-contrast":t.color&&(t.autoContrast??e.autoContrast)?cM(t.color,e):void 0}}),defaultProps:{...f,renderRoot:e=>{let t=e.style?.[`--labstack-sc-contrast`];return(0,d.createElement)(`div`,e,t?fM(e.children,t):e.children)}}},Stepper:{vars:(e,t)=>({root:{"--stepper-icon-color":t.autoContrast??e.autoContrast?cM(t.color||e.primaryColor,e):void 0,"--labstack-step-icon-opt-out":t.autoContrast??e.autoContrast?void 0:`var(--mantine-color-white)`}})},StepperStep:{defaultProps:{renderRoot:e=>{let t=e.style,n=dM(t?.[`--step-color`]);return(0,d.createElement)(`button`,{type:`button`,...e,style:{...n?{"--stepper-icon-color":`var(--labstack-step-icon-opt-out, ${n})`}:{},...t}})}}},ProgressSection:{defaultProps:{renderRoot:e=>{let t=e.style,n=dM(t?.[`--progress-section-color`]);return(0,d.createElement)(`div`,{...e,style:{...t,...n&&t?.[`--progress-label-color`]?{"--progress-label-color":n}:{}}})}}},Tabs:{vars:(e,t)=>({root:{"--tabs-text-color":cM(t.color||e.primaryColor,e)}})},TabsTab:{defaultProps:{styles:(e,t)=>({tab:{"--tabs-text-color":t.color?cM(t.color,e):void 0}})}},...e.controlSizes?{Avatar:{vars:()=>({root:{"--avatar-size-sm":`${e.controlSizes?.sm}px`,"--avatar-size-md":`${e.controlSizes?.md}px`,"--avatar-size-lg":`${e.controlSizes?.lg}px`}})}}:{},Slider:{defaultProps:{...p}},RangeSlider:{defaultProps:{...p}},Chip:{defaultProps:{variant:`filled`,...f,...p},...e.controlSizes?{vars:()=>({root:m(`chip-size`)})}:{}},Pagination:{defaultProps:{...f,getControlProps:e=>({"aria-label":{first:`First page`,previous:`Previous page`,next:`Next page`,last:`Last page`}[e]})},vars:(e,t)=>({root:{...m(`pagination-control-size`),"--pagination-active-color":cM(t.color||e.primaryColor,e)}})}},other:{labstackTones:a,labstack:{typeScale:o,contentWidths:Xj}}});if(e.accent){y.components??={};let e=y.components,t=e.SegmentedControl??{},n=t.vars;e.SegmentedControl={...t,vars:(e,t,r)=>{let i=(typeof n==`function`?n(e,t,r):n)??{};return t.color?i:{...i,root:{...i.root,"--sc-color":`var(--mantine-color-accent-light)`,"--sc-label-color":`var(--mantine-color-accent-text)`}}}};for(let t of mM){let n=e[t]??{};e[t]={...n,defaultProps:{...n.defaultProps,color:`accent`}}}}let b=Xo(Go,y),x=t=>{let n=pM(b,t,e),r=e.chart?.series?.[t];if(e.chart?.series&&!r)throw Error(`chart.series.${t} is required`);let i=r??(t===`light`?[`#2a78d6`,`#eb6834`,`#1aa674`,`#4a3aa7`,`#c28400`,`#d57197`]:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`]);if(i.length!==6)throw Error(`chart.series (${t}) series must have exactly six colors`);let a=Array.from(i,(e,i)=>{if(tM(e,`chart.series (${t}) series[${i}]`),!r)return oM(e,[n[`--labstack-raised`]],3);if(Kj(e,n[`--labstack-raised`])<3)throw Error(`chart.series (${t}) series[${i}] must meet 3:1 on raised`);return e});return{text:n[`--labstack-text`],muted:n[`--labstack-muted`],grid:n[`--labstack-border-soft`],surface:n[`--labstack-raised`],border:n[`--labstack-border`],series:a}};return{theme:y,chart:{light:x(`light`),dark:x(`dark`)},cssVariablesResolver:t=>({variables:{},light:pM(t,`light`,e),dark:pM(t,`dark`,e)})}}var gM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),_M=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z`}))]]),vM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),yM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z`}))]]),bM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),xM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212ZM163.27,77l-56,24a12,12,0,0,0-6.3,6.3l-24,56A12,12,0,0,0,92.73,179l56-24a12,12,0,0,0,6.3-6.3l24-56A12,12,0,0,0,163.27,77Zm-28.41,57.89-24,10.29,10.29-24,24-10.29Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32Zm16,112L80,176l32-64,64-32Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm51.58,57.79-32,64a4.08,4.08,0,0,1-1.79,1.79l-64,32a4,4,0,0,1-5.37-5.37l32-64a4.08,4.08,0,0,1,1.79-1.79l64-32A4,4,0,0,1,179.58,81.79Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM173.32,74.63l-64,32a6,6,0,0,0-2.69,2.69l-32,64A6,6,0,0,0,80,182a6.06,6.06,0,0,0,2.68-.63l64-32a6,6,0,0,0,2.69-2.69l32-64a6,6,0,0,0-8.05-8.05Zm-33.79,64.9L93.42,162.58l23-46.11,46.11-23Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220ZM174.21,76.42l-64,32a4.08,4.08,0,0,0-1.79,1.79l-32,64A4,4,0,0,0,80,180a4.05,4.05,0,0,0,1.79-.42l64-32a4.08,4.08,0,0,0,1.79-1.79l32-64a4,4,0,0,0-5.37-5.37ZM141,141l-52.08,26L115,115l52.08-26Z`}))]]),SM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),CM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),wM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm92-27.21v-1.58l14-17.51a12,12,0,0,0,2.23-10.59A111.75,111.75,0,0,0,225,71.89,12,12,0,0,0,215.89,66L193.61,63.5l-1.11-1.11L190,40.1A12,12,0,0,0,184.11,31a111.67,111.67,0,0,0-27.23-11.27A12,12,0,0,0,146.3,22L128.79,36h-1.58L109.7,22a12,12,0,0,0-10.59-2.23A111.75,111.75,0,0,0,71.89,31.05,12,12,0,0,0,66,40.11L63.5,62.39,62.39,63.5,40.1,66A12,12,0,0,0,31,71.89,111.67,111.67,0,0,0,19.77,99.12,12,12,0,0,0,22,109.7l14,17.51v1.58L22,146.3a12,12,0,0,0-2.23,10.59,111.75,111.75,0,0,0,11.29,27.22A12,12,0,0,0,40.11,190l22.28,2.48,1.11,1.11L66,215.9A12,12,0,0,0,71.89,225a111.67,111.67,0,0,0,27.23,11.27A12,12,0,0,0,109.7,234l17.51-14h1.58l17.51,14a12,12,0,0,0,10.59,2.23A111.75,111.75,0,0,0,184.11,225a12,12,0,0,0,5.91-9.06l2.48-22.28,1.11-1.11L215.9,190a12,12,0,0,0,9.06-5.91,111.67,111.67,0,0,0,11.27-27.23A12,12,0,0,0,234,146.3Zm-24.12-4.89a70.1,70.1,0,0,1,0,8.2,12,12,0,0,0,2.61,8.22l12.84,16.05A86.47,86.47,0,0,1,207,166.86l-20.43,2.27a12,12,0,0,0-7.65,4,69,69,0,0,1-5.8,5.8,12,12,0,0,0-4,7.65L166.86,207a86.47,86.47,0,0,1-10.49,4.35l-16.05-12.85a12,12,0,0,0-7.5-2.62c-.24,0-.48,0-.72,0a70.1,70.1,0,0,1-8.2,0,12.06,12.06,0,0,0-8.22,2.6L99.63,211.33A86.47,86.47,0,0,1,89.14,207l-2.27-20.43a12,12,0,0,0-4-7.65,69,69,0,0,1-5.8-5.8,12,12,0,0,0-7.65-4L49,166.86a86.47,86.47,0,0,1-4.35-10.49l12.84-16.05a12,12,0,0,0,2.61-8.22,70.1,70.1,0,0,1,0-8.2,12,12,0,0,0-2.61-8.22L44.67,99.63A86.47,86.47,0,0,1,49,89.14l20.43-2.27a12,12,0,0,0,7.65-4,69,69,0,0,1,5.8-5.8,12,12,0,0,0,4-7.65L89.14,49a86.47,86.47,0,0,1,10.49-4.35l16.05,12.85a12.06,12.06,0,0,0,8.22,2.6,70.1,70.1,0,0,1,8.2,0,12,12,0,0,0,8.22-2.6l16.05-12.85A86.47,86.47,0,0,1,166.86,49l2.27,20.43a12,12,0,0,0,4,7.65,69,69,0,0,1,5.8,5.8,12,12,0,0,0,7.65,4L207,89.14a86.47,86.47,0,0,1,4.35,10.49l-12.84,16.05A12,12,0,0,0,195.88,123.9Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M207.86,123.18l16.78-21a99.14,99.14,0,0,0-10.07-24.29l-26.7-3a81,81,0,0,0-6.81-6.81l-3-26.71a99.43,99.43,0,0,0-24.3-10l-21,16.77a81.59,81.59,0,0,0-9.64,0l-21-16.78A99.14,99.14,0,0,0,77.91,41.43l-3,26.7a81,81,0,0,0-6.81,6.81l-26.71,3a99.43,99.43,0,0,0-10,24.3l16.77,21a81.59,81.59,0,0,0,0,9.64l-16.78,21a99.14,99.14,0,0,0,10.07,24.29l26.7,3a81,81,0,0,0,6.81,6.81l3,26.71a99.43,99.43,0,0,0,24.3,10l21-16.77a81.59,81.59,0,0,0,9.64,0l21,16.78a99.14,99.14,0,0,0,24.29-10.07l3-26.7a81,81,0,0,0,6.81-6.81l26.71-3a99.43,99.43,0,0,0,10-24.3l-16.77-21A81.59,81.59,0,0,0,207.86,123.18ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8.06,8.06,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8.06,8.06,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,130.16q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm83.93-32.49q.13-3.51,0-7l15.83-19.79a4,4,0,0,0,.75-3.53A103.64,103.64,0,0,0,218,75.9a4,4,0,0,0-3-2l-25.19-2.8c-1.58-1.71-3.24-3.37-4.95-4.95L182.07,41a4,4,0,0,0-2-3A104,104,0,0,0,154.82,27.5a4,4,0,0,0-3.53.74L131.51,44.07q-3.51-.14-7,0L104.7,28.24a4,4,0,0,0-3.53-.75A103.64,103.64,0,0,0,75.9,38a4,4,0,0,0-2,3l-2.8,25.19c-1.71,1.58-3.37,3.24-4.95,4.95L41,73.93a4,4,0,0,0-3,2A104,104,0,0,0,27.5,101.18a4,4,0,0,0,.74,3.53l15.83,19.78q-.14,3.51,0,7L28.24,151.3a4,4,0,0,0-.75,3.53A103.64,103.64,0,0,0,38,180.1a4,4,0,0,0,3,2l25.19,2.8c1.58,1.71,3.24,3.37,4.95,4.95l2.8,25.2a4,4,0,0,0,2,3,104,104,0,0,0,25.28,10.46,4,4,0,0,0,3.53-.74l19.78-15.83q3.51.13,7,0l19.79,15.83a4,4,0,0,0,2.5.88,4,4,0,0,0,1-.13A103.64,103.64,0,0,0,180.1,218a4,4,0,0,0,2-3l2.8-25.19c1.71-1.58,3.37-3.24,4.95-4.95l25.2-2.8a4,4,0,0,0,3-2,104,104,0,0,0,10.46-25.28,4,4,0,0,0-.74-3.53Zm.17,42.83-24.67,2.74a4,4,0,0,0-2.55,1.32,76.2,76.2,0,0,1-6.48,6.48,4,4,0,0,0-1.32,2.55l-2.74,24.66a95.45,95.45,0,0,1-19.64,8.15l-19.38-15.51a4,4,0,0,0-2.5-.87h-.24a73.67,73.67,0,0,1-9.16,0,4,4,0,0,0-2.74.87l-19.37,15.5a95.33,95.33,0,0,1-19.65-8.13l-2.74-24.67a4,4,0,0,0-1.32-2.55,76.2,76.2,0,0,1-6.48-6.48,4,4,0,0,0-2.55-1.32l-24.66-2.74a95.45,95.45,0,0,1-8.15-19.64l15.51-19.38a4,4,0,0,0,.87-2.74,77.76,77.76,0,0,1,0-9.16,4,4,0,0,0-.87-2.74l-15.5-19.37A95.33,95.33,0,0,1,43.9,81.66l24.67-2.74a4,4,0,0,0,2.55-1.32,76.2,76.2,0,0,1,6.48-6.48,4,4,0,0,0,1.32-2.55l2.74-24.66a95.45,95.45,0,0,1,19.64-8.15l19.38,15.51a4,4,0,0,0,2.74.87,73.67,73.67,0,0,1,9.16,0,4,4,0,0,0,2.74-.87l19.37-15.5a95.33,95.33,0,0,1,19.65,8.13l2.74,24.67a4,4,0,0,0,1.32,2.55,76.2,76.2,0,0,1,6.48,6.48,4,4,0,0,0,2.55,1.32l24.66,2.74a95.45,95.45,0,0,1,8.15,19.64l-15.51,19.38a4,4,0,0,0-.87,2.74,77.76,77.76,0,0,1,0,9.16,4,4,0,0,0,.87,2.74l15.5,19.37A95.33,95.33,0,0,1,212.1,174.34Z`}))]]),TM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),EM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),DM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),OM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),kM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,164a36.07,36.07,0,0,0-33.94,24H72a28,28,0,0,1,0-56h96a44,44,0,0,0,0-88H72a12,12,0,0,0,0,24h96a20,20,0,0,1,0,40H72a52,52,0,0,0,0,104h94.06A36,36,0,1,0,200,164Zm0,48a12,12,0,1,1,12-12A12,12,0,0,1,200,212Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,200a24,24,0,1,1-24-24A24,24,0,0,1,224,200Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228,200a28,28,0,0,1-54.83,8H72a48,48,0,0,1,0-96h96a24,24,0,0,0,0-48H72a8,8,0,0,1,0-16h96a40,40,0,0,1,0,80H72a32,32,0,0,0,0,64H173.17A28,28,0,0,1,228,200Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,170a30.05,30.05,0,0,0-29.4,24H72a34,34,0,0,1,0-68h96a38,38,0,0,0,0-76H72a6,6,0,0,0,0,12h96a26,26,0,0,1,0,52H72a46,46,0,0,0,0,92h98.6A30,30,0,1,0,200,170Zm0,48a18,18,0,1,1,18-18A18,18,0,0,1,200,218Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,168a32.06,32.06,0,0,0-31,24H72a32,32,0,0,1,0-64h96a40,40,0,0,0,0-80H72a8,8,0,0,0,0,16h96a24,24,0,0,1,0,48H72a48,48,0,0,0,0,96h97a32,32,0,1,0,31-40Zm0,48a16,16,0,1,1,16-16A16,16,0,0,1,200,216Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,172a28,28,0,0,0-27.71,24H72a36,36,0,0,1,0-72h96a36,36,0,0,0,0-72H72a4,4,0,0,0,0,8h96a28,28,0,0,1,0,56H72a44,44,0,0,0,0,88H172.29A28,28,0,1,0,200,172Zm0,48a20,20,0,1,1,20-20A20,20,0,0,1,200,220Z`}))]]),AM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),jM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),MM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),NM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),PM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z`}))]]),FM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),IM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),LM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z`}))]]),RM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z`}))]]),zM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),BM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),VM=new Map([[`bold`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),d.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,d.createElement(d.Fragment,null,d.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),HM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:gM}));HM.displayName=`ArrowRightIcon`;var UM=HM,WM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:_M}));WM.displayName=`BellIcon`;var GM=WM,KM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:vM}));KM.displayName=`BookOpenIcon`;var qM=KM,JM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:yM}));JM.displayName=`ChatCircleIcon`;var YM=JM,XM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:bM}));XM.displayName=`CheckIcon`;var ZM=XM,QM=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:xM}));QM.displayName=`CompassIcon`;var $M=QM,eN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:SM}));eN.displayName=`CopyIcon`;var tN=eN,nN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:CM}));nN.displayName=`DotsThreeIcon`;var rN=nN,iN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:wM}));iN.displayName=`GearIcon`;var aN=iN,oN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:TM}));oN.displayName=`KeyboardIcon`;var sN=oN,cN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:EM}));cN.displayName=`ListMagnifyingGlassIcon`;var lN=cN,uN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:DM}));uN.displayName=`MagnifyingGlassIcon`;var dN=uN,fN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:OM}));fN.displayName=`MoonIcon`;var pN=fN,mN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:kM}));mN.displayName=`PathIcon`;var hN=mN,gN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:AM}));gN.displayName=`PencilSimpleIcon`;var _N=gN,vN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:jM}));vN.displayName=`PlugsConnectedIcon`;var yN=vN,bN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:MM}));bN.displayName=`PlusIcon`;var xN=bN,SN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:NM}));SN.displayName=`QuestionIcon`;var CN=SN,wN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:PM}));wN.displayName=`SidebarSimpleIcon`;var TN=wN,EN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:FM}));EN.displayName=`SignOutIcon`;var DN=EN,ON=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:IM}));ON.displayName=`SparkleIcon`;var kN=ON,AN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:LM}));AN.displayName=`SquaresFourIcon`;var jN=AN,MN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:RM}));MN.displayName=`StarIcon`;var NN=MN,PN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:zM}));PN.displayName=`SunIcon`;var FN=PN,IN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:BM}));IN.displayName=`TrashIcon`;var LN=IN,RN=d.forwardRef((e,t)=>d.createElement($A,{ref:t,...e,weights:VM}));RN.displayName=`UserPlusIcon`;var zN=RN,BN=class extends Error{status;problems;code;constructor(e,t,n=[],r=``){super(e),this.status=t,this.problems=n,this.code=r}},VN=`pitot:unauthorized`,HN=`/settings/ingest`,UN=`pitot:pending-email-code`,WN=3e5,GN=3e4;function KN(e){if(typeof window<`u`)try{window.sessionStorage.setItem(UN,JSON.stringify(e))}catch{}}function qN(e=Date.now()){if(typeof window>`u`)return null;let t=null;try{t=window.sessionStorage.getItem(UN)}catch{return null}if(!t)return null;try{let n=JSON.parse(t);if(!n||typeof n!=`object`||typeof n.email!=`string`||n.email.trim()===``||typeof n.expiresAt!=`number`||!Number.isFinite(n.expiresAt)||typeof n.resendAt!=`number`||!Number.isFinite(n.resendAt)||n.expiresAt<=e)return YN(),null;let r={email:n.email.trim(),expiresAt:Math.min(n.expiresAt,e+WN),resendAt:Math.min(n.resendAt,e+GN)};return(r.email!==n.email||r.expiresAt!==n.expiresAt||r.resendAt!==n.resendAt)&&KN(r),r}catch{return YN(),null}}function JN(e,t=Date.now()){let n={email:e.trim(),expiresAt:t+WN,resendAt:t+GN};return KN(n),n}function YN(){if(typeof window<`u`)try{window.sessionStorage.removeItem(UN)}catch{}}function XN(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`&&t.pathname!==HN?``:`${t.pathname}${t.search}`}function ZN(){return XN()||(window.location.pathname===HN?HN:``)}function QN(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function $N(){YN(),window.dispatchEvent(new Event(VN))}async function eP(e,t={}){let n=new Headers(t.headers);n.set(`Pitot-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&$N(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new BN(e.message??`You do not have permission to perform this action.`,r.status,[],e.code??``)}return r}async function tP(){let e=await eP(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&$N(),window.location.assign(`/`)}var nP=[`#F1F0FF`,`#E4E2FF`,`#CDC9FF`,`#B5B0FF`,`#A29CFF`,`#8F8CFF`,`#756DEB`,`#5A50D8`,`#463DAE`,`#332B81`],rP={dark:{ground:`#0B0B0C`,raised:`#121214`,inset:`#08080A`,hover:`#1A1A1D`,border:`#232327`,borderSoft:`#1A1A1E`,controlBorder:`#828288`,text:`#EDEDEF`,muted:`#A1A1A9`},light:{ground:`#F5F5F6`,raised:`#FFFFFF`,inset:`#EFEFF1`,hover:`#EDEDEF`,border:`#E3E3E6`,borderSoft:`#ECECEE`,controlBorder:`#6D6D73`,text:`#111113`,muted:`#53535B`}},iP=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],aP=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],oP=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],sP=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],cP={micro:11,small:12,body:14,title:16,section:20,page:28},lP={display:`"Geist Mono Variable", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},uP={small:{fontSize:15,gap:12},regular:{fontSize:18,gap:14},large:{fontSize:22,gap:16}};function dP({size:e=`regular`}){let t=uP[e];return(0,R.jsxs)(um,{component:`span`,gap:t.gap,wrap:`nowrap`,"aria-label":`Pitot`,children:[(0,R.jsx)(fP,{size:e}),(0,R.jsx)(U,{component:`span`,ff:lP.body,fz:t.fontSize,fw:600,lh:1,lts:`-0.045em`,children:`pitot`})]})}function fP({size:e=`regular`}){let t={small:32,regular:46,large:50}[e];return(0,R.jsx)(q0,{size:t,variant:`transparent`,"aria-hidden":`true`,children:(0,R.jsx)(pP,{})})}function pP(){let e=Ho(`light`)===`dark`,t=rP[e?`dark`:`light`].text;return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`100%`,height:`100%`,"aria-hidden":`true`,children:(0,R.jsxs)(`g`,{fill:`none`,strokeWidth:`2.6`,strokeLinecap:`round`,children:[(0,R.jsx)(`path`,{stroke:nP[e?5:7],d:`M3.3 4.5H20.7`}),(0,R.jsx)(`path`,{stroke:t,d:`M7 9.5H16.5`}),(0,R.jsx)(`path`,{stroke:t,d:`M7 14.5H11.5`}),(0,R.jsx)(`path`,{stroke:e?`#4A4A52`:`#B4B4BB`,d:`M10.5 19.5H17`})]})})}var mP={home:`https://pitot.dev/docs`,ingest:`https://pitot.dev/docs/get-started/send-telemetry`,connect:`https://pitot.dev/docs/guides/mcp`,authentication:`https://pitot.dev/docs/concepts/authentication`},hP=(0,d.createContext)(null);function gP(){let e=(0,d.useContext)(hP);if(!e)throw Error(`Pitot runtime status is unavailable`);return e}var _P=(0,d.createContext)(null);function vP(){let e=(0,d.useContext)(_P);if(!e)throw Error(`Pitot viewer is unavailable`);return e}function yP(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function bP(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??`Request failed (${n.status})`);return r}function xP(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function SP(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function CP({children:e}){let t=xr(),[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(`none`),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(xP),[h,g]=(0,d.useState)(SP),[_]=(0,d.useState)(()=>xP()||SP()?(YN(),null):qN()),[v,y]=(0,d.useState)(()=>_?.email??``),[b,x]=(0,d.useState)(``),[S,C]=(0,d.useState)(``),[w,T]=(0,d.useState)(()=>_!==null),[E,D]=(0,d.useState)(()=>_?.expiresAt??0),[O,k]=(0,d.useState)(()=>_?.resendAt??0),[A,j]=(0,d.useState)(()=>Date.now()),[M,N]=(0,d.useState)(null),[P,F]=(0,d.useState)(!1),[ee,I]=(0,d.useState)(``),[te,ne]=(0,d.useState)(null),[re,ie]=(0,d.useState)(!1),ae=(0,d.useRef)(null),oe=(0,d.useRef)(0),se=XN(),ce=o===`user`;function le(e=!1,t=!0){t&&(oe.current+=1),YN(),T(!1),C(``),D(0),k(0),e&&y(``)}async function ue(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null),n=QN(t);n===`user`&&le(!0),s(n),l(yP(t))}async function de(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(yP(await e.json().catch(()=>null)))}catch{}}(0,d.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,d.useEffect)(()=>{bP(`/api/auth/status`).then(e=>{let t=e;(t.setup_required||t.auth_mode===`oidc`||!t.smtp_configured)&&le(!0),r(t)}).catch(e=>{k(0),I(String(e))}).finally(()=>a(!0)),ue().catch(()=>s(`none`)).finally(()=>f(!0));let e=()=>{le(),s(`none`),l(null)};return window.addEventListener(VN,e),()=>window.removeEventListener(VN,e)},[]),(0,d.useEffect)(()=>{u&&o===`none`&&h&&(le(!0),F(!0),I(``),bP(`/api/auth/link/verify`,{token:h}).then(()=>{s(`user`),de()}).catch(e=>I(e instanceof Error?e.message:String(e))).finally(()=>{g(``),F(!1)}))},[h,u,o]),(0,d.useEffect)(()=>{ce&&u&&se&&window.location.replace(se)},[ce,se,u]),(0,d.useEffect)(()=>{if(!w)return;let e=()=>{M!==`resend`&&le(!1,!1)},t=()=>{let t=Date.now();E>0&&E<=t?e():j(t)},n=Date.now();if(E>0&&E<=n){e();return}O>0&&O<=n&&j(e=>en&&(r=setInterval(()=>{let t=Date.now();E>0&&t>=E?(r!==null&&clearInterval(r),e()):(j(t),t>=O&&r!==null&&clearInterval(r))},1e3)),window.addEventListener(`focus`,t),document.addEventListener(`visibilitychange`,t),()=>{r!==null&&clearInterval(r),window.removeEventListener(`focus`,t),document.removeEventListener(`visibilitychange`,t)}},[w,E,O,M]);let fe=Math.max(0,Math.ceil((O-A)/1e3));async function pe(e){try{await navigator.clipboard.writeText(e),ie(!0)}catch{I(`Clipboard access failed. Select and copy the token manually.`)}}if(te?.ingest_token)return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(fP,{}),footer:(0,R.jsx)(bg,{href:mP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),size:`lg`,children:(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsx)(Hj,{eyebrow:`Setup complete`,title:`Save your ingest token`}),(0,R.jsx)(U,{c:`dimmed`,children:`Pitot shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(U0,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(R_,{block:!0,children:te.suggested_endpoint??window.location.origin})]}),(0,R.jsxs)(U0,{gap:`xs`,children:[(0,R.jsx)(U,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(R_,{block:!0,children:[te.ingest_header_name??`Authorization`,`: Bearer `,te.ingest_token]})]}),ee&&(0,R.jsx)(Mj,{tone:`danger`,children:ee}),(0,R.jsxs)(um,{grow:!0,align:`stretch`,children:[(0,R.jsx)(N_,{variant:`light`,radius:`md`,leftSection:re?(0,R.jsx)(ZM,{size:16,weight:`bold`}):(0,R.jsx)(tN,{size:16}),onClick:()=>void pe(`${te.ingest_header_name??`Authorization`}: Bearer ${te.ingest_token}`),children:re?`Copied`:`Copy header`}),(0,R.jsx)(N_,{radius:`md`,rightSection:(0,R.jsx)(UM,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ne(null),de()},children:`Continue to Pitot`})]}),(0,R.jsx)(N_,{variant:`subtle`,size:`compact-xs`,onClick:()=>void pe(te.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||h)return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(fP,{}),footer:(0,R.jsx)(bg,{href:mP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsx)(Fj,{state:`loading`,loadingLabel:`Loading sign-in`,rows:4})});if(!n)return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(fP,{}),footer:(0,R.jsx)(bg,{href:mP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsxs)(U0,{gap:`lg`,children:[(0,R.jsx)(Hj,{title:`Pitot is unavailable`}),(0,R.jsx)(Mj,{tone:`danger`,children:ee||`Authentication status could not be loaded.`})]})});if(ce&&se)return null;if(ce)return(0,R.jsx)(hP.Provider,{value:n,children:(0,R.jsx)(_P.Provider,{value:c??{id:``,email:v,display_name:b,status:`active`,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=ZN(),t=e?`/api/auth/oidc/start?return_to=${encodeURIComponent(e)}`:`/api/auth/oidc/start`;return(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(fP,{}),footer:(0,R.jsx)(bg,{href:mP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsxs)(U0,{gap:28,children:[(0,R.jsx)(Hj,{title:`Sign in to Pitot`,description:`Use your organization’s identity provider to continue.`}),ee&&(0,R.jsx)(Mj,{tone:`danger`,children:ee}),(0,R.jsx)(N_,{component:`a`,href:t,size:`md`,radius:`md`,rightSection:(0,R.jsx)(UM,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function L(){if(P||!n?.smtp_configured||w&&fe>0)return;let e=oe.current;F(!0),N(w?`resend`:`send`),I(``);try{if(await bP(`/api/auth/code/send`,{email:v}),oe.current!==e)return;let t=Date.now(),n=JN(v,t);y(n.email),T(!0),C(``),D(n.expiresAt),k(n.resendAt),j(t)}catch(t){if(oe.current!==e)return;I(t instanceof Error?t.message:String(t))}finally{F(!1),N(null)}}async function me(e){if(!(P||e.length!==6)){F(!0),N(`verify`),I(``);try{await bP(`/api/auth/code/verify`,{email:v,code:e}),s(`user`),le(),de()}catch(e){C(``),I(e instanceof Error?e.message:String(e))}finally{F(!1),N(null)}}}function he(){le(),I(``)}async function ge(e){e.preventDefault(),F(!0),I(``);try{let e=await bP(`/api/auth/setup`,{email:v,display_name:b,setup_token:p});YN(),e.ingest_token?ne(e):(s(`user`),de())}catch(e){I(e instanceof Error?e.message:String(e))}finally{F(!1)}}return n.setup_required?(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(fP,{}),footer:(0,R.jsx)(bg,{href:mP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsxs)(U0,{gap:28,children:[(0,R.jsx)(Hj,{eyebrow:`One-time setup`,title:`Create the first admin`,description:`Use the one-time token printed by the Pitot process.`}),(0,R.jsx)(`form`,{onSubmit:ge,children:(0,R.jsxs)(U0,{gap:`md`,children:[(0,R.jsx)(W0,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:v,onChange:e=>y(e.currentTarget.value),autoFocus:!0}),(0,R.jsx)(W0,{label:`Display name`,placeholder:`Your display name`,value:b,onChange:e=>x(e.currentTarget.value)}),(0,R.jsx)(W0,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:p,onChange:e=>m(e.currentTarget.value),autoComplete:`one-time-code`}),ee&&(0,R.jsx)(Mj,{tone:`danger`,children:ee}),(0,R.jsx)(N_,{type:`submit`,loading:P,leftSection:(0,R.jsx)(zN,{size:17,weight:`bold`}),children:`Create admin`})]})})]})}):(0,R.jsx)(Cj,{surface:`plain`,brand:(0,R.jsx)(fP,{}),footer:(0,R.jsx)(bg,{href:mP.home,size:`xs`,target:`_blank`,rel:`noopener noreferrer`,children:`Docs`}),children:(0,R.jsx)(`fieldset`,{disabled:!n.smtp_configured,style:{border:0,padding:0,margin:0,minWidth:0},children:(0,R.jsx)(Bj,{step:w?`code`:`email`,title:`Sign in to Pitot`,description:n.smtp_configured?n.self_signup?`We'll email you a 6-digit code. New here? This creates your account.`:`We'll email you a 6-digit code.`:`Email delivery is not configured. Ask the operator to run pitot login-link with your email address.`,email:v,onEmailChange:y,inputRef:ae,onSendCode:()=>{ae.current?.reportValidity()&&L()},code:S,onCodeChange:C,onVerify:e=>void me(e),onChangeEmail:he,onResend:()=>void L(),resendIn:fe,pending:M,error:ee||void 0,stepLabels:!1,expiresInMinutes:5,codeNote:(0,R.jsx)(U,{size:`xs`,c:`dimmed`,children:`Codes expire in 5 minutes. Check your spam folder if the email hasn’t arrived.`}),labels:{continue:`Continue with email`,verify:`Verify code`,resend:`Resend code`,changeEmail:`Change email`,codeSent:()=>(0,R.jsxs)(R.Fragment,{children:[`Enter the code sent to `,(0,R.jsx)(U,{span:!0,inherit:!0,fw:700,children:v}),`.`]}),resendIn:e=>`Resend in ${e}`}})})})}var wP=[`agent-threads`];async function TP(e){let t=await eP(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var EP=new Set([`create_dashboard`,`edit_dashboard`,`replace_dashboard`,`restore_dashboard_version`]);function DP(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function OP(e){if(typeof e==`string`)try{let t=JSON.parse(e);if(DP(t))return t}catch{}}var kP=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),AP=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function jP(e){return DP(e)&&typeof e.id==`string`&&[`ok`,`empty`,`error`,`invalid`,`not_run`,`partial`,`stale`].includes(String(e.status))&&(e.rows===void 0||AP(e.rows))&&(e.elapsed_ms===void 0||AP(e.elapsed_ms))&&(e.diagnosis===void 0||typeof e.diagnosis==`string`)&&(e.error===void 0||typeof e.error==`string`)}function MP(e){if(!DP(e)||!Number.isInteger(e.base_version)||Number(e.base_version)<0||!Number.isInteger(e.version)||Number(e.version)<1||!Array.isArray(e.changes)||typeof e.layout_changed!=`boolean`||e.dashboard_fields!==void 0&&!kP(e.dashboard_fields)||!e.changes.every(e=>DP(e)&&typeof e.panel_id==`string`&&typeof e.title==`string`&&[`added`,`changed`,`removed`].includes(String(e.kind))&&(e.fields===void 0||kP(e.fields)&&!e.fields.includes(`grid`))&&(e.position_changed===void 0||typeof e.position_changed==`boolean`)))return!1;let t=e.save_check;return DP(t)&&typeof t.checked==`boolean`&&AP(t.elapsed_ms)&&Array.isArray(t.panels)&&t.panels.every(e=>jP(e)&&Number.isInteger(e.rows)&&Number(e.rows)>=0)&&new Set(t.panels.map(e=>e.id)).size===t.panels.length&&(t.reason===void 0||typeof t.reason==`string`)&&(!t.checked||t.panels.every(e=>e.status!==`not_run`))}function NP(e,t,n){let r=-1;n.forEach((n,i)=>{n.role===`tool`&&n.toolCallId===e&&n.content===t&&(r=i)});let i=r<0?n.length:r,a=-1;if(n.slice(0,i).forEach((e,t)=>{e.role===`user`&&(a=t)}),a<0)return null;let o=n.slice(a+1,i).flatMap(e=>e.role===`assistant`?e.toolCalls??[]:[]).filter(t=>t.id===e),s=o.length===1?o[0].function.name:void 0;if(!s||!EP.has(s))return null;let c=OP(t),l=c?.dashboard,u=c?.receipt;return!c||c.error||c.isError||!DP(l)||typeof l.id!=`string`||!l.id||typeof l.name!=`string`||!l.name||!MP(u)||l.version!==u.version||r>=0&&n[r].error?null:{id:l.id,name:l.name,version:u.version,label:s===`create_dashboard`?`Created`:s===`restore_dashboard_version`?`Restored`:`Updated`,receipt:u}}var PP={viz:`chart type`,sql:`SQL`,content:`text`,x_unit:`x-axis unit`,options:`display options`,drill:`drill-down`,click:`click action`,time:`time range`,annotations:`markers`,better:`better direction`,reduce:`summary`,min:`minimum`,max:`maximum`},FP=e=>Object.hasOwn(PP,e)?PP[e]:e.replaceAll(`_`,` `),IP=e=>e.kind===`added`?`+ ${e.title}`:e.kind===`removed`?`− ${e.title}`:`~ ${e.title}${e.fields?.length?`: `+e.fields.map(FP).join(`, `):``}${e.position_changed?` · moved`:``}`;function LP(e){return[...e.changes.map(IP),...e.layout_changed?[`Layout adjusted`]:[],...e.dashboard_fields?.map(e=>`Dashboard: ${FP(e)}`)??[]]}function RP(e,t,n){return e.filter(e=>n.has(e.panel_id)&&!t.some(t=>t.panel_id===e.panel_id&&t.path===e.path))}var zP={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},BP=new Set([`get_insights`,`query_telemetry`,`get_overview`,`get_service_topology`,`get_service_dependencies`,`get_service_performance`,`inspect_trace`,`search_logs`]),VP=(e,t)=>Array.isArray(e)?e.flatMap(e=>DP(e)&&typeof e.path==`string`&&typeof e.message==`string`?[{panel_id:t,path:e.path,message:e.message}]:[]):[],HP=e=>{let t=OP(e)?.error;return DP(t)?t.code:void 0},UP=e=>e.role===`tool`&&HP(e.content)===`interrupted`,WP=e=>![`invalid`,`not_run`].includes(e.status);function GP(e,t){let n=e.findIndex(e=>e.id===t&&e.role===`user`);if(n<0)return null;let r=e.findIndex((e,t)=>t>n&&e.role===`user`),i=e.slice(n+1,r<0?void 0:r),a=new Set(i.flatMap(e=>e.role===`tool`&&HP(e.content)===`answer_only`?[e.toolCallId]:[])),o=i.flatMap((e,t)=>e.role===`assistant`?(e.toolCalls??[]).map(e=>({call:e,index:t})):[]).filter(({call:e})=>!a.has(e.id));if(!o.some(({call:e})=>EP.has(e.function.name)||e.function.name===`preview_panels`))return null;let s={schema:{state:`unobserved`},context:{state:`unobserved`},draft:{state:`unobserved`},validation:{state:`unobserved`},preview:{state:`unobserved`},save:{state:`unobserved`}},c={turn_id:t,stages:s,panel_titles:{},panels:[],problems:[],corrections:[],save_attempts:[],explanations:[],context_counts:{deploys:0,anomalies:0}},l=new Map,u=new Map;for(let{call:e}of o)l.set(e.id,(l.get(e.id)??0)+1);i.forEach((e,t)=>{if(e.role===`tool`){let n=u.get(e.toolCallId)??[];n.push({index:t,message:e}),u.set(e.toolCallId,n)}});let d=new Map,f=new Map,p=[],m,h=!1,g=!1,_=(e,t)=>{for(let n of RP(y.get(e)??[],t,new Set([e])))p.some(e=>e.panel_id===n.panel_id&&e.path===n.path)||p.push(n);y.set(e,t)},v=new Map,y=new Map,b=new Set,x=!1,S=!1;for(let{call:t,index:n}of o){if(l.get(t.id)!==1)continue;let r=t.function.name,i=OP(t.function.arguments),a=(u.get(t.id)??[]).filter(e=>e.index>n),o=a.length===1||EP.has(r)&&a.length>1&&a.slice(0,-1).every(e=>UP(e.message))?a.at(-1).message:void 0,C=o&&OP(o.content),w=!!C&&o?.role===`tool`&&!o.error&&!C.error&&!C.isError,T=o?w?`complete`:`failed`:`incomplete`;if(r===`get_telemetry_schema`&&(s.schema={state:T}),BP.has(r)){let e=o?.role===`tool`&&!o.error&&!C?.error&&!C?.isError&&typeof o.content==`string`&&o.content.length>0;if(s.context={state:o?e?`complete`:`failed`:`incomplete`},w)for(let[e,t]of[[`deploys`,[`deploys`,`deployments`]],[`anomalies`,[`anomalies`]]])for(let n of t)Array.isArray(C[n])&&(c.context_counts[e]+=C[n].length)}if(r===`preview_panels`||r===`create_dashboard`||r===`replace_dashboard`){let e=r===`preview_panels`?i?.panels:DP(i?.dashboard)?i.dashboard.panels:void 0;if(Array.isArray(e)){c.panel_count=e.length,s.draft={state:`complete`};for(let t of e)DP(t)&&typeof t.id==`string`&&typeof t.title==`string`&&t.title.trim()&&f.set(t.id,t.title)}}if(r===`preview_panels`){x=!0;let e=Array.isArray(i?.panels)?i.panels.flatMap(e=>DP(e)&&typeof e.id==`string`?[e.id]:[]):[];for(let t of e)v.set(t,{id:t,status:`not_run`});let t=w&&Array.isArray(C.panels)&&C.panels.every(jP)?C.panels:void 0,n=typeof C?.elapsed_ms==`number`&&C.elapsed_ms>=0?C.elapsed_ms:void 0;if(s.validation={state:t?t.some(e=>e.status===`invalid`||e.status===`not_run`)||VP(C?.problems,`dashboard`).length?`failed`:`complete`:T===`complete`?`failed`:T},s.preview={state:t?t.every(WP)?`complete`:`incomplete`:T===`complete`?`failed`:T,elapsed_ms:n},!t||e.length===0||t.length!==e.length||new Set(t.map(e=>e.id)).size!==e.length||t.some(t=>!e.includes(t.id))){S=e.length===0;for(let t of e)o&&b.add(t);continue}S=!1;for(let t of e)b.delete(t);for(let e of t){let t=VP(e.problems,e.id);if(e.status!==`not_run`)_(e.id,t);else{let n=y.get(e.id)??[];y.set(e.id,[...n,...t.filter(e=>!n.some(t=>t.path===e.path))])}v.set(e.id,e)}c.problems=[...y.values()].flat().concat(VP(C?.problems,`dashboard`))}if(EP.has(r)){let n=o&&NP(t.id,o.content,e),r=!!o&&UP(o),i=!r&&o?.role===`tool`&&(!!o.error||!!C?.error||!!C?.isError);if(g=!!i,h=!!o&&!n&&!i&&!r,s.save={state:n?`complete`:r?`interrupted`:i?`failed`:`incomplete`},n)for(let e of c.save_attempts)e.state===`failed`&&(e.state=`retried`);if(c.save_attempts.push({call_id:t.id,state:s.save.state}),n){m?.id!==n.id&&(m=n,d.clear());for(let e of n.receipt.changes){e.title.trim()&&f.set(e.panel_id,e.title);let t=d.get(e.panel_id);t?.kind===`added`&&e.kind===`removed`?d.delete(e.panel_id):t?.kind===`added`?d.set(e.panel_id,{panel_id:e.panel_id,title:e.title,kind:`added`}):e.kind===`removed`?d.set(e.panel_id,e):t&&e.kind===`changed`?d.set(e.panel_id,{...e,fields:[...new Set([...t.fields??[],...e.fields??[]])].sort(),position_changed:t.position_changed||e.position_changed}):d.set(e.panel_id,t?.kind===`removed`&&e.kind===`added`?{...e,kind:`changed`}:e)}let e=C?.dashboard,t=DP(e)?e.spec:void 0;if(DP(t)&&Array.isArray(t.panels))for(let e of t.panels)DP(e)&&typeof e.id==`string`&&typeof e.title==`string`&&e.title.trim()&&f.set(e.id,e.title);let r=c.saved?.id===n.id?c.saved.receipt:void 0;c.saved={...n,label:m.label,receipt:{...n.receipt,base_version:m.receipt.base_version,changes:[...d.values()],layout_changed:m.receipt.base_version!==0&&(n.receipt.layout_changed||!!r?.layout_changed),dashboard_fields:m.receipt.base_version===0?void 0:[...new Set([...r?.dashboard_fields??[],...n.receipt.dashboard_fields??[]])].sort()}},c.panel_count=n.receipt.save_check.panels.length,s.draft={state:`complete`};let i=new Set(n.receipt.save_check.panels.map(e=>e.id));for(let e of n.receipt.save_check.panels)e.status===`invalid`?_(e.id,VP(e.problems,e.id)):WP(e)&&(_(e.id,[]),b.delete(e.id));p=p.filter(e=>i.has(e.panel_id)),c.problems=[...y.values()].flat().filter(e=>i.has(e.panel_id))}}}if(h)return null;c.panel_titles=Object.fromEntries(f),c.corrections=p.map(e=>({...e,title:f.get(e.panel_id)??e.panel_id}));let C=c.saved?new Set(c.saved.receipt.save_check.panels.map(e=>e.id)):void 0;if(c.panels=[...v.values()].filter(e=>!C||C.has(e.id)),x){let e=S||[...b].some(e=>!C||C.has(e)),t=c.panels.some(e=>e.status===`not_run`),n=c.problems.length>0;s.validation.state=e||n?`failed`:t?`incomplete`:`complete`,s.preview.state=e?`failed`:t||n||c.panels.some(e=>e.status===`invalid`)?`incomplete`:`complete`}let w=c.saved?.receipt.save_check;w&&!w.checked&&c.explanations.push(`Save check incomplete: ${w.reason||`Panels were not checked`}`);for(let e of w?.panels??c.panels)e.status!==`ok`&&c.explanations.push(`${f.get(e.id)??e.id}: ${e.status}${e.error||e.diagnosis?` — ${e.error||e.diagnosis}`:``}`);for(let e of c.problems)c.explanations.push(`${f.get(e.panel_id)??e.panel_id}: ${e.message}`);let T=Object.entries(s).filter(([,e])=>e.state===`incomplete`||e.state===`failed`).map(([e,t])=>`${zP[e]}: ${t.state}`);return T.length&&c.explanations.push(T.join(` · `)),s.save.state===`interrupted`&&c.explanations.push(`Save interrupted · outcome unknown`),g&&c.explanations.push(c.saved?`A later change failed; v${c.saved.version} remains saved`:`Save failed · dashboard was not saved`),c}var KP=(0,d.createContext)(null);function qP(){let e=(0,d.useContext)(KP);if(!e)throw Error(`Pitot app context is unavailable`);return e}var JP=`Build me a dashboard for my services, showing request volume, latency, and errors. Ask me which services to monitor first.`,YP={query_telemetry:{activity:`Querying telemetry…`,title:`Telemetry panels`},get_overview:{activity:`Checking system health…`,title:`System health`},get_service_topology:{activity:`Mapping service dependencies…`,title:`Service map`},get_service_dependencies:{activity:`Tracing service dependencies…`,title:`Service dependencies`},list_panel_exemplars:{activity:`Finding example traces…`,title:`Example traces`},resolve_panel_variables:{activity:`Reading filter choices…`,title:`Filter choices`},query_panel_fragment:{activity:`Refreshing panels…`,title:`Panel refresh`},get_service_performance:{activity:`Reading performance signals…`,title:`Performance`},inspect_trace:{activity:`Inspecting a trace…`,title:`Trace lookup`},search_logs:{activity:`Searching logs…`,title:`Logs`},get_insights:{activity:`Reviewing detected anomalies…`,title:`Detected anomalies`},get_telemetry_schema:{activity:`Reading what telemetry exists…`,title:`Telemetry discovery`},preview_panels:{activity:`Checking dashboard panels…`,title:`Panel check`},list_dashboards:{activity:`Looking through your dashboards…`,title:`Dashboards`},get_dashboard:{activity:`Opening your dashboard…`,title:`Dashboard`},create_dashboard:{activity:`Building your dashboard…`,title:`Dashboard save`},edit_dashboard:{activity:`Updating your dashboard…`,title:`Dashboard save`},replace_dashboard:{activity:`Redesigning your dashboard…`,title:`Dashboard save`},list_dashboard_versions:{activity:`Reading your dashboard history…`,title:`Dashboard history`},restore_dashboard_version:{activity:`Restoring your dashboard…`,title:`Dashboard`}};function XP(e){return YP[e]?.activity??`Working on it…`}function ZP(e){return YP[e]?.title??`Analysis step`}function QP(e){switch(e){case`provider_unavailable`:return`Pitot could not reach the model provider. Please try again.`;case`step_limit`:return`Pitot reached its step limit before finishing. Try a narrower question.`;case`time_limit`:return`Pitot reached its 5-minute time limit. Try a smaller request.`;default:return`Pitot could not complete this analysis. Please try again.`}}function $P(e){let t=(0,d.useRef)(new Map);return(0,d.useMemo)(()=>{let n=new Map,r=new Set,i=e.flatMap((e,t)=>e.role===`user`?[t]:[]);i.forEach((a,o)=>{let s=i[o+1]??e.length,c=e[a],l=e[s-1];r.add(c.id);let u=t.current.get(c.id),d=u&&u.last===l&&u.length===s-a?u.receipt:GP(e.slice(a,s),c.id);oe.msecs?(e.seq=cF(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function sF(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=cF(e),r[i++]=t/0x10000000000&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function cF(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function lF(){return aF()}var uF=[`dashboards`],dF=e=>[`dashboard`,e],fF=e=>[`dashboard-versions`,e],pF=3e4;async function mF(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await eP(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw hF(o,s);return s}var hF=(e,t)=>new BN(t.message??`Request failed (${e.status})`,e.status,t.problems??[],t.code??``),gF=e=>`/api/dashboards/${encodeURIComponent(e)}`,_F=()=>mF(`/api/dashboards`).then(e=>e.dashboards),vF=(e,t)=>mF(gF(e),{signal:t}),yF=(e,t)=>mF(`${gF(e)}/versions`,{signal:t}).then(e=>e.versions),bF=(e,t,n)=>mF(`${gF(e)}/versions/${t}`,{signal:n}),xF=(e,t)=>mF(`${gF(e)}/versions/${t}/restore`,{method:`POST`}),SF=(e,t,n,r)=>mF(gF(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),CF=(e,t,n,r)=>mF(gF(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}});async function wF(e,t,n,r=!1){let i=r?{"cache-control":`no-cache`}:{};if(!n)return mF(`/api/queries/run`,{method:`POST`,headers:i,json:e,signal:t}).then(e=>e.results);let a=await eP(`/api/queries/run`,{method:`POST`,headers:{...i,"content-type":`application/json`,accept:`application/x-ndjson`},body:JSON.stringify(e),signal:t});if(!a.ok)throw hF(a,await a.json().catch(()=>({})));let o=[],s=a.body.pipeThrough(new TextDecoderStream).getReader(),c=``;try{for(;;){let{done:e,value:t}=await s.read();c+=t??``;let r;for(;(r=c.indexOf(` +`))>=0;){let e=c.slice(0,r);if(c=c.slice(r+1),!e.trim())continue;let t=JSON.parse(e);o.push(t),n(t)}if(e)return o}}catch(e){throw s.cancel().catch(()=>{}),e}}var TF=e=>mF(`/api/dashboards`,{method:`POST`,json:{spec:e}}),EF=e=>mF(`/api/telemetry/schema`,{signal:e}),DF=XA({queryKey:[`telemetry-schema`],queryFn:({signal:e})=>EF(e),staleTime:6e4,retry:!1}),OF=(e,t)=>mF(`/api/annotations/query`,{method:`POST`,json:e,signal:t}),kF=(e,t)=>mF(`/api/queries/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),AF=(e,t)=>mF(`/api/queries/exemplars`,{method:`POST`,json:e,signal:t});function jF(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`500`});return mF(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function MF(){let{setColorScheme:e}=zo(),t=Ho(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,d.useState)(!1);return(0,R.jsx)(F0,{label:`Switch to ${n} theme`,opened:r,children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,R.jsx)(FN,{size:17,weight:`bold`}):(0,R.jsx)(pN,{size:17,weight:`bold`})})})}function NF(){let e=(0,d.useRef)(null);return(0,d.useRef)({remember(t){e.current=t instanceof HTMLElement?t:null},restore(t){let n=e.current;requestAnimationFrame(()=>(n?.isConnected?n:t)?.focus())}}).current}var PF=`pitot:shortcuts`,FF=0,IF=new Set,LF=()=>{for(let e of IF)e()};function RF(e){(0,d.useEffect)(()=>(window.addEventListener(PF,e),FF+=1,LF(),()=>{window.removeEventListener(PF,e),--FF,LF()}),[e])}function zF(){return(0,d.useSyncExternalStore)(e=>(IF.add(e),()=>IF.delete(e)),()=>FF>0,()=>!1)}function BF(){let e=zF(),t=(0,d.useRef)(null);return(0,R.jsxs)(X1,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(F0,{label:`Help`,children:(0,R.jsx)(em,{ref:t,variant:`subtle`,color:`gray`,"aria-label":`Help`,children:(0,R.jsx)(CN,{size:18,weight:`bold`})})})}),(0,R.jsxs)(X1.Dropdown,{children:[(0,R.jsx)(X1.Item,{component:`a`,href:mP.home,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(qM,{size:15}),children:`Documentation`}),e&&(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(sN,{size:15}),rightSection:(0,R.jsx)(d1,{size:`xs`,children:`?`}),onClick:()=>{t.current?.focus(),window.dispatchEvent(new Event(PF))},children:`Keyboard shortcuts`})]})]})}var VF=[`alerting`,`rules`],HF=[`alerting`,`alerts`],UF=[`alerting`,`email`],WF=e=>`/api/alerting/rules/${encodeURIComponent(e)}`,GF=e=>mF(`/api/alerting/rules`,{signal:e}).then(e=>e.rules),KF=e=>mF(`/api/alerting/alerts`,{signal:e}).then(e=>e.alerts),qF=e=>mF(`/api/alerting/email`,{signal:e}),JF=e=>mF(`/api/alerting/rules`,{method:`POST`,json:e}),YF=(e,t)=>mF(WF(e),{method:`PUT`,json:t}),XF=e=>mF(WF(e),{method:`DELETE`}),ZF=e=>mF(`/api/telemetry/schema?window=1h`,{signal:e}).then(e=>(e.services??[]).map(e=>e.value)),QF={queryKey:[`services`,`1h`],queryFn:({signal:e})=>ZF(e)},$F=e=>mF(`${WF(e)}/test`,{method:`POST`}),eI=(e,t)=>`${e} ${t}${e===1?``:`s`}`,tI=(e,t)=>String(Number(e.toFixed(t))),nI=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function rI(e){return Number.isFinite(e)?e>0&&e<1e-4?`<0.01%`:`${(e*100).toFixed(e>=.1?1:2)}%`:`—`}function iI(e){if(!Number.isFinite(e))return`—`;if(e<0)return`-${iI(-e)}`;if(e===0)return`0 ms`;if(e<.01)return`<0.01 ms`;if(e<1)return`${tI(e,2)} ms`;if(Math.round(e*10)/10<100)return`${tI(e,1)} ms`;if(Math.round(e)<1e3)return`${Math.round(e)} ms`;let t=Math.round(e/100)/10;if(t<10)return`${tI(e/1e3,2)} s`;if(t<60)return`${tI(t,1)} s`;let n=Math.round(e/1e3),r=Math.floor(n/60),i=n%60;if(r<60)return i===0?`${r} m`:`${r} m ${i} s`;let a=Math.floor(r/60),o=r%60;return o===0?`${a} h`:`${a} h ${o} m`}function aI(e){let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toLocaleString([],{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,second:`2-digit`,timeZoneName:`short`})}var oI=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),sI=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function cI(e){return Math.abs(e)<1e-4?e.toExponential(2).replace(/\.?(0+)(?=e)/,``):String(Number(e.toPrecision(3)))}function lI(e,t=sI){return e!==0&&Math.abs(e)<1?cI(e):t.format(e)}function uI(e,t){let n=t===`s`?e*1e3:t===`ns`?e/1e6:e;return e!==0&&n===0?`${cI(e)} ${t}`:n!==0&&Math.abs(n)<1?`${cI(n)} ms`:iI(n)}var dI=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function fI(e){let t=e,n=0;for(;Math.abs(t)>=1024&&n=1e4?oI:sI)}}var mI={ms:1,s:1e3,ns:1e-6},hI=[[36e5,`h`],[6e4,`m`],[1e3,`s`],[1,`ms`]];function gI(e,t){let n=e===void 0?void 0:mI[e];if(e===`bytes`&&t&&t.interval>0){let e=Math.max(Math.abs(t.min),Math.abs(t.max)),n=[4,3,2,1].find(n=>e>=1024**n&&Math.abs(t.interval/1024**n*100-Math.round(t.interval/1024**n*100))<1e-6)??0;return e=>Number.isFinite(e)?`${lI(e/1024**n)} ${dI[n]}`:`—`}if(e===`percent`&&t&&t.interval>0){let e=[0,1,2,3,4].find(e=>{let n=t.interval*10**e;return Math.round(n)!==0&&Math.abs(n-Math.round(n))<1e-6*Math.abs(n)});if(e!==void 0){let t=new Intl.NumberFormat(`en`,{minimumFractionDigits:e,maximumFractionDigits:e});return e=>Number.isFinite(e)?`${t.format(e)}%`:`—`}}if(n!==void 0&&t&&t.interval>0){let e=Math.max(Math.abs(t.min),Math.abs(t.max))*n,r=t.interval*n,[i,a]=hI.find(([t])=>e>=t&&Math.abs(r/t*100-Math.round(r/t*100))<1e-6)??[1,`ms`];return e=>Number.isFinite(e)?`${lI(e*n/i)} ${a}`:`—`}return t=>(!e||e===`count`)&&Math.abs(t)>=1e3?lI(t,oI):e===`ms`||e===`s`||e===`ns`?pI(e,t).replace(/(\.\d*?)0+([a-z]*)$/,`$1$2`).replace(/\.([a-z]*)$/,`$1`):pI(e,t)}function _I(e){return e!==void 0&&e!==`count`&&/[^\d\s]$/.test(gI(e)(1).trim())}function vI(e,t,n){return gI(e,n)(t??NaN).replace(/(?<=\d)(ms|ns|s|m|h)\b/g,` $1`)}function yI(e){return Math.max(3,Math.min(10,Math.round(e/70)))-1}function bI(e,t){let n=t===`ms`?1:t===`s`?1e3:t===`ns`?1e-6:void 0,r=e=>{let t=10**Math.floor(Math.log10(e));return[1,2,5,10].map(e=>e*t).find(t=>t>=e)};if(t===`bytes`){let t=Math.min(4,Math.max(0,Math.floor(Math.log(e)/Math.log(1024)))),n=r(Math.max(e/1024**t,+(t===0)));return(n>=1e3&&t<4?1024:n)*1024**t}if(n===void 0)return r(e);let i=e*n,a=[1,10,100,1e3,1e4,6e4,6e5,36e5,36e6].flatMap(e=>[1,2,5].map(t=>e*t)).sort((e,t)=>e-t);return(i<1?r(i):a.find(e=>e>=i)??r(i/36e5)*36e5)/n}function xI(e,t,n,r){e=Number.isFinite(e)?Math.min(0,e):0,t=Number.isFinite(t)?Math.max(0,t):1,t===e&&(t=e+1);let i=yI(r),a=bI(Math.max(t-e,2**-52)/i,n);for(let r=0;r<64&&Math.ceil(t/a)-Math.floor(e/a)>i;r++)a=bI(a*1.01,n);return{min:Math.floor(e/a)*a,max:Math.ceil(t/a)*a,interval:a,splitNumber:i,pitot_unit:n}}function SI(e,t){if(e.type!==`value`&&e.type!==`log`)return e;if(e.type!==`value`||typeof e.min!=`number`||typeof e.max!=`number`)return{...e,splitNumber:yI(t)};let n=typeof e.pitot_unit==`string`?e.pitot_unit:void 0,r=xI(e.min,e.max,n,t);return{...e,...r,...n&&(n in mI||n===`bytes`||n===`percent`)?{axisLabel:{...e.axisLabel,formatter:gI(n,r)}}:{}}}function CI(e,t,n){let r=e=>pI(n,e),i=``;if(n===`ms`||n===`s`||n===`ns`){let a=n===`s`?1e3:n===`ns`?1e-6:1,o=Math.abs((e??t??0)*a),s=o>=6e4?6e4:o>=1e3?1e3:1;i=s===6e4?` min`:s===1e3?` s`:` ms`;let c=s===6e4?1:s===1e3?+(o<1e4):2,l=new Intl.NumberFormat(void 0,{maximumFractionDigits:c});r=e=>l.format(e*a/s)}return t===null&&e!==null?`≥${r(e)}${i}`:(e===null||e===0)&&t!==null?`<${r(t)}${i}`:`${e===null?`−∞`:r(e)}–${t===null?`∞`:r(t)}${i}`}function wI(e){let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0?t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}):t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}function TI(e,t=new Date,n){let r=new Date(e);if(!Number.isFinite(r.getTime()))return`—`;let i=new Intl.DateTimeFormat(n,{month:`short`,day:`numeric`,...r.getFullYear()===t.getFullYear()?{}:{year:`numeric`},hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(r),a=i.filter(e=>[`month`,`day`,`year`].includes(e.type)).map(e=>e.value),o=i.filter(e=>[`hour`,`minute`,`second`].includes(e.type)).map(e=>e.value);return`${a.join(` `)} ${o.join(`:`)}`}var EI=[{path:`/explore`,label:`Explore`,Icon:$M},{path:`/logs`,label:`Logs`,Icon:lN},{path:`/traces`,label:`Traces`,Icon:hN},{path:`/alerts`,label:`Alerts`,Icon:GM},{path:`/settings`,label:`Settings`,Icon:aN}];async function DI(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await eP(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function OI({collapsed:e=!1,agentAvailable:t,activeThreadID:n,activeDashboardID:r,activePath:i,autoFocusSearch:a=!1,onNewChat:o,onSelectThread:s,onDeletedThread:c,onSelectDashboard:l,onCreateDashboard:u,onNewDashboard:f,onNavigate:p,onInvestigateService:m,ref:h}){let g=Ok(),[_,v]=(0,d.useState)(``),[y]=Qi(_.trim(),250),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(``),[E,D]=(0,d.useState)(``),[O,k]=(0,d.useState)(!1),A=(0,d.useRef)(null);(0,d.useImperativeHandle)(h,()=>({focusSearch:()=>A.current?.focus()}),[]),(0,d.useEffect)(()=>{a&&requestAnimationFrame(()=>A.current?.focus())},[a]);let j=ZA({queryKey:[...wP,y],queryFn:({pageParam:e})=>DI(y,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:t}),M=YA({queryKey:uF,queryFn:_F,refetchInterval:3e4,staleTime:pF}),N=(0,d.useMemo)(()=>j.data?.pages.flatMap(e=>e.items)??[],[j.data]),P=(0,d.useMemo)(()=>PI(N),[N]),F=YA({...QF,enabled:t&&!!y&&!!m,staleTime:6e4}),ee=(0,d.useMemo)(()=>{if(!y)return[];let e=y.toLowerCase();return(F.data??[]).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[F.data,y]),I=(0,d.useMemo)(()=>{let e=M.data??[],t=y.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[M.data,y]);function te(e){D(``),T(e.title),x(e)}async function ne(){if(b&&w.trim()){k(!0),D(``);try{let e=await eP(`/api/agent/threads/${encodeURIComponent(b.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:w.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await g.invalidateQueries({queryKey:wP}),x(null)}catch(e){D(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{k(!1)}}}async function re(){if(S){k(!0),D(``);try{let e=await eP(`/api/agent/threads/${encodeURIComponent(S.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=S.id;C(null),await g.invalidateQueries({queryKey:wP}),await g.invalidateQueries({queryKey:uF}),c(t)}catch(e){D(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{k(!1)}}}return e?(0,R.jsxs)(U0,{gap:4,component:`nav`,"aria-label":`Navigation`,children:[t&&(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:46,"aria-label":`New chat`,title:`New chat`,onClick:o,children:(0,R.jsx)(xN,{size:18})}),t&&(0,R.jsxs)(X1,{position:`right-start`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:46,"aria-label":`Chats`,title:`Chats`,className:`rail-row`,"data-active":!!n||void 0,children:(0,R.jsx)(YM,{size:18})})}),(0,R.jsxs)(X1.Dropdown,{maw:280,children:[(0,R.jsx)(X1.Label,{children:`Recent chats`}),j.isPending?(0,R.jsx)(X1.Item,{disabled:!0,children:`Loading chats…`}):j.isError?(0,R.jsx)(X1.Item,{onClick:()=>void j.refetch(),children:`Chats could not be loaded. Retry`}):N.length===0&&(0,R.jsx)(X1.Item,{disabled:!0,children:`No chats yet`}),N.slice(0,10).map(e=>(0,R.jsx)(X1.Item,{"aria-current":e.id===n?`page`:void 0,fw:e.id===n?600:void 0,onClick:()=>s(e.id),children:(0,R.jsx)(U,{size:`sm`,truncate:!0,children:e.title||`Untitled chat`})},e.id))]})]}),EI.map(({path:e,label:t,Icon:n})=>(0,R.jsx)(em,{component:`a`,href:e,title:t,"aria-label":t,"aria-current":i===e||i?.startsWith(`${e}/`)?`page`:void 0,className:`rail-row`,"data-active":i===e||i?.startsWith(`${e}/`)||void 0,variant:`subtle`,color:`gray`,size:46,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),p(e))},children:(0,R.jsx)(n,{size:18})},e)),(0,R.jsxs)(X1,{position:`right-start`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:46,"aria-label":`Dashboards`,title:`Dashboards`,className:`rail-row`,"data-active":!!r||void 0,children:(0,R.jsx)(jN,{size:18})})}),(0,R.jsxs)(X1.Dropdown,{maw:280,children:[(0,R.jsx)(X1.Label,{children:`Dashboards`}),M.isPending&&(0,R.jsx)(X1.Item,{disabled:!0,children:`Loading dashboards…`}),M.isError&&(0,R.jsx)(X1.Item,{onClick:()=>void M.refetch(),children:`Dashboards could not be loaded. Retry`}),(M.data??[]).map(e=>(0,R.jsx)(X1.Item,{"aria-current":e.id===r?`page`:void 0,fw:e.id===r?600:void 0,onClick:()=>l(e.id),children:(0,R.jsx)(U,{size:`sm`,truncate:!0,children:e.name})},e.id)),M.data?.length?(0,R.jsx)(X1.Divider,{}):null,(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(xN,{size:14}),onClick:f,children:`New dashboard`})]})]})]}):(0,R.jsxs)(U0,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[t&&(0,R.jsx)(N_,{leftSection:(0,R.jsx)(xN,{size:16,weight:`bold`}),onClick:o,children:`New chat`}),(0,R.jsx)(Bf,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(U0,{gap:`lg`,pb:`sm`,children:[t&&(0,R.jsxs)(U0,{gap:4,children:[(0,R.jsx)(kI,{children:`Chats`}),j.isLoading&&(0,R.jsx)(Fj,{state:`loading`,rows:3}),j.isError&&(0,R.jsx)(Fj,{state:`error`,error:{message:`Chats could not be loaded.`,onRetry:()=>void j.refetch()}}),!j.isLoading&&!j.isError&&N.length===0&&(0,R.jsx)(U,{size:`xs`,c:`dimmed`,px:`sm`,children:y?`No matching chats. Try another name.`:`No chats yet. Start one above.`}),P.map(e=>(0,R.jsxs)(U0,{gap:2,children:[P.length>1&&(0,R.jsx)(U,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(AI,{thread:e,active:(i?i.startsWith(`/chat/`):!r)&&e.id===n,onSelect:()=>s(e.id),onRename:()=>te(e),onDelete:()=>{D(``),C(e)}},e.id))]},e.label)),j.hasNextPage&&(0,R.jsx)(N_,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:j.isFetchingNextPage,onClick:()=>void j.fetchNextPage(),children:`See all`})]}),t&&y&&m&&F.isLoading&&(0,R.jsx)(Fj,{state:`loading`,rows:3}),t&&y&&m&&(F.isSuccess||F.isError)&&(0,R.jsxs)(U0,{gap:4,children:[(0,R.jsx)(kI,{children:`Services`}),F.isError&&(0,R.jsx)(U,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),F.isSuccess&&ee.length===0&&(0,R.jsx)(Fj,{state:`empty`,variant:`inline`,empty:{title:`No matching services`,description:`Try a different service name.`,action:(0,R.jsx)(N_,{variant:`subtle`,size:`compact-xs`,onClick:()=>v(``),children:`Clear search`})}}),ee.map(e=>(0,R.jsx)(Wf,{className:`rail-row`,p:`sm`,onClick:()=>m(e),children:(0,R.jsx)(U,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,R.jsx)(U0,{gap:0,children:EI.map(({path:e,label:t,Icon:n})=>{let r=i===e;return(0,R.jsx)(Wf,{component:`a`,href:e,className:`rail-row`,"data-active":r||void 0,"aria-current":r?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),p(e))},children:(0,R.jsxs)(um,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(n,{size:16}),(0,R.jsx)(U,{size:`sm`,fw:r?600:500,children:t})]})},e)})}),(0,R.jsxs)(U0,{gap:4,children:[(0,R.jsx)(kI,{children:`Dashboards`}),M.isLoading&&(0,R.jsx)(Fj,{state:`loading`,rows:3}),M.isError&&(0,R.jsx)(Mj,{tone:`danger`,children:`Dashboards could not be loaded.`}),!M.isLoading&&!M.isError&&y&&I.length===0&&(0,R.jsx)(Fj,{state:`empty`,variant:`inline`,empty:{title:`No matching dashboards`,description:`Try a different dashboard name.`,action:(0,R.jsx)(N_,{variant:`subtle`,size:`compact-xs`,onClick:()=>v(``),children:`Clear search`})}}),I.map(e=>{let n=(!i||i.startsWith(`/dashboards`))&&e.id===r;return(0,R.jsxs)(U0,{gap:0,children:[(0,R.jsx)(Wf,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":n||void 0,"aria-current":n?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),l(e.id))},children:(0,R.jsxs)(um,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsxs)(um,{gap:`xs`,wrap:`nowrap`,style:{minWidth:0,flex:1},children:[(0,R.jsx)(jN,{size:16,style:{flexShrink:0}}),(0,R.jsx)(U,{size:`sm`,fw:n?600:500,truncate:!0,title:e.name,children:e.name})]}),e.is_default&&(0,R.jsx)(F0,{label:`Default`,children:(0,R.jsx)(q0,{size:16,variant:`light`,color:`gray`,role:`img`,"aria-label":`Default`,style:{flexShrink:0},children:(0,R.jsx)(NN,{size:12,weight:`fill`,"aria-hidden":`true`})})})]})}),t&&e.origin&&(0,R.jsx)(Wf,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.origin.thread_id))},children:(0,R.jsxs)(U,{size:`xs`,c:`dimmed`,lineClamp:2,title:`Built from: ${e.origin.request_excerpt}`,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),(0,R.jsx)(N_,{variant:`subtle`,color:`gray`,size:`sm`,px:`sm`,justify:`flex-start`,leftSection:(0,R.jsx)(xN,{size:14}),onClick:f,children:`New dashboard`}),t&&(0,R.jsx)(N_,{variant:`subtle`,color:`gray`,size:`sm`,px:`sm`,justify:`flex-start`,leftSection:(0,R.jsx)(kN,{size:14,weight:`fill`}),onClick:u,children:`Create with AI`})]})]})}),(0,R.jsx)(W0,{ref:A,value:_,onChange:e=>v(e.currentTarget.value),leftSection:(0,R.jsx)(dN,{size:15}),rightSection:(0,R.jsx)(d1,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,R.jsx)(f0,{opened:b!==null,onClose:()=>!O&&x(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(U0,{children:[(0,R.jsx)(W0,{label:`Name`,value:w,onChange:e=>T(e.currentTarget.value),maxLength:120,autoFocus:!0}),E&&(0,R.jsx)(Mj,{tone:`danger`,children:E}),(0,R.jsxs)(um,{justify:`flex-end`,children:[(0,R.jsx)(N_,{variant:`default`,onClick:()=>x(null),disabled:O,children:`Cancel`}),(0,R.jsx)(N_,{type:`submit`,loading:O,disabled:!w.trim(),children:`Save`})]})]})})}),(0,R.jsxs)(Nj,{opened:S!==null,onClose:()=>C(null),title:`Delete chat?`,confirmLabel:`Delete chat`,tone:`danger`,pending:O?`confirm`:null,error:E||void 0,onConfirm:()=>void re(),children:[`This permanently removes `,(0,R.jsx)(U,{span:!0,ff:`monospace`,children:S?.title}),` and its saved messages.`]})]})}function kI({children:e}){return(0,R.jsx)(U,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function AI({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(H,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(um,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(Wf,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(U0,{gap:0,pl:24,style:{position:`relative`},children:[(0,R.jsx)(YM,{size:16,style:{position:`absolute`,left:0,top:2}}),(0,R.jsx)(U,{size:`sm`,fw:t?600:500,truncate:!0,title:e.title,children:e.title}),(0,R.jsx)(U,{c:`dimmed`,size:`xs`,ff:`monospace`,children:FI(e.updated_at)})]})}),(0,R.jsxs)(X1,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(rN,{size:18,weight:`bold`})})}),(0,R.jsxs)(X1.Dropdown,{children:[(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(_N,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(X1.Item,{color:`bad`,leftSection:(0,R.jsx)(LN,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function jI(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function MI(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var NI=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function PI(e){let t=MI(new Date),n=new Map;for(let r of e){let e=Math.floor((t-MI(jI(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return NI.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function FI(e){return TI(jI(e).valueOf())}var II=`modulepreload`,LI=function(e){return`/`+e},RI={},zI={},BI=function(e){return e.pathname.endsWith(`.css`)},VI=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},HI=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)},a,o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{e=LI(e,n);let t=i(e),r=BI(t);return VI(RI,t.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}let e=r?a.styles:a.all,n=r?zI[t.href]:void 0;if(!n&&e.has(t.href))return;let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:II,r||(i.as=`script`),i.crossOrigin=``,i.href=t.href,s&&i.setAttribute(`nonce`,s),n&&delete zI[t.href],n?.isConnected?n.replaceWith(i):document.head.appendChild(i),r)return new Promise((e,n)=>{let r=a=>{i.removeEventListener(`load`,r),i.removeEventListener(`error`,r),a.type===`error`?(zI[t.href]=i,n(Error(`Unable to preload CSS for ${t}`))):e(a)};i.addEventListener(`load`,r),i.addEventListener(`error`,r)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},UI=(0,d.lazy)(()=>HI(()=>import(`./new-dashboard-CFDZmvBm.js`).then(e=>({default:e.NewDashboard})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));function WI({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=qP(),s=xr(),c=ui({select:e=>e.location.pathname}),{dashboardId:l}=yr({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[f,p]=Na(!1),[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(``),[b,x]=(0,d.useState)(!1),S=(0,d.useRef)(null),C=(0,d.useRef)(null),w=NF(),T=Xi(`(max-width: 62em)`),E=Xi(`(max-width: 48em)`),D=(0,d.useRef)(T),O=()=>{T?(_(!0),p.open()):(h(!1),requestAnimationFrame(()=>S.current?.focusSearch()))};D.current=T,(0,d.useEffect)(()=>{p.close()},[c]),(0,d.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),D.current?(_(!0),p.open()):(h(!1),requestAnimationFrame(()=>S.current?.focusSearch())))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let k={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,activePath:c,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(JP),onNewDashboard:()=>{w.remember(D.current?C.current:document.activeElement),p.close(),x(!0)},onNavigate:e=>void s({to:e}),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)},A=()=>{x(!1),w.restore()};return(0,R.jsxs)(o_,{header:{height:56},navbar:{width:m?56:248,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,R.jsx)(o_.Header,{children:(0,R.jsxs)(um,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(um,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(w_,{ref:C,hiddenFrom:`md`,opened:f,"aria-expanded":f,onClick:()=>{_(!1),p.toggle()},size:`sm`,"aria-label":f?`Close navigation`:`Open navigation`}),(0,R.jsx)(em,{visibleFrom:`md`,variant:`subtle`,color:`gray`,"aria-label":m?`Expand navigation`:`Collapse navigation`,"aria-expanded":!m,onClick:()=>h(e=>!e),children:(0,R.jsx)(TN,{size:18})}),(0,R.jsx)(dP,{size:`small`})]}),E?(0,R.jsx)(em,{variant:`default`,size:`lg`,"aria-label":`Search`,onClick:O,children:(0,R.jsx)(dN,{size:16})}):(0,R.jsx)(N_,{variant:`default`,color:`gray`,leftSection:(0,R.jsx)(dN,{size:16}),onClick:O,children:`Search · ⌘K`}),(0,R.jsx)(H,{id:`shell-time-range`,visibleFrom:`sm`}),(0,R.jsxs)(um,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(BF,{}),(0,R.jsx)(MF,{}),(0,R.jsx)(GI,{onError:y})]})]})}),(0,R.jsx)(o_.Navbar,{p:m?4:`sm`,children:(0,R.jsx)(OI,{ref:S,...k,collapsed:m})}),(0,R.jsx)(c1,{opened:f,onClose:p.close,returnFocus:!b,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(dP,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(OI,{...k,autoFocusSearch:f&&g})}),(0,R.jsxs)(o_.Main,{id:`main`,tabIndex:-1,children:[v&&(0,R.jsx)(Mj,{tone:`danger`,onDismiss:()=>y(``),children:v}),e]}),b&&(0,R.jsx)(d.Suspense,{fallback:null,children:(0,R.jsx)(UI,{onClose:A,onCreated:e=>{x(!1),s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}})}})})]})}function GI({onError:e}){let t=xr(),n=vP(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(X1,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(X1.Target,{children:(0,R.jsx)(em,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`${r} account menu`,children:(0,R.jsx)(v_,{size:26,radius:`xl`,color:`gray`,children:r})})}),(0,R.jsxs)(X1.Dropdown,{children:[(0,R.jsx)(X1.Label,{children:n.email||`Signed in`}),(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(yN,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,R.jsx)(X1.Divider,{}),(0,R.jsx)(X1.Item,{leftSection:(0,R.jsx)(DN,{size:15}),onClick:()=>void tP().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function KI(){let{agent_available:e}=gP(),t=xr(),n=Ok(),{threadId:r}=yr({strict:!1}),[i,a]=(0,d.useState)(lF),o=(0,d.useRef)(new Set),s=r??i,[c,l]=(0,d.useState)([]),[u,f]=(0,d.useState)({}),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(!1),[_,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(!1),C=(0,d.useRef)(!1),[w,T]=(0,d.useState)(``),[E,D]=(0,d.useState)(``),[O,k]=(0,d.useState)(0),A=(0,d.useRef)(null),j=(0,d.useRef)({}),M=(0,d.useRef)(null),N=(0,d.useRef)(new Map),P=(0,d.useMemo)(()=>new wk({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>eP(e,t)}),[s]),F=!e||p===s;function ee(){N.current.clear(),b(``)}function I(e){return C.current||e instanceof Error&&e.name===`AbortError`}function te(e){e===void 0?(D(``),S(!0)):D(e),v(!1),ee()}(0,d.useEffect)(()=>{let t=!0;if(l([]),j.current={},f({}),m(``),g(!1),v(!1),C.current=!1,S(!1),ee(),D(``),!e){m(s);return}!r||o.current.has(s)?(P.setMessages([]),m(s)):eP(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{t&&(e===null?(g(!0),m(s)):(P.setMessages(e.messages??[]),l(e.messages??[]),m(s)))}).catch(()=>{t&&(A.current=null,D(`This chat could not be restored. Start a new chat or try again.`))});let i=P.subscribe({onMessagesChanged:({messages:e})=>l([...e]),onRunInitialized:()=>{C.current=!1,S(!1),v(!0),D(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&b(``)},onToolCallStartEvent:({event:e})=>{N.current.set(e.toolCallId,XP(e.toolCallName)),b(XP(e.toolCallName))},onToolCallResultEvent:({event:e,messages:t})=>{N.current.delete(e.toolCallId),b([...N.current.values()].at(-1)??`Analyzing your system`);let r=NP(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:uF}),n.invalidateQueries({queryKey:dF(r.id)}),n.invalidateQueries({queryKey:fF(r.id)}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||C.current?te():(console.warn(`Agent run error`,e.code),te(QP(e.code)))},onRunFinalized:({messages:e})=>{let t=[...e];l(t),f(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),v(!1),ee(),o.current.delete(s),n.invalidateQueries({queryKey:wP})},onRunFailed:e=>{I(e.error)?te():(console.error(`Agent run failed`,e),te(QP())),o.current.delete(s),n.invalidateQueries({queryKey:wP})}});return()=>{t=!1,i.unsubscribe(),P.abortRun()}},[P,e,n,O,s]),(0,d.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>M.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>M.current?.focus()))),e.key===`Escape`&&n===M.current&&(T(``),M.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ne(){v(!0),D(``);try{let{context:e=[],...t}=j.current;await P.runAgent({context:e,forwardedProps:t})}catch(e){I(e)?te():(console.error(`Agent run failed`,e),te(QP())),o.current.delete(s)}}async function re(n,i){let a=n.trim();if(!e||!a||_||!F||h)return;j.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:lF(),role:`user`,content:a};P.addMessage(c),l([...P.messages]),f(e=>({...e,[c.id]:Date.now()})),T(``),await ne()}(0,d.useEffect)(()=>{let e=A.current;F&&r&&e&&(A.current=null,re(e.text,e.options))},[F,r,s]);function ie(e){e.preventDefault(),re(w)}function ae(){C.current=!0,te(),P.abortRun(),o.current.delete(s)}function oe(){!_&&P.messages.some(e=>e.role===`user`)&&ne()}function se(n,r){if(!e)return;let i=lF();o.current.add(i),A.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function ce(){P.abortRun(),A.current=null,j.current={},a(lF()),t({to:`/chat`})}function le(e){A.current=null,j.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function ue(){k(e=>e+1)}return(0,R.jsx)(KP.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:h,messages:c,messageTimes:u,ready:F,running:_,activity:y,stopped:x,input:w,setInput:T,error:E,inputRef:M,send:re,submit:ie,stop:ae,retry:oe,reloadThread:ue,openChat:se,newThread:ce,selectThread:le},children:(0,R.jsx)(WI,{children:(0,R.jsx)(ei,{})})})}function qI(){let e=(0,d.useMemo)(()=>new VA,[]);return(0,R.jsx)(kk,{client:e,children:(0,R.jsx)(CP,{children:(0,R.jsx)(KI,{})})})}var JI=Hr({component:qI,notFoundComponent:()=>(0,R.jsx)(Sr,{to:`/`,replace:!0})}),YI=Ur(`/`)({component:Wr(()=>HI(()=>import(`./routes-B_nNwfNN.js`),[]),`component`)}),XI=Ur(`/alerts`)({component:Wr(()=>HI(()=>import(`./alerts-CDampZkC.js`),__vite__mapDeps([12,1,8,3,6,13,10,14,11])),`component`)});function ZI(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function QI(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return ZI(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function $I(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function eL(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var tL=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],nL=[`off`,`10s`,`30s`,`1m`,`5m`],rL=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},iL=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function aL(e){let t={};typeof e.range==`string`&&tL.includes(e.range)?t.range=e.range:rL(e.from)&&rL(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=iL(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=ZI(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function oL(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function sL(e,t){let n=new URL(e);return n.search=$I(oL({...aL(eL(n.search)),drill:JSON.stringify(t)})),n.href}function cL(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var lL=[`stat`,`gauge`,`timeseries`,`bar`,`table`,`heatmap`,`histogram`,`scatter`,`state_timeline`,`logs`,`log_patterns`,`traces`,`service_map`,`health`],uL=9999999,dL=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function fL(e){let t={q:``,range:`1h`,tab:`query`};if(e.v!==void 0&&String(e.v)!==`1`)return t;typeof e.q==`string`&&(t.q=e.q),typeof e.viz==`string`&&lL.includes(e.viz)&&(t.viz=e.viz),typeof e.range==`string`&&tL.includes(e.range)&&(t.range=e.range),rL(e.from)&&rL(e.to)&&Date.parse(e.from)0&&(t.picks=n);let r=ZI(e.drill);return r&&(t.drill=JSON.stringify(r)),typeof e.sort==`string`&&/^\+?[a-z_]{1,40}$/.test(e.sort)&&(t.sort=e.sort),t}function pL(e){let t={v:`1`};e.q&&(t.q=e.q),e.viz&&(t.viz=e.viz),e.from&&e.to?(t.from=e.from,t.to=e.to):e.range!==`1h`&&(t.range=e.range),e.tab!==`query`&&(t.tab=e.tab),e.sql&&(t.sql=e.sql),e.sort&&(t.sort=e.sort),e.drill&&(t.drill=JSON.parse(e.drill));for(let[n,r]of Object.entries(e.picks??{}))r&&(t[n]=r);return t}function mL(e){return e.from&&e.to?{from:e.from,to:e.to,refresh:`off`}:{range:e.range,refresh:`off`}}var hL=Ur(`/explore`)({component:Wr(()=>HI(()=>import(`./explore-CnEznG3I.js`),__vite__mapDeps([15,2,1,3,4,5,6,7,8,9,10])),`component`),validateSearch:e=>pL(fL(e))}),gL=Ur(`/logs`)({component:Wr(()=>HI(()=>import(`./logs-VrTLGNyl.js`),__vite__mapDeps([16,17,1,3,10,4,5,6,7,8,9])),`component`),validateSearch:e=>pL(fL(e))}),_L=Ur(`/settings`)({component:Wr(()=>HI(()=>import(`./settings-BJGfad4E.js`),__vite__mapDeps([18,19,1,8,13,5])),`component`)}),vL=Ur(`/traces`)({component:Wr(()=>HI(()=>import(`./traces-C1mBo8ZL.js`),__vite__mapDeps([20,17,1,3,10,4,5,6,7,8,9])),`component`),validateSearch:e=>pL(fL(e))}),yL=Ur(`/chat/`)({component:Wr(()=>HI(()=>import(`./chat.index-BkkPoSrS.js`),__vite__mapDeps([21,22,1,6,14,7,23])),`component`)}),bL=Ur(`/chat/$threadId`)({component:Wr(()=>HI(()=>import(`./chat._threadId-BkkPoSrS.js`),__vite__mapDeps([24,22,1,6,14,7,23])),`component`)}),xL=Ur(`/dashboards/`)({component:Wr(()=>HI(()=>import(`./dashboards.index-DGeIyqk7.js`),__vite__mapDeps([25,26,1,8,3,13,4,5,6,7,23])),`component`),validateSearch:e=>oL(aL(e))}),SL=Ur(`/dashboards/$dashboardId`)({component:Wr(()=>HI(()=>import(`./dashboards._dashboardId-DFPM3KOZ.js`),__vite__mapDeps([27,26,1,8,3,13,4,5,6,7,23])),`component`),validateSearch:e=>oL(aL(e))}),CL=Ur(`/settings_/ingest`)({component:Wr(()=>HI(()=>import(`./settings_.ingest-CVuXQWLV.js`),__vite__mapDeps([28,19,1,8,13,5])),`component`)}),wL=YI.update({id:`/`,path:`/`,getParentRoute:()=>JI}),TL=XI.update({id:`/alerts`,path:`/alerts`,getParentRoute:()=>JI}),EL=hL.update({id:`/explore`,path:`/explore`,getParentRoute:()=>JI}),DL=gL.update({id:`/logs`,path:`/logs`,getParentRoute:()=>JI}),OL=_L.update({id:`/settings`,path:`/settings`,getParentRoute:()=>JI}),kL=vL.update({id:`/traces`,path:`/traces`,getParentRoute:()=>JI}),AL=yL.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>JI}),jL=bL.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>JI}),ML=xL.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>JI}),NL={IndexRoute:wL,AlertsRoute:TL,ExploreRoute:EL,LogsRoute:DL,SettingsRoute:OL,TracesRoute:kL,ChatThreadIdRoute:jL,DashboardsDashboardIdRoute:SL.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>JI}),SettingsIngestRoute:CL.update({id:`/settings_/ingest`,path:`/settings/ingest`,getParentRoute:()=>JI}),ChatIndexRoute:AL,DashboardsIndexRoute:ML},PL=oi({routeTree:JI._addFileChildren(NL)._addFileTypes(),parseSearch:eL,stringifySearch:$I,defaultPreload:`intent`,scrollRestoration:!0}),FL=hM(),IL=FL.theme,LL=FL.cssVariablesResolver,RL=FL.chart,zL={light:RL.light.series,dark:RL.dark.series};(0,cv.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(d.StrictMode,{children:(0,R.jsx)(ps,{theme:IL,defaultColorScheme:`auto`,cssVariablesResolver:LL,children:(0,R.jsx)(li,{router:PL})})}));export{vF as $,c1 as $n,Fi as $r,Vj as $t,yI as A,k9 as An,As as Ar,lP as At,qF as B,F7 as Bn,Ya as Br,_N as Bt,CI as C,Z9 as Cn,xc as Cr,TP as Ct,pI as D,Y as Dn,sc as Dr,fP as Dt,TI as E,DS as En,fc as Er,mP as Et,eI as F,q as Fn,Io as Fr,aP as Ft,QF as G,ev as Gn,Aa as Gr,Mj as Gt,GF as H,kx as Hn,Ma as Hr,rN as Ht,HF as I,Y9 as In,wo as Ir,eP as It,NF as J,z0 as Jn,Gi as Jr,Hj as Jt,$F as K,W0 as Kn,Ea as Kr,Fj as Kt,JF as L,V9 as Ln,_o as Lr,BN as Lt,aI as M,cS as Mn,B as Mr,iP as Mt,nI as N,MS as Nn,$o as Nr,rP as Nt,_I as O,J as On,Rs as Or,nP as Ot,rI as P,tS as Pn,Ho as Pr,cP as Pt,uF as Q,d1 as Qn,Pi as Qr,Kj as Qt,XF as R,f9 as Rn,Qa as Rr,LN as Rt,gI as S,N9 as Sn,Cc as Sr,DP as St,wI as T,$9 as Tn,V as Tr,vP as Tt,YF as U,Ox as Un,ja as Ur,tN as Ut,KF as V,Nx as Vn,Ja as Vr,sN as Vt,VF as W,m3 as Wn,Oa as Wr,ZM as Wt,dF as X,f0 as Xn,Li as Xr,Xj as Xt,TF as Y,F0 as Yn,Hi as Yr,Ej as Yt,fF as Z,X1 as Zn,Ii as Zr,Nj as Zt,oL as _,rS as _n,Yf as _r,LP as _t,vL as a,z as ai,YA as an,bg as ar,OF as at,HI as b,z9 as bn,Bf as br,OP as bt,mL as c,Lr as ci,qk as cn,lg as cr,SF as ct,pL as d,pr as di,oA as dn,um as dr,xF as dt,Mi as ei,yj as en,R_ as er,jF as et,sL as f,rr as fi,Nk as fn,am as fr,DF as ft,nL as g,i as gi,O9 as gn,Dp as gr,qP as gt,tL as h,c as hi,r9 as hn,Rp as hr,$P as ht,xL as i,xi as ii,$A as in,s_ as ir,CF as it,iI as j,q9 as jn,hs as jr,sP as jt,xI as k,U9 as kn,Fs as kr,oP as kt,uL as l,Sr as li,zk as ln,og as lr,mF as lt,aL as m,jn as mi,i9 as mn,Kp as mr,ZP as mt,zL as n,wi as ni,aj as nn,N_ as nr,_F as nt,gL as o,_i as oi,LA as on,U as or,AF as ot,cL as p,or as pi,Ok as pn,em as pr,JP as pt,RF as q,U0 as qn,Xi as qr,Wj as qt,SL as r,Ci as ri,nj as rn,x_ as rr,yF as rt,hL as s,di as si,vA as sn,pg as sr,wF as st,RL as t,ki as ti,uj as tn,F_ as tr,bF as tt,fL as u,xr as ui,Zk as un,Hh as ur,kF as ut,QI as v,L9 as vn,Kf as vr,UP as vt,vI as w,c9 as wn,H as wr,gP as wt,SI as x,G9 as xn,Rc as xr,EP as xt,ZI as y,F9 as yn,Wf as yr,zP as yt,UF as z,V7 as zn,Xa as zr,xN as zt}; \ No newline at end of file diff --git a/internal/ui/dist/assets/lib-DeYqVmar.js b/internal/ui/dist/assets/lib-DSpv4cMb.js similarity index 99% rename from internal/ui/dist/assets/lib-DeYqVmar.js rename to internal/ui/dist/assets/lib-DSpv4cMb.js index 39979455..55edae84 100644 --- a/internal/ui/dist/assets/lib-DeYqVmar.js +++ b/internal/ui/dist/assets/lib-DSpv4cMb.js @@ -1,4 +1,4 @@ -import{n as e,r as t,t as n}from"./rolldown-runtime-BLXQ4ufn.js";import{gi as r,in as i,mi as a}from"./index-CL2Ww4um.js";var o=t(r(),1),s=new Map([[`bold`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),o.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),c=o.forwardRef((e,t)=>o.createElement(i,{ref:t,...e,weights:s}));c.displayName=`CaretDownIcon`;var l=c;function u(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var d=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p={};function m(e,t){return((t||p).jsx?f:d).test(e)}var h=/[ \t\n\f\r]/g;function g(e){return typeof e==`object`?e.type===`text`&&_(e.value):_(e)}function _(e){return e.replace(h,``)===``}var v=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};v.prototype.normal={},v.prototype.property={},v.prototype.space=void 0;function y(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new v(n,r,t)}function b(e){return e.toLowerCase()}var x=class{constructor(e,t){this.attribute=t,this.property=e}};x.prototype.attribute=``,x.prototype.booleanish=!1,x.prototype.boolean=!1,x.prototype.commaOrSpaceSeparated=!1,x.prototype.commaSeparated=!1,x.prototype.defined=!1,x.prototype.mustUseProperty=!1,x.prototype.number=!1,x.prototype.overloadedBoolean=!1,x.prototype.property=``,x.prototype.spaceSeparated=!1,x.prototype.space=void 0;var S=e({boolean:()=>w,booleanish:()=>T,commaOrSpaceSeparated:()=>A,commaSeparated:()=>k,number:()=>D,overloadedBoolean:()=>E,spaceSeparated:()=>O}),C=0,w=j(),T=j(),E=j(),D=j(),O=j(),k=j(),A=j();function j(){return 2**++C}var M=Object.keys(S),N=class extends x{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&ue.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(le,pe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!le.test(e)){let n=e.replace(ce,fe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=N}return new i(r,t)}function fe(e){return`-`+e.toLowerCase()}function pe(e){return e.charAt(1).toUpperCase()}var me=y([F,ne,ie,ae,oe],`html`),he=y([F,re,ie,ae,oe],`svg`);function ge(e){return e.join(` `).trim()}var _e=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,``):``}t.exports=function(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,d=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` +import{n as e,r as t,t as n}from"./rolldown-runtime-BLXQ4ufn.js";import{gi as r,in as i,mi as a}from"./index-CRKDYJaJ.js";var o=t(r(),1),s=new Map([[`bold`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),o.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),c=o.forwardRef((e,t)=>o.createElement(i,{ref:t,...e,weights:s}));c.displayName=`CaretDownIcon`;var l=c;function u(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var d=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p={};function m(e,t){return((t||p).jsx?f:d).test(e)}var h=/[ \t\n\f\r]/g;function g(e){return typeof e==`object`?e.type===`text`&&_(e.value):_(e)}function _(e){return e.replace(h,``)===``}var v=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};v.prototype.normal={},v.prototype.property={},v.prototype.space=void 0;function y(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new v(n,r,t)}function b(e){return e.toLowerCase()}var x=class{constructor(e,t){this.attribute=t,this.property=e}};x.prototype.attribute=``,x.prototype.booleanish=!1,x.prototype.boolean=!1,x.prototype.commaOrSpaceSeparated=!1,x.prototype.commaSeparated=!1,x.prototype.defined=!1,x.prototype.mustUseProperty=!1,x.prototype.number=!1,x.prototype.overloadedBoolean=!1,x.prototype.property=``,x.prototype.spaceSeparated=!1,x.prototype.space=void 0;var S=e({boolean:()=>w,booleanish:()=>T,commaOrSpaceSeparated:()=>A,commaSeparated:()=>k,number:()=>D,overloadedBoolean:()=>E,spaceSeparated:()=>O}),C=0,w=j(),T=j(),E=j(),D=j(),O=j(),k=j(),A=j();function j(){return 2**++C}var M=Object.keys(S),N=class extends x{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&ue.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(le,pe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!le.test(e)){let n=e.replace(ce,fe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=N}return new i(r,t)}function fe(e){return`-`+e.toLowerCase()}function pe(e){return e.charAt(1).toUpperCase()}var me=y([F,ne,ie,ae,oe],`html`),he=y([F,re,ie,ae,oe],`svg`);function ge(e){return e.join(` `).trim()}var _e=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,``):``}t.exports=function(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,d=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` `);d=~n?e.length-n:d+e.length}function p(){var e={line:l,column:d};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:d},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+d+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=d,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:u(t[0].replace(n,``)),value:r?u(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}})),ve=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(_e());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),ye=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),be=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ve()),i=ye();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),xe=Ce(`end`),Se=Ce(`start`);function Ce(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function we(e){let t=Se(e),n=xe(e);if(t&&n)return{start:t,end:n}}function Te(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?De(e.position):`start`in e||`end`in e?De(e):`line`in e||`column`in e?Ee(e):``}function Ee(e){return Oe(e&&e.line)+`:`+Oe(e&&e.column)}function De(e){return Ee(e&&e.start)+`-`+Ee(e&&e.end)}function Oe(e){return e&&typeof e==`number`?e:1}var L=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Te(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};L.prototype.file=``,L.prototype.name=``,L.prototype.reason=``,L.prototype.message=``,L.prototype.stack=``,L.prototype.column=void 0,L.prototype.line=void 0,L.prototype.ancestors=void 0,L.prototype.cause=void 0,L.prototype.fatal=void 0,L.prototype.place=void 0,L.prototype.ruleId=void 0,L.prototype.source=void 0;var ke=t(be(),1),Ae={}.hasOwnProperty,je=new Map,Me=/[A-Z]/g,Ne=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Pe=new Set([`td`,`th`]),Fe=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ie(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=qe(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ke(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?he:me,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Le(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Le(e,t,n){if(t.type===`element`)return Re(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return ze(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ve(e,t,n);if(t.type===`mdxjsEsm`)return Be(e,t);if(t.type===`root`)return He(e,t,n);if(t.type===`text`)return Ue(e,t)}function Re(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=he,e.schema=i),e.ancestors.push(t);let a=$e(e,t.tagName,!1),o=Je(e,t),s=Xe(e,t);return Ne.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!g(e)})),We(e,o,a,t),Ge(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ze(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}et(e,t.position)}function Be(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);et(e,t.position)}function Ve(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=he,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:$e(e,t.name,!0),o=Ye(e,t),s=Xe(e,t);return We(e,o,a,t),Ge(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function He(e,t,n){let r={};return Ge(r,Xe(e,t)),e.create(t,e.Fragment,r,n)}function Ue(e,t){return t.value}function We(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ge(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ke(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function qe(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Se(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Je(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ae.call(t.properties,i)){let a=Ze(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Pe.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Ye(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else et(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else et(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Xe(e,t){let n=[],r=-1,i=e.passKeys?new Map:je;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(R(e,e.length,0,t),e):t}var ft={}.hasOwnProperty;function pt(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function B(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var V=q(/[A-Za-z]/),H=q(/[\dA-Za-z]/),_t=q(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}var yt=q(/\d/),bt=q(/[\dA-Fa-f]/),xt=q(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}var St=q(/\p{P}|\p{S}/u),K=q(/\s/);function q(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ct(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return G(r)?(e.enter(n),s(r)):t(r)}function s(r){return G(r)&&a++0&&G(t)?(e.enter(r),c(t)):l(t)}function c(t){return G(t)&&o=i?t(e):n(e)}}var Tt={tokenize:Et};function Et(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return U(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Dt=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Ot(this,e,t,n,!1)}addBefore(e,t,n){Ot(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Ot(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var kt={tokenize:jt},At={tokenize:Mt};function jt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(ro))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mt(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Nt(e){if(e===null||W(e)||K(e))return 1;if(St(e))return 2}function Pt(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Rt(o,-a),Rt(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=z(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=z(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=z(r,Pt(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=z(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=z(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),R(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n0&&G(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||U(t)?e.check(Zt,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||U(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),G(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),G(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||U(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var tn={name:`codeIndented`,tokenize:rn},nn={partial:!0,tokenize:an};function rn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),wt(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):U(t)?e.attempt(nn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||U(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function an(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):U(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):wt(e,t,a,`linePrefix`,4,4)(o)}function a(e){return U(e)?i(e):n(e)}}var on={name:`codeText`,previous:cn,resolve:sn,tokenize:ln};function sn(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&dn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),dn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),dn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function yn(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||vt(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||U(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||W(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):U(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||U(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!G(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function xn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||U(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Sn(e,t){let n;return r;function r(i){return U(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):G(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Cn={name:`definition`,tokenize:Tn},wn={partial:!0,tokenize:En};function Tn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return bn.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=B(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return W(t)?Sn(e,l)(t):l(t)}function l(t){return yn(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(wn,d,d)(t)}function d(t){return G(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||U(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function En(e,t,n){return r;function r(t){return W(t)?Sn(e,i)(t):n(t)}function i(t){return xn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return G(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||U(e)?t(e):n(e)}}var Dn={name:`hardBreakEscape`,tokenize:On};function On(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return U(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var kn={name:`headingAtx`,resolve:An,tokenize:jn};function An(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};R(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function jn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||W(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||U(n)?(e.exit(`atxHeading`),t(n)):G(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||W(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Mn=`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.h1.h2.h3.h4.h5.h6.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`.split(`.`),Nn=[`pre`,`script`,`style`,`textarea`],Pn={concrete:!0,name:`htmlFlow`,resolveTo:In,tokenize:Ln},Fn={partial:!0,tokenize:Rn};function In(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ln(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):V(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):V(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return V(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||W(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Nn.includes(l)?(i=1,r.interrupt?t(s):O(s)):Mn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||H(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return G(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||V(t)?(e.consume(t),b):G(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||H(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):G(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):G(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||U(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||W(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||G(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||U(t)?O(t):G(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),I):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):U(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Fn,te,k)(t)):t===null||U(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Zt,A,te)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||U(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return Nn.includes(n)?(e.consume(t),I):O(t)}return V(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),I):t===45&&i===2?(e.consume(t),F):O(t)}function I(t){return t===null||U(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),I)}function te(n){return e.exit(`htmlFlow`),t(n)}}function Rn(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Vt,t,n)}}var zn={name:`htmlText`,tokenize:Bn};function Bn(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):V(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):V(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):U(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):U(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):U(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):U(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return V(t)?(e.consume(t),S):n(t)}function S(t){return t===45||H(t)?(e.consume(t),S):C(t)}function C(t){return U(t)?(o=C,N(t)):G(t)?(e.consume(t),C):M(t)}function w(t){return t===45||H(t)?(e.consume(t),w):t===47||t===62||W(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||V(t)?(e.consume(t),E):U(t)?(o=T,N(t)):G(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||H(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):U(t)?(o=D,N(t)):G(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):U(t)?(o=O,N(t)):G(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):U(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||W(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||W(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return G(t)?J(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}var Vn={name:`labelEnd`,resolveAll:Gn,resolveTo:Kn,tokenize:qn},Hn={tokenize:Jn},Un={tokenize:Yn},Wn={tokenize:Xn};function Gn(e){let t=-1,n=[];for(;++t0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(B(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Hn,u,o?u:d)(t):t===91?e.attempt(Un,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Wn,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Jn(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return W(t)?Sn(e,a)(t):a(t)}function a(t){return t===41?u(t):yn(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return W(t)?Sn(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?xn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return W(t)?Sn(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Yn(e,t,n){let r=this;return i;function i(t){return bn.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(B(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Xn(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Zn={name:`labelStartImage`,resolveAll:Vn.resolveAll,tokenize:Qn};function Qn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var $n={name:`labelStartLink`,resolveAll:Vn.resolveAll,tokenize:er};function er(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var tr={name:`lineEnding`,tokenize:nr};function nr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var rr={name:`thematicBreak`,tokenize:ir};function ir(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||U(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),G(t)?J(e,s,`whitespace`)(t):s(t))}}var Y={continuation:{tokenize:cr},exit:ur,name:`list`,tokenize:sr},ar={partial:!0,tokenize:dr},or={partial:!0,tokenize:lr};function sr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:yt(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(rr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return yt(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Vt,r.interrupt?n:u,e.attempt(ar,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return G(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function cr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Vt,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!G(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(or,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Y,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function lr(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ur(e){e.exit(this.containerState.type)}function dr(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!G(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var fr={name:`setextUnderline`,resolveTo:pr,tokenize:mr};function pr(e,t){let n=new Dt,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function mr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),G(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||U(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var hr={tokenize:gr};function gr(e){let t=this,n=e.attempt(Vt,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(mn,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var _r={resolveAll:xr()},vr=br(`string`),yr=br(`text`);function br(e){return{resolveAll:xr(e===`text`?Sr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++ijr,contentInitial:()=>Tr,disable:()=>Mr,document:()=>wr,flow:()=>Dr,flowInitial:()=>Er,insideSpan:()=>Ar,string:()=>Or,text:()=>kr}),wr={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:Ut},Tr={91:Cn},Er={[-2]:tn,[-1]:tn,32:tn},Dr={35:kn,42:rr,45:[fr,rr],60:Pn,61:fr,95:rr,96:$t,126:$t},Or={38:Yt,92:qt},kr={[-5]:tr,[-4]:tr,[-3]:tr,33:Zn,38:Yt,42:Ft,60:[zt,zn],91:$n,92:[Dn,qt],93:Vn,95:Ft,96:on},Ar={null:[Ft,_r]},jr={null:[42,95]},Mr={null:[]};function Nr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=z(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Pt(a,l.events,l),l.events):[]}function f(e,t){return Fr(p(e),t)}function p(e){return Pr(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Fr(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Jr).call(a,void 0,e[0])}for(r.position={start:X(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:X(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++dF(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function I(e){return e?e.map(e=>F(e)):[]}function ee(e){return e.reduce((e,t)=>`group`in t?{...e,...ee(t.items)}:(e[`${t.value}`]=t,e),{})}var L={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},te={error:null},R=k((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":u(t,`combobox-chevron-size`),"--combobox-chevron-color":n?o(n,e):void 0}})),z=f(e=>{let n=c(`ComboboxChevron`,te,e),{size:r,error:i,style:a,className:o,classNames:s,styles:l,unstyled:u,vars:d,attributes:f,mod:p,...m}=n,h=t({name:`ComboboxChevron`,classes:L,props:n,style:a,className:o,classNames:s,styles:l,unstyled:u,vars:d,varsResolver:R,attributes:f,rootSelector:`chevron`});return(0,j.jsx)(O,{component:`svg`,...m,...h(`chevron`),size:r,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:i},p],children:(0,j.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});z.classes=L,z.varsResolver=R,z.displayName=`@mantine/core/ComboboxChevron`;var[B,V]=w(`Combobox component was not found in tree`);function H({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,j.jsx)(S.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}H.displayName=`@mantine/core/ComboboxClearButton`;var U=f(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=c(`ComboboxDropdown`,null,e),s=V();return(0,j.jsx)(b.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});U.classes=L,U.displayName=`@mantine/core/ComboboxDropdown`;var ne={refProp:`ref`},W=f(e=>{let{children:t,refProp:n,ref:r}=c(`ComboboxDropdownTarget`,ne,e);if(V(),!E(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,j.jsx)(b.Target,{ref:r,refProp:n,children:t})});W.displayName=`@mantine/core/ComboboxDropdownTarget`;var G=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=c(`ComboboxEmpty`,null,e),s=V();return(0,j.jsx)(O,{...s.getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});G.classes=L,G.displayName=`@mantine/core/ComboboxEmpty`;function K({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=V(),[c,l]=(0,A.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var re={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},ie=f(e=>{let{children:t,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:s,targetType:l,autoComplete:u,ref:d,...f}=c(`ComboboxEventsTarget`,re,e),p=n(t);if(!p)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let h=V(),g=K({targetType:l,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:s,onKeyDown:p.props.onKeyDown,onClick:p.props.onClick,autoComplete:u});return(0,A.cloneElement)(p,{...g,...f,[r]:i(d,h.store.targetRef,m(p))})});ie.displayName=`@mantine/core/ComboboxEventsTarget`;var q=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=c(`ComboboxFooter`,null,e),s=V();return(0,j.jsx)(O,{...s.getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});q.classes=L,q.displayName=`@mantine/core/ComboboxFooter`;var J=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,label:l,id:u,...d}=c(`ComboboxGroup`,null,e),f=V(),p=a(u),m=l!=null&&l!==!1&&l!==``;return(0,j.jsxs)(O,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:n,classNames:t,style:r,styles:i}),...d,children:[m&&(0,j.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:t,styles:i}),children:l}),s]})});J.classes=L,J.displayName=`@mantine/core/ComboboxGroup`;var Y=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=c(`ComboboxHeader`,null,e),s=V();return(0,j.jsx)(O,{...s.getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Y.classes=L,Y.displayName=`@mantine/core/ComboboxHeader`;function ae({value:e,valuesDivider:t=`,`,...n}){return(0,j.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e==null?``:`${e}`,...n})}ae.displayName=`@mantine/core/ComboboxHiddenInput`;var X=f(e=>{let t=c(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:l,active:u,onMouseDown:d,onMouseOver:f,disabled:p,selected:m,mod:h,...g}=t,_=V(),v=(0,A.useId)(),y=l||v;return(0,j.jsx)(O,{..._.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),"aria-disabled":p||void 0,...g,id:y,mod:[`combobox-option`,{"combobox-active":u,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),d?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),f?.(e)}})});X.classes=L,X.displayName=`@mantine/core/ComboboxOption`;var oe=f(e=>{let{classNames:t,className:n,style:r,styles:i,id:o,onMouseDown:s,labelledBy:l,...u}=c(`ComboboxOptions`,null,e),d=V(),f=a(o);return(0,A.useEffect)(()=>{d.store.setListId(f)},[f]),(0,j.jsx)(O,{...d.getStyles(`options`,{className:n,style:r,classNames:t,styles:i}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});oe.classes=L,oe.displayName=`@mantine/core/ComboboxOptions`;var se={withAriaAttributes:!0,withKeyboardNavigation:!0},ce=f(e=>{let{classNames:t,styles:n,unstyled:r,vars:a,withAriaAttributes:o,onKeyDown:s,onClick:l,withKeyboardNavigation:u,size:d,ref:f,...p}=c(`ComboboxSearch`,se,e),m=V(),h=m.getStyles(`search`),g=K({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:s,onClick:l,autoComplete:`off`});return(0,j.jsx)(S,{ref:i(f,m.store.searchRef),classNames:[{input:h.className},t],styles:[{input:h.style},n],size:d||m.size,...g,...p,__staticSelector:`Combobox`})});ce.classes=L,ce.displayName=`@mantine/core/ComboboxSearch`;var le={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},ue=f(e=>{let{children:t,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:s,targetType:l,autoComplete:u,ref:d,...f}=c(`ComboboxTarget`,le,e),p=n(t);if(!p)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let m=V(),h=K({targetType:l,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:s,onKeyDown:p.props.onKeyDown,onClick:p.props.onClick,autoComplete:u}),g=(0,A.cloneElement)(p,{...h,...f});return(0,j.jsx)(b.Target,{refProp:r,ref:i(d,m.store.targetRef),children:g})});ue.displayName=`@mantine/core/ComboboxTarget`;function de(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function fe(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),v=(0,A.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),y=(0,A.useCallback)((e=`unknown`)=>{s?v(e):_(e)},[v,_,s]),b=(0,A.useCallback)(()=>{let e=P(f.current);M(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),x=(0,A.useCallback)(e=>{let t=P(f.current),n=M(`#${l.current}`,t),r=n?N(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(b(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,b]),S=(0,A.useCallback)(()=>{let e=P(f.current),t=M(`#${l.current} [data-combobox-active]`,e);if(t){let n=N(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return x(n)}return x(0)},[x]),C=(0,A.useCallback)(()=>{let e=P(f.current),t=N(`#${l.current} [data-combobox-option]`,e);return x(fe(u.current,t,a))},[x,a]),w=(0,A.useCallback)(()=>{let e=P(f.current),t=N(`#${l.current} [data-combobox-option]`,e);return x(de(u.current,t,a))},[x,a]),T=(0,A.useCallback)(()=>{let e=P(f.current),t=N(`#${l.current} [data-combobox-option]`,e);return x(pe(t))},[x]),E=(0,A.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=P(f.current),r=N(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o})}else g.current=window.setTimeout(()=>{let n=P(f.current),r=N(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),D=(0,A.useCallback)(()=>{u.current=-1,b()},[b]),O=(0,A.useCallback)(()=>{let e=P(f.current);(N(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),k=(0,A.useCallback)(e=>{l.current=e},[]),j=(0,A.useCallback)(()=>{m.current=window.setTimeout(()=>d.current?.focus(),0)},[]),F=(0,A.useCallback)(()=>{h.current=window.setTimeout(()=>f.current?.focus(),0)},[]),I=(0,A.useCallback)(()=>u.current,[]);return(0,A.useEffect)(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(h.current),window.clearTimeout(g.current)},[]),{dropdownOpened:s,openDropdown:_,closeDropdown:v,toggleDropdown:y,selectedOptionIndex:u.current,getSelectedOptionIndex:I,selectOption:x,selectFirstOption:T,selectActiveOption:S,selectNextOption:C,selectPreviousOption:w,resetSelectedOption:D,updateSelectedOptionIndex:E,listId:l.current,setListId:k,clickSelectedOption:O,searchRef:d,focusSearchInput:j,targetRef:f,focusTarget:F}}var he={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},ge=k((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":h(t),"--combobox-option-padding":u(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:_(n),"--combobox-option-fz":h(t),"--combobox-option-padding":u(t,`combobox-option-padding`)}})),Z=e=>{let n=c(`Combobox`,he,e),{classNames:r,styles:i,unstyled:a,children:o,store:s,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...x}=n,S=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,C=me(),w=s||C,T=t({name:h||`Combobox`,classes:L,props:n,classNames:r,styles:i,unstyled:a,attributes:_,vars:l,varsResolver:ge}),E=()=>{d?.(),w.closeDropdown()};return(0,j.jsx)(B,{value:{getStyles:T,store:w,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,j.jsx)(b,{opened:w.dropdownOpened,...x,middlewares:S,onChange:e=>!e&&E(),withRoles:!1,unstyled:a,children:o})})};Z.extend=e=>e,Z.classes=L,Z.varsResolver=ge,Z.displayName=`@mantine/core/Combobox`,Z.Target=ue,Z.Dropdown=U,Z.Options=oe,Z.Option=X,Z.Search=ce,Z.Empty=G,Z.Chevron=z,Z.Footer=q,Z.Header=Y,Z.EventsTarget=ie,Z.DropdownTarget=W,Z.Group=J,Z.ClearButton=H,Z.HiddenInput=ae;function _e({children:e,role:t}){let n=(0,A.use)(D);return n?(0,j.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,j.jsx)(j.Fragment,{children:e})}var ve={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},ye=ve;function be({__staticSelector:e,__stylesApiProps:n,className:r,classNames:i,styles:a,unstyled:o,children:s,label:c,description:l,id:d,disabled:f,error:p,size:m,labelPosition:g=`left`,bodyElement:_=`div`,labelElement:v=`label`,variant:y,style:b,vars:x,mod:C,attributes:w,...T}){let E=t({name:e,props:n,className:r,style:b,classes:ve,classNames:i,styles:a,unstyled:o,attributes:w}),D=l?`${d}-description`:void 0,k=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,j.jsx)(O,{...E(`root`),__vars:{"--label-fz":h(m),"--label-lh":u(m,`label-lh`)},mod:[{"label-position":g},C],variant:y,size:m,...T,children:(0,j.jsxs)(O,{component:_,htmlFor:_===`label`?d:void 0,...E(`body`),children:[s,(0,j.jsxs)(`div`,{...E(`labelWrapper`),"data-disabled":f||void 0,children:[c&&(0,j.jsx)(O,{component:v,htmlFor:v===`label`?d:void 0,...E(`label`),"data-disabled":f||void 0,children:c}),l&&(0,j.jsx)(S.Description,{id:D,size:m,__inheritStyles:!1,...E(`description`),children:l}),p&&typeof p!=`boolean`&&(0,j.jsx)(S.Error,{id:k,size:m,__inheritStyles:!1,...E(`error`),children:p})]})]})})}be.displayName=`@mantine/core/InlineInput`;function Q(e){return`group`in e}function xe({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0&&i.push({group:o.group,items:e})}Q(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function Se(e){if(e.length===0)return!0;for(let t of e)if(!(`group`in t)||t.items.length>0)return!1;return!0}function Ce(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Q(n))Ce(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function we(e,t){return Array.isArray(e)?e.includes(t):e===t}function Te({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Q(e)){let s=we(r,e.value),c=t&&(s?(0,j.jsx)(x,{className:L.optionsDropdownCheckIcon}):n?(0,j.jsx)(`div`,{className:L.optionsDropdownCheckPlaceholder}):null),l=(0,j.jsxs)(j.Fragment,{children:[i===`left`&&c,(0,j.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,j.jsx)(Z.Option,{value:e.value,disabled:e.disabled,className:d({[L.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,j.jsx)(Te,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,j.jsx)(Z.Group,{label:e.group,children:s})}function Ee({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:y,"aria-label":b}){let x=V();Ce(e);let S=typeof i==`string`?(r||xe)({options:e,search:l?i:``,limit:a??1/0}):e,C=Se(S),w=S.map((e,t)=>(0,j.jsx)(Te,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Q(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,j.jsx)(Z.Dropdown,{hidden:t||n&&C,"data-composed":!0,children:(0,j.jsxs)(Z.Options,{labelledBy:g,"aria-label":b,children:[c?(0,j.jsx)(v.Autosize,{mah:(s??x.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...y,children:w}):w,C&&m&&(0,j.jsx)(Z.Empty,{children:m})]})})}function De({id:e,label:t,labelProps:n,inputWrapperOrder:r}){if(t&&(!r||r.includes(`label`)))return n?.id||`${e}-label`}var Oe=(0,A.createContext)(null),ke={hiddenInputValuesSeparator:`,`},Ae=r((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:o,readOnly:s,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:m,...h}=c(`SwitchGroup`,ke,e),[g,_]=p({value:t,defaultValue:n,finalValue:[],onChange:r}),v=e=>{let t=e.currentTarget.value;if(s)return;let n=g.includes(t);!n&&f&&g.length>=f||_(n?g.filter(e=>e!==t):[...g,t])},y=e=>{if(m)return!0;if(!f)return!1;let t=g.includes(e),n=g.length>=f;return!t&&n},b=g.join(u);return(0,j.jsx)(Oe,{value:{value:g,onChange:v,size:i,isDisabled:y},children:(0,j.jsxs)(S.Wrapper,{size:i,...a,...h,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,j.jsx)(_e,{role:`group`,children:o}),(0,j.jsx)(`input`,{type:`hidden`,name:l,value:b,...d})]})})}));Ae.classes=S.Wrapper.classes,Ae.displayName=`@mantine/core/SwitchGroup`;var je={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},Me={labelPosition:`right`,withThumbIndicator:!0},Ne=k((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:g(t),"--switch-height":u(r,`switch-height`),"--switch-width":u(r,`switch-width`),"--switch-thumb-size":u(r,`switch-thumb-size`),"--switch-label-font-size":u(r,`switch-label-font-size`),"--switch-track-label-padding":u(r,`switch-track-label-padding`),"--switch-color":n?o(n,e):void 0}})),$=f(e=>{let n=c(`Switch`,Me,e),{classNames:r,className:i,style:o,styles:s,unstyled:u,vars:d,color:f,label:m,offLabel:h,onLabel:g,id:_,size:v,radius:y,wrapperProps:b,thumbIcon:x,checked:S,defaultChecked:C,onChange:w,labelPosition:T,description:E,error:D,disabled:k,variant:M,rootRef:N,mod:P,withThumbIndicator:F,attributes:I,...ee}=n,L=(0,A.use)(Oe),te=v||L?.size,R=t({name:`Switch`,props:n,classes:je,className:i,style:o,classNames:r,styles:s,unstyled:u,attributes:I,vars:d,varsResolver:Ne}),{styleProps:z,rest:B}=l(ee),V=a(_),H=[E?`${V}-description`:void 0,D&&typeof D!=`boolean`?`${V}-error`:void 0,B[`aria-describedby`]].filter(Boolean).join(` `)||void 0,U={checked:L?.value.includes(B.value)??S,onChange:e=>{L?.onChange(e),w?.(e)}},ne=k||L?.isDisabled?.(B.value),[W,G]=p({value:U.checked??S,defaultValue:C,finalValue:!1});return(0,j.jsxs)(be,{...R(`root`),__staticSelector:`Switch`,__stylesApiProps:n,id:V,size:te,labelPosition:T,label:m,description:E,error:D,disabled:ne,bodyElement:`label`,labelElement:`span`,classNames:r,styles:s,unstyled:u,"data-checked":U.checked,variant:M,ref:N,mod:P,attributes:I,inert:B.inert,...z,...b,children:[(0,j.jsx)(`input`,{...B,...U,disabled:ne,checked:W,"data-checked":U.checked,onChange:e=>{B.readOnly||(U.onChange?.(e),G(e.currentTarget.checked))},id:V,type:`checkbox`,role:`switch`,inert:B.inert,"aria-describedby":H,...R(`input`)}),(0,j.jsxs)(O,{"aria-hidden":`true`,component:`span`,mod:{error:D,"label-position":T,"without-labels":!g&&!h},...R(`track`),children:[(0,j.jsx)(O,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":F&&!x},...R(`thumb`),children:x}),(0,j.jsx)(`span`,{...R(`trackLabel`),children:W?g:h})]})]})});$.classes={...je,...ye},$.varsResolver=Ne,$.displayName=`@mantine/core/Switch`,$.Group=Ae;function Pe({time:e,updatedAt:t}){let[n,r]=(0,A.useState)(Date.now);(0,A.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let i=e?.from&&e.to?`${s(e.from)} – ${s(e.to)}`:e?`Last ${e.range??`1h`}`:`Refresh every 30s`;return(0,j.jsxs)(T,{ff:`monospace`,size:`xs`,c:`dimmed`,children:[i,` · `,t?`Updated ${Math.max(0,Math.floor((n-t)/1e3))}s ago`:`Waiting for data`]})}export{Q as a,ee as c,Ee as i,I as l,$ as n,Z as o,De as r,me as s,Pe as t,P as u}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Ar as t,Br as n,Er as r,Gr as i,Kr as a,Lr as o,M as s,Mr as c,Or as l,Qr as u,Rr as d,Tr as f,Ur as p,Vr as m,Xr as h,Zr as g,ai as _,br as v,gi as y,hr as b,ir as x,lr as S,mi as C,ni as w,or as T,ri as E,ur as D,wr as O,zr as k}from"./index-CRKDYJaJ.js";var A=e(y(),1),j=C();function M(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;tF(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function I(e){return e?e.map(e=>F(e)):[]}function ee(e){return e.reduce((e,t)=>`group`in t?{...e,...ee(t.items)}:(e[`${t.value}`]=t,e),{})}var L={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},te={error:null},R=k((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":u(t,`combobox-chevron-size`),"--combobox-chevron-color":n?o(n,e):void 0}})),z=f(e=>{let n=c(`ComboboxChevron`,te,e),{size:r,error:i,style:a,className:o,classNames:s,styles:l,unstyled:u,vars:d,attributes:f,mod:p,...m}=n,h=t({name:`ComboboxChevron`,classes:L,props:n,style:a,className:o,classNames:s,styles:l,unstyled:u,vars:d,varsResolver:R,attributes:f,rootSelector:`chevron`});return(0,j.jsx)(O,{component:`svg`,...m,...h(`chevron`),size:r,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:i},p],children:(0,j.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});z.classes=L,z.varsResolver=R,z.displayName=`@mantine/core/ComboboxChevron`;var[B,V]=w(`Combobox component was not found in tree`);function H({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,j.jsx)(S.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}H.displayName=`@mantine/core/ComboboxClearButton`;var U=f(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=c(`ComboboxDropdown`,null,e),s=V();return(0,j.jsx)(b.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});U.classes=L,U.displayName=`@mantine/core/ComboboxDropdown`;var ne={refProp:`ref`},W=f(e=>{let{children:t,refProp:n,ref:r}=c(`ComboboxDropdownTarget`,ne,e);if(V(),!E(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,j.jsx)(b.Target,{ref:r,refProp:n,children:t})});W.displayName=`@mantine/core/ComboboxDropdownTarget`;var G=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=c(`ComboboxEmpty`,null,e),s=V();return(0,j.jsx)(O,{...s.getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});G.classes=L,G.displayName=`@mantine/core/ComboboxEmpty`;function K({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=V(),[c,l]=(0,A.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var re={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},ie=f(e=>{let{children:t,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:s,targetType:l,autoComplete:u,ref:d,...f}=c(`ComboboxEventsTarget`,re,e),p=n(t);if(!p)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let h=V(),g=K({targetType:l,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:s,onKeyDown:p.props.onKeyDown,onClick:p.props.onClick,autoComplete:u});return(0,A.cloneElement)(p,{...g,...f,[r]:i(d,h.store.targetRef,m(p))})});ie.displayName=`@mantine/core/ComboboxEventsTarget`;var q=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=c(`ComboboxFooter`,null,e),s=V();return(0,j.jsx)(O,{...s.getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});q.classes=L,q.displayName=`@mantine/core/ComboboxFooter`;var J=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,label:l,id:u,...d}=c(`ComboboxGroup`,null,e),f=V(),p=a(u),m=l!=null&&l!==!1&&l!==``;return(0,j.jsxs)(O,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:n,classNames:t,style:r,styles:i}),...d,children:[m&&(0,j.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:t,styles:i}),children:l}),s]})});J.classes=L,J.displayName=`@mantine/core/ComboboxGroup`;var Y=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=c(`ComboboxHeader`,null,e),s=V();return(0,j.jsx)(O,{...s.getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Y.classes=L,Y.displayName=`@mantine/core/ComboboxHeader`;function ae({value:e,valuesDivider:t=`,`,...n}){return(0,j.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e==null?``:`${e}`,...n})}ae.displayName=`@mantine/core/ComboboxHiddenInput`;var X=f(e=>{let t=c(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:l,active:u,onMouseDown:d,onMouseOver:f,disabled:p,selected:m,mod:h,...g}=t,_=V(),v=(0,A.useId)(),y=l||v;return(0,j.jsx)(O,{..._.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),"aria-disabled":p||void 0,...g,id:y,mod:[`combobox-option`,{"combobox-active":u,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),d?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),f?.(e)}})});X.classes=L,X.displayName=`@mantine/core/ComboboxOption`;var oe=f(e=>{let{classNames:t,className:n,style:r,styles:i,id:o,onMouseDown:s,labelledBy:l,...u}=c(`ComboboxOptions`,null,e),d=V(),f=a(o);return(0,A.useEffect)(()=>{d.store.setListId(f)},[f]),(0,j.jsx)(O,{...d.getStyles(`options`,{className:n,style:r,classNames:t,styles:i}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});oe.classes=L,oe.displayName=`@mantine/core/ComboboxOptions`;var se={withAriaAttributes:!0,withKeyboardNavigation:!0},ce=f(e=>{let{classNames:t,styles:n,unstyled:r,vars:a,withAriaAttributes:o,onKeyDown:s,onClick:l,withKeyboardNavigation:u,size:d,ref:f,...p}=c(`ComboboxSearch`,se,e),m=V(),h=m.getStyles(`search`),g=K({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:s,onClick:l,autoComplete:`off`});return(0,j.jsx)(S,{ref:i(f,m.store.searchRef),classNames:[{input:h.className},t],styles:[{input:h.style},n],size:d||m.size,...g,...p,__staticSelector:`Combobox`})});ce.classes=L,ce.displayName=`@mantine/core/ComboboxSearch`;var le={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},ue=f(e=>{let{children:t,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:s,targetType:l,autoComplete:u,ref:d,...f}=c(`ComboboxTarget`,le,e),p=n(t);if(!p)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let m=V(),h=K({targetType:l,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:s,onKeyDown:p.props.onKeyDown,onClick:p.props.onClick,autoComplete:u}),g=(0,A.cloneElement)(p,{...h,...f});return(0,j.jsx)(b.Target,{refProp:r,ref:i(d,m.store.targetRef),children:g})});ue.displayName=`@mantine/core/ComboboxTarget`;function de(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function fe(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),v=(0,A.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),y=(0,A.useCallback)((e=`unknown`)=>{s?v(e):_(e)},[v,_,s]),b=(0,A.useCallback)(()=>{let e=P(f.current);M(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),x=(0,A.useCallback)(e=>{let t=P(f.current),n=M(`#${l.current}`,t),r=n?N(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(b(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,b]),S=(0,A.useCallback)(()=>{let e=P(f.current),t=M(`#${l.current} [data-combobox-active]`,e);if(t){let n=N(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return x(n)}return x(0)},[x]),C=(0,A.useCallback)(()=>{let e=P(f.current),t=N(`#${l.current} [data-combobox-option]`,e);return x(fe(u.current,t,a))},[x,a]),w=(0,A.useCallback)(()=>{let e=P(f.current),t=N(`#${l.current} [data-combobox-option]`,e);return x(de(u.current,t,a))},[x,a]),T=(0,A.useCallback)(()=>{let e=P(f.current),t=N(`#${l.current} [data-combobox-option]`,e);return x(pe(t))},[x]),E=(0,A.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=P(f.current),r=N(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o})}else g.current=window.setTimeout(()=>{let n=P(f.current),r=N(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),D=(0,A.useCallback)(()=>{u.current=-1,b()},[b]),O=(0,A.useCallback)(()=>{let e=P(f.current);(N(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),k=(0,A.useCallback)(e=>{l.current=e},[]),j=(0,A.useCallback)(()=>{m.current=window.setTimeout(()=>d.current?.focus(),0)},[]),F=(0,A.useCallback)(()=>{h.current=window.setTimeout(()=>f.current?.focus(),0)},[]),I=(0,A.useCallback)(()=>u.current,[]);return(0,A.useEffect)(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(h.current),window.clearTimeout(g.current)},[]),{dropdownOpened:s,openDropdown:_,closeDropdown:v,toggleDropdown:y,selectedOptionIndex:u.current,getSelectedOptionIndex:I,selectOption:x,selectFirstOption:T,selectActiveOption:S,selectNextOption:C,selectPreviousOption:w,resetSelectedOption:D,updateSelectedOptionIndex:E,listId:l.current,setListId:k,clickSelectedOption:O,searchRef:d,focusSearchInput:j,targetRef:f,focusTarget:F}}var he={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},ge=k((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":h(t),"--combobox-option-padding":u(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:_(n),"--combobox-option-fz":h(t),"--combobox-option-padding":u(t,`combobox-option-padding`)}})),Z=e=>{let n=c(`Combobox`,he,e),{classNames:r,styles:i,unstyled:a,children:o,store:s,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...x}=n,S=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,C=me(),w=s||C,T=t({name:h||`Combobox`,classes:L,props:n,classNames:r,styles:i,unstyled:a,attributes:_,vars:l,varsResolver:ge}),E=()=>{d?.(),w.closeDropdown()};return(0,j.jsx)(B,{value:{getStyles:T,store:w,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,j.jsx)(b,{opened:w.dropdownOpened,...x,middlewares:S,onChange:e=>!e&&E(),withRoles:!1,unstyled:a,children:o})})};Z.extend=e=>e,Z.classes=L,Z.varsResolver=ge,Z.displayName=`@mantine/core/Combobox`,Z.Target=ue,Z.Dropdown=U,Z.Options=oe,Z.Option=X,Z.Search=ce,Z.Empty=G,Z.Chevron=z,Z.Footer=q,Z.Header=Y,Z.EventsTarget=ie,Z.DropdownTarget=W,Z.Group=J,Z.ClearButton=H,Z.HiddenInput=ae;function _e({children:e,role:t}){let n=(0,A.use)(D);return n?(0,j.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,j.jsx)(j.Fragment,{children:e})}var ve={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},ye=ve;function be({__staticSelector:e,__stylesApiProps:n,className:r,classNames:i,styles:a,unstyled:o,children:s,label:c,description:l,id:d,disabled:f,error:p,size:m,labelPosition:g=`left`,bodyElement:_=`div`,labelElement:v=`label`,variant:y,style:b,vars:x,mod:C,attributes:w,...T}){let E=t({name:e,props:n,className:r,style:b,classes:ve,classNames:i,styles:a,unstyled:o,attributes:w}),D=l?`${d}-description`:void 0,k=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,j.jsx)(O,{...E(`root`),__vars:{"--label-fz":h(m),"--label-lh":u(m,`label-lh`)},mod:[{"label-position":g},C],variant:y,size:m,...T,children:(0,j.jsxs)(O,{component:_,htmlFor:_===`label`?d:void 0,...E(`body`),children:[s,(0,j.jsxs)(`div`,{...E(`labelWrapper`),"data-disabled":f||void 0,children:[c&&(0,j.jsx)(O,{component:v,htmlFor:v===`label`?d:void 0,...E(`label`),"data-disabled":f||void 0,children:c}),l&&(0,j.jsx)(S.Description,{id:D,size:m,__inheritStyles:!1,...E(`description`),children:l}),p&&typeof p!=`boolean`&&(0,j.jsx)(S.Error,{id:k,size:m,__inheritStyles:!1,...E(`error`),children:p})]})]})})}be.displayName=`@mantine/core/InlineInput`;function Q(e){return`group`in e}function xe({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0&&i.push({group:o.group,items:e})}Q(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function Se(e){if(e.length===0)return!0;for(let t of e)if(!(`group`in t)||t.items.length>0)return!1;return!0}function Ce(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Q(n))Ce(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function we(e,t){return Array.isArray(e)?e.includes(t):e===t}function Te({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Q(e)){let s=we(r,e.value),c=t&&(s?(0,j.jsx)(x,{className:L.optionsDropdownCheckIcon}):n?(0,j.jsx)(`div`,{className:L.optionsDropdownCheckPlaceholder}):null),l=(0,j.jsxs)(j.Fragment,{children:[i===`left`&&c,(0,j.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,j.jsx)(Z.Option,{value:e.value,disabled:e.disabled,className:d({[L.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,j.jsx)(Te,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,j.jsx)(Z.Group,{label:e.group,children:s})}function Ee({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:y,"aria-label":b}){let x=V();Ce(e);let S=typeof i==`string`?(r||xe)({options:e,search:l?i:``,limit:a??1/0}):e,C=Se(S),w=S.map((e,t)=>(0,j.jsx)(Te,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Q(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,j.jsx)(Z.Dropdown,{hidden:t||n&&C,"data-composed":!0,children:(0,j.jsxs)(Z.Options,{labelledBy:g,"aria-label":b,children:[c?(0,j.jsx)(v.Autosize,{mah:(s??x.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...y,children:w}):w,C&&m&&(0,j.jsx)(Z.Empty,{children:m})]})})}function De({id:e,label:t,labelProps:n,inputWrapperOrder:r}){if(t&&(!r||r.includes(`label`)))return n?.id||`${e}-label`}var Oe=(0,A.createContext)(null),ke={hiddenInputValuesSeparator:`,`},Ae=r((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:o,readOnly:s,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:m,...h}=c(`SwitchGroup`,ke,e),[g,_]=p({value:t,defaultValue:n,finalValue:[],onChange:r}),v=e=>{let t=e.currentTarget.value;if(s)return;let n=g.includes(t);!n&&f&&g.length>=f||_(n?g.filter(e=>e!==t):[...g,t])},y=e=>{if(m)return!0;if(!f)return!1;let t=g.includes(e),n=g.length>=f;return!t&&n},b=g.join(u);return(0,j.jsx)(Oe,{value:{value:g,onChange:v,size:i,isDisabled:y},children:(0,j.jsxs)(S.Wrapper,{size:i,...a,...h,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,j.jsx)(_e,{role:`group`,children:o}),(0,j.jsx)(`input`,{type:`hidden`,name:l,value:b,...d})]})})}));Ae.classes=S.Wrapper.classes,Ae.displayName=`@mantine/core/SwitchGroup`;var je={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},Me={labelPosition:`right`,withThumbIndicator:!0},Ne=k((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:g(t),"--switch-height":u(r,`switch-height`),"--switch-width":u(r,`switch-width`),"--switch-thumb-size":u(r,`switch-thumb-size`),"--switch-label-font-size":u(r,`switch-label-font-size`),"--switch-track-label-padding":u(r,`switch-track-label-padding`),"--switch-color":n?o(n,e):void 0}})),$=f(e=>{let n=c(`Switch`,Me,e),{classNames:r,className:i,style:o,styles:s,unstyled:u,vars:d,color:f,label:m,offLabel:h,onLabel:g,id:_,size:v,radius:y,wrapperProps:b,thumbIcon:x,checked:S,defaultChecked:C,onChange:w,labelPosition:T,description:E,error:D,disabled:k,variant:M,rootRef:N,mod:P,withThumbIndicator:F,attributes:I,...ee}=n,L=(0,A.use)(Oe),te=v||L?.size,R=t({name:`Switch`,props:n,classes:je,className:i,style:o,classNames:r,styles:s,unstyled:u,attributes:I,vars:d,varsResolver:Ne}),{styleProps:z,rest:B}=l(ee),V=a(_),H=[E?`${V}-description`:void 0,D&&typeof D!=`boolean`?`${V}-error`:void 0,B[`aria-describedby`]].filter(Boolean).join(` `)||void 0,U={checked:L?.value.includes(B.value)??S,onChange:e=>{L?.onChange(e),w?.(e)}},ne=k||L?.isDisabled?.(B.value),[W,G]=p({value:U.checked??S,defaultValue:C,finalValue:!1});return(0,j.jsxs)(be,{...R(`root`),__staticSelector:`Switch`,__stylesApiProps:n,id:V,size:te,labelPosition:T,label:m,description:E,error:D,disabled:ne,bodyElement:`label`,labelElement:`span`,classNames:r,styles:s,unstyled:u,"data-checked":U.checked,variant:M,ref:N,mod:P,attributes:I,inert:B.inert,...z,...b,children:[(0,j.jsx)(`input`,{...B,...U,disabled:ne,checked:W,"data-checked":U.checked,onChange:e=>{B.readOnly||(U.onChange?.(e),G(e.currentTarget.checked))},id:V,type:`checkbox`,role:`switch`,inert:B.inert,"aria-describedby":H,...R(`input`)}),(0,j.jsxs)(O,{"aria-hidden":`true`,component:`span`,mod:{error:D,"label-position":T,"without-labels":!g&&!h},...R(`track`),children:[(0,j.jsx)(O,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":F&&!x},...R(`thumb`),children:x}),(0,j.jsx)(`span`,{...R(`trackLabel`),children:W?g:h})]})]})});$.classes={...je,...ye},$.varsResolver=Ne,$.displayName=`@mantine/core/Switch`,$.Group=Ae;function Pe({time:e,updatedAt:t}){let[n,r]=(0,A.useState)(Date.now);(0,A.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let i=e?.from&&e.to?`${s(e.from)} – ${s(e.to)}`:e?`Last ${e.range??`1h`}`:`Refresh every 30s`;return(0,j.jsxs)(T,{ff:`monospace`,size:`xs`,c:`dimmed`,children:[i,` · `,t?`Updated ${Math.max(0,Math.floor((n-t)/1e3))}s ago`:`Waiting for data`]})}export{Q as a,ee as c,Ee as i,I as l,$ as n,Z as o,De as r,me as s,Pe as t,P as u}; \ No newline at end of file diff --git a/internal/ui/dist/assets/loading-skeleton-BsD5_HiB.js b/internal/ui/dist/assets/loading-skeleton-BgW8PQ9g.js similarity index 98% rename from internal/ui/dist/assets/loading-skeleton-BsD5_HiB.js rename to internal/ui/dist/assets/loading-skeleton-BgW8PQ9g.js index c026a922..b6017051 100644 --- a/internal/ui/dist/assets/loading-skeleton-BsD5_HiB.js +++ b/internal/ui/dist/assets/loading-skeleton-BgW8PQ9g.js @@ -1 +1 @@ -import{$t as e,Jn as t,_r as n,dr as r,mi as i,qn as a,wr as o}from"./index-CL2Ww4um.js";var s=i(),c={stat:`stat`,gauge:`gauge`,timeseries:`chart`,bar:`chart`,table:`table`,text:`text`,heatmap:`heatmap`,histogram:`chart`,scatter:`chart`,state_timeline:`chart`,logs:`table`,log_patterns:`table`,traces:`table`,service_map:`graph`,health:`health`};function l({viz:i,shape:l,columns:u=4,rows:d=5}){let f=i===void 0?l:c[i];return(0,s.jsx)(o,{"data-skeleton-shape":f,style:{minWidth:0,width:`100%`,minHeight:0,flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:f===`chart`?(0,s.jsxs)(a,{gap:`xs`,style:{flex:1,minHeight:0},children:[(0,s.jsx)(t,{"data-skeleton-chart":!0,radius:`sm`,style:{flex:1,minHeight:0}}),(0,s.jsx)(o,{"data-skeleton-axis":!0,style:{borderBottom:`1px solid var(--mantine-color-default-border)`,marginInline:8}}),(0,s.jsxs)(r,{justify:`space-between`,children:[(0,s.jsx)(t,{height:8,width:`16%`}),(0,s.jsx)(t,{height:8,width:`16%`}),(0,s.jsx)(t,{height:8,width:`16%`})]})]}):f===`stat`?(0,s.jsxs)(a,{gap:`md`,justify:`center`,mih:120,children:[(0,s.jsx)(t,{height:48,width:`52%`}),(0,s.jsx)(t,{height:12,width:`34%`})]}):f===`gauge`?(0,s.jsxs)(a,{gap:`lg`,justify:`center`,mih:140,children:[(0,s.jsx)(t,{height:40,width:`40%`}),(0,s.jsx)(t,{height:16,radius:`xl`}),(0,s.jsxs)(r,{justify:`space-between`,children:[(0,s.jsx)(t,{height:10,width:`18%`}),(0,s.jsx)(t,{height:10,width:`18%`})]})]}):f===`heatmap`?(0,s.jsx)(o,{style:{display:`grid`,gridTemplateColumns:`repeat(8, 1fr)`,gap:4},children:Array.from({length:40},(e,n)=>(0,s.jsx)(t,{height:24,radius:2},n))}):f===`text`?(0,s.jsx)(a,{gap:`sm`,children:[95,100,88,96,62].map((e,n)=>(0,s.jsx)(t,{height:12,width:`${e}%`},n))}):f===`table`?(0,s.jsx)(a,{gap:0,children:Array.from({length:d+1},(e,n)=>(0,s.jsx)(o,{"data-skeleton-row":n===0?`header`:`body`,style:{display:`grid`,gridTemplateColumns:`repeat(${u}, minmax(0, 1fr))`,gap:16,paddingBlock:12,borderBottom:`1px solid var(--mantine-color-default-border)`},children:Array.from({length:u},(e,r)=>(0,s.jsx)(t,{height:n===0?10:14,width:r===u-1?`60%`:`85%`},r))},n))}):f===`key_value`?(0,s.jsxs)(o,{children:[(0,s.jsx)(t,{height:12,width:`24%`,mb:4}),(0,s.jsx)(e,{items:Array.from({length:d},(e,n)=>({label:(0,s.jsx)(t,{"data-skeleton-label":n,height:21,width:`75%`}),value:(0,s.jsx)(t,{"data-skeleton-value":n,height:21,width:`85%`})}))})]}):f===`health`?(0,s.jsx)(o,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(120px, 1fr))`,gap:8},children:Array.from({length:6},(e,r)=>(0,s.jsx)(n,{withBorder:!0,p:`sm`,"data-skeleton-tile":!0,children:(0,s.jsxs)(a,{gap:`xs`,children:[(0,s.jsx)(t,{height:12,width:`65%`}),(0,s.jsx)(t,{height:24,width:`45%`}),(0,s.jsx)(t,{height:10,width:`85%`})]})},r))}):f===`graph`?(0,s.jsxs)(o,{style:{position:`relative`,flex:1,minHeight:80},children:[(0,s.jsx)(`svg`,{"aria-hidden":`true`,width:`100%`,height:`100%`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,style:{position:`absolute`,inset:0},children:(0,s.jsx)(`path`,{"data-skeleton-edges":!0,d:`M20 50 L50 20 L80 50 L50 80 Z M20 50 H80`,fill:`none`,stroke:`var(--mantine-color-default-border)`,vectorEffect:`non-scaling-stroke`})}),[[20,50],[50,20],[80,50],[50,80]].map(([e,n],r)=>(0,s.jsx)(t,{"data-skeleton-node":!0,width:`22%`,height:32,style:{position:`absolute`,left:`${e}%`,top:`${n}%`,transform:`translate(-50%, -50%)`}},r))]}):f===`settings`?(0,s.jsx)(a,{gap:`xl`,children:Array.from({length:3},(e,r)=>(0,s.jsxs)(a,{gap:`md`,"data-skeleton-section":!0,children:[(0,s.jsx)(t,{height:20,width:`25%`}),(0,s.jsx)(t,{height:12,width:`55%`}),(0,s.jsx)(n,{withBorder:!0,radius:`lg`,p:`lg`,children:(0,s.jsx)(t,{height:96,radius:`sm`})})]},r))}):(0,s.jsx)(a,{gap:`md`,children:Array.from({length:d},(e,n)=>(0,s.jsxs)(r,{wrap:`nowrap`,justify:`space-between`,children:[(0,s.jsxs)(a,{gap:8,style:{flex:1},children:[(0,s.jsx)(t,{height:12,width:`45%`}),(0,s.jsx)(t,{height:10,width:`70%`})]}),(0,s.jsx)(t,{height:36,width:96})]},n))})})}export{l as t}; \ No newline at end of file +import{$t as e,Jn as t,_r as n,dr as r,mi as i,qn as a,wr as o}from"./index-CRKDYJaJ.js";var s=i(),c={stat:`stat`,gauge:`gauge`,timeseries:`chart`,bar:`chart`,table:`table`,text:`text`,heatmap:`heatmap`,histogram:`chart`,scatter:`chart`,state_timeline:`chart`,logs:`table`,log_patterns:`table`,traces:`table`,service_map:`graph`,health:`health`};function l({viz:i,shape:l,columns:u=4,rows:d=5}){let f=i===void 0?l:c[i];return(0,s.jsx)(o,{"data-skeleton-shape":f,style:{minWidth:0,width:`100%`,minHeight:0,flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:f===`chart`?(0,s.jsxs)(a,{gap:`xs`,style:{flex:1,minHeight:0},children:[(0,s.jsx)(t,{"data-skeleton-chart":!0,radius:`sm`,style:{flex:1,minHeight:0}}),(0,s.jsx)(o,{"data-skeleton-axis":!0,style:{borderBottom:`1px solid var(--mantine-color-default-border)`,marginInline:8}}),(0,s.jsxs)(r,{justify:`space-between`,children:[(0,s.jsx)(t,{height:8,width:`16%`}),(0,s.jsx)(t,{height:8,width:`16%`}),(0,s.jsx)(t,{height:8,width:`16%`})]})]}):f===`stat`?(0,s.jsxs)(a,{gap:`md`,justify:`center`,mih:120,children:[(0,s.jsx)(t,{height:48,width:`52%`}),(0,s.jsx)(t,{height:12,width:`34%`})]}):f===`gauge`?(0,s.jsxs)(a,{gap:`lg`,justify:`center`,mih:140,children:[(0,s.jsx)(t,{height:40,width:`40%`}),(0,s.jsx)(t,{height:16,radius:`xl`}),(0,s.jsxs)(r,{justify:`space-between`,children:[(0,s.jsx)(t,{height:10,width:`18%`}),(0,s.jsx)(t,{height:10,width:`18%`})]})]}):f===`heatmap`?(0,s.jsx)(o,{style:{display:`grid`,gridTemplateColumns:`repeat(8, 1fr)`,gap:4},children:Array.from({length:40},(e,n)=>(0,s.jsx)(t,{height:24,radius:2},n))}):f===`text`?(0,s.jsx)(a,{gap:`sm`,children:[95,100,88,96,62].map((e,n)=>(0,s.jsx)(t,{height:12,width:`${e}%`},n))}):f===`table`?(0,s.jsx)(a,{gap:0,children:Array.from({length:d+1},(e,n)=>(0,s.jsx)(o,{"data-skeleton-row":n===0?`header`:`body`,style:{display:`grid`,gridTemplateColumns:`repeat(${u}, minmax(0, 1fr))`,gap:16,paddingBlock:12,borderBottom:`1px solid var(--mantine-color-default-border)`},children:Array.from({length:u},(e,r)=>(0,s.jsx)(t,{height:n===0?10:14,width:r===u-1?`60%`:`85%`},r))},n))}):f===`key_value`?(0,s.jsxs)(o,{children:[(0,s.jsx)(t,{height:12,width:`24%`,mb:4}),(0,s.jsx)(e,{items:Array.from({length:d},(e,n)=>({label:(0,s.jsx)(t,{"data-skeleton-label":n,height:21,width:`75%`}),value:(0,s.jsx)(t,{"data-skeleton-value":n,height:21,width:`85%`})}))})]}):f===`health`?(0,s.jsx)(o,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(120px, 1fr))`,gap:8},children:Array.from({length:6},(e,r)=>(0,s.jsx)(n,{withBorder:!0,p:`sm`,"data-skeleton-tile":!0,children:(0,s.jsxs)(a,{gap:`xs`,children:[(0,s.jsx)(t,{height:12,width:`65%`}),(0,s.jsx)(t,{height:24,width:`45%`}),(0,s.jsx)(t,{height:10,width:`85%`})]})},r))}):f===`graph`?(0,s.jsxs)(o,{style:{position:`relative`,flex:1,minHeight:80},children:[(0,s.jsx)(`svg`,{"aria-hidden":`true`,width:`100%`,height:`100%`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,style:{position:`absolute`,inset:0},children:(0,s.jsx)(`path`,{"data-skeleton-edges":!0,d:`M20 50 L50 20 L80 50 L50 80 Z M20 50 H80`,fill:`none`,stroke:`var(--mantine-color-default-border)`,vectorEffect:`non-scaling-stroke`})}),[[20,50],[50,20],[80,50],[50,80]].map(([e,n],r)=>(0,s.jsx)(t,{"data-skeleton-node":!0,width:`22%`,height:32,style:{position:`absolute`,left:`${e}%`,top:`${n}%`,transform:`translate(-50%, -50%)`}},r))]}):f===`settings`?(0,s.jsx)(a,{gap:`xl`,children:Array.from({length:3},(e,r)=>(0,s.jsxs)(a,{gap:`md`,"data-skeleton-section":!0,children:[(0,s.jsx)(t,{height:20,width:`25%`}),(0,s.jsx)(t,{height:12,width:`55%`}),(0,s.jsx)(n,{withBorder:!0,radius:`lg`,p:`lg`,children:(0,s.jsx)(t,{height:96,radius:`sm`})})]},r))}):(0,s.jsx)(a,{gap:`md`,children:Array.from({length:d},(e,n)=>(0,s.jsxs)(r,{wrap:`nowrap`,justify:`space-between`,children:[(0,s.jsxs)(a,{gap:8,style:{flex:1},children:[(0,s.jsx)(t,{height:12,width:`45%`}),(0,s.jsx)(t,{height:10,width:`70%`})]}),(0,s.jsx)(t,{height:36,width:96})]},n))})})}export{l as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/logs-DfcxDmmQ.js b/internal/ui/dist/assets/logs-VrTLGNyl.js similarity index 66% rename from internal/ui/dist/assets/logs-DfcxDmmQ.js rename to internal/ui/dist/assets/logs-VrTLGNyl.js index b77c11eb..8d2fefe5 100644 --- a/internal/ui/dist/assets/logs-DfcxDmmQ.js +++ b/internal/ui/dist/assets/logs-VrTLGNyl.js @@ -1 +1 @@ -import{d as e,mi as t,o as n,u as r,ui as i}from"./index-CL2Ww4um.js";import{n as a,t as o}from"./search-page-D3PsJ82P.js";var s=t();function c(){let t=r(n.useSearch()),c=i();return(0,s.jsx)(o,{preset:a,search:t,onSearch:(t,n)=>void c({to:`/logs`,search:e(t),replace:n}),onSaved:e=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:e}})},`logs`)}export{c as component}; \ No newline at end of file +import{d as e,mi as t,o as n,u as r,ui as i}from"./index-CRKDYJaJ.js";import{n as a,t as o}from"./search-page-CojucVCz.js";var s=t();function c(){let t=r(n.useSearch()),c=i();return(0,s.jsx)(o,{preset:a,search:t,onSearch:(t,n)=>void c({to:`/logs`,search:e(t),replace:n}),onSaved:e=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:e}})},`logs`)}export{c as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-BWngsxVi.js b/internal/ui/dist/assets/mcp-app-frame-BzMVY4oB.js similarity index 99% rename from internal/ui/dist/assets/mcp-app-frame-BWngsxVi.js rename to internal/ui/dist/assets/mcp-app-frame-BzMVY4oB.js index 2dcee9b2..38fd538b 100644 --- a/internal/ui/dist/assets/mcp-app-frame-BWngsxVi.js +++ b/internal/ui/dist/assets/mcp-app-frame-BzMVY4oB.js @@ -1,4 +1,4 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{An as t,Bn as n,Cn as r,Dn as i,En as a,Fn as o,Gt as s,Hn as c,In as l,It as u,Kt as d,Ln as f,Mn as p,Nn as m,On as h,Pn as g,Pr as _,Rn as v,Sn as y,Tn as b,Un as x,Vn as S,Wn as C,_n as w,bn as T,gi as E,gn as D,gr as ee,hn as te,jn as O,kn as k,mi as ne,mn as re,nr as ie,vn as ae,wn as oe,wr as se,xn as A,yn as ce,zn as le}from"./index-CL2Ww4um.js";import{n as j}from"./chat-DPOCuMln.js";var ue={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},de;de||={};function fe(e){return x(te,e)}function pe(e){return c(re,e)}function me(e){return S(D,e)}function M(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function N(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function he(e){let t=M(M(M(e)?.ui)?.csp),n=N(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=N(t?.resourceDomains,[`http`,`https`]),i=N(t?.frameDomains,[`http`,`https`]),a=N(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var ge=Object.create,P=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,ve=Object.getOwnPropertyNames,ye=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xe=(e,t)=>{let n={};for(var r in e)P(n,r,{get:e[r],enumerable:!0});return t&&P(n,Symbol.toStringTag,{value:`Module`}),n},Se=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ve(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=_e(t,s))||r.enumerable});return e},Ce=(e,t,n)=>(n=e==null?{}:ge(ye(e)),Se(t||!e||!e.__esModule?P(n,`default`,{value:e,enumerable:!0}):n,e)),we=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),Te=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Ee=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),De=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Oe(e){return typeof e==`string`&&Te.has(e.replace(/#$/,``))}function ke(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(we.has(n))return`2020-12`;if(Te.has(n))return`2019-09`;if(Ee.has(n)||De.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Ae=`2025-11-25`,je=[Ae,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Me=`io.modelcontextprotocol/related-task`,Ne=`io.modelcontextprotocol/protocolVersion`,Pe=`io.modelcontextprotocol/clientInfo`,Fe=`io.modelcontextprotocol/serverInfo`,Ie=`io.modelcontextprotocol/clientCapabilities`,Le=`io.modelcontextprotocol/subscriptionId`,Re=`io.modelcontextprotocol/logLevel`,ze=a(()=>l([o(),t(),y(),ae(),g(o(),ze),A(ze)])),I=g(o(),ze),Be=A(ze),Ve=l([o(),t().int()]),He=o(),Ue=O({ttl:t().optional()}),We=O({taskId:o()}),Ge=h({progressToken:Ve.optional(),[Me]:We.optional()}),L=O({_meta:Ge.optional()}),Ke=L.extend({task:Ue.optional()}),R=O({method:o(),params:L.loose().optional()}),z=O({_meta:Ge.optional()}),B=O({method:o(),params:z.loose().optional()}),qe=h({get[Fe](){return ot.optional().catch(void 0)}}),V=h({_meta:qe.optional()}),Je=l([o(),t().int()]),Ye=O({jsonrpc:i(`2.0`),id:Je,...R.shape}).strict(),Xe=O({jsonrpc:i(`2.0`),...B.shape}).strict(),Ze=O({jsonrpc:i(`2.0`),id:Je,result:V}).strict(),Qe=O({jsonrpc:i(`2.0`),id:Je.optional(),error:O({code:t().int(),message:o(),data:f().optional()})}).strict(),H=l([Ye,Xe,Ze,Qe]),$e=l([Ze,Qe]),et=V.strict(),tt=z.extend({requestId:Je.optional(),reason:o().optional()}),nt=B.extend({method:i(`notifications/cancelled`),params:tt}),rt=O({src:o(),mimeType:o().optional(),sizes:A(o()).optional(),theme:w([`light`,`dark`]).optional()}),it=O({icons:A(rt).optional()}),at=O({name:o(),title:o().optional()}),ot=at.extend({...at.shape,...it.shape,version:o(),websiteUrl:o().optional(),description:o().optional()}),st=b(O({applyDefaults:y().optional()}),I),U=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,b(O({form:st.optional(),url:I.optional()}),I.optional())),ct=h({list:I.optional(),cancel:I.optional(),requests:h({sampling:h({createMessage:I.optional()}).optional(),elicitation:h({create:I.optional()}).optional()}).optional()}),lt=h({list:I.optional(),cancel:I.optional(),requests:h({tools:h({call:I.optional()}).optional()}).optional()}),ut=O({experimental:g(o(),I).optional(),sampling:O({context:I.optional(),tools:I.optional()}).optional(),elicitation:U.optional(),roots:O({listChanged:y().optional()}).optional(),tasks:ct.optional(),extensions:g(o(),I).optional()}),dt=L.extend({protocolVersion:o(),capabilities:ut,clientInfo:ot}),ft=R.extend({method:i(`initialize`),params:dt}),pt=O({experimental:g(o(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:O({listChanged:y().optional()}).optional(),resources:O({subscribe:y().optional(),listChanged:y().optional()}).optional(),tools:O({listChanged:y().optional()}).optional(),tasks:lt.optional(),extensions:g(o(),I).optional()}),mt=V.extend({protocolVersion:o(),capabilities:pt,serverInfo:ot,instructions:o().optional()}),ht=B.extend({method:i(`notifications/initialized`),params:z.optional()}),gt=R.extend({method:i(`server/discover`),params:L.optional()}),_t=V.extend({supportedVersions:A(o()),capabilities:pt,instructions:o().optional()}),vt=R.extend({method:i(`ping`),params:L.optional()}),yt=O({progress:t(),total:p(t()),message:p(o())}),bt=O({...z.shape,...yt.shape,progressToken:Ve}),xt=B.extend({method:i(`notifications/progress`),params:bt}),St=L.extend({cursor:He.optional()}),Ct=R.extend({params:St.optional()}),wt=V.extend({nextCursor:He.optional()}),Tt=O({uri:o(),mimeType:p(o()),_meta:g(o(),f()).optional()}),Et=Tt.extend({text:o()}),Dt=o().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ot=Tt.extend({blob:Dt}),kt=w([`user`,`assistant`]),At=O({audience:A(kt).optional(),priority:t().min(0).max(1).optional(),lastModified:fe({offset:!0}).optional()}),jt=O({...at.shape,...it.shape,uri:o(),description:p(o()),mimeType:p(o()),size:p(t()),annotations:At.optional(),_meta:p(h({}))}),Mt=O({...at.shape,...it.shape,uriTemplate:o(),description:p(o()),mimeType:p(o()),annotations:At.optional(),_meta:p(h({}))}),Nt=Ct.extend({method:i(`resources/list`)}),Pt=wt.extend({resources:A(jt)}),Ft=Ct.extend({method:i(`resources/templates/list`)}),It=wt.extend({resourceTemplates:A(Mt)}),W=L.extend({uri:o()}),G=W,Lt=R.extend({method:i(`resources/read`),params:G}),Rt=V.extend({contents:A(l([Et,Ot]))}),zt=B.extend({method:i(`notifications/resources/list_changed`),params:z.optional()}),Bt=W,Vt=R.extend({method:i(`resources/subscribe`),params:Bt}),Ht=W,Ut=R.extend({method:i(`resources/unsubscribe`),params:Ht}),Wt=O({toolsListChanged:y().optional(),promptsListChanged:y().optional(),resourcesListChanged:y().optional(),resourceSubscriptions:A(o()).optional()}),Gt=L.extend({notifications:Wt}),Kt=R.extend({method:i(`subscriptions/listen`),params:Gt}),qt=z.extend({notifications:Wt}),Jt=B.extend({method:i(`notifications/subscriptions/acknowledged`),params:qt}),Yt=qe.extend({[Le]:Je}),Xt=V.extend({_meta:Yt}),Zt=z.extend({uri:o()}),Qt=B.extend({method:i(`notifications/resources/updated`),params:Zt}),$t=O({name:o(),description:p(o()),required:p(y())}),en=O({...at.shape,...it.shape,description:p(o()),arguments:p(A($t)),_meta:p(h({}))}),K=Ct.extend({method:i(`prompts/list`)}),tn=wt.extend({prompts:A(en)}),nn=L.extend({name:o(),arguments:g(o(),o()).optional()}),rn=R.extend({method:i(`prompts/get`),params:nn}),an=O({type:i(`text`),text:o(),annotations:At.optional(),_meta:g(o(),f()).optional()}),on=O({type:i(`image`),data:Dt,mimeType:o(),annotations:At.optional(),_meta:g(o(),f()).optional()}),sn=O({type:i(`audio`),data:Dt,mimeType:o(),annotations:At.optional(),_meta:g(o(),f()).optional()}),cn=O({type:i(`tool_use`),name:o(),id:o(),input:g(o(),f()),_meta:g(o(),f()).optional()}),ln=O({type:i(`resource`),resource:l([Et,Ot]),annotations:At.optional(),_meta:g(o(),f()).optional()}),un=jt.extend({type:i(`resource_link`)}),dn=l([an,on,sn,un,ln]),fn=O({role:kt,content:dn}),pn=V.extend({description:o().optional(),messages:A(fn)}),mn=B.extend({method:i(`notifications/prompts/list_changed`),params:z.optional()}),hn=O({title:o().optional(),readOnlyHint:y().optional(),destructiveHint:y().optional(),idempotentHint:y().optional(),openWorldHint:y().optional()}),gn=O({taskSupport:w([`required`,`optional`,`forbidden`]).optional()}),_n=O({...at.shape,...it.shape,description:o().optional(),inputSchema:O({type:i(`object`),properties:g(o(),ze).optional(),required:A(o()).optional()}).catchall(f()),outputSchema:h({$schema:o().optional()}).optional(),annotations:hn.optional(),execution:gn.optional(),_meta:g(o(),f()).optional()}),vn=Ct.extend({method:i(`tools/list`)}),yn=wt.extend({tools:A(_n)}),bn=V.extend({content:A(dn).default([]),structuredContent:f().optional(),isError:y().optional()}),xn=bn.or(V.extend({toolResult:f()})),Sn=Ke.extend({name:o(),arguments:g(o(),f()).optional()}),Cn=R.extend({method:i(`tools/call`),params:Sn}),wn=B.extend({method:i(`notifications/tools/list_changed`),params:z.optional()}),Tn=O({autoRefresh:y().default(!0),debounceMs:t().int().nonnegative().default(300)}),En=w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Dn=L.extend({level:En}),On=R.extend({method:i(`logging/setLevel`),params:Dn}),kn=z.extend({level:En,logger:o().optional(),data:f()}),An=B.extend({method:i(`notifications/message`),params:kn}),jn=O({name:o().optional()}),Mn=O({hints:A(jn).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),Nn=O({mode:w([`auto`,`required`,`none`]).optional()}),Pn=O({type:i(`tool_result`),toolUseId:o().describe(`The unique identifier for the corresponding tool call.`),content:A(dn),structuredContent:f().optional(),isError:y().optional(),_meta:g(o(),f()).optional()}),Fn=r(`type`,[an,on,sn]),In=r(`type`,[an,on,sn,cn,Pn]),Ln=O({role:kt,content:l([In,A(In)]),_meta:g(o(),f()).optional()}),Rn=Ke.extend({messages:A(Ln),modelPreferences:Mn.optional(),systemPrompt:o().optional(),includeContext:w([`none`,`thisServer`,`allServers`]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:A(o()).optional(),metadata:I.optional(),tools:A(_n).optional(),toolChoice:Nn.optional()}),zn=R.extend({method:i(`sampling/createMessage`),params:Rn}),Bn=V.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`]).or(o())),role:kt,content:Fn}),Vn=V.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(o())),role:kt,content:l([In,A(In)])}),Hn=O({type:i(`boolean`),title:o().optional(),description:o().optional(),default:y().optional()}),Un=O({type:i(`string`),title:o().optional(),description:o().optional(),minLength:t().optional(),maxLength:t().optional(),format:w([`email`,`uri`,`date`,`date-time`]).optional(),default:o().optional()}),Wn=O({type:w([`number`,`integer`]),title:o().optional(),description:o().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),Gn=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),default:o().optional()}),Kn=O({type:i(`string`),title:o().optional(),description:o().optional(),oneOf:A(O({const:o(),title:o()})),default:o().optional()}),qn=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),enumNames:A(o()).optional(),default:o().optional()}),Jn=l([Gn,Kn]),Yn=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({type:i(`string`),enum:A(o())}),default:A(o()).optional()}),Xn=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({anyOf:A(O({const:o(),title:o()}))}),default:A(o()).optional()}),Zn=l([Yn,Xn]),Qn=l([qn,Jn,Zn]),$n=l([Qn,Hn,Un,Wn]),er=Ke.extend({mode:i(`form`).optional(),message:o(),requestedSchema:O({type:i(`object`),properties:g(o(),$n),required:A(o()).optional()}).catchall(f())}),tr=Ke.extend({mode:i(`url`),message:o(),elicitationId:o(),url:o().url()}),nr=l([er,tr]),rr=R.extend({method:i(`elicitation/create`),params:nr}),ir=z.extend({elicitationId:o()}),ar=B.extend({method:i(`notifications/elicitation/complete`),params:ir}),or=V.extend({action:w([`accept`,`decline`,`cancel`]),content:m(e=>e===null?void 0:e,g(o(),l([o(),t(),y(),A(o())])).optional())}),sr=O({type:i(`ref/resource`),uri:o()}),cr=O({type:i(`ref/prompt`),name:o()}),lr=L.extend({ref:l([cr,sr]),argument:O({name:o(),value:o()}),context:O({arguments:g(o(),o()).optional()}).optional()}),ur=R.extend({method:i(`completion/complete`),params:lr}),dr=V.extend({completion:h({values:A(o()).max(100),total:p(t().int()),hasMore:p(y())})}),fr=O({uri:o().startsWith(`file://`),name:o().optional(),_meta:g(o(),f()).optional()}),pr=R.extend({method:i(`roots/list`),params:L.optional()}),mr=V.extend({roots:A(fr)}),hr=B.extend({method:i(`notifications/roots/list_changed`),params:z.optional()}),gr=h({ttl:t().optional(),pollInterval:t().optional()}),_r=w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),vr=O({taskId:o(),status:_r,ttl:l([t(),ae()]),createdAt:o(),lastUpdatedAt:o(),pollInterval:p(t()),statusMessage:p(o())}),yr=V.extend({task:vr}),br=z.merge(vr),xr=B.extend({method:i(`notifications/tasks/status`),params:br}),Sr=R.extend({method:i(`tasks/get`),params:L.extend({taskId:o()})}),Cr=V.merge(vr),wr=R.extend({method:i(`tasks/result`),params:L.extend({taskId:o()})}),Tr=V.loose(),Er=Ct.extend({method:i(`tasks/list`)}),Dr=wt.extend({tasks:A(vr)}),Or=R.extend({method:i(`tasks/cancel`),params:L.extend({taskId:o()})}),kr=V.merge(vr),Ar=l([vt,ft,gt,ur,On,rn,K,Nt,Ft,Lt,Vt,Ut,Kt,Cn,vn]),jr=l([nt,xt,ht,hr]),Mr=l([et,Bn,Vn,or,mr]),Nr=l([vt,zn,rr,pr]),Pr=l([nt,xt,An,Qt,zt,wn,mn,Jt,ar]),Fr=l([et,mt,_t,dr,pn,tn,Pt,It,Rt,bn,yn,Xt]),q=v().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:ue.custom,message:`URL must be parseable`,fatal:!0}),C}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Ir=h({resource:o().url(),authorization_servers:A(q).optional(),jwks_uri:o().url().optional(),scopes_supported:A(o()).optional(),bearer_methods_supported:A(o()).optional(),resource_signing_alg_values_supported:A(o()).optional(),resource_name:o().optional(),resource_documentation:o().optional(),resource_policy_uri:o().url().optional(),resource_tos_uri:o().url().optional(),tls_client_certificate_bound_access_tokens:y().optional(),authorization_details_types_supported:A(o()).optional(),dpop_signing_alg_values_supported:A(o()).optional(),dpop_bound_access_tokens_required:y().optional()}),Lr=h({issuer:o(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:A(o()).optional(),response_types_supported:A(o()),response_modes_supported:A(o()).optional(),grant_types_supported:A(o()).optional(),token_endpoint_auth_methods_supported:A(o()).optional(),token_endpoint_auth_signing_alg_values_supported:A(o()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:A(o()).optional(),revocation_endpoint_auth_signing_alg_values_supported:A(o()).optional(),introspection_endpoint:o().optional(),introspection_endpoint_auth_methods_supported:A(o()).optional(),introspection_endpoint_auth_signing_alg_values_supported:A(o()).optional(),code_challenge_methods_supported:A(o()).optional(),client_id_metadata_document_supported:y().optional(),authorization_response_iss_parameter_supported:y().optional().catch(void 0),dpop_signing_alg_values_supported:A(o()).optional()}),Rr=h({issuer:o(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:A(o()).optional(),response_types_supported:A(o()),response_modes_supported:A(o()).optional(),grant_types_supported:A(o()).optional(),acr_values_supported:A(o()).optional(),subject_types_supported:A(o()),id_token_signing_alg_values_supported:A(o()),id_token_encryption_alg_values_supported:A(o()).optional(),id_token_encryption_enc_values_supported:A(o()).optional(),userinfo_signing_alg_values_supported:A(o()).optional(),userinfo_encryption_alg_values_supported:A(o()).optional(),userinfo_encryption_enc_values_supported:A(o()).optional(),request_object_signing_alg_values_supported:A(o()).optional(),request_object_encryption_alg_values_supported:A(o()).optional(),request_object_encryption_enc_values_supported:A(o()).optional(),token_endpoint_auth_methods_supported:A(o()).optional(),token_endpoint_auth_signing_alg_values_supported:A(o()).optional(),display_values_supported:A(o()).optional(),claim_types_supported:A(o()).optional(),claims_supported:A(o()).optional(),service_documentation:o().optional(),claims_locales_supported:A(o()).optional(),ui_locales_supported:A(o()).optional(),claims_parameter_supported:y().optional(),request_parameter_supported:y().optional(),request_uri_parameter_supported:y().optional(),require_request_uri_registration:y().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:y().optional(),authorization_response_iss_parameter_supported:y().optional().catch(void 0)}),zr=O({...Rr.shape,...Lr.pick({code_challenge_methods_supported:!0}).shape}),Br=O({access_token:o(),id_token:o().optional(),token_type:o(),expires_in:me().optional(),scope:o().optional(),refresh_token:o().optional(),issuer:o().optional().catch(void 0)}).strip(),Vr=O({issued_token_type:i(`urn:ietf:params:oauth:token-type:id-jag`),access_token:o(),token_type:o().optional(),expires_in:t().optional(),scope:o().optional()}).strip(),Hr=O({error:o(),error_description:o().optional(),error_uri:o().optional()}),Ur=q.optional().or(i(``).transform(()=>void 0)),Wr=O({redirect_uris:A(q),token_endpoint_auth_method:o().optional(),grant_types:A(o()).optional(),response_types:A(o()).optional(),application_type:o().optional(),client_name:o().optional(),client_uri:q.optional(),logo_uri:Ur,scope:o().optional(),contacts:A(o()).optional(),tos_uri:Ur,policy_uri:o().optional(),jwks_uri:q.optional(),jwks:T().optional(),software_id:o().optional(),software_version:o().optional(),software_statement:o().optional()}).strip(),Gr=O({client_id:o(),client_secret:o().optional(),client_id_issued_at:t().optional(),client_secret_expires_at:t().optional(),issuer:o().optional().catch(void 0)}).strip(),Kr=Wr.merge(Gr),qr=O({error:o(),error_description:o().optional()}).strip(),Jr=O({token:o(),token_type_hint:o().optional()}).strip(),Yr=Symbol.for(`mcp.sdk.errorBrands`);function Xr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Yr,{value:n,enumerable:!1,configurable:!0})}function Zr(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Yr)){let n=t[Yr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Qr=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),$r=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Xr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Xr(this,new.target)}},ei=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ti(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ni(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ri({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=ii}function si(e){return e.filter(e=>!oi(e))}function ci(e){return e.filter(e=>oi(e))}function li(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var ui=[`task`,`inputRequests`,`requestState`];function di(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||ui.some(t=>t in e)?e:{...e,content:[]}}function fi(){let e=a(()=>l([o(),t(),y(),ae(),g(o(),e),A(e)])),n=g(o(),e),s=l([o(),t().int()]),c=o(),u=O({ttl:t().optional()}),d=O({taskId:o()}),_=h({progressToken:s.optional(),"io.modelcontextprotocol/related-task":d.optional()}),v=O({_meta:_.optional()}),x=v.extend({task:u.optional()}),S=O({method:o(),params:v.loose().optional()}),C=O({_meta:_.optional()}),T=O({method:o(),params:C.loose().optional()}),E=h({_meta:_.optional()}),D=l([o(),t().int()]),ee=E.strict(),te=C.extend({requestId:D.optional(),reason:o().optional()}),k=T.extend({method:i(`notifications/cancelled`),params:te}),ne=O({src:o(),mimeType:o().optional(),sizes:A(o()).optional(),theme:w([`light`,`dark`]).optional()}),re=O({icons:A(ne).optional()}),ie=O({name:o(),title:o().optional()}),oe=ie.extend({...ie.shape,...re.shape,version:o(),websiteUrl:o().optional(),description:o().optional()}),se=b(O({applyDefaults:y().optional()}),n),ce=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,b(O({form:se.optional(),url:n.optional()}),n.optional())),le=h({list:n.optional(),cancel:n.optional(),requests:h({sampling:h({createMessage:n.optional()}).optional(),elicitation:h({create:n.optional()}).optional()}).optional()}),j=h({list:n.optional(),cancel:n.optional(),requests:h({tools:h({call:n.optional()}).optional()}).optional()}),ue=O({experimental:g(o(),n).optional(),sampling:O({context:n.optional(),tools:n.optional()}).optional(),elicitation:ce.optional(),roots:O({listChanged:y().optional()}).optional(),tasks:le.optional(),extensions:g(o(),n).optional()}),de=v.extend({protocolVersion:o(),capabilities:ue,clientInfo:oe}),pe=S.extend({method:i(`initialize`),params:de}),me=O({experimental:g(o(),n).optional(),logging:n.optional(),completions:n.optional(),prompts:O({listChanged:y().optional()}).optional(),resources:O({subscribe:y().optional(),listChanged:y().optional()}).optional(),tools:O({listChanged:y().optional()}).optional(),tasks:j.optional(),extensions:g(o(),n).optional()}),M=E.extend({protocolVersion:o(),capabilities:me,serverInfo:oe,instructions:o().optional()}),N=T.extend({method:i(`notifications/initialized`),params:C.optional()}),he=S.extend({method:i(`ping`),params:v.optional()}),ge=O({progress:t(),total:p(t()),message:p(o())}),P=O({...C.shape,...ge.shape,progressToken:s}),_e=T.extend({method:i(`notifications/progress`),params:P}),ve=v.extend({cursor:c.optional()}),ye=S.extend({params:ve.optional()}),be=E.extend({nextCursor:c.optional()}),F=O({uri:o(),mimeType:p(o()),_meta:g(o(),f()).optional()}),xe=F.extend({text:o()}),Se=o().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=w([`user`,`assistant`]),Te=O({audience:A(we).optional(),priority:t().min(0).max(1).optional(),lastModified:fe({offset:!0}).optional()}),Ee=O({...ie.shape,...re.shape,uri:o(),description:p(o()),mimeType:p(o()),size:p(t()),annotations:Te.optional(),_meta:p(h({}))}),De=O({...ie.shape,...re.shape,uriTemplate:o(),description:p(o()),mimeType:p(o()),annotations:Te.optional(),_meta:p(h({}))}),Oe=ye.extend({method:i(`resources/list`)}),ke=be.extend({resources:A(Ee)}),Ae=ye.extend({method:i(`resources/templates/list`)}),je=be.extend({resourceTemplates:A(De)}),Me=v.extend({uri:o()}),Ne=Me,Pe=S.extend({method:i(`resources/read`),params:Ne}),Fe=E.extend({contents:A(l([xe,Ce]))}),Ie=T.extend({method:i(`notifications/resources/list_changed`),params:C.optional()}),Le=Me,Re=S.extend({method:i(`resources/subscribe`),params:Le}),ze=Me,I=S.extend({method:i(`resources/unsubscribe`),params:ze}),Be=C.extend({uri:o()}),Ve=T.extend({method:i(`notifications/resources/updated`),params:Be}),He=O({name:o(),description:p(o()),required:p(y())}),Ue=O({...ie.shape,...re.shape,description:p(o()),arguments:p(A(He)),_meta:p(h({}))}),We=ye.extend({method:i(`prompts/list`)}),Ge=be.extend({prompts:A(Ue)}),L=v.extend({name:o(),arguments:g(o(),o()).optional()}),Ke=S.extend({method:i(`prompts/get`),params:L}),R=O({type:i(`text`),text:o(),annotations:Te.optional(),_meta:g(o(),f()).optional()}),z=O({type:i(`image`),data:Se,mimeType:o(),annotations:Te.optional(),_meta:g(o(),f()).optional()}),B=O({type:i(`audio`),data:Se,mimeType:o(),annotations:Te.optional(),_meta:g(o(),f()).optional()}),qe=O({type:i(`tool_use`),name:o(),id:o(),input:g(o(),f()),_meta:g(o(),f()).optional()}),V=O({type:i(`resource`),resource:l([xe,Ce]),annotations:Te.optional(),_meta:g(o(),f()).optional()}),Je=Ee.extend({type:i(`resource_link`)}),Ye=l([R,z,B,Je,V]),Xe=O({role:we,content:Ye}),Ze=E.extend({description:o().optional(),messages:A(Xe)}),Qe=T.extend({method:i(`notifications/prompts/list_changed`),params:C.optional()}),H=O({title:o().optional(),readOnlyHint:y().optional(),destructiveHint:y().optional(),idempotentHint:y().optional(),openWorldHint:y().optional()}),$e=O({taskSupport:w([`required`,`optional`,`forbidden`]).optional()}),et=O({...ie.shape,...re.shape,description:o().optional(),inputSchema:O({type:i(`object`),properties:g(o(),e).optional(),required:A(o()).optional()}).catchall(f()),outputSchema:O({type:i(`object`),properties:g(o(),e).optional(),required:A(o()).optional()}).catchall(f()).optional(),annotations:H.optional(),execution:$e.optional(),_meta:g(o(),f()).optional()}),tt=ye.extend({method:i(`tools/list`)}),nt=be.extend({tools:A(et)}),rt=E.extend({content:A(Ye),structuredContent:g(o(),f()).optional(),isError:y().optional()}),it=x.extend({name:o(),arguments:g(o(),f()).optional()}),at=S.extend({method:i(`tools/call`),params:it}),ot=T.extend({method:i(`notifications/tools/list_changed`),params:C.optional()}),st=w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),U=v.extend({level:st}),ct=S.extend({method:i(`logging/setLevel`),params:U}),lt=C.extend({level:st,logger:o().optional(),data:f()}),ut=T.extend({method:i(`notifications/message`),params:lt}),dt=O({name:o().optional()}),ft=O({hints:A(dt).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),pt=O({mode:w([`auto`,`required`,`none`]).optional()}),mt=O({type:i(`tool_result`),toolUseId:o().describe(`The unique identifier for the corresponding tool call.`),content:A(Ye),structuredContent:O({}).loose().optional(),isError:y().optional(),_meta:g(o(),f()).optional()}),ht=r(`type`,[R,z,B]),gt=r(`type`,[R,z,B,qe,mt]),_t=O({role:we,content:l([gt,A(gt)]),_meta:g(o(),f()).optional()}),vt=x.extend({messages:A(_t),modelPreferences:ft.optional(),systemPrompt:o().optional(),includeContext:w([`none`,`thisServer`,`allServers`]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:A(o()).optional(),metadata:n.optional(),tools:A(et).optional(),toolChoice:pt.optional()}),yt=S.extend({method:i(`sampling/createMessage`),params:vt}),bt=E.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`]).or(o())),role:we,content:ht}),xt=E.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(o())),role:we,content:l([gt,A(gt)])}),St=O({type:i(`boolean`),title:o().optional(),description:o().optional(),default:y().optional()}),Ct=O({type:i(`string`),title:o().optional(),description:o().optional(),minLength:t().optional(),maxLength:t().optional(),format:w([`email`,`uri`,`date`,`date-time`]).optional(),default:o().optional()}),wt=O({type:w([`number`,`integer`]),title:o().optional(),description:o().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),Tt=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),default:o().optional()}),Et=O({type:i(`string`),title:o().optional(),description:o().optional(),oneOf:A(O({const:o(),title:o()})),default:o().optional()}),Dt=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),enumNames:A(o()).optional(),default:o().optional()}),Ot=l([Tt,Et]),kt=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({type:i(`string`),enum:A(o())}),default:A(o()).optional()}),At=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({anyOf:A(O({const:o(),title:o()}))}),default:A(o()).optional()}),jt=l([kt,At]),Mt=l([Dt,Ot,jt]),Nt=l([Mt,St,Ct,wt]),Pt=x.extend({mode:i(`form`).optional(),message:o(),requestedSchema:O({type:i(`object`),properties:g(o(),Nt),required:A(o()).optional()}).catchall(f())}),Ft=x.extend({mode:i(`url`),message:o(),elicitationId:o(),url:o().url()}),It=l([Pt,Ft]),W=S.extend({method:i(`elicitation/create`),params:It}),G=C.extend({elicitationId:o()}),Lt=T.extend({method:i(`notifications/elicitation/complete`),params:G}),Rt=E.extend({action:w([`accept`,`decline`,`cancel`]),content:m(e=>e===null?void 0:e,g(o(),l([o(),t(),y(),A(o())])).optional())}),zt=O({type:i(`ref/resource`),uri:o()}),Bt=O({type:i(`ref/prompt`),name:o()}),Vt=v.extend({ref:l([Bt,zt]),argument:O({name:o(),value:o()}),context:O({arguments:g(o(),o()).optional()}).optional()}),Ht=S.extend({method:i(`completion/complete`),params:Vt}),Ut=E.extend({completion:h({values:A(o()).max(100),total:p(t().int()),hasMore:p(y())})}),Wt=O({uri:o().startsWith(`file://`),name:o().optional(),_meta:g(o(),f()).optional()}),Gt=S.extend({method:i(`roots/list`),params:v.optional()}),Kt=E.extend({roots:A(Wt)}),qt=T.extend({method:i(`notifications/roots/list_changed`),params:C.optional()}),Jt=h({ttl:t().optional(),pollInterval:t().optional()}),Yt=w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Xt=O({taskId:o(),status:Yt,ttl:l([t(),ae()]),createdAt:o(),lastUpdatedAt:o(),pollInterval:p(t()),statusMessage:p(o())}),Zt=E.extend({task:Xt}),Qt=C.merge(Xt),$t=T.extend({method:i(`notifications/tasks/status`),params:Qt}),en=S.extend({method:i(`tasks/get`),params:v.extend({taskId:o()})}),K=E.merge(Xt),tn=S.extend({method:i(`tasks/result`),params:v.extend({taskId:o()})}),nn=E.loose(),rn=ye.extend({method:i(`tasks/list`)}),an=be.extend({tasks:A(Xt)}),on=S.extend({method:i(`tasks/cancel`),params:v.extend({taskId:o()})});return{JSONValueSchema:e,JSONObjectSchema:n,ProgressTokenSchema:s,CursorSchema:c,TaskMetadataSchema:u,RelatedTaskMetadataSchema:d,RequestMetaSchema:_,BaseRequestParamsSchema:v,TaskAugmentedRequestParamsSchema:x,RequestSchema:S,NotificationsParamsSchema:C,NotificationSchema:T,ResultSchema:E,RequestIdSchema:D,EmptyResultSchema:ee,CancelledNotificationParamsSchema:te,CancelledNotificationSchema:k,IconSchema:ne,IconsSchema:re,BaseMetadataSchema:ie,ImplementationSchema:oe,ClientTasksCapabilitySchema:le,ServerTasksCapabilitySchema:j,ClientCapabilitiesSchema:ue,InitializeRequestParamsSchema:de,InitializeRequestSchema:pe,ServerCapabilitiesSchema:me,InitializeResultSchema:M,InitializedNotificationSchema:N,PingRequestSchema:he,ProgressSchema:ge,ProgressNotificationParamsSchema:P,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:I,ResourceUpdatedNotificationParamsSchema:Be,ResourceUpdatedNotificationSchema:Ve,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:L,GetPromptRequestSchema:Ke,TextContentSchema:R,ImageContentSchema:z,AudioContentSchema:B,ToolUseContentSchema:qe,EmbeddedResourceSchema:V,ResourceLinkSchema:Je,ContentBlockSchema:Ye,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:H,ToolExecutionSchema:$e,ToolSchema:et,ListToolsRequestSchema:tt,ListToolsResultSchema:nt,CallToolResultSchema:rt,CallToolRequestParamsSchema:it,CallToolRequestSchema:at,ToolListChangedNotificationSchema:ot,LoggingLevelSchema:st,SetLevelRequestParamsSchema:U,SetLevelRequestSchema:ct,LoggingMessageNotificationParamsSchema:lt,LoggingMessageNotificationSchema:ut,ModelHintSchema:dt,ModelPreferencesSchema:ft,ToolChoiceSchema:pt,ToolResultContentSchema:mt,SamplingContentSchema:ht,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:_t,CreateMessageRequestParamsSchema:vt,CreateMessageRequestSchema:yt,CreateMessageResultSchema:bt,CreateMessageResultWithToolsSchema:xt,BooleanSchemaSchema:St,StringSchemaSchema:Ct,NumberSchemaSchema:wt,UntitledSingleSelectEnumSchemaSchema:Tt,TitledSingleSelectEnumSchemaSchema:Et,LegacyTitledEnumSchemaSchema:Dt,SingleSelectEnumSchemaSchema:Ot,UntitledMultiSelectEnumSchemaSchema:kt,TitledMultiSelectEnumSchemaSchema:At,MultiSelectEnumSchemaSchema:jt,EnumSchemaSchema:Mt,PrimitiveSchemaDefinitionSchema:Nt,ElicitRequestFormParamsSchema:Pt,ElicitRequestURLParamsSchema:Ft,ElicitRequestParamsSchema:It,ElicitRequestSchema:W,ElicitationCompleteNotificationParamsSchema:G,ElicitationCompleteNotificationSchema:Lt,ElicitResultSchema:Rt,ResourceTemplateReferenceSchema:zt,PromptReferenceSchema:Bt,CompleteRequestParamsSchema:Vt,CompleteRequestSchema:Ht,CompleteResultSchema:Ut,RootSchema:Wt,ListRootsRequestSchema:Gt,ListRootsResultSchema:Kt,RootsListChangedNotificationSchema:qt,TaskCreationParamsSchema:Jt,TaskStatusSchema:Yt,TaskSchema:Xt,CreateTaskResultSchema:Zt,TaskStatusNotificationParamsSchema:Qt,TaskStatusNotificationSchema:$t,GetTaskRequestSchema:en,GetTaskResultSchema:K,GetTaskPayloadRequestSchema:tn,GetTaskPayloadResultSchema:nn,ListTasksRequestSchema:rn,ListTasksResultSchema:an,CancelTaskRequestSchema:on,CancelTaskResultSchema:E.merge(Xt),ClientRequestSchema:l([he,pe,Ht,ct,Ke,We,Oe,Ae,Pe,Re,I,at,tt,en,tn,rn,on]),ClientNotificationSchema:l([k,_e,N,qt,$t]),ClientResultSchema:l([ee,bt,xt,Rt,Kt,K,an,Zt]),ServerRequestSchema:l([he,yt,W,Gt,en,tn,rn,on]),ServerNotificationSchema:l([k,_e,ut,Ve,Ie,ot,Qe,$t,Lt]),ServerResultSchema:l([ee,M,Ut,Ze,Ge,ke,je,Fe,rt,nt,K,an,Zt]),CallToolResultWireSchema:f().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of ui)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(di).pipe(rt)}}var pi;function mi(){return pi??=fi()}function hi(e){return e.type!==`object`}var gi=new Set([`const`,`enum`,`default`,`examples`]),_i=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function vi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function yi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(vi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Oe(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&vi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=gi.has(o)?s:_i.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var bi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},xi={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci;function wi(){if(Ci)return Ci;let e=mi();return Ci={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ci}function Ti(e){return Object.prototype.hasOwnProperty.call(bi,e)}function Ei(e){return Object.prototype.hasOwnProperty.call(xi,e)}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Di(e)?wi().resultSchemas[e]:void 0}function ki(e){return Ti(e)?wi().requestSchemas[e]:void 0}function Ai(e){return Ei(e)?wi().notificationSchemas[e]:void 0}Object.keys(bi),Object.keys(xi);function ji(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Mi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Ni={ok:!1,reason:`not-in-era`};function Pi(e){return ji(e)&&ji(e.outputSchema)&&hi(e.outputSchema)}function Fi(e){return e}var Ii={era:`2025-11-25`,hasRequestMethod:Ti,hasNotificationMethod:Ei,validateRequest:(e,t)=>Mi(ki(e),t),validateResult:(e,t)=>Mi(Oi(e),t),validateNotification:(e,t)=>Mi(Ai(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Ni,validateInputResponse:()=>Ni,samplingResultVariant:((e,t)=>{let n=mi();return Mi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=li(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&hi(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(ji(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Fi(e)}}return{kind:`complete`,result:Fi(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Pi(e))?t:{...t,tools:n.map(e=>Pi(e)?{...e,outputSchema:yi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function Li(){let e=a(()=>l([o(),t(),y(),ae(),g(o(),e),A(e)])),n=g(o(),e),r=l([o(),t().int()]),s=o(),c=l([o(),t().int()]),u=w([`user`,`assistant`]),d=w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),_=o().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),v=O({ttl:t().optional()}),x=O({taskId:o()}),S=h({progressToken:r.optional(),"io.modelcontextprotocol/related-task":x.optional()}),C=O({_meta:S.optional()}),T=C.extend({task:v.optional()}),E=O({_meta:S.optional()}),D=O({method:o(),params:E.loose().optional()}),ee=O({src:o(),mimeType:o().optional(),sizes:A(o()).optional(),theme:w([`light`,`dark`]).optional()}),te=O({icons:A(ee).optional()}),k=O({name:o(),title:o().optional()}),ne=k.extend({...k.shape,...te.shape,version:o(),websiteUrl:o().optional(),description:o().optional()}),re=b(O({applyDefaults:y().optional()}),n),ie=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,b(O({form:re.optional(),url:n.optional()}),n.optional())),oe=h({list:n.optional(),cancel:n.optional(),requests:h({sampling:h({createMessage:n.optional()}).optional(),elicitation:h({create:n.optional()}).optional()}).optional()}),se=h({list:n.optional(),cancel:n.optional(),requests:h({tools:h({call:n.optional()}).optional()}).optional()}),ce=O({experimental:g(o(),n).optional(),sampling:O({context:n.optional(),tools:n.optional()}).optional(),elicitation:ie.optional(),roots:O({listChanged:y().optional()}).optional(),tasks:oe.optional(),extensions:g(o(),n).optional()}),le=O({experimental:g(o(),n).optional(),logging:n.optional(),completions:n.optional(),prompts:O({listChanged:y().optional()}).optional(),resources:O({subscribe:y().optional(),listChanged:y().optional()}).optional(),tools:O({listChanged:y().optional()}).optional(),tasks:se.optional(),extensions:g(o(),n).optional()}),j=O({progress:t(),total:p(t()),message:p(o())}),ue=O({...E.shape,...j.shape,progressToken:r}),de=D.extend({method:i(`notifications/progress`),params:ue}),pe=E.extend({level:d,logger:o().optional(),data:f()}),me=D.extend({method:i(`notifications/message`),params:pe}),M=O({uri:o(),mimeType:p(o()),_meta:g(o(),f()).optional()}),N=M.extend({text:o()}),he=M.extend({blob:_}),ge=O({audience:A(u).optional(),priority:t().min(0).max(1).optional(),lastModified:fe({offset:!0}).optional()}),P=O({...k.shape,...te.shape,uri:o(),description:p(o()),mimeType:p(o()),size:p(t()),annotations:ge.optional(),_meta:p(h({}))}),_e=O({...k.shape,...te.shape,uriTemplate:o(),description:p(o()),mimeType:p(o()),annotations:ge.optional(),_meta:p(h({}))}),ve=D.extend({method:i(`notifications/resources/list_changed`),params:E.optional()}),ye=E.extend({uri:o()}),be=D.extend({method:i(`notifications/resources/updated`),params:ye}),F=O({name:o(),description:p(o()),required:p(y())}),xe=O({...k.shape,...te.shape,description:p(o()),arguments:p(A(F)),_meta:p(h({}))}),Se=D.extend({method:i(`notifications/prompts/list_changed`),params:E.optional()}),Ce=O({type:i(`text`),text:o(),annotations:ge.optional(),_meta:g(o(),f()).optional()}),we=O({type:i(`image`),data:_,mimeType:o(),annotations:ge.optional(),_meta:g(o(),f()).optional()}),Te=O({type:i(`audio`),data:_,mimeType:o(),annotations:ge.optional(),_meta:g(o(),f()).optional()}),Ee=O({type:i(`tool_use`),name:o(),id:o(),input:g(o(),f()),_meta:g(o(),f()).optional()}),De=O({type:i(`resource`),resource:l([N,he]),annotations:ge.optional(),_meta:g(o(),f()).optional()}),Oe=P.extend({type:i(`resource_link`)}),ke=l([Ce,we,Te,Oe,De]),Ae=O({role:u,content:ke}),je=O({title:o().optional(),readOnlyHint:y().optional(),destructiveHint:y().optional(),idempotentHint:y().optional(),openWorldHint:y().optional()}),Me=D.extend({method:i(`notifications/tools/list_changed`),params:E.optional()}),Le=O({name:o().optional()}),ze=O({hints:A(Le).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),I=O({mode:w([`auto`,`required`,`none`]).optional()}),Be=O({type:i(`boolean`),title:o().optional(),description:o().optional(),default:y().optional()}),Ve=O({type:i(`string`),title:o().optional(),description:o().optional(),minLength:t().optional(),maxLength:t().optional(),format:w([`email`,`uri`,`date`,`date-time`]).optional(),default:o().optional()}),He=O({type:w([`number`,`integer`]),title:o().optional(),description:o().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),Ue=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),default:o().optional()}),We=O({type:i(`string`),title:o().optional(),description:o().optional(),oneOf:A(O({const:o(),title:o()})),default:o().optional()}),Ge=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),enumNames:A(o()).optional(),default:o().optional()}),L=l([Ue,We]),Ke=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({type:i(`string`),enum:A(o())}),default:A(o()).optional()}),R=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({anyOf:A(O({const:o(),title:o()}))}),default:A(o()).optional()}),z=l([Ke,R]),B=l([Ge,L,z]),qe=l([B,Be,Ve,He]),V=T.extend({mode:i(`form`).optional(),message:o(),requestedSchema:O({type:i(`object`),properties:g(o(),qe),required:A(o()).optional()}).catchall(f())}),Je=O({type:i(`ref/resource`),uri:o()}),Ye=O({type:i(`ref/prompt`),name:o()}),Xe=O({uri:o().startsWith(`file://`),name:o().optional(),_meta:g(o(),f()).optional()}),Ze=ce.shape,Qe=O({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),H=le.shape,$e=O({experimental:H.experimental,logging:H.logging,completions:H.completions,prompts:H.prompts,resources:H.resources,tools:H.tools,extensions:H.extensions}),et=h({progressToken:r.optional(),[Ne]:o(),[Pe]:ne.optional(),[Ie]:Qe,[Re]:d.optional()}),tt=O({...k.shape,...te.shape,description:o().optional(),inputSchema:h({$schema:o().optional(),type:i(`object`)}),outputSchema:h({$schema:o().optional()}).optional(),annotations:je.optional(),_meta:g(o(),f()).optional()}),nt=O({type:i(`tool_result`),toolUseId:o(),content:A(ke),structuredContent:f().optional(),isError:y().optional(),_meta:g(o(),f()).optional()}),rt=l([Ce,we,Te,Ee,nt]),it=O({role:u,content:l([rt,A(rt)]),_meta:g(o(),f()).optional()}),at=o(),ot=h({[Fe]:ne.optional().catch(void 0)}),st=ot.optional();function U(e){return h({_meta:st,resultType:at.default(`complete`),...e})}let ct=U({}),lt=U({nextCursor:s.optional()}),ut=U({content:A(ke),structuredContent:f().optional(),isError:y().optional()}),dt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),tools:A(tt),nextCursor:s.optional()}),ft=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),prompts:A(xe),nextCursor:s.optional()}),pt=U({description:o().optional(),messages:A(Ae)}),mt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resources:A(P),nextCursor:s.optional()}),ht=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resourceTemplates:A(_e),nextCursor:s.optional()}),gt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),contents:A(l([N,he]))}),_t=U({completion:O({values:A(o()).max(100),total:t().int().optional(),hasMore:y().optional()}).loose()}),vt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`])}),yt=U({ttlMs:t().int().min(0).catch(0),cacheScope:w([`public`,`private`]).catch(`private`),supportedVersions:A(o()),capabilities:$e,instructions:o().optional()}),bt=O({messages:A(it),modelPreferences:ze.optional(),systemPrompt:o().optional(),includeContext:w([`none`,`thisServer`,`allServers`]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:A(o()).optional(),metadata:n.optional(),tools:A(tt).optional(),toolChoice:I.optional()}),xt=O({method:i(`sampling/createMessage`),params:bt}),St=O({method:i(`roots/list`),params:O({_meta:g(o(),f()).optional()}).optional()}),Ct=O({...it.shape,model:o(),stopReason:o().optional()}),wt=O({roots:A(Xe)}),Tt=O({action:w([`accept`,`decline`,`cancel`]),content:g(o(),l([o(),t(),y(),A(o())])).optional()}),Et=O({mode:i(`url`),message:o(),url:o().url()}),Dt=l([V,Et]),Ot=O({method:i(`elicitation/create`),params:Dt}),kt=l([xt,St,Ot]),At=l([Ct,wt,Tt]),jt=g(o(),kt),Mt=g(o(),At),Nt=U({inputRequests:jt.optional(),requestState:o().optional()}),Pt={inputResponses:Mt.optional(),requestState:o().optional()},Ft=O({_meta:et,...Pt}),It=h({progressToken:r.optional()});function W(e,t){return O({method:i(e),params:O({_meta:et,...t})})}function G(e,t){return O({method:i(e),params:O({_meta:It.optional(),...t}).optional()})}let Lt={name:o(),arguments:g(o(),f()).optional(),...Pt},Rt={cursor:s.optional()},zt=W(`tools/call`,Lt),Bt=W(`tools/list`,Rt),Vt=W(`prompts/list`,Rt),Ht=W(`prompts/get`,{name:o(),arguments:g(o(),o()).optional(),...Pt}),Ut=W(`resources/list`,Rt),Wt=W(`resources/templates/list`,Rt),Gt=W(`resources/read`,{uri:o(),...Pt}),Kt={ref:l([Ye,Je]),argument:O({name:o(),value:o()}),context:O({arguments:g(o(),o()).optional()}).optional()},qt=W(`completion/complete`,Kt),Jt=W(`server/discover`,{}),Yt=O({toolsListChanged:y().optional(),promptsListChanged:y().optional(),resourcesListChanged:y().optional(),resourceSubscriptions:A(o()).optional()}),Xt={notifications:Yt},Zt=W(`subscriptions/listen`,Xt),Qt=ot.extend({"io.modelcontextprotocol/subscriptionId":c}),$t=h({_meta:Qt,resultType:at.default(`complete`)}),en={"tools/call":G(`tools/call`,Lt),"tools/list":G(`tools/list`,Rt),"prompts/get":G(`prompts/get`,{name:o(),arguments:g(o(),o()).optional()}),"prompts/list":G(`prompts/list`,Rt),"resources/list":G(`resources/list`,Rt),"resources/templates/list":G(`resources/templates/list`,Rt),"resources/read":G(`resources/read`,{uri:o()}),"completion/complete":G(`completion/complete`,Kt),"server/discover":G(`server/discover`,{}),"subscriptions/listen":G(`subscriptions/listen`,Xt)};function K(e){return h({_meta:st,...e})}let tn={"tools/call":K({content:A(ke),structuredContent:f().optional(),isError:y().optional()}),"tools/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),tools:A(tt),nextCursor:s.optional()}),"prompts/get":K({description:o().optional(),messages:A(Ae)}),"prompts/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),prompts:A(xe),nextCursor:s.optional()}),"resources/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resources:A(P),nextCursor:s.optional()}),"resources/templates/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resourceTemplates:A(_e),nextCursor:s.optional()}),"resources/read":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),contents:A(l([N,he]))}),"completion/complete":K({completion:O({values:A(o()).max(100),total:t().int().optional(),hasMore:y().optional()}).loose()}),"server/discover":K({ttlMs:t().int().min(0).catch(0),cacheScope:w([`public`,`private`]).catch(`private`),supportedVersions:A(o()),capabilities:$e,instructions:o().optional()}),"subscriptions/listen":K({})},nn=h({"io.modelcontextprotocol/subscriptionId":c.optional()}),rn=O({method:i(`notifications/subscriptions/acknowledged`),params:O({_meta:nn.optional(),notifications:Yt})}),an=O({_meta:nn.optional(),requestId:c,reason:o().optional()}),on=O({method:i(`notifications/cancelled`),params:an}),sn={"notifications/cancelled":on,"notifications/progress":de,"notifications/message":me,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":rn},cn=e=>O({jsonrpc:i(`2.0`),id:l([o(),t().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:n,ProgressTokenSchema:r,CursorSchema:s,RequestIdSchema:c,RoleSchema:u,LoggingLevelSchema:d,TaskMetadataSchema:v,RelatedTaskMetadataSchema:x,RequestMetaSchema:S,BaseRequestParamsSchema:C,TaskAugmentedRequestParamsSchema:T,NotificationsParamsSchema:E,NotificationSchema:D,IconSchema:ee,IconsSchema:te,BaseMetadataSchema:k,ImplementationSchema:ne,ClientTasksCapabilitySchema:oe,ServerTasksCapabilitySchema:se,ClientCapabilitiesSchema:ce,ServerCapabilitiesSchema:le,ProgressSchema:j,ProgressNotificationParamsSchema:ue,ProgressNotificationSchema:de,LoggingMessageNotificationParamsSchema:pe,LoggingMessageNotificationSchema:me,ResourceContentsSchema:M,TextResourceContentsSchema:N,BlobResourceContentsSchema:he,AnnotationsSchema:ge,ResourceSchema:P,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Le,ModelPreferencesSchema:ze,ToolChoiceSchema:I,BooleanSchemaSchema:Be,StringSchemaSchema:Ve,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:L,UntitledMultiSelectEnumSchemaSchema:Ke,TitledMultiSelectEnumSchemaSchema:R,MultiSelectEnumSchemaSchema:z,EnumSchemaSchema:B,PrimitiveSchemaDefinitionSchema:qe,ElicitRequestFormParamsSchema:V,ResourceTemplateReferenceSchema:Je,PromptReferenceSchema:Ye,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:$e,RequestMetaEnvelopeSchema:et,ToolSchema:tt,ToolResultContentSchema:nt,SamplingMessageContentBlockSchema:rt,SamplingMessageSchema:it,ResultTypeSchema:at,ResultMetaSchema:ot,ResultSchema:ct,PaginatedResultSchema:lt,CallToolResultSchema:ut,ListToolsResultSchema:dt,ListPromptsResultSchema:ft,GetPromptResultSchema:pt,ListResourcesResultSchema:mt,ListResourceTemplatesResultSchema:ht,ReadResourceResultSchema:gt,CompleteResultSchema:_t,CacheableResultSchema:vt,DiscoverResultSchema:yt,CreateMessageRequestParamsSchema:bt,CreateMessageRequestSchema:xt,ListRootsRequestSchema:St,CreateMessageResultSchema:Ct,ListRootsResultSchema:wt,ElicitResultSchema:Tt,ElicitRequestURLParamsSchema:Et,ElicitRequestParamsSchema:Dt,ElicitRequestSchema:Ot,InputRequestSchema:kt,InputResponseSchema:At,InputRequestsSchema:jt,InputResponsesSchema:Mt,InputRequiredResultSchema:Nt,InputResponseRequestParamsSchema:Ft,CallToolRequestSchema:zt,ListToolsRequestSchema:Bt,ListPromptsRequestSchema:Vt,GetPromptRequestSchema:Ht,ListResourcesRequestSchema:Ut,ListResourceTemplatesRequestSchema:Wt,ReadResourceRequestSchema:Gt,CompleteRequestSchema:qt,DiscoverRequestSchema:Jt,SubscriptionFilterSchema:Yt,SubscriptionsListenRequestSchema:Zt,SubscriptionsListenResultMetaSchema:Qt,SubscriptionsListenResultSchema:$t,dispatchRequestSchemas:en,dispatchResultSchemas:tn,NotificationMetaSchema:nn,SubscriptionsAcknowledgedNotificationSchema:rn,CancelledNotificationParamsSchema:an,CancelledNotificationSchema:on,notificationSchemas2026:sn,JSONRPCResultResponseSchema:cn(ct),CallToolResultResponseSchema:cn(l([ut,Nt])),ListToolsResultResponseSchema:cn(dt),ListPromptsResultResponseSchema:cn(ft),GetPromptResultResponseSchema:cn(l([pt,Nt])),ListResourcesResultResponseSchema:cn(mt),ListResourceTemplatesResultResponseSchema:cn(ht),ReadResourceResultResponseSchema:cn(l([gt,Nt])),CompleteResultResponseSchema:cn(_t),DiscoverResultResponseSchema:cn(yt),SubscriptionsListenResultResponseSchema:cn($t)}}var Ri;function zi(){return Ri??=Li()}var Bi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Vi(e){return Bi.includes(e)}var Hi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Ui(e){return e[Hi]}function Wi(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Gi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Xr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new qi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Ji({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ki(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Yi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ki=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},qi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Xi=0,Zi=`private`,Qi=[`tools/call`,`prompts/get`,`resources/read`];function $i(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||Qi.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function ea(e,t){let n=Ui(t);if(t.resultType!==`complete`||!Vi(e))return n===void 0?t:aa(t);let r=t,i=Wi(r.ttlMs)?r.ttlMs:ra(n),a=Gi(r.cacheScope)?r.cacheScope:ia(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Hi],o}function ta(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function na(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Fe]:t}}:!ta(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Fe]:t}}}function ra(e){return e!==void 0&&Wi(e.ttlMs)?e.ttlMs:Xi}function ia(e){return e!==void 0&&Gi(e.cacheScope)?e.cacheScope:Zi}function aa(e){let t={...e};return delete t[Hi],t}var oa=[`elicitation/create`,`sampling/createMessage`,`roots/list`],sa;function ca(){if(sa)return sa;let e=zi();return sa={request:{"elicitation/create":O({method:i(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":O({method:i(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":O({method:i(`roots/list`),params:h({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},sa}function la(e){return oa.includes(e)}function ua(e){return la(e)?ca().request[e]:void 0}function da(e){return la(e)?ca().response[e]:void 0}var fa={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},pa={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ma(e){return Object.prototype.hasOwnProperty.call(fa,e)}function ha(e){return Object.prototype.hasOwnProperty.call(pa,e)}function ga(e){return Object.prototype.hasOwnProperty.call(fa,e)}function _a(e){return ma(e)?zi().dispatchRequestSchemas[e]:void 0}function va(e){return ga(e)?zi().dispatchResultSchemas[e]:void 0}function ya(e){return ha(e)?zi().notificationSchemas2026[e]:void 0}Object.keys(fa),Object.keys(pa);function ba(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xa(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Sa={ok:!1,reason:`not-in-era`},Ca=[Ne,Ie];function wa(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>ba(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!ba(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(ba(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Ta={era:`2026-07-28`,hasRequestMethod:ma,hasNotificationMethod:ha,hasInputRequestMethod:e=>ua(e)!==void 0,validateRequest:(e,t)=>xa(_a(e),t),validateResult:(e,t)=>xa(va(e),t),validateNotification:(e,t)=>xa(ya(e),t),validateInputRequest:(e,t)=>xa(ua(e),t),validateInputResponse:(e,t)=>xa(da(e),t),samplingResultVariant:()=>Sa,outboundEnvelope(e){return{[Ne]:e.protocolVersion,[Pe]:e.clientInfo,[Ie]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ca)n in e||t.push({key:n,problem:`missing`});let n=zi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>li(e),inputRequestSchema:ua,decodeResult(e,t){if(!ba(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=ba(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:zi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=Da(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return na(ea(e,$i(e,wa(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=zi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Ea;function Da(){if(Ea)return Ea;let e=zi();return Ea={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Ea}var Oa=`2026-07-28`;function ka(e){return e!==void 0&&oi(e)?Ta:Ii}function Aa(e){return e.revision===void 0?e.era===`modern`?Ta.era:Ii.era:ka(e.revision).era}function ja(e){return Pa.some(t=>t.hasRequestMethod(e))}function Ma(e){return Pa.some(t=>t.hasNotificationMethod(e))}function Na(e){return e===`tasks/get`||e===`tasks/cancel`}var Pa=[Ii,Ta],Fa=xe({AnnotationsSchema:()=>At,AudioContentSchema:()=>sn,BaseMetadataSchema:()=>at,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>Ot,BooleanSchemaSchema:()=>Hn,CallToolRequestParamsSchema:()=>Sn,CallToolRequestSchema:()=>Cn,CallToolResultSchema:()=>bn,CancelTaskRequestSchema:()=>Or,CancelTaskResultSchema:()=>kr,CancelledNotificationParamsSchema:()=>tt,CancelledNotificationSchema:()=>nt,ClientCapabilitiesSchema:()=>ut,ClientNotificationSchema:()=>jr,ClientRequestSchema:()=>Ar,ClientResultSchema:()=>Mr,ClientTasksCapabilitySchema:()=>ct,CompatibilityCallToolResultSchema:()=>xn,CompleteRequestParamsSchema:()=>lr,CompleteRequestSchema:()=>ur,CompleteResultSchema:()=>dr,ContentBlockSchema:()=>dn,CreateMessageRequestParamsSchema:()=>Rn,CreateMessageRequestSchema:()=>zn,CreateMessageResultSchema:()=>Bn,CreateMessageResultWithToolsSchema:()=>Vn,CreateTaskResultSchema:()=>yr,CursorSchema:()=>He,DiscoverRequestSchema:()=>gt,DiscoverResultSchema:()=>_t,ElicitRequestFormParamsSchema:()=>er,ElicitRequestParamsSchema:()=>nr,ElicitRequestSchema:()=>rr,ElicitRequestURLParamsSchema:()=>tr,ElicitResultSchema:()=>or,ElicitationCompleteNotificationParamsSchema:()=>ir,ElicitationCompleteNotificationSchema:()=>ar,EmbeddedResourceSchema:()=>ln,EmptyResultSchema:()=>et,EnumSchemaSchema:()=>Qn,GetPromptRequestParamsSchema:()=>nn,GetPromptRequestSchema:()=>rn,GetPromptResultSchema:()=>pn,GetTaskPayloadRequestSchema:()=>wr,GetTaskPayloadResultSchema:()=>Tr,GetTaskRequestSchema:()=>Sr,GetTaskResultSchema:()=>Cr,IconSchema:()=>rt,IconsSchema:()=>it,ImageContentSchema:()=>on,ImplementationSchema:()=>ot,InitializeRequestParamsSchema:()=>dt,InitializeRequestSchema:()=>ft,InitializeResultSchema:()=>mt,InitializedNotificationSchema:()=>ht,JSONArraySchema:()=>Be,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>Qe,JSONRPCMessageSchema:()=>H,JSONRPCNotificationSchema:()=>Xe,JSONRPCRequestSchema:()=>Ye,JSONRPCResponseSchema:()=>$e,JSONRPCResultResponseSchema:()=>Ze,JSONValueSchema:()=>ze,LegacyTitledEnumSchemaSchema:()=>qn,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>K,ListPromptsResultSchema:()=>tn,ListResourceTemplatesRequestSchema:()=>Ft,ListResourceTemplatesResultSchema:()=>It,ListResourcesRequestSchema:()=>Nt,ListResourcesResultSchema:()=>Pt,ListRootsRequestSchema:()=>pr,ListRootsResultSchema:()=>mr,ListTasksRequestSchema:()=>Er,ListTasksResultSchema:()=>Dr,ListToolsRequestSchema:()=>vn,ListToolsResultSchema:()=>yn,LoggingLevelSchema:()=>En,LoggingMessageNotificationParamsSchema:()=>kn,LoggingMessageNotificationSchema:()=>An,ModelHintSchema:()=>jn,ModelPreferencesSchema:()=>Mn,MultiSelectEnumSchemaSchema:()=>Zn,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Wn,PaginatedRequestParamsSchema:()=>St,PaginatedRequestSchema:()=>Ct,PaginatedResultSchema:()=>wt,PingRequestSchema:()=>vt,PrimitiveSchemaDefinitionSchema:()=>$n,ProgressNotificationParamsSchema:()=>bt,ProgressNotificationSchema:()=>xt,ProgressSchema:()=>yt,ProgressTokenSchema:()=>Ve,PromptArgumentSchema:()=>$t,PromptListChangedNotificationSchema:()=>mn,PromptMessageSchema:()=>fn,PromptReferenceSchema:()=>cr,PromptSchema:()=>en,ReadResourceRequestParamsSchema:()=>G,ReadResourceRequestSchema:()=>Lt,ReadResourceResultSchema:()=>Rt,RelatedTaskMetadataSchema:()=>We,RequestIdSchema:()=>Je,RequestMetaSchema:()=>Ge,RequestSchema:()=>R,ResourceContentsSchema:()=>Tt,ResourceLinkSchema:()=>un,ResourceListChangedNotificationSchema:()=>zt,ResourceRequestParamsSchema:()=>W,ResourceSchema:()=>jt,ResourceTemplateReferenceSchema:()=>sr,ResourceTemplateSchema:()=>Mt,ResourceUpdatedNotificationParamsSchema:()=>Zt,ResourceUpdatedNotificationSchema:()=>Qt,ResultMetaObjectSchema:()=>qe,ResultSchema:()=>V,RoleSchema:()=>kt,RootSchema:()=>fr,RootsListChangedNotificationSchema:()=>hr,SamplingContentSchema:()=>Fn,SamplingMessageContentBlockSchema:()=>In,SamplingMessageSchema:()=>Ln,ServerCapabilitiesSchema:()=>pt,ServerNotificationSchema:()=>Pr,ServerRequestSchema:()=>Nr,ServerResultSchema:()=>Fr,ServerTasksCapabilitySchema:()=>lt,SetLevelRequestParamsSchema:()=>Dn,SetLevelRequestSchema:()=>On,SingleSelectEnumSchemaSchema:()=>Jn,StringSchemaSchema:()=>Un,SubscribeRequestParamsSchema:()=>Bt,SubscribeRequestSchema:()=>Vt,SubscriptionFilterSchema:()=>Wt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>qt,SubscriptionsAcknowledgedNotificationSchema:()=>Jt,SubscriptionsListenRequestParamsSchema:()=>Gt,SubscriptionsListenRequestSchema:()=>Kt,SubscriptionsListenResultMetaSchema:()=>Yt,SubscriptionsListenResultSchema:()=>Xt,TaskAugmentedRequestParamsSchema:()=>Ke,TaskCreationParamsSchema:()=>gr,TaskMetadataSchema:()=>Ue,TaskSchema:()=>vr,TaskStatusNotificationParamsSchema:()=>br,TaskStatusNotificationSchema:()=>xr,TaskStatusSchema:()=>_r,TextContentSchema:()=>an,TextResourceContentsSchema:()=>Et,TitledMultiSelectEnumSchemaSchema:()=>Xn,TitledSingleSelectEnumSchemaSchema:()=>Kn,ToolAnnotationsSchema:()=>hn,ToolChoiceSchema:()=>Nn,ToolExecutionSchema:()=>gn,ToolListChangedNotificationSchema:()=>wn,ToolResultContentSchema:()=>Pn,ToolSchema:()=>_n,ToolUseContentSchema:()=>cn,UnsubscribeRequestParamsSchema:()=>Ht,UnsubscribeRequestSchema:()=>Ut,UntitledMultiSelectEnumSchemaSchema:()=>Yn,UntitledSingleSelectEnumSchemaSchema:()=>Gn}),Ia=e=>Ye.safeParse(e).success,La=e=>Xe.safeParse(e).success,Ra=e=>Ze.safeParse(e).success,za=e=>Qe.safeParse(e).success,Ba=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Va=e=>ft.safeParse(e).success,Ha=e=>ht.safeParse(e).success,Ua=`Mcp-Param-`,Wa=`x-mcp-header`,Ga=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ka=new Set([`string`,`integer`,`boolean`]);function qa(e){let t=[],n=new Map,r,i=(e,a,o)=>{if(typeof e!=`object`||!e)return;let s=e;if(Wa in s){if(!o||a.length===0)return`${Xa(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=s[Wa];if(typeof e!=`string`||e.length===0)return`${Xa(a)}: x-mcp-header MUST be a non-empty string`;if(!Ga.test(e))return`${Xa(a)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let i=typeof s.type==`string`?s.type:void 0;if(i===void 0||!Ka.has(i)){let e=`${Xa(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${i??``}`;if(i!==`number`)return e;r??=e}let c=e.toLowerCase(),l=n.get(c);if(l!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${l}')`;n.set(c,e),t.push({path:a,headerName:e,type:i})}let c=s.properties;if(typeof c==`object`&&c)for(let[e,t]of Object.entries(c)){let n=i(t,[...a,e],o);if(n!==void 0)return n}for(let e of Ja){let t=s[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Ya.has(e)?Object.values(t):[t];for(let t of n){let n=i(t,[...a,`<${e}>`],!1);if(n!==void 0)return n}}},a=i(e,[],!0);return a===void 0?r===void 0?{valid:!0,declarations:t}:{valid:!1,reason:r,declarations:t}:{valid:!1,reason:r??a}}var Ja=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Ya=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Xa(e){return e.length===0?``:e.join(`.`)}var Za=`=?base64?`,Qa=`?=`;function $a(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function eo(e){if(e.length===0||e.startsWith(Za)&&e.endsWith(Qa)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function to(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function no(e){return eo(e)?`${Za}${to(e)}${Qa}`:e}function ro(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function io(e,t){let n={};for(let r of e){let e=ro(t,r.path);if(e==null)continue;let i=$a(e);i!==void 0&&(n[`${Ua}${r.headerName}`]=no(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var ao={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function oo(e,t){let n=Object.hasOwn(ao,e)?ao[e]:void 0;if(n===void 0)return;let r=so(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function so(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function co(e,t){return le(e,t)}function lo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function uo(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var fo=!1,po=`draft-2020-12`;function mo(e,t=`input`){let r=e[`~standard`],i;if(r.jsonSchema)i=r.jsonSchema[t]({target:po});else if(r.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);fo||(fo=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),i=n(e,{target:po,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return i.type===void 0&&go(i)?{type:`object`,...i}:i;if(i.type!==void 0&&i.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(i.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...i}}var ho=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function go(e,t=e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;let n=typeof e.$ref==`string`&&ho.exec(e.$ref);if(n&&t[n[1]]?.[n[2]]?.type===`object`)return!0;for(let n of[`oneOf`,`anyOf`,`allOf`]){let r=e[n];if(Array.isArray(r)&&r.length>0)return r.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||go(e,`$id`in e?{}:t)))}return!1}function _o(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function vo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>_o(e)).join(`, `)}:{success:!0,data:n.value}}function yo(e){let t=n(e,{target:po,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var bo=/\\\.\\d\{(\d+)\}/;function xo(e){let t=bo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>fe({local:e,offset:t,precision:n}))))}function So(e,t){let n;switch(e){case`email`:n=[oe()];break;case`uri`:n=[v()];break;case`date`:n=[pe()];break;case`date-time`:n=xo(t)}return new Set(n.map(e=>yo(e)).filter(e=>e!==void 0))}function Co(e,t,n){return n!==`zod`||So(e,t).has(t)}function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e){try{return mo(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Eo=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Do(e){return Eo.has(e)||e.startsWith(`x-`)}var Oo=new Set([`$schema`,...Object.keys(er.shape.requestedSchema.shape)]),ko={string:lo([Un,Gn,Kn,qn]),number:lo([Wn]),integer:lo([Wn]),boolean:lo([Hn]),array:lo([Yn,Xn])},Ao=new Set(Un.shape.format.unwrap().options);function jo(e,t,n,r){if(!wo(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(ko,e.type)?ko[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Do(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ao.has(e.format)?typeof s==`string`&&Co(e.format,s,n)||r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Mo(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&wo(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,jo(n,`properties.${e}`,t,r)])):Oo.has(i)?n[i]=a:Do(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function No(e,t){if(!wo(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!co($n,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Po(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Po(e,t[r],`${n}[${r}]`)):!wo(e)||!wo(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Po(r,t[e],i):Do(e)?[]:[i]})}function Fo(e){if(!uo(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Mo(To(e.requestedSchema),t),r=co(er.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${No(n,r.error.message)}`);let i=Po(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Io(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Io,{elicit(e){try{return{method:`elicitation/create`,params:Fo(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Lo=!0,Ro=10,zo=250;function Bo(e){return{autoFulfill:e?.autoFulfill??Lo,maxRounds:e?.maxRounds??Ro}}function Vo(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Ho(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Uo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Wo(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Go(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Ho(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Wo(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Uo(zo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Vo(r,u,c.requestState),d);if(Ba(f))c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};else return f}}var Ko=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),qo={IdJagTokenExchangeResponseSchema:Vr,OAuthClientInformationFullSchema:Kr,OAuthClientInformationSchema:Gr,OAuthClientMetadataSchema:Wr,OAuthClientRegistrationErrorSchema:qr,OAuthErrorResponseSchema:Hr,OAuthMetadataSchema:Lr,OAuthProtectedResourceMetadataSchema:Ir,OAuthTokenRevocationRequestSchema:Jr,OAuthTokensSchema:Br,OpenIdProviderDiscoveryMetadataSchema:zr,OpenIdProviderMetadataSchema:Rr},Jo={},Yo={};function Xo(e,t){let n=e.slice(0,-6);Jo[n]=t,Yo[n]=e=>t.safeParse(e).success}for(let e of Ko)Xo(e,Fa[e]);for(let[e,t]of Object.entries(qo))Xo(e,t);Object.freeze(Jo);var Zo=Object.freeze(Yo);function Qo(e){switch(e){case`initialize`:case`notifications/initialized`:return ka(void 0);case`server/discover`:return ka(Oa);default:return}}var $o=[Ne,Pe,Ie,Re],es=[`inputResponses`,`requestState`];function ts(e,t){let n=e.params;if(!os(n))return{message:e,lifted:{}};let r=n._meta,i=os(r)?$o.filter(e=>e in r):[],a=t===`request`?es.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&os(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function ns(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function rs(e){return()=>e}var is=rs(void 0),as=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??je,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Ra(e)||za(e)?this._onresponse(e):Ia(e)?this._onrequest(e,t):La(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ts(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Aa(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Ma(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ts(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Aa(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(ja(n.method)&&!i.hasRequestMethod(n.method)&&!(Na(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:ls(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?is:rs(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),uo(t))return u(e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);n===void 0?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ra(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(uo(t))return Na(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ka(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qo(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ja(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(hs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}vo(n,a.result).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Ma(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))})}else await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!ja(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await vo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Ma(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))})}else{if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await vo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ss(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=os(a)&&os(i)?{...a,...i}:i}return n}function cs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ls(e){let t={},n=[];if(!cs(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e))!cs(i)||`method`in i||`result`in i?n.push(r):t[r]=i;return{accepted:t,droppedKeys:n}}function us(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function ds(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:rs(void 0),signal:r,send:(()=>us(`send`)),notify:()=>us(`notify`)}}}async function fs(e,t,n,r,i){if(!cs(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=cs(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(ds(n,a,s,i,e.sessionId)))}function ps(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function ms(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>fs(e,i,t,n,r),retry:(e,t)=>r.retry(e,ps(o,t))};return Go({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function hs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var gs=Ce(F((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function _s(e){if(e)try{return gs.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function vs(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ys(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...vs(t.headers),...vs(r.headers)}:t.headers}):e}var bs=new Set([301,302,303,307,308]),xs=5;function Ss(e,t){return e.protocol===t.protocol&&e.host===t.host||e.protocol===`http:`&&t.protocol===`https:`&&e.hostname===t.hostname&&!e.port&&!t.port}function Cs(e,t){let n=bs.has(t.status)?t.headers?.get(`location`):void 0;if(n)try{return new URL(n,e)}catch{return}}var ws=new WeakSet;function Ts(e){let t=(t,n)=>e(t,n);return ws.add(t),t}function Es(e){return ws.has(e)?e:async(t,n)=>{if(n?.redirect===`error`||n?.redirect===`manual`)return e(t,n);let r=(n?.method??`GET`).toUpperCase(),i=t;for(let t=0;;t++){let a=await e(i,{...n,redirect:`manual`}),o=Cs(i,a);if(!o||t===xs)return a;let s=new URL(i),c=r===`GET`||a.status===307||a.status===308,l=!(o.username||o.password)||o.username===s.username&&o.password===s.password;if(!c||!l||!Ss(s,o))return a;await a.text?.().catch(()=>{}),i=o}}}function Ds(e,t){if(t.type===`opaqueredirect`)return`Redirect not followed: this runtime does not expose where it points`;let n=Cs(t.url||e,t);if(n)return n.username=n.password=n.search=n.hash=``,n.protocol===`http:`&&new URL(t.url||e).protocol===`https:`?(n.protocol=`https:`,`Redirect from https to plain http not followed; try ${n.href} as the endpoint`):`Redirect to ${n.href} not followed; use that URL as the endpoint if it is the intended server`}function Os(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Fs(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ns[i])continue;let a=`${r}/${ks(i)}`,o=e[i];if(Array.isArray(o)){if(js[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Hs=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Us=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Ws=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Gs=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Ks=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,qs=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Js=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Ys=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Xs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Zs(e){return e.test.bind(e)}var Qs={date:ec,time:tc.bind(void 0,!1),"date-time":rc,duration:Xs,uri:oc,"uri-reference":Zs(Bs),"uri-template":Zs(Vs),url:Zs(Hs),email:qs,hostname:Zs(zs),ipv4:Zs(Js),ipv6:Zs(Ys),regex:cc,uuid:Zs(Us),"json-pointer":Zs(Ws),"json-pointer-uri-fragment":Zs(Gs),"relative-json-pointer":Zs(Ks)};function $s(e){return e%4==0&&(e%100!=0||e%400==0)}function ec(e){let t=e.match(Is);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&$s(n)?29:Ls[r])}function tc(e,t){let n=t.match(Rs);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var nc=/t|\s/i;function rc(e){let t=e.split(nc);return t.length==2&&ec(t[0])&&tc(!0,t[1])}var ic=/\/|:/,ac=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function oc(e){return ic.test(e)&&ac.test(e)}var sc=/[^\\]\\Z/;function cc(e){if(sc.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function lc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&r{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function he(e){let t=M(M(M(e)?.ui)?.csp),n=N(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=N(t?.resourceDomains,[`http`,`https`]),i=N(t?.frameDomains,[`http`,`https`]),a=N(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var ge=Object.create,P=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,ve=Object.getOwnPropertyNames,ye=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xe=(e,t)=>{let n={};for(var r in e)P(n,r,{get:e[r],enumerable:!0});return t&&P(n,Symbol.toStringTag,{value:`Module`}),n},Se=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ve(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=_e(t,s))||r.enumerable});return e},Ce=(e,t,n)=>(n=e==null?{}:ge(ye(e)),Se(t||!e||!e.__esModule?P(n,`default`,{value:e,enumerable:!0}):n,e)),we=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),Te=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Ee=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),De=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Oe(e){return typeof e==`string`&&Te.has(e.replace(/#$/,``))}function ke(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(we.has(n))return`2020-12`;if(Te.has(n))return`2019-09`;if(Ee.has(n)||De.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Ae=`2025-11-25`,je=[Ae,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Me=`io.modelcontextprotocol/related-task`,Ne=`io.modelcontextprotocol/protocolVersion`,Pe=`io.modelcontextprotocol/clientInfo`,Fe=`io.modelcontextprotocol/serverInfo`,Ie=`io.modelcontextprotocol/clientCapabilities`,Le=`io.modelcontextprotocol/subscriptionId`,Re=`io.modelcontextprotocol/logLevel`,ze=a(()=>l([o(),t(),y(),ae(),g(o(),ze),A(ze)])),I=g(o(),ze),Be=A(ze),Ve=l([o(),t().int()]),He=o(),Ue=O({ttl:t().optional()}),We=O({taskId:o()}),Ge=h({progressToken:Ve.optional(),[Me]:We.optional()}),L=O({_meta:Ge.optional()}),Ke=L.extend({task:Ue.optional()}),R=O({method:o(),params:L.loose().optional()}),z=O({_meta:Ge.optional()}),B=O({method:o(),params:z.loose().optional()}),qe=h({get[Fe](){return ot.optional().catch(void 0)}}),V=h({_meta:qe.optional()}),Je=l([o(),t().int()]),Ye=O({jsonrpc:i(`2.0`),id:Je,...R.shape}).strict(),Xe=O({jsonrpc:i(`2.0`),...B.shape}).strict(),Ze=O({jsonrpc:i(`2.0`),id:Je,result:V}).strict(),Qe=O({jsonrpc:i(`2.0`),id:Je.optional(),error:O({code:t().int(),message:o(),data:f().optional()})}).strict(),H=l([Ye,Xe,Ze,Qe]),$e=l([Ze,Qe]),et=V.strict(),tt=z.extend({requestId:Je.optional(),reason:o().optional()}),nt=B.extend({method:i(`notifications/cancelled`),params:tt}),rt=O({src:o(),mimeType:o().optional(),sizes:A(o()).optional(),theme:w([`light`,`dark`]).optional()}),it=O({icons:A(rt).optional()}),at=O({name:o(),title:o().optional()}),ot=at.extend({...at.shape,...it.shape,version:o(),websiteUrl:o().optional(),description:o().optional()}),st=b(O({applyDefaults:y().optional()}),I),U=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,b(O({form:st.optional(),url:I.optional()}),I.optional())),ct=h({list:I.optional(),cancel:I.optional(),requests:h({sampling:h({createMessage:I.optional()}).optional(),elicitation:h({create:I.optional()}).optional()}).optional()}),lt=h({list:I.optional(),cancel:I.optional(),requests:h({tools:h({call:I.optional()}).optional()}).optional()}),ut=O({experimental:g(o(),I).optional(),sampling:O({context:I.optional(),tools:I.optional()}).optional(),elicitation:U.optional(),roots:O({listChanged:y().optional()}).optional(),tasks:ct.optional(),extensions:g(o(),I).optional()}),dt=L.extend({protocolVersion:o(),capabilities:ut,clientInfo:ot}),ft=R.extend({method:i(`initialize`),params:dt}),pt=O({experimental:g(o(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:O({listChanged:y().optional()}).optional(),resources:O({subscribe:y().optional(),listChanged:y().optional()}).optional(),tools:O({listChanged:y().optional()}).optional(),tasks:lt.optional(),extensions:g(o(),I).optional()}),mt=V.extend({protocolVersion:o(),capabilities:pt,serverInfo:ot,instructions:o().optional()}),ht=B.extend({method:i(`notifications/initialized`),params:z.optional()}),gt=R.extend({method:i(`server/discover`),params:L.optional()}),_t=V.extend({supportedVersions:A(o()),capabilities:pt,instructions:o().optional()}),vt=R.extend({method:i(`ping`),params:L.optional()}),yt=O({progress:t(),total:p(t()),message:p(o())}),bt=O({...z.shape,...yt.shape,progressToken:Ve}),xt=B.extend({method:i(`notifications/progress`),params:bt}),St=L.extend({cursor:He.optional()}),Ct=R.extend({params:St.optional()}),wt=V.extend({nextCursor:He.optional()}),Tt=O({uri:o(),mimeType:p(o()),_meta:g(o(),f()).optional()}),Et=Tt.extend({text:o()}),Dt=o().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ot=Tt.extend({blob:Dt}),kt=w([`user`,`assistant`]),At=O({audience:A(kt).optional(),priority:t().min(0).max(1).optional(),lastModified:fe({offset:!0}).optional()}),jt=O({...at.shape,...it.shape,uri:o(),description:p(o()),mimeType:p(o()),size:p(t()),annotations:At.optional(),_meta:p(h({}))}),Mt=O({...at.shape,...it.shape,uriTemplate:o(),description:p(o()),mimeType:p(o()),annotations:At.optional(),_meta:p(h({}))}),Nt=Ct.extend({method:i(`resources/list`)}),Pt=wt.extend({resources:A(jt)}),Ft=Ct.extend({method:i(`resources/templates/list`)}),It=wt.extend({resourceTemplates:A(Mt)}),W=L.extend({uri:o()}),G=W,Lt=R.extend({method:i(`resources/read`),params:G}),Rt=V.extend({contents:A(l([Et,Ot]))}),zt=B.extend({method:i(`notifications/resources/list_changed`),params:z.optional()}),Bt=W,Vt=R.extend({method:i(`resources/subscribe`),params:Bt}),Ht=W,Ut=R.extend({method:i(`resources/unsubscribe`),params:Ht}),Wt=O({toolsListChanged:y().optional(),promptsListChanged:y().optional(),resourcesListChanged:y().optional(),resourceSubscriptions:A(o()).optional()}),Gt=L.extend({notifications:Wt}),Kt=R.extend({method:i(`subscriptions/listen`),params:Gt}),qt=z.extend({notifications:Wt}),Jt=B.extend({method:i(`notifications/subscriptions/acknowledged`),params:qt}),Yt=qe.extend({[Le]:Je}),Xt=V.extend({_meta:Yt}),Zt=z.extend({uri:o()}),Qt=B.extend({method:i(`notifications/resources/updated`),params:Zt}),$t=O({name:o(),description:p(o()),required:p(y())}),en=O({...at.shape,...it.shape,description:p(o()),arguments:p(A($t)),_meta:p(h({}))}),K=Ct.extend({method:i(`prompts/list`)}),tn=wt.extend({prompts:A(en)}),nn=L.extend({name:o(),arguments:g(o(),o()).optional()}),rn=R.extend({method:i(`prompts/get`),params:nn}),an=O({type:i(`text`),text:o(),annotations:At.optional(),_meta:g(o(),f()).optional()}),on=O({type:i(`image`),data:Dt,mimeType:o(),annotations:At.optional(),_meta:g(o(),f()).optional()}),sn=O({type:i(`audio`),data:Dt,mimeType:o(),annotations:At.optional(),_meta:g(o(),f()).optional()}),cn=O({type:i(`tool_use`),name:o(),id:o(),input:g(o(),f()),_meta:g(o(),f()).optional()}),ln=O({type:i(`resource`),resource:l([Et,Ot]),annotations:At.optional(),_meta:g(o(),f()).optional()}),un=jt.extend({type:i(`resource_link`)}),dn=l([an,on,sn,un,ln]),fn=O({role:kt,content:dn}),pn=V.extend({description:o().optional(),messages:A(fn)}),mn=B.extend({method:i(`notifications/prompts/list_changed`),params:z.optional()}),hn=O({title:o().optional(),readOnlyHint:y().optional(),destructiveHint:y().optional(),idempotentHint:y().optional(),openWorldHint:y().optional()}),gn=O({taskSupport:w([`required`,`optional`,`forbidden`]).optional()}),_n=O({...at.shape,...it.shape,description:o().optional(),inputSchema:O({type:i(`object`),properties:g(o(),ze).optional(),required:A(o()).optional()}).catchall(f()),outputSchema:h({$schema:o().optional()}).optional(),annotations:hn.optional(),execution:gn.optional(),_meta:g(o(),f()).optional()}),vn=Ct.extend({method:i(`tools/list`)}),yn=wt.extend({tools:A(_n)}),bn=V.extend({content:A(dn).default([]),structuredContent:f().optional(),isError:y().optional()}),xn=bn.or(V.extend({toolResult:f()})),Sn=Ke.extend({name:o(),arguments:g(o(),f()).optional()}),Cn=R.extend({method:i(`tools/call`),params:Sn}),wn=B.extend({method:i(`notifications/tools/list_changed`),params:z.optional()}),Tn=O({autoRefresh:y().default(!0),debounceMs:t().int().nonnegative().default(300)}),En=w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Dn=L.extend({level:En}),On=R.extend({method:i(`logging/setLevel`),params:Dn}),kn=z.extend({level:En,logger:o().optional(),data:f()}),An=B.extend({method:i(`notifications/message`),params:kn}),jn=O({name:o().optional()}),Mn=O({hints:A(jn).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),Nn=O({mode:w([`auto`,`required`,`none`]).optional()}),Pn=O({type:i(`tool_result`),toolUseId:o().describe(`The unique identifier for the corresponding tool call.`),content:A(dn),structuredContent:f().optional(),isError:y().optional(),_meta:g(o(),f()).optional()}),Fn=r(`type`,[an,on,sn]),In=r(`type`,[an,on,sn,cn,Pn]),Ln=O({role:kt,content:l([In,A(In)]),_meta:g(o(),f()).optional()}),Rn=Ke.extend({messages:A(Ln),modelPreferences:Mn.optional(),systemPrompt:o().optional(),includeContext:w([`none`,`thisServer`,`allServers`]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:A(o()).optional(),metadata:I.optional(),tools:A(_n).optional(),toolChoice:Nn.optional()}),zn=R.extend({method:i(`sampling/createMessage`),params:Rn}),Bn=V.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`]).or(o())),role:kt,content:Fn}),Vn=V.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(o())),role:kt,content:l([In,A(In)])}),Hn=O({type:i(`boolean`),title:o().optional(),description:o().optional(),default:y().optional()}),Un=O({type:i(`string`),title:o().optional(),description:o().optional(),minLength:t().optional(),maxLength:t().optional(),format:w([`email`,`uri`,`date`,`date-time`]).optional(),default:o().optional()}),Wn=O({type:w([`number`,`integer`]),title:o().optional(),description:o().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),Gn=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),default:o().optional()}),Kn=O({type:i(`string`),title:o().optional(),description:o().optional(),oneOf:A(O({const:o(),title:o()})),default:o().optional()}),qn=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),enumNames:A(o()).optional(),default:o().optional()}),Jn=l([Gn,Kn]),Yn=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({type:i(`string`),enum:A(o())}),default:A(o()).optional()}),Xn=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({anyOf:A(O({const:o(),title:o()}))}),default:A(o()).optional()}),Zn=l([Yn,Xn]),Qn=l([qn,Jn,Zn]),$n=l([Qn,Hn,Un,Wn]),er=Ke.extend({mode:i(`form`).optional(),message:o(),requestedSchema:O({type:i(`object`),properties:g(o(),$n),required:A(o()).optional()}).catchall(f())}),tr=Ke.extend({mode:i(`url`),message:o(),elicitationId:o(),url:o().url()}),nr=l([er,tr]),rr=R.extend({method:i(`elicitation/create`),params:nr}),ir=z.extend({elicitationId:o()}),ar=B.extend({method:i(`notifications/elicitation/complete`),params:ir}),or=V.extend({action:w([`accept`,`decline`,`cancel`]),content:m(e=>e===null?void 0:e,g(o(),l([o(),t(),y(),A(o())])).optional())}),sr=O({type:i(`ref/resource`),uri:o()}),cr=O({type:i(`ref/prompt`),name:o()}),lr=L.extend({ref:l([cr,sr]),argument:O({name:o(),value:o()}),context:O({arguments:g(o(),o()).optional()}).optional()}),ur=R.extend({method:i(`completion/complete`),params:lr}),dr=V.extend({completion:h({values:A(o()).max(100),total:p(t().int()),hasMore:p(y())})}),fr=O({uri:o().startsWith(`file://`),name:o().optional(),_meta:g(o(),f()).optional()}),pr=R.extend({method:i(`roots/list`),params:L.optional()}),mr=V.extend({roots:A(fr)}),hr=B.extend({method:i(`notifications/roots/list_changed`),params:z.optional()}),gr=h({ttl:t().optional(),pollInterval:t().optional()}),_r=w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),vr=O({taskId:o(),status:_r,ttl:l([t(),ae()]),createdAt:o(),lastUpdatedAt:o(),pollInterval:p(t()),statusMessage:p(o())}),yr=V.extend({task:vr}),br=z.merge(vr),xr=B.extend({method:i(`notifications/tasks/status`),params:br}),Sr=R.extend({method:i(`tasks/get`),params:L.extend({taskId:o()})}),Cr=V.merge(vr),wr=R.extend({method:i(`tasks/result`),params:L.extend({taskId:o()})}),Tr=V.loose(),Er=Ct.extend({method:i(`tasks/list`)}),Dr=wt.extend({tasks:A(vr)}),Or=R.extend({method:i(`tasks/cancel`),params:L.extend({taskId:o()})}),kr=V.merge(vr),Ar=l([vt,ft,gt,ur,On,rn,K,Nt,Ft,Lt,Vt,Ut,Kt,Cn,vn]),jr=l([nt,xt,ht,hr]),Mr=l([et,Bn,Vn,or,mr]),Nr=l([vt,zn,rr,pr]),Pr=l([nt,xt,An,Qt,zt,wn,mn,Jt,ar]),Fr=l([et,mt,_t,dr,pn,tn,Pt,It,Rt,bn,yn,Xt]),q=v().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:ue.custom,message:`URL must be parseable`,fatal:!0}),C}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Ir=h({resource:o().url(),authorization_servers:A(q).optional(),jwks_uri:o().url().optional(),scopes_supported:A(o()).optional(),bearer_methods_supported:A(o()).optional(),resource_signing_alg_values_supported:A(o()).optional(),resource_name:o().optional(),resource_documentation:o().optional(),resource_policy_uri:o().url().optional(),resource_tos_uri:o().url().optional(),tls_client_certificate_bound_access_tokens:y().optional(),authorization_details_types_supported:A(o()).optional(),dpop_signing_alg_values_supported:A(o()).optional(),dpop_bound_access_tokens_required:y().optional()}),Lr=h({issuer:o(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:A(o()).optional(),response_types_supported:A(o()),response_modes_supported:A(o()).optional(),grant_types_supported:A(o()).optional(),token_endpoint_auth_methods_supported:A(o()).optional(),token_endpoint_auth_signing_alg_values_supported:A(o()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:A(o()).optional(),revocation_endpoint_auth_signing_alg_values_supported:A(o()).optional(),introspection_endpoint:o().optional(),introspection_endpoint_auth_methods_supported:A(o()).optional(),introspection_endpoint_auth_signing_alg_values_supported:A(o()).optional(),code_challenge_methods_supported:A(o()).optional(),client_id_metadata_document_supported:y().optional(),authorization_response_iss_parameter_supported:y().optional().catch(void 0),dpop_signing_alg_values_supported:A(o()).optional()}),Rr=h({issuer:o(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:A(o()).optional(),response_types_supported:A(o()),response_modes_supported:A(o()).optional(),grant_types_supported:A(o()).optional(),acr_values_supported:A(o()).optional(),subject_types_supported:A(o()),id_token_signing_alg_values_supported:A(o()),id_token_encryption_alg_values_supported:A(o()).optional(),id_token_encryption_enc_values_supported:A(o()).optional(),userinfo_signing_alg_values_supported:A(o()).optional(),userinfo_encryption_alg_values_supported:A(o()).optional(),userinfo_encryption_enc_values_supported:A(o()).optional(),request_object_signing_alg_values_supported:A(o()).optional(),request_object_encryption_alg_values_supported:A(o()).optional(),request_object_encryption_enc_values_supported:A(o()).optional(),token_endpoint_auth_methods_supported:A(o()).optional(),token_endpoint_auth_signing_alg_values_supported:A(o()).optional(),display_values_supported:A(o()).optional(),claim_types_supported:A(o()).optional(),claims_supported:A(o()).optional(),service_documentation:o().optional(),claims_locales_supported:A(o()).optional(),ui_locales_supported:A(o()).optional(),claims_parameter_supported:y().optional(),request_parameter_supported:y().optional(),request_uri_parameter_supported:y().optional(),require_request_uri_registration:y().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:y().optional(),authorization_response_iss_parameter_supported:y().optional().catch(void 0)}),zr=O({...Rr.shape,...Lr.pick({code_challenge_methods_supported:!0}).shape}),Br=O({access_token:o(),id_token:o().optional(),token_type:o(),expires_in:me().optional(),scope:o().optional(),refresh_token:o().optional(),issuer:o().optional().catch(void 0)}).strip(),Vr=O({issued_token_type:i(`urn:ietf:params:oauth:token-type:id-jag`),access_token:o(),token_type:o().optional(),expires_in:t().optional(),scope:o().optional()}).strip(),Hr=O({error:o(),error_description:o().optional(),error_uri:o().optional()}),Ur=q.optional().or(i(``).transform(()=>void 0)),Wr=O({redirect_uris:A(q),token_endpoint_auth_method:o().optional(),grant_types:A(o()).optional(),response_types:A(o()).optional(),application_type:o().optional(),client_name:o().optional(),client_uri:q.optional(),logo_uri:Ur,scope:o().optional(),contacts:A(o()).optional(),tos_uri:Ur,policy_uri:o().optional(),jwks_uri:q.optional(),jwks:T().optional(),software_id:o().optional(),software_version:o().optional(),software_statement:o().optional()}).strip(),Gr=O({client_id:o(),client_secret:o().optional(),client_id_issued_at:t().optional(),client_secret_expires_at:t().optional(),issuer:o().optional().catch(void 0)}).strip(),Kr=Wr.merge(Gr),qr=O({error:o(),error_description:o().optional()}).strip(),Jr=O({token:o(),token_type_hint:o().optional()}).strip(),Yr=Symbol.for(`mcp.sdk.errorBrands`);function Xr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Yr,{value:n,enumerable:!1,configurable:!0})}function Zr(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Yr)){let n=t[Yr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Qr=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),$r=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Xr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Xr(this,new.target)}},ei=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ti(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ni(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ri({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=ii}function si(e){return e.filter(e=>!oi(e))}function ci(e){return e.filter(e=>oi(e))}function li(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var ui=[`task`,`inputRequests`,`requestState`];function di(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||ui.some(t=>t in e)?e:{...e,content:[]}}function fi(){let e=a(()=>l([o(),t(),y(),ae(),g(o(),e),A(e)])),n=g(o(),e),s=l([o(),t().int()]),c=o(),u=O({ttl:t().optional()}),d=O({taskId:o()}),_=h({progressToken:s.optional(),"io.modelcontextprotocol/related-task":d.optional()}),v=O({_meta:_.optional()}),x=v.extend({task:u.optional()}),S=O({method:o(),params:v.loose().optional()}),C=O({_meta:_.optional()}),T=O({method:o(),params:C.loose().optional()}),E=h({_meta:_.optional()}),D=l([o(),t().int()]),ee=E.strict(),te=C.extend({requestId:D.optional(),reason:o().optional()}),k=T.extend({method:i(`notifications/cancelled`),params:te}),ne=O({src:o(),mimeType:o().optional(),sizes:A(o()).optional(),theme:w([`light`,`dark`]).optional()}),re=O({icons:A(ne).optional()}),ie=O({name:o(),title:o().optional()}),oe=ie.extend({...ie.shape,...re.shape,version:o(),websiteUrl:o().optional(),description:o().optional()}),se=b(O({applyDefaults:y().optional()}),n),ce=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,b(O({form:se.optional(),url:n.optional()}),n.optional())),le=h({list:n.optional(),cancel:n.optional(),requests:h({sampling:h({createMessage:n.optional()}).optional(),elicitation:h({create:n.optional()}).optional()}).optional()}),j=h({list:n.optional(),cancel:n.optional(),requests:h({tools:h({call:n.optional()}).optional()}).optional()}),ue=O({experimental:g(o(),n).optional(),sampling:O({context:n.optional(),tools:n.optional()}).optional(),elicitation:ce.optional(),roots:O({listChanged:y().optional()}).optional(),tasks:le.optional(),extensions:g(o(),n).optional()}),de=v.extend({protocolVersion:o(),capabilities:ue,clientInfo:oe}),pe=S.extend({method:i(`initialize`),params:de}),me=O({experimental:g(o(),n).optional(),logging:n.optional(),completions:n.optional(),prompts:O({listChanged:y().optional()}).optional(),resources:O({subscribe:y().optional(),listChanged:y().optional()}).optional(),tools:O({listChanged:y().optional()}).optional(),tasks:j.optional(),extensions:g(o(),n).optional()}),M=E.extend({protocolVersion:o(),capabilities:me,serverInfo:oe,instructions:o().optional()}),N=T.extend({method:i(`notifications/initialized`),params:C.optional()}),he=S.extend({method:i(`ping`),params:v.optional()}),ge=O({progress:t(),total:p(t()),message:p(o())}),P=O({...C.shape,...ge.shape,progressToken:s}),_e=T.extend({method:i(`notifications/progress`),params:P}),ve=v.extend({cursor:c.optional()}),ye=S.extend({params:ve.optional()}),be=E.extend({nextCursor:c.optional()}),F=O({uri:o(),mimeType:p(o()),_meta:g(o(),f()).optional()}),xe=F.extend({text:o()}),Se=o().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=w([`user`,`assistant`]),Te=O({audience:A(we).optional(),priority:t().min(0).max(1).optional(),lastModified:fe({offset:!0}).optional()}),Ee=O({...ie.shape,...re.shape,uri:o(),description:p(o()),mimeType:p(o()),size:p(t()),annotations:Te.optional(),_meta:p(h({}))}),De=O({...ie.shape,...re.shape,uriTemplate:o(),description:p(o()),mimeType:p(o()),annotations:Te.optional(),_meta:p(h({}))}),Oe=ye.extend({method:i(`resources/list`)}),ke=be.extend({resources:A(Ee)}),Ae=ye.extend({method:i(`resources/templates/list`)}),je=be.extend({resourceTemplates:A(De)}),Me=v.extend({uri:o()}),Ne=Me,Pe=S.extend({method:i(`resources/read`),params:Ne}),Fe=E.extend({contents:A(l([xe,Ce]))}),Ie=T.extend({method:i(`notifications/resources/list_changed`),params:C.optional()}),Le=Me,Re=S.extend({method:i(`resources/subscribe`),params:Le}),ze=Me,I=S.extend({method:i(`resources/unsubscribe`),params:ze}),Be=C.extend({uri:o()}),Ve=T.extend({method:i(`notifications/resources/updated`),params:Be}),He=O({name:o(),description:p(o()),required:p(y())}),Ue=O({...ie.shape,...re.shape,description:p(o()),arguments:p(A(He)),_meta:p(h({}))}),We=ye.extend({method:i(`prompts/list`)}),Ge=be.extend({prompts:A(Ue)}),L=v.extend({name:o(),arguments:g(o(),o()).optional()}),Ke=S.extend({method:i(`prompts/get`),params:L}),R=O({type:i(`text`),text:o(),annotations:Te.optional(),_meta:g(o(),f()).optional()}),z=O({type:i(`image`),data:Se,mimeType:o(),annotations:Te.optional(),_meta:g(o(),f()).optional()}),B=O({type:i(`audio`),data:Se,mimeType:o(),annotations:Te.optional(),_meta:g(o(),f()).optional()}),qe=O({type:i(`tool_use`),name:o(),id:o(),input:g(o(),f()),_meta:g(o(),f()).optional()}),V=O({type:i(`resource`),resource:l([xe,Ce]),annotations:Te.optional(),_meta:g(o(),f()).optional()}),Je=Ee.extend({type:i(`resource_link`)}),Ye=l([R,z,B,Je,V]),Xe=O({role:we,content:Ye}),Ze=E.extend({description:o().optional(),messages:A(Xe)}),Qe=T.extend({method:i(`notifications/prompts/list_changed`),params:C.optional()}),H=O({title:o().optional(),readOnlyHint:y().optional(),destructiveHint:y().optional(),idempotentHint:y().optional(),openWorldHint:y().optional()}),$e=O({taskSupport:w([`required`,`optional`,`forbidden`]).optional()}),et=O({...ie.shape,...re.shape,description:o().optional(),inputSchema:O({type:i(`object`),properties:g(o(),e).optional(),required:A(o()).optional()}).catchall(f()),outputSchema:O({type:i(`object`),properties:g(o(),e).optional(),required:A(o()).optional()}).catchall(f()).optional(),annotations:H.optional(),execution:$e.optional(),_meta:g(o(),f()).optional()}),tt=ye.extend({method:i(`tools/list`)}),nt=be.extend({tools:A(et)}),rt=E.extend({content:A(Ye),structuredContent:g(o(),f()).optional(),isError:y().optional()}),it=x.extend({name:o(),arguments:g(o(),f()).optional()}),at=S.extend({method:i(`tools/call`),params:it}),ot=T.extend({method:i(`notifications/tools/list_changed`),params:C.optional()}),st=w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),U=v.extend({level:st}),ct=S.extend({method:i(`logging/setLevel`),params:U}),lt=C.extend({level:st,logger:o().optional(),data:f()}),ut=T.extend({method:i(`notifications/message`),params:lt}),dt=O({name:o().optional()}),ft=O({hints:A(dt).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),pt=O({mode:w([`auto`,`required`,`none`]).optional()}),mt=O({type:i(`tool_result`),toolUseId:o().describe(`The unique identifier for the corresponding tool call.`),content:A(Ye),structuredContent:O({}).loose().optional(),isError:y().optional(),_meta:g(o(),f()).optional()}),ht=r(`type`,[R,z,B]),gt=r(`type`,[R,z,B,qe,mt]),_t=O({role:we,content:l([gt,A(gt)]),_meta:g(o(),f()).optional()}),vt=x.extend({messages:A(_t),modelPreferences:ft.optional(),systemPrompt:o().optional(),includeContext:w([`none`,`thisServer`,`allServers`]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:A(o()).optional(),metadata:n.optional(),tools:A(et).optional(),toolChoice:pt.optional()}),yt=S.extend({method:i(`sampling/createMessage`),params:vt}),bt=E.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`]).or(o())),role:we,content:ht}),xt=E.extend({model:o(),stopReason:p(w([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(o())),role:we,content:l([gt,A(gt)])}),St=O({type:i(`boolean`),title:o().optional(),description:o().optional(),default:y().optional()}),Ct=O({type:i(`string`),title:o().optional(),description:o().optional(),minLength:t().optional(),maxLength:t().optional(),format:w([`email`,`uri`,`date`,`date-time`]).optional(),default:o().optional()}),wt=O({type:w([`number`,`integer`]),title:o().optional(),description:o().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),Tt=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),default:o().optional()}),Et=O({type:i(`string`),title:o().optional(),description:o().optional(),oneOf:A(O({const:o(),title:o()})),default:o().optional()}),Dt=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),enumNames:A(o()).optional(),default:o().optional()}),Ot=l([Tt,Et]),kt=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({type:i(`string`),enum:A(o())}),default:A(o()).optional()}),At=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({anyOf:A(O({const:o(),title:o()}))}),default:A(o()).optional()}),jt=l([kt,At]),Mt=l([Dt,Ot,jt]),Nt=l([Mt,St,Ct,wt]),Pt=x.extend({mode:i(`form`).optional(),message:o(),requestedSchema:O({type:i(`object`),properties:g(o(),Nt),required:A(o()).optional()}).catchall(f())}),Ft=x.extend({mode:i(`url`),message:o(),elicitationId:o(),url:o().url()}),It=l([Pt,Ft]),W=S.extend({method:i(`elicitation/create`),params:It}),G=C.extend({elicitationId:o()}),Lt=T.extend({method:i(`notifications/elicitation/complete`),params:G}),Rt=E.extend({action:w([`accept`,`decline`,`cancel`]),content:m(e=>e===null?void 0:e,g(o(),l([o(),t(),y(),A(o())])).optional())}),zt=O({type:i(`ref/resource`),uri:o()}),Bt=O({type:i(`ref/prompt`),name:o()}),Vt=v.extend({ref:l([Bt,zt]),argument:O({name:o(),value:o()}),context:O({arguments:g(o(),o()).optional()}).optional()}),Ht=S.extend({method:i(`completion/complete`),params:Vt}),Ut=E.extend({completion:h({values:A(o()).max(100),total:p(t().int()),hasMore:p(y())})}),Wt=O({uri:o().startsWith(`file://`),name:o().optional(),_meta:g(o(),f()).optional()}),Gt=S.extend({method:i(`roots/list`),params:v.optional()}),Kt=E.extend({roots:A(Wt)}),qt=T.extend({method:i(`notifications/roots/list_changed`),params:C.optional()}),Jt=h({ttl:t().optional(),pollInterval:t().optional()}),Yt=w([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Xt=O({taskId:o(),status:Yt,ttl:l([t(),ae()]),createdAt:o(),lastUpdatedAt:o(),pollInterval:p(t()),statusMessage:p(o())}),Zt=E.extend({task:Xt}),Qt=C.merge(Xt),$t=T.extend({method:i(`notifications/tasks/status`),params:Qt}),en=S.extend({method:i(`tasks/get`),params:v.extend({taskId:o()})}),K=E.merge(Xt),tn=S.extend({method:i(`tasks/result`),params:v.extend({taskId:o()})}),nn=E.loose(),rn=ye.extend({method:i(`tasks/list`)}),an=be.extend({tasks:A(Xt)}),on=S.extend({method:i(`tasks/cancel`),params:v.extend({taskId:o()})});return{JSONValueSchema:e,JSONObjectSchema:n,ProgressTokenSchema:s,CursorSchema:c,TaskMetadataSchema:u,RelatedTaskMetadataSchema:d,RequestMetaSchema:_,BaseRequestParamsSchema:v,TaskAugmentedRequestParamsSchema:x,RequestSchema:S,NotificationsParamsSchema:C,NotificationSchema:T,ResultSchema:E,RequestIdSchema:D,EmptyResultSchema:ee,CancelledNotificationParamsSchema:te,CancelledNotificationSchema:k,IconSchema:ne,IconsSchema:re,BaseMetadataSchema:ie,ImplementationSchema:oe,ClientTasksCapabilitySchema:le,ServerTasksCapabilitySchema:j,ClientCapabilitiesSchema:ue,InitializeRequestParamsSchema:de,InitializeRequestSchema:pe,ServerCapabilitiesSchema:me,InitializeResultSchema:M,InitializedNotificationSchema:N,PingRequestSchema:he,ProgressSchema:ge,ProgressNotificationParamsSchema:P,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:I,ResourceUpdatedNotificationParamsSchema:Be,ResourceUpdatedNotificationSchema:Ve,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:L,GetPromptRequestSchema:Ke,TextContentSchema:R,ImageContentSchema:z,AudioContentSchema:B,ToolUseContentSchema:qe,EmbeddedResourceSchema:V,ResourceLinkSchema:Je,ContentBlockSchema:Ye,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:H,ToolExecutionSchema:$e,ToolSchema:et,ListToolsRequestSchema:tt,ListToolsResultSchema:nt,CallToolResultSchema:rt,CallToolRequestParamsSchema:it,CallToolRequestSchema:at,ToolListChangedNotificationSchema:ot,LoggingLevelSchema:st,SetLevelRequestParamsSchema:U,SetLevelRequestSchema:ct,LoggingMessageNotificationParamsSchema:lt,LoggingMessageNotificationSchema:ut,ModelHintSchema:dt,ModelPreferencesSchema:ft,ToolChoiceSchema:pt,ToolResultContentSchema:mt,SamplingContentSchema:ht,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:_t,CreateMessageRequestParamsSchema:vt,CreateMessageRequestSchema:yt,CreateMessageResultSchema:bt,CreateMessageResultWithToolsSchema:xt,BooleanSchemaSchema:St,StringSchemaSchema:Ct,NumberSchemaSchema:wt,UntitledSingleSelectEnumSchemaSchema:Tt,TitledSingleSelectEnumSchemaSchema:Et,LegacyTitledEnumSchemaSchema:Dt,SingleSelectEnumSchemaSchema:Ot,UntitledMultiSelectEnumSchemaSchema:kt,TitledMultiSelectEnumSchemaSchema:At,MultiSelectEnumSchemaSchema:jt,EnumSchemaSchema:Mt,PrimitiveSchemaDefinitionSchema:Nt,ElicitRequestFormParamsSchema:Pt,ElicitRequestURLParamsSchema:Ft,ElicitRequestParamsSchema:It,ElicitRequestSchema:W,ElicitationCompleteNotificationParamsSchema:G,ElicitationCompleteNotificationSchema:Lt,ElicitResultSchema:Rt,ResourceTemplateReferenceSchema:zt,PromptReferenceSchema:Bt,CompleteRequestParamsSchema:Vt,CompleteRequestSchema:Ht,CompleteResultSchema:Ut,RootSchema:Wt,ListRootsRequestSchema:Gt,ListRootsResultSchema:Kt,RootsListChangedNotificationSchema:qt,TaskCreationParamsSchema:Jt,TaskStatusSchema:Yt,TaskSchema:Xt,CreateTaskResultSchema:Zt,TaskStatusNotificationParamsSchema:Qt,TaskStatusNotificationSchema:$t,GetTaskRequestSchema:en,GetTaskResultSchema:K,GetTaskPayloadRequestSchema:tn,GetTaskPayloadResultSchema:nn,ListTasksRequestSchema:rn,ListTasksResultSchema:an,CancelTaskRequestSchema:on,CancelTaskResultSchema:E.merge(Xt),ClientRequestSchema:l([he,pe,Ht,ct,Ke,We,Oe,Ae,Pe,Re,I,at,tt,en,tn,rn,on]),ClientNotificationSchema:l([k,_e,N,qt,$t]),ClientResultSchema:l([ee,bt,xt,Rt,Kt,K,an,Zt]),ServerRequestSchema:l([he,yt,W,Gt,en,tn,rn,on]),ServerNotificationSchema:l([k,_e,ut,Ve,Ie,ot,Qe,$t,Lt]),ServerResultSchema:l([ee,M,Ut,Ze,Ge,ke,je,Fe,rt,nt,K,an,Zt]),CallToolResultWireSchema:f().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of ui)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(di).pipe(rt)}}var pi;function mi(){return pi??=fi()}function hi(e){return e.type!==`object`}var gi=new Set([`const`,`enum`,`default`,`examples`]),_i=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function vi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function yi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(vi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Oe(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&vi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=gi.has(o)?s:_i.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var bi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},xi={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci;function wi(){if(Ci)return Ci;let e=mi();return Ci={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ci}function Ti(e){return Object.prototype.hasOwnProperty.call(bi,e)}function Ei(e){return Object.prototype.hasOwnProperty.call(xi,e)}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Di(e)?wi().resultSchemas[e]:void 0}function ki(e){return Ti(e)?wi().requestSchemas[e]:void 0}function Ai(e){return Ei(e)?wi().notificationSchemas[e]:void 0}Object.keys(bi),Object.keys(xi);function ji(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Mi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Ni={ok:!1,reason:`not-in-era`};function Pi(e){return ji(e)&&ji(e.outputSchema)&&hi(e.outputSchema)}function Fi(e){return e}var Ii={era:`2025-11-25`,hasRequestMethod:Ti,hasNotificationMethod:Ei,validateRequest:(e,t)=>Mi(ki(e),t),validateResult:(e,t)=>Mi(Oi(e),t),validateNotification:(e,t)=>Mi(Ai(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Ni,validateInputResponse:()=>Ni,samplingResultVariant:((e,t)=>{let n=mi();return Mi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=li(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&hi(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(ji(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Fi(e)}}return{kind:`complete`,result:Fi(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Pi(e))?t:{...t,tools:n.map(e=>Pi(e)?{...e,outputSchema:yi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function Li(){let e=a(()=>l([o(),t(),y(),ae(),g(o(),e),A(e)])),n=g(o(),e),r=l([o(),t().int()]),s=o(),c=l([o(),t().int()]),u=w([`user`,`assistant`]),d=w([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),_=o().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),v=O({ttl:t().optional()}),x=O({taskId:o()}),S=h({progressToken:r.optional(),"io.modelcontextprotocol/related-task":x.optional()}),C=O({_meta:S.optional()}),T=C.extend({task:v.optional()}),E=O({_meta:S.optional()}),D=O({method:o(),params:E.loose().optional()}),ee=O({src:o(),mimeType:o().optional(),sizes:A(o()).optional(),theme:w([`light`,`dark`]).optional()}),te=O({icons:A(ee).optional()}),k=O({name:o(),title:o().optional()}),ne=k.extend({...k.shape,...te.shape,version:o(),websiteUrl:o().optional(),description:o().optional()}),re=b(O({applyDefaults:y().optional()}),n),ie=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,b(O({form:re.optional(),url:n.optional()}),n.optional())),oe=h({list:n.optional(),cancel:n.optional(),requests:h({sampling:h({createMessage:n.optional()}).optional(),elicitation:h({create:n.optional()}).optional()}).optional()}),se=h({list:n.optional(),cancel:n.optional(),requests:h({tools:h({call:n.optional()}).optional()}).optional()}),ce=O({experimental:g(o(),n).optional(),sampling:O({context:n.optional(),tools:n.optional()}).optional(),elicitation:ie.optional(),roots:O({listChanged:y().optional()}).optional(),tasks:oe.optional(),extensions:g(o(),n).optional()}),le=O({experimental:g(o(),n).optional(),logging:n.optional(),completions:n.optional(),prompts:O({listChanged:y().optional()}).optional(),resources:O({subscribe:y().optional(),listChanged:y().optional()}).optional(),tools:O({listChanged:y().optional()}).optional(),tasks:se.optional(),extensions:g(o(),n).optional()}),j=O({progress:t(),total:p(t()),message:p(o())}),ue=O({...E.shape,...j.shape,progressToken:r}),de=D.extend({method:i(`notifications/progress`),params:ue}),pe=E.extend({level:d,logger:o().optional(),data:f()}),me=D.extend({method:i(`notifications/message`),params:pe}),M=O({uri:o(),mimeType:p(o()),_meta:g(o(),f()).optional()}),N=M.extend({text:o()}),he=M.extend({blob:_}),ge=O({audience:A(u).optional(),priority:t().min(0).max(1).optional(),lastModified:fe({offset:!0}).optional()}),P=O({...k.shape,...te.shape,uri:o(),description:p(o()),mimeType:p(o()),size:p(t()),annotations:ge.optional(),_meta:p(h({}))}),_e=O({...k.shape,...te.shape,uriTemplate:o(),description:p(o()),mimeType:p(o()),annotations:ge.optional(),_meta:p(h({}))}),ve=D.extend({method:i(`notifications/resources/list_changed`),params:E.optional()}),ye=E.extend({uri:o()}),be=D.extend({method:i(`notifications/resources/updated`),params:ye}),F=O({name:o(),description:p(o()),required:p(y())}),xe=O({...k.shape,...te.shape,description:p(o()),arguments:p(A(F)),_meta:p(h({}))}),Se=D.extend({method:i(`notifications/prompts/list_changed`),params:E.optional()}),Ce=O({type:i(`text`),text:o(),annotations:ge.optional(),_meta:g(o(),f()).optional()}),we=O({type:i(`image`),data:_,mimeType:o(),annotations:ge.optional(),_meta:g(o(),f()).optional()}),Te=O({type:i(`audio`),data:_,mimeType:o(),annotations:ge.optional(),_meta:g(o(),f()).optional()}),Ee=O({type:i(`tool_use`),name:o(),id:o(),input:g(o(),f()),_meta:g(o(),f()).optional()}),De=O({type:i(`resource`),resource:l([N,he]),annotations:ge.optional(),_meta:g(o(),f()).optional()}),Oe=P.extend({type:i(`resource_link`)}),ke=l([Ce,we,Te,Oe,De]),Ae=O({role:u,content:ke}),je=O({title:o().optional(),readOnlyHint:y().optional(),destructiveHint:y().optional(),idempotentHint:y().optional(),openWorldHint:y().optional()}),Me=D.extend({method:i(`notifications/tools/list_changed`),params:E.optional()}),Le=O({name:o().optional()}),ze=O({hints:A(Le).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),I=O({mode:w([`auto`,`required`,`none`]).optional()}),Be=O({type:i(`boolean`),title:o().optional(),description:o().optional(),default:y().optional()}),Ve=O({type:i(`string`),title:o().optional(),description:o().optional(),minLength:t().optional(),maxLength:t().optional(),format:w([`email`,`uri`,`date`,`date-time`]).optional(),default:o().optional()}),He=O({type:w([`number`,`integer`]),title:o().optional(),description:o().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),Ue=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),default:o().optional()}),We=O({type:i(`string`),title:o().optional(),description:o().optional(),oneOf:A(O({const:o(),title:o()})),default:o().optional()}),Ge=O({type:i(`string`),title:o().optional(),description:o().optional(),enum:A(o()),enumNames:A(o()).optional(),default:o().optional()}),L=l([Ue,We]),Ke=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({type:i(`string`),enum:A(o())}),default:A(o()).optional()}),R=O({type:i(`array`),title:o().optional(),description:o().optional(),minItems:t().optional(),maxItems:t().optional(),items:O({anyOf:A(O({const:o(),title:o()}))}),default:A(o()).optional()}),z=l([Ke,R]),B=l([Ge,L,z]),qe=l([B,Be,Ve,He]),V=T.extend({mode:i(`form`).optional(),message:o(),requestedSchema:O({type:i(`object`),properties:g(o(),qe),required:A(o()).optional()}).catchall(f())}),Je=O({type:i(`ref/resource`),uri:o()}),Ye=O({type:i(`ref/prompt`),name:o()}),Xe=O({uri:o().startsWith(`file://`),name:o().optional(),_meta:g(o(),f()).optional()}),Ze=ce.shape,Qe=O({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),H=le.shape,$e=O({experimental:H.experimental,logging:H.logging,completions:H.completions,prompts:H.prompts,resources:H.resources,tools:H.tools,extensions:H.extensions}),et=h({progressToken:r.optional(),[Ne]:o(),[Pe]:ne.optional(),[Ie]:Qe,[Re]:d.optional()}),tt=O({...k.shape,...te.shape,description:o().optional(),inputSchema:h({$schema:o().optional(),type:i(`object`)}),outputSchema:h({$schema:o().optional()}).optional(),annotations:je.optional(),_meta:g(o(),f()).optional()}),nt=O({type:i(`tool_result`),toolUseId:o(),content:A(ke),structuredContent:f().optional(),isError:y().optional(),_meta:g(o(),f()).optional()}),rt=l([Ce,we,Te,Ee,nt]),it=O({role:u,content:l([rt,A(rt)]),_meta:g(o(),f()).optional()}),at=o(),ot=h({[Fe]:ne.optional().catch(void 0)}),st=ot.optional();function U(e){return h({_meta:st,resultType:at.default(`complete`),...e})}let ct=U({}),lt=U({nextCursor:s.optional()}),ut=U({content:A(ke),structuredContent:f().optional(),isError:y().optional()}),dt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),tools:A(tt),nextCursor:s.optional()}),ft=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),prompts:A(xe),nextCursor:s.optional()}),pt=U({description:o().optional(),messages:A(Ae)}),mt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resources:A(P),nextCursor:s.optional()}),ht=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resourceTemplates:A(_e),nextCursor:s.optional()}),gt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),contents:A(l([N,he]))}),_t=U({completion:O({values:A(o()).max(100),total:t().int().optional(),hasMore:y().optional()}).loose()}),vt=U({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`])}),yt=U({ttlMs:t().int().min(0).catch(0),cacheScope:w([`public`,`private`]).catch(`private`),supportedVersions:A(o()),capabilities:$e,instructions:o().optional()}),bt=O({messages:A(it),modelPreferences:ze.optional(),systemPrompt:o().optional(),includeContext:w([`none`,`thisServer`,`allServers`]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:A(o()).optional(),metadata:n.optional(),tools:A(tt).optional(),toolChoice:I.optional()}),xt=O({method:i(`sampling/createMessage`),params:bt}),St=O({method:i(`roots/list`),params:O({_meta:g(o(),f()).optional()}).optional()}),Ct=O({...it.shape,model:o(),stopReason:o().optional()}),wt=O({roots:A(Xe)}),Tt=O({action:w([`accept`,`decline`,`cancel`]),content:g(o(),l([o(),t(),y(),A(o())])).optional()}),Et=O({mode:i(`url`),message:o(),url:o().url()}),Dt=l([V,Et]),Ot=O({method:i(`elicitation/create`),params:Dt}),kt=l([xt,St,Ot]),At=l([Ct,wt,Tt]),jt=g(o(),kt),Mt=g(o(),At),Nt=U({inputRequests:jt.optional(),requestState:o().optional()}),Pt={inputResponses:Mt.optional(),requestState:o().optional()},Ft=O({_meta:et,...Pt}),It=h({progressToken:r.optional()});function W(e,t){return O({method:i(e),params:O({_meta:et,...t})})}function G(e,t){return O({method:i(e),params:O({_meta:It.optional(),...t}).optional()})}let Lt={name:o(),arguments:g(o(),f()).optional(),...Pt},Rt={cursor:s.optional()},zt=W(`tools/call`,Lt),Bt=W(`tools/list`,Rt),Vt=W(`prompts/list`,Rt),Ht=W(`prompts/get`,{name:o(),arguments:g(o(),o()).optional(),...Pt}),Ut=W(`resources/list`,Rt),Wt=W(`resources/templates/list`,Rt),Gt=W(`resources/read`,{uri:o(),...Pt}),Kt={ref:l([Ye,Je]),argument:O({name:o(),value:o()}),context:O({arguments:g(o(),o()).optional()}).optional()},qt=W(`completion/complete`,Kt),Jt=W(`server/discover`,{}),Yt=O({toolsListChanged:y().optional(),promptsListChanged:y().optional(),resourcesListChanged:y().optional(),resourceSubscriptions:A(o()).optional()}),Xt={notifications:Yt},Zt=W(`subscriptions/listen`,Xt),Qt=ot.extend({"io.modelcontextprotocol/subscriptionId":c}),$t=h({_meta:Qt,resultType:at.default(`complete`)}),en={"tools/call":G(`tools/call`,Lt),"tools/list":G(`tools/list`,Rt),"prompts/get":G(`prompts/get`,{name:o(),arguments:g(o(),o()).optional()}),"prompts/list":G(`prompts/list`,Rt),"resources/list":G(`resources/list`,Rt),"resources/templates/list":G(`resources/templates/list`,Rt),"resources/read":G(`resources/read`,{uri:o()}),"completion/complete":G(`completion/complete`,Kt),"server/discover":G(`server/discover`,{}),"subscriptions/listen":G(`subscriptions/listen`,Xt)};function K(e){return h({_meta:st,...e})}let tn={"tools/call":K({content:A(ke),structuredContent:f().optional(),isError:y().optional()}),"tools/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),tools:A(tt),nextCursor:s.optional()}),"prompts/get":K({description:o().optional(),messages:A(Ae)}),"prompts/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),prompts:A(xe),nextCursor:s.optional()}),"resources/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resources:A(P),nextCursor:s.optional()}),"resources/templates/list":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),resourceTemplates:A(_e),nextCursor:s.optional()}),"resources/read":K({ttlMs:t().int().min(0),cacheScope:w([`public`,`private`]),contents:A(l([N,he]))}),"completion/complete":K({completion:O({values:A(o()).max(100),total:t().int().optional(),hasMore:y().optional()}).loose()}),"server/discover":K({ttlMs:t().int().min(0).catch(0),cacheScope:w([`public`,`private`]).catch(`private`),supportedVersions:A(o()),capabilities:$e,instructions:o().optional()}),"subscriptions/listen":K({})},nn=h({"io.modelcontextprotocol/subscriptionId":c.optional()}),rn=O({method:i(`notifications/subscriptions/acknowledged`),params:O({_meta:nn.optional(),notifications:Yt})}),an=O({_meta:nn.optional(),requestId:c,reason:o().optional()}),on=O({method:i(`notifications/cancelled`),params:an}),sn={"notifications/cancelled":on,"notifications/progress":de,"notifications/message":me,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":rn},cn=e=>O({jsonrpc:i(`2.0`),id:l([o(),t().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:n,ProgressTokenSchema:r,CursorSchema:s,RequestIdSchema:c,RoleSchema:u,LoggingLevelSchema:d,TaskMetadataSchema:v,RelatedTaskMetadataSchema:x,RequestMetaSchema:S,BaseRequestParamsSchema:C,TaskAugmentedRequestParamsSchema:T,NotificationsParamsSchema:E,NotificationSchema:D,IconSchema:ee,IconsSchema:te,BaseMetadataSchema:k,ImplementationSchema:ne,ClientTasksCapabilitySchema:oe,ServerTasksCapabilitySchema:se,ClientCapabilitiesSchema:ce,ServerCapabilitiesSchema:le,ProgressSchema:j,ProgressNotificationParamsSchema:ue,ProgressNotificationSchema:de,LoggingMessageNotificationParamsSchema:pe,LoggingMessageNotificationSchema:me,ResourceContentsSchema:M,TextResourceContentsSchema:N,BlobResourceContentsSchema:he,AnnotationsSchema:ge,ResourceSchema:P,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Le,ModelPreferencesSchema:ze,ToolChoiceSchema:I,BooleanSchemaSchema:Be,StringSchemaSchema:Ve,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:L,UntitledMultiSelectEnumSchemaSchema:Ke,TitledMultiSelectEnumSchemaSchema:R,MultiSelectEnumSchemaSchema:z,EnumSchemaSchema:B,PrimitiveSchemaDefinitionSchema:qe,ElicitRequestFormParamsSchema:V,ResourceTemplateReferenceSchema:Je,PromptReferenceSchema:Ye,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:$e,RequestMetaEnvelopeSchema:et,ToolSchema:tt,ToolResultContentSchema:nt,SamplingMessageContentBlockSchema:rt,SamplingMessageSchema:it,ResultTypeSchema:at,ResultMetaSchema:ot,ResultSchema:ct,PaginatedResultSchema:lt,CallToolResultSchema:ut,ListToolsResultSchema:dt,ListPromptsResultSchema:ft,GetPromptResultSchema:pt,ListResourcesResultSchema:mt,ListResourceTemplatesResultSchema:ht,ReadResourceResultSchema:gt,CompleteResultSchema:_t,CacheableResultSchema:vt,DiscoverResultSchema:yt,CreateMessageRequestParamsSchema:bt,CreateMessageRequestSchema:xt,ListRootsRequestSchema:St,CreateMessageResultSchema:Ct,ListRootsResultSchema:wt,ElicitResultSchema:Tt,ElicitRequestURLParamsSchema:Et,ElicitRequestParamsSchema:Dt,ElicitRequestSchema:Ot,InputRequestSchema:kt,InputResponseSchema:At,InputRequestsSchema:jt,InputResponsesSchema:Mt,InputRequiredResultSchema:Nt,InputResponseRequestParamsSchema:Ft,CallToolRequestSchema:zt,ListToolsRequestSchema:Bt,ListPromptsRequestSchema:Vt,GetPromptRequestSchema:Ht,ListResourcesRequestSchema:Ut,ListResourceTemplatesRequestSchema:Wt,ReadResourceRequestSchema:Gt,CompleteRequestSchema:qt,DiscoverRequestSchema:Jt,SubscriptionFilterSchema:Yt,SubscriptionsListenRequestSchema:Zt,SubscriptionsListenResultMetaSchema:Qt,SubscriptionsListenResultSchema:$t,dispatchRequestSchemas:en,dispatchResultSchemas:tn,NotificationMetaSchema:nn,SubscriptionsAcknowledgedNotificationSchema:rn,CancelledNotificationParamsSchema:an,CancelledNotificationSchema:on,notificationSchemas2026:sn,JSONRPCResultResponseSchema:cn(ct),CallToolResultResponseSchema:cn(l([ut,Nt])),ListToolsResultResponseSchema:cn(dt),ListPromptsResultResponseSchema:cn(ft),GetPromptResultResponseSchema:cn(l([pt,Nt])),ListResourcesResultResponseSchema:cn(mt),ListResourceTemplatesResultResponseSchema:cn(ht),ReadResourceResultResponseSchema:cn(l([gt,Nt])),CompleteResultResponseSchema:cn(_t),DiscoverResultResponseSchema:cn(yt),SubscriptionsListenResultResponseSchema:cn($t)}}var Ri;function zi(){return Ri??=Li()}var Bi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Vi(e){return Bi.includes(e)}var Hi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Ui(e){return e[Hi]}function Wi(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Gi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Xr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new qi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Ji({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ki(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Yi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ki=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},qi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Xi=0,Zi=`private`,Qi=[`tools/call`,`prompts/get`,`resources/read`];function $i(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||Qi.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function ea(e,t){let n=Ui(t);if(t.resultType!==`complete`||!Vi(e))return n===void 0?t:aa(t);let r=t,i=Wi(r.ttlMs)?r.ttlMs:ra(n),a=Gi(r.cacheScope)?r.cacheScope:ia(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Hi],o}function ta(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function na(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Fe]:t}}:!ta(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Fe]:t}}}function ra(e){return e!==void 0&&Wi(e.ttlMs)?e.ttlMs:Xi}function ia(e){return e!==void 0&&Gi(e.cacheScope)?e.cacheScope:Zi}function aa(e){let t={...e};return delete t[Hi],t}var oa=[`elicitation/create`,`sampling/createMessage`,`roots/list`],sa;function ca(){if(sa)return sa;let e=zi();return sa={request:{"elicitation/create":O({method:i(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":O({method:i(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":O({method:i(`roots/list`),params:h({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},sa}function la(e){return oa.includes(e)}function ua(e){return la(e)?ca().request[e]:void 0}function da(e){return la(e)?ca().response[e]:void 0}var fa={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},pa={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ma(e){return Object.prototype.hasOwnProperty.call(fa,e)}function ha(e){return Object.prototype.hasOwnProperty.call(pa,e)}function ga(e){return Object.prototype.hasOwnProperty.call(fa,e)}function _a(e){return ma(e)?zi().dispatchRequestSchemas[e]:void 0}function va(e){return ga(e)?zi().dispatchResultSchemas[e]:void 0}function ya(e){return ha(e)?zi().notificationSchemas2026[e]:void 0}Object.keys(fa),Object.keys(pa);function ba(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xa(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Sa={ok:!1,reason:`not-in-era`},Ca=[Ne,Ie];function wa(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>ba(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!ba(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(ba(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Ta={era:`2026-07-28`,hasRequestMethod:ma,hasNotificationMethod:ha,hasInputRequestMethod:e=>ua(e)!==void 0,validateRequest:(e,t)=>xa(_a(e),t),validateResult:(e,t)=>xa(va(e),t),validateNotification:(e,t)=>xa(ya(e),t),validateInputRequest:(e,t)=>xa(ua(e),t),validateInputResponse:(e,t)=>xa(da(e),t),samplingResultVariant:()=>Sa,outboundEnvelope(e){return{[Ne]:e.protocolVersion,[Pe]:e.clientInfo,[Ie]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ca)n in e||t.push({key:n,problem:`missing`});let n=zi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>li(e),inputRequestSchema:ua,decodeResult(e,t){if(!ba(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=ba(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:zi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=Da(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return na(ea(e,$i(e,wa(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=zi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Ea;function Da(){if(Ea)return Ea;let e=zi();return Ea={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Ea}var Oa=`2026-07-28`;function ka(e){return e!==void 0&&oi(e)?Ta:Ii}function Aa(e){return e.revision===void 0?e.era===`modern`?Ta.era:Ii.era:ka(e.revision).era}function ja(e){return Pa.some(t=>t.hasRequestMethod(e))}function Ma(e){return Pa.some(t=>t.hasNotificationMethod(e))}function Na(e){return e===`tasks/get`||e===`tasks/cancel`}var Pa=[Ii,Ta],Fa=xe({AnnotationsSchema:()=>At,AudioContentSchema:()=>sn,BaseMetadataSchema:()=>at,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>Ot,BooleanSchemaSchema:()=>Hn,CallToolRequestParamsSchema:()=>Sn,CallToolRequestSchema:()=>Cn,CallToolResultSchema:()=>bn,CancelTaskRequestSchema:()=>Or,CancelTaskResultSchema:()=>kr,CancelledNotificationParamsSchema:()=>tt,CancelledNotificationSchema:()=>nt,ClientCapabilitiesSchema:()=>ut,ClientNotificationSchema:()=>jr,ClientRequestSchema:()=>Ar,ClientResultSchema:()=>Mr,ClientTasksCapabilitySchema:()=>ct,CompatibilityCallToolResultSchema:()=>xn,CompleteRequestParamsSchema:()=>lr,CompleteRequestSchema:()=>ur,CompleteResultSchema:()=>dr,ContentBlockSchema:()=>dn,CreateMessageRequestParamsSchema:()=>Rn,CreateMessageRequestSchema:()=>zn,CreateMessageResultSchema:()=>Bn,CreateMessageResultWithToolsSchema:()=>Vn,CreateTaskResultSchema:()=>yr,CursorSchema:()=>He,DiscoverRequestSchema:()=>gt,DiscoverResultSchema:()=>_t,ElicitRequestFormParamsSchema:()=>er,ElicitRequestParamsSchema:()=>nr,ElicitRequestSchema:()=>rr,ElicitRequestURLParamsSchema:()=>tr,ElicitResultSchema:()=>or,ElicitationCompleteNotificationParamsSchema:()=>ir,ElicitationCompleteNotificationSchema:()=>ar,EmbeddedResourceSchema:()=>ln,EmptyResultSchema:()=>et,EnumSchemaSchema:()=>Qn,GetPromptRequestParamsSchema:()=>nn,GetPromptRequestSchema:()=>rn,GetPromptResultSchema:()=>pn,GetTaskPayloadRequestSchema:()=>wr,GetTaskPayloadResultSchema:()=>Tr,GetTaskRequestSchema:()=>Sr,GetTaskResultSchema:()=>Cr,IconSchema:()=>rt,IconsSchema:()=>it,ImageContentSchema:()=>on,ImplementationSchema:()=>ot,InitializeRequestParamsSchema:()=>dt,InitializeRequestSchema:()=>ft,InitializeResultSchema:()=>mt,InitializedNotificationSchema:()=>ht,JSONArraySchema:()=>Be,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>Qe,JSONRPCMessageSchema:()=>H,JSONRPCNotificationSchema:()=>Xe,JSONRPCRequestSchema:()=>Ye,JSONRPCResponseSchema:()=>$e,JSONRPCResultResponseSchema:()=>Ze,JSONValueSchema:()=>ze,LegacyTitledEnumSchemaSchema:()=>qn,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>K,ListPromptsResultSchema:()=>tn,ListResourceTemplatesRequestSchema:()=>Ft,ListResourceTemplatesResultSchema:()=>It,ListResourcesRequestSchema:()=>Nt,ListResourcesResultSchema:()=>Pt,ListRootsRequestSchema:()=>pr,ListRootsResultSchema:()=>mr,ListTasksRequestSchema:()=>Er,ListTasksResultSchema:()=>Dr,ListToolsRequestSchema:()=>vn,ListToolsResultSchema:()=>yn,LoggingLevelSchema:()=>En,LoggingMessageNotificationParamsSchema:()=>kn,LoggingMessageNotificationSchema:()=>An,ModelHintSchema:()=>jn,ModelPreferencesSchema:()=>Mn,MultiSelectEnumSchemaSchema:()=>Zn,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Wn,PaginatedRequestParamsSchema:()=>St,PaginatedRequestSchema:()=>Ct,PaginatedResultSchema:()=>wt,PingRequestSchema:()=>vt,PrimitiveSchemaDefinitionSchema:()=>$n,ProgressNotificationParamsSchema:()=>bt,ProgressNotificationSchema:()=>xt,ProgressSchema:()=>yt,ProgressTokenSchema:()=>Ve,PromptArgumentSchema:()=>$t,PromptListChangedNotificationSchema:()=>mn,PromptMessageSchema:()=>fn,PromptReferenceSchema:()=>cr,PromptSchema:()=>en,ReadResourceRequestParamsSchema:()=>G,ReadResourceRequestSchema:()=>Lt,ReadResourceResultSchema:()=>Rt,RelatedTaskMetadataSchema:()=>We,RequestIdSchema:()=>Je,RequestMetaSchema:()=>Ge,RequestSchema:()=>R,ResourceContentsSchema:()=>Tt,ResourceLinkSchema:()=>un,ResourceListChangedNotificationSchema:()=>zt,ResourceRequestParamsSchema:()=>W,ResourceSchema:()=>jt,ResourceTemplateReferenceSchema:()=>sr,ResourceTemplateSchema:()=>Mt,ResourceUpdatedNotificationParamsSchema:()=>Zt,ResourceUpdatedNotificationSchema:()=>Qt,ResultMetaObjectSchema:()=>qe,ResultSchema:()=>V,RoleSchema:()=>kt,RootSchema:()=>fr,RootsListChangedNotificationSchema:()=>hr,SamplingContentSchema:()=>Fn,SamplingMessageContentBlockSchema:()=>In,SamplingMessageSchema:()=>Ln,ServerCapabilitiesSchema:()=>pt,ServerNotificationSchema:()=>Pr,ServerRequestSchema:()=>Nr,ServerResultSchema:()=>Fr,ServerTasksCapabilitySchema:()=>lt,SetLevelRequestParamsSchema:()=>Dn,SetLevelRequestSchema:()=>On,SingleSelectEnumSchemaSchema:()=>Jn,StringSchemaSchema:()=>Un,SubscribeRequestParamsSchema:()=>Bt,SubscribeRequestSchema:()=>Vt,SubscriptionFilterSchema:()=>Wt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>qt,SubscriptionsAcknowledgedNotificationSchema:()=>Jt,SubscriptionsListenRequestParamsSchema:()=>Gt,SubscriptionsListenRequestSchema:()=>Kt,SubscriptionsListenResultMetaSchema:()=>Yt,SubscriptionsListenResultSchema:()=>Xt,TaskAugmentedRequestParamsSchema:()=>Ke,TaskCreationParamsSchema:()=>gr,TaskMetadataSchema:()=>Ue,TaskSchema:()=>vr,TaskStatusNotificationParamsSchema:()=>br,TaskStatusNotificationSchema:()=>xr,TaskStatusSchema:()=>_r,TextContentSchema:()=>an,TextResourceContentsSchema:()=>Et,TitledMultiSelectEnumSchemaSchema:()=>Xn,TitledSingleSelectEnumSchemaSchema:()=>Kn,ToolAnnotationsSchema:()=>hn,ToolChoiceSchema:()=>Nn,ToolExecutionSchema:()=>gn,ToolListChangedNotificationSchema:()=>wn,ToolResultContentSchema:()=>Pn,ToolSchema:()=>_n,ToolUseContentSchema:()=>cn,UnsubscribeRequestParamsSchema:()=>Ht,UnsubscribeRequestSchema:()=>Ut,UntitledMultiSelectEnumSchemaSchema:()=>Yn,UntitledSingleSelectEnumSchemaSchema:()=>Gn}),Ia=e=>Ye.safeParse(e).success,La=e=>Xe.safeParse(e).success,Ra=e=>Ze.safeParse(e).success,za=e=>Qe.safeParse(e).success,Ba=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Va=e=>ft.safeParse(e).success,Ha=e=>ht.safeParse(e).success,Ua=`Mcp-Param-`,Wa=`x-mcp-header`,Ga=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ka=new Set([`string`,`integer`,`boolean`]);function qa(e){let t=[],n=new Map,r,i=(e,a,o)=>{if(typeof e!=`object`||!e)return;let s=e;if(Wa in s){if(!o||a.length===0)return`${Xa(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=s[Wa];if(typeof e!=`string`||e.length===0)return`${Xa(a)}: x-mcp-header MUST be a non-empty string`;if(!Ga.test(e))return`${Xa(a)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let i=typeof s.type==`string`?s.type:void 0;if(i===void 0||!Ka.has(i)){let e=`${Xa(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${i??``}`;if(i!==`number`)return e;r??=e}let c=e.toLowerCase(),l=n.get(c);if(l!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${l}')`;n.set(c,e),t.push({path:a,headerName:e,type:i})}let c=s.properties;if(typeof c==`object`&&c)for(let[e,t]of Object.entries(c)){let n=i(t,[...a,e],o);if(n!==void 0)return n}for(let e of Ja){let t=s[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Ya.has(e)?Object.values(t):[t];for(let t of n){let n=i(t,[...a,`<${e}>`],!1);if(n!==void 0)return n}}},a=i(e,[],!0);return a===void 0?r===void 0?{valid:!0,declarations:t}:{valid:!1,reason:r,declarations:t}:{valid:!1,reason:r??a}}var Ja=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Ya=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Xa(e){return e.length===0?``:e.join(`.`)}var Za=`=?base64?`,Qa=`?=`;function $a(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function eo(e){if(e.length===0||e.startsWith(Za)&&e.endsWith(Qa)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function to(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function no(e){return eo(e)?`${Za}${to(e)}${Qa}`:e}function ro(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function io(e,t){let n={};for(let r of e){let e=ro(t,r.path);if(e==null)continue;let i=$a(e);i!==void 0&&(n[`${Ua}${r.headerName}`]=no(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var ao={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function oo(e,t){let n=Object.hasOwn(ao,e)?ao[e]:void 0;if(n===void 0)return;let r=so(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function so(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function co(e,t){return le(e,t)}function lo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function uo(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var fo=!1,po=`draft-2020-12`;function mo(e,t=`input`){let r=e[`~standard`],i;if(r.jsonSchema)i=r.jsonSchema[t]({target:po});else if(r.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);fo||(fo=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),i=n(e,{target:po,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return i.type===void 0&&go(i)?{type:`object`,...i}:i;if(i.type!==void 0&&i.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(i.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...i}}var ho=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function go(e,t=e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;let n=typeof e.$ref==`string`&&ho.exec(e.$ref);if(n&&t[n[1]]?.[n[2]]?.type===`object`)return!0;for(let n of[`oneOf`,`anyOf`,`allOf`]){let r=e[n];if(Array.isArray(r)&&r.length>0)return r.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||go(e,`$id`in e?{}:t)))}return!1}function _o(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function vo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>_o(e)).join(`, `)}:{success:!0,data:n.value}}function yo(e){let t=n(e,{target:po,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var bo=/\\\.\\d\{(\d+)\}/;function xo(e){let t=bo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>fe({local:e,offset:t,precision:n}))))}function So(e,t){let n;switch(e){case`email`:n=[oe()];break;case`uri`:n=[v()];break;case`date`:n=[pe()];break;case`date-time`:n=xo(t)}return new Set(n.map(e=>yo(e)).filter(e=>e!==void 0))}function Co(e,t,n){return n!==`zod`||So(e,t).has(t)}function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e){try{return mo(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Eo=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Do(e){return Eo.has(e)||e.startsWith(`x-`)}var Oo=new Set([`$schema`,...Object.keys(er.shape.requestedSchema.shape)]),ko={string:lo([Un,Gn,Kn,qn]),number:lo([Wn]),integer:lo([Wn]),boolean:lo([Hn]),array:lo([Yn,Xn])},Ao=new Set(Un.shape.format.unwrap().options);function jo(e,t,n,r){if(!wo(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(ko,e.type)?ko[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Do(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ao.has(e.format)?typeof s==`string`&&Co(e.format,s,n)||r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Mo(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&wo(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,jo(n,`properties.${e}`,t,r)])):Oo.has(i)?n[i]=a:Do(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function No(e,t){if(!wo(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!co($n,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Po(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Po(e,t[r],`${n}[${r}]`)):!wo(e)||!wo(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Po(r,t[e],i):Do(e)?[]:[i]})}function Fo(e){if(!uo(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Mo(To(e.requestedSchema),t),r=co(er.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${No(n,r.error.message)}`);let i=Po(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Io(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Io,{elicit(e){try{return{method:`elicitation/create`,params:Fo(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Lo=!0,Ro=10,zo=250;function Bo(e){return{autoFulfill:e?.autoFulfill??Lo,maxRounds:e?.maxRounds??Ro}}function Vo(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Ho(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Uo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Wo(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Go(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Ho(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Wo(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Uo(zo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Vo(r,u,c.requestState),d);if(Ba(f))c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};else return f}}var Ko=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),qo={IdJagTokenExchangeResponseSchema:Vr,OAuthClientInformationFullSchema:Kr,OAuthClientInformationSchema:Gr,OAuthClientMetadataSchema:Wr,OAuthClientRegistrationErrorSchema:qr,OAuthErrorResponseSchema:Hr,OAuthMetadataSchema:Lr,OAuthProtectedResourceMetadataSchema:Ir,OAuthTokenRevocationRequestSchema:Jr,OAuthTokensSchema:Br,OpenIdProviderDiscoveryMetadataSchema:zr,OpenIdProviderMetadataSchema:Rr},Jo={},Yo={};function Xo(e,t){let n=e.slice(0,-6);Jo[n]=t,Yo[n]=e=>t.safeParse(e).success}for(let e of Ko)Xo(e,Fa[e]);for(let[e,t]of Object.entries(qo))Xo(e,t);Object.freeze(Jo);var Zo=Object.freeze(Yo);function Qo(e){switch(e){case`initialize`:case`notifications/initialized`:return ka(void 0);case`server/discover`:return ka(Oa);default:return}}var $o=[Ne,Pe,Ie,Re],es=[`inputResponses`,`requestState`];function ts(e,t){let n=e.params;if(!os(n))return{message:e,lifted:{}};let r=n._meta,i=os(r)?$o.filter(e=>e in r):[],a=t===`request`?es.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&os(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function ns(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function rs(e){return()=>e}var is=rs(void 0),as=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??je,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Ra(e)||za(e)?this._onresponse(e):Ia(e)?this._onrequest(e,t):La(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ts(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Aa(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Ma(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ts(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Aa(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(ja(n.method)&&!i.hasRequestMethod(n.method)&&!(Na(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:ls(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?is:rs(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),uo(t))return u(e,t,n);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);n===void 0?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ra(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(uo(t))return Na(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=ns(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ka(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qo(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ja(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(hs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}vo(n,a.result).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Ma(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))})}else await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!ja(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await vo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Ma(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))})}else{if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await vo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ss(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=os(a)&&os(i)?{...a,...i}:i}return n}function cs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ls(e){let t={},n=[];if(!cs(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e))!cs(i)||`method`in i||`result`in i?n.push(r):t[r]=i;return{accepted:t,droppedKeys:n}}function us(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function ds(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:rs(void 0),signal:r,send:(()=>us(`send`)),notify:()=>us(`notify`)}}}async function fs(e,t,n,r,i){if(!cs(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=cs(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(ds(n,a,s,i,e.sessionId)))}function ps(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function ms(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>fs(e,i,t,n,r),retry:(e,t)=>r.retry(e,ps(o,t))};return Go({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function hs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var gs=Ce(F((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function _s(e){if(e)try{return gs.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function vs(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ys(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...vs(t.headers),...vs(r.headers)}:t.headers}):e}var bs=new Set([301,302,303,307,308]),xs=5;function Ss(e,t){return e.protocol===t.protocol&&e.host===t.host||e.protocol===`http:`&&t.protocol===`https:`&&e.hostname===t.hostname&&!e.port&&!t.port}function Cs(e,t){let n=bs.has(t.status)?t.headers?.get(`location`):void 0;if(n)try{return new URL(n,e)}catch{return}}var ws=new WeakSet;function Ts(e){let t=(t,n)=>e(t,n);return ws.add(t),t}function Es(e){return ws.has(e)?e:async(t,n)=>{if(n?.redirect===`error`||n?.redirect===`manual`)return e(t,n);let r=(n?.method??`GET`).toUpperCase(),i=t;for(let t=0;;t++){let a=await e(i,{...n,redirect:`manual`}),o=Cs(i,a);if(!o||t===xs)return a;let s=new URL(i),c=r===`GET`||a.status===307||a.status===308,l=!(o.username||o.password)||o.username===s.username&&o.password===s.password;if(!c||!l||!Ss(s,o))return a;await a.text?.().catch(()=>{}),i=o}}}function Ds(e,t){if(t.type===`opaqueredirect`)return`Redirect not followed: this runtime does not expose where it points`;let n=Cs(t.url||e,t);if(n)return n.username=n.password=n.search=n.hash=``,n.protocol===`http:`&&new URL(t.url||e).protocol===`https:`?(n.protocol=`https:`,`Redirect from https to plain http not followed; try ${n.href} as the endpoint`):`Redirect to ${n.href} not followed; use that URL as the endpoint if it is the intended server`}function Os(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Fs(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ns[i])continue;let a=`${r}/${ks(i)}`,o=e[i];if(Array.isArray(o)){if(js[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Hs=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Us=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Ws=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Gs=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Ks=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,qs=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Js=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Ys=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Xs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Zs(e){return e.test.bind(e)}var Qs={date:ec,time:tc.bind(void 0,!1),"date-time":rc,duration:Xs,uri:oc,"uri-reference":Zs(Bs),"uri-template":Zs(Vs),url:Zs(Hs),email:qs,hostname:Zs(zs),ipv4:Zs(Js),ipv6:Zs(Ys),regex:cc,uuid:Zs(Us),"json-pointer":Zs(Ws),"json-pointer-uri-fragment":Zs(Gs),"relative-json-pointer":Zs(Ks)};function $s(e){return e%4==0&&(e%100!=0||e%400==0)}function ec(e){let t=e.match(Is);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&$s(n)?29:Ls[r])}function tc(e,t){let n=t.match(Rs);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var nc=/t|\s/i;function rc(e){let t=e.split(nc);return t.length==2&&ec(t[0])&&tc(!0,t[1])}var ic=/\/|:/,ac=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function oc(e){return ic.test(e)&&ac.test(e)}var sc=/[^\\]\\Z/;function cc(e){if(sc.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function lc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&rOs(e,t))||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Q(e,v,n,r,i,a,o,t).valid&&F.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let xe=[];if(y!==void 0){let t=`${s}/anyOf`,l=F.length,u=!1;for(let s=0;s{let u=Object.create(c),d=Q(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return F.push(...d.errors),d.valid&&xe.push(u),d.valid}).length;u===1?F.length=l:F.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...xe),S!==void 0){let t=`${s}/if`;if(Q(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=Q(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=Q(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||F.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(O!==void 0&&t.lengthk&&F.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${k} properties.`}),ne!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${ks(s)}`,c=Q(s,ne,n,r,i,a,e,t);c.valid||F.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(re!==void 0){let t=`${s}/dependantRequired`;for(let n in re)if(n in e){let r=re[n];for(let i of r)i in e||F.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(ie!==void 0)for(let t in ie){let l=`${s}/dependentSchemas`;if(t in e){let s=Q(e,ie[t],n,r,i,a,o,`${l}/${ks(t)}`,c);s.valid||F.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(ae!==void 0){let t=`${s}/dependencies`;for(let s in ae)if(s in e){let c=ae[s];if(Array.isArray(c))for(let n of c)n in e||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Q(e,c,n,r,i,a,o,`${t}/${ks(s)}`);l.valid||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(E!==void 0){let t=`${s}/properties`;for(let s in E){if(!(s in e))continue;let d=`${o}/${ks(s)}`,f=Q(e[s],E[s],n,r,i,a,d,`${t}/${ks(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,F.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&D!==void 0){let t=`${s}/patternProperties`;for(let s in D){let d=new RegExp(s,`u`),f=D[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${ks(p)}`,h=Q(e[p],f,n,r,i,a,m,`${t}/${ks(s)}`);h.valid?c[p]=l[p]=!0:(u=i,F.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&ee!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${ks(s)}`,f=Q(e[s],ee,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,F.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&te!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${ks(s)}`,u=Q(e[s],te,n,r,i,a,l,t);u.valid?c[s]=!0:F.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){fe!==void 0&&e.length>fe&&F.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${fe}).`}),de!==void 0&&e.length=(j||0)&&(F.length=u),j===void 0&&ue===void 0&&d===0?F.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):j!==void 0&&due&&F.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${ue} items matching schema. ${d} items were found.`})}}if(!u&&ce!==void 0){let u=`${s}/unevaluatedItems`;for(;l=M||e>M)&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${he?`or equal to `:``} ${M}.`})):(me!==void 0&&eM&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${M}.`}),N!==void 0&&e<=N&&F.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${N}.`}),he!==void 0&&e>=he&&F.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${he}.`})),ge!==void 0){let t=e%ge;Math.abs(0-t)>=1.1920929e-7&&Math.abs(ge-t)>=1.1920929e-7&&F.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${ge}.`})}}else if(u===`string`){let t=P===void 0&&_e===void 0?0:lc(e);P!==void 0&&t_e&&F.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${_e}).`}),ve!==void 0&&!new RegExp(ve,`u`).test(e)&&F.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&Qs[T]&&!Qs[T](e)&&F.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:F.length===0,errors:F}}var uc=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Fs(e)}validate(e){return Q(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Fs(e,this.lookup)}},dc=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=ke(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new uc(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},fc=globalThis.crypto;async function pc(e){return(await fc).getRandomValues(new Uint8Array(e))}async function mc(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await hc(e);return{code_verifier:t,code_challenge:await gc(t)}}var vc=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e){super(e),this.name=new.target.name,Xr(this,new.target)}},yc=class extends vc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},bc=class extends vc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},xc=class extends vc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},Sc=class extends vc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},Cc=class extends vc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function wc(e,t,n){if(e)return typeof e.issuer==`string`?Tc(e.issuer,t)?e:void 0:(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e.issuer===void 0?e:{...e,issuer:void 0})}function Tc(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}function Ec(e){if(e==null)return!1;let t=e;return typeof t.tokens==`function`&&typeof t.clientInformation==`function`}async function Dc(e,t,n){let{resourceMetadataUrl:r,scope:i}=tl(t.response);if(await Yc(e,{serverUrl:t.serverUrl,resourceMetadataUrl:r,scope:i,fetchFn:t.fetchFn,...n})!==`AUTHORIZED`)throw new kc}function Oc(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async n=>Dc(e,n,t)}}var kc=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return Zr(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Zr(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Xr(this,new.target)}};function Ac(e){return e?.authorization_response_iss_parameter_supported===!0}function jc({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new yc(`authorization_response`,t,void 0)}else if(e!==t)throw new yc(`authorization_response`,t,e)}}function Mc(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function Nc(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}async function Pc(e,t,n,r,i){if(typeof e==`string`)return{authorizationCode:e,iss:t};let a=e.get(`iss`)??void 0,o=e.get(`code`);if(o)return{authorizationCode:o,iss:a};let s=(await n.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await dl(r,i)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new kc(`Authorization callback failed and the issuer could not be verified`);jc({iss:a,expectedIssuer:s.issuer,issParameterSupported:Ac(s)});let c=e.get(`error`);throw c?new $r(c,e.get(`error_description`)??c,e.get(`error_uri`)??void 0):new kc("Authorization callback contained neither `code` nor `error`")}function Fc(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var Ic=`code`,Lc=`S256`;function Rc(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Fc(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function zc(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Bc(i,a,n);return;case`client_secret_post`:Vc(i,a,r);return;case`none`:Hc(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Bc(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Vc(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Hc(e,t){t.set(`client_id`,e)}function Uc(e){return e===`localhost`||e.endsWith(`.localhost`)||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function Wc(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!Uc(t.hostname))throw new xc(t.href);return t}function Gc(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||Uc(e.hostname))return`native`}return`web`}function Kc(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??Gc(t.redirect_uris)}}async function qc(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=Hr.parse(JSON.parse(n));return $r.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new $r(Qr.ServerError,r)}}function Jc(e,t,n){let r=e.invalidateCredentials===void 0?`retrying authorization without discarding the stored ${n} (provider implements no invalidateCredentials())`:`invalidating the stored ${n} and retrying authorization`;console.warn(`[mcp-sdk] OAuth ${JSON.stringify(t.code)} — ${r}. Cause: ${JSON.stringify(t.message)}`)}async function Yc(e,t){try{return await Zc(e,t)}catch(n){if(n instanceof $r){if(n.code===Qr.InvalidClient||n.code===Qr.UnauthorizedClient)return Jc(e,n,`client credentials and tokens`),await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await Zc(e,t);if(n.code===Qr.InvalidGrant||n.code===Qr.InvalidDpopProof)return Jc(e,n,`tokens`),await e.invalidateCredentials?.(`tokens`),await Zc(e,t)}throw n}}function Xc(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function Zc(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=Kc(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await ul(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await rl(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await dl(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new Sc(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!Tc(t,g))throw new Sc(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await $c(t,e,d),y=v&&d&&!e.validateResourceURL?d.resource:v;y&&await e.saveResourceUrl?.(fl(y));let b=Xc({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),x=await Promise.resolve(e.clientInformation(_)),S=wc(x,g,{canPersistStamp:e.saveClientInformation!==void 0});if(S===void 0&&x?.issuer&&e.saveClientInformation===void 0)throw new Sc(x.issuer,g);if(S&&S.issuer===void 0&&(S={...S,issuer:g},await e.saveClientInformation?.(S,_)),!S){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!Qc(r))throw new $r(Qr.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)S={client_id:r,issuer:g},await e.saveClientInformation?.(S,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);S={...await vl(f,{metadata:p,clientMetadata:l,scope:b,fetchFn:o}),issuer:g},await e.saveClientInformation(S,_)}}let C=!e.redirectUrl;if(n!==void 0||C){n!==void 0&&jc({iss:r,expectedIssuer:p?.issuer,issParameterSupported:Ac(p)});let t=await _l(e,f,{metadata:p,resource:y,authorizationCode:n,iss:r,scope:b,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let w=wc(await e.tokens(_),g);if(w&&w.issuer===void 0&&(w={...w,issuer:g},await e.saveTokens(w,_)),w?.refresh_token&&!c){let t=await e.scopeForRefresh?.(w),n;try{n=await gl(f,{metadata:p,clientInformation:S,refreshToken:w.refresh_token,scope:t,resource:y,addClientAuthentication:e.addClientAuthentication,dpop:await e.dpop?.(),fetchFn:o})}catch(e){if(e instanceof xc)throw e;if(!(e instanceof $r)||e.code===Qr.ServerError)console.warn(`[mcp-sdk] Could not refresh OAuth tokens; falling back to a new authorization request. Cause: ${JSON.stringify(e instanceof Error?e.message:String(e))}`);else throw e}if(n)return await e.saveTokens({...n,issuer:g},_),`AUTHORIZED`}let T=e.state?await e.state():void 0,{authorizationUrl:E,codeVerifier:D}=await pl(f,{metadata:p,clientInformation:S,state:T,redirectUrl:e.redirectUrl,scope:b,resource:y});return await e.saveCodeVerifier(D),await e.redirectToAuthorization(E),`REDIRECT`}function Qc(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function $c(e,t,n){let r=ti(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!ri({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}var el=new Set([`bearer`,`dpop`]);function tl(e){let t=e.headers.get(`WWW-Authenticate`);if(!t)return{};let[n,r]=t.split(` `);if(!n||!el.has(n.toLowerCase())||!r)return{};let i=nl(e,`resource_metadata`)||void 0,a;if(i)try{a=new URL(i)}catch{}let o=nl(e,`scope`)||void 0,s=nl(e,`error`)||void 0,c=nl(e,`error_description`)||void 0;return{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}}function nl(e,t){let n=e.headers.get(`WWW-Authenticate`);if(!n)return null;let r=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),i=n.match(r);if(i){let e=i[1]||i[2];if(e)return e}return null}async function rl(e,t,n=fetch){let r=await cl(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Ir.parse(await r.json())}async function il(e,t,n=fetch){let r=Es(n);try{return await r(e,{headers:t})}catch(n){if(!(n instanceof TypeError))throw n;if(t)try{return await r(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function al(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function ol(e,t,n=fetch){return await il(e,{"MCP-Protocol-Version":t},n)}function sl(e,t){return e?t===`/`?!1:!e.ok&&e.status<500||e.status===502:!0}async function cl(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=al(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await ol(o,a,n);return!r?.metadataUrl&&sl(s,i.pathname)&&(s=await ol(new URL(`/.well-known/${t}`,i),a,n)),s}function ll(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function ul(e,{fetchFn:t=fetch,protocolVersion:n=Ae,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=ll(e);for(let{url:n,type:o}of a){let a=await il(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?Lr.parse(await a.json()):zr.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new yc(`metadata`,t,s.issuer)}return s}}async function dl(e,t){let n,r;try{n=await rl(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await ul(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}function fl(e){return typeof e==`string`?e:e.href}async function pl(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Ic))throw Error(`Incompatible auth server: does not support response type ${Ic}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(Lc))throw Error(`Incompatible auth server: does not support code challenge method ${Lc}`)}else s=new URL(`/authorize`,e);let c=await _c(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Ic),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,Lc),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,fl(o)),{authorizationUrl:s,codeVerifier:l}}function ml(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function hl(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,dpop:o,fetchFn:s}){let c=Wc(t?.token_endpoint??new URL(`/token`,e)),l=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,fl(a)),!i&&r&&zc(Rc(r,t?.token_endpoint_auth_methods_supported??[]),r,l,n);let u=async()=>{let e=new Headers(l);return i&&await i(e,n,c,t),o&&e.set(`DPoP`,await o.buildProof({htm:`POST`,htu:c})),Es(s??fetch)(c,{method:`POST`,headers:e,body:n})},d=await u();if(o&&d.status===400&&(await d.clone().json().catch(()=>{}))?.error===Qr.UseDpopNonce&&(o.observeNonce(d,c),d=await u()),o?.observeNonce(d,c),!d.ok)throw await qc(d);let f=await d.json();try{return Br.parse(ni(f))}catch(e){throw typeof f==`object`&&f&&`error`in f?await qc(JSON.stringify(f)):e}}async function gl(e,{metadata:t,clientInformation:n,refreshToken:r,scope:i,resource:a,addClientAuthentication:o,dpop:s,fetchFn:c}){let l=new URLSearchParams({grant_type:`refresh_token`,refresh_token:r});i&&l.set(`scope`,i);let u=await hl(e,{metadata:t,tokenRequestParams:l,clientInformation:n,addClientAuthentication:o,resource:a,dpop:s,fetchFn:c});return{refresh_token:r,...u,...i&&!u.scope&&{scope:i}}}async function _l(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&jc({iss:a,expectedIssuer:n?.issuer,issParameterSupported:Ac(n)});let c=n?.issuer??String(t),l=async()=>{let t=await e.clientInformation({issuer:c}),n=wc(t,c,{canPersistStamp:!1});if(t&&n===void 0)throw new Sc(String(t.issuer),c);return n},u=await l(),d=o??e.clientMetadata.scope,f;if(e.prepareTokenRequest&&(f=await e.prepareTokenRequest(d)),!f){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);f=ml(i,await e.codeVerifier(),e.redirectUrl)}return u??=await l(),hl(t,{metadata:n,tokenRequestParams:f,clientInformation:u,addClientAuthentication:e.addClientAuthentication,resource:r,dpop:await e.dpop?.(),fetchFn:s})}async function vl(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await Es(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new bc({status:s.status,body:await s.text(),submittedMetadata:o});return Kr.parse(ni(await s.json()))}var yl=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),bl=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(xl(e))}set(e,t){let n=xl(e),r=yl.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!yl.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(xl(e))&&!yl.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=yl.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function xl(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function Sl(e,t){return t===void 0?e:`${e}\0${t}`}var Cl=864e5,wl=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=Sl(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=Sl(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(Sl(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:Tl(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(n?.expiresAt!==void 0&&n.expiresAt>this.now())try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0)this._toolIndex=void 0;else{if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0)this._toolOutputValidatorIndex=void 0;else{if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function Tl(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var El=Symbol.for(`mcp.authSeamEscape`);function Dl(e){if(typeof e==`object`&&e||typeof e==`function`)try{Object.defineProperty(e,El,{value:!0,configurable:!0})}catch{}return e}function Ol(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&e[El]===!0}var kl=-32022,Al=new Set([-32001,-32020,-32021]);function jl(e,t){switch(e.kind){case`result`:return Ml(e.result,t);case`rpc-error`:return Nl(e,t);case`http-error`:return Pl(e,t);case`network-error`:return Fl(e.error,t);case`unusable-reply`:return{kind:`error`,error:new Y(J.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${Ll(e.error)})`,{cause:e.error},{cause:e.error})};case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:Fl(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new Y(J.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function Ml(e,t){let n=ka(Oa).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new Ji({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function Nl(e,t){let{code:n,message:r,data:i}=e;if(n===kl){let e=Rl(i);if(e===void 0)return{kind:`legacy`};let n=new Ji({supported:e,requested:zl(i)??t.requestedVersion},r),a=ci(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return Al.has(n),{kind:`legacy`}}function Pl(e,t){if(e.status===401||e.status===403){let t=e.status===403;return{kind:`error`,error:new ei(t?J.ClientHttpForbidden:J.ClientHttpAuthentication,`Version negotiation failed: ${t?`the server denied access (HTTP 403)`:`the server requires authorization (HTTP 401)`}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:`error`,error:new ei(J.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let n=Bl(e.body);return n===void 0?{kind:`legacy`}:Nl(n,t)}function Fl(e,t){return t.environment===`browser`&&Il(e)?{kind:`legacy`}:{kind:`error`,error:new Y(J.EraNegotiationFailed,`Version negotiation probe failed: ${Ll(e)}`,{cause:e},{cause:e})}}function Il(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function Ll(e){return e instanceof Error?e.message:String(e)}function Rl(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(Array.isArray(t)&&t.length!==0&&t.every(e=>typeof e==`string`))return t}function zl(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function Bl(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var Vl=`legacy`;function Hl(e,t){let n=e?.mode??Vl;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!oi(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?ci(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...ai],fallbackAvailable:!t||si(t).length>0,probe:r}}function Ul(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function Wl(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var Gl=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;t!==void 0&&(Ra(e)||za(e))&&e.id===t.id&&(n._pending=void 0,Ra(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error}))},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{n?e():n=!0};t.onclose=r,Kl.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n)n=!1,e.start=t;else return t.call(e)}}},Kl=new WeakMap;function ql(e){let t=Kl.get(e);Kl.delete(e),t?.()}function Jl(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:ka(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function Yl(e){return e instanceof Y&&e.code===J.ClientHttpUnexpectedContent||e instanceof Error&&e.name===`SyntaxError`}function Xl(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(Ol(t)||t instanceof kc||t instanceof Error&&t.name===`UnauthorizedError`)return{kind:`auth-required`,error:t};if(t instanceof ei){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0,statusText:t.data.statusText}}return Yl(t)?{kind:`unusable-reply`,error:t}:{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function Zl(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await Gl.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>Jl(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=Xl(r,n),d=jl(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new Y(J.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new Y(J.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new Y(J.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function Ql(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function $l(e,t,n,r){let i=new t.constructor({...n,stderr:`ignore`}),a=t.close,o=!1,s,c=new Promise((e,t)=>{s=()=>t(eu())});t.close=async function(){return o=!0,s?.(),a.call(t)};let l;try{let t=Zl(e,{...r,transport:i,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),l=await Promise.race([t,c])}finally{await tu(i),t.close=a}if(o)throw eu();return l}function eu(){return new Y(J.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function tu(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function nu(e){let t=e._meta?.[Fe];return Zo.Implementation(t)?t:void 0}function ru(e,t){if(e&&typeof t==`object`&&t){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&ru(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&ru(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&ru(n,t)}}function iu(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function au(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&_t.safeParse(e.discover).success))return e;throw new Y(J.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var ou={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},su=64,cu=class extends as{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new Y(J.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new dc,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=Bo(t?.inputRequired),this._cache=new wl(t?.responseCacheStore??new bl,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??su,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&oi(this._negotiatedProtocolVersion)&&Ia(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?ms({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=ss(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=ka(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new Z(i.reason===`not-in-era`?X.InternalError:X.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=iu(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new Z(X.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new Z(X.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new Z(l.reason===`not-in-era`?X.InternalError:X.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{ru(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=ka(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new Z(i.reason===`not-in-era`?X.InternalError:X.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new Z(c.reason===`not-in-era`?X.InternalError:X.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Y(J.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,au(t.prior),t);let n=Hl(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t)}else this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=si(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new Y(J.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=Wl(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:Ul(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?Ql(e):void 0;r=o===void 0?await Zl(t,{...a,transport:e,transportKind:i}):await $l(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),ql(e),t}if(ql(e),await super.connect(e),r.era===`legacy`)await this._legacyHandshake(e,n);else if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=nu(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&ci(i).length>0?ci(i):ai).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new Y(J.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=nu(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return oi(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new Y(J.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new Y(J.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new Y(J.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new Y(J.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new Y(J.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new Y(J.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw new Y(J.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new Y(J.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new Y(J.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new Y(J.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},_t,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,e=>e.prompts):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,e=>e.resources):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,e=>e.resourceTemplates):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this._walkPages(e,r=>{let i=r===void 0?t&&{...t}:{...t,cursor:r};return this.request({method:e,...i&&{params:i}},n)},r);return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}async _walkPages(e,t,n){let r=await t(void 0),i=r.nextCursor,a=r,o=1;for(;i!==void 0;){if(this._listMaxPages!==0&&o>=this._listMaxPages)throw new Y(J.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let s=await t(i);if(s.nextCursor===i&&JSON.stringify(n(s))===JSON.stringify(n(a)))break;n(r).push(...n(s)),a=s,i=s.nextCursor,o++}return r}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),Cl),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:qa(n.inputSchema)}async readResource(e,t){let{result:n}=await this._readResource(e,t);return n}async _readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return{result:n,cached:!0};let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return{result:i,cached:!1}}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new Y(J.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!oi(n))throw new Y(J.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e?(a=`open`,c(e.ack)):(a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new Y(J.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`)))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new Y(J.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},v=e=>{p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})};try{this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})}).catch(v)}catch(e){v(e)}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(ou,e.method)?ou[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[Le],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;n===void 0?super._onresponse(e):za(e)?n.settle({cause:`remote`,error:Z.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new Y(J.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)})}_onclose(){if(this._listenState.size>0){let e=new Y(J.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&Ul()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=io(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new Z(X.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof Z&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new Z(X.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new Z(X.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof Z?e:new Z(X.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,e=>e.tools,e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||Wl(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=qa(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=co(Tn,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a)s(null,null);else try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}},lu=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},uu=10,du=13,fu=32;function pu(e){}function mu(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=pu,onError:n=pu,onRetry:r=pu,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new lu(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` diff --git a/internal/ui/dist/assets/new-dashboard-CCTJTeSK.js b/internal/ui/dist/assets/new-dashboard-CFDZmvBm.js similarity index 90% rename from internal/ui/dist/assets/new-dashboard-CCTJTeSK.js rename to internal/ui/dist/assets/new-dashboard-CFDZmvBm.js index c183e55f..7a9a9ec3 100644 --- a/internal/ui/dist/assets/new-dashboard-CCTJTeSK.js +++ b/internal/ui/dist/assets/new-dashboard-CFDZmvBm.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Kn as t,Lt as n,Q as r,Xn as i,Y as a,gi as o,mi as s,pn as c,qn as l}from"./index-CL2Ww4um.js";import{t as u}from"./page-D9GXhDXQ.js";import{t as d}from"./discard-zr3DFRDY.js";var f=e(o(),1),p=s();function m({onClose:e,onCreated:o}){let s=c(),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)({q:``,tab:`query`,range:`1h`}),[v,y]=(0,f.useState)(!1),b=m.trim(),x=d(b!==``||v,e,`this dashboard`);return(0,p.jsxs)(i,{opened:!0,onClose:x.request,closeOnEscape:!1,title:`New dashboard`,size:`min(1280px, 100vw - 32px)`,onKeyDown:x.onKeyDown,children:[x.prompt,(0,p.jsxs)(l,{gap:0,children:[(0,p.jsx)(t,{label:`Dashboard name`,px:`lg`,value:m,onChange:e=>h(e.currentTarget.value),"data-autofocus":!0,required:!0}),(0,p.jsx)(u,{search:g,onSearch:_,context:{spec:{version:1,name:b||`New dashboard`,time:{range:g.range},panels:[]},vars:{},onDirtyChange:y,cancel:x.request,save:{label:`Create dashboard`,run:async e=>{if(!b)throw Error(`Name the dashboard first.`);let t=g.from&&g.to?{from:g.from,to:g.to}:{range:g.range};try{let n=await a({version:1,name:b,time:t,panels:[{...e,id:`panel`}]});s.invalidateQueries({queryKey:r}),o(n.id)}catch(e){throw e instanceof n&&e.problems.length>0?Error(e.problems.map(e=>e.message).join(` `)):e}}}}})]})]})}export{m as NewDashboard}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Kn as t,Lt as n,Q as r,Xn as i,Y as a,gi as o,mi as s,pn as c,qn as l}from"./index-CRKDYJaJ.js";import{t as u}from"./page-TqwEGxR8.js";import{t as d}from"./discard-YoKuewjt.js";var f=e(o(),1),p=s();function m({onClose:e,onCreated:o}){let s=c(),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)({q:``,tab:`query`,range:`1h`}),[v,y]=(0,f.useState)(!1),b=m.trim(),x=d(b!==``||v,e,`this dashboard`);return(0,p.jsxs)(i,{opened:!0,onClose:x.request,closeOnEscape:!1,title:`New dashboard`,size:`min(1280px, 100vw - 32px)`,onKeyDown:x.onKeyDown,children:[x.prompt,(0,p.jsxs)(l,{gap:0,children:[(0,p.jsx)(t,{label:`Dashboard name`,px:`lg`,value:m,onChange:e=>h(e.currentTarget.value),"data-autofocus":!0,required:!0}),(0,p.jsx)(u,{search:g,onSearch:_,context:{spec:{version:1,name:b||`New dashboard`,time:{range:g.range},panels:[]},vars:{},onDirtyChange:y,cancel:x.request,save:{label:`Create dashboard`,run:async e=>{if(!b)throw Error(`Name the dashboard first.`);let t=g.from&&g.to?{from:g.from,to:g.to}:{range:g.range};try{let n=await a({version:1,name:b,time:t,panels:[{...e,id:`panel`}]});s.invalidateQueries({queryKey:r}),o(n.id)}catch(e){throw e instanceof n&&e.problems.length>0?Error(e.problems.map(e=>e.message).join(` `)):e}}}}})]})]})}export{m as NewDashboard}; \ No newline at end of file diff --git a/internal/ui/dist/assets/page-CyLCNkgg.js b/internal/ui/dist/assets/page-DNINkXnr.js similarity index 99% rename from internal/ui/dist/assets/page-CyLCNkgg.js rename to internal/ui/dist/assets/page-DNINkXnr.js index 3cbbf967..6d04781a 100644 --- a/internal/ui/dist/assets/page-CyLCNkgg.js +++ b/internal/ui/dist/assets/page-DNINkXnr.js @@ -1,6 +1,6 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/panel-editor-CCqCD_kx.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/index-CL2Ww4um.js","assets/index-BKxggnz9.css","assets/save-dialog-CVDkqzuX.js","assets/toolbar-BxU8wfSr.js","assets/CopyButton-CeHt7WhA.js","assets/Table-B_pVYmc3.js","assets/live-data-meta-CGsP1XrP.js","assets/lib-DeYqVmar.js","assets/loading-skeleton-BsD5_HiB.js","assets/page-D9GXhDXQ.js","assets/NumberInput-DMNGxCQ3.js","assets/discard-zr3DFRDY.js","assets/new-dashboard-CCTJTeSK.js"])))=>i.map(i=>d[i]); -import{r as e,t}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as n,$n as r,Ar as i,Er as a,Gn as o,Gr as s,Gt as c,Jn as l,Jt as u,Kn as d,Kr as f,Kt as p,Lt as m,M as h,Mr as g,Or as _,Q as v,Qn as y,Qr as b,Rr as x,Sr as S,Tr as C,Tt as w,Ur as T,Ut as E,X as D,Xn as O,Y as ee,Yn as k,Z as A,Zr as j,_r as M,_t as te,ai as N,an as P,at as F,b as I,br as ne,cr as re,ct as ie,dr as ae,dt as oe,er as L,et as se,fr as ce,gi as le,gt as ue,hi as R,it as de,jr as fe,mi as pe,ni as z,nr as B,nt as V,or as H,ot as me,p as he,pn as U,pr as W,q as G,qn as K,qt as q,rt as ge,sr as J,st as _e,ti as ve,tr as ye,tt as be,ur as xe,ut as Se,vr as Ce,wr as Y,y as we,yr as Te,zr as Ee}from"./index-CL2Ww4um.js";import{t as De}from"./loading-skeleton-BsD5_HiB.js";import{a as Oe,c as ke,i as Ae,l as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./live-data-meta-CGsP1XrP.js";import{t as Le}from"./useMutation-BWRBtdcF.js";import{_ as Re,a as ze,c as Be,g as Ve,i as He,l as Ue,m as We,n as Ge,o as Ke,r as qe,s as Je,u as Ye,v as Xe}from"./toolbar-BxU8wfSr.js";import{t as Ze}from"./dashboard-change-chips-BnO9d30A.js";var[Qe,$e]=z(`Accordion component was not found in the tree`),[et,tt]=z(`Accordion.Item component was not found in the tree`),nt={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},X=pe(),rt=C(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,chevron:o,icon:s,onClick:c,onKeyDown:l,children:u,disabled:d,mod:f,...p}=g(`AccordionControl`,null,e),{value:m}=tt(),h=$e(),_=h.isItemActive(m),v=typeof h.order==`number`,y=`h${h.order}`,b=(0,X.jsxs)(Te,{...h.getStyles(`control`,{className:n,classNames:t,style:r,styles:i,variant:h.variant}),unstyled:h.unstyled,mod:[`accordion-control`,{active:_,"chevron-position":h.chevronPosition,disabled:d},f],onClick:e=>{c?.(e),h.onChange(m)},type:`button`,disabled:d,"aria-expanded":_,"aria-controls":h.getRegionId(m),id:h.getControlId(m),onKeyDown:ve({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:h.loop,orientation:`vertical`,onKeyDown:l}),...p,children:[(0,X.jsx)(Y,{component:`span`,mod:{rotate:!h.disableChevronRotation&&_,position:h.chevronPosition},...h.getStyles(`chevron`,{classNames:t,styles:i}),children:o||h.chevron}),(0,X.jsx)(`span`,{...h.getStyles(`label`,{classNames:t,styles:i}),children:u}),s&&(0,X.jsx)(Y,{component:`span`,mod:{"chevron-position":h.chevronPosition},...h.getStyles(`icon`,{classNames:t,styles:i}),children:s})]});return v?(0,X.jsx)(y,{...h.getStyles(`itemTitle`,{classNames:t,styles:i}),children:b}):b});rt.displayName=`@mantine/core/AccordionControl`,rt.classes=nt;var it=C(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:o,mod:s,...c}=g(`AccordionItem`,null,e),l=$e();return(0,X.jsx)(et,{value:{value:o},children:(0,X.jsx)(Y,{mod:[{active:l.isItemActive(o)},s],...l.getStyles(`item`,{className:n,classNames:t,styles:i,style:r,variant:l.variant}),...c})})});it.displayName=`@mantine/core/AccordionItem`,it.classes=nt;var at=C(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,keepMounted:s,keepMountedMode:c,...l}=g(`AccordionPanel`,null,e),{value:u}=tt(),d=$e();return(0,X.jsx)(S,{...d.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:d.isItemActive(u),transitionDuration:d.transitionDuration??200,role:`region`,id:d.getRegionId(u),"aria-labelledby":d.getControlId(u),keepMounted:s??d.keepMounted,keepMountedMode:c??d.keepMountedMode,...l,children:(0,X.jsx)(`div`,{...d.getStyles(`content`,{classNames:t,styles:i}),children:o})})});at.displayName=`@mantine/core/AccordionPanel`,at.classes=nt;var ot={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},st=Ee((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:N(n),"--accordion-radius":r===void 0?void 0:j(r)}})),ct=a(e=>{let t=g(`Accordion`,ot,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,children:l,multiple:u,value:d,defaultValue:p,onChange:m,id:h,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:E,radius:D,chevronIconSize:O,attributes:ee,keepMounted:k,keepMountedMode:A,...j}=t,M=f(h),[te,N]=T({value:d,defaultValue:p,finalValue:u?[]:null,onChange:m}),P=e=>Array.isArray(te)?te.includes(e):e===te,F=e=>{if(!Array.isArray(te)&&b&&e===te)return;let t=Array.isArray(te)?te.includes(e)?te.filter(t=>t!==e):[...te,e]:e===te?null:e;N(t)},I=i({name:`Accordion`,classes:nt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:s,attributes:ee,vars:c,varsResolver:st});return(0,X.jsx)(Qe,{value:{isItemActive:P,onChange:F,getControlId:Xe(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:Xe(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,X.jsx)(J,{size:O}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:I,variant:E,unstyled:s,keepMounted:k,keepMountedMode:A},children:(0,X.jsx)(Y,{...I(`root`),id:M,...j,variant:E,"data-accordion":!0,children:l})})});ct.classes=nt,ct.varsResolver=st,ct.displayName=`@mantine/core/Accordion`,ct.Item=it,ct.Panel=at,ct.Control=rt,ct.Chevron=J;function lt(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},Q=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,Q(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,Z.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=lt(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=lt(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;c&&(n.preventDefault(),n.stopPropagation(),s>=o.current.length?ut(c)?.focus():c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus())}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}var ft=(0,Z.createContext)(null),pt={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},mt=(0,Z.createContext)(null),ht=Ee((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?b(n,`pg-gap`):b(t)}})),gt=C(e=>{let t=g(`PillGroup`,null,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,size:l,disabled:u,attributes:d,...f}=t,p=(0,Z.use)(ft)?.size||l||void 0,m=i({name:`PillGroup`,classes:pt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:ht,stylesCtx:{size:p},rootSelector:`group`});return(0,X.jsx)(mt,{value:{size:p,disabled:u},children:(0,X.jsx)(Y,{size:p,...m(`group`),...f})})});gt.classes=pt,gt.varsResolver=ht,gt.displayName=`@mantine/core/PillGroup`;var _t={variant:`default`},vt=Ee((e,{radius:t},{size:n})=>({root:{"--pill-fz":b(n,`pill-fz`),"--pill-height":b(n,`pill-height`),"--pill-radius":t===void 0?void 0:j(t)}})),yt=C(e=>{let t=g(`Pill`,_t,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,variant:l,children:u,withRemoveButton:d,onRemove:f,removeButtonProps:p,radius:m,size:h,disabled:_,mod:v,attributes:y,...b}=t,x=(0,Z.use)(mt),S=(0,Z.use)(ft),C=h||x?.size||void 0,w=S?.variant===`filled`?`contrast`:l||`default`,T=i({name:`Pill`,classes:pt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:vt,stylesCtx:{size:C}});return(0,X.jsxs)(Y,{component:`span`,variant:w,size:C,...T(`root`,{variant:w}),mod:[{"with-remove":d&&!_,disabled:_||x?.disabled},v],...b,children:[(0,X.jsx)(`span`,{...T(`label`),children:u}),d&&(0,X.jsx)(ce,{variant:`transparent`,radius:m,tabIndex:-1,"aria-hidden":!0,unstyled:s,...p,...T(`remove`,{className:p?.className,style:p?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),p?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),f?.(),p?.onClick?.(e)}})]})});yt.classes=pt,yt.varsResolver=vt,yt.displayName=`@mantine/core/Pill`,yt.Group=gt;var bt={field:`m_45c4369d`},xt={type:`visible`},St=C(e=>{let t=g(`PillsInputField`,xt,e),{classNames:n,className:r,style:a,styles:o,unstyled:c,vars:l,type:u,disabled:d,id:f,pointer:p,mod:m,attributes:h,ref:_,...v}=t,y=(0,Z.use)(ft),b=(0,Z.use)(xe),x=i({name:`PillsInputField`,classes:bt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:c,attributes:h,rootSelector:`field`}),S=d||y?.disabled;return(0,X.jsx)(Y,{component:`input`,ref:s(_,y?.fieldRef),"data-type":u,disabled:S,mod:[{disabled:S,pointer:p},m],...x(`field`),...v,id:b?.inputId||f,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!p&&e.stopPropagation()})});St.classes=bt,St.displayName=`@mantine/core/PillsInputField`;var Ct={size:`sm`},wt=C(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:o,error:s,variant:c,...l}=g([`Input`,`InputWrapper`,`PillsInput`],Ct,e),u=(0,Z.useRef)(null);return(0,X.jsx)(ft,{value:{fieldRef:u,size:i,disabled:a,hasError:!!s,variant:c},children:(0,X.jsx)(re,{size:i,error:s,variant:c,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),u.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(u.current?.focus(),r?.(e))},...l,multiline:!0,disabled:a,__staticSelector:o||`PillsInput`,withAria:!1,children:t})})});wt.displayName=`@mantine/core/PillsInput`,wt.classes=re.classes,wt.Field=St;function Tt(e){return typeof e==`string`?e.trim().toLowerCase():e}function Et({data:e,value:t}){let n=t.map(Tt);return e.reduce((e,t)=>(Oe(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(Tt(e.value))===-1)}):n.indexOf(Tt(t.value))===-1&&e.push(t),e),[])}var Dt={xs:41,sm:50,md:60,lg:72,xl:89},Ot={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},kt=a(e=>{let t=g([`Input`,`InputWrapper`,`MultiSelect`],Ot,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,size:l,value:u,defaultValue:d,onChange:p,onKeyDown:m,variant:h,data:v,dropdownOpened:y,defaultDropdownOpened:b,onDropdownOpen:x,onDropdownClose:S,selectFirstOptionOnChange:C,selectFirstOptionOnDropdownOpen:w,onOptionSubmit:E,comboboxProps:D,filter:O,limit:ee,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:te,onSearchChange:N,readOnly:P,disabled:F,onFocus:I,onBlur:ne,radius:re,rightSection:ie,rightSectionWidth:ae,rightSectionPointerEvents:oe,rightSectionProps:L,leftSection:se,leftSectionWidth:ce,leftSectionPointerEvents:le,leftSectionProps:ue,inputContainer:R,inputWrapperOrder:de,withAsterisk:pe,labelProps:z,descriptionProps:B,errorProps:V,successProps:H,wrapperProps:me,description:he,label:U,error:W,success:G,maxValues:K,searchable:q,nothingFoundMessage:ge,withCheckIcon:J,withAlignedLabels:_e,checkIconPosition:ve,hidePickedOptions:ye,withErrorStyles:be,withSuccessStyles:xe,name:Se,form:Ce,id:Y,clearable:we,clearSectionMode:Te,clearButtonProps:Ee,hiddenInputProps:De,placeholder:Oe,hiddenInputValuesDivider:Me,required:Ie,mod:Le,renderOption:ze,renderPill:Be,onRemove:He,onClear:Ue,onMaxValues:We,scrollAreaProps:Ge,chevronColor:Ke,attributes:qe,clearSearchOnChange:Je,openOnFocus:Ye,loading:Xe,loadingPosition:Ze,loaderProps:Qe,withPillsReorder:$e,...et}=t,tt=f(Y),nt=Pe({id:tt,label:U,labelProps:z,inputWrapperOrder:de}),rt=je(v),it=ke(rt),at=(0,Z.useRef)({}),ot=Fe({opened:y,defaultOpened:b,onDropdownOpen:()=>{x?.(),w&&ot.selectFirstOption()},onDropdownClose:()=>{S?.(),ot.resetSelectedOption()}}),{styleProps:st,rest:{type:ct,autoComplete:lt,...ut}}=_(et),[Q,ft]=T({value:u,defaultValue:d,finalValue:[],onChange:p}),{getPillProps:pt,getListProps:mt,handleInputKeyDown:ht}=dt({value:Q,onChange:ft,enabled:$e&&!F&&!P}),[gt,_t]=T({value:M,defaultValue:te,finalValue:``,onChange:N}),vt=e=>{_t(e),ot.resetSelectedOption()},bt=i({name:`MultiSelect`,classes:{},props:t,classNames:n,styles:o,unstyled:s,attributes:qe}),{resolvedClassNames:xt,resolvedStyles:St}=fe({props:t,styles:o,classNames:n}),Ct=e=>{m?.(e),e.defaultPrevented||(e.key===` `&&!q&&(e.preventDefault(),ot.toggleDropdown()),e.key===`Backspace`&>.length===0&&Q.length>0&&!e.nativeEvent.isComposing&&!P&&(He?.(Q[Q.length-1]),ft(Q.slice(0,Q.length-1))),ht(e))},Tt=Q.map((e,t)=>{let n=it[`${e}`]||at.current[`${e}`],r=pt(t);return Be?(0,X.jsx)(Z.Fragment,{children:Be({option:n,value:e,onRemove:()=>{ft(Q.filter(t=>e!==t)),He?.(e)},disabled:F,reorderProps:r})},`${e}-${t}`):(0,X.jsx)(yt,{withRemoveButton:!P&&!it[`${e}`]?.disabled,onRemove:()=>{ft(Q.filter(t=>e!==t)),He?.(e)},unstyled:s,disabled:F,...bt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,Z.useEffect)(()=>{C&&ot.selectFirstOption()},[C,gt]),(0,Z.useEffect)(()=>{Q.forEach(e=>{`${e}`in it&&(at.current[`${e}`]=it[`${e}`])})},[it,Q]);let kt=(0,X.jsx)(Ne.ClearButton,{...Ee,onClear:()=>{Ue?.(),ft([]),vt(``)}}),At=Et({data:rt,value:Q}),jt=we&&Q.length>0&&!F&&!P,Mt=jt?{paddingInlineEnd:Dt[l]??Dt.sm}:void 0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Ne,{store:ot,classNames:xt,styles:St,unstyled:s,size:l,readOnly:P,__staticSelector:`MultiSelect`,attributes:qe,floatingHeight:j,onOptionSubmit:e=>{E?.(e),Je&&vt(``),ot.updateSelectedOptionIndex(`selected`),Q.includes(it[`${e}`].value)?(ft(Q.filter(t=>t!==it[`${e}`].value)),He?.(it[`${e}`].value)):Q.lengthq?ot.openDropdown():ot.toggleDropdown(),"data-expanded":ot.dropdownOpened||void 0,id:tt,required:Ie,mod:Le,attributes:qe,children:(0,X.jsxs)(yt.Group,{attributes:qe,disabled:F,unstyled:s,...bt(`pillsList`,{style:Mt}),...mt(),children:[Tt,(0,X.jsx)(Ne.EventsTarget,{autoComplete:lt,withExpandedAttribute:!0,children:(0,X.jsx)(wt.Field,{...ut,id:tt,placeholder:Oe,type:!q&&!Oe?`hidden`:`visible`,...bt(`inputField`),unstyled:s,onFocus:e=>{I?.(e),Ye&&q&&ot.openDropdown()},onBlur:e=>{ne?.(e),ot.closeDropdown(),vt(``)},onKeyDown:Ct,value:gt,onChange:e=>{if(Re(e)){if(!P){let t=Ve(it,e.currentTarget.value);t&&!Q.includes(t.value)&&Q.lengthe*40+(e-1)*12,Nt={s:3,m:6,l:10},Pt={stat:4},Ft=e=>Math.max(Pt[e.viz]??0,Nt[e.height??(e.viz===`service_map`?`l`:e.viz===`stat`?`s`:`m`)]);function It(){let[e,t]=(0,Z.useState)(()=>window.innerHeight);return(0,Z.useEffect)(()=>{let e=()=>t(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Lt(){return(0,X.jsxs)(K,{gap:`md`,"data-dashboard-skeleton":!0,children:[(0,X.jsxs)(K,{gap:`sm`,"data-dashboard-header-skeleton":!0,children:[(0,X.jsxs)(ae,{justify:`space-between`,children:[(0,X.jsx)(l,{height:28,width:`32%`}),(0,X.jsx)(l,{height:28,width:28})]}),(0,X.jsx)(l,{height:12,width:`52%`}),(0,X.jsxs)(ae,{justify:`space-between`,children:[(0,X.jsx)(l,{height:32,width:180}),(0,X.jsx)(l,{height:32,width:120})]})]}),(0,X.jsx)(Y,{style:{containerType:`inline-size`},children:(0,X.jsx)(Y,{className:`dashboard-loading-grid`,style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`,gap:12},children:[`stat`,`stat`,`stat`,`timeseries`,`table`].map((e,t)=>(0,X.jsxs)(M,{withBorder:!0,p:`md`,className:`dashboard-loading-panel`,"data-skeleton-columns":e===`stat`?4:6,style:{display:`flex`,flexDirection:`column`,minHeight:Mt(e===`stat`?4:6)},children:[(0,X.jsx)(l,{height:14,width:`44%`,mb:`xl`}),(0,X.jsx)(De,{viz:e,rows:4})]},t))})})]})}function Rt(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function zt(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Bt(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Rt(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=zt(r,u,s[0]),f=zt(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Vt(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Rt(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Wt(d,0,s-r),f=Wt(f,0,l-i),{x:d,y:f}}function Ht(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Rt(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ut(e,t,n){let{margin:r,rowHeight:i}=e,a=Rt(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Wt(e,t,n){return Math.max(Math.min(e,n),t)}function Gt(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Kt(e,t){for(let n=0;nGt(e,t))}function Jt(e,t){return t===`horizontal`?Xt(e):t===`vertical`||t===`wrap`?Yt(e):[...e]}function Yt(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Xt(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Zt(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Qt(e,t){for(let n=0;ne.static===!0)}function en(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function tn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),i.y===1/0&&(i.y=Zt(n)),!i.static)n.push(i);else for(;Kt(n,i);)i.y++}}return e}function on(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Jt(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=qt(d,t),p=f.length>0;if(p&&c)return tn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return on(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return on(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return on(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:on(e,n,l,u,r,c,i)}function cn(e,t,n){return Math.max(t,Math.min(n,e))}var ln=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:cn(t,0,Math.max(0,r-e.w)),y:cn(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:cn(t,1,Math.max(1,o)),h:cn(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:cn(t,e.minW??1,e.maxW??1/0),h:cn(n,e.minH??1,e.maxH??1/0)}}}];function un(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function dn(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function fn({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function pn({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function mn(e){return e*100+`%`}function hn(e,t,n,r){return e+n>r?t:n}function gn(e,t,n){return e<0?t:n}function _n(e){return Math.max(0,e)}function vn(e){return Math.max(0,e)}var yn=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:gn(o,e.height,i),top:vn(o)}},bn=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:hn(e.left,e.width,o,n),left:_n(i)}},xn=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:vn(r),left:0}:{height:i,width:a,top:vn(r),left:o}},Sn=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:gn(r,e.height,a),top:vn(r)}},Cn={n:yn,ne:(e,t,n)=>yn(e,bn(e,t,n)),e:bn,se:(e,t,n)=>Sn(e,bn(e,t,n)),s:Sn,sw:(e,t,n)=>Sn(e,xn(e,t)),w:xn,nw:(e,t,n)=>yn(e,xn(e,t))};function wn(e,t,n,r){let i=Cn[e];return i?i(t,{...t,...n},r):n}var Tn={type:`transform`,scale:1,calcStyle(e){return fn(e)}},En={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Dn={enabled:!0,bounded:!1,threshold:3},On={enabled:!0,handles:[`se`]},kn={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function An(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??$t(e).length>0;for(let i=o+1;it.y+t.h)break;Gt(t,o)&&An(e,o,n+t[a],r,s)}}t[r]=n}function jn(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Kt(e,t);)t.y--;let i;for(;(i=Kt(e,t))!==void 0;)An(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Mn(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Kt(e,t);)t.x--;let i;for(;(i=Kt(e,t))!==void 0;)if(An(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Kt(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Nn={type:`vertical`,allowOverlap:!1,compact(e,t){let n=$t(e),r=Zt(n),i=Yt(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Vn(e,t){let n=Bn(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Hn(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Un(e,t,n,r,i,a){let o=e[n];if(o)return tn(o);let s=e[r],c=Bn(t),l=c.slice(c.indexOf(n));for(let t=0;t{var r;(function(n,i){typeof e==`object`&&t!==void 0?i(e):typeof r==`function`&&r.amd?r([`exports`],i):(n=typeof globalThis<`u`?globalThis:n||self,i(n[`fast-equals`]={}))})(n,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=(0,e.createIsNestedEqual)(f);function f(e,f,p){if(e===f)return!0;if(!e||!f||typeof e!=`object`||typeof f!=`object`)return e!==e&&f!==f;if(i(e)&&i(f))return c(e,f,d,p);var m=Array.isArray(e),h=Array.isArray(f);if(m||h)return m===h&&t(e,f,d,p);var g=s.call(e);return g===s.call(f)?g===`[object Date]`?n(e,f,d,p):g===`[object RegExp]`?l(e,f,d,p):g===`[object Map]`?r(e,f,d,p):g===`[object Set]`?u(e,f,d,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(f)?!1:c(e,f,d,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),f.valueOf()):!1:!1}return f}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x),w=c(r(x,{createIsNestedEqual:function(){return o}})),T=c(S),E=c(r(S,{createIsNestedEqual:function(){return o}}));e.circularDeepEqual=function(e,t){return T(e,t,new WeakMap)},e.circularShallowEqual=function(e,t){return E(e,t,new WeakMap)},e.createCustomCircularEqual=function(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})},e.createCustomEqual=function(e){return c(r(x,e(x)))},e.deepEqual=function(e,t){return C(e,t,void 0)},e.sameValueZeroEqual=o,e.shallowEqual=function(e,t){return w(e,t,void 0)},Object.defineProperty(e,"__esModule",{value:!0})}))})),Kn=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),qn=t(((e,t)=>{var n=Kn();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Jn=t(((e,t)=>{t.exports=qn()()})),$=e(Jn(),1);function Yn(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Yn(e.changedTouches,e=>t===e.identifier)}function yr(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function br(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function xr(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??br();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/panel-editor-Dx0fP2VL.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/index-CRKDYJaJ.js","assets/index-BKxggnz9.css","assets/save-dialog-jF2dwSKX.js","assets/toolbar-DsH2ghVs.js","assets/CopyButton-DfD1hFjv.js","assets/Table-DKSK2CAk.js","assets/live-data-meta-D4rcFCF2.js","assets/lib-DSpv4cMb.js","assets/loading-skeleton-BgW8PQ9g.js","assets/page-TqwEGxR8.js","assets/NumberInput-C4qWjk_e.js","assets/discard-YoKuewjt.js","assets/new-dashboard-CFDZmvBm.js"])))=>i.map(i=>d[i]); +import{r as e,t}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as n,$n as r,Ar as i,Er as a,Gn as o,Gr as s,Gt as c,Jn as l,Jt as u,Kn as d,Kr as f,Kt as p,Lt as m,M as h,Mr as g,Or as _,Q as v,Qn as y,Qr as b,Rr as x,Sr as S,Tr as C,Tt as w,Ur as T,Ut as E,X as D,Xn as O,Y as ee,Yn as k,Z as A,Zr as j,_r as M,_t as te,ai as N,an as P,at as F,b as I,br as ne,cr as re,ct as ie,dr as ae,dt as oe,er as L,et as se,fr as ce,gi as le,gt as ue,hi as R,it as de,jr as fe,mi as pe,ni as z,nr as B,nt as V,or as H,ot as me,p as he,pn as U,pr as W,q as G,qn as K,qt as q,rt as ge,sr as J,st as _e,ti as ve,tr as ye,tt as be,ur as xe,ut as Se,vr as Ce,wr as Y,y as we,yr as Te,zr as Ee}from"./index-CRKDYJaJ.js";import{t as De}from"./loading-skeleton-BgW8PQ9g.js";import{a as Oe,c as ke,i as Ae,l as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./live-data-meta-D4rcFCF2.js";import{t as Le}from"./useMutation-C6XBlFap.js";import{_ as Re,a as ze,c as Be,g as Ve,i as He,l as Ue,m as We,n as Ge,o as Ke,r as qe,s as Je,u as Ye,v as Xe}from"./toolbar-DsH2ghVs.js";import{t as Ze}from"./dashboard-change-chips-CsKsdB0I.js";var[Qe,$e]=z(`Accordion component was not found in the tree`),[et,tt]=z(`Accordion.Item component was not found in the tree`),nt={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},X=pe(),rt=C(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,chevron:o,icon:s,onClick:c,onKeyDown:l,children:u,disabled:d,mod:f,...p}=g(`AccordionControl`,null,e),{value:m}=tt(),h=$e(),_=h.isItemActive(m),v=typeof h.order==`number`,y=`h${h.order}`,b=(0,X.jsxs)(Te,{...h.getStyles(`control`,{className:n,classNames:t,style:r,styles:i,variant:h.variant}),unstyled:h.unstyled,mod:[`accordion-control`,{active:_,"chevron-position":h.chevronPosition,disabled:d},f],onClick:e=>{c?.(e),h.onChange(m)},type:`button`,disabled:d,"aria-expanded":_,"aria-controls":h.getRegionId(m),id:h.getControlId(m),onKeyDown:ve({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:h.loop,orientation:`vertical`,onKeyDown:l}),...p,children:[(0,X.jsx)(Y,{component:`span`,mod:{rotate:!h.disableChevronRotation&&_,position:h.chevronPosition},...h.getStyles(`chevron`,{classNames:t,styles:i}),children:o||h.chevron}),(0,X.jsx)(`span`,{...h.getStyles(`label`,{classNames:t,styles:i}),children:u}),s&&(0,X.jsx)(Y,{component:`span`,mod:{"chevron-position":h.chevronPosition},...h.getStyles(`icon`,{classNames:t,styles:i}),children:s})]});return v?(0,X.jsx)(y,{...h.getStyles(`itemTitle`,{classNames:t,styles:i}),children:b}):b});rt.displayName=`@mantine/core/AccordionControl`,rt.classes=nt;var it=C(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:o,mod:s,...c}=g(`AccordionItem`,null,e),l=$e();return(0,X.jsx)(et,{value:{value:o},children:(0,X.jsx)(Y,{mod:[{active:l.isItemActive(o)},s],...l.getStyles(`item`,{className:n,classNames:t,styles:i,style:r,variant:l.variant}),...c})})});it.displayName=`@mantine/core/AccordionItem`,it.classes=nt;var at=C(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,keepMounted:s,keepMountedMode:c,...l}=g(`AccordionPanel`,null,e),{value:u}=tt(),d=$e();return(0,X.jsx)(S,{...d.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:d.isItemActive(u),transitionDuration:d.transitionDuration??200,role:`region`,id:d.getRegionId(u),"aria-labelledby":d.getControlId(u),keepMounted:s??d.keepMounted,keepMountedMode:c??d.keepMountedMode,...l,children:(0,X.jsx)(`div`,{...d.getStyles(`content`,{classNames:t,styles:i}),children:o})})});at.displayName=`@mantine/core/AccordionPanel`,at.classes=nt;var ot={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},st=Ee((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:N(n),"--accordion-radius":r===void 0?void 0:j(r)}})),ct=a(e=>{let t=g(`Accordion`,ot,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,children:l,multiple:u,value:d,defaultValue:p,onChange:m,id:h,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:E,radius:D,chevronIconSize:O,attributes:ee,keepMounted:k,keepMountedMode:A,...j}=t,M=f(h),[te,N]=T({value:d,defaultValue:p,finalValue:u?[]:null,onChange:m}),P=e=>Array.isArray(te)?te.includes(e):e===te,F=e=>{if(!Array.isArray(te)&&b&&e===te)return;let t=Array.isArray(te)?te.includes(e)?te.filter(t=>t!==e):[...te,e]:e===te?null:e;N(t)},I=i({name:`Accordion`,classes:nt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:s,attributes:ee,vars:c,varsResolver:st});return(0,X.jsx)(Qe,{value:{isItemActive:P,onChange:F,getControlId:Xe(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:Xe(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,X.jsx)(J,{size:O}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:I,variant:E,unstyled:s,keepMounted:k,keepMountedMode:A},children:(0,X.jsx)(Y,{...I(`root`),id:M,...j,variant:E,"data-accordion":!0,children:l})})});ct.classes=nt,ct.varsResolver=st,ct.displayName=`@mantine/core/Accordion`,ct.Item=it,ct.Panel=at,ct.Control=rt,ct.Chevron=J;function lt(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},Q=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,Q(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,Z.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=lt(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=lt(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;c&&(n.preventDefault(),n.stopPropagation(),s>=o.current.length?ut(c)?.focus():c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus())}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}var ft=(0,Z.createContext)(null),pt={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},mt=(0,Z.createContext)(null),ht=Ee((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?b(n,`pg-gap`):b(t)}})),gt=C(e=>{let t=g(`PillGroup`,null,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,size:l,disabled:u,attributes:d,...f}=t,p=(0,Z.use)(ft)?.size||l||void 0,m=i({name:`PillGroup`,classes:pt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:ht,stylesCtx:{size:p},rootSelector:`group`});return(0,X.jsx)(mt,{value:{size:p,disabled:u},children:(0,X.jsx)(Y,{size:p,...m(`group`),...f})})});gt.classes=pt,gt.varsResolver=ht,gt.displayName=`@mantine/core/PillGroup`;var _t={variant:`default`},vt=Ee((e,{radius:t},{size:n})=>({root:{"--pill-fz":b(n,`pill-fz`),"--pill-height":b(n,`pill-height`),"--pill-radius":t===void 0?void 0:j(t)}})),yt=C(e=>{let t=g(`Pill`,_t,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,variant:l,children:u,withRemoveButton:d,onRemove:f,removeButtonProps:p,radius:m,size:h,disabled:_,mod:v,attributes:y,...b}=t,x=(0,Z.use)(mt),S=(0,Z.use)(ft),C=h||x?.size||void 0,w=S?.variant===`filled`?`contrast`:l||`default`,T=i({name:`Pill`,classes:pt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:vt,stylesCtx:{size:C}});return(0,X.jsxs)(Y,{component:`span`,variant:w,size:C,...T(`root`,{variant:w}),mod:[{"with-remove":d&&!_,disabled:_||x?.disabled},v],...b,children:[(0,X.jsx)(`span`,{...T(`label`),children:u}),d&&(0,X.jsx)(ce,{variant:`transparent`,radius:m,tabIndex:-1,"aria-hidden":!0,unstyled:s,...p,...T(`remove`,{className:p?.className,style:p?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),p?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),f?.(),p?.onClick?.(e)}})]})});yt.classes=pt,yt.varsResolver=vt,yt.displayName=`@mantine/core/Pill`,yt.Group=gt;var bt={field:`m_45c4369d`},xt={type:`visible`},St=C(e=>{let t=g(`PillsInputField`,xt,e),{classNames:n,className:r,style:a,styles:o,unstyled:c,vars:l,type:u,disabled:d,id:f,pointer:p,mod:m,attributes:h,ref:_,...v}=t,y=(0,Z.use)(ft),b=(0,Z.use)(xe),x=i({name:`PillsInputField`,classes:bt,props:t,className:r,style:a,classNames:n,styles:o,unstyled:c,attributes:h,rootSelector:`field`}),S=d||y?.disabled;return(0,X.jsx)(Y,{component:`input`,ref:s(_,y?.fieldRef),"data-type":u,disabled:S,mod:[{disabled:S,pointer:p},m],...x(`field`),...v,id:b?.inputId||f,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!p&&e.stopPropagation()})});St.classes=bt,St.displayName=`@mantine/core/PillsInputField`;var Ct={size:`sm`},wt=C(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:o,error:s,variant:c,...l}=g([`Input`,`InputWrapper`,`PillsInput`],Ct,e),u=(0,Z.useRef)(null);return(0,X.jsx)(ft,{value:{fieldRef:u,size:i,disabled:a,hasError:!!s,variant:c},children:(0,X.jsx)(re,{size:i,error:s,variant:c,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),u.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(u.current?.focus(),r?.(e))},...l,multiline:!0,disabled:a,__staticSelector:o||`PillsInput`,withAria:!1,children:t})})});wt.displayName=`@mantine/core/PillsInput`,wt.classes=re.classes,wt.Field=St;function Tt(e){return typeof e==`string`?e.trim().toLowerCase():e}function Et({data:e,value:t}){let n=t.map(Tt);return e.reduce((e,t)=>(Oe(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(Tt(e.value))===-1)}):n.indexOf(Tt(t.value))===-1&&e.push(t),e),[])}var Dt={xs:41,sm:50,md:60,lg:72,xl:89},Ot={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},kt=a(e=>{let t=g([`Input`,`InputWrapper`,`MultiSelect`],Ot,e),{classNames:n,className:r,style:a,styles:o,unstyled:s,vars:c,size:l,value:u,defaultValue:d,onChange:p,onKeyDown:m,variant:h,data:v,dropdownOpened:y,defaultDropdownOpened:b,onDropdownOpen:x,onDropdownClose:S,selectFirstOptionOnChange:C,selectFirstOptionOnDropdownOpen:w,onOptionSubmit:E,comboboxProps:D,filter:O,limit:ee,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:te,onSearchChange:N,readOnly:P,disabled:F,onFocus:I,onBlur:ne,radius:re,rightSection:ie,rightSectionWidth:ae,rightSectionPointerEvents:oe,rightSectionProps:L,leftSection:se,leftSectionWidth:ce,leftSectionPointerEvents:le,leftSectionProps:ue,inputContainer:R,inputWrapperOrder:de,withAsterisk:pe,labelProps:z,descriptionProps:B,errorProps:V,successProps:H,wrapperProps:me,description:he,label:U,error:W,success:G,maxValues:K,searchable:q,nothingFoundMessage:ge,withCheckIcon:J,withAlignedLabels:_e,checkIconPosition:ve,hidePickedOptions:ye,withErrorStyles:be,withSuccessStyles:xe,name:Se,form:Ce,id:Y,clearable:we,clearSectionMode:Te,clearButtonProps:Ee,hiddenInputProps:De,placeholder:Oe,hiddenInputValuesDivider:Me,required:Ie,mod:Le,renderOption:ze,renderPill:Be,onRemove:He,onClear:Ue,onMaxValues:We,scrollAreaProps:Ge,chevronColor:Ke,attributes:qe,clearSearchOnChange:Je,openOnFocus:Ye,loading:Xe,loadingPosition:Ze,loaderProps:Qe,withPillsReorder:$e,...et}=t,tt=f(Y),nt=Pe({id:tt,label:U,labelProps:z,inputWrapperOrder:de}),rt=je(v),it=ke(rt),at=(0,Z.useRef)({}),ot=Fe({opened:y,defaultOpened:b,onDropdownOpen:()=>{x?.(),w&&ot.selectFirstOption()},onDropdownClose:()=>{S?.(),ot.resetSelectedOption()}}),{styleProps:st,rest:{type:ct,autoComplete:lt,...ut}}=_(et),[Q,ft]=T({value:u,defaultValue:d,finalValue:[],onChange:p}),{getPillProps:pt,getListProps:mt,handleInputKeyDown:ht}=dt({value:Q,onChange:ft,enabled:$e&&!F&&!P}),[gt,_t]=T({value:M,defaultValue:te,finalValue:``,onChange:N}),vt=e=>{_t(e),ot.resetSelectedOption()},bt=i({name:`MultiSelect`,classes:{},props:t,classNames:n,styles:o,unstyled:s,attributes:qe}),{resolvedClassNames:xt,resolvedStyles:St}=fe({props:t,styles:o,classNames:n}),Ct=e=>{m?.(e),e.defaultPrevented||(e.key===` `&&!q&&(e.preventDefault(),ot.toggleDropdown()),e.key===`Backspace`&>.length===0&&Q.length>0&&!e.nativeEvent.isComposing&&!P&&(He?.(Q[Q.length-1]),ft(Q.slice(0,Q.length-1))),ht(e))},Tt=Q.map((e,t)=>{let n=it[`${e}`]||at.current[`${e}`],r=pt(t);return Be?(0,X.jsx)(Z.Fragment,{children:Be({option:n,value:e,onRemove:()=>{ft(Q.filter(t=>e!==t)),He?.(e)},disabled:F,reorderProps:r})},`${e}-${t}`):(0,X.jsx)(yt,{withRemoveButton:!P&&!it[`${e}`]?.disabled,onRemove:()=>{ft(Q.filter(t=>e!==t)),He?.(e)},unstyled:s,disabled:F,...bt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,Z.useEffect)(()=>{C&&ot.selectFirstOption()},[C,gt]),(0,Z.useEffect)(()=>{Q.forEach(e=>{`${e}`in it&&(at.current[`${e}`]=it[`${e}`])})},[it,Q]);let kt=(0,X.jsx)(Ne.ClearButton,{...Ee,onClear:()=>{Ue?.(),ft([]),vt(``)}}),At=Et({data:rt,value:Q}),jt=we&&Q.length>0&&!F&&!P,Mt=jt?{paddingInlineEnd:Dt[l]??Dt.sm}:void 0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Ne,{store:ot,classNames:xt,styles:St,unstyled:s,size:l,readOnly:P,__staticSelector:`MultiSelect`,attributes:qe,floatingHeight:j,onOptionSubmit:e=>{E?.(e),Je&&vt(``),ot.updateSelectedOptionIndex(`selected`),Q.includes(it[`${e}`].value)?(ft(Q.filter(t=>t!==it[`${e}`].value)),He?.(it[`${e}`].value)):Q.lengthq?ot.openDropdown():ot.toggleDropdown(),"data-expanded":ot.dropdownOpened||void 0,id:tt,required:Ie,mod:Le,attributes:qe,children:(0,X.jsxs)(yt.Group,{attributes:qe,disabled:F,unstyled:s,...bt(`pillsList`,{style:Mt}),...mt(),children:[Tt,(0,X.jsx)(Ne.EventsTarget,{autoComplete:lt,withExpandedAttribute:!0,children:(0,X.jsx)(wt.Field,{...ut,id:tt,placeholder:Oe,type:!q&&!Oe?`hidden`:`visible`,...bt(`inputField`),unstyled:s,onFocus:e=>{I?.(e),Ye&&q&&ot.openDropdown()},onBlur:e=>{ne?.(e),ot.closeDropdown(),vt(``)},onKeyDown:Ct,value:gt,onChange:e=>{if(Re(e)){if(!P){let t=Ve(it,e.currentTarget.value);t&&!Q.includes(t.value)&&Q.lengthe*40+(e-1)*12,Nt={s:3,m:6,l:10},Pt={stat:4},Ft=e=>Math.max(Pt[e.viz]??0,Nt[e.height??(e.viz===`service_map`?`l`:e.viz===`stat`?`s`:`m`)]);function It(){let[e,t]=(0,Z.useState)(()=>window.innerHeight);return(0,Z.useEffect)(()=>{let e=()=>t(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Lt(){return(0,X.jsxs)(K,{gap:`md`,"data-dashboard-skeleton":!0,children:[(0,X.jsxs)(K,{gap:`sm`,"data-dashboard-header-skeleton":!0,children:[(0,X.jsxs)(ae,{justify:`space-between`,children:[(0,X.jsx)(l,{height:28,width:`32%`}),(0,X.jsx)(l,{height:28,width:28})]}),(0,X.jsx)(l,{height:12,width:`52%`}),(0,X.jsxs)(ae,{justify:`space-between`,children:[(0,X.jsx)(l,{height:32,width:180}),(0,X.jsx)(l,{height:32,width:120})]})]}),(0,X.jsx)(Y,{style:{containerType:`inline-size`},children:(0,X.jsx)(Y,{className:`dashboard-loading-grid`,style:{display:`grid`,gridTemplateColumns:`repeat(12, minmax(0, 1fr))`,gap:12},children:[`stat`,`stat`,`stat`,`timeseries`,`table`].map((e,t)=>(0,X.jsxs)(M,{withBorder:!0,p:`md`,className:`dashboard-loading-panel`,"data-skeleton-columns":e===`stat`?4:6,style:{display:`flex`,flexDirection:`column`,minHeight:Mt(e===`stat`?4:6)},children:[(0,X.jsx)(l,{height:14,width:`44%`,mb:`xl`}),(0,X.jsx)(De,{viz:e,rows:4})]},t))})})]})}function Rt(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function zt(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Bt(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Rt(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=zt(r,u,s[0]),f=zt(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Vt(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Rt(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Wt(d,0,s-r),f=Wt(f,0,l-i),{x:d,y:f}}function Ht(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Rt(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ut(e,t,n){let{margin:r,rowHeight:i}=e,a=Rt(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Wt(e,t,n){return Math.max(Math.min(e,n),t)}function Gt(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Kt(e,t){for(let n=0;nGt(e,t))}function Jt(e,t){return t===`horizontal`?Xt(e):t===`vertical`||t===`wrap`?Yt(e):[...e]}function Yt(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Xt(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Zt(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Qt(e,t){for(let n=0;ne.static===!0)}function en(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function tn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),i.y===1/0&&(i.y=Zt(n)),!i.static)n.push(i);else for(;Kt(n,i);)i.y++}}return e}function on(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Jt(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=qt(d,t),p=f.length>0;if(p&&c)return tn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return on(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return on(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return on(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:on(e,n,l,u,r,c,i)}function cn(e,t,n){return Math.max(t,Math.min(n,e))}var ln=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:cn(t,0,Math.max(0,r-e.w)),y:cn(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:cn(t,1,Math.max(1,o)),h:cn(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:cn(t,e.minW??1,e.maxW??1/0),h:cn(n,e.minH??1,e.maxH??1/0)}}}];function un(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function dn(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function fn({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function pn({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function mn(e){return e*100+`%`}function hn(e,t,n,r){return e+n>r?t:n}function gn(e,t,n){return e<0?t:n}function _n(e){return Math.max(0,e)}function vn(e){return Math.max(0,e)}var yn=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:gn(o,e.height,i),top:vn(o)}},bn=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:hn(e.left,e.width,o,n),left:_n(i)}},xn=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:vn(r),left:0}:{height:i,width:a,top:vn(r),left:o}},Sn=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:gn(r,e.height,a),top:vn(r)}},Cn={n:yn,ne:(e,t,n)=>yn(e,bn(e,t,n)),e:bn,se:(e,t,n)=>Sn(e,bn(e,t,n)),s:Sn,sw:(e,t,n)=>Sn(e,xn(e,t)),w:xn,nw:(e,t,n)=>yn(e,xn(e,t))};function wn(e,t,n,r){let i=Cn[e];return i?i(t,{...t,...n},r):n}var Tn={type:`transform`,scale:1,calcStyle(e){return fn(e)}},En={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Dn={enabled:!0,bounded:!1,threshold:3},On={enabled:!0,handles:[`se`]},kn={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function An(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??$t(e).length>0;for(let i=o+1;it.y+t.h)break;Gt(t,o)&&An(e,o,n+t[a],r,s)}}t[r]=n}function jn(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Kt(e,t);)t.y--;let i;for(;(i=Kt(e,t))!==void 0;)An(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Mn(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Kt(e,t);)t.x--;let i;for(;(i=Kt(e,t))!==void 0;)if(An(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Kt(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Nn={type:`vertical`,allowOverlap:!1,compact(e,t){let n=$t(e),r=Zt(n),i=Yt(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Vn(e,t){let n=Bn(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Hn(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Un(e,t,n,r,i,a){let o=e[n];if(o)return tn(o);let s=e[r],c=Bn(t),l=c.slice(c.indexOf(n));for(let t=0;t{var r;(function(n,i){typeof e==`object`&&t!==void 0?i(e):typeof r==`function`&&r.amd?r([`exports`],i):(n=typeof globalThis<`u`?globalThis:n||self,i(n[`fast-equals`]={}))})(n,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=(0,e.createIsNestedEqual)(f);function f(e,f,p){if(e===f)return!0;if(!e||!f||typeof e!=`object`||typeof f!=`object`)return e!==e&&f!==f;if(i(e)&&i(f))return c(e,f,d,p);var m=Array.isArray(e),h=Array.isArray(f);if(m||h)return m===h&&t(e,f,d,p);var g=s.call(e);return g===s.call(f)?g===`[object Date]`?n(e,f,d,p):g===`[object RegExp]`?l(e,f,d,p):g===`[object Map]`?r(e,f,d,p):g===`[object Set]`?u(e,f,d,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(f)?!1:c(e,f,d,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),f.valueOf()):!1:!1}return f}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x),w=c(r(x,{createIsNestedEqual:function(){return o}})),T=c(S),E=c(r(S,{createIsNestedEqual:function(){return o}}));e.circularDeepEqual=function(e,t){return T(e,t,new WeakMap)},e.circularShallowEqual=function(e,t){return E(e,t,new WeakMap)},e.createCustomCircularEqual=function(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})},e.createCustomEqual=function(e){return c(r(x,e(x)))},e.deepEqual=function(e,t){return C(e,t,void 0)},e.sameValueZeroEqual=o,e.shallowEqual=function(e,t){return w(e,t,void 0)},Object.defineProperty(e,"__esModule",{value:!0})}))})),Kn=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),qn=t(((e,t)=>{var n=Kn();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Jn=t(((e,t)=>{t.exports=qn()()})),$=e(Jn(),1);function Yn(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Yn(e.changedTouches,e=>t===e.identifier)}function yr(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function br(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function xr(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??br();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&wr(e.body,`react-draggable-transparent-selection`)}function Sr(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Cr(e)}):Cr(e)}function Cr(e){if(e)try{e.body&&Tr(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function wr(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Tr(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Er(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Nr(r);let i=Pr(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+Qn(s.paddingLeft)+Qn(o.marginLeft),top:-i.offsetTop+Qn(s.paddingTop)+Qn(o.marginTop),right:pr(a)-dr(i)-i.offsetLeft+Qn(s.paddingRight)-Qn(o.marginRight),bottom:fr(a)-ur(i)-i.offsetTop+Qn(s.paddingBottom)-Qn(o.marginBottom)}}return Zn(r.right)&&(t=Math.min(t,r.right)),Zn(r.bottom)&&(n=Math.min(n,r.bottom)),Zn(r.left)&&(t=Math.max(t,r.left)),Zn(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Dr(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Or(e){return e.props.axis===`both`||e.props.axis===`x`}function kr(e){return e.props.axis===`both`||e.props.axis===`y`}function Ar(e,t,n){let r=typeof t==`number`?vr(e,t):null;if(typeof t==`number`&&!r)return null;let i=Pr(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return mr(r||e,a,n.props.scale)}function jr(e,t,n){let r=!Zn(e.lastX),i=Pr(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Mr(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Nr(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Pr(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Fr=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ir={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Lr=Ir.mouse,Rr=class extends Z.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!sr(e.target,this.props.handle,t)||this.props.cancel&&sr(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=yr(e);this.touchIdentifier=r;let i=Ar(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=jr(this,a,o);Fr(`DraggableCore: handleDragStart: %j`,s),Fr(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&xr(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,cr(n,Lr.move,this.handleDrag),cr(n,Lr.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Ar(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Dr(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=jr(this,n,r);if(Fr(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1)try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}else this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Ar(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Dr(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=jr(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Sr(a.ownerDocument),Fr(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Fr(`DraggableCore: Removing handlers`),lr(a.ownerDocument,Lr.move,this.handleDrag),lr(a.ownerDocument,Lr.stop,this.handleDragStop))},this.onMouseDown=e=>(Lr=Ir.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Lr=Ir.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Lr=Ir.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Lr=Ir.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&cr(e,Ir.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;lr(t,Ir.mouse.move,this.handleDrag),lr(t,Ir.touch.move,this.handleDrag),lr(t,Ir.mouse.stop,this.handleDragStop),lr(t,Ir.touch.stop,this.handleDragStop),lr(e,Ir.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Sr(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=At.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Fr(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return Z.cloneElement(Z.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Rr.displayName=`DraggableCore`,Rr.propTypes={allowAnyClick:$.default.bool,allowMobileScroll:$.default.bool,children:$.default.node.isRequired,disabled:$.default.bool,enableUserSelectHack:$.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:$.default.arrayOf($.default.number),handle:$.default.string,cancel:$.default.string,nodeRef:$.default.object,nonce:$.default.string,onStart:$.default.func,onDrag:$.default.func,onStop:$.default.func,onMouseDown:$.default.func,scale:$.default.number,className:$n,style:$n,transform:$n},Rr.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var zr=class extends Z.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Fr(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Mr(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Fr(`Draggable: onDrag: %j`,t);let n=Mr(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Er(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,Mr(this,t))===!1)return!1;Fr(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Fr(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=At.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:Or(this)&&p?this.state.x:m.x,y:kr(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=gr(h,c):d=hr(h,c);let g=Z.Children.only(n),_=x(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return Z.createElement(Rr,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},Z.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};zr.displayName=`Draggable`,zr.propTypes={...Rr.propTypes,axis:$.default.oneOf([`both`,`x`,`y`,`none`]),bounds:$.default.oneOfType([$.default.shape({left:$.default.number,right:$.default.number,top:$.default.number,bottom:$.default.number}),$.default.string,$.default.oneOf([!1])]),defaultClassName:$.default.string,defaultClassNameDragging:$.default.string,defaultClassNameDragged:$.default.string,defaultPosition:$.default.shape({x:$.default.number,y:$.default.number}),positionOffset:$.default.shape({x:$.default.oneOfType([$.default.number,$.default.string]),y:$.default.oneOfType([$.default.number,$.default.string])}),position:$.default.shape({x:$.default.number,y:$.default.number}),className:$n,style:$n,transform:$n},zr.defaultProps={...Rr.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Br=t(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>J,default:()=>_e}),t.exports=d(f);var p=u(le()),m=u(Jn()),h=u(R()),g=Br();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function ie(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ae(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function oe(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??ae();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&ce(e.body,`react-draggable-transparent-selection`)}function L(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{se(e)}):se(e)}function se(e){if(e)try{e.body&&ue(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function ce(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function ue(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function de(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:me(r);let i=he(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+b(s.paddingLeft)+b(o.marginLeft),top:-i.offsetTop+b(s.paddingTop)+b(o.marginTop),right:N(a)-M(i)-i.offsetLeft+b(s.paddingRight)-b(o.marginRight),bottom:te(a)-j(i)-i.offsetTop+b(s.paddingBottom)-b(o.marginBottom)}}return y(r.right)&&(t=Math.min(t,r.right)),y(r.bottom)&&(n=Math.min(n,r.bottom)),y(r.left)&&(t=Math.max(t,r.left)),y(r.top)&&(n=Math.max(n,r.top)),[t,n]}function fe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function pe(e){return e.props.axis===`both`||e.props.axis===`x`}function z(e){return e.props.axis===`both`||e.props.axis===`y`}function B(e,t,n){let r=typeof t==`number`?re(e,t):null;if(typeof t==`number`&&!r)return null;let i=he(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return P(r||e,a,n.props.scale)}function V(e,t,n){let r=!y(e.lastX),i=he(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function H(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function me(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function he(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var U=u(le()),W=u(Jn()),G=u(R()),K=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},q={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},ge=q.mouse,J=class extends U.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!ee(e.target,this.props.handle,t)||this.props.cancel&&ee(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ie(e);this.touchIdentifier=r;let i=B(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=V(this,a,o);K(`DraggableCore: handleDragStart: %j`,s),K(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&oe(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,k(n,ge.move,this.handleDrag),k(n,ge.stop,this.handleDragStop))},this.handleDrag=e=>{let t=B(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=fe(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=V(this,n,r);if(K(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1)try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}else this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=B(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=fe(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=V(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&L(a.ownerDocument),K(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(K(`DraggableCore: Removing handlers`),A(a.ownerDocument,ge.move,this.handleDrag),A(a.ownerDocument,ge.stop,this.handleDragStop))},this.onMouseDown=e=>(ge=q.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(ge=q.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(ge=q.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(ge=q.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&k(e,q.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;A(t,q.mouse.move,this.handleDrag),A(t,q.touch.move,this.handleDrag),A(t,q.mouse.stop,this.handleDragStop),A(t,q.touch.stop,this.handleDragStop),A(e,q.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&L(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=G.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(K(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return U.cloneElement(U.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};J.displayName=`DraggableCore`,J.propTypes={allowAnyClick:W.default.bool,allowMobileScroll:W.default.bool,children:W.default.node.isRequired,disabled:W.default.bool,enableUserSelectHack:W.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:W.default.arrayOf(W.default.number),handle:W.default.string,cancel:W.default.string,nodeRef:W.default.object,nonce:W.default.string,onStart:W.default.func,onDrag:W.default.func,onStop:W.default.func,onMouseDown:W.default.func,scale:W.default.number,className:x,style:x,transform:x},J.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var _e=class extends p.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(K(`Draggable: onDragStart: %j`,t),this.props.onStart(e,H(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;K(`Draggable: onDrag: %j`,t);let n=H(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=de(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,H(this,t))===!1)return!1;K(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(K(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=h.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,m=!s||this.state.dragging,h=s||r,_={x:pe(this)&&m?this.state.x:h.x,y:z(this)&&m?this.state.y:h.y};this.state.isElementSVG?f=I(_,c):d=F(_,c);let v=p.Children.only(n),y=(0,g.clsx)(v.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return p.createElement(J,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},p.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};_e.displayName=`Draggable`,_e.propTypes={...J.propTypes,axis:m.default.oneOf([`both`,`x`,`y`,`none`]),bounds:m.default.oneOfType([m.default.shape({left:m.default.number,right:m.default.number,top:m.default.number,bottom:m.default.number}),m.default.string,m.default.oneOf([!1])]),defaultClassName:m.default.string,defaultClassNameDragging:m.default.string,defaultClassNameDragged:m.default.string,defaultPosition:m.default.shape({x:m.default.number,y:m.default.number}),positionOffset:m.default.shape({x:m.default.oneOfType([m.default.number,m.default.string]),y:m.default.oneOfType([m.default.number,m.default.string])}),position:m.default.shape({x:m.default.number,y:m.default.number}),className:x,style:x,transform:x},_e.defaultProps={...J.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(t.exports={DraggableCore:J})})),Hr=t(((e,t)=>{var n=Vr(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),Ur=t((e=>{e.__esModule=!0,e.cloneElement=c;var t=n(le());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t{e.__esModule=!0,e.resizableProps=void 0;var t=n(Jn());Hr();function n(e){return e&&e.__esModule?e:{default:e}}e.resizableProps={axis:t.default.oneOf([`both`,`x`,`y`,`none`]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<`u`?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`y`?t.default.number.isRequired(...e):t.default.number(...e)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf([`s`,`w`,`e`,`n`,`sw`,`nw`,`se`,`ne`])),transformScale:t.default.number,width:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`x`?t.default.number.isRequired(...e):t.default.number(...e)}}})),Gr=t((e=>{e.__esModule=!0,e.default=void 0;var t=o(le()),n=Hr(),r=Ur(),i=Wr(),a=[`children`,`className`,`draggableOpts`,`width`,`height`,`handle`,`handleSize`,`lockAspectRatio`,`axis`,`minConstraints`,`maxConstraints`,`onResize`,`onResizeStop`,`onResizeStart`,`resizeHandles`,`transformScale`];function o(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(o=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(i*n)?t=e/n:e=t*n}let o=e,s=t,c=this.slack||[0,0],l=c[0],u=c[1];return e+=l,t+=u,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[l+(o-e),u+(s-t)],[e,t]}resizeHandler(e,t){return(n,r)=>{let i=r.node,a=r.deltaX,o=r.deltaY;e===`onResizeStart`&&this.resetData();let s=(this.props.axis===`both`||this.props.axis===`x`)&&t!==`n`&&t!==`s`,c=(this.props.axis===`both`||this.props.axis===`y`)&&t!==`e`&&t!==`w`;if(!s&&!c)return;let l=t[0],u=t[t.length-1],d=i.getBoundingClientRect();if(this.lastHandleRect!=null){if(u===`w`){let e=d.left-this.lastHandleRect.left;a+=e}if(l===`n`){let e=d.top-this.lastHandleRect.top;o+=e}}this.lastHandleRect=d,u===`w`&&(a=-a),l===`n`&&(o=-o);let f=this.lastSize?.width??this.props.width,p=this.lastSize?.height??this.props.height,m=f+(s?a/this.props.transformScale:0),h=p+(c?o/this.props.transformScale:0);var g=this.runConstraints(m,h);if(m=g[0],h=g[1],e===`onResizeStop`&&this.lastSize){var _=this.lastSize;m=_.width,h=_.height}let v=m!==f||h!==p;e!==`onResizeStop`&&(this.lastSize={width:m,height:h});let y=typeof this.props[e]==`function`?this.props[e]:null;y&&(e!==`onResize`||v)&&(n.persist==null||n.persist(),y(n,{node:i,size:{width:m,height:h},handle:t})),e===`onResizeStop`&&this.resetData()}}renderResizeHandle(e,n){let r=this.props.handle;if(!r)return t.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:n});if(typeof r==`function`)return r(e,n);let i=typeof r.type==`string`,a=u({ref:n},i?{}:{handleAxis:e});return t.cloneElement(r,a)}render(){let e=this.props,i=e.children,o=e.className,l=e.draggableOpts;e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart;let d=e.resizeHandles;e.transformScale;let f=c(e,a);return(0,r.cloneElement)(i,u(u({},f),{},{className:(o?o+` `:``)+`react-resizable`,children:[...t.Children.toArray(i.props.children),...d.map(e=>{let r=this.handleRefs[e]??(this.handleRefs[e]=t.createRef());return t.createElement(n.DraggableCore,s({},l,{nodeRef:r,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,r))})]}))}};e.default=m,m.propTypes=i.resizableProps,m.defaultProps={axis:`both`,handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:[`se`],transformScale:1}})),Kr=t((e=>{e.__esModule=!0,e.default=void 0;var t=s(le()),n=o(Jn()),r=o(Gr()),i=Wr(),a=[`handle`,`handleSize`,`onResize`,`onResizeStart`,`onResizeStop`,`draggableOpts`,`minConstraints`,`maxConstraints`,`lockAspectRatio`,`axis`,`width`,`height`,`resizeHandles`,`style`,`transformScale`];function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=t.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(n,()=>this.props.onResize&&this.props.onResize(e,t))):this.setState(n)}}static getDerivedStateFromProps(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,n=e.handle,i=e.handleSize;e.onResize;let o=e.onResizeStart,s=e.onResizeStop,l=e.draggableOpts,d=e.minConstraints,f=e.maxConstraints,p=e.lockAspectRatio,h=e.axis;e.width,e.height;let g=e.resizeHandles,_=e.style,v=e.transformScale,y=m(e,a);return t.createElement(r.default,{axis:h,draggableOpts:l,handle:n,handleSize:i,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:d,onResizeStart:o,onResize:this.onResize,onResizeStop:s,resizeHandles:g,transformScale:v,width:this.state.width},t.createElement(`div`,c({},y,{style:u(u({},_),{},{width:this.state.width+`px`,height:this.state.height+`px`})})))}};e.default=h,h.propTypes=u(u({},i.resizableProps),{},{children:n.default.element})})),qr=t(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=Gr().default,t.exports.ResizableBox=Kr().default}))(),Jr=Gn(),Yr=50,Xr=12;function Zr(e){let t=e;for(;t;){let e=window.getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function Qr(e){let t=Zr(e),n=null,r=0,i=0,a=!1;function o(){let e=t;if(!e)return;let s=e.getBoundingClientRect(),{clientHeight:c,scrollTop:l,scrollHeight:u}=e,{scrollLeft:d,scrollWidth:f,clientWidth:p}=e,m=0,h=0;i0?m=-Xr:i>s.bottom-Yr&&l+c0?h=-Xr:r>s.right-Yr&&d+p({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:s,rowHeight:o}),[n,a,r,i,s,o]),W=(0,Z.useMemo)(()=>({cols:n,maxRows:s,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,s,r,o,i]),G=(0,Z.useCallback)(e=>({...W,containerHeight:e??W.containerHeight,layout:pe.current}),[W]),K=(0,Z.useMemo)(()=>P??{i:j,x:w,y:T,w:E,h:D,minW:O,maxW:ee,minH:k,maxH:A},[P,j,w,T,E,D,O,ee,k,A]),q=(0,Z.useCallback)(e=>{if(g?.calcStyle)return g.calcStyle(e);if(p)return fn(e);let t=pn(e);return m?{...t,left:mn(e.left/r),width:mn(e.width/r)}:t},[g,p,m,r]),ge=(0,Z.useCallback)((e,{node:t})=>{if(!I)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/h,o=r.left/h,s=i.top/h,c=r.top/h,l;if(g?.calcDragPosition){let t=e;l=g.calcDragPosition(t.clientX,t.clientY,t.clientX-i.left,t.clientY-i.top)}else l={left:a-o+n.scrollLeft,top:s-c+n.scrollTop};if(R.current=l,he.current||=Qr(t instanceof HTMLElement?t:null),_>0){let t=e;H.current={x:t.clientX,y:t.clientY},V.current=!0,me.current=!1,se(!0);return}se(!0);let u=Ht(U,l.top,l.left),{x:d,y:f}=un(N,K,u.x,u.y,G());I(j,d,f,{e,node:t,newPosition:l})},[I,h,U,g,_,N,K,G,j]),J=(0,Z.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!ne||!L)return;let s=e;if(V.current&&!me.current){let n=s.clientX-H.current.x,r=s.clientY-H.current.y;if(Math.hypot(n,r)<_)return;if(me.current=!0,V.current=!1,I){let n=Ht(U,R.current.top,R.current.left),{x:r,y:i}=un(N,K,n.x,n.y,G());I(j,r,i,{e,node:t,newPosition:R.current})}}he.current?.feed(s.clientX,s.clientY);let c=R.current.top+a,l=R.current.left+n;if(u){let{offsetParent:e}=t;if(e){let t=e.clientHeight-zt(D,o,i[1]);c=Wt(c,0,t);let n=Rt(U),a=r-zt(E,n,i[0]);l=Wt(l,0,a)}}let d={top:c,left:l};R.current=d;let f=Ht(U,c,l),{x:p,y:m}=un(N,K,f.x,f.y,G());ne(j,p,m,{e,node:t,newPosition:d})},[ne,I,L,_,u,D,o,i,U,r,E,j,N,K,G]),_e=(0,Z.useCallback)((e,{node:t})=>{if(!re||!L)return;he.current?.stop(),he.current=null;let n=V.current;if(V.current=!1,me.current=!1,H.current={x:0,y:0},n){se(!1),R.current={left:0,top:0};return}let{left:r,top:i}=R.current,a={top:i,left:r};se(!1),R.current={left:0,top:0};let o=Ht(U,i,r),{x:s,y:c}=un(N,K,o.x,o.y,G());re(j,s,c,{e,node:t,newPosition:a})},[re,L,U,N,K,G,j]);z.current=ge,B.current=J;let ve=(0,Z.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?ie:o===`onResize`?ae:oe;if(!s)return;let c;c=t?wn(i,a,n,r):{...n,top:a.top,left:a.left},de.current=c;let l=t?.offsetParent?.clientHeight??0,u=Ut(U,c.width,c.height),{w:d,h:f}=dn(N,K,u.w,u.h,i,G(l));s(j,d,f,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[ie,ae,oe,r,U,j,N,K,G]),ye=(0,Z.useCallback)((e,t)=>{le(!0);let n=Bt(U,w,T,E,D),r={...t,handle:t.handle};ve(e,r,n,`onResizeStart`)},[ve,U,w,T,E,D]),be=(0,Z.useCallback)((e,t)=>{let n=Bt(U,w,T,E,D),r={...t,handle:t.handle};ve(e,r,n,`onResize`)},[ve,U,w,T,E,D]),xe=(0,Z.useCallback)((e,t)=>{le(!1),de.current={top:0,left:0,width:0,height:0};let n=Bt(U,w,T,E,D),r={...t,handle:t.handle};ve(e,r,n,`onResizeStop`)},[ve,U,w,T,E,D]);(0,Z.useEffect)(()=>{if(!v)return;let e=ue.current;if(!e)return;let t=fe.current||{left:0,top:0},n=L&&(v.left!==t.left||v.top!==t.top);if(!L){let t={node:e,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};z.current?.(v.e,t)}else if(n){let t={node:e,deltaX:v.left-R.current.left,deltaY:v.top-R.current.top,lastX:R.current.left,lastY:R.current.top,x:v.left,y:v.top};B.current?.(v.e,t)}fe.current=v},[v,L,j]);let Se=Bt(U,w,T,E,D,L?R.current:null,ce?de.current:null),Ce=Z.Children.only(t),Y=Rt(U),we=[zt(O,Y,i[0]),zt(k,o,i[1])],Te=[zt(ee,Y,i[0]),zt(A,o,i[1])],Ee=Ce.props,De=Ee.className,Oe=Ee.style,ke=Z.cloneElement(Ce,{ref:ue,className:x(`react-grid-item`,De,y,{static:f,resizing:ce,"react-draggable":c,"react-draggable-dragging":L,dropping:!!v,cssTransforms:p}),style:{...b,...Oe,...q(Se)}}),Ae=te;return ke=(0,X.jsx)(qr.Resizable,{draggableOpts:{disabled:!l},className:l?void 0:`react-resizable-hide`,width:Se.width,height:Se.height,minConstraints:we,maxConstraints:Te,onResizeStart:ye,onResize:be,onResizeStop:xe,transformScale:h,resizeHandles:M,handle:Ae,children:ke}),ke=(0,X.jsx)(Rr,{disabled:!c,onStart:ge,onDrag:J,onStop:_e,handle:S,cancel:`.react-resizable-handle`+(C?`,`+C:``),scale:h,allowMobileScroll:d,nodeRef:ue,children:ke}),ke}var ei=Z.memo($r,(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h&&e.minW===t.minW&&e.maxW===t.maxW&&e.minH===t.minH&&e.maxH===t.maxH&&e.cols===t.cols&&e.containerWidth===t.containerWidth&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.margin===t.margin&&e.containerPadding===t.containerPadding&&e.transformScale===t.transformScale&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.isBounded===t.isBounded&&e.allowMobileScroll===t.allowMobileScroll&&e.useCSSTransforms===t.useCSSTransforms&&e.usePercentages===t.usePercentages&&e.children===t.children&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.droppingPosition===t.droppingPosition);ei.displayName=`GridItem`;function ti(e){let{clientX:t,clientY:n,gridElement:r,droppingItem:i,event:a,dragOffsetX:o=0,dragOffsetY:s=0,transformScale:c,cols:l,margin:u,maxRows:d,rowHeight:f,width:p,containerPadding:m}=e,h=r.getBoundingClientRect(),g={cols:l,margin:u,maxRows:d,rowHeight:f,containerWidth:p,containerPadding:m},_=Rt(g),v=zt(i.w,_,u[0]),y=zt(i.h,f,u[1]),b=v/2,x=y/2,S=r.scrollLeft??0,C=r.scrollTop??0,w=t-h.left+S+o-b,T=n-h.top+C+s-x,E=Math.max(0,w),D=Math.max(0,T);return{newDroppingPosition:{left:E/c,top:D/c,e:a},calculatedXY:Vt(g,D,E,i.w,i.h)}}var ni=()=>{},ri=`react-grid-layout`,ii=!1;try{ii=/firefox/i.test(navigator.userAgent)}catch{}function ai(e,t){let n=Z.Children.toArray(e),r=Z.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!Z.isValidElement(t)||t.key===null)return;let n=String(t.key);a.add(n);let r=e.find(e=>e.i===n);if(r)i.push(en(r));else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:Zt(i),w:1,h:1})}});let o=an(i,{cols:n});return r.compact(o,n)}function si(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:o,positionStrategy:s=Tn,compactor:c,constraints:l=ln,layout:u=[],droppingItem:d,autoSize:f=!0,className:p=``,style:m={},innerRef:h,onLayoutChange:g=ni,onDragStart:_=ni,onDrag:v=ni,onDragStop:y=ni,onResizeStart:b=ni,onResize:S=ni,onResizeStop:C=ni,onDrop:w=ni,onDropDragOver:T=ni}=e,E=(0,Z.useMemo)(()=>({...En,...r}),[r]),D=(0,Z.useMemo)(()=>({...Dn,...i}),[i]),O=(0,Z.useMemo)(()=>({...On,...a}),[a]),ee=(0,Z.useMemo)(()=>({...kn,...o}),[o]),{cols:k,rowHeight:A,maxRows:j,margin:M,containerPadding:te}=E,{enabled:N,bounded:P,handle:F,cancel:I,threshold:ne,allowMobileScroll:re}=D,{enabled:ie,handles:ae,handleComponent:oe}=O,{enabled:L,defaultItem:se,onDragOver:ce,touchEnabled:le=!0,touchDragSource:ue=`[data-rgl-draggable]`}=ee,R=c??zn(`vertical`),de=R.type,fe=R.allowOverlap,pe=R.preventCollision??!1,z=(0,Z.useMemo)(()=>d??{i:`__dropping-elem__`,...se},[d,se]),B=s.type===`transform`,V=s.scale,H=te??M,[me,he]=(0,Z.useState)(!1),[U,W]=(0,Z.useState)(()=>oi(u,t,k,R)),[G,K]=(0,Z.useState)(null),[q,ge]=(0,Z.useState)(!1),[J,_e]=(0,Z.useState)(null),[ve,ye]=(0,Z.useState)(),be=(0,Z.useRef)(void 0);be.current=ve;let xe=(0,Z.useRef)(null),Se=(0,Z.useRef)(null),Ce=(0,Z.useRef)(null),Y=(0,Z.useRef)(0),we=(0,Z.useRef)(U),Te=(0,Z.useRef)(u),Ee=(0,Z.useRef)(t),De=(0,Z.useRef)(de),Oe=(0,Z.useRef)(null),ke=(0,Z.useRef)(!1),Ae=(0,Z.useRef)(null),je=(0,Z.useRef)(null);je.current=J;let Me=(0,Z.useRef)(w);(0,Z.useLayoutEffect)(()=>{Me.current=w});let Ne=(0,Z.useRef)(U);Ne.current=U,(0,Z.useEffect)(()=>{he(!0),(0,Jr.deepEqual)(U,u)||g(U)},[]),(0,Z.useEffect)(()=>{if(G||J)return;let e=!(0,Jr.deepEqual)(u,Te.current),n=!ai(t,Ee.current),r=de!==De.current;if(e||n||r){let n=oi(e?u:U,t,k,R);(0,Jr.deepEqual)(n,U)||W(n)}Te.current=u,Ee.current=t,De.current=de},[u,t,k,de,R,G,J,U]),(0,Z.useEffect)(()=>{if(!G&&!J&&!(0,Jr.deepEqual)(U,we.current)){we.current=U;let e=U.filter(e=>e.i!==z.i);g(e)}},[U,G,J,g,z.i]);let Pe=(0,Z.useMemo)(()=>{if(!f)return;let e=Zt(U),t=H[1];return e*A+(e-1)*M[1]+t*2+`px`},[f,U,A,M,H]),Fe=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Qt(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};xe.current=en(a),Ce.current=i,K(o),_(i,a,a,null,r.e,r.node)},[_]),Ie=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=xe.current,o=Qt(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=on(i,o,t,n,!0,pe,de,k,fe);v(c,a,o,s,r.e,r.node),W(R.compact(c,k)),K(s)},[pe,de,k,fe,R,v]),Le=(0,Z.useCallback)((e,t,n,r)=>{if(!xe.current)return;let i=Ne.current,a=xe.current,o=Qt(i,e);if(!o)return;let s=on(i,o,t,n,!0,pe,de,k,fe),c=R.compact(s,k);y(c,a,o,null,r.e,r.node);let l=Ce.current;xe.current=null,Ce.current=null,K(null),W(c),l&&!(0,Jr.deepEqual)(l,c)&&g(c)},[pe,de,k,fe,R,y,g]),Re=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Qt(i,e);a&&(Se.current=en(a),Ce.current=i,ge(!0),b(i,a,a,null,r.e,r.node))},[b]),ze=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Se.current,{handle:o}=r,s=!1,c,l,[u,d]=rn(i,e,e=>(c=e.x,l=e.y,[`sw`,`w`,`nw`,`n`,`ne`].includes(o)&&([`sw`,`nw`,`w`].includes(o)&&(c=e.x+(e.w-t),t=e.x!==c&&c<0?e.w:t,c=c<0?0:c),[`ne`,`n`,`nw`].includes(o)&&(l=e.y+(e.h-n),n=e.y!==l&&l<0?e.h:n,l=l<0?0:l),s=!0),pe&&!fe&&qt(i,{...e,w:t,h:n,x:c??e.x,y:l??e.y}).filter(t=>t.i!==e.i).length>0&&(l=e.y,n=e.h,c=e.x,t=e.w,s=!1),e.w=t,e.h=n,(o===`n`||o===`nw`||o===`ne`)&&(e.y=l??e.y),e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=on(u,d,c,l,!0,pe,de,k,fe));let p={w:d.w,h:d.h,x:d.x,y:d.y,i:e,static:!0};S(f,a,d,p,r.e,r.node);let m=R.compact(f,k);if(o===`n`||o===`nw`||o===`ne`){let t=m.find(t=>t.i===e);t&&(t.y=d.y)}W(m),K(p)},[pe,de,k,fe,R,S]),Be=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Se.current,o=Qt(i,e),s=R.compact(i,k);C(s,a,o??null,null,r.e,r.node);let c=Ce.current;Se.current=null,Ce.current=null,K(null),ge(!1),W(s),c&&!(0,Jr.deepEqual)(c,s)&&g(s)},[k,R,C,g]),Ve=(0,Z.useCallback)((e,t,n,r)=>{if(r)be.current&&(be.current.left!==t.left||be.current.top!==t.top)&&(ye(t),W(t=>t.map(t=>t.i===e.i&&(t.x!==n.x||t.y!==n.y)?{...t,x:n.x,y:n.y}:t)));else{_e((0,X.jsx)(`div`,{},e.i)),ye(t);let r=Ne.current.filter(t=>t.i!==e.i);W([...r,{...e,x:n.x,y:n.y,static:!1,isDraggable:!0}])}},[]),He=(0,Z.useCallback)((e,t,r)=>{let i=Oe.current;if(!i)return;let{newDroppingPosition:a,calculatedXY:o}=ti({clientX:e,clientY:t,gridElement:i,droppingItem:z,event:r,transformScale:V,cols:k,margin:M,maxRows:j,rowHeight:A,width:n,containerPadding:H});Ve(z,a,o,!!je.current)},[z,V,k,M,j,A,n,H,Ve]),Ue=(0,Z.useCallback)(()=>{let e=Ne.current;if(!e.some(e=>e.i===z.i)){_e(null),K(null),ye(void 0);return}let t=R.compact(e.filter(e=>e.i!==z.i),k);W(t),_e(null),K(null),ye(void 0)},[z.i,k,R]),We=(0,Z.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),ii&&!e.nativeEvent.target?.classList.contains(ri))return!1;let t=ce?ce(e.nativeEvent):T(e);if(t===!1)return J&&Ue(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...z,...a},{newDroppingPosition:s,calculatedXY:c}=ti({clientX:e.clientX,clientY:e.clientY,gridElement:e.currentTarget,droppingItem:o,event:e.nativeEvent,dragOffsetX:r,dragOffsetY:i,transformScale:V,cols:k,margin:M,maxRows:j,rowHeight:A,width:n,containerPadding:H});Ve(o,s,c,!!J)},[J,z,ce,T,Ue,Ve,V,k,M,j,A,n,H]),Ge=(0,Z.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Y.current--,Y.current<0&&(Y.current=0),Y.current===0&&Ue()},[Ue]),Ke=(0,Z.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Y.current++},[]),qe=(0,Z.useCallback)(e=>{let t=Ne.current,n=t.find(e=>e.i===z.i);Ue(),Me.current(t,n,e)},[z.i,Ue]),Je=(0,Z.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Y.current=0,qe(e.nativeEvent)},[qe]);(0,Z.useEffect)(()=>{if(!L||!le)return;let e=Oe.current;if(!e)return;let t=(t,n)=>{let r=document.elementFromPoint(t,n);return r?e.contains(r):!1},n=e=>e instanceof HTMLElement&&e.closest(ue)!==null,r=e=>{let t=e.changedTouches;if(!t||t.length===0)return;let n=Ae.current;if(n===null)return t[0];for(let e=0;e{if(!n(e.target)||Ae.current!==null)return;e.preventDefault();let t=e.changedTouches?.[0];t&&(Ae.current=t.identifier,ke.current=!0)},a=e=>{if(!ke.current)return;e.preventDefault();let n=r(e);n&&(t(n.clientX,n.clientY)?He(n.clientX,n.clientY,e):je.current&&Ue())},o=e=>{if(!ke.current)return;e.preventDefault();let n=r(e);ke.current=!1,Ae.current=null,n&&(t(n.clientX,n.clientY)?qe(e):Ue())},s=()=>{ke.current&&(ke.current=!1,Ae.current=null,Ue())},c={passive:!1};return document.addEventListener(`touchstart`,i,c),document.addEventListener(`touchmove`,a,c),document.addEventListener(`touchend`,o,c),document.addEventListener(`touchcancel`,s,c),()=>{document.removeEventListener(`touchstart`,i,c),document.removeEventListener(`touchmove`,a,c),document.removeEventListener(`touchend`,o,c),document.removeEventListener(`touchcancel`,s,c)}},[L,le,ue,He,Ue,qe,z.i]);let Ye=(0,Z.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=Qt(U,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&N,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&ie,o=r.resizeHandles||[...ae],c=i&&P&&r.isBounded!==!1,u=oe;return(0,X.jsx)(ei,{containerWidth:n,cols:k,margin:M,containerPadding:H,maxRows:j,rowHeight:A,cancel:I,handle:F,onDragStart:Fe,onDrag:Ie,onDragStop:Le,onResizeStart:Re,onResize:ze,onResizeStop:Be,isDraggable:i,isResizable:a,isBounded:c,allowMobileScroll:re,useCSSTransforms:B&&me,usePercentages:!me,transformScale:V,positionStrategy:s,dragThreshold:ne,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?ve:void 0,resizeHandles:o,resizeHandle:u,constraints:l,layoutItem:r,layout:U,children:e},r.i)},[U,n,k,M,H,j,A,I,F,Fe,Ie,Le,Re,ze,Be,N,ie,P,B,me,V,s,ne,ve,ae,oe,l]),Xe=()=>G?(0,X.jsx)(ei,{w:G.w,h:G.h,x:G.x,y:G.y,i:G.i,className:`react-grid-placeholder ${q?`placeholder-resizing`:``}`,containerWidth:n,cols:k,margin:M,containerPadding:H,maxRows:j,rowHeight:A,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:B,transformScale:V,constraints:l,layout:U,children:(0,X.jsx)(`div`,{})}):null,Ze=(0,Z.useCallback)(e=>{Oe.current=e,typeof h==`function`?h(e):h&&`current`in h&&(h.current=e)},[h]),Qe=x(ri,p),$e={height:Pe,...m};return(0,X.jsxs)(`div`,{ref:Ze,className:Qe,style:$e,onDrop:L?Je:void 0,onDragLeave:L?Ge:void 0,onDragEnter:L?Ke:void 0,onDragOver:L?We:void 0,children:[Z.Children.map(t,e=>Z.isValidElement(e)?Ye(e):null),L&&J&&Ye(J,!0),Xe()]})}var ci={lg:1200,md:996,sm:768,xs:480,xxs:0},li={lg:12,md:10,sm:6,xs:4,xxs:2},ui=()=>{};function di(e,t,n,r,i=!1){let a=[];Z.Children.forEach(t,t=>{if(!Z.isValidElement(t)||t.key===null)return;let n=String(t.key),r=t.props[`data-grid`],o=e.find(e=>e.i===n);o?i&&r?a.push({...o,i:n,w:r.w??o.w,h:r.h??o.h,minW:r.minW??o.minW,maxW:r.maxW??o.maxW,minH:r.minH??o.minH,maxH:r.maxH??o.maxH}):a.push({...o,i:n}):r?a.push({i:n,x:r.x??0,y:r.y??0,w:r.w??1,h:r.h??1,minW:r.minW,maxW:r.maxW,minH:r.minH,maxH:r.maxH,static:r.static,isDraggable:r.isDraggable,isResizable:r.isResizable,resizeHandles:r.resizeHandles,isBounded:r.isBounded}):a.push({i:n,x:0,y:Zt(a),w:1,h:1})});let o=an(a,{cols:n});return r.compact(o,n)}function fi(e){let{children:t,width:n,breakpoint:r,breakpoints:i=ci,cols:a=li,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=ui,onLayoutChange:p=ui,onWidthChange:m=ui,...h}=e,g=d??zn(`vertical`),_=g.type,v=g.allowOverlap,y=(0,Z.useMemo)(()=>r??Vn(i,n),[]),b=(0,Z.useMemo)(()=>Hn(y,a),[y,a]),x=(0,Z.useMemo)(()=>Un(o,i,y,y,b,_),[]),[S,C]=(0,Z.useState)(y),[w,T]=(0,Z.useState)(b),[E,D]=(0,Z.useState)(x),[O,ee]=(0,Z.useState)(o),k=(0,Z.useRef)(n),A=(0,Z.useRef)(r),j=(0,Z.useRef)(i),M=(0,Z.useRef)(a),te=(0,Z.useRef)(o),N=(0,Z.useRef)(_),P=(0,Z.useRef)(O);(0,Z.useEffect)(()=>{P.current=O},[O]);let F=(0,Z.useMemo)(()=>(0,Jr.deepEqual)(o,te.current)?null:Un(o,i,S,S,w,g),[o,i,S,w,g]),I=F??E;(0,Z.useEffect)(()=>{F!==null&&(D(F),ee(o),P.current=o,te.current=o)},[F,o]),(0,Z.useEffect)(()=>{if(_!==N.current){let e=g.compact(tn(I),w),t={...P.current,[S]:e};D(e),ee(t),P.current=t,p(e,t),N.current=_}},[_,g,I,w,v,S,p]),(0,Z.useEffect)(()=>{let e=n!==k.current,o=r!==A.current,s=!(0,Jr.deepEqual)(i,j.current),c=!(0,Jr.deepEqual)(a,M.current);if(e||o||s||c){let e=r??Vn(i,n),o=Hn(e,a),d=S;if(d!==e||s||c){let n={...P.current};n[d]||(n[d]=tn(E));let r=Un(n,i,e,d,o,g),a=!n[e];r=di(r,t,o,g,a),n[e]=r,C(e),T(o),D(r),ee(n),P.current=n,f(e,o),p(r,n)}let h=Wn(l,e),_=u?Wn(u,e):null;m(n,h,o,_),k.current=n,A.current=r,j.current=i,M.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let ne=(0,Z.useCallback)(e=>{let t={...P.current,[S]:e};D(e),ee(t),P.current=t,p(e,t)},[S,p]),re=(0,Z.useMemo)(()=>Wn(l,S),[l,S]),ie=(0,Z.useMemo)(()=>u===null?null:Wn(u,S),[u,S]),ae=(0,Z.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:re,containerPadding:ie}),[w,s,c,re,ie]);return(0,X.jsx)(si,{...h,width:n,gridConfig:ae,compactor:g,onLayoutChange:ne,layout:I,children:t})}var pi=Z.forwardRef(function(e,t){let{innerRef:n,...r}=e,i=n??t;return(0,X.jsx)(fi,{...r,innerRef:i})});pi.displayName=`ResponsiveGridLayout`;function mi(e,t,n){if(e.kind===`constant`)return e.value??``;let r=e.kind===`custom`?e.options?.map(e=>({value:e}))??[]:n===null?[]:n,i=t[e.name],a=!e.multi&&Array.isArray(i)&&i.length===0?void 0:i;if(a===`$__all`){if(e.include_all)return jt}else if(a!==void 0){if(e.kind===`text`||r===void 0)return a;let t=new Set(r.map(e=>e.value));if(Array.isArray(a)){if(a.length===0&&e.multi)return[];let n=a.filter(e=>t.has(e));if(n.length>0)return n}else if(t.has(a))return a}return e.default?e.default:e.include_all?jt:r?.[0]?.value??``}var hi=(e,t)=>e.replace(/\$([a-z][a-z0-9_]*)/g,(e,n)=>{let r=t[n];return r===void 0?e:r===`$__all`?`all`:Array.isArray(r)?r.join(`, `):r});function gi(e,t,n){let r={};for(let i of e??[]){let e=mi(i,t,n?.[i.name]);(i.kind!==`query`||e!==``)&&(r[i.name]=e)}return r}function _i(e){return`Explain the panel “${e.title}”`}function vi(e){return`Fix the panel “${e.title}”`}function yi(e){return[{description:`Observed panel diagnostics`,value:JSON.stringify(e)}]}var bi=(0,Z.lazy)(()=>I(()=>import(`./panel-editor-CCqCD_kx.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),xi=e=>e.panels.map(e=>({i:e.id,x:e.grid?.x??0,y:e.grid?.y??0,w:e.grid?.w??6,h:e.grid?.h??Ft(e)})),Si=0;function Ci(e){let t;do t=`p_${Date.now().toString(36)}_${(++Si).toString(36)}_${Math.random().toString(36).slice(2,10)}`;while(e.some(e=>e.id===t));return t}function wi({dashboardId:e,version:t,spec:n,vars:r,results:i,fetching:a,annotations:o,fetchingIds:s=[],staleAt:l=new Map,time:u=n.time,onEditExit:d,editing:f,view:h,agentAvailable:g,canManage:_=!1,onOpenChat:v,onVariable:y,onRetry:b,onPoint:x,onZoom:S,onZoomReset:C,onWiden:w,zoomed:T,onView:E,onVisible:ee,onRangePending:k,shortcutScope:A,onShortcuts:j,overlayOpen:M,returnViewFocus:te}){let N=U(),[P,F]=(0,Z.useState)(),[I,ne]=(0,Z.useState)(()=>xi(n));(0,Z.useEffect)(()=>{ne(xi(n))},[n]);let re=It(),[oe,L]=(0,Z.useState)(),se=(0,Z.useRef)(null),ce=(0,Z.useRef)(new Map),le=(0,Z.useRef)(null),ue=(0,Z.useRef)(null),R=()=>{let e=P?.panel?.id;F(void 0),requestAnimationFrame(()=>(ue.current?.isConnected?ue.current:ce.current.get(e??``))?.focus())},fe=(0,Z.useRef)(h);h&&(fe.current=h);let[pe,z]=(0,Z.useState)(0),V=pe>0,me=f&&(pe>=1100?`lg`:pe>=800?`md`:`sm`)==`lg`;(0,Z.useLayoutEffect)(()=>{if(!se.current)return;z(Math.max(0,Math.round(se.current.getBoundingClientRect().width)));let e=new ResizeObserver(([e])=>{e&&z(Math.max(0,Math.round(e.contentRect.width)))});return e.observe(se.current),()=>e.disconnect()},[]);let he=(0,Z.useRef)(ee);he.current=ee,(0,Z.useEffect)(()=>{if(!V||!se.current||typeof IntersectionObserver>`u`)return;let e=new Set(n.panels.map(e=>e.id)),t=new IntersectionObserver(t=>{for(let n of t){let t=n.target.dataset.panel;t&&(n.isIntersecting?e.add(t):e.delete(t))}h&&n.panels.some(e=>e.id===h)&&e.add(h),he.current([...e])},{rootMargin:`200px`});return se.current.querySelectorAll(`.react-grid-item[data-panel]`).forEach(e=>t.observe(e)),()=>t.disconnect()},[n,h,V]);let W=(0,Z.useMemo)(()=>n.panels.some(e=>{let t=I.find(t=>t.i===e.id);return t&&(t.x!==e.grid?.x||t.y!==e.grid?.y||t.w!==e.grid?.w||t.h!==e.grid?.h)}),[I,n]),G=e=>({...n,panels:e.map(e=>{let t=I.find(t=>t.i===e.id);return t?{...e,grid:{x:t.x,y:t.y,w:t.w,h:t.h}}:e})}),K=t=>{N.setQueryData(D(e),t)},q=Le({mutationFn:()=>ie(e,G(n.panels),t,`Edited layout`),onSuccess:K}),ge=Le({mutationFn:r=>W?ie(e,G(n.panels.filter(e=>e.id!==r)),t,`Removed a panel and saved layout`):de(e,[{op:`remove_panel`,id:r}],t,`Removed a panel`),onSuccess:K}),J=Le({mutationFn:r=>{let i={...r,id:Ci(n.panels),title:`${Array.from(r.title).slice(0,73).join(``)} (copy)`,grid:void 0};if(W){let a=[...n.panels];return a.splice(a.findIndex(e=>e.id===r.id)+1,0,i),ie(e,G(a),t,`Duplicated a panel and saved layout`)}return de(e,[{op:`add_panel`,after:r.id,panel:i}],t,`Duplicated a panel`)},onSuccess:K}),_e=()=>{q.reset(),ge.reset(),J.reset()};(0,Z.useEffect)(()=>{f||_e()},[f]);let ve=()=>{_e(),d?.(),N.invalidateQueries({queryKey:D(e)})},ye=async e=>{let t=new URL(window.location.href);t.searchParams.set(`view`,e),t.searchParams.delete(`edit`);try{await navigator.clipboard.writeText(t.toString()),L(`Link copied`)}catch{L(`Copy this URL: ${t.toString()}`)}},be=`dashboard-${e}`,xe=n=>({dashboard_id:e,version:t,panel_id:n.id,title:hi(n.title,r),from_ms:i.get(n.id)?.from_ms,to_ms:i.get(n.id)?.to_ms,vars:r,error:i.get(n.id)?.error,status:i.get(n.id)?.status,diagnosis:i.get(n.id)?.diagnosis,stale_since:l.get(n.id),truncated:i.has(n.id)?!!(i.get(n.id)?.frame?.truncated||i.get(n.id)?.previous?.truncated):void 0,note:i.get(n.id)?.frame?.note,spec:{...n,dashboard_time:u}}),Se=(c,d,f=!1)=>(0,X.jsx)(ze,{panel:c,title:hi(c.title,r),result:i.get(c.id),loading:a&&s.includes(c.id),height:d,group:be,editing:me&&!f,agentAvailable:g,suspended:!f&&c.id===h,menuRef:f?le:e=>{e?ce.current.set(c.id,e):ce.current.delete(c.id)},compare:u.compare===`previous_period`,range:c.time?.range??u.range,annotations:o,vars:r,onVariable:y,...Ue(c,i.get(c.id),y,x?e=>x(c,e):void 0),onRangePending:e=>k?.(c.id,e),onZoom:S,zoomed:T,onZoomReset:C,onWiden:w,onRetry:b?()=>b(c.id):void 0,onView:()=>E(c.id),onCopyLink:()=>{ye(c.id)},onEdit:_&&e&&(c.query||typeof c.sql==`string`)?()=>{ue.current=f?le.current:ce.current.get(c.id)??null,F({panel:c,spec:n,version:t})}:void 0,onExplain:g&&e?()=>v(_i(xe(c)),{answer_only:!0,context:yi(xe(c))}):void 0,onFix:g&&e&&_?()=>v(vi(xe(c)),{context:yi(xe(c))}):void 0,staleAt:l.get(c.id),onDuplicate:me&&!f?()=>J.mutate(c):void 0,onRemove:me&&!f?()=>ge.mutate(c.id):void 0}),Ce=n.panels.find(e=>e.id===h),we=f?q.error??ge.error??J.error:null,Te=we instanceof m&&we.code===`dashboard_version_conflict`,Ee=e=>{me&&ne(e.map(({i:e,x:t,y:n,w:r,h:i})=>({i:e,x:t,y:n,w:r,h:i})))};return(0,X.jsxs)(`div`,{ref:se,style:{minWidth:0},children:[f&&(0,X.jsxs)(ae,{justify:`space-between`,mb:`sm`,p:`xs`,style:{border:`1px dashed var(--mantine-color-default-border)`,borderRadius:8},children:[(0,X.jsx)(H,{size:`sm`,c:`dimmed`,children:me?`Drag a panel by its title and resize it from the corner. Changes are saved as a new version.`:`The layout can be edited only on a wider screen.`}),(0,X.jsxs)(ae,{gap:`xs`,children:[_&&e&&(0,X.jsx)(B,{size:`compact-sm`,variant:`default`,onClick:e=>{ue.current=e.currentTarget,F({spec:n,version:t})},children:`Add panel`}),(0,X.jsx)(B,{size:`compact-sm`,disabled:!W||!me,loading:q.isPending,onClick:()=>q.mutate(),children:`Save layout`})]})]}),Te&&(0,X.jsx)(Y,{mb:`sm`,children:(0,X.jsxs)(c,{tone:`warning`,children:[`Someone saved this dashboard since you opened it. Load the latest version, then redo your change. `,(0,X.jsx)(B,{size:`compact-sm`,onClick:ve,children:`Load latest`})]})}),we&&!Te&&(0,X.jsx)(Y,{mb:`sm`,children:(0,X.jsx)(c,{tone:`danger`,children:we.message})}),oe&&(0,X.jsx)(Y,{mb:`sm`,children:(0,X.jsx)(c,{tone:`info`,children:oe})}),!V&&(0,X.jsx)(`div`,{"data-grid-placeholder":!0,style:{height:Mt(Math.max(1,...I.map(e=>e.y+e.h)))}}),V&&(0,X.jsx)(pi,{width:pe,className:`dashboard-grid${me?` dashboard-grid-editing`:``}`,layouts:{lg:I,md:I,sm:I.map(e=>({...e,x:0,w:12}))},breakpoints:{lg:1100,md:800,sm:0},cols:{lg:12,md:12,sm:12},rowHeight:40,margin:[12,12],containerPadding:[0,0],compactor:Nn,dragConfig:{enabled:me,handle:`.panel-drag`,cancel:`button`},resizeConfig:{enabled:me},onDragStop:Ee,onResizeStop:Ee,children:n.panels.map(e=>{let t=I.find(t=>t.i===e.id);return(0,X.jsx)(`div`,{"data-panel":e.id,children:Se(e,Mt(t?.h??6))},e.id)})}),(0,X.jsx)(Ke,{shortcutScope:A,onShortcuts:j,escapeEnabled:!M&&!P,opened:!!h,onClose:()=>E(void 0),title:Ce?hi(Ce.title,r):`Missing panel`,returnFocusTo:()=>te?.(fe.current)??ce.current.get(fe.current??``)??ce.current.values().next().value,children:Ce?(0,X.jsx)(`div`,{style:{height:`calc(100vh - 120px)`},children:Se(Ce,Math.max(40,re-140),!0)}):(0,X.jsx)(Y,{children:(0,X.jsx)(c,{tone:`warning`,children:`This panel is missing from the dashboard. The shared link may be out of date.`})})}),P&&e&&(0,X.jsx)(Z.Suspense,{fallback:(0,X.jsx)(O,{opened:!0,onClose:R,title:`Loading the panel editor`,children:(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading the panel editor`,rows:3})}),children:(0,X.jsx)(bi,{dashboardId:e,version:P.version,spec:G(P.spec.panels),layoutChanged:me&&W,panel:P.panel,time:u,vars:r,onClose:R})})]})}function Ti({spec:e,onClose:t,onCreated:n}){let r=U(),[i,a]=(0,Z.useState)(`${e.name} copy`),[o,s]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(),f=async()=>{s(!0),u(void 0);try{let t=await ee({...e,name:i.trim()});r.invalidateQueries({queryKey:v}),n(t.id)}catch(e){u(e instanceof Error?e.message:`Duplicate failed`)}finally{s(!1)}};return(0,X.jsx)(O,{opened:!0,onClose:()=>{o||t()},title:`Duplicate dashboard`,children:(0,X.jsxs)(K,{gap:`md`,children:[(0,X.jsx)(d,{label:`New dashboard name`,value:i,onChange:e=>a(e.currentTarget.value),"data-autofocus":!0}),l&&(0,X.jsx)(Y,{children:(0,X.jsx)(c,{tone:`danger`,children:l})}),(0,X.jsxs)(ae,{justify:`flex-end`,gap:`xs`,children:[(0,X.jsx)(B,{variant:`default`,disabled:o,onClick:t,children:`Cancel`}),(0,X.jsx)(B,{loading:o,disabled:!i.trim()||i.trim()===e.name,onClick:()=>void f(),children:`Duplicate`})]})]})})}var Ei=(e,t)=>!(t instanceof m&&t.status<500)&&e<2,Di=(e,t)=>!(t instanceof m&&t.code===`timeout`)&&Ei(e,t),Oi=e=>({panels:e.panels.map(({grid:e,...t})=>t),variables:e.variables,time:e.time,annotations:e.annotations});function ki(e,t,n,r,i){return[`panels`,JSON.stringify([e,Oi(t),n,r,i])]}function Ai(e,t,n,r){return[`variables`,e,Oi(t),n,r]}var ji=2;async function Mi(e,t,n,r=[],i=!1){let a=r.filter(t=>e.panels?.includes(t)),o=e.panels?.filter(e=>!a.includes(e)),s=a.length&&!o?.length?[]:await _e(a.length?{...e,panels:o}:e,t,n,i);for(let r=0;re.reason===`busy`))break}let c=new Set(e.dashboard.panels.filter(e=>[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz)).map(e=>e.id)),l=s.filter(e=>c.has(e.id)&&e.from_ms!==void 0&&e.to_ms!==void 0&&e.from_mse.from_ms)),d=Math.max(...l.map(e=>e.to_ms));try{let e=await F({from:new Date(u).toISOString(),to:new Date(d).toISOString()},t);return{results:s,annotations:e}}catch(e){if(t?.aborted)throw e;return{results:s,annotation_error:e instanceof Error?e.message:`Annotations unavailable`}}}var Ni={off:!1,"10s":1e4,"30s":3e4,"1m":6e4,"5m":3e5},Pi=0;function Fi(e,t){let[n,r]=e.queryKey;if(n!==`panels`||typeof r!=`string`)return!1;try{return JSON.parse(r)[0]===t}catch{return!1}}function Ii({dashboardId:e,spec:t,time:n,vars:r,compare:i,widths:a,visible:o,refresh:s,enabled:c=!0}){let l=(0,Z.useMemo)(()=>Object.fromEntries(Object.entries(a).map(([e,t])=>[e,Math.max(100,Math.round(t/100)*100)])),[a]),u=ki(e,t,n,r,i),d=u[1],f=o.filter(e=>t.panels.some(t=>t.id===e)),p=(0,Z.useRef)([]),h=(0,Z.useRef)(new Set),g=(0,Z.useRef)(void 0),_=(0,Z.useRef)(null),v=(0,Z.useRef)(!1),y=(0,Z.useRef)(!1),b=(0,Z.useRef)(null),x=(0,Z.useRef)({key:d,ids:new Set}),[S,C]=(0,Z.useState)({key:d}),[w,T]=(0,Z.useState)({key:d,results:new Map,updated:new Map,stale:new Set,receivedAt:0}),E=f.length===0&&w.key===d&&w.receivedAt>0,D=c&&t.panels.some(e=>e.viz!==`text`),O=P({queryKey:u,queryFn:({signal:e})=>{if(E&&_.current?.key!==d)return p.current=[],Promise.resolve({results:[],hasTimePanels:!1,batch:++Pi});let a=_.current?.key===d?_.current.ids:f;p.current=(a.length?[...a]:t.panels.map(e=>e.id)).sort(),x.current.key!==d&&(x.current={key:d,ids:new Set});for(let e of p.current)x.current.ids.add(e);let o=[...p.current],s=y.current;y.current=!1;let c=h.current=new Set,u=t=>{if(e.aborted)return;c.add(t.id);let n=Date.now(),r=++Pi;T(e=>Li(e,d,[qe(t,o)],n,r))},v=w.key===d?o.filter(e=>w.results.get(e)?.reason===`busy`):[];return Mi({dashboard:t,panels:o,time:n,vars:r,widths:l,compare:i},e,u,v,s).then(e=>{let n=new Set(e.results.map(e=>e.id)),r=o.filter(e=>!n.has(e)&&!v.includes(e)&&t.panels.find(t=>t.id===e)?.viz!==`text`).map(e=>({id:e,status:`error`,elapsed_ms:0,error:`No result was returned for this panel; refresh to retry.`,request_error:o}));return{...e,batch:++Pi,results:[...e.results.map(e=>qe(e,o)),...r],hasTimePanels:t.panels.some(e=>o.includes(e.id)&&[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz))}}).catch(n=>{throw e.aborted||(g.current={key:d,ids:o.filter(e=>!c.has(e)&&t.panels.find(t=>t.id===e)?.viz!==`text`),error:n instanceof Error?n.message:String(n),retryable:!(n instanceof m)||n.status===408||n.status===429||n.status>=500}),n})},retry:Di,enabled:D,refetchInterval:E?!1:Ni[s]??3e4,staleTime:5e3,placeholderData:e=>e}),ee=O.error&&g.current?.key===d?g.current:void 0,k=(0,Z.useMemo)(()=>Li(w,d,O.isPlaceholderData?void 0:O.data?.results,O.dataUpdatedAt,O.data?.batch,ee),[w,d,O.data,O.dataUpdatedAt,O.isPlaceholderData,O.error,O.errorUpdatedAt]),A=k.results,j=O.isPlaceholderData?void 0:O.data?.hasTimePanels?O.data:S.key===d?S:void 0;(0,Z.useEffect)(()=>{!O.isPlaceholderData&&O.data?.hasTimePanels&&C({key:d,annotations:O.data.annotations,annotation_error:O.data.annotation_error})},[d,O.data,O.isPlaceholderData]),(0,Z.useEffect)(()=>{O.isPlaceholderData||T(e=>Li(e,d,O.data?.results,O.dataUpdatedAt,O.data?.batch,ee))},[d,O.data,O.dataUpdatedAt,O.isPlaceholderData,O.error,O.errorUpdatedAt]);let M=new Map([...k.stale].flatMap(e=>{let t=k.updated.get(e);return t?[[e,t]]:[]})),te=(O.data?.results??[]).find(e=>e.status===`error`&&e.reason!==`busy`&&k.stale.has(e.id)),N=(O.data?.results??[]).flatMap(e=>e.reason===`busy`&&k.stale.has(e.id)?[k.updated.get(e.id)??0]:[]),F=Math.max(0,...[...k.updated].filter(([e])=>{let t=k.results.get(e);return t?.reason!==`busy`||t.frame!==void 0}).map(([,e])=>e));(0,Z.useEffect)(()=>{if(x.current.key===d)for(let e of x.current.ids)A.get(e)?.reason===`busy`&&!f.includes(e)&&x.current.ids.delete(e)},[o,d,A]),(0,Z.useEffect)(()=>{if(!D||O.isFetching||v.current||b.current?.key===d||_.current?.key===d)return;let e=x.current.key===d?x.current.ids:new Set,n=[...new Set(f.filter(n=>(!A.has(n)||A.get(n)?.reason===`busy`)&&!e.has(n)&&t.panels.find(e=>e.id===n)?.viz!==`text`))].sort();if(!n.length)return;let r={key:d,ids:n};_.current=r,O.refetch({cancelRefetch:!1}).finally(()=>{_.current===r&&(_.current=null)})},[o,D,d,O.isFetching,O.error,O.refetch,A,t.panels]),(0,Z.useEffect)(()=>{!O.isFetching&&b.current?.key!==d&&v.current&&(v.current=!1,_.current=null,D&&!E&&(y.current=!0,O.refetch({cancelRefetch:!1})))},[O.isFetching,d,D,E,O.refetch]);let I=e=>{let t={key:d,ids:e};_.current=t,O.refetch({cancelRefetch:!1}).finally(()=>{_.current===t&&(_.current=null)})};return(0,Z.useEffect)(()=>{if(O.isFetching||!b.current)return;let e=b.current;if(b.current=null,e.key!==d||!D)return;let n=[...e.ids].filter(e=>t.panels.some(t=>t.id===e&&t.viz!==`text`)&&A.get(e)?.request_error).sort();n.length&&I(n)},[O.isFetching,d,D,A,t.panels]),{retry:e=>{D&&t.panels.some(t=>t.id===e&&t.viz!==`text`)&&A.get(e)?.request_error&&(O.isFetching?(b.current?.key!==d&&(b.current={key:d,ids:new Set}),b.current.ids.add(e)):I([e]))},results:A,staleAt:M,annotations:j?.annotations,annotationError:j?.annotation_error,fetchingIds:O.isFetching?p.current.filter(e=>!h.current.has(e)):[],fetching:O.isFetching,error:O.error??(te?Error(te.error??`Panel refresh failed`):null),updatedAt:F||null,skippedAt:N.length?Math.min(...N):null,refetch:()=>{D&&!E&&(O.isFetching?_.current?.key===d&&(v.current=!0):(y.current=!0,O.refetch({cancelRefetch:!1})))}}}function Li(e,t,n,r,i,a){let o=e.key===t?{key:t,results:new Map(e.results),updated:new Map(e.updated),stale:new Set(e.stale),receivedAt:e.receivedAt,receivedBatch:e.receivedBatch}:{key:t,results:new Map,updated:new Map,stale:new Set,receivedAt:0},s=n&&i!==void 0&&(o.receivedBatch===void 0||i>o.receivedBatch);for(let e of s?n:[])e.status===`error`&&o.results.get(e.id)?.frame?(o.stale.add(e.id),o.results.set(e.id,{...o.results.get(e.id),error:e.error,reason:e.reason,request_error:e.request_error})):(o.results.set(e.id,e),o.updated.set(e.id,r),o.stale.delete(e.id));s&&(o.receivedAt=r,o.receivedBatch=i);for(let e of a?.ids??[]){let t=o.results.get(e);t?.frame?(o.stale.add(e),o.results.set(e,{...t,error:a.error,reason:void 0,request_error:a.retryable?a.ids:void 0})):o.results.set(e,{id:e,status:`error`,elapsed_ms:0,error:a.error,request_error:a.retryable?a.ids:void 0})}return o}function Ri(e,t){return e.queryKey[0]===`variables`&&e.queryKey[1]===t}function zi(e,t,n,r,i,a=!1){let o=!!t.variables?.some(e=>e.kind===`query`),s=P({queryKey:Ai(e,t,n,r),queryFn:async({signal:e})=>{let a=await i({dashboard:t,time:n,vars:r},e);return Object.fromEntries((t.variables??[]).map(e=>[e.name,a[e.name]??(e.kind===`custom`?e.options?.map(e=>({value:e})):void 0)??[]]))},enabled:o,retry:a,staleTime:6e4,placeholderData:e=>e}),c=s.isPlaceholderData?void 0:s.data,l=s.isError||(t.variables??[]).every(e=>e.kind!==`query`||r[e.name]!==void 0&&r[e.name]!==`$__all`&&(e.multi||!Array.isArray(r[e.name])||r[e.name].length>0)||!!e.default||e.include_all||c?.[e.name]!==void 0);return{...s,currentData:c,ready:l}}function Bi(e){return t=>Fi(t,e)||Ri(t,`dashboard-${e}`)}function Vi({id:e,currentVersion:t,currentSpec:n,opened:i,onClose:a,onRestored:o}){let s=U(),[c,l]=(0,Z.useState)(),[u,d]=(0,Z.useState)(),[f,p]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(i),_=(0,Z.useRef)(0),y=(0,Z.useRef)(i);y.current=i;let b=(0,Z.useRef)(!1),x=(0,Z.useRef)(!1),S=(0,Z.useRef)(o);S.current=o,(0,Z.useEffect)(()=>(x.current=!0,()=>{x.current=!1}),[]);let C=Le({mutationFn:({version:t})=>oe(e,t),retry:!1,onSuccess:(t,{version:n,generation:r})=>{s.cancelQueries({queryKey:D(e),exact:!0}),s.cancelQueries({predicate:Bi(e)}),s.cancelQueries({queryKey:[`exemplars`]}),s.cancelQueries({queryKey:[`drill-trace`]}),s.setQueryData(D(e),t),s.invalidateQueries({predicate:Bi(e),refetchType:`none`}),x.current&&(y.current&&r===_.current&&d({text:`Restored v${n} as v${t.version}`}),S.current(t)),s.invalidateQueries({queryKey:v}),s.invalidateQueries({queryKey:A(e)},{cancelRefetch:!1}),s.invalidateQueries({queryKey:[`exemplars`],refetchType:`none`}),s.invalidateQueries({queryKey:[`drill-trace`],refetchType:`none`})},onError:t=>{t instanceof m&&t.code===`dashboard_version_not_found`&&s.invalidateQueries({queryKey:A(e)})},onSettled:()=>{b.current=!1,x.current&&p(!1)}}),w=()=>{_.current++,C.reset(),d(void 0)};(0,Z.useEffect)(()=>{i?g(!0):(_.current++,C.reset(),d(void 0),s.cancelQueries({queryKey:A(e)}),s.cancelQueries({queryKey:[`dashboard-version`,e]}))},[i,e,s,C.reset]);let T=(0,Z.useRef)(t);return(0,Z.useEffect)(()=>{T.current!==t&&(T.current=t,s.invalidateQueries({queryKey:A(e)},{cancelRefetch:!1}))},[t,e,s]),(0,X.jsx)(r,{opened:i,onClose:()=>{w(),a()},onExitTransitionEnd:()=>g(!1),title:`Version history`,position:`right`,size:`xl`,children:(i||h)&&(0,X.jsx)(Hi,{id:e,opened:i,currentVersion:t,currentSpec:n,selected:c,onSelect:e=>{w(),l(e)},pending:f,error:C.error,failedVersion:C.variables?.version,success:u,onRestore:e=>{b.current||(b.current=!0,p(!0),d(void 0),C.mutate({version:e,generation:_.current}))}})})}function Hi({id:e,opened:t,currentVersion:n,currentSpec:r,selected:i,onSelect:a,pending:o,error:s,failedVersion:l,success:u,onRestore:d}){let f=P({queryKey:A(e),queryFn:({signal:t})=>ge(e,t),enabled:t,retry:!1}),h=i??f.data?.[0]?.version,g=P({queryKey:[`dashboard-version`,e,h],queryFn:({signal:t})=>be(e,h,t),enabled:t&&h!==void 0,retry:!1}),_=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{u&&_.current?.focus()},[u]),(0,X.jsxs)(K,{gap:`md`,"data-version-history":!0,children:[(0,X.jsx)(H,{size:`sm`,c:`dimmed`,children:`Inspect saved specs and changes. Restoring adds a new version.`}),u&&(0,X.jsx)(Y,{ref:_,tabIndex:-1,role:`note`,children:(0,X.jsx)(c,{live:!1,tone:`success`,children:u.text})}),s&&l===h&&(0,X.jsx)(Ki,{error:s,version:h}),(0,X.jsxs)(Y,{mih:160,children:[f.isPending&&(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading history…`,rows:3}),f.error&&(0,X.jsx)(Y,{children:(0,X.jsxs)(c,{tone:`danger`,title:`History unavailable`,children:[f.error.message,(0,X.jsx)(B,{mt:`xs`,variant:`default`,size:`xs`,onClick:()=>void f.refetch(),children:`Retry history`})]})}),f.data?.length===0&&(0,X.jsx)(p,{state:`empty`,empty:{title:`No versions available.`,description:`Version history appears after a dashboard is saved.`,action:(0,X.jsx)(B,{variant:`default`,onClick:()=>void f.refetch(),children:`Retry history`})}}),!!f.data?.length&&(0,X.jsx)(ne,{h:200,type:`auto`,children:(0,X.jsx)(K,{gap:`xs`,pr:`sm`,role:`list`,"aria-label":`Saved versions`,children:f.data.map(e=>(0,X.jsxs)(M,{role:`listitem`,withBorder:!0,p:`xs`,radius:`sm`,style:{borderColor:h===e.version?`var(--mantine-color-accent-filled)`:void 0},children:[(0,X.jsxs)(ae,{justify:`space-between`,gap:`xs`,children:[(0,X.jsxs)(B,{color:`accent`,variant:h===e.version?`light`:`subtle`,size:`compact-sm`,"aria-pressed":h===e.version,onClick:()=>a(e.version),children:[`Version `,e.version]}),e.version===n&&(0,X.jsx)(q,{tone:`neutral`,children:`Current`}),(0,X.jsx)(Wi,{at:e.created_at})]}),(0,X.jsxs)(H,{size:`xs`,c:`dimmed`,mt:4,children:[Ui(e),` · `,e.message||`No edit message`]})]},e.version))})})]}),(0,X.jsx)(Ce,{role:`status`,"aria-live":`polite`,children:h===void 0?`Select a version.`:g.isFetching?`Loading version ${h}…`:g.error?`Version ${h} unavailable.`:`Version ${h} ready.`}),(0,X.jsxs)(Y,{mih:280,"aria-busy":g.isFetching,children:[h!==void 0&&g.isPending&&(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading version…`,rows:3}),g.error&&(0,X.jsx)(Y,{children:(0,X.jsxs)(c,{tone:`danger`,title:g.error instanceof m&&g.error.code===`dashboard_version_not_found`?`This version is no longer available`:`Version unavailable`,children:[g.error.message,(0,X.jsx)(B,{mt:`xs`,variant:`default`,size:`xs`,onClick:()=>void g.refetch(),children:`Retry version`})]})}),g.data&&!g.error&&(0,X.jsx)(Gi,{record:g.data,currentVersion:n,current:JSON.stringify(g.data.dashboard.spec)===JSON.stringify(r),pending:o,onRestore:()=>d(g.data.dashboard.version)})]})]})}function Ui(e){return e.author_kind===`agent`?`Agent`:e.author_kind===`user`?`You`:`System`}function Wi({at:e}){let t=(Date.parse(e)-Date.now())/1e3,[n,r]=Math.abs(t)<60?[1,`second`]:Math.abs(t)<3600?[60,`minute`]:Math.abs(t)<86400?[3600,`hour`]:[86400,`day`];return(0,X.jsx)(H,{component:`time`,dateTime:e,title:h(e),size:`xs`,c:`dimmed`,children:new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}).format(Math.round(t/n),r)})}function Gi({record:e,currentVersion:t,current:n,pending:r,onRestore:i}){let{dashboard:a}=e,s=te(e);return(0,X.jsxs)(K,{gap:`sm`,"data-history-version":a.version,children:[(0,X.jsxs)(ae,{justify:`space-between`,align:`flex-start`,children:[(0,X.jsxs)(Y,{miw:0,children:[(0,X.jsxs)(o,{order:2,fz:`lg`,children:[a.name,` · v`,a.version]}),(0,X.jsxs)(H,{size:`sm`,c:`dimmed`,children:[Ui(e),` · `,e.message||`No edit message`]}),(0,X.jsx)(Wi,{at:e.created_at})]}),a.version===t?(0,X.jsx)(B,{size:`sm`,variant:`default`,disabled:!0,children:`Current version`}):n?(0,X.jsx)(B,{size:`sm`,variant:`default`,disabled:!0,children:`Same as current`}):(0,X.jsxs)(B,{size:`sm`,disabled:r,loading:r,onClick:i,children:[`Restore version `,a.version]})]}),a.description&&(0,X.jsx)(H,{size:`sm`,children:a.description}),e.changes_available?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ze,{labels:s}),!s.length&&!e.layout_changed&&(0,X.jsx)(p,{state:`empty`,empty:{title:`No authored changes.`}})]}):(0,X.jsx)(Y,{children:(0,X.jsx)(c,{tone:`warning`,title:`Changes unavailable`,children:`The preceding version is no longer retained. This saved spec is still available.`})}),(0,X.jsxs)(H,{size:`sm`,c:`dimmed`,children:[`Read-only · `,a.spec.panels.length,` panels. Historical data is not queried.`]}),(0,X.jsxs)(ct,{variant:`contained`,children:[(0,X.jsxs)(ct.Item,{value:`spec`,children:[(0,X.jsx)(ct.Control,{children:`Spec`}),(0,X.jsx)(ct.Panel,{children:(0,X.jsx)(L,{block:!0,tabIndex:0,style:{maxHeight:320,overflow:`auto`},children:JSON.stringify(a.spec,null,2)})})]}),(0,X.jsxs)(ct.Item,{value:`data`,children:[(0,X.jsx)(ct.Control,{children:`Data`}),(0,X.jsx)(ct.Panel,{children:(0,X.jsx)(K,{gap:`xs`,children:a.spec.panels.map(e=>(0,X.jsxs)(Y,{children:[(0,X.jsxs)(H,{size:`sm`,fw:500,children:[e.title,` · `,e.viz]}),(0,X.jsx)(L,{block:!0,tabIndex:0,children:e.content??e.sql??JSON.stringify(e.query??{},null,2)})]},e.id))})})]})]})]})}function Ki({error:e,version:t}){let n=e instanceof m?e.code:void 0,r=!(e instanceof m)||e.status>=500?`Try again with the restore button.`:n===`invalid_spec`?`This saved spec is invalid. Review the fields below and choose another version.`:n===`dashboard_version_not_found`?`Reload history and choose a retained version.`:n===`already_current`?`The dashboard already has this version's contents, so there is nothing to restore.`:[`dashboard_version_conflict`,`conflict`].includes(n??``)?`This dashboard changed or its name conflicts. Reload history and choose another version.`:`Check your access and reload history.`;return(0,X.jsx)(Y,{children:(0,X.jsxs)(c,{tone:`danger`,title:`Restore of version ${t} failed`,children:[(0,X.jsx)(H,{size:`sm`,children:e.message}),e instanceof m&&e.problems.length>0&&(0,X.jsx)(`ul`,{children:e.problems.map((e,t)=>(0,X.jsxs)(`li`,{children:[e.path,`: `,e.message,e.hint?` (${e.hint})`:``]},t))}),(0,X.jsx)(H,{size:`sm`,mt:`xs`,children:r})]})})}function qi(e,t){let n=JSON.stringify([e.range,e.from,e.to]),r=(0,Z.useRef)({search:e,onSearch:t,scope:n}),i=(0,Z.useRef)(``),a=(0,Z.useRef)(void 0),[o,s]=(0,Z.useState)(!1);r.current.scope!==n&&(i.current!==`${e.from}/${e.to}`&&(a.current=void 0,o&&s(!1)),i.current=``),r.current={search:e,onSearch:t,scope:n};let c=(0,Z.useCallback)(()=>{i.current=``,a.current=void 0,s(!1)},[]),l=(0,Z.useCallback)(()=>{if(!a.current)return;let e=a.current;c(),r.current.onSearch({...r.current.search,...e},!1)},[c]);return{zoom:(0,Z.useCallback)((e,t)=>{let n=Je(e,t);if(!n)return;let o=r.current,c=`${n.from}/${n.to}`;o.search.from===n.from&&o.search.to===n.to||i.current===c||(a.current??={range:o.search.range,from:o.search.from,to:o.search.to},s(!0),i.current=c,o.onSearch({...o.search,range:void 0,...n},!1))},[]),reset:c,resetZoom:l,zoomed:o}}function Ji({variables:e,vars:t,options:n,onChange:r}){return e.length===0?null:(0,X.jsx)(ae,{gap:`sm`,wrap:`wrap`,role:`group`,"aria-label":`Dashboard variables`,children:e.map(e=>{let i=mi(e,t,n[e.name]),a=[...e.include_all?[{value:jt,label:`All`}]:[],...(n[e.name]??e.options?.map(e=>({value:e}))??[]).map(e=>({value:e.value,label:e.value}))],o=(0,X.jsxs)(H,{size:`sm`,c:`dimmed`,ff:`monospace`,children:[`$`,e.name]});return e.kind===`constant`?(0,X.jsx)(d,{label:o,size:`sm`,value:e.value,readOnly:!0,w:160},e.name):e.kind===`text`?(0,X.jsx)(d,{label:o,size:`sm`,w:200,defaultValue:typeof i==`string`?i:``,onBlur:t=>r(e.name,t.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.name}:${JSON.stringify(i)}`):e.multi?(0,X.jsx)(kt,{label:o,size:`sm`,w:260,searchable:!0,clearable:!0,data:a.filter(e=>e.value!==jt),value:Array.isArray(i)?i:i&&i!==`$__all`?[i]:[],placeholder:e.include_all?`All`:`None`,onChange:t=>r(e.name,t.length?t:e.include_all?jt:[])},e.name):(0,X.jsx)(We,{label:o,size:`sm`,w:220,searchable:!0,allowDeselect:!1,data:a,value:Array.isArray(i)?i[0]??null:i||null,onChange:t=>t!==null&&r(e.name,t)},e.name)})})}function Yi(e,t,n=!1){let r=e.target;return t||e.defaultPrevented||e.repeat||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey&&e.key!==`?`||r instanceof Element&&r.closest(`input,textarea,select,[contenteditable]:not([contenteditable="false"]),[role="textbox"],[role="menu"]`)||r instanceof Element&&r.closest(`[role="dialog"]`)&&!(n&&r.closest(`[data-panel-fullscreen]`))?null:[`r`,`e`,`h`,`f`,`?`].includes(e.key)?e.key:null}function Xi(e,t,n={}){let r=(0,Z.useRef)({actions:t,options:n});r.current={actions:t,options:n},(0,Z.useEffect)(()=>{let t=t=>{let n=e.current,i=t.target,{actions:a,options:o}=r.current;if(!n||!(i instanceof Element)||o.enabled===!1)return;let s=o.fullscreenScope?[...document.querySelectorAll(`[data-shortcut-scope]`)].find(e=>e.dataset.shortcutScope===o.fullscreenScope&&e.hasAttribute(`data-panel-fullscreen`)):void 0,c=n.contains(i)&&n.contains(document.activeElement),l=i===document.body&&document.activeElement===document.body,u=s?.contains(i)&&s.contains(document.activeElement);if(!c&&!l&&!u)return;let d=Yi(t,!!(o.modalOpen||[...document.querySelectorAll(`[role="dialog"]`)].some(e=>e!==s)),!!s);if(!d||s&&![`r`,`f`,`?`].includes(d))return;let f=a[d];f&&(t.preventDefault(),f(i))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function Zi({opened:e,onClose:t,fullscreen:n=!1,enabled:r,onEnabled:i}){let a=[[`r`,`Refresh now`],...n?[]:[[`e`,`Toggle layout mode`],[`h`,`Open history`]],[`f`,n?`Exit full-screen`:`Open the focused panel in full-screen`],[`?`,`Open keyboard shortcuts`],[`Escape`,`Cancel a range, then leave the chart or close full-screen`]];return(0,X.jsx)(O,{opened:e,onClose:t,title:`Keyboard shortcuts`,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,children:(0,X.jsxs)(K,{gap:`xs`,children:[(0,X.jsx)(Me,{label:`Single-key shortcuts`,checked:r,onChange:e=>i(e.currentTarget.checked)}),a.map(([e,t])=>(0,X.jsxs)(ae,{gap:`sm`,children:[(0,X.jsx)(y,{children:e}),(0,X.jsx)(H,{size:`sm`,children:t})]},e)),!n&&(0,X.jsx)(H,{size:`sm`,children:`Focus a chart or a panel control before pressing f. Without a focused panel, f does nothing.`}),(0,X.jsx)(H,{size:`sm`,children:`Tab directly to a chart. Left/Right moves between points; Up/Down changes series at the same time or category. Home/End jumps to the first/last point. Enter drills or applies the panel filter. Comparison and Other values can be read even when selection is unavailable.`}),(0,X.jsx)(H,{size:`sm`,children:`On time charts, Shift+Left/Right extends a range and pauses auto-refresh. Review the shaded range and compact UTC label, then choose Zoom to range. Use the time picker after zooming for precise edits. Escape or Cancel cancels it and resumes refresh. The next Escape leaves the chart or closes full-screen. Reset zoom, Zoom out and browser Back preserve comparison and filters.`}),(0,X.jsxs)(H,{size:`sm`,children:[n?`In full-screen, r refreshes, f exits and ? opens help; e and h are inactive.`:`Shortcuts work in the dashboard.`,` Typing, menus and other dialogs or drawers pause shortcuts. Modifier shortcuts keep their browser behavior. Turning off single-key shortcuts keeps chart navigation and visible controls available.`]}),(0,X.jsx)(H,{size:`sm`,children:`The global / shortcut focuses the chat composer.`})]})})}function Qi(e){let t=`pitot:single-key-shortcuts:`+e,n=()=>{try{return localStorage.getItem(t)!==`off`}catch{return!0}},[r,i]=(0,Z.useState)(n);return(0,Z.useEffect)(()=>{i(n())},[t]),(0,Z.useEffect)(()=>{let e=e=>{e.key===t&&i(n())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[t]),{enabled:r,change:e=>{i(e);try{localStorage.setItem(t,e?`on`:`off`)}catch{}}}}function $i(e){let t=(0,Z.useRef)(void 0),n=t=>[...e.current?.querySelectorAll(`[data-panel]`)??[]].find(e=>e.dataset.panel===t&&!e.closest(`[data-panel-fullscreen],[data-fragment-fullscreen]`));return(0,Z.useEffect)(()=>{t.current&&!n(t.current.panel)&&(t.current=void 0)}),{remember(n){t.current=void 0;let r=document.activeElement;if(!(r instanceof HTMLElement)||!e.current?.contains(r)||r.closest(`[data-panel]`)?.dataset.panel!==n)return;let i=r.getAttribute(`data-panel-view`),a=r.getAttribute(`aria-label`),o=r.hasAttribute(`data-chart-plot`)?`[data-chart-plot]`:i?`[data-panel-view=${JSON.stringify(i)}]`:a?`[aria-label=${JSON.stringify(a)}]`:void 0;t.current={element:r,panel:n,selector:o}},restore(e){let r=t.current;if(t.current=void 0,r&&(e===void 0||r.panel===e)&&n(r.panel))return r.element.isConnected&&!r.element.closest(`[hidden]`)?r.element:r.selector?n(r.panel)?.querySelector(r.selector)??void 0:void 0}}}var ea=(0,Z.lazy)(()=>I(()=>import(`./new-dashboard-CCTJTeSK.js`).then(e=>({default:e.NewDashboard})),__vite__mapDeps([14,1,2,3,11,8,5,6,7,9,10,4,12,13]))),ta={exemplars:me,trace:se,span:He},na={"5m":`15m`,"15m":`1h`,"1h":`3h`,"3h":`6h`,"6h":`12h`,"12h":`24h`,"24h":`2d`,"2d":`7d`,"7d":`30d`,"30d":`30d`};function ra({dashboardId:e,search:t,onSearch:r,onOpen:i}){let{agentAvailable:a,openChat:s}=ue(),[c,l]=(0,Z.useState)(!1),d=P({queryKey:v,queryFn:V,staleTime:15e3});(0,Z.useEffect)(()=>{!e&&d.data?.length&&i((d.data.find(e=>e.is_default)??d.data[0]).id,!0)},[e,d.data]);let f=P({queryKey:D(e),queryFn:({signal:t})=>n(e,t),enabled:!!e,retry:(e,t)=>!(t instanceof m&&t.code===`not_found`)&&e<2});return!e&&d.error?(0,X.jsxs)(K,{p:`lg`,children:[(0,X.jsx)(u,{title:`Dashboards`,description:`Monitor your services and investigate changes.`}),(0,X.jsx)(p,{state:`error`,error:{title:`Dashboards could not be loaded`,message:d.error.message,onRetry:()=>void d.refetch()}})]}):!e&&d.data?.length===0?(0,X.jsx)(ye,{mih:`50vh`,children:(0,X.jsxs)(K,{align:`center`,gap:`xs`,children:[(0,X.jsx)(u,{title:`Dashboards`,description:`Create a dashboard to explore your services.`}),(0,X.jsx)(p,{state:`empty`,empty:{title:(0,X.jsx)(o,{order:2,fz:`lg`,children:`No dashboards yet`}),description:`Create a dashboard to see your telemetry.`,action:(0,X.jsx)(B,{size:`sm`,onClick:()=>l(!0),children:`New dashboard`})}}),(0,X.jsx)(ae,{mt:`sm`,gap:`xs`,children:a&&(0,X.jsx)(B,{size:`sm`,variant:`default`,onClick:()=>s(`Build me a dashboard for my services, showing request volume, latency, and errors. Ask me which services to monitor first.`),children:`Create with AI`})}),c&&(0,X.jsx)(Z.Suspense,{fallback:null,children:(0,X.jsx)(ea,{onClose:()=>l(!1),onCreated:e=>{l(!1),i(e)}})})]})}):!e||f.isLoading?(0,X.jsx)(Y,{component:`section`,"aria-label":`Dashboard`,maw:1600,mx:`auto`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,children:(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading dashboard`,skeleton:(0,X.jsx)(Lt,{})})}):f.error instanceof m&&f.error.code===`not_found`?(0,X.jsx)(ye,{mih:`50vh`,children:(0,X.jsxs)(K,{align:`center`,gap:`xs`,children:[(0,X.jsx)(u,{title:`Dashboard`,description:`Monitor your services and investigate changes.`}),(0,X.jsx)(p,{state:`empty`,empty:{title:(0,X.jsx)(o,{order:2,fz:`lg`,children:`This dashboard isn't here`}),description:`The link may be out of date, or the dashboard may have been deleted.`,action:d.data?.length?(0,X.jsx)(B,{variant:`default`,size:`sm`,onClick:()=>i((d.data.find(e=>e.is_default)??d.data[0]).id,!0),children:`Open your default dashboard`}):void 0}})]})}):f.error||!f.data?(0,X.jsxs)(K,{p:`lg`,children:[(0,X.jsx)(u,{title:`Dashboard`,description:`Monitor your services and investigate changes.`}),(0,X.jsx)(p,{state:`error`,error:{message:`Your dashboard is unavailable.`,onRetry:()=>void f.refetch()}})]}):(0,X.jsx)(ia,{id:f.data.id,version:f.data.version,spec:f.data.spec,search:t,onSearch:r,onOpen:i,agentAvailable:a,openChat:s},f.data.id)}function ia({id:e,version:t,spec:n,search:r,onSearch:i,onOpen:a,agentAvailable:o,openChat:s}){let[l,d]=(0,Z.useState)(!1),[f,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(!1);G((0,Z.useCallback)(()=>_(!0),[]));let v=(0,Z.useRef)(null),y=(0,Z.useId)(),b=Qi(w().id),x=$i(v),[S,C]=(0,Z.useState)(()=>new Set),T=(0,Z.useCallback)((e,t)=>C(n=>{if(n.has(e)===t)return n;let r=new Set(n);return t?r.add(e):r.delete(e),r}),[]),D=U(),[O,ee]=(0,Z.useState)(),{zoom:A,reset:j,resetZoom:M,zoomed:te}=qi(r,i),N=he(n,r),[P,F]=(0,Z.useState)(N.refresh??`30s`),I=()=>{if(N.from&&N.to){let e=Date.parse(N.from),t=Date.parse(N.to),n=(t-e)/2;i({...r,range:void 0,from:new Date(e-n).toISOString(),to:new Date(t+n).toISOString()})}else i({...r,range:na[N.range??`1h`]??`1h`,from:void 0,to:void 0})},ne=r.compare?r.compare===`1`:n.time.compare===`previous_period`,re=r.vars??{},ie=zi(`dashboard-${e}`,n,N,re,Se,Ei),oe=(0,Z.useMemo)(()=>gi(n.variables,re,ie.currentData),[n.variables,re,ie.currentData]),[L,se]=(0,Z.useState)(()=>window.innerWidth);(0,Z.useEffect)(()=>{let e=0,t=()=>{window.clearTimeout(e),e=window.setTimeout(()=>se(window.innerWidth),300)};return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t),window.clearTimeout(e)}},[]);let ce=(0,Z.useMemo)(()=>{let e=Math.max(320,Math.min(L-64,1600));return Object.fromEntries(n.panels.map(t=>[t.id,e/12*(t.grid?.w??t.width??6)]))},[L,n]),[le,ue]=(0,Z.useState)(()=>n.panels.map(e=>e.id)),R=Ii({dashboardId:e,version:t,spec:n,time:N,vars:oe,compare:ne,widths:ce,visible:(0,Z.useMemo)(()=>le.filter(e=>n.panels.some(t=>t.id===e)),[le,n.panels]),refresh:S.size?`off`:P,enabled:ie.ready});(0,Z.useEffect)(()=>{O===t&&D.refetchQueries({predicate:Bi(e),type:`active`,stale:!0},{cancelRefetch:!1})},[O,t,e,D]);let de=(0,Z.useMemo)(()=>R.annotations?{...R.annotations,deploys:n.annotations?.deploys===!1?[]:R.annotations.deploys,anomalies:n.annotations?.anomalies===!1?[]:R.annotations.anomalies}:void 0,[R.annotations,n.annotations?.deploys,n.annotations?.anomalies]),fe=ie.error??R.error,pe=(e,t)=>{let n={...re};t===void 0?delete n[e]:n[e]=t,i({...r,vars:n},!0)},z=()=>i({...r,edit:r.edit===`1`?void 0:`1`}),V=e=>{e&&x.remember(e),i({...r,view:e},e===void 0)};return Xi(v,{r:()=>R.refetch(),e:z,h:()=>h(!0),"?":()=>_(!0),f:e=>{if(r.view){V();return}let t=e.closest(`[data-panel]`)?.dataset.panel;t&&n.panels.some(e=>e.id===t)&&V(t)}},{modalOpen:f||g||!!r.drill,fullscreenScope:r.view?y:void 0,enabled:b.enabled}),(0,X.jsxs)(Y,{component:`section`,ref:v,"aria-label":`Dashboard`,maw:1600,mx:`auto`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,children:[(0,X.jsxs)(K,{gap:`sm`,mb:`md`,children:[(0,X.jsx)(u,{title:n.name,description:n.description||`Monitor your services and investigate changes.`,meta:(0,X.jsx)(Ie,{time:N,updatedAt:R.updatedAt}),actions:(0,X.jsx)(ae,{gap:`xs`,children:(0,X.jsx)(k,{label:`Duplicate dashboard`,children:(0,X.jsx)(W,{variant:`subtle`,color:`gray`,"aria-label":`Duplicate dashboard`,onClick:()=>d(!0),children:(0,X.jsx)(E,{size:16})})})})}),(0,X.jsx)(Ge,{selecting:S.size>0,time:N,refresh:P,compare:ne,editing:r.edit===`1`,fetching:R.fetching,updatedAt:R.updatedAt,onRange:e=>{j(),i({...r,range:e,from:void 0,to:void 0})},onAbsolute:(e,t)=>{j(),i({...r,range:void 0,from:e,to:t})},onZoomOut:I,onRefresh:F,onRefreshNow:R.refetch,onCompare:e=>i({...r,compare:e?`1`:`0`},!0),onEdit:z,onHistory:()=>h(!0)}),(0,X.jsx)(Ji,{variables:n.variables??[],vars:re,options:ie.data??{},onChange:pe}),Object.entries(re).filter(([,e])=>e!==`$__all`).length>0&&(0,X.jsx)(ae,{gap:6,children:Object.entries(re).filter(([,e])=>e!==`$__all`).map(([e,t])=>(0,X.jsxs)(B,{color:`accent`,size:`compact-xs`,variant:`light`,"aria-label":`$${e} = ${Array.isArray(t)?t.join(`, `):t} ×: remove filter`,onClick:()=>pe(e,void 0),children:[`$`,e,` = `,Array.isArray(t)?t.join(`, `):t,` ×`]},e))}),R.annotationError&&(0,X.jsx)(c,{tone:`warning`,title:`Annotations unavailable`,children:R.annotationError}),R.annotations?.truncated&&(0,X.jsx)(c,{tone:`warning`,children:`Annotation history is limited.`})]}),!fe&&R.skippedAt!==null&&(0,X.jsx)(Y,{"data-refresh-skipped":!0,children:(0,X.jsxs)(c,{tone:`info`,children:[`The server was busy, so the latest refresh was skipped. Marked panels show data from `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,second:`2-digit`}).format(R.skippedAt),`.`]})}),fe&&(0,X.jsxs)(c,{tone:`danger`,title:ie.error?`Variables could not be loaded`:`Panels could not be loaded`,children:[fe.message,fe instanceof m&&(0,X.jsx)(`ul`,{children:fe.problems.map((e,t)=>(0,X.jsxs)(`li`,{children:[e.path,`: `,e.message,e.hint?` (${e.hint})`:``]},t))})]}),n.panels.length===0&&(0,X.jsx)(p,{state:`empty`,empty:{title:`No panels yet`,description:`Add a panel to see telemetry on this dashboard.`,action:(0,X.jsx)(B,{onClick:()=>i({...r,edit:`1`}),children:`Add panel`})}}),(0,X.jsx)(wi,{dashboardId:e,version:t,spec:n,vars:oe,results:R.results,annotations:de,fetching:R.fetching,fetchingIds:R.fetchingIds,staleAt:R.staleAt,time:{...N,compare:ne?`previous_period`:void 0},onEditExit:()=>i({...r,edit:void 0}),editing:r.edit===`1`,view:r.view,canManage:!0,agentAvailable:o,onOpenChat:s,onRetry:R.retry,onVariable:pe,onZoom:A,zoomed:te,onZoomReset:M,onWiden:I,onView:V,onRangePending:T,shortcutScope:y,onShortcuts:()=>_(!0),overlayOpen:f||g||!!r.drill,returnViewFocus:x.restore,onVisible:ue,onPoint:(e,t)=>{let n=Be(e,R.results.get(e.id),t,re);n&&i({...r,vars:n.vars,drill:JSON.stringify(n.target)},!1)}}),(0,X.jsx)(Ye,{client:ta,spec:n,time:N,vars:oe,target:we(r.drill),onChange:e=>i({...r,drill:e?JSON.stringify(e):void 0},!1)}),l&&(0,X.jsx)(Ti,{spec:n,onClose:()=>d(!1),onCreated:e=>{d(!1),a(e)}}),(0,X.jsx)(Vi,{id:e,currentVersion:t,currentSpec:n,opened:f,onClose:()=>h(!1),onRestored:e=>{ee(e.version);let t=new Set(e.spec.panels.map(e=>e.id)),n=we(r.drill),a=r.view&&!t.has(r.view)?void 0:r.view,o=n&&!t.has(n.panel_id)?void 0:r.drill;(a!==r.view||o!==r.drill)&&i({...r,view:a,drill:o},!0)}}),(0,X.jsx)(Zi,{opened:g,onClose:()=>_(!1),fullscreen:!!r.view,enabled:b.enabled,onEnabled:b.change})]})}export{jt as n,ra as t}; \ No newline at end of file +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&ce(e.body,`react-draggable-transparent-selection`)}function L(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{se(e)}):se(e)}function se(e){if(e)try{e.body&&ue(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function ce(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function ue(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function de(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:me(r);let i=he(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+b(s.paddingLeft)+b(o.marginLeft),top:-i.offsetTop+b(s.paddingTop)+b(o.marginTop),right:N(a)-M(i)-i.offsetLeft+b(s.paddingRight)-b(o.marginRight),bottom:te(a)-j(i)-i.offsetTop+b(s.paddingBottom)-b(o.marginBottom)}}return y(r.right)&&(t=Math.min(t,r.right)),y(r.bottom)&&(n=Math.min(n,r.bottom)),y(r.left)&&(t=Math.max(t,r.left)),y(r.top)&&(n=Math.max(n,r.top)),[t,n]}function fe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function pe(e){return e.props.axis===`both`||e.props.axis===`x`}function z(e){return e.props.axis===`both`||e.props.axis===`y`}function B(e,t,n){let r=typeof t==`number`?re(e,t):null;if(typeof t==`number`&&!r)return null;let i=he(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return P(r||e,a,n.props.scale)}function V(e,t,n){let r=!y(e.lastX),i=he(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function H(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function me(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function he(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var U=u(le()),W=u(Jn()),G=u(R()),K=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},q={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},ge=q.mouse,J=class extends U.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!ee(e.target,this.props.handle,t)||this.props.cancel&&ee(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ie(e);this.touchIdentifier=r;let i=B(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=V(this,a,o);K(`DraggableCore: handleDragStart: %j`,s),K(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&oe(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,k(n,ge.move,this.handleDrag),k(n,ge.stop,this.handleDragStop))},this.handleDrag=e=>{let t=B(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=fe(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=V(this,n,r);if(K(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1)try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}else this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=B(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=fe(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=V(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&L(a.ownerDocument),K(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(K(`DraggableCore: Removing handlers`),A(a.ownerDocument,ge.move,this.handleDrag),A(a.ownerDocument,ge.stop,this.handleDragStop))},this.onMouseDown=e=>(ge=q.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(ge=q.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(ge=q.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(ge=q.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&k(e,q.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;A(t,q.mouse.move,this.handleDrag),A(t,q.touch.move,this.handleDrag),A(t,q.mouse.stop,this.handleDragStop),A(t,q.touch.stop,this.handleDragStop),A(e,q.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&L(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=G.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(K(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return U.cloneElement(U.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};J.displayName=`DraggableCore`,J.propTypes={allowAnyClick:W.default.bool,allowMobileScroll:W.default.bool,children:W.default.node.isRequired,disabled:W.default.bool,enableUserSelectHack:W.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:W.default.arrayOf(W.default.number),handle:W.default.string,cancel:W.default.string,nodeRef:W.default.object,nonce:W.default.string,onStart:W.default.func,onDrag:W.default.func,onStop:W.default.func,onMouseDown:W.default.func,scale:W.default.number,className:x,style:x,transform:x},J.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var _e=class extends p.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(K(`Draggable: onDragStart: %j`,t),this.props.onStart(e,H(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;K(`Draggable: onDrag: %j`,t);let n=H(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=de(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,H(this,t))===!1)return!1;K(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(K(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=h.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,m=!s||this.state.dragging,h=s||r,_={x:pe(this)&&m?this.state.x:h.x,y:z(this)&&m?this.state.y:h.y};this.state.isElementSVG?f=I(_,c):d=F(_,c);let v=p.Children.only(n),y=(0,g.clsx)(v.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return p.createElement(J,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},p.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};_e.displayName=`Draggable`,_e.propTypes={...J.propTypes,axis:m.default.oneOf([`both`,`x`,`y`,`none`]),bounds:m.default.oneOfType([m.default.shape({left:m.default.number,right:m.default.number,top:m.default.number,bottom:m.default.number}),m.default.string,m.default.oneOf([!1])]),defaultClassName:m.default.string,defaultClassNameDragging:m.default.string,defaultClassNameDragged:m.default.string,defaultPosition:m.default.shape({x:m.default.number,y:m.default.number}),positionOffset:m.default.shape({x:m.default.oneOfType([m.default.number,m.default.string]),y:m.default.oneOfType([m.default.number,m.default.string])}),position:m.default.shape({x:m.default.number,y:m.default.number}),className:x,style:x,transform:x},_e.defaultProps={...J.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(t.exports={DraggableCore:J})})),Hr=t(((e,t)=>{var n=Vr(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),Ur=t((e=>{e.__esModule=!0,e.cloneElement=c;var t=n(le());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t{e.__esModule=!0,e.resizableProps=void 0;var t=n(Jn());Hr();function n(e){return e&&e.__esModule?e:{default:e}}e.resizableProps={axis:t.default.oneOf([`both`,`x`,`y`,`none`]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<`u`?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`y`?t.default.number.isRequired(...e):t.default.number(...e)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf([`s`,`w`,`e`,`n`,`sw`,`nw`,`se`,`ne`])),transformScale:t.default.number,width:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`x`?t.default.number.isRequired(...e):t.default.number(...e)}}})),Gr=t((e=>{e.__esModule=!0,e.default=void 0;var t=o(le()),n=Hr(),r=Ur(),i=Wr(),a=[`children`,`className`,`draggableOpts`,`width`,`height`,`handle`,`handleSize`,`lockAspectRatio`,`axis`,`minConstraints`,`maxConstraints`,`onResize`,`onResizeStop`,`onResizeStart`,`resizeHandles`,`transformScale`];function o(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(o=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(i*n)?t=e/n:e=t*n}let o=e,s=t,c=this.slack||[0,0],l=c[0],u=c[1];return e+=l,t+=u,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[l+(o-e),u+(s-t)],[e,t]}resizeHandler(e,t){return(n,r)=>{let i=r.node,a=r.deltaX,o=r.deltaY;e===`onResizeStart`&&this.resetData();let s=(this.props.axis===`both`||this.props.axis===`x`)&&t!==`n`&&t!==`s`,c=(this.props.axis===`both`||this.props.axis===`y`)&&t!==`e`&&t!==`w`;if(!s&&!c)return;let l=t[0],u=t[t.length-1],d=i.getBoundingClientRect();if(this.lastHandleRect!=null){if(u===`w`){let e=d.left-this.lastHandleRect.left;a+=e}if(l===`n`){let e=d.top-this.lastHandleRect.top;o+=e}}this.lastHandleRect=d,u===`w`&&(a=-a),l===`n`&&(o=-o);let f=this.lastSize?.width??this.props.width,p=this.lastSize?.height??this.props.height,m=f+(s?a/this.props.transformScale:0),h=p+(c?o/this.props.transformScale:0);var g=this.runConstraints(m,h);if(m=g[0],h=g[1],e===`onResizeStop`&&this.lastSize){var _=this.lastSize;m=_.width,h=_.height}let v=m!==f||h!==p;e!==`onResizeStop`&&(this.lastSize={width:m,height:h});let y=typeof this.props[e]==`function`?this.props[e]:null;y&&(e!==`onResize`||v)&&(n.persist==null||n.persist(),y(n,{node:i,size:{width:m,height:h},handle:t})),e===`onResizeStop`&&this.resetData()}}renderResizeHandle(e,n){let r=this.props.handle;if(!r)return t.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:n});if(typeof r==`function`)return r(e,n);let i=typeof r.type==`string`,a=u({ref:n},i?{}:{handleAxis:e});return t.cloneElement(r,a)}render(){let e=this.props,i=e.children,o=e.className,l=e.draggableOpts;e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart;let d=e.resizeHandles;e.transformScale;let f=c(e,a);return(0,r.cloneElement)(i,u(u({},f),{},{className:(o?o+` `:``)+`react-resizable`,children:[...t.Children.toArray(i.props.children),...d.map(e=>{let r=this.handleRefs[e]??(this.handleRefs[e]=t.createRef());return t.createElement(n.DraggableCore,s({},l,{nodeRef:r,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,r))})]}))}};e.default=m,m.propTypes=i.resizableProps,m.defaultProps={axis:`both`,handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:[`se`],transformScale:1}})),Kr=t((e=>{e.__esModule=!0,e.default=void 0;var t=s(le()),n=o(Jn()),r=o(Gr()),i=Wr(),a=[`handle`,`handleSize`,`onResize`,`onResizeStart`,`onResizeStop`,`draggableOpts`,`minConstraints`,`maxConstraints`,`lockAspectRatio`,`axis`,`width`,`height`,`resizeHandles`,`style`,`transformScale`];function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=t.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(n,()=>this.props.onResize&&this.props.onResize(e,t))):this.setState(n)}}static getDerivedStateFromProps(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,n=e.handle,i=e.handleSize;e.onResize;let o=e.onResizeStart,s=e.onResizeStop,l=e.draggableOpts,d=e.minConstraints,f=e.maxConstraints,p=e.lockAspectRatio,h=e.axis;e.width,e.height;let g=e.resizeHandles,_=e.style,v=e.transformScale,y=m(e,a);return t.createElement(r.default,{axis:h,draggableOpts:l,handle:n,handleSize:i,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:d,onResizeStart:o,onResize:this.onResize,onResizeStop:s,resizeHandles:g,transformScale:v,width:this.state.width},t.createElement(`div`,c({},y,{style:u(u({},_),{},{width:this.state.width+`px`,height:this.state.height+`px`})})))}};e.default=h,h.propTypes=u(u({},i.resizableProps),{},{children:n.default.element})})),qr=t(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=Gr().default,t.exports.ResizableBox=Kr().default}))(),Jr=Gn(),Yr=50,Xr=12;function Zr(e){let t=e;for(;t;){let e=window.getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function Qr(e){let t=Zr(e),n=null,r=0,i=0,a=!1;function o(){let e=t;if(!e)return;let s=e.getBoundingClientRect(),{clientHeight:c,scrollTop:l,scrollHeight:u}=e,{scrollLeft:d,scrollWidth:f,clientWidth:p}=e,m=0,h=0;i0?m=-Xr:i>s.bottom-Yr&&l+c0?h=-Xr:r>s.right-Yr&&d+p({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:s,rowHeight:o}),[n,a,r,i,s,o]),W=(0,Z.useMemo)(()=>({cols:n,maxRows:s,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,s,r,o,i]),G=(0,Z.useCallback)(e=>({...W,containerHeight:e??W.containerHeight,layout:pe.current}),[W]),K=(0,Z.useMemo)(()=>P??{i:j,x:w,y:T,w:E,h:D,minW:O,maxW:ee,minH:k,maxH:A},[P,j,w,T,E,D,O,ee,k,A]),q=(0,Z.useCallback)(e=>{if(g?.calcStyle)return g.calcStyle(e);if(p)return fn(e);let t=pn(e);return m?{...t,left:mn(e.left/r),width:mn(e.width/r)}:t},[g,p,m,r]),ge=(0,Z.useCallback)((e,{node:t})=>{if(!I)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/h,o=r.left/h,s=i.top/h,c=r.top/h,l;if(g?.calcDragPosition){let t=e;l=g.calcDragPosition(t.clientX,t.clientY,t.clientX-i.left,t.clientY-i.top)}else l={left:a-o+n.scrollLeft,top:s-c+n.scrollTop};if(R.current=l,he.current||=Qr(t instanceof HTMLElement?t:null),_>0){let t=e;H.current={x:t.clientX,y:t.clientY},V.current=!0,me.current=!1,se(!0);return}se(!0);let u=Ht(U,l.top,l.left),{x:d,y:f}=un(N,K,u.x,u.y,G());I(j,d,f,{e,node:t,newPosition:l})},[I,h,U,g,_,N,K,G,j]),J=(0,Z.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!ne||!L)return;let s=e;if(V.current&&!me.current){let n=s.clientX-H.current.x,r=s.clientY-H.current.y;if(Math.hypot(n,r)<_)return;if(me.current=!0,V.current=!1,I){let n=Ht(U,R.current.top,R.current.left),{x:r,y:i}=un(N,K,n.x,n.y,G());I(j,r,i,{e,node:t,newPosition:R.current})}}he.current?.feed(s.clientX,s.clientY);let c=R.current.top+a,l=R.current.left+n;if(u){let{offsetParent:e}=t;if(e){let t=e.clientHeight-zt(D,o,i[1]);c=Wt(c,0,t);let n=Rt(U),a=r-zt(E,n,i[0]);l=Wt(l,0,a)}}let d={top:c,left:l};R.current=d;let f=Ht(U,c,l),{x:p,y:m}=un(N,K,f.x,f.y,G());ne(j,p,m,{e,node:t,newPosition:d})},[ne,I,L,_,u,D,o,i,U,r,E,j,N,K,G]),_e=(0,Z.useCallback)((e,{node:t})=>{if(!re||!L)return;he.current?.stop(),he.current=null;let n=V.current;if(V.current=!1,me.current=!1,H.current={x:0,y:0},n){se(!1),R.current={left:0,top:0};return}let{left:r,top:i}=R.current,a={top:i,left:r};se(!1),R.current={left:0,top:0};let o=Ht(U,i,r),{x:s,y:c}=un(N,K,o.x,o.y,G());re(j,s,c,{e,node:t,newPosition:a})},[re,L,U,N,K,G,j]);z.current=ge,B.current=J;let ve=(0,Z.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?ie:o===`onResize`?ae:oe;if(!s)return;let c;c=t?wn(i,a,n,r):{...n,top:a.top,left:a.left},de.current=c;let l=t?.offsetParent?.clientHeight??0,u=Ut(U,c.width,c.height),{w:d,h:f}=dn(N,K,u.w,u.h,i,G(l));s(j,d,f,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[ie,ae,oe,r,U,j,N,K,G]),ye=(0,Z.useCallback)((e,t)=>{le(!0);let n=Bt(U,w,T,E,D),r={...t,handle:t.handle};ve(e,r,n,`onResizeStart`)},[ve,U,w,T,E,D]),be=(0,Z.useCallback)((e,t)=>{let n=Bt(U,w,T,E,D),r={...t,handle:t.handle};ve(e,r,n,`onResize`)},[ve,U,w,T,E,D]),xe=(0,Z.useCallback)((e,t)=>{le(!1),de.current={top:0,left:0,width:0,height:0};let n=Bt(U,w,T,E,D),r={...t,handle:t.handle};ve(e,r,n,`onResizeStop`)},[ve,U,w,T,E,D]);(0,Z.useEffect)(()=>{if(!v)return;let e=ue.current;if(!e)return;let t=fe.current||{left:0,top:0},n=L&&(v.left!==t.left||v.top!==t.top);if(!L){let t={node:e,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};z.current?.(v.e,t)}else if(n){let t={node:e,deltaX:v.left-R.current.left,deltaY:v.top-R.current.top,lastX:R.current.left,lastY:R.current.top,x:v.left,y:v.top};B.current?.(v.e,t)}fe.current=v},[v,L,j]);let Se=Bt(U,w,T,E,D,L?R.current:null,ce?de.current:null),Ce=Z.Children.only(t),Y=Rt(U),we=[zt(O,Y,i[0]),zt(k,o,i[1])],Te=[zt(ee,Y,i[0]),zt(A,o,i[1])],Ee=Ce.props,De=Ee.className,Oe=Ee.style,ke=Z.cloneElement(Ce,{ref:ue,className:x(`react-grid-item`,De,y,{static:f,resizing:ce,"react-draggable":c,"react-draggable-dragging":L,dropping:!!v,cssTransforms:p}),style:{...b,...Oe,...q(Se)}}),Ae=te;return ke=(0,X.jsx)(qr.Resizable,{draggableOpts:{disabled:!l},className:l?void 0:`react-resizable-hide`,width:Se.width,height:Se.height,minConstraints:we,maxConstraints:Te,onResizeStart:ye,onResize:be,onResizeStop:xe,transformScale:h,resizeHandles:M,handle:Ae,children:ke}),ke=(0,X.jsx)(Rr,{disabled:!c,onStart:ge,onDrag:J,onStop:_e,handle:S,cancel:`.react-resizable-handle`+(C?`,`+C:``),scale:h,allowMobileScroll:d,nodeRef:ue,children:ke}),ke}var ei=Z.memo($r,(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h&&e.minW===t.minW&&e.maxW===t.maxW&&e.minH===t.minH&&e.maxH===t.maxH&&e.cols===t.cols&&e.containerWidth===t.containerWidth&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.margin===t.margin&&e.containerPadding===t.containerPadding&&e.transformScale===t.transformScale&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.isBounded===t.isBounded&&e.allowMobileScroll===t.allowMobileScroll&&e.useCSSTransforms===t.useCSSTransforms&&e.usePercentages===t.usePercentages&&e.children===t.children&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.droppingPosition===t.droppingPosition);ei.displayName=`GridItem`;function ti(e){let{clientX:t,clientY:n,gridElement:r,droppingItem:i,event:a,dragOffsetX:o=0,dragOffsetY:s=0,transformScale:c,cols:l,margin:u,maxRows:d,rowHeight:f,width:p,containerPadding:m}=e,h=r.getBoundingClientRect(),g={cols:l,margin:u,maxRows:d,rowHeight:f,containerWidth:p,containerPadding:m},_=Rt(g),v=zt(i.w,_,u[0]),y=zt(i.h,f,u[1]),b=v/2,x=y/2,S=r.scrollLeft??0,C=r.scrollTop??0,w=t-h.left+S+o-b,T=n-h.top+C+s-x,E=Math.max(0,w),D=Math.max(0,T);return{newDroppingPosition:{left:E/c,top:D/c,e:a},calculatedXY:Vt(g,D,E,i.w,i.h)}}var ni=()=>{},ri=`react-grid-layout`,ii=!1;try{ii=/firefox/i.test(navigator.userAgent)}catch{}function ai(e,t){let n=Z.Children.toArray(e),r=Z.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!Z.isValidElement(t)||t.key===null)return;let n=String(t.key);a.add(n);let r=e.find(e=>e.i===n);if(r)i.push(en(r));else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:Zt(i),w:1,h:1})}});let o=an(i,{cols:n});return r.compact(o,n)}function si(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:o,positionStrategy:s=Tn,compactor:c,constraints:l=ln,layout:u=[],droppingItem:d,autoSize:f=!0,className:p=``,style:m={},innerRef:h,onLayoutChange:g=ni,onDragStart:_=ni,onDrag:v=ni,onDragStop:y=ni,onResizeStart:b=ni,onResize:S=ni,onResizeStop:C=ni,onDrop:w=ni,onDropDragOver:T=ni}=e,E=(0,Z.useMemo)(()=>({...En,...r}),[r]),D=(0,Z.useMemo)(()=>({...Dn,...i}),[i]),O=(0,Z.useMemo)(()=>({...On,...a}),[a]),ee=(0,Z.useMemo)(()=>({...kn,...o}),[o]),{cols:k,rowHeight:A,maxRows:j,margin:M,containerPadding:te}=E,{enabled:N,bounded:P,handle:F,cancel:I,threshold:ne,allowMobileScroll:re}=D,{enabled:ie,handles:ae,handleComponent:oe}=O,{enabled:L,defaultItem:se,onDragOver:ce,touchEnabled:le=!0,touchDragSource:ue=`[data-rgl-draggable]`}=ee,R=c??zn(`vertical`),de=R.type,fe=R.allowOverlap,pe=R.preventCollision??!1,z=(0,Z.useMemo)(()=>d??{i:`__dropping-elem__`,...se},[d,se]),B=s.type===`transform`,V=s.scale,H=te??M,[me,he]=(0,Z.useState)(!1),[U,W]=(0,Z.useState)(()=>oi(u,t,k,R)),[G,K]=(0,Z.useState)(null),[q,ge]=(0,Z.useState)(!1),[J,_e]=(0,Z.useState)(null),[ve,ye]=(0,Z.useState)(),be=(0,Z.useRef)(void 0);be.current=ve;let xe=(0,Z.useRef)(null),Se=(0,Z.useRef)(null),Ce=(0,Z.useRef)(null),Y=(0,Z.useRef)(0),we=(0,Z.useRef)(U),Te=(0,Z.useRef)(u),Ee=(0,Z.useRef)(t),De=(0,Z.useRef)(de),Oe=(0,Z.useRef)(null),ke=(0,Z.useRef)(!1),Ae=(0,Z.useRef)(null),je=(0,Z.useRef)(null);je.current=J;let Me=(0,Z.useRef)(w);(0,Z.useLayoutEffect)(()=>{Me.current=w});let Ne=(0,Z.useRef)(U);Ne.current=U,(0,Z.useEffect)(()=>{he(!0),(0,Jr.deepEqual)(U,u)||g(U)},[]),(0,Z.useEffect)(()=>{if(G||J)return;let e=!(0,Jr.deepEqual)(u,Te.current),n=!ai(t,Ee.current),r=de!==De.current;if(e||n||r){let n=oi(e?u:U,t,k,R);(0,Jr.deepEqual)(n,U)||W(n)}Te.current=u,Ee.current=t,De.current=de},[u,t,k,de,R,G,J,U]),(0,Z.useEffect)(()=>{if(!G&&!J&&!(0,Jr.deepEqual)(U,we.current)){we.current=U;let e=U.filter(e=>e.i!==z.i);g(e)}},[U,G,J,g,z.i]);let Pe=(0,Z.useMemo)(()=>{if(!f)return;let e=Zt(U),t=H[1];return e*A+(e-1)*M[1]+t*2+`px`},[f,U,A,M,H]),Fe=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Qt(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};xe.current=en(a),Ce.current=i,K(o),_(i,a,a,null,r.e,r.node)},[_]),Ie=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=xe.current,o=Qt(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=on(i,o,t,n,!0,pe,de,k,fe);v(c,a,o,s,r.e,r.node),W(R.compact(c,k)),K(s)},[pe,de,k,fe,R,v]),Le=(0,Z.useCallback)((e,t,n,r)=>{if(!xe.current)return;let i=Ne.current,a=xe.current,o=Qt(i,e);if(!o)return;let s=on(i,o,t,n,!0,pe,de,k,fe),c=R.compact(s,k);y(c,a,o,null,r.e,r.node);let l=Ce.current;xe.current=null,Ce.current=null,K(null),W(c),l&&!(0,Jr.deepEqual)(l,c)&&g(c)},[pe,de,k,fe,R,y,g]),Re=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Qt(i,e);a&&(Se.current=en(a),Ce.current=i,ge(!0),b(i,a,a,null,r.e,r.node))},[b]),ze=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Se.current,{handle:o}=r,s=!1,c,l,[u,d]=rn(i,e,e=>(c=e.x,l=e.y,[`sw`,`w`,`nw`,`n`,`ne`].includes(o)&&([`sw`,`nw`,`w`].includes(o)&&(c=e.x+(e.w-t),t=e.x!==c&&c<0?e.w:t,c=c<0?0:c),[`ne`,`n`,`nw`].includes(o)&&(l=e.y+(e.h-n),n=e.y!==l&&l<0?e.h:n,l=l<0?0:l),s=!0),pe&&!fe&&qt(i,{...e,w:t,h:n,x:c??e.x,y:l??e.y}).filter(t=>t.i!==e.i).length>0&&(l=e.y,n=e.h,c=e.x,t=e.w,s=!1),e.w=t,e.h=n,(o===`n`||o===`nw`||o===`ne`)&&(e.y=l??e.y),e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=on(u,d,c,l,!0,pe,de,k,fe));let p={w:d.w,h:d.h,x:d.x,y:d.y,i:e,static:!0};S(f,a,d,p,r.e,r.node);let m=R.compact(f,k);if(o===`n`||o===`nw`||o===`ne`){let t=m.find(t=>t.i===e);t&&(t.y=d.y)}W(m),K(p)},[pe,de,k,fe,R,S]),Be=(0,Z.useCallback)((e,t,n,r)=>{let i=Ne.current,a=Se.current,o=Qt(i,e),s=R.compact(i,k);C(s,a,o??null,null,r.e,r.node);let c=Ce.current;Se.current=null,Ce.current=null,K(null),ge(!1),W(s),c&&!(0,Jr.deepEqual)(c,s)&&g(s)},[k,R,C,g]),Ve=(0,Z.useCallback)((e,t,n,r)=>{if(r)be.current&&(be.current.left!==t.left||be.current.top!==t.top)&&(ye(t),W(t=>t.map(t=>t.i===e.i&&(t.x!==n.x||t.y!==n.y)?{...t,x:n.x,y:n.y}:t)));else{_e((0,X.jsx)(`div`,{},e.i)),ye(t);let r=Ne.current.filter(t=>t.i!==e.i);W([...r,{...e,x:n.x,y:n.y,static:!1,isDraggable:!0}])}},[]),He=(0,Z.useCallback)((e,t,r)=>{let i=Oe.current;if(!i)return;let{newDroppingPosition:a,calculatedXY:o}=ti({clientX:e,clientY:t,gridElement:i,droppingItem:z,event:r,transformScale:V,cols:k,margin:M,maxRows:j,rowHeight:A,width:n,containerPadding:H});Ve(z,a,o,!!je.current)},[z,V,k,M,j,A,n,H,Ve]),Ue=(0,Z.useCallback)(()=>{let e=Ne.current;if(!e.some(e=>e.i===z.i)){_e(null),K(null),ye(void 0);return}let t=R.compact(e.filter(e=>e.i!==z.i),k);W(t),_e(null),K(null),ye(void 0)},[z.i,k,R]),We=(0,Z.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),ii&&!e.nativeEvent.target?.classList.contains(ri))return!1;let t=ce?ce(e.nativeEvent):T(e);if(t===!1)return J&&Ue(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...z,...a},{newDroppingPosition:s,calculatedXY:c}=ti({clientX:e.clientX,clientY:e.clientY,gridElement:e.currentTarget,droppingItem:o,event:e.nativeEvent,dragOffsetX:r,dragOffsetY:i,transformScale:V,cols:k,margin:M,maxRows:j,rowHeight:A,width:n,containerPadding:H});Ve(o,s,c,!!J)},[J,z,ce,T,Ue,Ve,V,k,M,j,A,n,H]),Ge=(0,Z.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Y.current--,Y.current<0&&(Y.current=0),Y.current===0&&Ue()},[Ue]),Ke=(0,Z.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Y.current++},[]),qe=(0,Z.useCallback)(e=>{let t=Ne.current,n=t.find(e=>e.i===z.i);Ue(),Me.current(t,n,e)},[z.i,Ue]),Je=(0,Z.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Y.current=0,qe(e.nativeEvent)},[qe]);(0,Z.useEffect)(()=>{if(!L||!le)return;let e=Oe.current;if(!e)return;let t=(t,n)=>{let r=document.elementFromPoint(t,n);return r?e.contains(r):!1},n=e=>e instanceof HTMLElement&&e.closest(ue)!==null,r=e=>{let t=e.changedTouches;if(!t||t.length===0)return;let n=Ae.current;if(n===null)return t[0];for(let e=0;e{if(!n(e.target)||Ae.current!==null)return;e.preventDefault();let t=e.changedTouches?.[0];t&&(Ae.current=t.identifier,ke.current=!0)},a=e=>{if(!ke.current)return;e.preventDefault();let n=r(e);n&&(t(n.clientX,n.clientY)?He(n.clientX,n.clientY,e):je.current&&Ue())},o=e=>{if(!ke.current)return;e.preventDefault();let n=r(e);ke.current=!1,Ae.current=null,n&&(t(n.clientX,n.clientY)?qe(e):Ue())},s=()=>{ke.current&&(ke.current=!1,Ae.current=null,Ue())},c={passive:!1};return document.addEventListener(`touchstart`,i,c),document.addEventListener(`touchmove`,a,c),document.addEventListener(`touchend`,o,c),document.addEventListener(`touchcancel`,s,c),()=>{document.removeEventListener(`touchstart`,i,c),document.removeEventListener(`touchmove`,a,c),document.removeEventListener(`touchend`,o,c),document.removeEventListener(`touchcancel`,s,c)}},[L,le,ue,He,Ue,qe,z.i]);let Ye=(0,Z.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=Qt(U,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&N,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&ie,o=r.resizeHandles||[...ae],c=i&&P&&r.isBounded!==!1,u=oe;return(0,X.jsx)(ei,{containerWidth:n,cols:k,margin:M,containerPadding:H,maxRows:j,rowHeight:A,cancel:I,handle:F,onDragStart:Fe,onDrag:Ie,onDragStop:Le,onResizeStart:Re,onResize:ze,onResizeStop:Be,isDraggable:i,isResizable:a,isBounded:c,allowMobileScroll:re,useCSSTransforms:B&&me,usePercentages:!me,transformScale:V,positionStrategy:s,dragThreshold:ne,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?ve:void 0,resizeHandles:o,resizeHandle:u,constraints:l,layoutItem:r,layout:U,children:e},r.i)},[U,n,k,M,H,j,A,I,F,Fe,Ie,Le,Re,ze,Be,N,ie,P,B,me,V,s,ne,ve,ae,oe,l]),Xe=()=>G?(0,X.jsx)(ei,{w:G.w,h:G.h,x:G.x,y:G.y,i:G.i,className:`react-grid-placeholder ${q?`placeholder-resizing`:``}`,containerWidth:n,cols:k,margin:M,containerPadding:H,maxRows:j,rowHeight:A,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:B,transformScale:V,constraints:l,layout:U,children:(0,X.jsx)(`div`,{})}):null,Ze=(0,Z.useCallback)(e=>{Oe.current=e,typeof h==`function`?h(e):h&&`current`in h&&(h.current=e)},[h]),Qe=x(ri,p),$e={height:Pe,...m};return(0,X.jsxs)(`div`,{ref:Ze,className:Qe,style:$e,onDrop:L?Je:void 0,onDragLeave:L?Ge:void 0,onDragEnter:L?Ke:void 0,onDragOver:L?We:void 0,children:[Z.Children.map(t,e=>Z.isValidElement(e)?Ye(e):null),L&&J&&Ye(J,!0),Xe()]})}var ci={lg:1200,md:996,sm:768,xs:480,xxs:0},li={lg:12,md:10,sm:6,xs:4,xxs:2},ui=()=>{};function di(e,t,n,r,i=!1){let a=[];Z.Children.forEach(t,t=>{if(!Z.isValidElement(t)||t.key===null)return;let n=String(t.key),r=t.props[`data-grid`],o=e.find(e=>e.i===n);o?i&&r?a.push({...o,i:n,w:r.w??o.w,h:r.h??o.h,minW:r.minW??o.minW,maxW:r.maxW??o.maxW,minH:r.minH??o.minH,maxH:r.maxH??o.maxH}):a.push({...o,i:n}):r?a.push({i:n,x:r.x??0,y:r.y??0,w:r.w??1,h:r.h??1,minW:r.minW,maxW:r.maxW,minH:r.minH,maxH:r.maxH,static:r.static,isDraggable:r.isDraggable,isResizable:r.isResizable,resizeHandles:r.resizeHandles,isBounded:r.isBounded}):a.push({i:n,x:0,y:Zt(a),w:1,h:1})});let o=an(a,{cols:n});return r.compact(o,n)}function fi(e){let{children:t,width:n,breakpoint:r,breakpoints:i=ci,cols:a=li,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=ui,onLayoutChange:p=ui,onWidthChange:m=ui,...h}=e,g=d??zn(`vertical`),_=g.type,v=g.allowOverlap,y=(0,Z.useMemo)(()=>r??Vn(i,n),[]),b=(0,Z.useMemo)(()=>Hn(y,a),[y,a]),x=(0,Z.useMemo)(()=>Un(o,i,y,y,b,_),[]),[S,C]=(0,Z.useState)(y),[w,T]=(0,Z.useState)(b),[E,D]=(0,Z.useState)(x),[O,ee]=(0,Z.useState)(o),k=(0,Z.useRef)(n),A=(0,Z.useRef)(r),j=(0,Z.useRef)(i),M=(0,Z.useRef)(a),te=(0,Z.useRef)(o),N=(0,Z.useRef)(_),P=(0,Z.useRef)(O);(0,Z.useEffect)(()=>{P.current=O},[O]);let F=(0,Z.useMemo)(()=>(0,Jr.deepEqual)(o,te.current)?null:Un(o,i,S,S,w,g),[o,i,S,w,g]),I=F??E;(0,Z.useEffect)(()=>{F!==null&&(D(F),ee(o),P.current=o,te.current=o)},[F,o]),(0,Z.useEffect)(()=>{if(_!==N.current){let e=g.compact(tn(I),w),t={...P.current,[S]:e};D(e),ee(t),P.current=t,p(e,t),N.current=_}},[_,g,I,w,v,S,p]),(0,Z.useEffect)(()=>{let e=n!==k.current,o=r!==A.current,s=!(0,Jr.deepEqual)(i,j.current),c=!(0,Jr.deepEqual)(a,M.current);if(e||o||s||c){let e=r??Vn(i,n),o=Hn(e,a),d=S;if(d!==e||s||c){let n={...P.current};n[d]||(n[d]=tn(E));let r=Un(n,i,e,d,o,g),a=!n[e];r=di(r,t,o,g,a),n[e]=r,C(e),T(o),D(r),ee(n),P.current=n,f(e,o),p(r,n)}let h=Wn(l,e),_=u?Wn(u,e):null;m(n,h,o,_),k.current=n,A.current=r,j.current=i,M.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let ne=(0,Z.useCallback)(e=>{let t={...P.current,[S]:e};D(e),ee(t),P.current=t,p(e,t)},[S,p]),re=(0,Z.useMemo)(()=>Wn(l,S),[l,S]),ie=(0,Z.useMemo)(()=>u===null?null:Wn(u,S),[u,S]),ae=(0,Z.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:re,containerPadding:ie}),[w,s,c,re,ie]);return(0,X.jsx)(si,{...h,width:n,gridConfig:ae,compactor:g,onLayoutChange:ne,layout:I,children:t})}var pi=Z.forwardRef(function(e,t){let{innerRef:n,...r}=e,i=n??t;return(0,X.jsx)(fi,{...r,innerRef:i})});pi.displayName=`ResponsiveGridLayout`;function mi(e,t,n){if(e.kind===`constant`)return e.value??``;let r=e.kind===`custom`?e.options?.map(e=>({value:e}))??[]:n===null?[]:n,i=t[e.name],a=!e.multi&&Array.isArray(i)&&i.length===0?void 0:i;if(a===`$__all`){if(e.include_all)return jt}else if(a!==void 0){if(e.kind===`text`||r===void 0)return a;let t=new Set(r.map(e=>e.value));if(Array.isArray(a)){if(a.length===0&&e.multi)return[];let n=a.filter(e=>t.has(e));if(n.length>0)return n}else if(t.has(a))return a}return e.default?e.default:e.include_all?jt:r?.[0]?.value??``}var hi=(e,t)=>e.replace(/\$([a-z][a-z0-9_]*)/g,(e,n)=>{let r=t[n];return r===void 0?e:r===`$__all`?`all`:Array.isArray(r)?r.join(`, `):r});function gi(e,t,n){let r={};for(let i of e??[]){let e=mi(i,t,n?.[i.name]);(i.kind!==`query`||e!==``)&&(r[i.name]=e)}return r}function _i(e){return`Explain the panel “${e.title}”`}function vi(e){return`Fix the panel “${e.title}”`}function yi(e){return[{description:`Observed panel diagnostics`,value:JSON.stringify(e)}]}var bi=(0,Z.lazy)(()=>I(()=>import(`./panel-editor-Dx0fP2VL.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),xi=e=>e.panels.map(e=>({i:e.id,x:e.grid?.x??0,y:e.grid?.y??0,w:e.grid?.w??6,h:e.grid?.h??Ft(e)})),Si=0;function Ci(e){let t;do t=`p_${Date.now().toString(36)}_${(++Si).toString(36)}_${Math.random().toString(36).slice(2,10)}`;while(e.some(e=>e.id===t));return t}function wi({dashboardId:e,version:t,spec:n,vars:r,results:i,fetching:a,annotations:o,fetchingIds:s=[],staleAt:l=new Map,time:u=n.time,onEditExit:d,editing:f,view:h,agentAvailable:g,canManage:_=!1,onOpenChat:v,onVariable:y,onRetry:b,onPoint:x,onZoom:S,onZoomReset:C,onWiden:w,zoomed:T,onView:E,onVisible:ee,onRangePending:k,shortcutScope:A,onShortcuts:j,overlayOpen:M,returnViewFocus:te}){let N=U(),[P,F]=(0,Z.useState)(),[I,ne]=(0,Z.useState)(()=>xi(n));(0,Z.useEffect)(()=>{ne(xi(n))},[n]);let re=It(),[oe,L]=(0,Z.useState)(),se=(0,Z.useRef)(null),ce=(0,Z.useRef)(new Map),le=(0,Z.useRef)(null),ue=(0,Z.useRef)(null),R=()=>{let e=P?.panel?.id;F(void 0),requestAnimationFrame(()=>(ue.current?.isConnected?ue.current:ce.current.get(e??``))?.focus())},fe=(0,Z.useRef)(h);h&&(fe.current=h);let[pe,z]=(0,Z.useState)(0),V=pe>0,me=f&&(pe>=1100?`lg`:pe>=800?`md`:`sm`)==`lg`;(0,Z.useLayoutEffect)(()=>{if(!se.current)return;z(Math.max(0,Math.round(se.current.getBoundingClientRect().width)));let e=new ResizeObserver(([e])=>{e&&z(Math.max(0,Math.round(e.contentRect.width)))});return e.observe(se.current),()=>e.disconnect()},[]);let he=(0,Z.useRef)(ee);he.current=ee,(0,Z.useEffect)(()=>{if(!V||!se.current||typeof IntersectionObserver>`u`)return;let e=new Set(n.panels.map(e=>e.id)),t=new IntersectionObserver(t=>{for(let n of t){let t=n.target.dataset.panel;t&&(n.isIntersecting?e.add(t):e.delete(t))}h&&n.panels.some(e=>e.id===h)&&e.add(h),he.current([...e])},{rootMargin:`200px`});return se.current.querySelectorAll(`.react-grid-item[data-panel]`).forEach(e=>t.observe(e)),()=>t.disconnect()},[n,h,V]);let W=(0,Z.useMemo)(()=>n.panels.some(e=>{let t=I.find(t=>t.i===e.id);return t&&(t.x!==e.grid?.x||t.y!==e.grid?.y||t.w!==e.grid?.w||t.h!==e.grid?.h)}),[I,n]),G=e=>({...n,panels:e.map(e=>{let t=I.find(t=>t.i===e.id);return t?{...e,grid:{x:t.x,y:t.y,w:t.w,h:t.h}}:e})}),K=t=>{N.setQueryData(D(e),t)},q=Le({mutationFn:()=>ie(e,G(n.panels),t,`Edited layout`),onSuccess:K}),ge=Le({mutationFn:r=>W?ie(e,G(n.panels.filter(e=>e.id!==r)),t,`Removed a panel and saved layout`):de(e,[{op:`remove_panel`,id:r}],t,`Removed a panel`),onSuccess:K}),J=Le({mutationFn:r=>{let i={...r,id:Ci(n.panels),title:`${Array.from(r.title).slice(0,73).join(``)} (copy)`,grid:void 0};if(W){let a=[...n.panels];return a.splice(a.findIndex(e=>e.id===r.id)+1,0,i),ie(e,G(a),t,`Duplicated a panel and saved layout`)}return de(e,[{op:`add_panel`,after:r.id,panel:i}],t,`Duplicated a panel`)},onSuccess:K}),_e=()=>{q.reset(),ge.reset(),J.reset()};(0,Z.useEffect)(()=>{f||_e()},[f]);let ve=()=>{_e(),d?.(),N.invalidateQueries({queryKey:D(e)})},ye=async e=>{let t=new URL(window.location.href);t.searchParams.set(`view`,e),t.searchParams.delete(`edit`);try{await navigator.clipboard.writeText(t.toString()),L(`Link copied`)}catch{L(`Copy this URL: ${t.toString()}`)}},be=`dashboard-${e}`,xe=n=>({dashboard_id:e,version:t,panel_id:n.id,title:hi(n.title,r),from_ms:i.get(n.id)?.from_ms,to_ms:i.get(n.id)?.to_ms,vars:r,error:i.get(n.id)?.error,status:i.get(n.id)?.status,diagnosis:i.get(n.id)?.diagnosis,stale_since:l.get(n.id),truncated:i.has(n.id)?!!(i.get(n.id)?.frame?.truncated||i.get(n.id)?.previous?.truncated):void 0,note:i.get(n.id)?.frame?.note,spec:{...n,dashboard_time:u}}),Se=(c,d,f=!1)=>(0,X.jsx)(ze,{panel:c,title:hi(c.title,r),result:i.get(c.id),loading:a&&s.includes(c.id),height:d,group:be,editing:me&&!f,agentAvailable:g,suspended:!f&&c.id===h,menuRef:f?le:e=>{e?ce.current.set(c.id,e):ce.current.delete(c.id)},compare:u.compare===`previous_period`,range:c.time?.range??u.range,annotations:o,vars:r,onVariable:y,...Ue(c,i.get(c.id),y,x?e=>x(c,e):void 0),onRangePending:e=>k?.(c.id,e),onZoom:S,zoomed:T,onZoomReset:C,onWiden:w,onRetry:b?()=>b(c.id):void 0,onView:()=>E(c.id),onCopyLink:()=>{ye(c.id)},onEdit:_&&e&&(c.query||typeof c.sql==`string`)?()=>{ue.current=f?le.current:ce.current.get(c.id)??null,F({panel:c,spec:n,version:t})}:void 0,onExplain:g&&e?()=>v(_i(xe(c)),{answer_only:!0,context:yi(xe(c))}):void 0,onFix:g&&e&&_?()=>v(vi(xe(c)),{context:yi(xe(c))}):void 0,staleAt:l.get(c.id),onDuplicate:me&&!f?()=>J.mutate(c):void 0,onRemove:me&&!f?()=>ge.mutate(c.id):void 0}),Ce=n.panels.find(e=>e.id===h),we=f?q.error??ge.error??J.error:null,Te=we instanceof m&&we.code===`dashboard_version_conflict`,Ee=e=>{me&&ne(e.map(({i:e,x:t,y:n,w:r,h:i})=>({i:e,x:t,y:n,w:r,h:i})))};return(0,X.jsxs)(`div`,{ref:se,style:{minWidth:0},children:[f&&(0,X.jsxs)(ae,{justify:`space-between`,mb:`sm`,p:`xs`,style:{border:`1px dashed var(--mantine-color-default-border)`,borderRadius:8},children:[(0,X.jsx)(H,{size:`sm`,c:`dimmed`,children:me?`Drag a panel by its title and resize it from the corner. Changes are saved as a new version.`:`The layout can be edited only on a wider screen.`}),(0,X.jsxs)(ae,{gap:`xs`,children:[_&&e&&(0,X.jsx)(B,{size:`compact-sm`,variant:`default`,onClick:e=>{ue.current=e.currentTarget,F({spec:n,version:t})},children:`Add panel`}),(0,X.jsx)(B,{size:`compact-sm`,disabled:!W||!me,loading:q.isPending,onClick:()=>q.mutate(),children:`Save layout`})]})]}),Te&&(0,X.jsx)(Y,{mb:`sm`,children:(0,X.jsxs)(c,{tone:`warning`,children:[`Someone saved this dashboard since you opened it. Load the latest version, then redo your change. `,(0,X.jsx)(B,{size:`compact-sm`,onClick:ve,children:`Load latest`})]})}),we&&!Te&&(0,X.jsx)(Y,{mb:`sm`,children:(0,X.jsx)(c,{tone:`danger`,children:we.message})}),oe&&(0,X.jsx)(Y,{mb:`sm`,children:(0,X.jsx)(c,{tone:`info`,children:oe})}),!V&&(0,X.jsx)(`div`,{"data-grid-placeholder":!0,style:{height:Mt(Math.max(1,...I.map(e=>e.y+e.h)))}}),V&&(0,X.jsx)(pi,{width:pe,className:`dashboard-grid${me?` dashboard-grid-editing`:``}`,layouts:{lg:I,md:I,sm:I.map(e=>({...e,x:0,w:12}))},breakpoints:{lg:1100,md:800,sm:0},cols:{lg:12,md:12,sm:12},rowHeight:40,margin:[12,12],containerPadding:[0,0],compactor:Nn,dragConfig:{enabled:me,handle:`.panel-drag`,cancel:`button`},resizeConfig:{enabled:me},onDragStop:Ee,onResizeStop:Ee,children:n.panels.map(e=>{let t=I.find(t=>t.i===e.id);return(0,X.jsx)(`div`,{"data-panel":e.id,children:Se(e,Mt(t?.h??6))},e.id)})}),(0,X.jsx)(Ke,{shortcutScope:A,onShortcuts:j,escapeEnabled:!M&&!P,opened:!!h,onClose:()=>E(void 0),title:Ce?hi(Ce.title,r):`Missing panel`,returnFocusTo:()=>te?.(fe.current)??ce.current.get(fe.current??``)??ce.current.values().next().value,children:Ce?(0,X.jsx)(`div`,{style:{height:`calc(100vh - 120px)`},children:Se(Ce,Math.max(40,re-140),!0)}):(0,X.jsx)(Y,{children:(0,X.jsx)(c,{tone:`warning`,children:`This panel is missing from the dashboard. The shared link may be out of date.`})})}),P&&e&&(0,X.jsx)(Z.Suspense,{fallback:(0,X.jsx)(O,{opened:!0,onClose:R,title:`Loading the panel editor`,children:(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading the panel editor`,rows:3})}),children:(0,X.jsx)(bi,{dashboardId:e,version:P.version,spec:G(P.spec.panels),layoutChanged:me&&W,panel:P.panel,time:u,vars:r,onClose:R})})]})}function Ti({spec:e,onClose:t,onCreated:n}){let r=U(),[i,a]=(0,Z.useState)(`${e.name} copy`),[o,s]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(),f=async()=>{s(!0),u(void 0);try{let t=await ee({...e,name:i.trim()});r.invalidateQueries({queryKey:v}),n(t.id)}catch(e){u(e instanceof Error?e.message:`Duplicate failed`)}finally{s(!1)}};return(0,X.jsx)(O,{opened:!0,onClose:()=>{o||t()},title:`Duplicate dashboard`,children:(0,X.jsxs)(K,{gap:`md`,children:[(0,X.jsx)(d,{label:`New dashboard name`,value:i,onChange:e=>a(e.currentTarget.value),"data-autofocus":!0}),l&&(0,X.jsx)(Y,{children:(0,X.jsx)(c,{tone:`danger`,children:l})}),(0,X.jsxs)(ae,{justify:`flex-end`,gap:`xs`,children:[(0,X.jsx)(B,{variant:`default`,disabled:o,onClick:t,children:`Cancel`}),(0,X.jsx)(B,{loading:o,disabled:!i.trim()||i.trim()===e.name,onClick:()=>void f(),children:`Duplicate`})]})]})})}var Ei=(e,t)=>!(t instanceof m&&t.status<500)&&e<2,Di=(e,t)=>!(t instanceof m&&t.code===`timeout`)&&Ei(e,t),Oi=e=>({panels:e.panels.map(({grid:e,...t})=>t),variables:e.variables,time:e.time,annotations:e.annotations});function ki(e,t,n,r,i){return[`panels`,JSON.stringify([e,Oi(t),n,r,i])]}function Ai(e,t,n,r){return[`variables`,e,Oi(t),n,r]}var ji=2;async function Mi(e,t,n,r=[],i=!1){let a=r.filter(t=>e.panels?.includes(t)),o=e.panels?.filter(e=>!a.includes(e)),s=a.length&&!o?.length?[]:await _e(a.length?{...e,panels:o}:e,t,n,i);for(let r=0;re.reason===`busy`))break}let c=new Set(e.dashboard.panels.filter(e=>[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz)).map(e=>e.id)),l=s.filter(e=>c.has(e.id)&&e.from_ms!==void 0&&e.to_ms!==void 0&&e.from_mse.from_ms)),d=Math.max(...l.map(e=>e.to_ms));try{let e=await F({from:new Date(u).toISOString(),to:new Date(d).toISOString()},t);return{results:s,annotations:e}}catch(e){if(t?.aborted)throw e;return{results:s,annotation_error:e instanceof Error?e.message:`Annotations unavailable`}}}var Ni={off:!1,"10s":1e4,"30s":3e4,"1m":6e4,"5m":3e5},Pi=0;function Fi(e,t){let[n,r]=e.queryKey;if(n!==`panels`||typeof r!=`string`)return!1;try{return JSON.parse(r)[0]===t}catch{return!1}}function Ii({dashboardId:e,spec:t,time:n,vars:r,compare:i,widths:a,visible:o,refresh:s,enabled:c=!0}){let l=(0,Z.useMemo)(()=>Object.fromEntries(Object.entries(a).map(([e,t])=>[e,Math.max(100,Math.round(t/100)*100)])),[a]),u=ki(e,t,n,r,i),d=u[1],f=o.filter(e=>t.panels.some(t=>t.id===e)),p=(0,Z.useRef)([]),h=(0,Z.useRef)(new Set),g=(0,Z.useRef)(void 0),_=(0,Z.useRef)(null),v=(0,Z.useRef)(!1),y=(0,Z.useRef)(!1),b=(0,Z.useRef)(null),x=(0,Z.useRef)({key:d,ids:new Set}),[S,C]=(0,Z.useState)({key:d}),[w,T]=(0,Z.useState)({key:d,results:new Map,updated:new Map,stale:new Set,receivedAt:0}),E=f.length===0&&w.key===d&&w.receivedAt>0,D=c&&t.panels.some(e=>e.viz!==`text`),O=P({queryKey:u,queryFn:({signal:e})=>{if(E&&_.current?.key!==d)return p.current=[],Promise.resolve({results:[],hasTimePanels:!1,batch:++Pi});let a=_.current?.key===d?_.current.ids:f;p.current=(a.length?[...a]:t.panels.map(e=>e.id)).sort(),x.current.key!==d&&(x.current={key:d,ids:new Set});for(let e of p.current)x.current.ids.add(e);let o=[...p.current],s=y.current;y.current=!1;let c=h.current=new Set,u=t=>{if(e.aborted)return;c.add(t.id);let n=Date.now(),r=++Pi;T(e=>Li(e,d,[qe(t,o)],n,r))},v=w.key===d?o.filter(e=>w.results.get(e)?.reason===`busy`):[];return Mi({dashboard:t,panels:o,time:n,vars:r,widths:l,compare:i},e,u,v,s).then(e=>{let n=new Set(e.results.map(e=>e.id)),r=o.filter(e=>!n.has(e)&&!v.includes(e)&&t.panels.find(t=>t.id===e)?.viz!==`text`).map(e=>({id:e,status:`error`,elapsed_ms:0,error:`No result was returned for this panel; refresh to retry.`,request_error:o}));return{...e,batch:++Pi,results:[...e.results.map(e=>qe(e,o)),...r],hasTimePanels:t.panels.some(e=>o.includes(e.id)&&[`timeseries`,`heatmap`,`state_timeline`].includes(e.viz))}}).catch(n=>{throw e.aborted||(g.current={key:d,ids:o.filter(e=>!c.has(e)&&t.panels.find(t=>t.id===e)?.viz!==`text`),error:n instanceof Error?n.message:String(n),retryable:!(n instanceof m)||n.status===408||n.status===429||n.status>=500}),n})},retry:Di,enabled:D,refetchInterval:E?!1:Ni[s]??3e4,staleTime:5e3,placeholderData:e=>e}),ee=O.error&&g.current?.key===d?g.current:void 0,k=(0,Z.useMemo)(()=>Li(w,d,O.isPlaceholderData?void 0:O.data?.results,O.dataUpdatedAt,O.data?.batch,ee),[w,d,O.data,O.dataUpdatedAt,O.isPlaceholderData,O.error,O.errorUpdatedAt]),A=k.results,j=O.isPlaceholderData?void 0:O.data?.hasTimePanels?O.data:S.key===d?S:void 0;(0,Z.useEffect)(()=>{!O.isPlaceholderData&&O.data?.hasTimePanels&&C({key:d,annotations:O.data.annotations,annotation_error:O.data.annotation_error})},[d,O.data,O.isPlaceholderData]),(0,Z.useEffect)(()=>{O.isPlaceholderData||T(e=>Li(e,d,O.data?.results,O.dataUpdatedAt,O.data?.batch,ee))},[d,O.data,O.dataUpdatedAt,O.isPlaceholderData,O.error,O.errorUpdatedAt]);let M=new Map([...k.stale].flatMap(e=>{let t=k.updated.get(e);return t?[[e,t]]:[]})),te=(O.data?.results??[]).find(e=>e.status===`error`&&e.reason!==`busy`&&k.stale.has(e.id)),N=(O.data?.results??[]).flatMap(e=>e.reason===`busy`&&k.stale.has(e.id)?[k.updated.get(e.id)??0]:[]),F=Math.max(0,...[...k.updated].filter(([e])=>{let t=k.results.get(e);return t?.reason!==`busy`||t.frame!==void 0}).map(([,e])=>e));(0,Z.useEffect)(()=>{if(x.current.key===d)for(let e of x.current.ids)A.get(e)?.reason===`busy`&&!f.includes(e)&&x.current.ids.delete(e)},[o,d,A]),(0,Z.useEffect)(()=>{if(!D||O.isFetching||v.current||b.current?.key===d||_.current?.key===d)return;let e=x.current.key===d?x.current.ids:new Set,n=[...new Set(f.filter(n=>(!A.has(n)||A.get(n)?.reason===`busy`)&&!e.has(n)&&t.panels.find(e=>e.id===n)?.viz!==`text`))].sort();if(!n.length)return;let r={key:d,ids:n};_.current=r,O.refetch({cancelRefetch:!1}).finally(()=>{_.current===r&&(_.current=null)})},[o,D,d,O.isFetching,O.error,O.refetch,A,t.panels]),(0,Z.useEffect)(()=>{!O.isFetching&&b.current?.key!==d&&v.current&&(v.current=!1,_.current=null,D&&!E&&(y.current=!0,O.refetch({cancelRefetch:!1})))},[O.isFetching,d,D,E,O.refetch]);let I=e=>{let t={key:d,ids:e};_.current=t,O.refetch({cancelRefetch:!1}).finally(()=>{_.current===t&&(_.current=null)})};return(0,Z.useEffect)(()=>{if(O.isFetching||!b.current)return;let e=b.current;if(b.current=null,e.key!==d||!D)return;let n=[...e.ids].filter(e=>t.panels.some(t=>t.id===e&&t.viz!==`text`)&&A.get(e)?.request_error).sort();n.length&&I(n)},[O.isFetching,d,D,A,t.panels]),{retry:e=>{D&&t.panels.some(t=>t.id===e&&t.viz!==`text`)&&A.get(e)?.request_error&&(O.isFetching?(b.current?.key!==d&&(b.current={key:d,ids:new Set}),b.current.ids.add(e)):I([e]))},results:A,staleAt:M,annotations:j?.annotations,annotationError:j?.annotation_error,fetchingIds:O.isFetching?p.current.filter(e=>!h.current.has(e)):[],fetching:O.isFetching,error:O.error??(te?Error(te.error??`Panel refresh failed`):null),updatedAt:F||null,skippedAt:N.length?Math.min(...N):null,refetch:()=>{D&&!E&&(O.isFetching?_.current?.key===d&&(v.current=!0):(y.current=!0,O.refetch({cancelRefetch:!1})))}}}function Li(e,t,n,r,i,a){let o=e.key===t?{key:t,results:new Map(e.results),updated:new Map(e.updated),stale:new Set(e.stale),receivedAt:e.receivedAt,receivedBatch:e.receivedBatch}:{key:t,results:new Map,updated:new Map,stale:new Set,receivedAt:0},s=n&&i!==void 0&&(o.receivedBatch===void 0||i>o.receivedBatch);for(let e of s?n:[])e.status===`error`&&o.results.get(e.id)?.frame?(o.stale.add(e.id),o.results.set(e.id,{...o.results.get(e.id),error:e.error,reason:e.reason,request_error:e.request_error})):(o.results.set(e.id,e),o.updated.set(e.id,r),o.stale.delete(e.id));s&&(o.receivedAt=r,o.receivedBatch=i);for(let e of a?.ids??[]){let t=o.results.get(e);t?.frame?(o.stale.add(e),o.results.set(e,{...t,error:a.error,reason:void 0,request_error:a.retryable?a.ids:void 0})):o.results.set(e,{id:e,status:`error`,elapsed_ms:0,error:a.error,request_error:a.retryable?a.ids:void 0})}return o}function Ri(e,t){return e.queryKey[0]===`variables`&&e.queryKey[1]===t}function zi(e,t,n,r,i,a=!1){let o=!!t.variables?.some(e=>e.kind===`query`),s=P({queryKey:Ai(e,t,n,r),queryFn:async({signal:e})=>{let a=await i({dashboard:t,time:n,vars:r},e);return Object.fromEntries((t.variables??[]).map(e=>[e.name,a[e.name]??(e.kind===`custom`?e.options?.map(e=>({value:e})):void 0)??[]]))},enabled:o,retry:a,staleTime:6e4,placeholderData:e=>e}),c=s.isPlaceholderData?void 0:s.data,l=s.isError||(t.variables??[]).every(e=>e.kind!==`query`||r[e.name]!==void 0&&r[e.name]!==`$__all`&&(e.multi||!Array.isArray(r[e.name])||r[e.name].length>0)||!!e.default||e.include_all||c?.[e.name]!==void 0);return{...s,currentData:c,ready:l}}function Bi(e){return t=>Fi(t,e)||Ri(t,`dashboard-${e}`)}function Vi({id:e,currentVersion:t,currentSpec:n,opened:i,onClose:a,onRestored:o}){let s=U(),[c,l]=(0,Z.useState)(),[u,d]=(0,Z.useState)(),[f,p]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(i),_=(0,Z.useRef)(0),y=(0,Z.useRef)(i);y.current=i;let b=(0,Z.useRef)(!1),x=(0,Z.useRef)(!1),S=(0,Z.useRef)(o);S.current=o,(0,Z.useEffect)(()=>(x.current=!0,()=>{x.current=!1}),[]);let C=Le({mutationFn:({version:t})=>oe(e,t),retry:!1,onSuccess:(t,{version:n,generation:r})=>{s.cancelQueries({queryKey:D(e),exact:!0}),s.cancelQueries({predicate:Bi(e)}),s.cancelQueries({queryKey:[`exemplars`]}),s.cancelQueries({queryKey:[`drill-trace`]}),s.setQueryData(D(e),t),s.invalidateQueries({predicate:Bi(e),refetchType:`none`}),x.current&&(y.current&&r===_.current&&d({text:`Restored v${n} as v${t.version}`}),S.current(t)),s.invalidateQueries({queryKey:v}),s.invalidateQueries({queryKey:A(e)},{cancelRefetch:!1}),s.invalidateQueries({queryKey:[`exemplars`],refetchType:`none`}),s.invalidateQueries({queryKey:[`drill-trace`],refetchType:`none`})},onError:t=>{t instanceof m&&t.code===`dashboard_version_not_found`&&s.invalidateQueries({queryKey:A(e)})},onSettled:()=>{b.current=!1,x.current&&p(!1)}}),w=()=>{_.current++,C.reset(),d(void 0)};(0,Z.useEffect)(()=>{i?g(!0):(_.current++,C.reset(),d(void 0),s.cancelQueries({queryKey:A(e)}),s.cancelQueries({queryKey:[`dashboard-version`,e]}))},[i,e,s,C.reset]);let T=(0,Z.useRef)(t);return(0,Z.useEffect)(()=>{T.current!==t&&(T.current=t,s.invalidateQueries({queryKey:A(e)},{cancelRefetch:!1}))},[t,e,s]),(0,X.jsx)(r,{opened:i,onClose:()=>{w(),a()},onExitTransitionEnd:()=>g(!1),title:`Version history`,position:`right`,size:`xl`,children:(i||h)&&(0,X.jsx)(Hi,{id:e,opened:i,currentVersion:t,currentSpec:n,selected:c,onSelect:e=>{w(),l(e)},pending:f,error:C.error,failedVersion:C.variables?.version,success:u,onRestore:e=>{b.current||(b.current=!0,p(!0),d(void 0),C.mutate({version:e,generation:_.current}))}})})}function Hi({id:e,opened:t,currentVersion:n,currentSpec:r,selected:i,onSelect:a,pending:o,error:s,failedVersion:l,success:u,onRestore:d}){let f=P({queryKey:A(e),queryFn:({signal:t})=>ge(e,t),enabled:t,retry:!1}),h=i??f.data?.[0]?.version,g=P({queryKey:[`dashboard-version`,e,h],queryFn:({signal:t})=>be(e,h,t),enabled:t&&h!==void 0,retry:!1}),_=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{u&&_.current?.focus()},[u]),(0,X.jsxs)(K,{gap:`md`,"data-version-history":!0,children:[(0,X.jsx)(H,{size:`sm`,c:`dimmed`,children:`Inspect saved specs and changes. Restoring adds a new version.`}),u&&(0,X.jsx)(Y,{ref:_,tabIndex:-1,role:`note`,children:(0,X.jsx)(c,{live:!1,tone:`success`,children:u.text})}),s&&l===h&&(0,X.jsx)(Ki,{error:s,version:h}),(0,X.jsxs)(Y,{mih:160,children:[f.isPending&&(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading history…`,rows:3}),f.error&&(0,X.jsx)(Y,{children:(0,X.jsxs)(c,{tone:`danger`,title:`History unavailable`,children:[f.error.message,(0,X.jsx)(B,{mt:`xs`,variant:`default`,size:`xs`,onClick:()=>void f.refetch(),children:`Retry history`})]})}),f.data?.length===0&&(0,X.jsx)(p,{state:`empty`,empty:{title:`No versions available.`,description:`Version history appears after a dashboard is saved.`,action:(0,X.jsx)(B,{variant:`default`,onClick:()=>void f.refetch(),children:`Retry history`})}}),!!f.data?.length&&(0,X.jsx)(ne,{h:200,type:`auto`,children:(0,X.jsx)(K,{gap:`xs`,pr:`sm`,role:`list`,"aria-label":`Saved versions`,children:f.data.map(e=>(0,X.jsxs)(M,{role:`listitem`,withBorder:!0,p:`xs`,radius:`sm`,style:{borderColor:h===e.version?`var(--mantine-color-accent-filled)`:void 0},children:[(0,X.jsxs)(ae,{justify:`space-between`,gap:`xs`,children:[(0,X.jsxs)(B,{color:`accent`,variant:h===e.version?`light`:`subtle`,size:`compact-sm`,"aria-pressed":h===e.version,onClick:()=>a(e.version),children:[`Version `,e.version]}),e.version===n&&(0,X.jsx)(q,{tone:`neutral`,children:`Current`}),(0,X.jsx)(Wi,{at:e.created_at})]}),(0,X.jsxs)(H,{size:`xs`,c:`dimmed`,mt:4,children:[Ui(e),` · `,e.message||`No edit message`]})]},e.version))})})]}),(0,X.jsx)(Ce,{role:`status`,"aria-live":`polite`,children:h===void 0?`Select a version.`:g.isFetching?`Loading version ${h}…`:g.error?`Version ${h} unavailable.`:`Version ${h} ready.`}),(0,X.jsxs)(Y,{mih:280,"aria-busy":g.isFetching,children:[h!==void 0&&g.isPending&&(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading version…`,rows:3}),g.error&&(0,X.jsx)(Y,{children:(0,X.jsxs)(c,{tone:`danger`,title:g.error instanceof m&&g.error.code===`dashboard_version_not_found`?`This version is no longer available`:`Version unavailable`,children:[g.error.message,(0,X.jsx)(B,{mt:`xs`,variant:`default`,size:`xs`,onClick:()=>void g.refetch(),children:`Retry version`})]})}),g.data&&!g.error&&(0,X.jsx)(Gi,{record:g.data,currentVersion:n,current:JSON.stringify(g.data.dashboard.spec)===JSON.stringify(r),pending:o,onRestore:()=>d(g.data.dashboard.version)})]})]})}function Ui(e){return e.author_kind===`agent`?`Agent`:e.author_kind===`user`?`You`:`System`}function Wi({at:e}){let t=(Date.parse(e)-Date.now())/1e3,[n,r]=Math.abs(t)<60?[1,`second`]:Math.abs(t)<3600?[60,`minute`]:Math.abs(t)<86400?[3600,`hour`]:[86400,`day`];return(0,X.jsx)(H,{component:`time`,dateTime:e,title:h(e),size:`xs`,c:`dimmed`,children:new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}).format(Math.round(t/n),r)})}function Gi({record:e,currentVersion:t,current:n,pending:r,onRestore:i}){let{dashboard:a}=e,s=te(e);return(0,X.jsxs)(K,{gap:`sm`,"data-history-version":a.version,children:[(0,X.jsxs)(ae,{justify:`space-between`,align:`flex-start`,children:[(0,X.jsxs)(Y,{miw:0,children:[(0,X.jsxs)(o,{order:2,fz:`lg`,children:[a.name,` · v`,a.version]}),(0,X.jsxs)(H,{size:`sm`,c:`dimmed`,children:[Ui(e),` · `,e.message||`No edit message`]}),(0,X.jsx)(Wi,{at:e.created_at})]}),a.version===t?(0,X.jsx)(B,{size:`sm`,variant:`default`,disabled:!0,children:`Current version`}):n?(0,X.jsx)(B,{size:`sm`,variant:`default`,disabled:!0,children:`Same as current`}):(0,X.jsxs)(B,{size:`sm`,disabled:r,loading:r,onClick:i,children:[`Restore version `,a.version]})]}),a.description&&(0,X.jsx)(H,{size:`sm`,children:a.description}),e.changes_available?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ze,{labels:s}),!s.length&&!e.layout_changed&&(0,X.jsx)(p,{state:`empty`,empty:{title:`No authored changes.`}})]}):(0,X.jsx)(Y,{children:(0,X.jsx)(c,{tone:`warning`,title:`Changes unavailable`,children:`The preceding version is no longer retained. This saved spec is still available.`})}),(0,X.jsxs)(H,{size:`sm`,c:`dimmed`,children:[`Read-only · `,a.spec.panels.length,` panels. Historical data is not queried.`]}),(0,X.jsxs)(ct,{variant:`contained`,children:[(0,X.jsxs)(ct.Item,{value:`spec`,children:[(0,X.jsx)(ct.Control,{children:`Spec`}),(0,X.jsx)(ct.Panel,{children:(0,X.jsx)(L,{block:!0,tabIndex:0,style:{maxHeight:320,overflow:`auto`},children:JSON.stringify(a.spec,null,2)})})]}),(0,X.jsxs)(ct.Item,{value:`data`,children:[(0,X.jsx)(ct.Control,{children:`Data`}),(0,X.jsx)(ct.Panel,{children:(0,X.jsx)(K,{gap:`xs`,children:a.spec.panels.map(e=>(0,X.jsxs)(Y,{children:[(0,X.jsxs)(H,{size:`sm`,fw:500,children:[e.title,` · `,e.viz]}),(0,X.jsx)(L,{block:!0,tabIndex:0,children:e.content??e.sql??JSON.stringify(e.query??{},null,2)})]},e.id))})})]})]})]})}function Ki({error:e,version:t}){let n=e instanceof m?e.code:void 0,r=!(e instanceof m)||e.status>=500?`Try again with the restore button.`:n===`invalid_spec`?`This saved spec is invalid. Review the fields below and choose another version.`:n===`dashboard_version_not_found`?`Reload history and choose a retained version.`:n===`already_current`?`The dashboard already has this version's contents, so there is nothing to restore.`:[`dashboard_version_conflict`,`conflict`].includes(n??``)?`This dashboard changed or its name conflicts. Reload history and choose another version.`:`Check your access and reload history.`;return(0,X.jsx)(Y,{children:(0,X.jsxs)(c,{tone:`danger`,title:`Restore of version ${t} failed`,children:[(0,X.jsx)(H,{size:`sm`,children:e.message}),e instanceof m&&e.problems.length>0&&(0,X.jsx)(`ul`,{children:e.problems.map((e,t)=>(0,X.jsxs)(`li`,{children:[e.path,`: `,e.message,e.hint?` (${e.hint})`:``]},t))}),(0,X.jsx)(H,{size:`sm`,mt:`xs`,children:r})]})})}function qi(e,t){let n=JSON.stringify([e.range,e.from,e.to]),r=(0,Z.useRef)({search:e,onSearch:t,scope:n}),i=(0,Z.useRef)(``),a=(0,Z.useRef)(void 0),[o,s]=(0,Z.useState)(!1);r.current.scope!==n&&(i.current!==`${e.from}/${e.to}`&&(a.current=void 0,o&&s(!1)),i.current=``),r.current={search:e,onSearch:t,scope:n};let c=(0,Z.useCallback)(()=>{i.current=``,a.current=void 0,s(!1)},[]),l=(0,Z.useCallback)(()=>{if(!a.current)return;let e=a.current;c(),r.current.onSearch({...r.current.search,...e},!1)},[c]);return{zoom:(0,Z.useCallback)((e,t)=>{let n=Je(e,t);if(!n)return;let o=r.current,c=`${n.from}/${n.to}`;o.search.from===n.from&&o.search.to===n.to||i.current===c||(a.current??={range:o.search.range,from:o.search.from,to:o.search.to},s(!0),i.current=c,o.onSearch({...o.search,range:void 0,...n},!1))},[]),reset:c,resetZoom:l,zoomed:o}}function Ji({variables:e,vars:t,options:n,onChange:r}){return e.length===0?null:(0,X.jsx)(ae,{gap:`sm`,wrap:`wrap`,role:`group`,"aria-label":`Dashboard variables`,children:e.map(e=>{let i=mi(e,t,n[e.name]),a=[...e.include_all?[{value:jt,label:`All`}]:[],...(n[e.name]??e.options?.map(e=>({value:e}))??[]).map(e=>({value:e.value,label:e.value}))],o=(0,X.jsxs)(H,{size:`sm`,c:`dimmed`,ff:`monospace`,children:[`$`,e.name]});return e.kind===`constant`?(0,X.jsx)(d,{label:o,size:`sm`,value:e.value,readOnly:!0,w:160},e.name):e.kind===`text`?(0,X.jsx)(d,{label:o,size:`sm`,w:200,defaultValue:typeof i==`string`?i:``,onBlur:t=>r(e.name,t.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.name}:${JSON.stringify(i)}`):e.multi?(0,X.jsx)(kt,{label:o,size:`sm`,w:260,searchable:!0,clearable:!0,data:a.filter(e=>e.value!==jt),value:Array.isArray(i)?i:i&&i!==`$__all`?[i]:[],placeholder:e.include_all?`All`:`None`,onChange:t=>r(e.name,t.length?t:e.include_all?jt:[])},e.name):(0,X.jsx)(We,{label:o,size:`sm`,w:220,searchable:!0,allowDeselect:!1,data:a,value:Array.isArray(i)?i[0]??null:i||null,onChange:t=>t!==null&&r(e.name,t)},e.name)})})}function Yi(e,t,n=!1){let r=e.target;return t||e.defaultPrevented||e.repeat||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey&&e.key!==`?`||r instanceof Element&&r.closest(`input,textarea,select,[contenteditable]:not([contenteditable="false"]),[role="textbox"],[role="menu"]`)||r instanceof Element&&r.closest(`[role="dialog"]`)&&!(n&&r.closest(`[data-panel-fullscreen]`))?null:[`r`,`e`,`h`,`f`,`?`].includes(e.key)?e.key:null}function Xi(e,t,n={}){let r=(0,Z.useRef)({actions:t,options:n});r.current={actions:t,options:n},(0,Z.useEffect)(()=>{let t=t=>{let n=e.current,i=t.target,{actions:a,options:o}=r.current;if(!n||!(i instanceof Element)||o.enabled===!1)return;let s=o.fullscreenScope?[...document.querySelectorAll(`[data-shortcut-scope]`)].find(e=>e.dataset.shortcutScope===o.fullscreenScope&&e.hasAttribute(`data-panel-fullscreen`)):void 0,c=n.contains(i)&&n.contains(document.activeElement),l=i===document.body&&document.activeElement===document.body,u=s?.contains(i)&&s.contains(document.activeElement);if(!c&&!l&&!u)return;let d=Yi(t,!!(o.modalOpen||[...document.querySelectorAll(`[role="dialog"]`)].some(e=>e!==s)),!!s);if(!d||s&&![`r`,`f`,`?`].includes(d))return;let f=a[d];f&&(t.preventDefault(),f(i))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function Zi({opened:e,onClose:t,fullscreen:n=!1,enabled:r,onEnabled:i}){let a=[[`r`,`Refresh now`],...n?[]:[[`e`,`Toggle layout mode`],[`h`,`Open history`]],[`f`,n?`Exit full-screen`:`Open the focused panel in full-screen`],[`?`,`Open keyboard shortcuts`],[`Escape`,`Cancel a range, then leave the chart or close full-screen`]];return(0,X.jsx)(O,{opened:e,onClose:t,title:`Keyboard shortcuts`,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,children:(0,X.jsxs)(K,{gap:`xs`,children:[(0,X.jsx)(Me,{label:`Single-key shortcuts`,checked:r,onChange:e=>i(e.currentTarget.checked)}),a.map(([e,t])=>(0,X.jsxs)(ae,{gap:`sm`,children:[(0,X.jsx)(y,{children:e}),(0,X.jsx)(H,{size:`sm`,children:t})]},e)),!n&&(0,X.jsx)(H,{size:`sm`,children:`Focus a chart or a panel control before pressing f. Without a focused panel, f does nothing.`}),(0,X.jsx)(H,{size:`sm`,children:`Tab directly to a chart. Left/Right moves between points; Up/Down changes series at the same time or category. Home/End jumps to the first/last point. Enter drills or applies the panel filter. Comparison and Other values can be read even when selection is unavailable.`}),(0,X.jsx)(H,{size:`sm`,children:`On time charts, Shift+Left/Right extends a range and pauses auto-refresh. Review the shaded range and compact UTC label, then choose Zoom to range. Use the time picker after zooming for precise edits. Escape or Cancel cancels it and resumes refresh. The next Escape leaves the chart or closes full-screen. Reset zoom, Zoom out and browser Back preserve comparison and filters.`}),(0,X.jsxs)(H,{size:`sm`,children:[n?`In full-screen, r refreshes, f exits and ? opens help; e and h are inactive.`:`Shortcuts work in the dashboard.`,` Typing, menus and other dialogs or drawers pause shortcuts. Modifier shortcuts keep their browser behavior. Turning off single-key shortcuts keeps chart navigation and visible controls available.`]}),(0,X.jsx)(H,{size:`sm`,children:`The global / shortcut focuses the chat composer.`})]})})}function Qi(e){let t=`pitot:single-key-shortcuts:`+e,n=()=>{try{return localStorage.getItem(t)!==`off`}catch{return!0}},[r,i]=(0,Z.useState)(n);return(0,Z.useEffect)(()=>{i(n())},[t]),(0,Z.useEffect)(()=>{let e=e=>{e.key===t&&i(n())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[t]),{enabled:r,change:e=>{i(e);try{localStorage.setItem(t,e?`on`:`off`)}catch{}}}}function $i(e){let t=(0,Z.useRef)(void 0),n=t=>[...e.current?.querySelectorAll(`[data-panel]`)??[]].find(e=>e.dataset.panel===t&&!e.closest(`[data-panel-fullscreen],[data-fragment-fullscreen]`));return(0,Z.useEffect)(()=>{t.current&&!n(t.current.panel)&&(t.current=void 0)}),{remember(n){t.current=void 0;let r=document.activeElement;if(!(r instanceof HTMLElement)||!e.current?.contains(r)||r.closest(`[data-panel]`)?.dataset.panel!==n)return;let i=r.getAttribute(`data-panel-view`),a=r.getAttribute(`aria-label`),o=r.hasAttribute(`data-chart-plot`)?`[data-chart-plot]`:i?`[data-panel-view=${JSON.stringify(i)}]`:a?`[aria-label=${JSON.stringify(a)}]`:void 0;t.current={element:r,panel:n,selector:o}},restore(e){let r=t.current;if(t.current=void 0,r&&(e===void 0||r.panel===e)&&n(r.panel))return r.element.isConnected&&!r.element.closest(`[hidden]`)?r.element:r.selector?n(r.panel)?.querySelector(r.selector)??void 0:void 0}}}var ea=(0,Z.lazy)(()=>I(()=>import(`./new-dashboard-CFDZmvBm.js`).then(e=>({default:e.NewDashboard})),__vite__mapDeps([14,1,2,3,11,8,5,6,7,9,10,4,12,13]))),ta={exemplars:me,trace:se,span:He},na={"5m":`15m`,"15m":`1h`,"1h":`3h`,"3h":`6h`,"6h":`12h`,"12h":`24h`,"24h":`2d`,"2d":`7d`,"7d":`30d`,"30d":`30d`};function ra({dashboardId:e,search:t,onSearch:r,onOpen:i}){let{agentAvailable:a,openChat:s}=ue(),[c,l]=(0,Z.useState)(!1),d=P({queryKey:v,queryFn:V,staleTime:15e3});(0,Z.useEffect)(()=>{!e&&d.data?.length&&i((d.data.find(e=>e.is_default)??d.data[0]).id,!0)},[e,d.data]);let f=P({queryKey:D(e),queryFn:({signal:t})=>n(e,t),enabled:!!e,retry:(e,t)=>!(t instanceof m&&t.code===`not_found`)&&e<2});return!e&&d.error?(0,X.jsxs)(K,{p:`lg`,children:[(0,X.jsx)(u,{title:`Dashboards`,description:`Monitor your services and investigate changes.`}),(0,X.jsx)(p,{state:`error`,error:{title:`Dashboards could not be loaded`,message:d.error.message,onRetry:()=>void d.refetch()}})]}):!e&&d.data?.length===0?(0,X.jsx)(ye,{mih:`50vh`,children:(0,X.jsxs)(K,{align:`center`,gap:`xs`,children:[(0,X.jsx)(u,{title:`Dashboards`,description:`Create a dashboard to explore your services.`}),(0,X.jsx)(p,{state:`empty`,empty:{title:(0,X.jsx)(o,{order:2,fz:`lg`,children:`No dashboards yet`}),description:`Create a dashboard to see your telemetry.`,action:(0,X.jsx)(B,{size:`sm`,onClick:()=>l(!0),children:`New dashboard`})}}),(0,X.jsx)(ae,{mt:`sm`,gap:`xs`,children:a&&(0,X.jsx)(B,{size:`sm`,variant:`default`,onClick:()=>s(`Build me a dashboard for my services, showing request volume, latency, and errors. Ask me which services to monitor first.`),children:`Create with AI`})}),c&&(0,X.jsx)(Z.Suspense,{fallback:null,children:(0,X.jsx)(ea,{onClose:()=>l(!1),onCreated:e=>{l(!1),i(e)}})})]})}):!e||f.isLoading?(0,X.jsx)(Y,{component:`section`,"aria-label":`Dashboard`,maw:1600,mx:`auto`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,children:(0,X.jsx)(p,{state:`loading`,loadingLabel:`Loading dashboard`,skeleton:(0,X.jsx)(Lt,{})})}):f.error instanceof m&&f.error.code===`not_found`?(0,X.jsx)(ye,{mih:`50vh`,children:(0,X.jsxs)(K,{align:`center`,gap:`xs`,children:[(0,X.jsx)(u,{title:`Dashboard`,description:`Monitor your services and investigate changes.`}),(0,X.jsx)(p,{state:`empty`,empty:{title:(0,X.jsx)(o,{order:2,fz:`lg`,children:`This dashboard isn't here`}),description:`The link may be out of date, or the dashboard may have been deleted.`,action:d.data?.length?(0,X.jsx)(B,{variant:`default`,size:`sm`,onClick:()=>i((d.data.find(e=>e.is_default)??d.data[0]).id,!0),children:`Open your default dashboard`}):void 0}})]})}):f.error||!f.data?(0,X.jsxs)(K,{p:`lg`,children:[(0,X.jsx)(u,{title:`Dashboard`,description:`Monitor your services and investigate changes.`}),(0,X.jsx)(p,{state:`error`,error:{message:`Your dashboard is unavailable.`,onRetry:()=>void f.refetch()}})]}):(0,X.jsx)(ia,{id:f.data.id,version:f.data.version,spec:f.data.spec,search:t,onSearch:r,onOpen:i,agentAvailable:a,openChat:s},f.data.id)}function ia({id:e,version:t,spec:n,search:r,onSearch:i,onOpen:a,agentAvailable:o,openChat:s}){let[l,d]=(0,Z.useState)(!1),[f,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(!1);G((0,Z.useCallback)(()=>_(!0),[]));let v=(0,Z.useRef)(null),y=(0,Z.useId)(),b=Qi(w().id),x=$i(v),[S,C]=(0,Z.useState)(()=>new Set),T=(0,Z.useCallback)((e,t)=>C(n=>{if(n.has(e)===t)return n;let r=new Set(n);return t?r.add(e):r.delete(e),r}),[]),D=U(),[O,ee]=(0,Z.useState)(),{zoom:A,reset:j,resetZoom:M,zoomed:te}=qi(r,i),N=he(n,r),[P,F]=(0,Z.useState)(N.refresh??`30s`),I=()=>{if(N.from&&N.to){let e=Date.parse(N.from),t=Date.parse(N.to),n=(t-e)/2;i({...r,range:void 0,from:new Date(e-n).toISOString(),to:new Date(t+n).toISOString()})}else i({...r,range:na[N.range??`1h`]??`1h`,from:void 0,to:void 0})},ne=r.compare?r.compare===`1`:n.time.compare===`previous_period`,re=r.vars??{},ie=zi(`dashboard-${e}`,n,N,re,Se,Ei),oe=(0,Z.useMemo)(()=>gi(n.variables,re,ie.currentData),[n.variables,re,ie.currentData]),[L,se]=(0,Z.useState)(()=>window.innerWidth);(0,Z.useEffect)(()=>{let e=0,t=()=>{window.clearTimeout(e),e=window.setTimeout(()=>se(window.innerWidth),300)};return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t),window.clearTimeout(e)}},[]);let ce=(0,Z.useMemo)(()=>{let e=Math.max(320,Math.min(L-64,1600));return Object.fromEntries(n.panels.map(t=>[t.id,e/12*(t.grid?.w??t.width??6)]))},[L,n]),[le,ue]=(0,Z.useState)(()=>n.panels.map(e=>e.id)),R=Ii({dashboardId:e,version:t,spec:n,time:N,vars:oe,compare:ne,widths:ce,visible:(0,Z.useMemo)(()=>le.filter(e=>n.panels.some(t=>t.id===e)),[le,n.panels]),refresh:S.size?`off`:P,enabled:ie.ready});(0,Z.useEffect)(()=>{O===t&&D.refetchQueries({predicate:Bi(e),type:`active`,stale:!0},{cancelRefetch:!1})},[O,t,e,D]);let de=(0,Z.useMemo)(()=>R.annotations?{...R.annotations,deploys:n.annotations?.deploys===!1?[]:R.annotations.deploys,anomalies:n.annotations?.anomalies===!1?[]:R.annotations.anomalies}:void 0,[R.annotations,n.annotations?.deploys,n.annotations?.anomalies]),fe=ie.error??R.error,pe=(e,t)=>{let n={...re};t===void 0?delete n[e]:n[e]=t,i({...r,vars:n},!0)},z=()=>i({...r,edit:r.edit===`1`?void 0:`1`}),V=e=>{e&&x.remember(e),i({...r,view:e},e===void 0)};return Xi(v,{r:()=>R.refetch(),e:z,h:()=>h(!0),"?":()=>_(!0),f:e=>{if(r.view){V();return}let t=e.closest(`[data-panel]`)?.dataset.panel;t&&n.panels.some(e=>e.id===t)&&V(t)}},{modalOpen:f||g||!!r.drill,fullscreenScope:r.view?y:void 0,enabled:b.enabled}),(0,X.jsxs)(Y,{component:`section`,ref:v,"aria-label":`Dashboard`,maw:1600,mx:`auto`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,children:[(0,X.jsxs)(K,{gap:`sm`,mb:`md`,children:[(0,X.jsx)(u,{title:n.name,description:n.description||`Monitor your services and investigate changes.`,meta:(0,X.jsx)(Ie,{time:N,updatedAt:R.updatedAt}),actions:(0,X.jsx)(ae,{gap:`xs`,children:(0,X.jsx)(k,{label:`Duplicate dashboard`,children:(0,X.jsx)(W,{variant:`subtle`,color:`gray`,"aria-label":`Duplicate dashboard`,onClick:()=>d(!0),children:(0,X.jsx)(E,{size:16})})})})}),(0,X.jsx)(Ge,{selecting:S.size>0,time:N,refresh:P,compare:ne,editing:r.edit===`1`,fetching:R.fetching,updatedAt:R.updatedAt,onRange:e=>{j(),i({...r,range:e,from:void 0,to:void 0})},onAbsolute:(e,t)=>{j(),i({...r,range:void 0,from:e,to:t})},onZoomOut:I,onRefresh:F,onRefreshNow:R.refetch,onCompare:e=>i({...r,compare:e?`1`:`0`},!0),onEdit:z,onHistory:()=>h(!0)}),(0,X.jsx)(Ji,{variables:n.variables??[],vars:re,options:ie.data??{},onChange:pe}),Object.entries(re).filter(([,e])=>e!==`$__all`).length>0&&(0,X.jsx)(ae,{gap:6,children:Object.entries(re).filter(([,e])=>e!==`$__all`).map(([e,t])=>(0,X.jsxs)(B,{color:`accent`,size:`compact-xs`,variant:`light`,"aria-label":`$${e} = ${Array.isArray(t)?t.join(`, `):t} ×: remove filter`,onClick:()=>pe(e,void 0),children:[`$`,e,` = `,Array.isArray(t)?t.join(`, `):t,` ×`]},e))}),R.annotationError&&(0,X.jsx)(c,{tone:`warning`,title:`Annotations unavailable`,children:R.annotationError}),R.annotations?.truncated&&(0,X.jsx)(c,{tone:`warning`,children:`Annotation history is limited.`})]}),!fe&&R.skippedAt!==null&&(0,X.jsx)(Y,{"data-refresh-skipped":!0,children:(0,X.jsxs)(c,{tone:`info`,children:[`The server was busy, so the latest refresh was skipped. Marked panels show data from `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,second:`2-digit`}).format(R.skippedAt),`.`]})}),fe&&(0,X.jsxs)(c,{tone:`danger`,title:ie.error?`Variables could not be loaded`:`Panels could not be loaded`,children:[fe.message,fe instanceof m&&(0,X.jsx)(`ul`,{children:fe.problems.map((e,t)=>(0,X.jsxs)(`li`,{children:[e.path,`: `,e.message,e.hint?` (${e.hint})`:``]},t))})]}),n.panels.length===0&&(0,X.jsx)(p,{state:`empty`,empty:{title:`No panels yet`,description:`Add a panel to see telemetry on this dashboard.`,action:(0,X.jsx)(B,{onClick:()=>i({...r,edit:`1`}),children:`Add panel`})}}),(0,X.jsx)(wi,{dashboardId:e,version:t,spec:n,vars:oe,results:R.results,annotations:de,fetching:R.fetching,fetchingIds:R.fetchingIds,staleAt:R.staleAt,time:{...N,compare:ne?`previous_period`:void 0},onEditExit:()=>i({...r,edit:void 0}),editing:r.edit===`1`,view:r.view,canManage:!0,agentAvailable:o,onOpenChat:s,onRetry:R.retry,onVariable:pe,onZoom:A,zoomed:te,onZoomReset:M,onWiden:I,onView:V,onRangePending:T,shortcutScope:y,onShortcuts:()=>_(!0),overlayOpen:f||g||!!r.drill,returnViewFocus:x.restore,onVisible:ue,onPoint:(e,t)=>{let n=Be(e,R.results.get(e.id),t,re);n&&i({...r,vars:n.vars,drill:JSON.stringify(n.target)},!1)}}),(0,X.jsx)(Ye,{client:ta,spec:n,time:N,vars:oe,target:we(r.drill),onChange:e=>i({...r,drill:e?JSON.stringify(e):void 0},!1)}),l&&(0,X.jsx)(Ti,{spec:n,onClose:()=>d(!1),onCreated:e=>{d(!1),a(e)}}),(0,X.jsx)(Vi,{id:e,currentVersion:t,currentSpec:n,opened:f,onClose:()=>h(!1),onRestored:e=>{ee(e.version);let t=new Set(e.spec.panels.map(e=>e.id)),n=we(r.drill),a=r.view&&!t.has(r.view)?void 0:r.view,o=n&&!t.has(n.panel_id)?void 0:r.drill;(a!==r.view||o!==r.drill)&&i({...r,view:a,drill:o},!0)}}),(0,X.jsx)(Zi,{opened:g,onClose:()=>_(!1),fullscreen:!!r.view,enabled:b.enabled,onEnabled:b.change})]})}export{jt as n,ra as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/page-D9GXhDXQ.js b/internal/ui/dist/assets/page-TqwEGxR8.js similarity index 99% rename from internal/ui/dist/assets/page-D9GXhDXQ.js rename to internal/ui/dist/assets/page-TqwEGxR8.js index 1f75e754..37627fd8 100644 --- a/internal/ui/dist/assets/page-D9GXhDXQ.js +++ b/internal/ui/dist/assets/page-TqwEGxR8.js @@ -1,2 +1,2 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{t}from"./live-data-meta-CGsP1XrP.js";import{Gt as n,Jt as r,Kn as i,Lt as a,Yn as o,an as s,c,d as l,dr as u,ft as d,gi as f,mi as p,nn as m,nr as h,or as g,pr as _,qn as v,rr as y,st as ee,u as te,wr as b,y as ne,zt as re}from"./index-CL2Ww4um.js";import{a as x,c as ie,h as ae,m as S,p as C,r as oe,t as se,u as ce}from"./toolbar-BxU8wfSr.js";import{A as le,B as w,C as ue,D as de,E as T,F as E,H as fe,I as D,L as O,M as pe,N as k,O as A,P as me,R as he,S as ge,T as _e,U as j,V as ve,W as ye,_ as M,a as be,b as xe,c as Se,d as Ce,f as we,g as Te,h as Ee,i as De,j as Oe,k as ke,l as Ae,m as N,n as je,o as Me,p as P,s as Ne,t as Pe,u as F,v as Fe,w as Ie,x as Le,y as Re,z as ze}from"./save-dialog-CVDkqzuX.js";import{t as Be}from"./NumberInput-DMNGxCQ3.js";var I=e(f(),1),L=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new Ve(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new He(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;rt&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}},Ve=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},He=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Ue=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function R(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var We=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Ge=new We,Ke=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=Ge,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nt.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ge,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},z=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;V(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;var B=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?R(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(V(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};B.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;var qe=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function V(e,t,n,r,i,a){let o=0,s=1<0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||Je(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535)o=e[n+u*3-1];else{for(;l>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r=c)l=i+1;else{o=e[a+2],t.advance();continue e}}break}}}function H(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function Je(e,t,n,r){let i=H(n,r,t);return i<0||H(n,r,e)t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var Xe=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ye(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ye(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(i instanceof E){let n=a>this.lastRepeatPos&&i.type.id>=this.minRepeat;if(a==e||n){let t=a+i.length,r;if(a>=this.safeFrom&&t<=this.safeTo&&(!(r=i.prop(Oe.lookAhead))||t+r=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},Ze=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new We)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;rl.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new We,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new We,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;te.bufferLength*4?new Xe(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;at)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&et(r);if(e)return U&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw U&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return U&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let e=0;e500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue e}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e-1&&n.length&&(!i||(n.prop(Oe.contextHash)||0)==a))return e.useNode(n,o,t),n;if(n.children.length==0||n.positions[0]>0)break;let s=n.children[0];if(s instanceof E&&(!r||s.type.id>=this.parser.minRepeatTerm))n=s;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=U?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos0)return e.reduce(o),U&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;or?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return G(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),U&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(U&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)U&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))U&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),U&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),G(o,n)):(!r||r.scoree.topRules[t][1]),r=[];for(let e=0;e=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new pe(t.map((t,i)=>k.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ke;let a=R(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;etypeof e==`number`?new z(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Qe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=q(this.data,n+2);else break}r=t(q(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=q(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=J(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;ee)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,r)<<1|t}return e.get}var tt=36,nt=1,rt=2,Y=3,X=4,it=5,Z=6,at=7,ot=8,st=9,ct=10,lt=11,Q=12,ut=13,dt=14,ft=15,pt=16,mt=17,ht=18,gt=19,_t=20,vt=21,yt=22,bt=23,xt=24;function St(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ct(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function wt(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function Tt(e,t){e:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function Dt(e,t){for(;e.next==95||St(e.next);)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Ot(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),wt(e,t,!1)}else Dt(e)}function kt(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function At(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function jt(e){for(;!(e.next<0||e.next==10);)e.advance()}function Mt(e,t){for(let n=0;nt%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new Ve(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new He(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;rt&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}},Ve=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},He=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Ue=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function R(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var We=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Ge=new We,Ke=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=Ge,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nt.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ge,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},z=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;V(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;var B=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?R(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(V(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};B.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;var qe=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function V(e,t,n,r,i,a){let o=0,s=1<0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||Je(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535)o=e[n+u*3-1];else{for(;l>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r=c)l=i+1;else{o=e[a+2],t.advance();continue e}}break}}}function H(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function Je(e,t,n,r){let i=H(n,r,t);return i<0||H(n,r,e)t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var Xe=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ye(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ye(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(i instanceof E){let n=a>this.lastRepeatPos&&i.type.id>=this.minRepeat;if(a==e||n){let t=a+i.length,r;if(a>=this.safeFrom&&t<=this.safeTo&&(!(r=i.prop(Oe.lookAhead))||t+r=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},Ze=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new We)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;rl.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new We,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new We,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;te.bufferLength*4?new Xe(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;at)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&et(r);if(e)return U&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw U&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return U&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let e=0;e500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue e}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e-1&&n.length&&(!i||(n.prop(Oe.contextHash)||0)==a))return e.useNode(n,o,t),n;if(n.children.length==0||n.positions[0]>0)break;let s=n.children[0];if(s instanceof E&&(!r||s.type.id>=this.parser.minRepeatTerm))n=s;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=U?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos0)return e.reduce(o),U&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;or?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return G(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),U&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(U&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)U&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))U&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),U&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),G(o,n)):(!r||r.scoree.topRules[t][1]),r=[];for(let e=0;e=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new pe(t.map((t,i)=>k.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ke;let a=R(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;etypeof e==`number`?new z(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Qe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=q(this.data,n+2);else break}r=t(q(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=q(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=J(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;ee)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,r)<<1|t}return e.get}var tt=36,nt=1,rt=2,Y=3,X=4,it=5,Z=6,at=7,ot=8,st=9,ct=10,lt=11,Q=12,ut=13,dt=14,ft=15,pt=16,mt=17,ht=18,gt=19,_t=20,vt=21,yt=22,bt=23,xt=24;function St(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ct(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function wt(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function Tt(e,t){e:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function Dt(e,t){for(;e.next==95||St(e.next);)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Ot(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),wt(e,t,!1)}else Dt(e)}function kt(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function At(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function jt(e){for(;!(e.next<0||e.next==10);)e.advance()}function Mt(e,t){for(let n=0;n!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:!1,words:Pt(It,Ft)};function Rt(e,t,n,r){let i={};for(let t in Lt)i[t]=(e.hasOwnProperty(t)?e:Lt)[t];return t&&(i.words=Pt(t,n||``,r)),i}function zt(e){return new qe(t=>{let{next:n}=t;if(t.advance(),Mt(n,Nt)){for(;Mt(t.next,Nt);)t.advance();t.acceptToken(tt)}else if(n==36&&e.doubleDollarQuotedStrings){let e=Dt(t,``);t.next==36&&(t.advance(),Tt(t,e),t.acceptToken(Y))}else if(n==39||n==34&&e.doubleQuotedStrings)wt(t,n,e.backslashEscapes),t.acceptToken(Y);else if(n==35&&e.hashComments||n==47&&t.next==47&&e.slashComments)jt(t),t.acceptToken(nt);else if(n==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))jt(t),t.acceptToken(nt);else if(n==47&&t.next==42){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),n==42&&t.next==47){if(e--,t.advance(),!e)break}else n==47&&t.next==42&&(e++,t.advance())}t.acceptToken(rt)}else if((n==101||n==69)&&t.next==39)t.advance(),wt(t,39,!0),t.acceptToken(Y);else if((n==110||n==78)&&t.next==39&&e.charSetCasts)t.advance(),wt(t,39,e.backslashEscapes),t.acceptToken(Y);else if(n==95&&e.charSetCasts)for(let n=0;;n++){if(t.next==39&&n>1){t.advance(),wt(t,39,e.backslashEscapes),t.acceptToken(Y);break}if(!St(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(n==113||n==81)&&t.next==39&&t.peek(1)>0&&!Mt(t.peek(1),Nt)){let e=t.peek(1);t.advance(2),Et(t,e),t.acceptToken(Y)}else if(Mt(n,e.identifierQuotes))wt(t,n==91?93:n,!1),t.acceptToken(gt);else if(n==40)t.acceptToken(at);else if(n==41)t.acceptToken(ot);else if(n==123)t.acceptToken(st);else if(n==125)t.acceptToken(ct);else if(n==91)t.acceptToken(lt);else if(n==93)t.acceptToken(Q);else if(n==59)t.acceptToken(ut);else if(e.unquotedBitLiterals&&n==48&&t.next==98)t.advance(),kt(t),t.acceptToken(yt);else if((n==98||n==66)&&(t.next==39||t.next==34)){let n=t.next;t.advance(),e.treatBitsAsBytes?(wt(t,n,e.backslashEscapes),t.acceptToken(bt)):(kt(t,n),t.acceptToken(yt))}else if(n==48&&(t.next==120||t.next==88)||(n==120||n==88)&&t.next==39){let e=t.next==39;for(t.advance();Ct(t.next);)t.advance();e&&t.next==39&&t.advance(),t.acceptToken(X)}else if(n==46&&t.next>=48&&t.next<=57)At(t,!0),t.acceptToken(X);else if(n==46)t.acceptToken(dt);else if(n>=48&&n<=57)At(t,!1),t.acceptToken(X);else if(Mt(n,e.operatorChars)){for(;Mt(t.next,e.operatorChars);)t.advance();t.acceptToken(ft)}else if(Mt(n,e.specialVar))t.next==n&&t.advance(),Ot(t),t.acceptToken(mt);else if(n==58||n==44)t.acceptToken(pt);else if(St(n)){let r=Dt(t,String.fromCharCode(n));t.acceptToken(t.next==46||t.peek(-r.length-1)==46?ht:e.words[r.toLowerCase()]??ht)}})}var Bt=zt(Lt),Vt=$e.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,Bt],topRules:{Script:[0,25]},tokenPrec:0});function Ht(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function Ut(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function Wt(e){return e&&(e.name==`Identifier`||e.name==`QuotedIdentifier`)}function Gt(e,t){if(t.name==`CompositeIdentifier`){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)Wt(r)&&n.push(Ut(e,r));return n}return[Ut(e,t)]}function Kt(e,t){for(let n=[];;){if(!t||t.name!=`.`)return n;let r=Ht(t);if(!Wt(r))return n;n.unshift(Ut(e,r)),t=Ht(r)}}function qt(e,t){let n=T(e).resolveInner(t,-1),r=Yt(e.doc,n);return n.name==`Identifier`||n.name==`QuotedIdentifier`||n.name==`Keyword`?{from:n.from,quoted:n.name==`QuotedIdentifier`?e.doc.sliceString(n.from,n.from+1):null,parents:Kt(e.doc,Ht(n)),aliases:r}:n.name==`.`?{from:t,quoted:null,parents:Kt(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}var Jt=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function Yt(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;e.name==`Statement`&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,a=null;t;t=t.nextSibling){let n=t.name==`Keyword`?e.sliceString(t.from,t.to).toLowerCase():null,o=null;if(!i)i=n==`from`;else if(n==`as`&&a&&Wt(t.nextSibling))o=Ut(e,t.nextSibling);else if(n&&Jt.has(n))break;else a&&Wt(t)&&(o=Ut(e,t));o&&(r||=Object.create(null),r[o]=Gt(e,a)),a=/Identifier$/.test(t.name)?t:null}return r}function Xt(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}var Zt=/^\w*$/,Qt=/^[`'"\[]?\w*[`'"\]]?$/;function $t(e){return e.self&&typeof e.self.label==`string`}var en=class e{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(t){let n=this.children||=Object.create(null);return n[t]||(t&&!this.list.some(e=>e.label==t)&&this.list.push(tn(t,`type`,this.idQuote,this.idCaseInsensitive)),n[t]=new e(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t==`string`?tn(t,`property`,this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):$t(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>e==`.`?`\0`:e).split(`\0`),a=this;$t(n)&&(r=n.self,n=n.children);for(let e=0;e{let{parents:t,from:n,quoted:i,empty:a,aliases:c}=qt(e.state,e.pos);if(a&&!e.explicit)return null;c&&t.length==1&&(t=c[t[0]]||t);let l=o;for(let e of t){for(;!l.children||!l.children[e];)if(l==o&&s)l=s;else if(l==s&&r)l=l.child(r);else return null;let t=l.maybeChild(e);if(!t)return null;l=t}let u=l.list;if(l==o&&c&&(u=u.concat(Object.keys(c).map(e=>({label:e,type:`constant`})))),i){let t=i[0],r=nn(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==r?e.pos+1:void 0,options:Xt(t,r,u),validFor:Qt}}return{from:n,options:u,validFor:Zt}}}function an(e){return e==vt?`type`:e==_t?`keyword`:`variable`}function on(e,t,n){let r=Object.keys(e).map(r=>n(t?r.toUpperCase():r,an(e[r])));return N([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],we(r))}var sn=Vt.configure({props:[ue.add({Statement:Le()}),ge.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),de({Keyword:A.keyword,Type:A.typeName,Builtin:A.standard(A.name),Bits:A.number,Bytes:A.string,Bool:A.bool,Null:A.null,Number:A.number,String:A.string,Identifier:A.name,QuotedIdentifier:A.special(A.string),SpecialVar:A.special(A.name),LineComment:A.lineComment,BlockComment:A.blockComment,Operator:A.operator,"Semi Punctuation":A.punctuation,"( )":A.paren,"{ }":A.brace,"[ ]":A.squareBracket})]}),cn=class e{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(t,n){return new e(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=Rt(t,t.keywords,t.types,t.builtin),r=Fe.define({name:`sql`,parser:sn.configure({tokenizers:[{from:Bt,to:zt(n)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}});return new e(n,r,t)}};function ln(e,t){return{label:e,type:t,boost:-1}}function un(e,t=!1,n){return on(e.dialect.words,t,n||ln)}function dn(e){return e.schema?rn(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||mn):()=>null}function fn(e){return e.schema?(e.dialect||mn).language.data.of({autocomplete:dn(e)}):[]}function pn(e={}){let t=e.dialect||mn;return new Re(t.language,[fn(e),t.language.data.of({autocomplete:un(t,e.upperCaseKeywords,e.keywordCompletion)})])}var mn=cn.define({}),hn=cn.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:``,keywords:It+`abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes`,types:Ft+`bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml`}),gn=cn.define({...hn.spec,keywords:`${hn.spec.keywords} qualify exclude replace pivot unpivot summarize asof positional semi anti union by name columns sample using key`,types:`${hn.spec.types} variant timestamp_ns timestamptz_ns hugeint uhugeint ubigint uinteger`,builtin:`${hn.spec.builtin??``} time_bucket epoch_ns epoch_ms make_timestamp_ns try_cast count_if arg_max arg_min any_value quantile_cont quantile_disc approx_quantile histogram first last list list_extract list_value list_distinct list_sort unnest struct_pack struct_extract map map_keys map_extract map_extract_value json_extract json_extract_string json_keys json_type to_json regexp_matches regexp_full_match regexp_replace regexp_extract starts_with contains greatest least isfinite isinf isnan date_diff date_sub`,specialVar:`$?`}),_n=we([{label:`$__window`,type:`function`,detail:`Time filter`,info:`Use $__window(time_column) to apply the dashboard time range.`},{label:`$__bucket`,type:`function`,detail:`Time bucket`,info:`Use $__bucket(time_column) to group by the panel interval.`}]);function vn(e){return Object.fromEntries(Object.entries({...e.signals,...e.sql_relations}).map(([e,t])=>[e,t.columns.map(e=>({label:e.name,type:`property`,detail:e.sql_type??e.type,info:e.description}))]))}function yn(e,t){let n=e.line(Math.max(1,Math.min(e.lines,t.line+1)));return n.from+Math.max(0,Math.min(n.length,t.character))}function bn(e,t){return t.map(t=>{let n=t.range?yn(e,t.range.start):0;return{from:n,to:t.range?Math.max(n,yn(e,t.range.end)):e.length,severity:`error`,message:t.message+(t.hint?` (${t.hint})`:``)}})}var $=p(),xn=[];function Sn(e){let{value:t,schema:n,problems:r=xn,label:i=`Panel SQL`,describedBy:a,disabled:o=!1}=e,s=(0,I.useRef)(null),c=(0,I.useRef)(null),l=(0,I.useRef)(e);l.current=e;let u=(0,I.useRef)({language:new ve,editable:new ve,attributes:new ve});return(0,I.useEffect)(()=>{let{language:e,editable:t,attributes:n}=u.current,r=new D({parent:s.current,state:fe.create({doc:l.current.value,extensions:[w(),Te(),O(),he(),xe(),Ie(),Ae,_e(Se),D.lineWrapping,e.of(pn({dialect:gn})),gn.language.data.of({autocomplete:_n}),t.of([]),n.of([]),j.highest(ze.of([{key:`Mod-Enter`,run:()=>(l.current.disabled||l.current.onRun(),!0),stopPropagation:!0},{key:`Escape`,run:()=>(r.contentDOM.blur(),l.current.onEscape(),!0),stopPropagation:!0}])),Ce(),ze.of([...P.filter(e=>e.key!==`Escape`),...Ee,...M]),D.updateListener.of(e=>{e.docChanged&&l.current.onChange(e.state.doc.toString())})]})});return c.current=r,()=>{c.current=null,r.destroy()}},[]),(0,I.useEffect)(()=>{let e=c.current;e.state.doc.toString()!==t&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}})},[t]),(0,I.useEffect)(()=>{c.current.dispatch({effects:u.current.language.reconfigure(pn({dialect:gn,schema:n?vn(n):void 0}))})},[n]),(0,I.useEffect)(()=>{c.current.dispatch({effects:u.current.editable.reconfigure([fe.readOnly.of(o),D.editable.of(!o)])})},[o]),(0,I.useEffect)(()=>{c.current.dispatch({effects:u.current.attributes.reconfigure(D.contentAttributes.of({role:`textbox`,"aria-label":i,"aria-multiline":`true`,"aria-describedby":a??``,"aria-invalid":r.length?`true`:`false`,spellcheck:`false`}))})},[i,a,r.length]),(0,I.useEffect)(()=>{let e=c.current;e.dispatch(F(e.state,bn(e.state.doc,r)))},[t,r]),(0,$.jsx)(`div`,{ref:s,"data-sql-editor":!0})}var Cn=[`=`,`!=`,`>`,`>=`,`<`,`<=`],wn=String.raw`[a-z_][a-z0-9_]*|(?:attributes|resource)\['(?:[^']|'')+'\]`,Tn=String.raw`'(?:[^']|'')*'|-?\d+(?:\.\d+)?|\$[a-z][a-z0-9_]*`,En=new RegExp(String.raw`^(${wn})\s*(!=|>=|<=|=|>|<)\s*(${Tn})$`),Dn=/^-?\d+(?:\.\d+)?$/,On=/^\$[a-z][a-z0-9_]*$/;function kn(e){let t=En.exec(e.trim());if(!t)return;let[,n,r,i]=t,a=i.startsWith(`'`);return{field:n,op:r,value:a?i.slice(1,-1).replaceAll(`''`,`'`):i,quoted:a}}function An(e,t=[]){let n=e.value.trim();if(On.test(n)&&t.includes(n.slice(1)))return`${e.field} ${e.op} ${n}`;let r=e.quoted||!Dn.test(n)?`'${e.value.replaceAll(`'`,`''`)}'`:e.value.trim();return`${e.field} ${e.op} ${r}`}var jn={h:36e5,m:6e4,s:1e3,ms:1,us:.001},Mn=/^(\d+(?:\.\d+)?)\s*(h|m|s|ms|us)$/i,Nn=e=>Number(e.toPrecision(12));function Pn(e){let t=e.trim();if(Dn.test(t))return Number(t);let n=Mn.exec(t);return n?Nn(Number(n[1])*jn[n[2].toLowerCase()]):void 0}function Fn(e){for(let[t,n]of Object.entries(jn))if(e>=n&&Nn(Nn(e/n)*n)===e)return`${Nn(e/n)}${t}`;return`${e}ms`}var In=[`spans`,`logs`,`metrics`],Ln=new Set([`count`,`rate`,`error_rate`,`share`]),Rn=new Set([`quantile`]),zn=new RegExp(String.raw`^([a-z_][a-z0-9_]*)\((|${wn})\)$`);function Bn(e,t){let n=zn.exec(e.trim());if(n&&!Rn.has(n[1])&&t.includes(n[1])&&Ln.has(n[1])===(n[2]===``))return{fn:n[1],field:n[2]}}var Vn=e=>`${e.fn}(${Ln.has(e.fn)?``:e.field})`,Hn=`duration_ms`,Un=/^\$[a-z][a-z0-9_]*$/;function Wn(e,t){if(e===Hn){let e=Pn(t);return e===void 0?void 0:String(e)}return/^-?\d+(?:\.\d+)?$/.test(t)?t:void 0}function Gn(e){let t=new Set,n=new Set,r=new Set([`count`]);for(let i of e.measures??[]){let e=zn.exec(i.trim());e&&(r.add(e[1]),e[2]&&(e[1]===`count_distinct`?n:t).add(e[2]))}for(let r of e.where??[]){let e=kn(r);e&&(e.quoted?n:t).add(e.field)}for(let t of e.by??[])n.add(t);n.add(`service`);let i=e=>({name:e,type:t.has(e)?`number`:`string`});return{signals:{[e.from]:{columns:[...new Set([...t,...n])].map(i)}},sql_relations:{},measures:[...r],buckets:[`auto`,...e.bucket&&e.bucket!==`auto`?[e.bucket]:[]]}}function Kn(e,t){let n=e.signals[t],r=(n?.columns??[]).filter(e=>e.type!==`map`&&e.type!==`time`),i=(n?.attributes??[]).map(e=>({name:`${e.scope===`resource`?`resource`:`attributes`}['${e.key.replaceAll(`'`,`''`)}']`,type:e.type}));return[...r,...i]}function qn({text:e,onRemove:t}){return(0,$.jsx)(y,{variant:`light`,color:`gray`,size:`lg`,tt:`none`,rightSection:(0,$.jsx)(_,{size:`xs`,variant:`subtle`,color:`gray`,"aria-label":`Remove ${e}`,onClick:t,children:(0,$.jsx)(m,{size:10})}),children:(0,$.jsx)(`code`,{children:e})})}function Jn({query:e,schema:t,variables:n=[],labels:r={},onChange:a,onInvalid:o}){let s=Kn(t,e.from),c=new Set(s.map(e=>e.name)),l=new Set(s.filter(e=>e.type===`number`||e.type===`int`||e.type===`float`).map(e=>e.name)),d=s.map(e=>e.name),f=t.measures??[],p=e.where??[],y=e.measures??[],ee=e.by??[],te=t.buckets??[],[b,ne]=(0,I.useState)(),x=e=>{ne(e),o?.(e!==void 0&&e.condition.value.trim()!==``)},ie=(0,I.useRef)(o);ie.current=o,(0,I.useEffect)(()=>()=>ie.current?.(!1),[]);let[ae,C]=(0,I.useState)(),oe=b!==void 0&&b.condition.value.trim()!==``,se=e=>r[e]??e,[ce,le]=(0,I.useState)(),w=t=>{le(void 0),a({...e,...t})},ue=n=>{let r=new Set(Kn(t,n).map(e=>e.name)),i=e=>r.has(e)||e.startsWith(`attributes[`)||e.startsWith(`resource[`),o={where:p.filter(e=>{let t=kn(e);return!t||i(t.field)}),measures:y.filter(e=>{let t=Bn(e,f);return!t||!t.field||i(t.field)}),by:ee.filter(i)},s=[...y.filter(e=>!o.measures.includes(e)),...p.filter(e=>!o.where.includes(e)),...ee.filter(e=>!o.by.includes(e))];o.measures.length===0&&y.length>0&&(o.measures=[`count()`]),x(void 0),le(s.length>0?`Removed what ${n} does not have: ${s.map(se).join(`, `)}.`:void 0),a({...e,from:n,...o})},de=(e,t,n)=>e.map((e,r)=>r===t?n:e),T=(e,t)=>e.filter((e,n)=>n!==t),E=e=>c.has(e)?d:[e,...d];return(0,$.jsxs)(v,{gap:`sm`,"data-builder":!0,children:[(0,$.jsx)(S,{label:`Source`,w:200,allowDeselect:!1,value:e.from,data:[...In],onChange:t=>t&&t!==e.from&&ue(t)}),ce&&(0,$.jsx)(g,{size:`xs`,c:`dimmed`,role:`status`,"data-builder-removed":!0,children:ce}),(0,$.jsxs)(v,{gap:6,children:[(0,$.jsx)(g,{size:`sm`,fw:500,children:`Measures`}),y.map((e,n)=>{let r=Bn(e,f);return r?(0,$.jsxs)(u,{gap:`xs`,wrap:`nowrap`,children:[(0,$.jsx)(S,{"aria-label":`Measure ${n+1} function`,w:160,allowDeselect:!1,searchable:!0,value:r.fn,data:(t.measures??[]).filter(e=>!Rn.has(e)),onChange:e=>e&&w({measures:de(y,n,Vn({fn:e,field:Ln.has(e)?``:r.field||(l.values().next().value??``)}))})}),!Ln.has(r.fn)&&(0,$.jsx)(S,{"aria-label":`Measure ${n+1} field`,w:260,searchable:!0,value:r.field||null,data:Yn(r.fn,d,l,E(r.field)),onChange:e=>e&&w({measures:de(y,n,Vn({...r,field:e}))})}),(0,$.jsx)(_,{variant:`subtle`,color:`gray`,"aria-label":`Remove measure ${n+1}`,onClick:()=>w({measures:T(y,n)}),children:(0,$.jsx)(m,{size:14})})]},n):(0,$.jsx)(u,{children:(0,$.jsx)(qn,{text:se(e),onRemove:()=>w({measures:T(y,n)})})},n)}),(0,$.jsx)(u,{children:(0,$.jsx)(h,{size:`compact-sm`,variant:`subtle`,leftSection:(0,$.jsx)(re,{size:12}),onClick:()=>w({measures:[...y,`count()`]}),children:`Add measure`})})]}),(0,$.jsxs)(v,{gap:6,children:[(0,$.jsx)(g,{size:`sm`,fw:500,children:`Filters`}),(b?[...p.slice(0,b.at),b.condition,...p.slice(b.at)]:p).map((e,r)=>{let a=b?.at===r,o=b&&r>b.at?r-1:r,s=()=>{b&&o{let t={...d,...e};c.has(t.field)&&(t.quoted=!l.has(t.field));let r=t.value.trim(),i=Un.test(r)&&n.includes(r.slice(1)),s=l.has(t.field)&&!i?Wn(t.field,r):r;if(!s){x({at:o,condition:t}),a||w({where:T(p,o)});return}a&&x(void 0);let u=An({...t,value:s},n);w({where:a?[...p.slice(0,o),u,...p.slice(o)]:de(p,o,u)})},h=a&&oe?d.field===Hn?`Enter a duration such as 100ms or 1.5s`:`Enter a number`:void 0,g=ae?.row===r?ae.text:d.field===Hn&&!d.quoted&&Pn(d.value)!==void 0&&!a?Fn(Number(d.value)):d.value;return(0,$.jsxs)(u,{gap:`xs`,wrap:`nowrap`,align:`flex-start`,children:[(0,$.jsx)(S,{"aria-label":`Filter ${r+1} field`,w:260,searchable:!0,allowDeselect:!1,value:d.field,data:E(d.field),onChange:e=>e&&f({field:e})}),(0,$.jsx)(S,{"aria-label":`Filter ${r+1} operator`,w:90,style:{flexShrink:0},allowDeselect:!1,value:d.op,data:[...Cn],onChange:e=>e&&f({op:e})}),d.field===`service`&&t.services?.length?(0,$.jsx)(S,{"aria-label":`Filter ${r+1} value`,w:220,searchable:!0,value:d.value||null,data:[...n.map(e=>`$${e}`),...t.services.map(e=>e.value)],onChange:e=>f({value:e??``})}):(0,$.jsx)(i,{"aria-label":`Filter ${r+1} value`,w:220,placeholder:a?`Value`:void 0,value:g,error:h,onBlur:()=>C(void 0),onChange:e=>{let t=e.currentTarget.value;C({row:r,text:t}),f({value:t})}}),(0,$.jsx)(_,{variant:`subtle`,color:`gray`,"aria-label":`Remove filter ${r+1}`,onClick:()=>a?x(void 0):s(),children:(0,$.jsx)(m,{size:14})})]},r)}),(0,$.jsx)(u,{children:(0,$.jsx)(h,{size:`compact-sm`,variant:`subtle`,leftSection:(0,$.jsx)(re,{size:12}),disabled:b!==void 0,onClick:()=>x({at:p.length,condition:{field:`service`,op:`=`,value:``,quoted:!0}}),children:`Add filter`})})]}),(0,$.jsxs)(u,{gap:`md`,align:`flex-end`,children:[(0,$.jsxs)(v,{gap:6,children:[(0,$.jsx)(g,{size:`sm`,fw:500,children:`Group by`}),(0,$.jsxs)(u,{gap:`xs`,children:[ee.map((e,t)=>(0,$.jsx)(qn,{text:e,onRemove:()=>w({by:T(ee,t)})},e)),(0,$.jsx)(S,{"aria-label":`Add group by field`,placeholder:`Add field`,w:220,searchable:!0,value:null,data:d.filter(e=>!ee.includes(e)),onChange:e=>e&&w({by:[...ee,e]})})]})]}),(0,$.jsx)(S,{label:`Every`,w:170,clearable:!0,placeholder:`No time buckets`,value:e.bucket??null,data:e.bucket&&!te.includes(e.bucket)?[...te,e.bucket]:te,onChange:e=>w({bucket:e??void 0})}),(0,$.jsx)(Be,{label:`Limit`,w:120,min:1,max:1e3,value:e.limit??``,onChange:e=>w({limit:typeof e==`number`?e:void 0})})]})]})}function Yn(e,t,n,r){let i=e===`count_distinct`?t:t.filter(e=>n.has(e));return[...new Set([...r.filter(e=>!t.includes(e)),...i])]}var Xn=`explore`,Zn=420,Qn={stat:`Stat`,gauge:`Gauge`,timeseries:`Time series`,bar:`Bar`,table:`Table`,text:`Text`,heatmap:`Heatmap`,histogram:`Histogram`,scatter:`Scatter`,state_timeline:`State timeline`,logs:`Logs`,log_patterns:`Log patterns`,traces:`Traces`,service_map:`Service map`,health:`Health`},$n={min_max:`a minimum and maximum`,thresholds:`thresholds`},er=e=>e===`sql`?`sql`:`query`,tr={from:`spans`,measures:[`count()`],by:[`service`]};function nr(e,t){if(e.from===`logs`)return`logs`;if(e.from===`spans`&&t!==`health`&&t!==`service_map`)return`traces`}function rr(e,t){let n=(e,t)=>(e??[]).flatMap((e,n)=>n0||e.result.frame?.totals!==void 0)}function ar({search:e,onSearch:i,onSaved:f,context:p}){let m=p?.spec.variables,_=p?.panel,y=e=>e.requires.every(e=>e===`min_max`?_?.min!==void 0&&_?.max!==void 0:(_?.thresholds?.length??0)>0),re=e=>p?.compose?p.compose(e):e,S=p?.vars??{},[le,w]=(0,I.useState)(),[ue,de]=(0,I.useState)(),[T,E]=(0,I.useState)(!1),[fe,D]=(0,I.useState)(),[O,pe]=(0,I.useState)(e.q),[k,A]=(0,I.useState)(e.sql??``),me=(0,I.useRef)({text:e.q,sql:e.sql??``}),he=O!==me.current.text||k!==me.current.sql,ge=p?.onDirtyChange;(0,I.useEffect)(()=>{ge?.(he)},[he,ge]);let _e=(0,I.useRef)(null),[j,ve]=(0,I.useState)(),[M,xe]=(0,I.useState)(p?.initial?.query),[Se,Ce]=(0,I.useState)(p?.initial?.formatted),[we,Te]=(0,I.useState)([]),[Ee,Oe]=(0,I.useState)(()=>p?.initial?rr(p.initial.query,p.initial.formatted):{}),[ke,Ae]=(0,I.useState)(!1),N=(0,I.useRef)({}),[P,F]=(0,I.useState)([]),[Fe,Ie]=(0,I.useState)([]),[Le,Re]=(0,I.useState)(),[ze,Be]=(0,I.useState)(0),[L,Ve]=(0,I.useState)(),[He,Ue]=(0,I.useState)(),[R,We]=(0,I.useState)(!1),Ge=(0,I.useRef)(void 0),Ke=(0,I.useRef)(null),z=(0,I.useId)(),B=c(e),qe=B.from&&B.to?void 0:B.range,V=(0,I.useRef)(e);V.current=e;let H=(0,I.useRef)({q:e.q,sql:e.sql??``,viz:e.viz}),Je=e=>{let t=V.current;H.current={q:e.q,sql:e.sql??``,viz:e.viz},i(e,e.q===t.q&&e.sql===t.sql&&(t.viz===void 0||e.viz===t.viz))},U=e=>`${e.range}|${e.from??``}|${e.to??``}`,W=U(e),Ye=(0,I.useRef)(void 0),Xe=e=>{let t=U(te(l(e)));t!==W&&(Ye.current=t),i(e)},Ze=(0,I.useRef)(void 0),Qe=(0,I.useRef)({text:O,sql:k});Qe.current={text:O,sql:k};let G=s({...d,enabled:e.tab!==`query`});(0,I.useEffect)(()=>()=>{Ge.current?.abort(),N.current.abort?.abort(),clearTimeout(N.current.timer),Ze.current=void 0},[]);let K=async(e,t,n,r)=>{if(!t.trim())return;Ge.current?.abort();let i=new AbortController;Ge.current=i,We(!0),Re(void 0),F([]),Ie([]),Ue(void 0);try{let a,o;if(e===`query`&&r)ve(void 0),a=re({id:Xn,title:je(t),viz:n??`table`,query:r,drill:nr(r,n??`table`)}),o=t,Je({...V.current,q:t,viz:a.viz});else if(e===`query`){let e=await Me({text:t,variables:m,window:qe},i.signal);if(i.signal.aborted)return;ve({...e,text:t}),Qe.current.text===t&&Ie(e.notices),V.current.tab===`builder`&&xe(e.query);let r=n&&e.viz.compatible.some(e=>e.viz===n&&y(e))?n:e.viz.compatible.find(y)?.viz??`table`;a=re({id:Xn,title:je(e.canonical),viz:r,query:e.query,drill:nr(e.query,r)}),o=e.canonical,Je({...V.current,q:t,viz:r,...t===V.current.q?{}:{drill:void 0}})}else a=re({id:Xn,title:`SQL`,viz:_?.viz??`table`,sql:t}),Je({...V.current,sql:t});let s={version:1,name:p?.spec.name??`Explore`,time:B,variables:m,panels:[a]},c=Ke.current?.clientWidth||960,l=await ee({dashboard:s,panels:[Xn],time:B,vars:S,widths:{[Xn]:c}},i.signal);if(i.signal.aborted)return;let u=l.find(e=>e.id===Xn);if(!u)throw Error(`The query returned no result.`);if(u.status===`invalid`){Ue({kind:e,source:t,window:W}),Qe.current[e===`query`?`text`:`sql`]===t&&F(u.problems??[]);return}w(Date.now()),Ve({kind:e,source:t,window:W,panel:a,result:oe(u,[Xn]),canonical:o}),e===`sql`&&u.status===`error`&&!u.retryable&&Qe.current.sql===t&&F([{path:`sql`,message:u.error??`Query failed`}])}catch(n){if(i.signal.aborted)return;Ue({kind:e,source:t,window:W}),n instanceof a&&n.problems.length>0?Qe.current[e===`query`?`text`:`sql`]===t&&F(n.problems):Re(n instanceof Error?n.message:`Request failed`)}finally{Ge.current===i&&We(!1)}},$e=(0,I.useRef)({kind:er(e.tab),viz:L?.panel.viz??e.viz,direct:void 0});$e.current={kind:er(e.tab),viz:L?.panel.viz??e.viz,direct:Se?.editable===!1?M:void 0};let q=(0,I.useRef)(()=>void 0),et=()=>{clearTimeout(N.current.timer),N.current.timer=void 0,N.current.abort?.abort()},J=async(e,t=!0)=>{et();let n=new AbortController;N.current.abort=n;try{let r=await be({query:e},n.signal);return n.signal.aborted?void 0:(Ce(r),Te([]),Oe(t=>({...t,...rr(e,r)})),t&&(Ie(r.notices),F([]),pe(r.text)),r)}catch(e){if(n.signal.aborted)return;Te(e instanceof a&&e.problems.length>0?e.problems:[{path:`query`,message:e instanceof Error?e.message:`The query could not be printed`}]);return}},tt=e=>{xe(e),clearTimeout(N.current.timer),N.current.timer=setTimeout(()=>{N.current.timer=void 0,J(e)},250)},nt=async t=>{if(!M)return;let n=await J(M);n&&V.current.tab===`builder`&&K(`query`,n.text,t??L?.panel.viz??e.viz,n.editable?void 0:M)},rt=async t=>{if(t!==`builder`){e.tab===`builder`&&M&&N.current.timer&&J(M),i({...e,tab:t});return}let n=()=>{V.current.tab!==t&&i({...V.current,tab:t})};if(Se?.editable===!1&&M)n();else if(j&&j.text===O)xe(j.query),n(),J(j.query,!1);else if(!O.trim())xe(tr),n(),J(tr,!1);else try{let e=await Me({text:O,variables:m,window:qe});ve({...e,text:O}),xe(e.query),n(),J(e.query,!1)}catch(e){e instanceof a&&e.problems.length>0?F(e.problems):Re(e instanceof Error?e.message:`Request failed`)}};q.current=()=>{let{kind:e,viz:t,direct:n}=$e.current;V.current.tab===`builder`&&M?nt(t):K(e,Qe.current[e===`query`?`text`:`sql`],t,n)},(0,I.useEffect)(()=>{let t={q:e.q,sql:e.sql??``,viz:e.viz},n=t.q===H.current.q&&t.sql===H.current.sql&&t.viz===H.current.viz,r=Ze.current===void 0,i=Ze.current!==W,a=Ye.current===W;if(Ze.current=W,Ye.current=void 0,n&&(r||i&&a)){q.current();return}if(n&&!i)return;H.current=t,et(),Ce(void 0),F([]),pe(t.q),A(t.sql);let o=er(e.tab);K(o,o===`query`?t.q:t.sql,t.viz)},[e.q,e.sql,e.viz,W]),(0,I.useEffect)(()=>{e.tab===`builder`&&rt(`builder`)},[]);let Y=er(e.tab),X=Y===`query`?O:k,it=ze>0&&!O.trim(),Z=Se?.editable===!1,at=L!==void 0&&(L.kind!==Y||L.source!==X||L.window!==W),ot=j?.viz.compatible??[],st=p?.panel!==void 0,ct=_!==void 0&&!he&&(e.viz??_.viz)===_.viz,lt=!at&&!R&&ir(L,st),Q=lt||ct,ut=He===void 0?!at&&L?.result.status===`error`:He.kind===Y&&He.source===X&&He.window===W,dt=R?`Wait for the run to finish`:ut?`The last run failed; saving needs a run that works`:at?`Run the query as it is now first`:st?`Run the query first`:`Run a query that returns rows first`,ft=(0,I.useId)(),pt=L!==void 0&&(L.panel.drill!==void 0||L.panel.viz===`service_map`||(L.result.frame?.columns.some(e=>e.name===`trace_id`)??!1));return(0,$.jsxs)(v,{gap:`md`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,maw:1600,mx:`auto`,"data-explore":!0,children:[!p&&(0,$.jsx)(r,{title:`Explore`,description:`Ask a question of your telemetry.`,meta:(0,$.jsx)(t,{time:B,updatedAt:L?le:null})}),(0,$.jsx)(se,{inHeader:!p,time:B,onRange:t=>Xe({...e,range:t,from:void 0,to:void 0}),onAbsolute:(t,n)=>Xe({...e,from:t,to:n})}),(0,$.jsxs)(C,{value:e.tab,onChange:e=>void rt(e===`sql`||e===`builder`?e:`query`),keepMounted:!1,children:[(0,$.jsxs)(C.List,{children:[(0,$.jsx)(C.Tab,{value:`query`,children:`Query`}),(0,$.jsx)(C.Tab,{value:`builder`,children:`Builder`}),(0,$.jsx)(C.Tab,{value:`sql`,children:`SQL`})]}),(0,$.jsx)(C.Panel,{value:`query`,pt:`sm`,children:(0,$.jsxs)(v,{gap:`xs`,children:[(0,$.jsxs)(g,{id:z,size:`xs`,c:`dimmed`,children:[`Press Enter to run. For example `,(0,$.jsx)(`code`,{children:`spans | p95(duration) by service every 5m`}),`.`]}),Z&&(0,$.jsxs)(g,{size:`xs`,c:`dimmed`,"data-pitotql-readonly":!0,children:[`This query is edited in the Builder: `,Se?.reason??`it is too large for the text editor`,`.`]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Ne,{value:O,readOnly:Z,placeholder:`spans | count() by service`,onChange:(e,t)=>{et(),pe(e),F(t?.problems??[]),Ie(t?.notices??[]),Ce(void 0)},onRun:()=>{O.trim()||Be(e=>e+1),K(`query`,O,e.viz,Z?M:void 0)},problems:P,notices:Fe,describedBy:z,complete:(e,t,n)=>De({text:e,cursor:t,...B.from&&B.to?{from:B.from,to:B.to}:{window:B.range}},n)}),(0,$.jsx)(g,{size:`xs`,c:`dimmed`,mt:it?4:0,"aria-live":`polite`,"data-pitotql-empty":!0,children:it&&(0,$.jsxs)(`span`,{children:[`Type a query to run, for example `,(0,$.jsx)(`code`,{children:`spans | count() by service`}),`.`]},ze)})]})]})}),(0,$.jsx)(C.Panel,{value:`builder`,pt:`sm`,children:(0,$.jsxs)(v,{gap:`xs`,children:[!M&&(P.length>0||Le)?(0,$.jsx)(b,{"data-builder-blocked":!0,children:(0,$.jsxs)(n,{tone:`danger`,title:`This query cannot open in the Builder`,children:[P.length>0?(0,$.jsx)(v,{gap:2,mb:`xs`,children:P.map((e,t)=>(0,$.jsxs)(g,{size:`sm`,children:[e.message,e.hint?` (${e.hint})`:``]},t))}):(0,$.jsx)(g,{size:`sm`,mb:`xs`,children:Le}),(0,$.jsx)(h,{size:`compact-sm`,variant:`default`,onClick:()=>void rt(`query`),children:`Fix it in the Query tab`})]})}):(0,$.jsxs)($.Fragment,{children:[G.error&&(0,$.jsxs)(n,{tone:`warning`,title:`Fields could not be loaded`,children:[M?`Only the fields this query uses are offered until the field list loads. `:``,G.error.message,(0,$.jsx)(h,{size:`compact-xs`,variant:`default`,ml:`xs`,loading:G.isFetching,onClick:()=>void G.refetch(),children:`Retry`})]}),M&&(G.data??G.error)?(0,$.jsx)(Jn,{query:M,schema:G.data??Gn(M),variables:(m??[]).map(e=>e.name),labels:Ee,onChange:tt,onInvalid:Ae}):!G.error&&(0,$.jsx)(g,{size:`sm`,c:`dimmed`,children:`Loading fields…`})]}),we.length>0&&(0,$.jsx)(v,{gap:2,role:`alert`,"data-builder-problems":!0,children:we.map((e,t)=>(0,$.jsxs)(g,{size:`sm`,c:`bad`,children:[e.message,e.hint?` (${e.hint})`:``]},t))}),Se&&we.length===0&&(0,$.jsxs)(g,{size:`xs`,c:`dimmed`,"data-builder-text":!0,children:[`As PitotQL: `,(0,$.jsx)(`code`,{children:Se.text})]})]})}),(0,$.jsxs)(C.Panel,{value:`sql`,pt:`sm`,children:[!k.trim()&&(0,$.jsxs)(g,{size:`xs`,c:`dimmed`,mb:`xs`,"data-sql-hint":!0,children:[O.trim()?`SQL runs on its own; the PitotQL query is not converted. `:``,`Write one SELECT over spans, logs or metrics that filters time with `,(0,$.jsx)(`code`,{children:`$__window(time_column)`}),`, for example `,(0,$.jsx)(`code`,{children:`SELECT service, count(*) AS spans FROM spans WHERE $__window(start_time) GROUP BY service`}),`.`]}),(0,$.jsx)(Sn,{value:k,onChange:e=>{A(e),F([])},onRun:()=>void K(`sql`,k),onEscape:()=>_e.current?.focus(),schema:G.data,problems:e.tab===`sql`?P:[],label:p?`Panel SQL`:`Explore SQL`}),e.tab===`sql`&&P.length>0&&(0,$.jsx)(n,{tone:`danger`,title:`The SQL has problems`,children:(0,$.jsx)(`ul`,{children:P.map((e,t)=>(0,$.jsxs)(`li`,{className:`sql-problem`,children:[e.message,e.hint?` (${e.hint})`:``]},t))})})]})]}),(0,$.jsxs)(u,{justify:`space-between`,children:[(0,$.jsxs)(u,{gap:`xs`,children:[(0,$.jsx)(h,{ref:_e,loading:R,disabled:e.tab===`builder`?!M||we.length>0||ke:!X.trim(),onClick:()=>void(e.tab===`builder`?nt(e.viz):K(Y,X,e.viz,Z?M:void 0)),children:`Run`}),Y===`query`&&ot.length>0&&(0,$.jsx)(ae,{size:`xs`,"aria-label":`Visualization`,value:L?.panel.viz??e.viz??``,onChange:t=>void(e.tab===`builder`?nt(t):K(`query`,O,t,Z?M:void 0)),data:ot.map(e=>({value:e.viz,disabled:!y(e),label:y(e)?Qn[e.viz]:(0,$.jsx)(o,{label:`Needs ${e.requires.map(e=>$n[e]).join(` and `)}; set them after saving`,children:(0,$.jsx)(`span`,{children:Qn[e.viz]})})}))}),Y===`query`&&!at&&!Z&&j?.viz.edits.map(e=>(0,$.jsx)(o,{label:(0,$.jsxs)($.Fragment,{children:[`Rewrites the query as `,(0,$.jsx)(`code`,{children:e.text})]}),multiline:!0,maw:420,children:(0,$.jsxs)(h,{size:`compact-sm`,variant:`subtle`,onClick:()=>{pe(e.text),K(`query`,e.text,e.viz)},children:[Qn[e.viz],`…`]})},e.viz))]}),(0,$.jsxs)(u,{gap:`xs`,children:[p?.cancel&&(0,$.jsx)(h,{variant:`default`,disabled:T,onClick:p.cancel,children:`Cancel`}),(0,$.jsx)(o,{label:dt,disabled:Q,events:{hover:!0,focus:!0,touch:!0},children:p?(0,$.jsx)(h,{"data-disabled":!Q||void 0,"aria-disabled":!Q,"aria-describedby":Q?void 0:ft,loading:T,onClick:()=>{let e=lt?L?.panel:_;e&&Q&&(E(!0),de(void 0),p.save.run(e).catch(e=>de(e instanceof Error?e.message:`Save failed`)).finally(()=>E(!1)))},children:p.save.label}):(0,$.jsx)(h,{variant:`default`,"data-disabled":!Q||void 0,"aria-disabled":!Q,"aria-describedby":Q?void 0:ft,onClick:()=>L&&Q&&D(L.panel),children:`Save to dashboard`})}),!Q&&(0,$.jsx)(`span`,{id:ft,hidden:!0,children:dt})]})]}),Le&&(0,$.jsx)(n,{tone:`danger`,title:`The query could not run`,children:Le}),ue&&(0,$.jsx)(n,{tone:`danger`,title:`Not saved`,children:ue}),(0,$.jsx)(b,{ref:Ke,children:L?(0,$.jsxs)(v,{gap:`xs`,children:[(0,$.jsx)(g,{size:`sm`,fw:600,role:`status`,children:R?`Running the query…`:L.kind===Y?L.source===X?L.window===W?L.canonical?(0,$.jsxs)($.Fragment,{children:[`Ran as `,(0,$.jsx)(`code`,{children:L.canonical})]}):`Result`:`Result of the last run · time range has changed`:`Result of the last run · query has changed`:`Result of the last ${L.kind===`sql`?`SQL`:`PitotQL`} run`}),(0,$.jsx)(b,{h:Zn,children:(0,$.jsx)(x,{panel:L.panel,title:L.panel.title,result:L.result,loading:R,height:Zn,group:`explore`,editing:!1,agentAvailable:!1,range:B.range,onRetry:()=>void K(L.kind,L.source,L.panel.viz,Z?M:void 0),traceLinks:`button`,onPoint:pt?t=>{let n=ie(L.panel,L.result,t,S);n&&i({...e,drill:JSON.stringify(n.target)})}:void 0})})]}):R?(0,$.jsx)(g,{c:`dimmed`,size:`sm`,role:`status`,"data-explore-running":!0,children:`Running the query…`}):(0,$.jsx)(g,{c:`dimmed`,size:`sm`,"data-explore-empty":!0,children:e.tab===`builder`?`Build a query above and press Run.`:e.tab===`sql`?`Write a query above and press Run.`:`Type a query above and press Enter.`})}),L&&(0,$.jsx)(ce,{client:ye,spec:{version:1,name:p?.spec.name??`Explore`,time:B,variables:m,panels:[L.panel]},time:B,vars:S,target:ne(e.drill),onChange:t=>i({...e,drill:t?JSON.stringify(t):void 0})}),fe&&f&&(0,$.jsx)(Pe,{panel:fe,time:B,onClose:()=>D(void 0),onSaved:f})]})}export{ar as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/panel-editor-CCqCD_kx.js b/internal/ui/dist/assets/panel-editor-Dx0fP2VL.js similarity index 95% rename from internal/ui/dist/assets/panel-editor-CCqCD_kx.js rename to internal/ui/dist/assets/panel-editor-Dx0fP2VL.js index 10fdf220..19bb3658 100644 --- a/internal/ui/dist/assets/panel-editor-CCqCD_kx.js +++ b/internal/ui/dist/assets/panel-editor-Dx0fP2VL.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as t,Gt as n,Kn as r,Kt as i,Lt as a,Q as o,X as s,Xn as c,Z as l,an as u,ct as d,gi as f,it as p,mi as m,nr as h,or as g,pn as _,wr as v}from"./index-CL2Ww4um.js";import"./page-CyLCNkgg.js";import{a as y,r as b}from"./save-dialog-CVDkqzuX.js";import{t as x}from"./page-D9GXhDXQ.js";import{t as S}from"./discard-zr3DFRDY.js";var C=e(f(),1),w=m();function T(e,t,n){let r=e.from&&e.to?{range:`1h`,from:e.from,to:e.to}:{range:t?.time?.range??e.range??`1h`};return t?.sql===void 0?!t||!n?{q:``,tab:`query`,...r}:{q:n.text,viz:t.viz,tab:n.editable?`query`:`builder`,...r}:{q:``,sql:t.sql,viz:t.viz,tab:`sql`,...r}}var E=(e,t)=>JSON.stringify(e??null)===JSON.stringify(t??null),D={gauge:`stat`,state_timeline:`timeseries`};function ee(e,t){let{query:n,sql:r,viz:i,reduce:a,options:o,drill:s,click:c,unit:l,thresholds:u,better:d,min:f,max:p,...m}=e,h={...m,id:t.id,title:t.title,viz:t.viz,...t.sql===void 0?{query:t.query}:{sql:t.sql}},g=t.sql!==void 0||E(t.query?.measures,n?.measures),_=t.sql===void 0?g&&E(t.query?.by,n?.by):t.sql===r;g?Object.assign(h,{unit:l,thresholds:u,better:d,min:f,max:p}):h.viz in D&&(h.viz=D[h.viz]);let v=h.viz===i;return v&&a&&(h.reduce=a),v&&_&&o&&(h.options=o),s&&t.query&&t.query.from===n?.from&&(h.drill=s),c&&t.query&&E(t.query.by,n?.by)&&(h.click=c),h}function te(e,t){let n={};for(let r of new Set([...Object.keys(e),...Object.keys(t)])){if(r===`id`||r===`grid`)continue;let i=e[r],a=t[r];E(i,a)||(n[r]=a??null)}return n}var O=e=>e===void 0?`not set`:e===`$__all`?`All`:Array.isArray(e)?e.join(`, `):e;function k({dashboardId:e,version:f,spec:m,layoutChanged:E=!1,time:D,vars:k,panel:A,onClose:j}){let M=_(),[N,P]=(0,C.useState)(),{version:F,spec:I,panel:L}=N??{version:f,spec:m,panel:A},[R,z]=(0,C.useState)(),B=(0,C.useRef)(null);(0,C.useEffect)(()=>{R===`stale`&&B.current?.focus()},[R]);let V=u({queryKey:[`panel-editor-format`,e,A?.id,f],queryFn:({signal:e})=>y({query:A.query,viz:A.viz},e),enabled:!!A?.query,staleTime:1/0,retry:!1}),H=!A?.query||V.isSuccess,[U,W]=(0,C.useState)(),G=U??(H?T(D,A,V.data):void 0),[K,q]=(0,C.useState)(A?.title??``),[J,Y]=(0,C.useState)(!1),X=J||K.trim()!==(A?.title??``)||A!==void 0&&G?.viz!==void 0&&G.viz!==A.viz,Z=S(X,j,`this panel`),Q=(0,C.useRef)(!1),ne=async()=>{z(`loading`);try{let n=await t(e);M.setQueryData(s(e),n),Q.current=!0,P({version:n.version,spec:n.spec,panel:A&&n.spec.panels.find(e=>e.id===A.id)}),z(void 0)}catch(e){z(e instanceof Error?e.message:`The latest version could not be loaded.`)}},re=async t=>{let n=K.trim()||t.title,r=L?void 0:{...t,title:n,id:b(`panel`,I.panels.map(e=>e.id))},i=L?`Edited ${n}`:`Added ${n}`,c=E&&!Q.current;try{let a=c?await d(e,{...I,panels:r?[...I.panels,r]:I.panels.map(e=>e.id===L.id?{...t,id:e.id,title:n,grid:e.grid}:e)},F,`${i} and saved layout`):await p(e,[r?{op:`add_panel`,panel:r}:{op:`update_panel`,id:L.id,set:te(L,{...t,id:L.id,title:n})}],F,i);await M.cancelQueries({queryKey:s(e),exact:!0}),M.setQueryData(s(e),a),M.invalidateQueries({queryKey:o}),M.invalidateQueries({queryKey:l(e)}),j()}catch(e){if(e instanceof a&&e.code===`dashboard_version_conflict`){z(`stale`);return}throw e instanceof a&&e.problems.length>0?Error(e.problems.map(e=>e.message).join(` `)):e}},$=I.variables??[];return(0,w.jsxs)(c,{opened:!0,onClose:Z.request,closeOnEscape:!1,title:A?`Edit panel · ${A.title}`:`Add panel`,size:`min(1280px, 100vw - 32px)`,onKeyDown:Z.onKeyDown,children:[Z.prompt,R&&(0,w.jsx)(v,{mb:`sm`,children:(0,w.jsxs)(n,{tone:R===`stale`||R===`loading`?`warning`:`danger`,title:`Someone saved this dashboard since you opened it`,children:[(0,w.jsx)(g,{size:`sm`,children:R===`stale`||R===`loading`?`Load the latest version, then save again. Your draft stays as it is.`:R}),(0,w.jsx)(h,{ref:B,mt:`sm`,size:`compact-sm`,loading:R===`loading`,onClick:()=>void ne(),children:`Load latest`})]})}),(0,w.jsx)(r,{label:`Panel title`,px:`lg`,value:K,onChange:e=>q(e.currentTarget.value),placeholder:A?void 0:`Named after the query`}),$.length>0&&(0,w.jsxs)(g,{size:`xs`,c:`dimmed`,px:`lg`,pt:`xs`,"data-editor-variables":!0,children:[`Runs with the dashboard's variables: `,$.map((e,t)=>(0,w.jsxs)(`span`,{children:[t>0&&` · `,(0,w.jsxs)(`code`,{children:[`$`,e.name]}),` = `,O(k[e.name])]},e.name))]}),V.error?(0,w.jsx)(v,{children:(0,w.jsx)(n,{tone:`danger`,title:`This panel's query could not be opened`,children:V.error.message})}):G?(0,w.jsx)(x,{search:G,onSearch:W,context:{spec:I,vars:k,panel:L,compose:L?e=>ee(L,e):void 0,onDirtyChange:Y,cancel:Z.request,save:{label:A?`Save panel`:`Add panel`,run:re},initial:A?.query&&V.data&&!V.data.editable?{query:A.query,formatted:V.data}:void 0}}):(0,w.jsx)(i,{state:`loading`,loadingLabel:`Loading the panel's query`,rows:3})]})}export{k as default}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as t,Gt as n,Kn as r,Kt as i,Lt as a,Q as o,X as s,Xn as c,Z as l,an as u,ct as d,gi as f,it as p,mi as m,nr as h,or as g,pn as _,wr as v}from"./index-CRKDYJaJ.js";import"./page-DNINkXnr.js";import{a as y,r as b}from"./save-dialog-jF2dwSKX.js";import{t as x}from"./page-TqwEGxR8.js";import{t as S}from"./discard-YoKuewjt.js";var C=e(f(),1),w=m();function T(e,t,n){let r=e.from&&e.to?{range:`1h`,from:e.from,to:e.to}:{range:t?.time?.range??e.range??`1h`};return t?.sql===void 0?!t||!n?{q:``,tab:`query`,...r}:{q:n.text,viz:t.viz,tab:n.editable?`query`:`builder`,...r}:{q:``,sql:t.sql,viz:t.viz,tab:`sql`,...r}}var E=(e,t)=>JSON.stringify(e??null)===JSON.stringify(t??null),D={gauge:`stat`,state_timeline:`timeseries`};function ee(e,t){let{query:n,sql:r,viz:i,reduce:a,options:o,drill:s,click:c,unit:l,thresholds:u,better:d,min:f,max:p,...m}=e,h={...m,id:t.id,title:t.title,viz:t.viz,...t.sql===void 0?{query:t.query}:{sql:t.sql}},g=t.sql!==void 0||E(t.query?.measures,n?.measures),_=t.sql===void 0?g&&E(t.query?.by,n?.by):t.sql===r;g?Object.assign(h,{unit:l,thresholds:u,better:d,min:f,max:p}):h.viz in D&&(h.viz=D[h.viz]);let v=h.viz===i;return v&&a&&(h.reduce=a),v&&_&&o&&(h.options=o),s&&t.query&&t.query.from===n?.from&&(h.drill=s),c&&t.query&&E(t.query.by,n?.by)&&(h.click=c),h}function te(e,t){let n={};for(let r of new Set([...Object.keys(e),...Object.keys(t)])){if(r===`id`||r===`grid`)continue;let i=e[r],a=t[r];E(i,a)||(n[r]=a??null)}return n}var O=e=>e===void 0?`not set`:e===`$__all`?`All`:Array.isArray(e)?e.join(`, `):e;function k({dashboardId:e,version:f,spec:m,layoutChanged:E=!1,time:D,vars:k,panel:A,onClose:j}){let M=_(),[N,P]=(0,C.useState)(),{version:F,spec:I,panel:L}=N??{version:f,spec:m,panel:A},[R,z]=(0,C.useState)(),B=(0,C.useRef)(null);(0,C.useEffect)(()=>{R===`stale`&&B.current?.focus()},[R]);let V=u({queryKey:[`panel-editor-format`,e,A?.id,f],queryFn:({signal:e})=>y({query:A.query,viz:A.viz},e),enabled:!!A?.query,staleTime:1/0,retry:!1}),H=!A?.query||V.isSuccess,[U,W]=(0,C.useState)(),G=U??(H?T(D,A,V.data):void 0),[K,q]=(0,C.useState)(A?.title??``),[J,Y]=(0,C.useState)(!1),X=J||K.trim()!==(A?.title??``)||A!==void 0&&G?.viz!==void 0&&G.viz!==A.viz,Z=S(X,j,`this panel`),Q=(0,C.useRef)(!1),ne=async()=>{z(`loading`);try{let n=await t(e);M.setQueryData(s(e),n),Q.current=!0,P({version:n.version,spec:n.spec,panel:A&&n.spec.panels.find(e=>e.id===A.id)}),z(void 0)}catch(e){z(e instanceof Error?e.message:`The latest version could not be loaded.`)}},re=async t=>{let n=K.trim()||t.title,r=L?void 0:{...t,title:n,id:b(`panel`,I.panels.map(e=>e.id))},i=L?`Edited ${n}`:`Added ${n}`,c=E&&!Q.current;try{let a=c?await d(e,{...I,panels:r?[...I.panels,r]:I.panels.map(e=>e.id===L.id?{...t,id:e.id,title:n,grid:e.grid}:e)},F,`${i} and saved layout`):await p(e,[r?{op:`add_panel`,panel:r}:{op:`update_panel`,id:L.id,set:te(L,{...t,id:L.id,title:n})}],F,i);await M.cancelQueries({queryKey:s(e),exact:!0}),M.setQueryData(s(e),a),M.invalidateQueries({queryKey:o}),M.invalidateQueries({queryKey:l(e)}),j()}catch(e){if(e instanceof a&&e.code===`dashboard_version_conflict`){z(`stale`);return}throw e instanceof a&&e.problems.length>0?Error(e.problems.map(e=>e.message).join(` `)):e}},$=I.variables??[];return(0,w.jsxs)(c,{opened:!0,onClose:Z.request,closeOnEscape:!1,title:A?`Edit panel · ${A.title}`:`Add panel`,size:`min(1280px, 100vw - 32px)`,onKeyDown:Z.onKeyDown,children:[Z.prompt,R&&(0,w.jsx)(v,{mb:`sm`,children:(0,w.jsxs)(n,{tone:R===`stale`||R===`loading`?`warning`:`danger`,title:`Someone saved this dashboard since you opened it`,children:[(0,w.jsx)(g,{size:`sm`,children:R===`stale`||R===`loading`?`Load the latest version, then save again. Your draft stays as it is.`:R}),(0,w.jsx)(h,{ref:B,mt:`sm`,size:`compact-sm`,loading:R===`loading`,onClick:()=>void ne(),children:`Load latest`})]})}),(0,w.jsx)(r,{label:`Panel title`,px:`lg`,value:K,onChange:e=>q(e.currentTarget.value),placeholder:A?void 0:`Named after the query`}),$.length>0&&(0,w.jsxs)(g,{size:`xs`,c:`dimmed`,px:`lg`,pt:`xs`,"data-editor-variables":!0,children:[`Runs with the dashboard's variables: `,$.map((e,t)=>(0,w.jsxs)(`span`,{children:[t>0&&` · `,(0,w.jsxs)(`code`,{children:[`$`,e.name]}),` = `,O(k[e.name])]},e.name))]}),V.error?(0,w.jsx)(v,{children:(0,w.jsx)(n,{tone:`danger`,title:`This panel's query could not be opened`,children:V.error.message})}):G?(0,w.jsx)(x,{search:G,onSearch:W,context:{spec:I,vars:k,panel:L,compose:L?e=>ee(L,e):void 0,onDirtyChange:Y,cancel:Z.request,save:{label:A?`Save panel`:`Add panel`,run:re},initial:A?.query&&V.data&&!V.data.editable?{query:A.query,formatted:V.data}:void 0}}):(0,w.jsx)(i,{state:`loading`,loadingLabel:`Loading the panel's query`,rows:3})]})}export{k as default}; \ No newline at end of file diff --git a/internal/ui/dist/assets/routes-DtOHorVT.js b/internal/ui/dist/assets/routes-B_nNwfNN.js similarity index 55% rename from internal/ui/dist/assets/routes-DtOHorVT.js rename to internal/ui/dist/assets/routes-B_nNwfNN.js index a30b069b..ea819109 100644 --- a/internal/ui/dist/assets/routes-DtOHorVT.js +++ b/internal/ui/dist/assets/routes-B_nNwfNN.js @@ -1 +1 @@ -import{li as e,mi as t}from"./index-CL2Ww4um.js";var n=t();function r(){return(0,n.jsx)(e,{to:`/dashboards`,replace:!0})}export{r as component}; \ No newline at end of file +import{li as e,mi as t}from"./index-CRKDYJaJ.js";var n=t();function r(){return(0,n.jsx)(e,{to:`/dashboards`,replace:!0})}export{r as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/save-dialog-CVDkqzuX.js b/internal/ui/dist/assets/save-dialog-jF2dwSKX.js similarity index 99% rename from internal/ui/dist/assets/save-dialog-CVDkqzuX.js rename to internal/ui/dist/assets/save-dialog-jF2dwSKX.js index a0687f77..94864742 100644 --- a/internal/ui/dist/assets/save-dialog-CVDkqzuX.js +++ b/internal/ui/dist/assets/save-dialog-jF2dwSKX.js @@ -1,4 +1,4 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as t,At as n,Gt as r,Kn as i,Lt as a,Q as o,X as s,Xn as c,Y as l,an as u,dr as d,et as f,gi as p,it as m,lt as h,mi as g,nr as _,nt as v,or as y,ot as b,pn as x,qn as S,wr as ee}from"./index-CL2Ww4um.js";import{h as te,i as ne,m as re}from"./toolbar-BxU8wfSr.js";var ie={exemplars:b,trace:f,span:ne},C=e(p(),1),ae=[],oe=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t>1;if(e=oe[r])t=r+1;else return!0;if(t==n)return!1}}function ce(e){return e>=127462&&e<=127487}var le=8205;function ue(e,t,n=!0,r=!0){return(n?de:fe)(e,t,r)}function de(e,t,n){if(t==e.length)return t;t&&me(e.charCodeAt(t))&&he(e.charCodeAt(t-1))&&t--;let r=pe(e,t);for(t+=ge(r);t=0&&ce(pe(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function fe(e,t,n){for(;t>1;){let r=de(e,t-2,n);if(r=56320&&e<57344}function he(e){return e>=55296&&e<56320}function ge(e){return e<65536?1:2}var w=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Ee(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),ve.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ee(this,e,t);let n=[];return this.decompose(e,t,n,0),ve.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Se(this),i=new Se(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Se(this,e)}iterRange(e,t=this.length){return new Ce(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new we(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new _e(t):ve.from(_e.split(t,[]))}},_e=class e extends w{constructor(e,t=ye(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Te(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(xe(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=be(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Ee(this,t,n);let i=be(this.text,be(r.text,xe(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):ve.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=` +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as t,At as n,Gt as r,Kn as i,Lt as a,Q as o,X as s,Xn as c,Y as l,an as u,dr as d,et as f,gi as p,it as m,lt as h,mi as g,nr as _,nt as v,or as y,ot as b,pn as x,qn as S,wr as ee}from"./index-CRKDYJaJ.js";import{h as te,i as ne,m as re}from"./toolbar-DsH2ghVs.js";var ie={exemplars:b,trace:f,span:ne},C=e(p(),1),ae=[],oe=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t>1;if(e=oe[r])t=r+1;else return!0;if(t==n)return!1}}function ce(e){return e>=127462&&e<=127487}var le=8205;function ue(e,t,n=!0,r=!0){return(n?de:fe)(e,t,r)}function de(e,t,n){if(t==e.length)return t;t&&me(e.charCodeAt(t))&&he(e.charCodeAt(t-1))&&t--;let r=pe(e,t);for(t+=ge(r);t=0&&ce(pe(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function fe(e,t,n){for(;t>1;){let r=de(e,t-2,n);if(r=56320&&e<57344}function he(e){return e>=55296&&e<56320}function ge(e){return e<65536?1:2}var w=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Ee(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),ve.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ee(this,e,t);let n=[];return this.decompose(e,t,n,0),ve.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Se(this),i=new Se(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Se(this,e)}iterRange(e,t=this.length){return new Ce(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new we(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new _e(t):ve.from(_e.split(t,[]))}},_e=class e extends w{constructor(e,t=ye(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Te(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(xe(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=be(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Ee(this,t,n);let i=be(this.text,be(r.text,xe(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):ve.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=` `){[e,t]=Ee(this,e,t);let r=``;for(let i=0,a=0;i<=t&&ae&&a&&(r+=n),ei&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},ve=class e extends w{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=Ee(this,t,n),r.lines=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=` `){[e,t]=Ee(this,e,t);let r=``;for(let i=0,a=0;ie&&i&&(r+=n),ea&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new _e(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof _e&&c&&(n=u[u.length-1])instanceof _e&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new _e(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};w.empty=new _e([``],0);function ye(e){let t=-1;for(let n of e)t+=n.length+1;return t}function be(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a=n&&(c>r&&(s=s.slice(0,r-i)),i0?1:(e instanceof _e?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof _e?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(r instanceof _e){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof _e?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Ce=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new Se(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},we=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(w.prototype[Symbol.iterator]=function(){return this.iter()},Se.prototype[Symbol.iterator]=Ce.prototype[Symbol.iterator]=we.prototype[Symbol.iterator]=function(){return this});var Te=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function Ee(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function T(e,t,n=!0,r=!0){return ue(e,t,n,r)}function De(e){return e>=56320&&e<57344}function Oe(e){return e>=55296&&e<56320}function ke(e,t){let n=e.charCodeAt(t);if(!Oe(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return De(r)?(n-55296<<10)+(r-56320)+65536:n}function Ae(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function je(e){return e<65536?1:2}var Me=/\r\n?|\n/,Ne=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Ne||={}),Pe=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return i+(e-r);i+=o}else{if(n!=Ne.Simple&&c>=e&&(n==Ne.TrackDel&&re||n==Ne.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&o>=e)return rt?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},Fe=class e extends Pe{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return Le(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Re(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length0&&Ie(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;os||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?w.of(l.split(r||Me)):l:w.empty,d=u.length;if(e==s&&d==0)return;eo&&E(i,e-o,-1),E(i,s-e,d),Ie(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;et&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Ie(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function Re(e,t,n,r=!1){let i=[],a=r?[]:null,o=new Be(e),s=new Be(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);E(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len=0&&e=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.lent||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var Be=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?w.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?w.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},Ve=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return D.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return D.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return D.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},D=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>Ve.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;ie.from-t.from),n=t.indexOf(r);for(let r=1;ri.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function He(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var Ue=0,O=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Ue++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:We),!!t.static,t.enables)}of(e){return new Ge([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Ge(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Ge(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function We(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var Ge=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Ue++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||qe(e,c)){let r=t(e);if(a?!Ke(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=ot(o,c);if(this.dependencies.every(t=>t instanceof O?o.facet(t)===e.facet(t):t instanceof Xe?o.field(t,!1)==e.field(t,!1):!0)||(a?Ke(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function Ke(e,t,n){if(e.length!=t.length)return!1;for(let r=0;re[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;te===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(Ye).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Ye),i=n.facet(Ye),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,Ye.of({field:this,create:e})]}get extension(){return this}},Ze={lowest:4,low:3,default:2,high:1,highest:0};function Qe(e){return t=>new et(t,e)}var $e={highest:Qe(Ze.highest),high:Qe(Ze.high),default:Qe(Ze.default),low:Qe(Ze.low),lowest:Qe(Ze.lowest)},et=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},tt=class e{of(e){return new nt(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},nt=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},rt=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of it(t,n,o))e instanceof Xe?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,We(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>Je(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function it(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof nt&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof nt){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof et)a(e.inner,e.prec);else if(e instanceof Xe)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof Ge)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,Ze.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,Ze.default),r.reduce((e,t)=>e.concat(t))}function at(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function ot(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var st=O.define(),ct=O.define({combine:e=>e.some(e=>e),static:!0}),lt=O.define({combine:e=>e.length?e[0]:void 0,static:!0}),ut=O.define(),dt=O.define(),ft=O.define(),pt=O.define({combine:e=>e.length?e[0]:!1}),mt=class{constructor(e,t){this.type=e,this.value=t}static define(){return new ht}},ht=class{of(e){return new mt(this,e)}},gt=class{constructor(e){this.map=e}of(e){return new k(this,e)}},k=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new gt(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};k.reconfigure=k.define(),k.appendConfig=k.define();var A=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&He(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};A.time=mt.define(),A.userEvent=mt.define(),A.addToHistory=mt.define(),A.remote=mt.define();function _t(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r=e[r]))a=e[r++],o=e[r++];else if(i=0;n--){let i=r[n](e);e=i instanceof A?i:Array.isArray(i)&&i.length==1&&i[0]instanceof A?i[0]:bt(t,wt(i),!1)}return e}function St(e){let t=e.startState,n=t.facet(ft),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=vt(r,yt(t,a,e.changes.newLength),!0))}return r==e?e:A.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Ct=[];function wt(e){return e==null?Ct:Array.isArray(e)?e:[e]}var Tt=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(Tt||={}),Et=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Dt;try{Dt=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function Ot(e){if(Dt)return Dt.test(e);for(let t=0;t`€`&&(n.toUpperCase()!=n.toLowerCase()||Et.test(n)))return!0}return!1}function kt(e){return t=>{if(!/\S/.test(t))return Tt.Space;if(Ot(t))return Tt.Word;for(let n=0;n-1)return Tt.Word;return Tt.Other}}var j=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;ei.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(k.reconfigure)?(n=null,r=e.value):e.is(k.appendConfig)&&(n=null,r=wt(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=rt.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(ct)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:D.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=wt(n.effects);for(let n=1;nn.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:D.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=rt.resolve(t.extensions||[],new Map),r=t.doc instanceof w?t.doc:w.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||Me)),i=t.selection?t.selection instanceof D?t.selection:D.single(t.selection.anchor,t.selection.head):D.single(0);return He(i,r.length),n.staticFacet(ct)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||` diff --git a/internal/ui/dist/assets/search-page-D3PsJ82P.js b/internal/ui/dist/assets/search-page-CojucVCz.js similarity index 96% rename from internal/ui/dist/assets/search-page-D3PsJ82P.js rename to internal/ui/dist/assets/search-page-CojucVCz.js index d8821736..a7491d5a 100644 --- a/internal/ui/dist/assets/search-page-D3PsJ82P.js +++ b/internal/ui/dist/assets/search-page-CojucVCz.js @@ -1 +1 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{n as t,t as n}from"./live-data-meta-CGsP1XrP.js";import{$t as r,Gt as i,Jt as a,Kt as o,Lt as s,Yn as c,an as l,ar as u,c as ee,dr as d,ft as f,gi as p,l as m,mi as h,nr as g,or as _,qn as v,st as y,wr as b,y as te}from"./index-CL2Ww4um.js";import{t as x}from"./NumberInput-DMNGxCQ3.js";import{a as ne,c as re,d as ie,f as S,h as ae,m as oe,r as se,t as ce,u as le}from"./toolbar-BxU8wfSr.js";import{W as ue,a as C,i as de,n as fe,o as pe,s as me,t as he}from"./save-dialog-CVDkqzuX.js";import{t as w}from"./loading-skeleton-BsD5_HiB.js";var T=e(p(),1),E=h(),D=e=>`'${e.replaceAll(`'`,`''`)}'`,O=e=>{let t=typeof e==`string`&&e?JSON.parse(e):null;return t&&typeof t==`object`&&!Array.isArray(t)?t:{}};async function k(e,t){let n=Number(e.time),r={from:new Date(n-1).toISOString(),to:new Date(n+1).toISOString(),refresh:`off`},i=Array.from(String(e.body??``)),a=i.length===2e3&&i[1999]===`…`?`starts_with(body, ${D(i.slice(0,1999).join(``))})`:`coalesce(body, '') = ${D(i.join(``))}`,o=`SELECT attributes, resource, coalesce(span_id, ''), coalesce(scope_name, '') FROM logs WHERE $__window(time) AND coalesce(service, '') = ${D(String(e.service??``))} AND coalesce(namespace, '') = ${D(String(e.namespace??``))} AND coalesce(trace_id, '') = ${D(String(e.trace_id??``))} AND ${a} LIMIT 1`,[s]=await y({dashboard:{version:1,name:`Log`,time:r,panels:[{id:`log`,title:`Log`,viz:`table`,sql:o}]},panels:[`log`],time:r},t);if(s?.status===`error`||s?.status===`invalid`)throw Error(s.error??`The log details could not load.`);let c=s?.frame?.values;if(!c||!s.frame?.rows)throw Error(`This log is no longer stored.`);return{attributes:O(c[0][0]),resource:O(c[1][0]),span_id:String(c[2][0]??``),scope:String(c[3][0]??``)}}function ge({row:e,onTrace:t}){let n=l({queryKey:[`log-extras`,e],queryFn:({signal:t})=>k(e,t),retry:!1,staleTime:1/0}),i=typeof e.trace_id==`string`?e.trace_id:``;return(0,E.jsxs)(v,{gap:`xs`,py:4,"data-log-details":!0,onClick:e=>e.stopPropagation(),style:{cursor:`auto`},children:[i&&(0,E.jsx)(b,{children:(0,E.jsx)(r,{label:`Log metadata`,items:[{label:`Trace`,value:t?(0,E.jsx)(u,{component:`button`,type:`button`,size:`sm`,ff:`monospace`,onClick:t,style:{overflowWrap:`anywhere`},children:i}):(0,E.jsx)(_,{span:!0,inherit:!0,ff:`monospace`,children:i})},...n.data?.span_id?[{label:`Span`,value:(0,E.jsx)(_,{span:!0,inherit:!0,ff:`monospace`,children:n.data.span_id})}]:[]]})}),n.isLoading&&(0,E.jsx)(o,{state:`loading`,loadingLabel:`Loading log details`,skeleton:(0,E.jsx)(w,{shape:`key_value`,rows:3})}),n.error&&(0,E.jsx)(b,{p:`xs`,children:(0,E.jsx)(o,{state:`error`,error:{message:n.error.message,onRetry:()=>void n.refetch()}})}),n.data&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S,{label:`Attributes`,values:n.data.attributes}),(0,E.jsx)(S,{label:`Resource`,values:n.data.resource}),n.data.scope&&(0,E.jsx)(b,{children:(0,E.jsx)(r,{items:[{label:`Instrumentation scope`,value:(0,E.jsx)(_,{span:!0,inherit:!0,ff:`monospace`,children:n.data.scope})}]})})]})]})}var A={name:`Logs`,source:`logs`,viz:`logs`,fields:[`service`,`severity`],sorts:[{value:`time`,label:`Newest`},{value:`+time`,label:`Oldest`}],example:`service:checkout severity>=warn`,matching:`Bare words match anywhere in the body; body:x matches the whole body and body~x any part of it.`},j={name:`Traces`,source:`spans`,viz:`traces`,fields:[`service`,`errors`,`slower`],sorts:[{value:`duration_ms`,label:`Slowest`},{value:`+start`,label:`Oldest`}],example:`status:error duration>500ms`,matching:`Bare words match anywhere in the operation; operation:x matches the whole operation and operation~x any part of it.`},M=`search`,_e=[{value:`debug`,label:`Debug and above`},{value:`info`,label:`Info and above`},{value:`warn`,label:`Warn and above`},{value:`error`,label:`Error and above`},{value:`fatal`,label:`Fatal`}];function ve(e,t){let n=[];return e.fields.includes(`service`)&&t.service&&n.push(`service:"${t.service.replaceAll(`"`,`""`)}"`),e.fields.includes(`severity`)&&t.severity&&n.push(`severity>=${t.severity}`),e.fields.includes(`errors`)&&t.errors&&n.push(`status:error`),e.fields.includes(`slower`)&&t.slower&&n.push(`duration>${t.slower}ms`),n.join(` `)}var N=560,ye=100,be=e=>e.reason===`busy`?{...e,error:`Not run: other queries kept the server busy. Run the search again.`}:e,xe=(e,t)=>e.trim()&&t?`(${e}) ${t}`:e.trim()?e:t,Se=e=>`"${e.replaceAll(`"`,`""`)}"`,P=e=>/\bstatus\b/i.test(e.replace(/'(?:[^']|'')*'|"(?:[^"]|"")*"/g,`''`));async function Ce(e){let t=e?.where??[],n=``;return t.length>0&&(n=(await C({query:{from:`spans`,where:t},viz:`traces`})).where.filter((e,n)=>!e.startsWith(`-`)&&!P(t[n]??``)).map(e=>/\bor\b/i.test(e)?`(${e})`:e).join(` `)),`spans${n?` where ${n}`:``} | count(), error_rate(), p95(duration) by service sort error_rate`}function F({preset:e,search:r,onSearch:o,onSaved:p,onExplore:m}){let[h,x]=(0,T.useState)(r.q),[S,C]=(0,T.useState)([]),[w,D]=(0,T.useState)({shift:0,length:0}),[O,k]=(0,T.useState)([]),[A,j]=(0,T.useState)(),[P,F]=(0,T.useState)(),[I,L]=(0,T.useState)(!1),[R,z]=(0,T.useState)(),B=(0,T.useRef)(void 0),V=(0,T.useRef)(null),Te=(0,T.useId)(),[Ee,De]=(0,T.useState)(),H=ee(r),U=`${r.range}|${r.from??``}|${r.to??``}`,W=r.sort&&e.sorts.some(e=>e.value===r.sort)?r.sort:e.sorts[0].value,G=(0,T.useRef)(h);G.current=h;let K=ve(e,r.picks??{}),Oe=(0,T.useRef)(K);Oe.current=K;let q=l({...f,enabled:e.fields.includes(`service`)}),J=e=>o({...r,picks:{...r.picks,...e}}),Y=(0,T.useRef)(r.q),X=(0,T.useRef)(r);X.current=r;let ke=(0,T.useRef)(o);ke.current=o;let Ae=(0,T.useRef)(W);Ae.current=W,(0,T.useEffect)(()=>()=>B.current?.abort(),[]);let Z=async(t,n)=>{B.current?.abort();let r=new AbortController;B.current=r,L(!0),j(void 0),C([]),k([]);try{let i=Oe.current,a=xe(t,i),s=t.trim()&&i?1:0;D({shift:s,length:Array.from(t).length});let c=await pe({text:a,source:e.source,viz:e.viz,window:H.from&&H.to?void 0:H.range},r.signal);if(r.signal.aborted)return;G.current===t&&k(c.notices);let l={id:M,title:fe(`${e.name}: ${[t.trim(),i].filter(Boolean).join(` `)||`all`}`),viz:e.viz,query:{...c.query,sort:n}},u=t!==Y.current;Y.current=t,o({...X.current,q:t,sort:n,...u?{drill:void 0}:{}},!u);let ee={version:1,name:e.name,time:H,panels:[l]},d=V.current?.clientWidth||960,f=await y({dashboard:ee,panels:[M],time:H,widths:{[M]:d}},r.signal);if(r.signal.aborted)return;let p=f.find(e=>e.id===M);if(!p)throw Error(`The search returned no result.`);if(p.status===`invalid`){G.current===t&&C(p.problems??[]);return}De(Date.now()),F({text:t,terms:i,sort:n,window:U,panel:l,result:se(be(p),[M])})}catch(e){if(r.signal.aborted)return;e instanceof s&&e.problems.length>0?G.current===t&&C(e.problems):j(e instanceof Error?e.message:`Request failed`)}finally{B.current===r&&L(!1)}},je=(0,T.useRef)(Z);je.current=Z;let Me=(0,T.useRef)(()=>void 0);Me.current=()=>void Z(G.current,W),(0,T.useEffect)(()=>{Me.current()},[U,W,K]),(0,T.useEffect)(()=>{r.q!==Y.current&&(Y.current=r.q,x(r.q),Z(r.q,W))},[r.q]);let Ne=(0,T.useMemo)(()=>{let e=e=>e&&e.start>=w.shift&&e.end-w.shift<=w.length?{start:e.start-w.shift,end:e.end-w.shift}:void 0,t=t=>({...t,span:e(t.span),fix_its:t.fix_its?.flatMap(t=>{let n=e(t.span);return n?[{...t,span:n}]:[]})});return{problems:S.map(t),notices:O.map(t)}},[S,O,w]),Q=(0,T.useRef)(P);Q.current=P;let Pe=(0,T.useRef)(h);Pe.current=h;let $=(0,T.useCallback)(e=>{let t=Q.current;if(!t)return;let n=re(t.panel,t.result,e,{});n&&ke.current({...X.current,drill:JSON.stringify(n.target)})},[]),Fe=(0,T.useMemo)(()=>({page:ye,details:e.viz===`logs`?e=>(0,E.jsx)(ge,{row:e,onTrace:()=>{let t=Q.current;t&&$(ie(t.panel,t.result).selection(e))}}):void 0,exclude:e.viz===`traces`?(e,t)=>{let n=Pe.current.trim(),r=[/\bor\b/i.test(n)?`(${n})`:n,`-${e}:${Se(t)}`].filter(Boolean).join(` `);x(r),je.current(r,Ae.current)}:void 0}),[e.viz,$]),Ie=P!==void 0&&(P.text!==h||P.terms!==K||P.sort!==W||P.window!==U),Le=P!==void 0&&!Ie&&!I&&P.result.status===`ok`&&(P.result.frame?.rows??0)>0;return(0,E.jsxs)(v,{gap:`md`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,maw:1600,mx:`auto`,"data-search-page":e.viz,children:[(0,E.jsxs)(d,{justify:`space-between`,align:`flex-end`,children:[(0,E.jsx)(a,{title:e.name,description:e.name===`Logs`?`Search and inspect log events.`:`Find slow requests and inspect their traces.`,meta:(0,E.jsx)(n,{time:H,updatedAt:P?Ee:null})}),(0,E.jsx)(ce,{inHeader:!0,time:H,onRange:e=>o({...r,range:e,from:void 0,to:void 0}),onAbsolute:(e,t)=>o({...r,from:e,to:t})})]}),(0,E.jsxs)(v,{gap:`xs`,children:[(0,E.jsxs)(_,{id:Te,size:`xs`,c:`dimmed`,children:[`Filter with PitotQL, for example `,(0,E.jsx)(`code`,{children:e.example}),`. `,e.matching,` Press Enter to search.`]}),(0,E.jsx)(me,{value:h,label:`Search ${e.name.toLowerCase()}`,describedBy:Te,problems:Ne.problems,notices:Ne.notices,onChange:e=>{x(e),C([]),k([])},onRun:()=>void Z(h,W),complete:(t,n,r)=>de({text:t,cursor:n,source:e.source,viz:e.viz,...H.from&&H.to?{from:H.from,to:H.to}:{window:H.range}},r)})]}),(0,E.jsxs)(d,{gap:`sm`,align:`flex-end`,"data-search-fields":!0,children:[e.fields.includes(`service`)&&(0,E.jsx)(oe,{label:`Service`,placeholder:q.isPending?`Loading services…`:`All services`,w:220,clearable:!0,searchable:!0,value:r.picks?.service??null,error:q.isError&&(0,E.jsxs)(E.Fragment,{children:[`Services did not load. `,(0,E.jsx)(u,{component:`button`,type:`button`,fz:`xs`,onClick:()=>void q.refetch(),children:`Retry`})]}),data:[...new Set([...r.picks?.service?[r.picks.service]:[],...(q.data?.services??[]).map(e=>e.value)])],onChange:e=>J({service:e??void 0})}),e.fields.includes(`severity`)&&(0,E.jsx)(oe,{label:`Severity`,placeholder:`Any severity`,w:180,clearable:!0,value:r.picks?.severity??null,data:_e,onChange:e=>J({severity:e??void 0})}),e.fields.includes(`slower`)&&(0,E.jsx)(we,{value:r.picks?.slower,onCommit:e=>J({slower:e})}),e.fields.includes(`errors`)&&(0,E.jsx)(t,{label:`Errors only`,mb:8,checked:r.picks?.errors===`1`,onChange:e=>J({errors:e.currentTarget.checked?`1`:void 0})})]}),(0,E.jsxs)(d,{justify:`space-between`,children:[(0,E.jsxs)(d,{gap:`xs`,children:[(0,E.jsx)(g,{loading:I,onClick:()=>void Z(h,W),children:`Search`}),(0,E.jsx)(ae,{size:`sm`,"aria-label":`Order`,value:W,data:[...e.sorts],onChange:e=>o({...r,sort:e})}),e.viz===`traces`&&m&&(0,E.jsx)(c,{label:`Error rate of the matching spans in each service, in Explore. Status and excluded terms are left out.`,children:(0,E.jsx)(g,{variant:`subtle`,size:`xs`,disabled:!P,onClick:()=>{P&&Ce(P.panel.query).then(m,e=>j(e instanceof Error?e.message:`Request failed`))},children:`Span error rates by service`})})]}),(0,E.jsx)(c,{label:`Search for something that returns rows first`,disabled:Le,children:(0,E.jsx)(`span`,{children:(0,E.jsx)(g,{variant:`default`,disabled:!Le,onClick:()=>P&&z(P.panel),children:`Save to dashboard`})})})]}),A&&(0,E.jsx)(i,{tone:`danger`,title:`The search could not run`,children:A}),(0,E.jsx)(b,{ref:V,children:P&&(0,E.jsxs)(v,{gap:`xs`,children:[Ie&&(0,E.jsx)(_,{size:`sm`,fw:600,role:`status`,children:`Result of the last search · filters have changed`}),(0,E.jsx)(b,{h:N,children:(0,E.jsx)(ne,{panel:P.panel,title:P.panel.title,result:P.result,loading:I,height:N,group:`search-${e.viz}`,editing:!1,agentAvailable:!1,range:H.range,onRetry:()=>void Z(P.text,P.sort),traceLinks:`button`,controls:Fe,onPoint:$})})]})}),P&&(0,E.jsx)(le,{client:ue,spec:{version:1,name:e.name,time:H,panels:[{...P.panel,title:`this search`}]},time:H,vars:{},target:te(r.drill),onChange:e=>o({...r,drill:e?JSON.stringify(e):void 0})}),R&&(0,E.jsx)(he,{panel:R,time:H,onClose:()=>z(void 0),onSaved:p})]})}function we({value:e,onCommit:t}){let[n,r]=(0,T.useState)(e?Number(e):``);(0,T.useEffect)(()=>{r(e?Number(e):``)},[e]);let i=()=>{let r=typeof n==`number`&&n>=1?String(Math.min(m,Math.floor(n))):void 0;r!==e&&t(r)};return(0,E.jsx)(x,{label:`Slower than (ms)`,w:160,min:1,max:m,clampBehavior:`strict`,value:n,onChange:r,onBlur:i,onKeyDown:e=>{e.key===`Enter`&&i()}})}export{A as n,j as r,F as t}; \ No newline at end of file +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{n as t,t as n}from"./live-data-meta-D4rcFCF2.js";import{$t as r,Gt as i,Jt as a,Kt as o,Lt as s,Yn as c,an as l,ar as u,c as ee,dr as d,ft as f,gi as p,l as m,mi as h,nr as g,or as _,qn as v,st as y,wr as b,y as te}from"./index-CRKDYJaJ.js";import{t as x}from"./NumberInput-C4qWjk_e.js";import{a as ne,c as re,d as ie,f as S,h as ae,m as oe,r as se,t as ce,u as le}from"./toolbar-DsH2ghVs.js";import{W as ue,a as C,i as de,n as fe,o as pe,s as me,t as he}from"./save-dialog-jF2dwSKX.js";import{t as w}from"./loading-skeleton-BgW8PQ9g.js";var T=e(p(),1),E=h(),D=e=>`'${e.replaceAll(`'`,`''`)}'`,O=e=>{let t=typeof e==`string`&&e?JSON.parse(e):null;return t&&typeof t==`object`&&!Array.isArray(t)?t:{}};async function k(e,t){let n=Number(e.time),r={from:new Date(n-1).toISOString(),to:new Date(n+1).toISOString(),refresh:`off`},i=Array.from(String(e.body??``)),a=i.length===2e3&&i[1999]===`…`?`starts_with(body, ${D(i.slice(0,1999).join(``))})`:`coalesce(body, '') = ${D(i.join(``))}`,o=`SELECT attributes, resource, coalesce(span_id, ''), coalesce(scope_name, '') FROM logs WHERE $__window(time) AND coalesce(service, '') = ${D(String(e.service??``))} AND coalesce(namespace, '') = ${D(String(e.namespace??``))} AND coalesce(trace_id, '') = ${D(String(e.trace_id??``))} AND ${a} LIMIT 1`,[s]=await y({dashboard:{version:1,name:`Log`,time:r,panels:[{id:`log`,title:`Log`,viz:`table`,sql:o}]},panels:[`log`],time:r},t);if(s?.status===`error`||s?.status===`invalid`)throw Error(s.error??`The log details could not load.`);let c=s?.frame?.values;if(!c||!s.frame?.rows)throw Error(`This log is no longer stored.`);return{attributes:O(c[0][0]),resource:O(c[1][0]),span_id:String(c[2][0]??``),scope:String(c[3][0]??``)}}function ge({row:e,onTrace:t}){let n=l({queryKey:[`log-extras`,e],queryFn:({signal:t})=>k(e,t),retry:!1,staleTime:1/0}),i=typeof e.trace_id==`string`?e.trace_id:``;return(0,E.jsxs)(v,{gap:`xs`,py:4,"data-log-details":!0,onClick:e=>e.stopPropagation(),style:{cursor:`auto`},children:[i&&(0,E.jsx)(b,{children:(0,E.jsx)(r,{label:`Log metadata`,items:[{label:`Trace`,value:t?(0,E.jsx)(u,{component:`button`,type:`button`,size:`sm`,ff:`monospace`,onClick:t,style:{overflowWrap:`anywhere`},children:i}):(0,E.jsx)(_,{span:!0,inherit:!0,ff:`monospace`,children:i})},...n.data?.span_id?[{label:`Span`,value:(0,E.jsx)(_,{span:!0,inherit:!0,ff:`monospace`,children:n.data.span_id})}]:[]]})}),n.isLoading&&(0,E.jsx)(o,{state:`loading`,loadingLabel:`Loading log details`,skeleton:(0,E.jsx)(w,{shape:`key_value`,rows:3})}),n.error&&(0,E.jsx)(b,{p:`xs`,children:(0,E.jsx)(o,{state:`error`,error:{message:n.error.message,onRetry:()=>void n.refetch()}})}),n.data&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S,{label:`Attributes`,values:n.data.attributes}),(0,E.jsx)(S,{label:`Resource`,values:n.data.resource}),n.data.scope&&(0,E.jsx)(b,{children:(0,E.jsx)(r,{items:[{label:`Instrumentation scope`,value:(0,E.jsx)(_,{span:!0,inherit:!0,ff:`monospace`,children:n.data.scope})}]})})]})]})}var A={name:`Logs`,source:`logs`,viz:`logs`,fields:[`service`,`severity`],sorts:[{value:`time`,label:`Newest`},{value:`+time`,label:`Oldest`}],example:`service:checkout severity>=warn`,matching:`Bare words match anywhere in the body; body:x matches the whole body and body~x any part of it.`},j={name:`Traces`,source:`spans`,viz:`traces`,fields:[`service`,`errors`,`slower`],sorts:[{value:`duration_ms`,label:`Slowest`},{value:`+start`,label:`Oldest`}],example:`status:error duration>500ms`,matching:`Bare words match anywhere in the operation; operation:x matches the whole operation and operation~x any part of it.`},M=`search`,_e=[{value:`debug`,label:`Debug and above`},{value:`info`,label:`Info and above`},{value:`warn`,label:`Warn and above`},{value:`error`,label:`Error and above`},{value:`fatal`,label:`Fatal`}];function ve(e,t){let n=[];return e.fields.includes(`service`)&&t.service&&n.push(`service:"${t.service.replaceAll(`"`,`""`)}"`),e.fields.includes(`severity`)&&t.severity&&n.push(`severity>=${t.severity}`),e.fields.includes(`errors`)&&t.errors&&n.push(`status:error`),e.fields.includes(`slower`)&&t.slower&&n.push(`duration>${t.slower}ms`),n.join(` `)}var N=560,ye=100,be=e=>e.reason===`busy`?{...e,error:`Not run: other queries kept the server busy. Run the search again.`}:e,xe=(e,t)=>e.trim()&&t?`(${e}) ${t}`:e.trim()?e:t,Se=e=>`"${e.replaceAll(`"`,`""`)}"`,P=e=>/\bstatus\b/i.test(e.replace(/'(?:[^']|'')*'|"(?:[^"]|"")*"/g,`''`));async function Ce(e){let t=e?.where??[],n=``;return t.length>0&&(n=(await C({query:{from:`spans`,where:t},viz:`traces`})).where.filter((e,n)=>!e.startsWith(`-`)&&!P(t[n]??``)).map(e=>/\bor\b/i.test(e)?`(${e})`:e).join(` `)),`spans${n?` where ${n}`:``} | count(), error_rate(), p95(duration) by service sort error_rate`}function F({preset:e,search:r,onSearch:o,onSaved:p,onExplore:m}){let[h,x]=(0,T.useState)(r.q),[S,C]=(0,T.useState)([]),[w,D]=(0,T.useState)({shift:0,length:0}),[O,k]=(0,T.useState)([]),[A,j]=(0,T.useState)(),[P,F]=(0,T.useState)(),[I,L]=(0,T.useState)(!1),[R,z]=(0,T.useState)(),B=(0,T.useRef)(void 0),V=(0,T.useRef)(null),Te=(0,T.useId)(),[Ee,De]=(0,T.useState)(),H=ee(r),U=`${r.range}|${r.from??``}|${r.to??``}`,W=r.sort&&e.sorts.some(e=>e.value===r.sort)?r.sort:e.sorts[0].value,G=(0,T.useRef)(h);G.current=h;let K=ve(e,r.picks??{}),Oe=(0,T.useRef)(K);Oe.current=K;let q=l({...f,enabled:e.fields.includes(`service`)}),J=e=>o({...r,picks:{...r.picks,...e}}),Y=(0,T.useRef)(r.q),X=(0,T.useRef)(r);X.current=r;let ke=(0,T.useRef)(o);ke.current=o;let Ae=(0,T.useRef)(W);Ae.current=W,(0,T.useEffect)(()=>()=>B.current?.abort(),[]);let Z=async(t,n)=>{B.current?.abort();let r=new AbortController;B.current=r,L(!0),j(void 0),C([]),k([]);try{let i=Oe.current,a=xe(t,i),s=t.trim()&&i?1:0;D({shift:s,length:Array.from(t).length});let c=await pe({text:a,source:e.source,viz:e.viz,window:H.from&&H.to?void 0:H.range},r.signal);if(r.signal.aborted)return;G.current===t&&k(c.notices);let l={id:M,title:fe(`${e.name}: ${[t.trim(),i].filter(Boolean).join(` `)||`all`}`),viz:e.viz,query:{...c.query,sort:n}},u=t!==Y.current;Y.current=t,o({...X.current,q:t,sort:n,...u?{drill:void 0}:{}},!u);let ee={version:1,name:e.name,time:H,panels:[l]},d=V.current?.clientWidth||960,f=await y({dashboard:ee,panels:[M],time:H,widths:{[M]:d}},r.signal);if(r.signal.aborted)return;let p=f.find(e=>e.id===M);if(!p)throw Error(`The search returned no result.`);if(p.status===`invalid`){G.current===t&&C(p.problems??[]);return}De(Date.now()),F({text:t,terms:i,sort:n,window:U,panel:l,result:se(be(p),[M])})}catch(e){if(r.signal.aborted)return;e instanceof s&&e.problems.length>0?G.current===t&&C(e.problems):j(e instanceof Error?e.message:`Request failed`)}finally{B.current===r&&L(!1)}},je=(0,T.useRef)(Z);je.current=Z;let Me=(0,T.useRef)(()=>void 0);Me.current=()=>void Z(G.current,W),(0,T.useEffect)(()=>{Me.current()},[U,W,K]),(0,T.useEffect)(()=>{r.q!==Y.current&&(Y.current=r.q,x(r.q),Z(r.q,W))},[r.q]);let Ne=(0,T.useMemo)(()=>{let e=e=>e&&e.start>=w.shift&&e.end-w.shift<=w.length?{start:e.start-w.shift,end:e.end-w.shift}:void 0,t=t=>({...t,span:e(t.span),fix_its:t.fix_its?.flatMap(t=>{let n=e(t.span);return n?[{...t,span:n}]:[]})});return{problems:S.map(t),notices:O.map(t)}},[S,O,w]),Q=(0,T.useRef)(P);Q.current=P;let Pe=(0,T.useRef)(h);Pe.current=h;let $=(0,T.useCallback)(e=>{let t=Q.current;if(!t)return;let n=re(t.panel,t.result,e,{});n&&ke.current({...X.current,drill:JSON.stringify(n.target)})},[]),Fe=(0,T.useMemo)(()=>({page:ye,details:e.viz===`logs`?e=>(0,E.jsx)(ge,{row:e,onTrace:()=>{let t=Q.current;t&&$(ie(t.panel,t.result).selection(e))}}):void 0,exclude:e.viz===`traces`?(e,t)=>{let n=Pe.current.trim(),r=[/\bor\b/i.test(n)?`(${n})`:n,`-${e}:${Se(t)}`].filter(Boolean).join(` `);x(r),je.current(r,Ae.current)}:void 0}),[e.viz,$]),Ie=P!==void 0&&(P.text!==h||P.terms!==K||P.sort!==W||P.window!==U),Le=P!==void 0&&!Ie&&!I&&P.result.status===`ok`&&(P.result.frame?.rows??0)>0;return(0,E.jsxs)(v,{gap:`md`,px:{base:`md`,sm:`xl`},pt:`lg`,pb:`xl`,maw:1600,mx:`auto`,"data-search-page":e.viz,children:[(0,E.jsxs)(d,{justify:`space-between`,align:`flex-end`,children:[(0,E.jsx)(a,{title:e.name,description:e.name===`Logs`?`Search and inspect log events.`:`Find slow requests and inspect their traces.`,meta:(0,E.jsx)(n,{time:H,updatedAt:P?Ee:null})}),(0,E.jsx)(ce,{inHeader:!0,time:H,onRange:e=>o({...r,range:e,from:void 0,to:void 0}),onAbsolute:(e,t)=>o({...r,from:e,to:t})})]}),(0,E.jsxs)(v,{gap:`xs`,children:[(0,E.jsxs)(_,{id:Te,size:`xs`,c:`dimmed`,children:[`Filter with PitotQL, for example `,(0,E.jsx)(`code`,{children:e.example}),`. `,e.matching,` Press Enter to search.`]}),(0,E.jsx)(me,{value:h,label:`Search ${e.name.toLowerCase()}`,describedBy:Te,problems:Ne.problems,notices:Ne.notices,onChange:e=>{x(e),C([]),k([])},onRun:()=>void Z(h,W),complete:(t,n,r)=>de({text:t,cursor:n,source:e.source,viz:e.viz,...H.from&&H.to?{from:H.from,to:H.to}:{window:H.range}},r)})]}),(0,E.jsxs)(d,{gap:`sm`,align:`flex-end`,"data-search-fields":!0,children:[e.fields.includes(`service`)&&(0,E.jsx)(oe,{label:`Service`,placeholder:q.isPending?`Loading services…`:`All services`,w:220,clearable:!0,searchable:!0,value:r.picks?.service??null,error:q.isError&&(0,E.jsxs)(E.Fragment,{children:[`Services did not load. `,(0,E.jsx)(u,{component:`button`,type:`button`,fz:`xs`,onClick:()=>void q.refetch(),children:`Retry`})]}),data:[...new Set([...r.picks?.service?[r.picks.service]:[],...(q.data?.services??[]).map(e=>e.value)])],onChange:e=>J({service:e??void 0})}),e.fields.includes(`severity`)&&(0,E.jsx)(oe,{label:`Severity`,placeholder:`Any severity`,w:180,clearable:!0,value:r.picks?.severity??null,data:_e,onChange:e=>J({severity:e??void 0})}),e.fields.includes(`slower`)&&(0,E.jsx)(we,{value:r.picks?.slower,onCommit:e=>J({slower:e})}),e.fields.includes(`errors`)&&(0,E.jsx)(t,{label:`Errors only`,mb:8,checked:r.picks?.errors===`1`,onChange:e=>J({errors:e.currentTarget.checked?`1`:void 0})})]}),(0,E.jsxs)(d,{justify:`space-between`,children:[(0,E.jsxs)(d,{gap:`xs`,children:[(0,E.jsx)(g,{loading:I,onClick:()=>void Z(h,W),children:`Search`}),(0,E.jsx)(ae,{size:`sm`,"aria-label":`Order`,value:W,data:[...e.sorts],onChange:e=>o({...r,sort:e})}),e.viz===`traces`&&m&&(0,E.jsx)(c,{label:`Error rate of the matching spans in each service, in Explore. Status and excluded terms are left out.`,children:(0,E.jsx)(g,{variant:`subtle`,size:`xs`,disabled:!P,onClick:()=>{P&&Ce(P.panel.query).then(m,e=>j(e instanceof Error?e.message:`Request failed`))},children:`Span error rates by service`})})]}),(0,E.jsx)(c,{label:`Search for something that returns rows first`,disabled:Le,children:(0,E.jsx)(`span`,{children:(0,E.jsx)(g,{variant:`default`,disabled:!Le,onClick:()=>P&&z(P.panel),children:`Save to dashboard`})})})]}),A&&(0,E.jsx)(i,{tone:`danger`,title:`The search could not run`,children:A}),(0,E.jsx)(b,{ref:V,children:P&&(0,E.jsxs)(v,{gap:`xs`,children:[Ie&&(0,E.jsx)(_,{size:`sm`,fw:600,role:`status`,children:`Result of the last search · filters have changed`}),(0,E.jsx)(b,{h:N,children:(0,E.jsx)(ne,{panel:P.panel,title:P.panel.title,result:P.result,loading:I,height:N,group:`search-${e.viz}`,editing:!1,agentAvailable:!1,range:H.range,onRetry:()=>void Z(P.text,P.sort),traceLinks:`button`,controls:Fe,onPoint:$})})]})}),P&&(0,E.jsx)(le,{client:ue,spec:{version:1,name:e.name,time:H,panels:[{...P.panel,title:`this search`}]},time:H,vars:{},target:te(r.drill),onChange:e=>o({...r,drill:e?JSON.stringify(e):void 0})}),R&&(0,E.jsx)(he,{panel:R,time:H,onClose:()=>z(void 0),onSaved:p})]})}function we({value:e,onCommit:t}){let[n,r]=(0,T.useState)(e?Number(e):``);(0,T.useEffect)(()=>{r(e?Number(e):``)},[e]);let i=()=>{let r=typeof n==`number`&&n>=1?String(Math.min(m,Math.floor(n))):void 0;r!==e&&t(r)};return(0,E.jsx)(x,{label:`Slower than (ms)`,w:160,min:1,max:m,clampBehavior:`strict`,value:n,onChange:r,onBlur:i,onKeyDown:e=>{e.key===`Enter`&&i()}})}export{A as n,j as r,F as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/settings-781S98c4.js b/internal/ui/dist/assets/settings-781S98c4.js deleted file mode 100644 index 4bda52a9..00000000 --- a/internal/ui/dist/assets/settings-781S98c4.js +++ /dev/null @@ -1 +0,0 @@ -import{n as e}from"./settings-_ddYdY9A.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/settings-BJGfad4E.js b/internal/ui/dist/assets/settings-BJGfad4E.js new file mode 100644 index 00000000..c39034da --- /dev/null +++ b/internal/ui/dist/assets/settings-BJGfad4E.js @@ -0,0 +1 @@ +import{n as e}from"./settings-CfrRZuaG.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/settings-_ddYdY9A.js b/internal/ui/dist/assets/settings-CfrRZuaG.js similarity index 98% rename from internal/ui/dist/assets/settings-_ddYdY9A.js rename to internal/ui/dist/assets/settings-CfrRZuaG.js index a2df8a64..2fe5cef7 100644 --- a/internal/ui/dist/assets/settings-_ddYdY9A.js +++ b/internal/ui/dist/assets/settings-CfrRZuaG.js @@ -1,4 +1,4 @@ -import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{t}from"./loading-skeleton-BsD5_HiB.js";import{$t as n,Ct as r,E as i,Et as a,Gn as o,Gt as s,It as c,Jt as l,Kn as u,Kt as d,Tt as f,Ut as p,Wt as m,Yn as h,Zt as g,_r as _,an as v,ar as y,dr as b,er as x,gi as S,gt as C,mi as w,nr as T,or as E,pn as D,qn as O,wr as k,wt as A,zt as j}from"./index-CL2Ww4um.js";import{t as M}from"./useMutation-BWRBtdcF.js";import{t as N}from"./CopyButton-CeHt7WhA.js";var P=e(S(),1),F=w(),I=[`settings`,`ingest`],L=[`settings`,`ingest`,`tokens`];function R(e,t){let n=e.trim();return t||/^https:\/\//i.test(n)||/:443$/.test(n)}function z(e,t,n){if(/^https?:\/\//i.test(e.trim()))try{let t=new URL(e);e=`${t.protocol}//${t.hostname}:${t.port||(t.protocol===`https:`?`443`:`80`)}`}catch{}let r=R(e,n)?``:` +import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{t}from"./loading-skeleton-BgW8PQ9g.js";import{$t as n,Ct as r,E as i,Et as a,Gn as o,Gt as s,It as c,Jt as l,Kn as u,Kt as d,Tt as f,Ut as p,Wt as m,Yn as h,Zt as g,_r as _,an as v,ar as y,dr as b,er as x,gi as S,gt as C,mi as w,nr as T,or as E,pn as D,qn as O,wr as k,wt as A,zt as j}from"./index-CRKDYJaJ.js";import{t as M}from"./useMutation-C6XBlFap.js";import{t as N}from"./CopyButton-DfD1hFjv.js";var P=e(S(),1),F=w(),I=[`settings`,`ingest`],L=[`settings`,`ingest`,`tokens`];function R(e,t){let n=e.trim();return t||/^https:\/\//i.test(n)||/:443$/.test(n)}function z(e,t,n){if(/^https?:\/\//i.test(e.trim()))try{let t=new URL(e);e=`${t.protocol}//${t.hostname}:${t.port||(t.protocol===`https:`?`443`:`80`)}`}catch{}let r=R(e,n)?``:` tls: insecure: true`;return`exporters: otlp/pitot: diff --git a/internal/ui/dist/assets/settings_.ingest-BOYYaqhX.js b/internal/ui/dist/assets/settings_.ingest-BOYYaqhX.js deleted file mode 100644 index 08626f65..00000000 --- a/internal/ui/dist/assets/settings_.ingest-BOYYaqhX.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./settings-_ddYdY9A.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/settings_.ingest-CVuXQWLV.js b/internal/ui/dist/assets/settings_.ingest-CVuXQWLV.js new file mode 100644 index 00000000..7763f882 --- /dev/null +++ b/internal/ui/dist/assets/settings_.ingest-CVuXQWLV.js @@ -0,0 +1 @@ +import{t as e}from"./settings-CfrRZuaG.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/toolbar-BxU8wfSr.js b/internal/ui/dist/assets/toolbar-DsH2ghVs.js similarity index 99% rename from internal/ui/dist/assets/toolbar-BxU8wfSr.js rename to internal/ui/dist/assets/toolbar-DsH2ghVs.js index 8a94c6cb..de07e303 100644 --- a/internal/ui/dist/assets/toolbar-BxU8wfSr.js +++ b/internal/ui/dist/assets/toolbar-DsH2ghVs.js @@ -1,4 +1,4 @@ -import{n as e,r as t}from"./rolldown-runtime-BLXQ4ufn.js";import{$n as n,$r as r,$t as i,A as a,Ar as o,At as s,Bt as c,C as l,Cr as u,D as d,Dr as f,E as p,Er as m,F as h,Fr as g,Ft as _,Gr as v,Gt as y,Hr as b,Ht as x,Ir as S,Jr as C,Kn as w,Kr as T,Kt as E,Lr as D,M as O,Mr as k,Mt as A,N as j,Nr as M,Nt as ee,O as te,Ot as ne,P as N,Pr as P,Pt as re,Qr as ie,Qt as ae,Rt as oe,S as se,T as ce,Tr as le,Ur as ue,Ut as de,Vt as fe,Wt as pe,Xn as me,Xr as he,Yn as ge,Yr as _e,Yt as ve,Zn as ye,Zr as be,_r as xe,ai as Se,an as Ce,ar as we,cr as Te,di as Ee,dr as De,en as Oe,er as ke,f as Ae,fi as je,fr as Me,g as Ne,gi as Pe,h as Fe,hi as Ie,ii as Le,in as Re,j as ze,jr as Be,jt as Ve,k as He,kr as Ue,kt as We,mi as Ge,mr as Ke,n as qe,ni as Je,nr as Ye,oi as Xe,or as F,pi as Ze,pr as Qe,qn as $e,qr as et,qt as tt,rn as nt,rr as rt,si as it,st as at,t as ot,ti as st,tn as ct,v as lt,vr as ut,w as dt,wr as I,x as ft,xr as pt,yr as mt,zr as ht}from"./index-CL2Ww4um.js";import{t as gt}from"./CopyButton-CeHt7WhA.js";import{n as _t,t as vt}from"./Table-B_pVYmc3.js";import{c as yt,i as bt,l as xt,n as St,o as Ct,r as wt,s as Tt,u as Et}from"./live-data-meta-CGsP1XrP.js";import{n as Dt,r as Ot,t as kt}from"./lib-DeYqVmar.js";import{t as At}from"./loading-skeleton-BsD5_HiB.js";function jt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Mt(e);if(n.length!==Mt(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function Pt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ft(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i(e+1)%1e6;function Lt(){let[,e]=(0,L.useReducer)(It,0);return e}function Rt(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{r.current||=window.setTimeout(()=>{r.current=null,i(...e)},t)},[t]),o=(0,L.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,L.useEffect)(()=>{if(n.autoInvoke)return a(),o},[o,a]),(0,L.useEffect)(()=>o,[o]),{start:a,clear:o}}function Ht(e){let t=(0,L.useRef)(void 0);return(0,L.useEffect)(()=>{t.current=e},[e]),t.current}function Ut(e){return JSON.stringify(e??{})}function Wt(e,t,n){let r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useRef)(null),o=C(e),s=Ut(t);(0,L.useEffect)(()=>{let e=(typeof n==`function`?n():n)??null;(e!==i.current||s!==a.current)&&(r.current&&=(r.current.disconnect(),null),i.current=e,a.current=s,e&&(r.current=new MutationObserver(o),r.current.observe(e,t)))}),(0,L.useEffect)(()=>()=>{r.current&&=(r.current.disconnect(),null),i.current=null,a.current=null},[])}function Gt(){let[e,t]=(0,L.useState)(!1);return(0,L.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t){return typeof e==`boolean`?e:t.autoContrast}function Jt(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function Yt({target:e,parent:t,ref:n,displayAfterTransitionEnd:r,onTransitionStart:i,onTransitionEnd:a}){let o=(0,L.useRef)(-1),s=(0,L.useRef)(e),[c,l]=(0,L.useState)(!1),[u,d]=(0,L.useState)(typeof r==`boolean`&&r),f=()=>{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=pt(s.borderTopWidth)+pt(c.borderTopWidth),u=pt(s.borderLeftWidth)+pt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,L.useRef)(null),h=(0,L.useRef)(null),g=(0,L.useRef)(null);return(0,L.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t),g.current=new MutationObserver(()=>{t.contains(e)&&f()}),g.current.observe(t,{childList:!0,subtree:!0})),()=>{m.current?.disconnect(),h.current?.disconnect(),g.current?.disconnect()}},[t,e]),(0,L.useEffect)(()=>{if(t){let e=e=>{Jt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,L.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Vt(()=>{_t()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var Xt={root:`m_96b553a6`},Zt=ht((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),Qt=le(e=>{let t=k(`FloatingIndicator`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:s,vars:c,target:l,parent:u,transitionDuration:d,mod:f,displayAfterTransitionEnd:p,onTransitionStart:m,onTransitionEnd:h,attributes:g,ref:_,...y}=t,x=b(),S=o({name:`FloatingIndicator`,classes:Xt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:s,attributes:g,vars:c,varsResolver:Zt,stylesCtx:{shouldReduceMotion:x}}),C=(0,L.useRef)(null),{initialized:w,hidden:T}=Yt({target:l,parent:u,ref:C,displayAfterTransitionEnd:p,onTransitionStart:m,onTransitionEnd:h}),E=v(_,C);return!l||!u?null:(0,R.jsx)(I,{ref:E,mod:[{initialized:w,hidden:T},f],...S(`root`),...y})});Qt.displayName=`@mantine/core/FloatingIndicator`,Qt.classes=Xt,Qt.varsResolver=Zt;function $t(e){let t=e.currentTarget;return Et(t).activeElement!==t}function en(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[tn,nn]=Je(`Progress.Root component was not found in tree`),rn={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},an=le(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=k(`ProgressLabel`,null,e),s=nn();return(0,R.jsx)(I,{...s.getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});an.classes=rn,an.displayName=`@mantine/core/ProgressLabel`;var on=ht((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":ie(t,`progress-size`),"--progress-radius":n===void 0?void 0:be(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),sn=le(e=>{let t=k(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:s,vars:c,autoContrast:l,transitionDuration:u,orientation:d,attributes:f,mod:p,...m}=t,h=o({name:`Progress`,classes:rn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:s,attributes:f,vars:c,varsResolver:on});return(0,R.jsx)(tn,{value:{getStyles:h,autoContrast:l},children:(0,R.jsx)(I,{mod:[{orientation:d},p],...h(`root`),...m})})});sn.classes=rn,sn.varsResolver=on,sn.displayName=`@mantine/core/ProgressRoot`;var cn={withAria:!0},ln=le(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:o,withAria:s,color:c,striped:l,animated:u,mod:d,...f}=k(`ProgressSection`,cn,e),p=nn(),m=M(),h=s?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":o,"aria-valuetext":`${o}%`}:{};return(0,R.jsx)(I,{...p.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...f,...h,mod:[{striped:l||u,animated:u},d],__vars:{"--progress-section-size":`${o}%`,"--progress-section-color":D(c,m),"--progress-label-color":qt(p.autoContrast,m)?S({color:c,theme:m,autoContrast:p.autoContrast}):void 0}})});ln.classes=rn,ln.displayName=`@mantine/core/ProgressSection`;var un=le(e=>{let t=k(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:o,striped:s,animated:c,"aria-label":l,...u}=t,{resolvedClassNames:d,resolvedStyles:f}=Be({classNames:r,styles:i,props:t});return(0,R.jsx)(sn,{classNames:d,styles:f,vars:a,...u,children:(0,R.jsx)(ln,{value:n,color:o,striped:s,animated:c,"aria-label":l})})});un.classes=rn,un.displayName=`@mantine/core/Progress`,un.Section=ln,un.Root=sn,un.Label=an;var dn={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},fn={withItemsBorders:!0},pn=ht((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:a})=>({root:{"--sc-radius":t===void 0?void 0:be(t),"--sc-color":n?D(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":a,"--sc-padding":ie(i,`sc-padding`),"--sc-font-size":he(i)}})),mn=m(e=>{let t=k(`SegmentedControl`,fn,e),{classNames:n,className:r,style:i,styles:a,unstyled:s,vars:c,data:l,value:u,defaultValue:d,onChange:f,size:p,name:m,disabled:h,readOnly:g,fullWidth:_,orientation:y,radius:b,color:x,transitionDuration:C,transitionTimingFunction:w,variant:E,autoContrast:D,withItemsBorders:O,mod:A,attributes:j,ref:ee,...te}=t,ne=o({name:`SegmentedControl`,props:t,classes:dn,className:r,style:i,classNames:n,styles:a,unstyled:s,attributes:j,vars:c,varsResolver:pn}),N=M(),P=l.map(e=>Kt(e)?{label:`${e}`,value:e}:e),re=Gt(),[ie,ae]=(0,L.useState)(0),[oe,se]=(0,L.useState)(null),[ce,le]=(0,L.useState)({}),de=(e,t)=>{e!==null&&ce[t]!==e&&(ce[t]=e,le({...ce}))},[fe,pe]=ue({value:u,defaultValue:d,finalValue:Array.isArray(l)?P.find(e=>!e.disabled)?.value??l[0]?.value??null:null,onChange:f}),me=T(m),he=P.map(e=>`${e.value}`),ge=P.map(e=>(0,L.createElement)(I,{...ne(`control`),mod:{active:fe===e.value,orientation:y},key:`${e.value}`},(0,L.createElement)(`input`,{...ne(`input`),disabled:h||e.disabled,type:`radio`,name:me,value:`${e.value}`,id:`${me}-${e.value}`,checked:fe===e.value,onChange:()=>!g&&pe(e.value),"data-focus-ring":N.focusRing,key:`${e.value}-input`}),(0,L.createElement)(I,{component:`label`,...ne(`label`),mod:{active:fe===e.value&&!(h||e.disabled),disabled:h||e.disabled,"read-only":g},htmlFor:`${me}-${e.value}`,ref:t=>de(t,`${e.value}`),__vars:{"--sc-label-color":x===void 0?void 0:S({color:x,theme:N,autoContrast:D})},key:`${e.value}-label`},(0,R.jsx)(`span`,{...ne(`innerLabel`),children:e.label})))),_e=v(ee,se);return Bt(()=>{ae(e=>e+1)},[l.length]),Bt(()=>{le(e=>{let t={};return he.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[he]),l.length===0?null:(0,R.jsxs)(I,{...ne(`root`),variant:E,size:p,ref:_e,mod:[{"full-width":_,orientation:y,initialized:re,"with-items-borders":O},A],...te,role:`radiogroup`,"data-disabled":h,children:[fe!==void 0&&(0,R.jsx)(Qt,{target:ce[`${fe}`],parent:oe,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...ne(`indicator`)},ie),ge]})});mn.classes=dn,mn.varsResolver=pn,mn.displayName=`@mantine/core/SegmentedControl`;var hn={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},gn=m(e=>{let t=k([`Input`,`InputWrapper`,`Select`],hn,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:o,defaultDropdownOpened:s,onDropdownClose:c,onDropdownOpen:l,onFocus:u,onBlur:d,onClick:f,onChange:p,data:m,value:h,defaultValue:g,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:v,onOptionSubmit:y,comboboxProps:b,readOnly:x,disabled:S,filter:C,limit:w,withScrollArea:E,maxDropdownHeight:D,floatingHeight:O,size:A,searchable:j,rightSection:M,checkIconPosition:ee,withCheckIcon:te,withAlignedLabels:ne,nothingFoundMessage:N,name:P,form:re,searchValue:ie,defaultSearchValue:ae,onSearchChange:oe,allowDeselect:se,error:ce,rightSectionPointerEvents:le,id:de,clearable:fe,clearSectionMode:pe,clearButtonProps:me,hiddenInputProps:he,renderOption:ge,onClear:_e,autoComplete:ve,scrollAreaProps:ye,__defaultRightSection:be,__clearSection:xe,__clearable:Se,chevronColor:Ce,autoSelectOnBlur:we,openOnFocus:Ee,attributes:De,...Oe}=t,ke=(0,L.useMemo)(()=>xt(m),[m]),Ae=(0,L.useRef)({}),je=(0,L.useMemo)(()=>yt(ke),[ke]),Me=T(de),Ne=wt({id:Me,label:Oe.label,labelProps:Oe.labelProps,inputWrapperOrder:Oe.inputWrapperOrder}),[Pe,Fe,Ie]=ue({value:h,defaultValue:g,finalValue:null,onChange:p}),Le=Pe==null?void 0:`${Pe}`in je?je[`${Pe}`]:Ae.current[`${Pe}`],Re=Ht(Le),[ze,Ve,He]=ue({value:ie,defaultValue:ae,finalValue:Le?Le.label:``,onChange:oe}),Ue=Tt({opened:o,defaultOpened:s,onDropdownOpen:()=>{l?.(),v?Ue.selectFirstOption():Ue.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Ue.resetSelectedOption,0)}}),We=e=>{Ve(e),Ue.resetSelectedOption()},{resolvedClassNames:Ge,resolvedStyles:Ke}=Be({props:t,styles:r,classNames:n});(0,L.useEffect)(()=>{_&&Ue.selectFirstOption()},[_,ze]),(0,L.useEffect)(()=>{h===null&&We(``),h!=null&&Le&&(Re?.value!==Le.value||Re?.label!==Le.label)&&We(Le.label)},[h,Le]),(0,L.useEffect)(()=>{!Ie&&!He&&We(Pe==null?``:`${Pe}`in je?je[`${Pe}`]?.label:Ae.current[`${Pe}`]?.label||``)},[je,Pe]),(0,L.useEffect)(()=>{Pe&&`${Pe}`in je&&(Ae.current[`${Pe}`]=je[`${Pe}`])},[je,Pe]);let qe=(0,R.jsx)(Ct.ClearButton,{...me,onClear:()=>{Fe(null,null),We(``),_e?.()}}),Je=fe&&Pe!=null&&!S&&!x;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Ct,{store:Ue,__staticSelector:`Select`,classNames:Ge,styles:Ke,unstyled:i,readOnly:x,size:A,attributes:De,floatingHeight:O,keepMounted:we,onOptionSubmit:e=>{y?.(e);let t=se&&`${je[e].value}`==`${Pe}`?null:je[e],n=t?t.value:null;n!==Pe&&Fe(n,t),!Ie&&We(n==null?``:t?.label||``),Ue.closeDropdown()},...b,children:[(0,R.jsx)(Ct.Target,{targetType:j?`input`:`button`,autoComplete:ve,withExpandedAttribute:!0,children:(0,R.jsx)(Te,{id:Me,__defaultRightSection:(0,R.jsx)(Ct.Chevron,{size:A,error:ce,unstyled:i,color:Ce}),__clearSection:qe,__clearable:Je,__clearSectionMode:pe,rightSection:M,rightSectionPointerEvents:le||`none`,...Oe,size:A,__staticSelector:`Select`,disabled:S,readOnly:x||!j,value:ze,onChange:e=>{if($t(e)){if(!x){let t=en(je,e.currentTarget.value);t&&`${t.value}`!=`${Pe}`&&(Fe(t.value,t),!Ie&&We(t.label))}}else We(e.currentTarget.value),Ue.openDropdown(),_&&Ue.selectFirstOption()},onFocus:e=>{Ee&&j&&Ue.openDropdown(),u?.(e)},onBlur:e=>{we&&Ue.clickSelectedOption(),Ue.closeDropdown();let t=Pe!=null&&(`${Pe}`in je?je[`${Pe}`]:Ae.current[`${Pe}`]);We(t&&t.label||``),d?.(e)},onClick:e=>{j?Ue.openDropdown():Ue.toggleDropdown(),f?.(e)},classNames:Ge,styles:Ke,unstyled:i,pointer:!j,error:ce,attributes:De})}),(0,R.jsx)(bt,{data:ke,hidden:x||S,filter:C,search:ze,limit:w,hiddenWhenEmpty:!N,withScrollArea:E,maxDropdownHeight:D,filterOptions:!!j&&Le?.label!==ze,value:Pe,checkIconPosition:ee,withCheckIcon:te,withAlignedLabels:ne,nothingFoundMessage:N,unstyled:i,labelId:Ne,"aria-label":Ne?void 0:Oe[`aria-label`],renderOption:ge,scrollAreaProps:ye})]}),(0,R.jsx)(Ct.HiddenInput,{value:Pe,name:P,form:re,disabled:S,...he})]})});gn.classes={...Te.classes,...Ct.classes},gn.displayName=`@mantine/core/Select`;function _n(e){if(e!==void 0)return typeof e==`number`?Se(e):e}function vn({spacing:e,verticalSpacing:t,cols:n,minColWidth:i,autoRows:a,selector:o}){let s=M(),c=t===void 0?e:t,l=i!==void 0,u=Le({"--sg-spacing-x":r(Pt(e)),"--sg-spacing-y":r(Pt(c)),"--sg-auto-rows":a,...l?{"--sg-min-col-width":_n(i)}:{"--sg-cols":Pt(n)?.toString()}}),d=it(s.breakpoints).reduce((t,i)=>(t[i]||(t[i]={}),typeof e==`object`&&e[i]!==void 0&&(t[i][`--sg-spacing-x`]=r(e[i])),typeof c==`object`&&c[i]!==void 0&&(t[i][`--sg-spacing-y`]=r(c[i])),!l&&typeof n==`object`&&n[i]!==void 0&&(t[i][`--sg-cols`]=n[i]),t),{}),f=_e(it(d),s.breakpoints).filter(e=>it(d[e.value]).length>0).map(e=>({query:`(min-width: ${s.breakpoints[e.value]})`,styles:d[e.value]}));return(0,R.jsx)(Ue,{styles:u,media:f,selector:o})}function yn(e){return typeof e==`object`&&e?it(e):[]}function bn(e){return e.sort((e,t)=>Xe(e)-Xe(t))}function xn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return bn(Array.from(new Set([...yn(e),...yn(t),...r===void 0?yn(n):[]])))}function Sn({spacing:e,verticalSpacing:t,cols:n,minColWidth:i,autoRows:a,selector:o}){let s=t===void 0?e:t,c=i!==void 0,l=Le({"--sg-spacing-x":r(Pt(e)),"--sg-spacing-y":r(Pt(s)),"--sg-auto-rows":a,...c?{"--sg-min-col-width":_n(i)}:{"--sg-cols":Pt(n)?.toString()}}),u=xn({spacing:e,verticalSpacing:t,cols:n,minColWidth:i}),d=u.reduce((t,i)=>(t[i]||(t[i]={}),typeof e==`object`&&e[i]!==void 0&&(t[i][`--sg-spacing-x`]=r(e[i])),typeof s==`object`&&s[i]!==void 0&&(t[i][`--sg-spacing-y`]=r(s[i])),!c&&typeof n==`object`&&n[i]!==void 0&&(t[i][`--sg-cols`]=n[i]),t),{}),f=u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]}));return(0,R.jsx)(Ue,{styles:l,container:f,selector:o})}var Cn={container:`m_925c2d2c`,root:`m_2415a157`},wn={cols:1,spacing:`md`,type:`media`},Tn=le(e=>{let t=k(`SimpleGrid`,wn,e),{classNames:n,className:r,style:i,styles:a,unstyled:s,vars:c,cols:l,verticalSpacing:u,spacing:d,type:p,minColWidth:m,autoFlow:h,autoRows:g,attributes:_,...v}=t,y=o({name:`SimpleGrid`,classes:Cn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:s,attributes:_,vars:c}),b=f(),x=m===void 0?void 0:h||`auto-fill`;return p===`container`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Sn,{...t,selector:`.${b}`}),(0,R.jsx)(`div`,{...y(`container`),children:(0,R.jsx)(I,{...y(`root`,{className:b}),...v,"data-auto-cols":x})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(vn,{...t,selector:`.${b}`}),(0,R.jsx)(I,{...y(`root`,{className:b}),...v,"data-auto-cols":x})]})});Tn.classes=Cn,Tn.displayName=`@mantine/core/SimpleGrid`;var[En,Dn]=Je(`Tabs component was not found in the tree`),On={root:`m_89d60db1`,"list--default":`m_576c9d4`,list:`m_89d33d6d`,tab:`m_4ec4dce6`,panel:`m_b0c91715`,tabSection:`m_fc420b1f`,tabLabel:`m_42bbd1ae`,"tab--default":`m_539e827b`,"list--outline":`m_6772fbd5`,"tab--outline":`m_b59ab47c`,"tab--pills":`m_c3381914`},kn=le(e=>{let t=k(`TabsList`,null,e),{children:n,className:r,grow:i,justify:a,classNames:o,styles:s,style:c,mod:l,...u}=t,d=Dn();return(0,R.jsx)(I,{...d.getStyles(`list`,{className:r,style:c,classNames:o,styles:s,props:t,variant:d.variant}),role:`tablist`,variant:d.variant,mod:[{grow:i,orientation:d.orientation,placement:d.orientation===`vertical`&&d.placement,inverted:d.inverted},l],"aria-orientation":d.orientation,__vars:{"--tabs-justify":a},...u,children:n})});kn.classes=On,kn.displayName=`@mantine/core/TabsList`;var An=le(e=>{let t=k(`TabsPanel`,null,e),{children:n,className:r,value:i,classNames:a,styles:o,style:s,mod:c,keepMounted:l,...u}=t,d=g(),f=Dn();(0,L.useEffect)(()=>(f.setMountedPanel(i,!0),()=>{f.setMountedPanel(i,!1)}),[i]);let p=f.value===i,m=f.keepMounted||l,h=f.keepMountedMode!==`display-none`,_=m&&h&&d!==`test`?(0,R.jsx)(L.Activity,{mode:p?`visible`:`hidden`,children:n}):m||p?n:null;return(0,R.jsx)(I,{...f.getStyles(`panel`,{className:r,classNames:a,styles:o,style:[s,p?void 0:{display:`none`}],props:t}),mod:[{orientation:f.orientation},c],role:`tabpanel`,id:f.getPanelId(i),"aria-labelledby":f.getTabId(i),...u,children:_})});An.classes=On,An.displayName=`@mantine/core/TabsPanel`;var jn=le(e=>{let t=k(`TabsTab`,null,e),{className:n,children:r,rightSection:i,leftSection:a,value:o,onClick:s,onKeyDown:c,disabled:l,color:d,style:f,classNames:p,styles:m,vars:h,mod:g,tabIndex:_,...v}=t,y=M(),{dir:b}=u(),x=Dn(),S=o===x.value,C=e=>{x.onChange(x.allowTabDeactivation&&o===x.value?null:o),s?.(e)},w={classNames:p,styles:m,props:t};return(0,R.jsxs)(mt,{...x.getStyles(`tab`,{className:n,style:f,variant:x.variant,...w}),disabled:l,unstyled:x.unstyled,variant:x.variant,mod:[{active:S,disabled:l,orientation:x.orientation,inverted:x.inverted,placement:x.orientation===`vertical`&&x.placement},g],role:`tab`,id:x.getTabId(o),"aria-selected":S,tabIndex:_===void 0?S||x.value===null?0:-1:_,"aria-controls":x.mountedPanels.current.has(o)?x.getPanelId(o):void 0,onClick:C,__vars:{"--tabs-color":d?D(d,y):void 0},onKeyDown:st({siblingSelector:`[role="tab"]`,parentSelector:`[role="tablist"]`,activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||`horizontal`,dir:b,onKeyDown:c}),...v,children:[a&&(0,R.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`left`,children:a}),r&&(0,R.jsx)(`span`,{...x.getStyles(`tabLabel`,w),children:r}),i&&(0,R.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`right`,children:i})]})});jn.classes=On,jn.displayName=`@mantine/core/TabsTab`;var Mn=`Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value`,Nn={keepMounted:!0,keepMountedMode:`activity`,orientation:`horizontal`,loop:!0,activateTabWithKeyboard:!0,variant:`default`,placement:`left`},Pn=ht((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":be(t),"--tabs-color":D(n,e),"--tabs-text-color":qt(r,e)?S({color:n,theme:e,autoContrast:r}):void 0}})),Fn=le(e=>{let t=k(`Tabs`,Nn,e),{defaultValue:n,value:r,onChange:i,orientation:a,children:s,loop:c,id:l,activateTabWithKeyboard:u,allowTabDeactivation:d,variant:f,color:p,radius:m,inverted:h,placement:g,keepMounted:_,keepMountedMode:v,classNames:y,styles:b,unstyled:x,className:S,style:C,vars:w,autoContrast:E,mod:D,attributes:O,...A}=t,j=T(l),M=(0,L.useRef)(new Set),ee=Lt(),te=(0,L.useCallback)((e,t)=>{let n=M.current;t&&!n.has(e)?(n.add(e),ee()):!t&&n.has(e)&&(n.delete(e),ee())},[]),[ne,N]=ue({value:r,defaultValue:n,finalValue:null,onChange:i}),P=o({name:`Tabs`,props:t,classes:On,className:S,style:C,classNames:y,styles:b,unstyled:x,attributes:O,vars:w,varsResolver:Pn});return(0,R.jsx)(En,{value:{placement:g,value:ne,orientation:a,id:j,loop:c,activateTabWithKeyboard:u,getTabId:Nt(`${j}-tab`,Mn),getPanelId:Nt(`${j}-panel`,Mn),onChange:N,allowTabDeactivation:d,variant:f,color:p,radius:m,inverted:h,keepMounted:_,keepMountedMode:v,unstyled:x,getStyles:P,mountedPanels:M,setMountedPanel:te},children:(0,R.jsx)(I,{id:j,variant:f,mod:[{orientation:a,inverted:a===`horizontal`&&h,placement:a===`vertical`&&g},D],...P(`root`),...A,children:s})})});Fn.classes=On,Fn.varsResolver=Pn,Fn.displayName=`@mantine/core/Tabs`,Fn.Tab=jn,Fn.Panel=An,Fn.List=kn;var In=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),Ln=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:In}));Ln.displayName=`CaretUpIcon`;var Rn=Ln,zn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),Bn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),Vn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),Hn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),Un=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),Wn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),Gn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),Kn=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180,128a12,12,0,0,1-12,12H88a12,12,0,0,1,0-24h80A12,12,0,0,1,180,128Zm56,0A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M176,128a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,128Zm56,0A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm40,112H88a8,8,0,0,1,0-16h80a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M174,128a6,6,0,0,1-6,6H88a6,6,0,0,1,0-12h80A6,6,0,0,1,174,128Zm56,0A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,128Zm56,0A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M172,128a4,4,0,0,1-4,4H88a4,4,0,0,1,0-8h80A4,4,0,0,1,172,128Zm56,0A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),qn=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:zn}));qn.displayName=`ArrowClockwiseIcon`;var Jn=qn,Yn=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Bn}));Yn.displayName=`ArrowsOutIcon`;var Xn=Yn,Zn=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Vn}));Zn.displayName=`ChatCircleTextIcon`;var Qn=Zn,$n=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Hn}));$n.displayName=`ClockIcon`;var er=$n,tr=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Un}));tr.displayName=`ClockCounterClockwiseIcon`;var nr=tr,rr=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Wn}));rr.displayName=`ListBulletsIcon`;var ir=rr,ar=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Gn}));ar.displayName=`MagnifyingGlassMinusIcon`;var or=ar,sr=L.forwardRef((e,t)=>L.createElement(Re,{ref:t,...e,weights:Kn}));sr.displayName=`MinusCircleIcon`;var cr=sr;function lr(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function ur(e){return ot[e?`dark`:`light`]}function dr(e){let t=e?5:7;return{ok:A[t],warn:_[t],bad:We[t],info:Ve[t]}}function fr(e,t){return qe[t?`dark`:`light`][e]??ur(t).muted}function pr(e){return e===`unhealthy`?`diamond`:e===`degraded`?`roundRect`:`circle`}function mr(e){return e===`unknown`?`dashed`:`solid`}function hr(e){let t=e.map(e=>{let t=e.start.match(/\.(\d+)(?=Z|[+-]\d{2}:\d{2}$)/),n=t?e.start.replace(t[0],``):e.start,r=Date.parse(n);if(Number.isFinite(r))return BigInt(r)*1000000n+BigInt((t?.[1]??``).slice(0,9).padEnd(9,`0`))}),n=t.filter(e=>e!==void 0),r=n.reduce((e,t)=>t[e,Number((t[n]??r)-r)/1e6]))}function gr(e){let t=hr(e),n=e.map(e=>{let n=t.get(e);return{span:e,start:n,end:n+Math.max(0,e.duration_ms),children:[]}}),r=new Map(n.map((e,t)=>[e.span.span_id,t])),i;for(let e=0;en[i].end-n[i].start)&&(i=e)}if(i===void 0)return[];for(let e of n)e.children.sort((t,r)=>Math.min(n[r].end,e.end)-Math.min(n[t].end,e.end)||n[r].start-n[t].start||t-r);let a=(e,t,n)=>({id:e,start:t,end:n,cursor:n,next:0}),o=[a(i,n[i].start,n[i].end)],s=[],c=(e,t,r)=>{r>t&&s.push({span_id:n[e].span.span_id,start:t,end:r})};for(;o.length;){let e=o[o.length-1],t=n[e.id].children[e.next++];if(t===void 0||e.cursor<=e.start){c(e.id,e.start,e.cursor),o.pop();continue}let r=n[t],i=Math.min(r.end,e.end);if(i>e.cursor)continue;let s=Math.max(r.start,e.start);i<=s||(c(e.id,i,e.cursor),e.cursor=s,o.push(a(t,s,i)))}return s}function _r(e,t){let n=new Set(e.map(e=>e.span_id)),r=(e,n)=>t.get(e)-t.get(n),i=new Map,a=[];for(let t of e){let e=t.parent_span_id;if(e&&e!==t.span_id&&n.has(e)){let n=i.get(e);n?n.push(t):i.set(e,[t])}else a.push(t)}let o=[],s=new Set,c=a.sort(r).reverse().map(e=>({span:e,depth:0})),l=()=>{for(;c.length;){let e=c.pop();if(!s.has(e.span)){s.add(e.span),o.push(e);for(let t of[...i.get(e.span.span_id)??[]].sort(r).reverse())c.push({span:t,depth:e.depth+1})}}};l();for(let t of e)s.has(t)||(c.push({span:t,depth:0}),l());return o}function vr({spans:e,dark:t,onSpan:n,selected:r,showCriticalPath:i=!0}){let a=(0,L.useMemo)(()=>{let t=new Map;for(let n of gr(e)){let e=t.get(n.span_id);e?e.push(n):t.set(n.span_id,[n])}return t},[e]),o=(0,L.useMemo)(()=>{let n=hr(e),r=e.reduce((e,t)=>Math.max(e,n.get(t)+t.duration_ms),1),i=[...new Set(e.map(e=>e.service))];return _r(e,n).map(({span:e,depth:a})=>{let o=n.get(e)/r*100,s=fr(i.indexOf(e.service),t);return{span:e,depth:a,offset:o,total:r,width:Math.min(Math.max(e.duration_ms/r*100,.6),100-o),color:s,failed:e.status===`STATUS_CODE_ERROR`}})},[e,t]);return(0,R.jsx)(I,{"data-waterfall":!0,style:{maxHeight:520,overflow:`auto`},children:(0,R.jsxs)(vt,{highlightOnHover:!!n,verticalSpacing:6,layout:`fixed`,stickyHeader:!0,children:[(0,R.jsxs)(`colgroup`,{children:[(0,R.jsx)(`col`,{style:{width:`42%`}}),(0,R.jsx)(`col`,{}),(0,R.jsx)(`col`,{style:{width:76}})]}),(0,R.jsx)(vt.Thead,{children:(0,R.jsxs)(vt.Tr,{children:[(0,R.jsx)(vt.Th,{children:`Operation`}),(0,R.jsx)(vt.Th,{children:`Timeline`}),(0,R.jsx)(vt.Th,{ta:`right`,children:`Duration`})]})}),(0,R.jsx)(vt.Tbody,{children:o.map(({span:e,depth:t,offset:o,total:s,width:c,color:l,failed:u})=>{let d=i?a.get(e.span_id)??[]:[],f=d.reduce((e,t)=>e+t.end-t.start,0),p=d.length?` · on critical path · ${ze(f)} (${(f/e.duration_ms*100).toFixed(1)}% of span)`:``,m=`${e.service} · ${e.operation} · ${ze(e.duration_ms)}${p}`;return(0,R.jsxs)(vt.Tr,{"data-depth":t,"data-selected":e.span_id===r||void 0,"aria-selected":n?e.span_id===r:void 0,tabIndex:n?0:void 0,onClick:n?()=>n(e):void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))}:void 0,style:{cursor:n?`pointer`:void 0},children:[(0,R.jsx)(vt.Td,{title:m,children:(0,R.jsxs)(I,{style:{display:`flex`,alignItems:`center`,gap:6,paddingLeft:Math.min(t,16)*10,minWidth:0},children:[(0,R.jsx)(I,{w:8,h:8,bg:l,style:{borderRadius:`50%`,flex:`0 0 auto`}}),(0,R.jsxs)(I,{miw:0,children:[(0,R.jsxs)(F,{fw:600,size:`sm`,truncate:!0,children:[u&&(0,R.jsx)(Oe,{size:14,"aria-label":`Error`,color:`var(--mantine-color-bad-text)`}),e.operation]}),(0,R.jsx)(F,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]})]})}),(0,R.jsx)(vt.Td,{children:(0,R.jsxs)(I,{pos:`relative`,h:14,bg:`var(--mantine-color-default-hover)`,role:`img`,title:m,"aria-label":`${e.operation} on ${e.service} took ${ze(e.duration_ms)}${p}`,style:{borderRadius:`var(--mantine-radius-sm)`},children:[(0,R.jsx)(I,{pos:`absolute`,left:`${o}%`,w:`${c}%`,h:`100%`,bg:u?`bad`:l,style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}}),d.map((t,n)=>(0,R.jsx)(I,{"data-critical-path-segment":e.span_id,"aria-hidden":`true`,pos:`absolute`,left:`${t.start/s*100}%`,w:`${(t.end-t.start)/s*100}%`,top:`50%`,bg:`var(--mantine-color-text)`,style:{height:3,transform:`translateY(-50%)`,pointerEvents:`none`,boxShadow:`0 0 0 1px var(--mantine-color-body)`}},n))]})}),(0,R.jsx)(vt.Td,{ta:`right`,children:(0,R.jsx)(F,{size:`sm`,ff:`monospace`,children:ze(e.duration_ms)})})]},e.span_id)})})]})})}var yr={STATUS_CODE_ERROR:`Error`,STATUS_CODE_OK:`OK`,STATUS_CODE_UNSET:`Unset`},br=e=>e==null?void 0:typeof e==`string`?e:JSON.stringify(e);function xr({label:e,values:t}){let n=Object.keys(t).sort();return(0,R.jsxs)(I,{children:[(0,R.jsx)(F,{size:`xs`,fw:600,c:`dimmed`,mb:4,children:e}),n.length===0?(0,R.jsx)(F,{size:`xs`,c:`dimmed`,children:`None`}):(0,R.jsx)(i,{label:e,items:n.map(e=>({label:(0,R.jsx)(F,{span:!0,inherit:!0,ff:`monospace`,children:e}),value:(0,R.jsx)(F,{span:!0,inherit:!0,ff:`monospace`,style:{whiteSpace:`pre-wrap`},children:typeof t[e]==`string`?String(t[e]):JSON.stringify(t[e])})}))})]})}function Sr({traceId:e,span:t,load:n,onClose:r}){let a=(0,L.useRef)(null);(0,L.useEffect)(()=>{a.current?.scrollIntoView?.({block:`nearest`})},[t]);let o=Ce({queryKey:[`span-extras`,e,t.span_id,t.start],queryFn:({signal:r})=>n(e,t,r),enabled:!!n,retry:!1,staleTime:1/0}),s=ve(`danger`),c=t.status===`STATUS_CODE_ERROR`,l=o.data?.events.filter(e=>e.name===`exception`)??[];return(0,R.jsx)(xe,{ref:a,withBorder:!0,p:`sm`,radius:`md`,"data-span-details":!0,"aria-label":`Span ${t.operation}`,role:`region`,children:(0,R.jsxs)($e,{gap:`sm`,children:[(0,R.jsxs)(De,{justify:`space-between`,wrap:`nowrap`,align:`flex-start`,children:[(0,R.jsxs)(I,{miw:0,children:[(0,R.jsx)(F,{fw:600,style:{overflowWrap:`anywhere`},children:t.operation}),(0,R.jsxs)(F,{size:`xs`,c:`dimmed`,children:[t.service,` · `,t.kind.replace(/^SPAN_KIND_/,``).toLowerCase(),` · `,ze(t.duration_ms),` · `,(0,R.jsx)(F,{span:!0,ff:`monospace`,size:`xs`,children:p(Date.parse(t.start))})]})]}),(0,R.jsx)(Me,{"aria-label":`Close span details`,onClick:r})]}),(0,R.jsx)(I,{children:(0,R.jsx)(i,{label:`Span metadata`,items:[{label:`Status`,value:(0,R.jsx)(tt,{tone:c?`danger`:`neutral`,children:yr[t.status]??t.status})},{label:`Span`,value:(0,R.jsx)(F,{span:!0,inherit:!0,ff:`monospace`,children:t.span_id})},...t.parent_span_id?[{label:`Parent`,value:(0,R.jsx)(F,{span:!0,inherit:!0,ff:`monospace`,children:t.parent_span_id})}]:[]]})}),t.status_message&&(0,R.jsx)(F,{size:`sm`,c:c?s:void 0,style:{overflowWrap:`anywhere`},children:t.status_message}),o.isLoading&&(0,R.jsx)(E,{state:`loading`,loadingLabel:`Loading span details`,skeleton:(0,R.jsx)(At,{shape:`key_value`,rows:3})}),o.error&&(0,R.jsx)(I,{p:`xs`,children:(0,R.jsx)(E,{state:`error`,error:{message:o.error.message,onRetry:()=>void o.refetch()}})}),l.map((e,t)=>{let n=br(e.attributes[`exception.message`]),r=br(e.attributes[`exception.stacktrace`]);return(0,R.jsx)(I,{p:`xs`,children:(0,R.jsxs)(y,{tone:`danger`,title:br(e.attributes[`exception.type`])??`Exception`,children:[n&&(0,R.jsx)(F,{size:`sm`,style:{overflowWrap:`anywhere`},children:n}),r&&(0,R.jsx)(ke,{block:!0,mt:4,fz:12,style:{maxHeight:220,overflow:`auto`},children:r})]})},t)}),o.data&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(xr,{label:`Attributes`,values:o.data.attributes}),o.data.events.length>0&&(0,R.jsxs)(I,{children:[(0,R.jsx)(F,{size:`xs`,fw:600,c:`dimmed`,mb:4,children:`Events`}),(0,R.jsx)($e,{gap:4,children:o.data.events.map((e,t)=>(0,R.jsxs)(I,{children:[(0,R.jsxs)(F,{size:`xs`,children:[(0,R.jsxs)(F,{span:!0,ff:`monospace`,c:`dimmed`,children:[`+`,ze(e.offset_ns/1e6)]}),` `,e.name]}),e.name!==`exception`&&Object.keys(e.attributes).length>0&&(0,R.jsx)(I,{pl:`md`,children:(0,R.jsx)(xr,{label:`Event attributes`,values:e.attributes})})]},t))})]}),(0,R.jsx)(xr,{label:`Resource`,values:o.data.resource}),o.data.scope&&(0,R.jsx)(I,{children:(0,R.jsx)(i,{items:[{label:`Instrumentation scope`,value:(0,R.jsx)(F,{span:!0,inherit:!0,ff:`monospace`,children:o.data.scope})}]})})]})]})})}function Cr({value:e,children:t}){return(0,R.jsxs)(De,{gap:4,wrap:`nowrap`,children:[(0,R.jsx)(I,{miw:0,flex:1,children:t}),(0,R.jsx)(gt,{value:e,children:({copied:t,copy:n})=>(0,R.jsx)(Qe,{size:`xs`,variant:`subtle`,color:`gray`,"aria-label":t?`Trace ID copied`:`Copy trace ID`,title:e,onClick:e=>{e.stopPropagation(),n()},children:t?(0,R.jsx)(pe,{size:12}):(0,R.jsx)(de,{size:12})})})]})}function wr(e){return e!==`OK`&&/^[A-Za-z]+$/.test(e)?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e}function Tr(e){return Array.from({length:e.rows},(t,n)=>Object.fromEntries(e.columns.map((t,r)=>{let i=e.values[r]?.[n]??null;return[t.name,typeof i==`number`&&!Number.isFinite(i)?null:i]})))}function Er(e,t){return e.viz!==`logs`||!t||t.rows<2?[]:t.columns.flatMap((e,n)=>{if(e.role!==`dimension`||e.type!==`string`||[`body`,`body_template`,`severity`,`status`].includes(e.name)||/(^id$|_id$)/.test(e.name))return[];let r=t.values[n][0];return typeof r==`string`&&r!==``&&t.values[n].slice(0,t.rows).every(e=>e===r)?[{name:e.name,value:r}]:[]})}function Dr(e,t){let n=t.frame??{columns:[],values:[],rows:0};return{columns:n.columns.map(e=>e.name),rows:Tr(n),selection:t=>{let n={};for(let r of e.query?.by??[]){let e=r.startsWith(`attributes[`)||r.startsWith(`resource[`)?r.slice(r.indexOf(`'`)+1,r.lastIndexOf(`'`)):r;t[e]!==void 0&&t[e]!==null&&(n[r]=String(t[e]))}return{time:typeof t.time==`number`?t.time:typeof t.start==`number`?t.start:void 0,dimensions:n,trace_id:typeof t.trace_id==`string`?t.trace_id:void 0,namespace:typeof t.namespace==`string`?t.namespace:void 0}}}}function Or(e){return kr(e)||typeof e==`function`||Ar(e)}function kr(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ar(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function jr(e,t){return e==null?null:Or(e)?L.createElement(e,t):e}function Mr(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?jr(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:jr(n.cell,t.getContext())}return`header`in e&&e.header?jr(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?jr(e.footer.column.columnDef.footer,e.footer.getContext()):null}function Nr(e){let t=Ee(e.source,e.selector,{compare:jt});return typeof e.children==`function`?e.children(t):e.children}function Pr(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function Fr(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return a&&i(o,t)||(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function Ir(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{n&&t(r,e)||i(e)})}}function Lr(){return Fr({createAtom:Ze,batch:je})}function Rr(e,t){return typeof e==`function`?e(t):e}function zr(e){if(Array.isArray(e))return e.map(zr);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?Vr():{},r=Object.keys(e);for(let t=0;t{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>Rr(n,e))}}function Wr(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gr(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var Kr=3;function qr(e,t){return Jr(e,t,Kr)}function Jr(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!Wr(e)||!Wr(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=Gr(e),i=Gr(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e{let t=Rr(n,e);return r(e,t)?e:t})}function Xr(e){return e instanceof Function}function Zr(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var Qr=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e{t?e():t=!0}}function ei({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o={onAfterUpdate:r?()=>{let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))}:void 0};return Qr({...a,...o})}function ti(e,t=`_`){let[n,r]=e.replace(t,` `).split(` `);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function ni(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=ti(r);t[n]=a?ei({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function ri(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=ti(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=ei({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function ii(e){return e.row.getValue(e.column.id)}function ai(e){return e.getValue()??e.table.options.renderFallbackValue}function oi(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var si={assignCellPrototype:(e,t)=>{ri(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>ii(e)},cell_renderValue:{fn:e=>ai(e)},cell_getContext:{fn:e=>oi(e),memoDeps:e=>[e]}})}};function ci(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n{let n=t;for(let t=0;te[i.accessorKey]}if(!s)throw Error();let l=ci(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;ee.getFlatColumns())]}function bi(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return fi(e.table,t)}return[e]}function xi(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function Si(e,t,n,r=0){let i=Array(t.length);for(let a=0;ae.getFlatColumns())}function Ti(e){let t=Vr(),n=e.getAllFlatColumns();for(let e=0;ee.getLeafColumns()))}function Di(e){let t=Vr(),n=e.getAllLeafColumns();for(let e=0;e{ri(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>yi(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>bi(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{ni(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>xi(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>Ci(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>wi(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>Ti(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>Ei(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>Di(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>Oi(e,t)}})}};function Ai(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n0&&Ii(s,t-1,n,r,i,a)}function Li(e){for(let t=0;te.id),e)}function Ui(e){return[...e.getHeaderGroups()].reverse()}function Wi(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e{ri(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>Bi(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>Vi(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{ni(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>Hi(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>Ui(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>Wi(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>Gi(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function qi(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n{let s=qi(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=Vr(),c._valuesCache=Vr(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;eei({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>Zi(e,e.options.data),onAfterUpdate:$r(()=>{hi(e),gi(e),_i(e),vi(e)})})}function Xi(e,t,n,r=0,i){let a=[];for(let o=0;o{ni(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>Qi(e)},table_getPreFilteredRowModel:{fn:()=>$i(e)},table_getFilteredRowModel:{fn:()=>ea(e)},table_getPreGroupedRowModel:{fn:()=>ta(e)},table_getGroupedRowModel:{fn:()=>na(e)},table_getPreSortedRowModel:{fn:()=>ra(e)},table_getSortedRowModel:{fn:()=>ia(e)},table_getPreExpandedRowModel:{fn:()=>aa(e)},table_getExpandedRowModel:{fn:()=>oa(e)},table_getPrePaginatedRowModel:{fn:()=>sa(e)},table_getPaginatedRowModel:{fn:()=>ca(e)},table_getRowModel:{fn:()=>la(e)}})}};function da(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;ne.subRows)}function ya(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e{ri(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>pa(e)},row_getAllCellsByColumnId:{fn:e=>Ca(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>Sa(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>va(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>ba(e)},row_getParentRows:{fn:e=>xa(e)},row_getUniqueValues:{fn:(e,t)=>ga(e,t)},row_getValue:{fn:(e,t)=>ha(e,t)},row_renderValue:{fn:(e,t)=>_a(e,t)}})},constructTableAPIs:e=>{ni(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>ma(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>wa(t,e,n,r)},table_getRow:{fn:(t,n)=>Ta(e,t,n)},table_getMaxSubRowDepth:{fn:()=>ya(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function Da(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function Oa(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{Da(e,t,n),e._reactivity.commit?.()})}function ka(e){let t=zr(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;rr):e.options=r,n?.syncExternalState!==!1&&Oa(e,r.state??null)}var Ma={coreCellsFeature:si,coreColumnsFeature:ki,coreHeadersFeature:Ki,coreRowModelsFeature:ua,coreRowsFeature:Ea,coreTablesFeature:{constructTableAPIs:e=>{ni(`coreTablesFeature`,e,{table_reset:{fn:()=>ka(e)},table_setOptions:{fn:t=>ja(e,t)}})}}};function Na(e){return e}function Pa(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),zr(t)}function Fa(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Ma,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=Pa(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&Hr(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}Da(v),v.store=Pr(t.createReadonlyAtom(()=>{let e={};for(let t=0;t{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var Ra=La({resolveDataValue:e=>Va(e).toLowerCase(),sort:(e,t)=>Ha(e,t)}),za=La({sort:(e,t)=>Ba(e,t)});function Ba(e,t){return e===t?0:e>t?1:-1}function Va(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function Ha(e,t){let n=0,r=0,i=e.length,a=t.length;for(;n=48&&e<=57}function Wa(e,t,n){let r=t+1;for(;ro)return 1;if(o>a)return-1}return o>s?1:s>o?-1:0}function Ka(e,t,n,r,i,a){let o=t;for(;oi?1:i>t?-1:0}let u=parseInt(e.slice(t,n),10),d=parseInt(r.slice(i,a),10);return u>d?1:d>u?-1:0}function qa(e,t,n){let r=0;for(let i=t;i1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return za}function eo(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&oo(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function ro(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??eo(e)===`desc`?`desc`:`asc`}function io(e,t){let n=ro(e),r=so(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function ao(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function oo(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function so(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function co(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function lo(e){Xa(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function uo(e){let t=ao(e);return n=>{t&&no(e,void 0,oo(e)?e.table.options.isMultiSortEvent?.(n):!1)}}var fo={getInitialState(e){return{sorting:Ya(),...e}},getDefaultColumnDef(){return{sortFn:`auto`,sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:Ur(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}},assignColumnPrototype(e,t){ri(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>$a(e)},column_getAutoSortDir:{fn:e=>eo(e)},column_getSortFn:{fn:e=>to(e)},column_toggleSorting:{fn:(e,t,n)=>no(e,t,n)},column_getFirstSortDir:{fn:e=>ro(e)},column_getNextSortingOrder:{fn:(e,t)=>io(e,t)},column_getCanSort:{fn:e=>ao(e)},column_getCanMultiSort:{fn:e=>oo(e)},column_getIsSorted:{fn:e=>so(e)},column_getSortIndex:{fn:e=>co(e)},column_clearSorting:{fn:e=>lo(e)},column_getToggleSortingHandler:{fn:e=>uo(e)}})},constructTableAPIs(e){ni(`rowSortingFeature`,e,{table_autoResetSorting:{fn:()=>Qa(e)},table_setSorting:{fn:t=>Xa(e,t)},table_resetSorting:{fn:t=>Za(e,t)}})}};function po(){return e=>{let t=e;return ei({feature:`rowSortingFeature`,table:t,fnName:`table.getSortedRowModel`,memoDeps:()=>[t.atoms.sorting?.get(),t.getPreSortedRowModel()],fn:()=>mo(t),onAfterUpdate:$r(()=>gi(t))})}}function mo(e){let t=e.getPreSortedRowModel(),n=e.atoms.sorting?.get();if(!t.rows.length||!n?.length)return t;let r=[],i=n.filter(t=>{let n=e.getColumn(t.id);return n?ao(n):!1});if(!i.length)return t;let a=[];for(let t=0;t{for(let n=0;n{let t=e.slice();t.sort(o);let n=!1;for(let i=0;i`u`?L.useEffect:L.useLayoutEffect;function go(e,t){let[{table:n,rootSource:r}]=(0,L.useState)(()=>{let t=Fa({...e,features:{coreReactivityFeature:Lr(),...e.features}});return t.Subscribe=(e=>Nr({...e,source:e.source??t.store})),t.FlexRender=Mr,{table:t,rootSource:Ir(t.store,jt)}}),i=n;ja(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=Ee(r,t,{compare:jt});return ho(()=>{r.markCommitted(o),Oa(i,a??null,jt)}),(0,L.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}var _o=new Set([`id`,`http`,`https`,`rpc`,`grpc`,`cpu`,`sql`,`url`,`uri`,`ip`,`io`,`db`,`gc`,`tls`,`api`]),vo={ms:`ms`,ns:`ns`,s:`s`,us:`µs`,bytes:`bytes`,percent:`%`,ratio:`ratio`,per_second:`/s`,per_minute:`/min`},yo={body_template:`message template`,calls:`requests`,spans:`requests`,parquet_index:`traces`};function bo(e,t,{withUnit:n=!0}={}){let r=typeof e==`string`?e:e.name,i=t?.options?.columns?.find(e=>e.field===r)?.unit??(typeof e==`string`?void 0:e.unit)??(typeof e!=`string`&&e.role===`measure`?t?.unit:void 0),a=yo[r]??r;/\b(?:duckdb|parquet|sqlite|variant|timestamptz_ns|timestamp_ns)\b|\btelemetry\./i.test(a)&&(a=`value`),a=a.replace(/^(\w+)\(([^()]*)\)$/,(e,t,n)=>[t,n].filter(Boolean).join(`_`));let o=a.match(/_(ms|ns|us|s|bytes|percent)$/i);o&&(a=a.slice(0,-o[0].length));let s=i??o?.[1]?.toLowerCase();return a=a.split(`_`).map((e,t)=>/^p\d+$/i.test(e)||_o.has(e.toLowerCase())?/^p\d+$/i.test(e)?e.toLowerCase():e.toUpperCase():t===0?e.charAt(0).toUpperCase()+e.slice(1):e).join(` `),a+(n&&s&&s!==`none`&&s!==`count`?` (${vo[s]??s})`:``)}var xo={ok:0,warn:1,bad:2};function So(e){if(!e?.length)return;let t=[...e].sort((e,t)=>xo[e.status]-xo[t.status]),n=t[0],r=t[t.length-1];return xo[r.status]>xo[n.status]&&r.value!==n.value?r.value>n.value?`lower`:`higher`:`lower`}function Co(e,t,n){if(e===null||!t||t.length===0)return null;n??=So(t);let r=`ok`;for(let i of t)(n===`lower`?e>=i.value:e<=i.value)&&xo[i.status]>xo[r]&&(r=i.status);return r}var wo=e=>String(e??``)||`(none)`,To=e=>typeof e==`number`&&Number.isFinite(e)?e:null;function Eo(e){return e.columns.flatMap((e,t)=>e.role===`measure`?[t]:[])}function Do(e){let t=e.columns.findIndex(e=>e.role===`time`);if(t<0)return[];let n=e.columns.findIndex(e=>e.role===`dimension`),r=Eo(e);if(n>=0&&r.length>0){let i=r[0],a=new Map;for(let r=0;r({name:e.columns[n].name,unit:e.columns[n].unit,points:e.values[t].map((t,r)=>[Number(t),To(e.values[n][r])])}))}function Oo(e){let t=e.columns.flatMap((e,t)=>e.role===`dimension`?[t]:[]),n=Eo(e);if(t.length===0||n.length===0)return{categories:[],series:[]};let r=t[0],i=[];for(let t=0;t1){let a=t[1],o=n[0],s=new Map;for(let t=0;tnull)),s.get(n)[i.indexOf(String(e.values[r][t]??``))]=To(e.values[o][t])}return{categories:i,series:[...s.entries()].map(([t,n])=>({name:t,unit:e.columns[o].unit,values:n}))}}return{categories:i,series:n.map(t=>({name:e.columns[t].name,unit:e.columns[t].unit,values:e.values[t].map(To)}))}}function ko(e,t){let n=e.filter(e=>e!==null);if(n.length===0)return null;switch(t){case`last`:return n[n.length-1];case`min`:return Math.min(...n);case`max`:return Math.max(...n);case`sum`:return n.reduce((e,t)=>e+t,0);default:return n.reduce((e,t)=>e+t,0)/n.length}}function Ao(e,t){let n=Eo(t)[0];return n===void 0?null:(e.reduce??`window`)===`window`?t.totals?To(t.totals[n]):ko(t.values[n].map(To),`mean`):ko(t.values[n].map(To),e.reduce??`mean`)}function jo(e){let t=Eo(e)[0];return t===void 0?[]:e.values[t].map(To)}function Mo(e,t){return!t.previous||(e.reduce??`window`)===`window`&&!t.previous.totals?null:Ao(e,t.previous)}function No(e,t){return`rgba(${[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)).join(`, `)}, ${t})`}function Po(e,t){return{color:e,...ae(e,t.surface)<3?{borderColor:t.text,borderWidth:1}:{}}}function Fo(e,t){return{color:e,...ae(e,t.surface)<3?{shadowColor:t.text,shadowBlur:2}:{}}}function Io(e,t){return{ok:A,warn:_,bad:We}[e][t?5:8]}function Lo({panel:e,result:t,dark:n=!1,compare:r=!0,range:i}){let a=t.frame,o=Ao(e,a),s=a.columns.find(e=>e.role===`measure`)?.unit??e.unit,c=e.better??t.better??So(e.thresholds),l=Co(o,e.thresholds,c)??(a.health?.health===`healthy`?`ok`:a.health?.health===`degraded`?`warn`:a.health?.health===`unhealthy`?`bad`:null),u=Mo(e,t),f=jo(a),p=e.thresholds?.find(e=>e.status===l&&o!==null&&(c===`higher`?o<=e.value:o>=e.value))?.label;return(0,R.jsxs)(I,{h:`100%`,style:{display:`flex`,flexDirection:`column`,justifyContent:`space-between`,gap:4},children:[(0,R.jsxs)(De,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,gap:`xs`,children:[(0,R.jsx)(F,{"data-stat-value":!0,fz:24,fw:500,lh:1.1,lts:`-0.02em`,ff:`var(--mantine-font-family-monospace)`,children:d(s,o)}),l&&(0,R.jsx)(I,{"data-stat-status":!0,children:(0,R.jsx)(tt,{tone:l===`bad`?`danger`:l===`warn`?`warning`:`success`,children:p??(l===`bad`?`Unhealthy`:l===`warn`?`Degraded`:`Healthy`)})})]}),r&&u!==null&&o!==null&&(0,R.jsx)(Ro,{dark:n,value:o,previous:u,better:c,unit:s,period:zo(i,t)}),(0,R.jsx)(Bo,{points:f,area:!0,dark:n,height:40})]})}function Ro({value:e,previous:t,better:n,unit:r,period:i,dark:a}){let o=r===`percent`,s=o?e-t:t===0?e===0?0:1/0:(e-t)/Math.abs(t)*100,c=s>=0,l=s===0||!n?null:c?n===`higher`:n===`lower`,u=Number.isFinite(s)?o?`${c?`+`:`−`}${Math.abs(s).toFixed(1)} pts`:`${c?`+`:`−`}${Math.abs(s).toFixed(0)}%`:`new`;return(0,R.jsxs)(De,{gap:6,children:[(0,R.jsxs)(F,{"data-stat-delta":!0,fz:12,fw:600,style:{color:l===null?`var(--mantine-color-dimmed)`:Io(l?`ok`:`bad`,a)},children:[c?`▲`:`▼`,` `,u]}),(0,R.jsxs)(F,{fz:12,c:`dimmed`,children:[`vs previous `,i]})]})}function zo(e,t){let n=t.from_ms!==void 0&&t.to_ms!==void 0?t.to_ms-t.from_ms:t.shift_ms,r=/^(\d+)(s|m|h|d|w)$/.exec(e??``),i=r?Number(r[1])*{s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5}[r[2]]:n;if(!i)return`period`;let a=i>=6048e5?`week`:i>=864e5?`day`:i>=36e5?`hour`:i>=6e4?`minute`:`second`,o=i/{week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3}[a];return o===1?a:`${Number(o.toFixed(2))} ${a}s`}function Bo({points:e,area:t=!1,dark:n=!1,height:r=32}){let i=e.filter(e=>e!==null&&Number.isFinite(e));if(i.length<2)return null;let a=Math.min(...i),o=Math.max(...i),s=r,c=t=>t/(e.length-1)*200,l=e=>s-2-(e-a)/(o-a||1)*(s-4),u=e.map((t,n)=>t===null||!Number.isFinite(t)?``:`${n===0||e[n-1]===null||!Number.isFinite(e[n-1])?`M`:`L`}${c(n).toFixed(1)},${l(t).toFixed(1)}`).join(``),d=[];return e.forEach((t,n)=>{if(t!==null&&Number.isFinite(t)){if(!n||e[n-1]===null||!Number.isFinite(e[n-1]))d.push({start:n,end:n,path:`M${c(n).toFixed(1)},${l(t).toFixed(1)}`});else{let e=d.at(-1);e.end=n,e.path+=`L${c(n).toFixed(1)},${l(t).toFixed(1)}`}}}),(0,R.jsxs)(`svg`,{viewBox:`0 0 200 ${s}`,preserveAspectRatio:`none`,width:`100%`,height:s,role:`img`,"aria-label":`Value over this panel's time range`,children:[t&&d.filter(e=>e.end>e.start).map(e=>(0,R.jsx)(`path`,{"data-sparkline-area":!0,d:`${e.path}L${c(e.end)},${s}L${c(e.start)},${s}Z`,fill:fr(0,n),opacity:.18},e.start)),(0,R.jsx)(`path`,{"data-sparkline-line":!0,d:u,fill:`none`,stroke:fr(0,n),strokeWidth:1.5,vectorEffect:`non-scaling-stroke`})]})}function Vo(e,t,n,r,i,a){e.format===`status`&&e.unit&&typeof t==`string`&&t.trim()!==``&&Number.isFinite(Number(t))&&(t=Number(t));let o=t===null?`—`:String(t),s={kind:e.format,text:o};if([`unit`,`bar`,`status`,`sparkline`].includes(e.format)&&(s.text=typeof t==`number`?d(e.unit,t):o),e.format===`bar`&&(s.fraction=typeof t==`number`&&n>0?Math.max(0,Math.min(1,t/n)):0),e.format===`status`&&typeof t==`number`&&(s.status=Co(Number.isFinite(t)?t:null,r?.thresholds,r?.better??i)),e.format===`service_link`&&(s.variable=e.variable),e.format===`sparkline`&&a)return s.points=a.slice(0,240),s;if(e.format===`sparkline`)try{let e=JSON.parse(o);Array.isArray(e)?s.points=e.slice(0,240).map(e=>typeof e==`number`&&Number.isFinite(e)?e:null):s.unsupported=`Sparkline requires an array column`}catch{s.unsupported=`Sparkline requires an array column`}return s}function Ho({text:e,template:t=!1,highlight:n=``}){let r=P(`light`)===`dark`,i=ne[r?5:7],a=[1,3,5].map(e=>parseInt(i.slice(e,e+2),16)).join(`, `),o=[];if(n){let t=e.toLowerCase(),r=n.toLowerCase();for(let e=t.indexOf(r);e!==-1;e=t.indexOf(r,e+r.length))o.push(e)}let c=(t,i)=>{let s=[],c=t;for(let l of o){let o=Math.max(t,l),u=Math.min(i,l+n.length);o>=u||(s.push(e.slice(c,o),(0,R.jsx)(`mark`,{"data-highlight-match":!0,style:{background:`rgba(${a}, ${r?.22:.3})`,color:`inherit`,borderRadius:3,padding:`0 2px`},children:e.slice(o,u)},o)),c=u)}return s.push(e.slice(c,i)),s},l=[],u=0;if(t)for(let t of e.matchAll(/<\*>||||