@ahmedramez-org/nexus-chat 1.0.0-beta.2 → 1.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -44
- package/contract/conformance.js +30 -5
- package/contract/index.d.ts +96 -8
- package/contract/index.js +14 -0
- package/index.d.ts +23 -3
- package/index.js +238 -14
- package/package.json +19 -4
- package/react.d.ts +77 -17
- package/react.js +241 -35
- package/window.js +387 -0
- package/remote/assets/AgentOptionControl-BnqfB5W3.js +0 -1
- package/remote/assets/CsvPreview-DD2VELWa.js +0 -10
- package/remote/assets/ErrorCard-Bu_0QAJ9.js +0 -1
- package/remote/assets/HighlightedCode-DpxGYHfF.js +0 -1
- package/remote/assets/HistorySearchDialog-q4cvx5jy.js +0 -41
- package/remote/assets/HostBridgeProvider-BV-UGU3Q.js +0 -1
- package/remote/assets/HtmlArtifactRenderer-EO_cwaEm.js +0 -1
- package/remote/assets/I18nContext-BlQKoDmv.js +0 -24
- package/remote/assets/PreviewState-VcIZyCXJ.js +0 -1
- package/remote/assets/SourceCitations-DvApeC9N.js +0 -1
- package/remote/assets/SourcesArtifactRenderer-BqnIOctm.js +0 -1
- package/remote/assets/TableArtifactRenderer-BLZLQMxU.js +0 -2
- package/remote/assets/TiptapComposerInput-CmxEiBlE.js +0 -132
- package/remote/assets/UnsupportedArtifact-CeOCu_J6.js +0 -1
- package/remote/assets/_virtual_mf-localSharedImportMap___mfe_internal__nexusChat__mf_owner__1-CObPUVU6.js +0 -1
- package/remote/assets/ar-BV81JAir.js +0 -1
- package/remote/assets/button-CO0tH6F2.js +0 -1
- package/remote/assets/client-Bv7EbCrM.js +0 -2
- package/remote/assets/composite-giRhJC3d.js +0 -1
- package/remote/assets/conformance-entry-uotihsU2.js +0 -2
- package/remote/assets/createLucideIcon-D1A0JYKN.js +0 -1
- package/remote/assets/de-BXJlhmC2.js +0 -1
- package/remote/assets/defineProperty-BbfpZ9Tg.js +0 -1
- package/remote/assets/dist-MaNcI-Om.js +0 -4
- package/remote/assets/errorReporter-hCgThzof.js +0 -1
- package/remote/assets/es-nnw68YFM.js +0 -1
- package/remote/assets/federation-entry-B8pojL73.css +0 -2
- package/remote/assets/federation-entry-BA9UpYiM.js +0 -65
- package/remote/assets/floating-ui.dom-B99QSfPH.js +0 -1
- package/remote/assets/floating-ui.utils.dom-ObnfY4F6.js +0 -1
- package/remote/assets/fr-CJIAbbzn.js +0 -1
- package/remote/assets/highlighter-C37NKSjx.js +0 -19
- package/remote/assets/hostInit-YMtJ2r-g.js +0 -1
- package/remote/assets/it-D3TiEKfy.js +0 -1
- package/remote/assets/ja-ZB0L4Lsc.js +0 -1
- package/remote/assets/jsx-runtime-DE3RlOCf.js +0 -1
- package/remote/assets/lib-CjT9YRPC.js +0 -1
- package/remote/assets/modelProviderIcons-fiyx4SaW.js +0 -1
- package/remote/assets/react-dom-FxOPXJ08.js +0 -1
- package/remote/assets/rehype-raw-CNOzW4vu.js +0 -2
- package/remote/assets/roboto-latin-400-italic-CSuqwwKr.woff2 +0 -0
- package/remote/assets/roboto-latin-400-normal-BqEyEoaF.woff2 +0 -0
- package/remote/assets/roboto-latin-500-italic-DOe3GFcv.woff2 +0 -0
- package/remote/assets/roboto-latin-500-normal-7RbcRiD8.woff2 +0 -0
- package/remote/assets/roboto-latin-700-italic-Cb9agdGy.woff2 +0 -0
- package/remote/assets/roboto-latin-700-normal-BZpUvMxY.woff2 +0 -0
- package/remote/assets/roboto-latin-ext-400-italic-BilqUbDw.woff2 +0 -0
- package/remote/assets/roboto-latin-ext-400-normal-C3tdtHj3.woff2 +0 -0
- package/remote/assets/roboto-latin-ext-500-italic-B5teBpxj.woff2 +0 -0
- package/remote/assets/roboto-latin-ext-500-normal-pMCM9Ixg.woff2 +0 -0
- package/remote/assets/roboto-latin-ext-700-italic-CBdFfgzf.woff2 +0 -0
- package/remote/assets/roboto-latin-ext-700-normal-DSBUz0N1.woff2 +0 -0
- package/remote/assets/rolldown-runtime-hePW80VL.js +0 -1
- package/remote/assets/sessionTitle-C9LhAN0r.js +0 -1
- package/remote/assets/spinner-eqRx6Fq-.js +0 -1
- package/remote/assets/sqlFormatting-BjJIfUN_.js +0 -7
- package/remote/assets/src-CIHHGjAO.js +0 -1
- package/remote/assets/store-FaSYSP4_.js +0 -1
- package/remote/assets/useBaseUiId-Dpqq0brK.js +0 -1
- package/remote/assets/usePositioner-BhCjFmeW.js +0 -1
- package/remote/assets/virtualExposes-C0oWo8z2.js +0 -1
- package/remote/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__nexusChat__remoteEntry_js-5uUvXWWH.js +0 -1
- package/remote/assets/virtual_mf-exposes-ssr___mfe_internal__nexusChat__remoteEntry_js-WBZ0Muv9.js +0 -2
- package/remote/assets/virtual_mf-exposes___mfe_internal__nexusChat__remoteEntry_js-BGZ2nkwm.js +0 -2
- package/remote/assets/vite-preload-helper-B7qeedMF.js +0 -1
- package/remote/assets/zh-De2Ilp0M.js +0 -1
- package/remote/remoteEntry.js +0 -1
- package/remote/remoteEntry.ssr.js +0 -1
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{n as r}from"./createLucideIcon-D1A0JYKN.js";import{C as i}from"./composite-giRhJC3d.js";import{D as a,_ as o,c as s,d as c,f as l,g as u,l as d,m as f,o as p,p as m,t as h,u as g}from"./sessionTitle-C9LhAN0r.js";import{r as _}from"./I18nContext-BlQKoDmv.js";import{t as v}from"./ErrorCard-Bu_0QAJ9.js";import{t as ee}from"./react-dom-FxOPXJ08.js";var y=n(),b=1,x=.9,S=.8,C=.17,w=.1,T=.999,E=.9999,D=.99,te=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,ne=/[\s-]/g;function A(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?b:D;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=A(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=b:te.test(e.charAt(l-1))?(d*=S,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=T**+p.length)):k.test(e.charAt(l-1))?(d*=x,m=e.slice(i,l-1).match(ne),m&&i>0&&(d*=T**+m.length)):(d*=C,i>0&&(d*=T**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=E)),(d<w&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=A(e,t,n,r,l+1,a+2,o),f*w>d&&(d=f*w)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function re(e){return e.toLowerCase().replace(ne,` `)}function ie(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,A(e,t,re(e),re(t),0,0,{})}var j=e(t(),1),ae=Object.defineProperty,M=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),oe=!!(typeof window<`u`&&window.document&&window.document.createElement);function N(e,t,{checkForDefaultPrevented:n=!0}={}){return M(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},`handleEvent`)}M(N,`composeEventHandlers`);function se(e){var t;if(!oe)throw Error(`Cannot access window outside of the DOM`);return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)??window}M(se,`getOwnerWindow`);function ce(e){if(!oe)throw Error(`Cannot access document outside of the DOM`);return(e==null?void 0:e.ownerDocument)??document}M(ce,`getOwnerDocument`);function le(e,t=!1){let{activeElement:n}=ce(e);if(!(n!=null&&n.nodeName))return null;if(ue(n)&&n.contentDocument)return le(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ce(n).getElementById(e);if(t)return t}}return n}M(le,`getActiveElement`);function ue(e){return e.tagName===`IFRAME`}M(ue,`isFrame`);var de=Object.defineProperty,fe=(e,t)=>de(e,`name`,{value:t,configurable:!0});function pe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}fe(pe,`setRef`);function P(...e){return t=>{let n=!1,r=e.map(e=>{let r=pe(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():pe(e[t],null)}}}}fe(P,`composeRefs`);function me(...e){return j.useCallback(P(...e),e)}fe(me,`useComposedRefs`);var he=Object.defineProperty,F=(e,t)=>he(e,`name`,{value:t,configurable:!0});function ge(e,t){let n=j.createContext(t);n.displayName=e+`Context`;let r=F(e=>{let{children:t,...r}=e,i=j.useMemo(()=>r,Object.values(r));return(0,y.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=j.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return F(i,`useContext`),[r,i]}F(ge,`createContext`);function _e(e,t=[]){let n=[];function r(t,r){let i=j.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=F(t=>{var n;let{scope:r,children:o,...s}=t,c=(r==null||(n=r[e])==null?void 0:n[a])||i,l=j.useMemo(()=>s,Object.values(s));return(0,y.jsx)(c.Provider,{value:l,children:o})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){var c;let{optional:l=!1}=s,u=(o==null||(c=o[e])==null?void 0:c[a])||i,d=j.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return F(s,`useContext`),[o,s]}F(r,`createContext`);let i=F(()=>{let t=n.map(e=>j.createContext(e));return F(function(n){let r=(n==null?void 0:n[e])||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ve(i,...t)]}F(_e,`createContextScope`);function ve(...e){let t=e[0];if(e.length===1)return t;let n=F(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return F(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}F(ve,`composeContextScopes`);var ye,I=(ye=globalThis)!=null&&ye.document?j.useLayoutEffect:()=>{},be=Object.defineProperty,xe=(e,t)=>be(e,`name`,{value:t,configurable:!0}),Se=j.useId||(()=>void 0),Ce=0;function L(e){let[t,n]=j.useState(Se());return I(()=>{e||n(e=>e??String(Ce++))},[e]),e||(t?`radix-${t}`:``)}xe(L,`useId`);var we=Object.defineProperty,Te=(e,t)=>we(e,`name`,{value:t,configurable:!0}),Ee=j.useEffectEvent,De=j.useInsertionEffect;function Oe(e){if(typeof Ee==`function`)return Ee(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof De==`function`?De(()=>{t.current=e}):I(()=>{t.current=e}),j.useMemo(()=>((...e)=>{var n;return(n=t.current)==null?void 0:n.call(t,...e)}),[])}Te(Oe,`useEffectEvent`);var ke=Object.defineProperty,Ae=(e,t)=>ke(e,`name`,{value:t,configurable:!0}),je=j.useInsertionEffect||I;function Me({prop:e,defaultProp:t,onChange:n=Ae(()=>{},`onChange`),caller:r}){let[i,a,o]=Ne({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let r=Pe(t)?t(e):t;if(r!==e){var n;(n=o.current)==null||n.call(o,r)}}else a(t)},[s,e,a,o])]}Ae(Me,`useControllableState`);function Ne({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return je(()=>{a.current=t},[t]),j.useEffect(()=>{if(i.current!==n){var e;(e=a.current)==null||e.call(a,n),i.current=n}},[n,i]),[n,r,a]}Ae(Ne,`useUncontrolledState`);function Pe(e){return typeof e==`function`}Ae(Pe,`isFunction`);var Fe=Symbol(`RADIX:SYNC_STATE`);function Ie(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Oe(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===Fe)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Fe,state:i})},[i,d.state,c]),[h,f]}Ae(Ie,`useControllableStateReducer`);var Le=e(ee(),1),Re=Object.defineProperty,R=(e,t)=>Re(e,`name`,{value:t,configurable:!0});function ze(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];qe(r)&&typeof Ze==`function`&&(r=Ze(r._payload)),j.Children.forEach(r,e=>{if(Ge(e)){var t;o=!0;let n=e,r=`child`in n.props?n.props.child:n.props.children;qe(r)&&typeof Ze==`function`&&(r=Ze(r._payload)),a=He(n,r),s.push(a==null||(t=a.props)==null?void 0:t.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?We(a):void 0,l=me(n,c);if(!a){if(r||r===0)throw Error(o?Xe(e):Ye(e));return r}let u=Ue(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}R(ze,`createSlot`);var Be=Symbol.for(`radix.slottable`);function Ve(e){let t=R(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Be,t}R(Ve,`createSlottable`);var He=R((e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ue(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}R(Ue,`mergeProps`);function We(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,`ref`))==null?void 0:t.get,i=r&&`isReactWarning`in r&&r.isReactWarning;return i?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,`ref`))==null?void 0:n.get,i=r&&`isReactWarning`in r&&r.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}R(We,`getElementRef`);function Ge(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Be}R(Ge,`isSlottable`);var Ke=Symbol.for(`react.lazy`);function qe(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ke&&`_payload`in e&&Je(e._payload)}R(qe,`isLazyComponent`);function Je(e){return typeof e==`object`&&!!e&&`then`in e}R(Je,`isPromiseLike`);var Ye=R(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Xe=R(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ze=j.use,Qe=Object.defineProperty,$e=(e,t)=>Qe(e,`name`,{value:t,configurable:!0}),z=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ze(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,y.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function et(e,t){e&&Le.flushSync(()=>e.dispatchEvent(t))}$e(et,`dispatchDiscreteCustomEvent`);var tt=Object.defineProperty,nt=(e,t)=>tt(e,`name`,{value:t,configurable:!0});function rt(e){let t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>((...e)=>{var n;return(n=t.current)==null?void 0:n.call(t,...e)}),[])}nt(rt,`useCallbackRef`);var it=Object.defineProperty,B=(e,t)=>it(e,`name`,{value:t,configurable:!0}),at=`dismissableLayer.update`,ot=`dismissableLayer.pointerDownOutside`,st=`dismissableLayer.focusOutside`,ct,lt=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ut=j.forwardRef(B(function(e,t){var n;let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=j.useContext(lt),[f,p]=j.useState(null),m=(f==null?void 0:f.ownerDocument)??((n=globalThis)==null?void 0:n.document),[,h]=j.useState({}),g=me(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),ee=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=ee,C=j.useRef(!1),w=pt(e=>{o==null||o(e),c==null||c(e),e.defaultPrevented||l==null||l()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:j.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=mt(e=>{if(i&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s==null||s(e),c==null||c(e),e.defaultPrevented||l==null||l())},m),E=f?b===_.length-1:!1,D=rt(e=>{e.key===`Escape`&&(a==null||a(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return j.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),j.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ct=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ht(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=ct))}},[f,m,r,d]),j.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ht())},[f,d]),j.useEffect(()=>{let e=B(()=>h({}),`handleUpdate`);return document.addEventListener(at,e),()=>document.removeEventListener(at,e)},[]),(0,y.jsx)(z.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:N(e.onFocusCapture,T.onFocusCapture),onBlurCapture:N(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:N(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function dt(){let e=j.useContext(lt),[t,n]=j.useState(null);return j.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}B(dt,`useDismissableLayerSurface`);var ft=B(()=>!0,`IS_TRUE`);function pt(e,t){var n;let{ownerDocument:r=(n=globalThis)==null?void 0:n.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o,shouldHandlePointerDownOutside:s=ft}=t,c=rt(e),l=j.useRef(!1),u=j.useRef(!1),d=j.useRef(new Map),f=j.useRef(()=>{});return j.useEffect(()=>{function e(){u.current=!1,a.current=!1,d.current.clear()}B(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}B(t,`isOutsideInteractionIntercepted`);function n(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}B(n,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}B(p,`handleInteractionBubble`);let m=B(n=>{if(n.target&&!l.current){let o=function(){r.removeEventListener(`click`,f.current);let n=t();e(),n||gt(ot,c,p,{discrete:!0})};if(B(o,`handleAndDispatchPointerDownOutsideEvent`),!s(n.target)){r.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:n};u.current=!0,a.current=i&&n.button===0,d.current.clear(),!i||n.button!==0?o():(r.removeEventListener(`click`,f.current),f.current=o,r.addEventListener(`click`,f.current,{once:!0}))}else r.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)r.addEventListener(e,n,!0),r.addEventListener(e,p);let g=window.setTimeout(()=>{r.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),r.removeEventListener(`pointerdown`,m),r.removeEventListener(`click`,f.current);for(let e of h)r.removeEventListener(e,n,!0),r.removeEventListener(e,p)}},[r,c,i,a,o,s]),{onPointerDownCapture:B(()=>l.current=!0,`onPointerDownCapture`)}}B(pt,`usePointerDownOutside`);function mt(e,t=(()=>{var e;return(e=globalThis)==null?void 0:e.document})()){let n=rt(e),r=j.useRef(!1);return j.useEffect(()=>{let e=B(e=>{e.target&&!r.current&>(st,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:B(()=>r.current=!0,`onFocusCapture`),onBlurCapture:B(()=>r.current=!1,`onBlurCapture`)}}B(mt,`useFocusOutside`);function ht(){let e=new CustomEvent(at);document.dispatchEvent(e)}B(ht,`dispatchUpdate`);function gt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?et(i,a):i.dispatchEvent(a)}B(gt,`handleAndDispatchCustomEvent`);var _t=Object.defineProperty,V=(e,t)=>_t(e,`name`,{value:t,configurable:!0}),vt=`focusScope.autoFocusOnMount`,yt=`focusScope.autoFocusOnUnmount`,bt={bubbles:!1,cancelable:!0},xt=j.forwardRef(V(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=j.useState(null),l=rt(i),u=rt(a),d=j.useRef(null),f=me(t,c),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:H(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||H(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&H(s)};V(e,`handleFocusIn`),V(t,`handleFocusOut`),V(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){Ot.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(vt,bt);s.addEventListener(vt,l),s.dispatchEvent(t),t.defaultPrevented||(St(jt(wt(s)),{select:!0}),document.activeElement===e&&H(s))}return()=>{s.removeEventListener(vt,l),setTimeout(()=>{let t=new CustomEvent(yt,bt);s.addEventListener(yt,u),s.dispatchEvent(t),t.defaultPrevented||H(e??document.body,{select:!0}),s.removeEventListener(yt,u),Ot.remove(p)},0)}}},[s,l,u,p]);let m=j.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ct(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&H(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&H(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,y.jsx)(z.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function St(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(H(r,{select:t}),document.activeElement!==n)return}V(St,`focusFirst`);function Ct(e){let t=wt(e);return[Tt(t,e),Tt(t.reverse(),e)]}V(Ct,`getTabbableEdges`);function wt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:V(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}V(wt,`getTabbableCandidates`);function Tt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Et(r,{upTo:t})))return r}V(Tt,`findVisible`);function Et(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}V(Et,`isHidden`);function Dt(e){return e instanceof HTMLInputElement&&`select`in e}V(Dt,`isSelectableInput`);function H(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dt(e)&&t&&e.select()}}V(H,`focus`);var Ot=kt();function kt(){let e=[];return{add(t){let n=e[0];t!==n&&(n==null||n.pause()),e=At(e,t),e.unshift(t)},remove(t){var n;e=At(e,t),(n=e[0])==null||n.resume()}}}V(kt,`createFocusScopesStack`);function At(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}V(At,`arrayRemove`);function jt(e){return e.filter(e=>e.tagName!==`A`)}V(jt,`removeLinks`);var Mt=Object.defineProperty,Nt=j.forwardRef(((e,t)=>Mt(e,`name`,{value:t,configurable:!0}))(function(e,t){var n;let{container:r,...i}=e,[a,o]=j.useState(!1);I(()=>o(!0),[]);let s=r||a&&((n=globalThis)==null||(n=n.document)==null?void 0:n.body);return s?Le.createPortal((0,y.jsx)(z.div,{...i,ref:t}),s):null},`Portal`)),Pt=Object.defineProperty,U=(e,t)=>Pt(e,`name`,{value:t,configurable:!0});function Ft(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}U(Ft,`useStateMachine`);var It=U(e=>{let{present:t,children:n}=e,r=Lt(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=zt(r.ref,Bt(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function Lt(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Ft(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??W(r.current),o.current=void 0):a.current=`none`},[s]),I(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=W(t);e?(o.current=s,c(`MOUNT`)):s===`none`||(t==null?void 0:t.display)===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),I(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=U(a=>{let o=W(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=U(e=>{e.target===t&&(a.current=W(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=W(t)}else r.current=null;n(e)},[])}}U(Lt,`usePresence`);function Rt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}U(Rt,`setRef`);function zt(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Rt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Rt(n[e],null)}}},[])}U(zt,`useStableComposedRefs`);function W(e){return(e==null?void 0:e.animationName)||`none`}U(W,`getAnimationName`);function Bt(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,`ref`))==null?void 0:t.get,i=r&&`isReactWarning`in r&&r.isReactWarning;return i?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,`ref`))==null?void 0:n.get,i=r&&`isReactWarning`in r&&r.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}U(Bt,`getElementRef`);var Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0}),Ut=0,G=null;function Wt(e){return Gt(),e.children}Ht(Wt,`FocusGuards`);function Gt(){j.useEffect(()=>{G||={start:Kt(),end:Kt()};let{start:e,end:t}=G;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ut++,()=>{Ut===1&&(G==null||G.start.remove(),G==null||G.end.remove(),G=null),Ut=Math.max(0,Ut-1)}},[])}Ht(Gt,`useFocusGuards`);function Kt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ht(Kt,`createFocusGuard`);var K=function(){return K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},K.apply(this,arguments)};function qt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Jt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Yt=`right-scroll-bar-position`,Xt=`width-before-scroll-bar`,Zt=`with-scroll-bars-hidden`,Qt=`--removed-body-scroll-bar-size`;function $t(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function en(e,t){var n=(0,j.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var tn=typeof window<`u`?j.useLayoutEffect:j.useEffect,nn=new WeakMap;function rn(e,t){var n=en(t||null,function(t){return e.forEach(function(e){return $t(e,t)})});return tn(function(){var t=nn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$t(e,null)}),i.forEach(function(e){r.has(e)||$t(e,a)})}nn.set(n,e)},[e]),n}function an(e){return e}function on(e,t){t===void 0&&(t=an);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function sn(e){e===void 0&&(e={});var t=on(null);return t.options=K({async:!0,ssr:!1},e),t}var cn=function(e){var t=e.sideCar,n=qt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return j.createElement(r,K({},n))};cn.isSideCarExport=!0;function ln(e,t){return e.useMedium(t),cn}var un=sn(),dn=function(){},fn=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:dn,onWheelCapture:dn,onTouchMoveCapture:dn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,ee=e.gapMode,y=qt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),b=f,x=rn([n,t]),S=K(K({},y),i);return j.createElement(j.Fragment,null,u&&j.createElement(b,{sideCar:un,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:ee}),o?j.cloneElement(j.Children.only(s),K(K({},S),{ref:x})):j.createElement(v,K({},S,{className:c,ref:x}),s))});fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fn.classNames={fullWidth:Xt,zeroRight:Yt};var pn,mn=function(){if(pn)return pn;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function hn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=mn();return t&&e.setAttribute(`nonce`,t),e}function gn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _n(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var vn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hn())&&(gn(t,n),_n(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yn=function(){var e=vn();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bn=function(){var e=yn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},xn={left:0,top:0,right:0,gap:0},Sn=function(e){return parseInt(e||``,10)||0},Cn=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Sn(n),Sn(r),Sn(i)]},wn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return xn;var t=Cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Tn=bn(),En=`data-scroll-locked`,Dn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${Zt} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${En}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${Yt} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${Xt} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${Yt} .${Yt} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${Xt} .${Xt} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${En}] {
|
|
36
|
-
${Qt}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},On=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},kn=function(){j.useEffect(function(){return document.body.setAttribute(En,(On()+1).toString()),function(){var e=On()-1;e<=0?document.body.removeAttribute(En):document.body.setAttribute(En,e.toString())}},[])},An=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;kn();var a=j.useMemo(function(){return wn(i)},[i]);return j.createElement(Tn,{styles:Dn(a,!t,i,n?``:`!important`)})},jn=!1;if(typeof window<`u`)try{var Mn=Object.defineProperty({},"passive",{get:function(){return jn=!0,!0}});window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var q=jn?{passive:!1}:!1,Nn=function(e){return e.tagName===`TEXTAREA`},Pn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Nn(e)&&n[t]===`visible`)},Fn=function(e){return Pn(e,`overflowY`)},In=function(e){return Pn(e,`overflowX`)},Ln=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Bn(e,r)){var i=Vn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Rn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},zn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Bn=function(e,t){return e===`v`?Fn(t):In(t)},Vn=function(e,t){return e===`v`?Rn(t):zn(t)},Hn=function(e,t){return e===`h`&&t===`rtl`?-1:1},Un=function(e,t,n,r,i){var a=Hn(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Vn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Bn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Wn=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gn=function(e){return[e.deltaX,e.deltaY]},Kn=function(e){return e&&`current`in e?e.current:e},qn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jn=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},Yn=0,J=[];function Xn(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),i=j.useState(Yn++)[0],a=j.useState(bn)[0],o=j.useRef(e);j.useEffect(function(){o.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jt([e.lockRef.current],(e.shards||[]).map(Kn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Wn(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ln(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ln(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Un(h,t,e,h===`h`?s:c,!0)},[]),c=j.useCallback(function(e){var n=e;if(!(!J.length||J[J.length-1]!==a)){var r=`deltaY`in n?Gn(n):Wn(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&qn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Kn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=j.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=j.useCallback(function(e){n.current=Wn(e),r.current=void 0},[]),d=j.useCallback(function(t){l(t.type,Gn(t),t.target,s(t,e.lockRef.current))},[]),f=j.useCallback(function(t){l(t.type,Wn(t),t.target,s(t,e.lockRef.current))},[]);j.useEffect(function(){return J.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,q),document.addEventListener(`touchmove`,c,q),document.addEventListener(`touchstart`,u,q),function(){J=J.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,q),document.removeEventListener(`touchmove`,c,q),document.removeEventListener(`touchstart`,u,q)}},[]);var p=e.removeScrollBar,m=e.inert;return j.createElement(j.Fragment,null,m?j.createElement(a,{styles:Jn(i)}):null,p?j.createElement(An,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qn=ln(un,Xn),$n=j.forwardRef(function(e,t){return j.createElement(fn,K({},e,{ref:t,sideCar:Qn}))});$n.classNames=fn.classNames;var er=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Y=new WeakMap,tr=new WeakMap,nr={},rr=0,ir=function(e){return e&&(e.host||ir(e.parentNode))},ar=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ir(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},or=function(e,t,n,r){var i=ar(t,Array.isArray(e)?e:[e]);nr[n]||(nr[n]=new WeakMap);var a=nr[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Y.get(e)||0)+1,l=(a.get(e)||0)+1;Y.set(e,c),a.set(e,l),o.push(e),c===1&&i&&tr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),rr++,function(){o.forEach(function(e){var t=Y.get(e)-1,i=a.get(e)-1;Y.set(e,t),a.set(e,i),t||(tr.has(e)||e.removeAttribute(r),tr.delete(e)),i||e.removeAttribute(n)}),rr--,rr||(Y=new WeakMap,Y=new WeakMap,tr=new WeakMap,nr={})}},sr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||er(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),or(r,i,n,`aria-hidden`)):function(){return null}},cr=Object.defineProperty,X=(e,t)=>cr(e,`name`,{value:t,configurable:!0}),lr=`Dialog`,[ur,dr]=_e(lr),[fr,Z]=ur(lr),pr=X(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=j.useRef(null),c=j.useRef(null),[l,u]=Me({prop:r,defaultProp:i??!1,onChange:a,caller:lr}),[d,f]=j.useState(0),[p,m]=j.useState(0);return(0,y.jsx)(fr,{scope:t,triggerRef:s,contentRef:c,contentId:L(),titleId:L(),descriptionId:L(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:j.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),mr=`DialogPortal`,[hr,gr]=ur(mr,{forceMount:void 0}),_r=X(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Z(mr,t);return(0,y.jsx)(hr,{scope:t,forceMount:n,children:j.Children.map(r,e=>(0,y.jsx)(It,{present:n||a.open,children:(0,y.jsx)(Nt,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),vr=`DialogOverlay`,yr=j.forwardRef(X(function(e,t){let n=gr(vr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(vr,e.__scopeDialog);return a.modal?(0,y.jsx)(It,{present:r||a.open,children:(0,y.jsx)(xr,{...i,ref:t})}):null},`DialogOverlay`)),br=ze(`DialogOverlay.RemoveScroll`),xr=j.forwardRef(X(function(e,t){let{__scopeDialog:n,...r}=e,i=Z(vr,n),a=me(t,dt());return(0,y.jsx)($n,{as:br,allowPinchZoom:!0,shards:[i.contentRef],children:(0,y.jsx)(z.div,{"data-state":Dr(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Sr=`DialogContent`,Cr=j.forwardRef(X(function(e,t){let n=gr(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(Sr,e.__scopeDialog);return(0,y.jsx)(It,{present:r||a.open,children:a.modal?(0,y.jsx)(wr,{...i,ref:t}):(0,y.jsx)(Tr,{...i,ref:t})})},`DialogContent`)),wr=j.forwardRef(X(function(e,t){let n=Z(Sr,e.__scopeDialog),r=j.useRef(null),i=me(t,n.contentRef,r);return j.useEffect(()=>{let e=r.current;if(e)return sr(e)},[]),(0,y.jsx)(Er,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:N(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),(t=n.triggerRef.current)==null||t.focus()}),onPointerDownOutside:N(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:N(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Tr=j.forwardRef(X(function(e,t){let n=Z(Sr,e.__scopeDialog),r=j.useRef(!1),i=j.useRef(!1);return(0,y.jsx)(Er,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var a;if((a=e.onCloseAutoFocus)==null||a.call(e,t),!t.defaultPrevented){var o;r.current||(o=n.triggerRef.current)==null||o.focus(),t.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:t=>{var a,o;(a=e.onInteractOutside)==null||a.call(e,t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let s=t.target;(o=n.triggerRef.current)!=null&&o.contains(s)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Er=j.forwardRef(X(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Z(Sr,n);return Gt(),(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(xt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(ut,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Dr(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function Dr(e){return e?`open`:`closed`}X(Dr,`getState`);var Or=`[cmdk-group=""]`,kr=`[cmdk-group-items=""]`,Ar=`[cmdk-group-heading=""]`,jr=`[cmdk-item=""]`,Mr=`${jr}:not([aria-disabled="true"])`,Nr=`cmdk-item-select`,Pr=`data-value`,Fr=(e,t,n)=>ie(e,t,n),Ir=j.createContext(void 0),Lr=()=>j.useContext(Ir),Rr=j.createContext(void 0),zr=()=>j.useContext(Rr),Br=j.createContext(void 0),Vr=j.forwardRef((e,t)=>{let n=ei(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ei(()=>new Set),i=ei(()=>new Map),a=ei(()=>new Map),o=ei(()=>new Set),s=$r(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=L(),ee=L(),y=L(),b=j.useRef(null),x=ni();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,S.emit()}},[u]),Q(()=>{x(6,te)},[]);let S=j.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o,c;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),T(),x(1,E);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(y);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(x(7,()=>{var e;n.current.selectedItemId=(e=O())==null?void 0:e.id,S.emit()}),r||x(5,te),((a=s.current)==null?void 0:a.value)!==void 0){let e=t??``;(c=(o=s.current).onValueChange)==null||c.call(o,e);return}}S.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=j.useMemo(()=>({value:(e,t,r)=>{var i;t!==((i=a.current.get(e))==null?void 0:i.value)&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,w(t,r)),x(2,()=>{T(),S.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),x(3,()=>{D(),T(),n.current.value||E(),S.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();x(4,()=>{D(),(t==null?void 0:t.getAttribute(`id`))===e&&E(),S.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:y,labelId:ee,listInnerRef:b}),[]);function w(e,t){var r;let i=((r=s.current)==null?void 0:r.filter)??Fr;return e?i(e,n.current.search,t):0}function T(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=b.current;k().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(kr);t?t.appendChild(e.parentElement===t?e:e.closest(`${kr} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${kr} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=(t=b.current)==null?void 0:t.querySelector(`${Or}[${Pr}="${encodeURIComponent(e[0])}"]`);n==null||n.parentElement.appendChild(n)})}function E(){let e=k().find(e=>e.getAttribute(`aria-disabled`)!==`true`),t=e==null?void 0:e.getAttribute(Pr);S.setState(`value`,t||void 0)}function D(){var e,t;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let o=0;for(let i of r.current){let r=w(((e=a.current.get(i))==null?void 0:e.value)??``,((t=a.current.get(i))==null?void 0:t.keywords)??[]);n.current.filtered.items.set(i,r),r>0&&o++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=o}function te(){var e,t,n;let r=O();r&&(((e=r.parentElement)==null?void 0:e.firstChild)===r&&((n=(t=r.closest(Or))==null?void 0:t.querySelector(Ar))==null||n.scrollIntoView({block:`nearest`})),r.scrollIntoView({block:`nearest`}))}function O(){var e;return(e=b.current)==null?void 0:e.querySelector(`${jr}[aria-selected="true"]`)}function k(){var e;return Array.from(((e=b.current)==null?void 0:e.querySelectorAll(Mr))||[])}function ne(e){let t=k()[e];t&&S.setState(`value`,t.getAttribute(Pr))}function A(e){var t;let n=O(),r=k(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&S.setState(`value`,a.getAttribute(Pr))}function re(e){let t=O(),n=t==null?void 0:t.closest(Or),r;for(;n&&!r;)n=e>0?Zr(n,Or):Qr(n,Or),r=n==null?void 0:n.querySelector(Mr);r?S.setState(`value`,r.getAttribute(Pr)):A(e)}let ie=()=>ne(k().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?re(1):A(1)},M=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?re(-1):A(-1)};return j.createElement(z.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ae(e);break;case`ArrowDown`:ae(e);break;case`p`:case`k`:g&&e.ctrlKey&&M(e);break;case`ArrowUp`:M(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),ie();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(Nr);t.dispatchEvent(e)}}}}},j.createElement(`label`,{"cmdk-label":``,htmlFor:C.inputId,id:C.labelId,style:ai},c),ii(e,e=>j.createElement(Rr.Provider,{value:S},j.createElement(Ir.Provider,{value:C},e))))}),Hr=j.forwardRef((e,t)=>{var n;let r=L(),i=j.useRef(null),a=j.useContext(Br),o=Lr(),s=$r(e),c=((n=s.current)==null?void 0:n.forceMount)??(a==null?void 0:a.forceMount);Q(()=>{if(!c)return o.item(r,a==null?void 0:a.id)},[c]);let l=ti(r,i,[e.value,e.children,i],e.keywords),u=zr(),d=$(e=>e.value&&e.value===l.current),f=$(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(r)>0);j.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(Nr,p),()=>t.removeEventListener(Nr,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:ee,...y}=e;return j.createElement(z.div,{ref:P(i,t),...y,id:r,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),Ur=j.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=L(),s=j.useRef(null),c=j.useRef(null),l=L(),u=Lr(),d=$(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Q(()=>u.group(o),[]),ti(o,s,[e.value,e.heading,c]);let f=j.useMemo(()=>({id:o,forceMount:i}),[i]);return j.createElement(z.div,{ref:P(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&j.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ii(e,e=>j.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},j.createElement(Br.Provider,{value:f},e))))}),Wr=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=j.useRef(null),a=$(e=>!e.search);return!n&&!a?null:j.createElement(z.div,{ref:P(i,t),...r,"cmdk-separator":``,role:`separator`})}),Gr=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=zr(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=Lr();return j.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),j.createElement(z.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n==null||n(e.target.value)}})}),Kr=j.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=j.useRef(null),o=j.useRef(null),s=$(e=>e.selectedItemId),c=Lr();return j.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),j.createElement(z.div,{ref:P(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ii(e,e=>j.createElement(`div`,{ref:P(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),qr=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return j.createElement(pr,{open:n,onOpenChange:r},j.createElement(_r,{container:o},j.createElement(yr,{"cmdk-overlay":``,className:i}),j.createElement(Cr,{"aria-label":e.label,"cmdk-dialog":``,className:a},j.createElement(Vr,{ref:t,...s}))))}),Jr=j.forwardRef((e,t)=>$(e=>e.filtered.count===0)?j.createElement(z.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Yr=j.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return j.createElement(z.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ii(e,e=>j.createElement(`div`,{"aria-hidden":!0},e)))}),Xr=Object.assign(Vr,{List:Kr,Item:Hr,Input:Gr,Group:Ur,Separator:Wr,Dialog:qr,Empty:Jr,Loading:Yr});function Zr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Qr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $r(e){let t=j.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?j.useEffect:j.useLayoutEffect;function ei(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=zr(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function ti(e,t,n,r=[]){let i=j.useRef(),a=Lr();return Q(()=>{var o;let s=(()=>{var e;for(let t of n){if(typeof t==`string`)return t.trim();if(typeof t==`object`&&`current`in t)return t.current?(e=t.current.textContent)==null?void 0:e.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Pr,s),i.current=s}),i}var ni=()=>{let[e,t]=j.useState(),n=ei(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ri(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ii({asChild:e,children:t},n){return e&&j.isValidElement(t)?j.cloneElement(ri(t),{ref:t.ref},n(t.props.children)):n(t)}var ai={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function oi({className:e,...t}){return(0,y.jsx)(Xr,{"data-slot":`command`,className:r(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function si({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,y.jsxs)(g,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,y.jsx)(Xr.Input,{"data-slot":`command-input`,className:r(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,y.jsx)(c,{children:(0,y.jsx)(a,{className:`size-4 shrink-0 opacity-50`})})]})})}function ci({className:e,...t}){return(0,y.jsx)(Xr.List,{"data-slot":`command-list`,className:r(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function li({className:e,...t}){return(0,y.jsx)(Xr.Empty,{"data-slot":`command-empty`,className:r(`py-6 text-center text-sm`,e),...t})}function ui({className:e,...t}){return(0,y.jsx)(Xr.Group,{"data-slot":`command-group`,className:r(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-secondary-foreground`,e),...t})}function di({className:e,children:t,...n}){return(0,y.jsxs)(Xr.Item,{"data-slot":`command-item`,className:r(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-highlight data-[selected=true]:text-highlight-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:**:[svg]:text-highlight-foreground`,e),...n,children:[t,(0,y.jsx)(i,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var fi=`$.metadata.business_question`,pi=`title`;function mi(e){return e.source===`session-title`||e.fieldKey===pi}function hi(e){return e.filter(e=>!mi(e)&&e.fieldKey!==fi)}function gi(e){return hi(e).length+ +!!e.some(mi)}function _i(e){return e===`user-question`?`history.search.userQuestion`:e===`assistant-answer`?`history.search.assistantAnswer`:null}function vi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function yi({query:e,text:t}){let n=e.trim().split(/\s+/).filter(Boolean);if(n.length===0)return(0,y.jsx)(y.Fragment,{children:t});let r=RegExp(`(${n.map(vi).join(`|`)})`,`gi`);return t.split(r).map((e,t)=>n.some(t=>t.localeCompare(e,void 0,{sensitivity:`accent`})===0)?(0,y.jsx)(`mark`,{children:e},`${e}-${t}`):e)}function bi(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e:p(t,{dateStyle:`medium`,timeStyle:`short`}).format(n)}function xi({expanded:e,onSelect:t,onToggleExpanded:n,query:r,session:i}){let a=s(),o=_(),c=i.searchMatches??[],l=h(i.title,o),u=hi(c),d=e?u:u.slice(0,1),f=Math.max(u.length-d.length,0),p=gi(c);return(0,y.jsxs)(di,{className:`nexus-chat-history-search__item`,onSelect:t,value:i.id,children:[(0,y.jsxs)(`span`,{className:`nexus-chat-history-search__content`,children:[(0,y.jsxs)(`span`,{className:`nexus-chat-history-search__title-row`,children:[(0,y.jsx)(`strong`,{children:(0,y.jsx)(yi,{query:r,text:l})}),c.length>0?(0,y.jsx)(`small`,{className:`nexus-chat-history-search__count`,children:o(`history.search.resultCount`,{count:p})}):null]}),d.map((e,t)=>{let n=_i(e.source);return(0,y.jsxs)(`span`,{className:`nexus-chat-history-search__match`,children:[n?(0,y.jsx)(`small`,{className:`nexus-chat-history-search__match-source`,children:o(n)}):null,(0,y.jsx)(`span`,{className:`nexus-chat-history-search__match-snapshot`,children:(0,y.jsx)(yi,{query:r,text:e.snapshot.trim()||l})})]},`${e.taskId}-${e.source}-${e.fieldKey}-${t}`)}),f>0||e?(0,y.jsx)(`button`,{"aria-expanded":e,className:`nexus-chat-history-search__more`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},onPointerDown:e=>e.stopPropagation(),type:`button`,children:e?o(`common.showLess`):o(`history.search.moreResults`,{count:f})}):null]}),(0,y.jsx)(`span`,{className:`nexus-chat-history-search__time`,children:bi(i.updatedAt,a)})]})}function Si({count:e=3}){let t=_();return(0,y.jsx)(`div`,{"aria-label":t(`history.search.searching`),className:`nexus-chat-history-search__skeletons`,role:`status`,children:Array.from({length:e},(e,t)=>(0,y.jsxs)(`div`,{className:`nexus-chat-history-search__skeleton`,children:[(0,y.jsx)(d,{className:`nexus-chat-history-search__skeleton-title`}),(0,y.jsx)(d,{className:`nexus-chat-history-search__skeleton-line`}),(0,y.jsx)(d,{className:`nexus-chat-history-search__skeleton-line`})]},t))})}function Ci(e,t){let[n,r]=(0,j.useState)();return(0,j.useLayoutEffect)(()=>{var n;let i=t==null||(n=t.closest(`[data-nexus-chat-root]`))==null?void 0:n.querySelector(`.nexus-chat-workspace`);if(!e||!t||!i)return;let a=()=>{var e;let n=i.getBoundingClientRect(),a=((e=t.offsetParent)==null?void 0:e.getBoundingClientRect().left)??0;r(n.left+n.width/2-a)};a();let o=new ResizeObserver(a);return o.observe(i),()=>o.disconnect()},[e,t]),n}function wi({open:e,onOpenChange:t,searchQuery:n,onSearchQueryChange:r,status:i,error:a,sessions:s,expandedSessionIds:c,onToggleExpanded:d,onSelect:p,hasNextPage:h,loadingMore:g,listRef:ee,sentinelRef:b}){let x=_(),[S,C]=(0,j.useState)(null),w=Ci(e,S);return(0,y.jsxs)(l,{onOpenChange:t,open:e,children:[(0,y.jsxs)(u,{className:`sr-only`,children:[(0,y.jsx)(o,{children:x(`history.searchChats`)}),(0,y.jsx)(f,{children:x(`history.search.description`)})]}),(0,y.jsx)(m,{className:`nexus-chat-history-search`,ref:C,showCloseButton:!1,style:w===void 0?void 0:{left:w},children:(0,y.jsxs)(oi,{className:`nexus-chat-history-search__command`,shouldFilter:!1,children:[(0,y.jsx)(si,{"aria-label":x(`history.searchChats`),onValueChange:r,placeholder:x(`history.search.placeholder`),value:n}),(0,y.jsxs)(ci,{className:`nexus-chat-history-search__list`,ref:ee,children:[i===`loading`?(0,y.jsx)(Si,{}):null,i===`loading`?null:(0,y.jsxs)(y.Fragment,{children:[i===`error`?(0,y.jsx)(v,{className:`nexus-chat-history-search__error`,compact:!0,message:a??x(`history.search.failed`)}):(0,y.jsx)(li,{children:x(`history.search.empty`)}),(0,y.jsxs)(ui,{className:`nexus-chat-history-search__group`,heading:x(`history.search.conversations`),children:[s.map(e=>(0,y.jsx)(xi,{expanded:c.has(e.id),onSelect:()=>p(e),onToggleExpanded:()=>d(e.id),query:n,session:e},e.id)),h?(0,y.jsx)(`div`,{"aria-hidden":`true`,className:`nexus-chat-history-search__sentinel`,ref:b}):null,g?(0,y.jsx)(Si,{count:2}):null]})]})]})]})})]})}export{wi as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";var r=e(t(),1),i=new Set([`ar`,`fa`,`he`,`ur`]);function a(e){return i.has(e.split(/[-_]/)[0].toLowerCase())?`rtl`:`ltr`}function o(e){return{...e,direction:e.direction??a(e.locale)}}function s(e,t){var n,r,i,o;return e.theme===t.theme&&e.locale===t.locale&&e.direction===(t.direction??a(t.locale))&&e.tenantId===t.tenantId&&((n=e.user)==null?void 0:n.id)===((r=t.user)==null?void 0:r.id)&&((i=e.user)==null?void 0:i.name)===((o=t.user)==null?void 0:o.name)}function c(e){let t;return()=>{let n=e.get();return t&&s(t,n)||(t=o(n)),t}}var l=n(),u=(0,r.createContext)(null);function d({bridge:e,children:t,toasterId:n=`nexus-chat`}){let{environment:i}=e,[a,o]=(0,r.useMemo)(()=>[e=>i.subscribe(e),c(i)],[i]),s=(0,r.useSyncExternalStore)(a,o,o);return(0,l.jsx)(u.Provider,{value:{bridge:e,snapshot:s,toasterId:n},children:t})}function f(){let e=(0,r.useContext)(u);if(!e)throw Error(`useHostBridge must be used inside HostBridgeProvider.`);return e}function p(){return f().bridge}function m(){return f().snapshot}function h(){var e;return(e=(0,r.useContext)(u))==null?void 0:e.bridge.actions}function g(){var e;return(e=(0,r.useContext)(u))==null?void 0:e.snapshot.locale}function _(){return f().toasterId}export{m as a,g as i,h as n,_ as o,p as r,o as s,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{r}from"./I18nContext-BlQKoDmv.js";import{t as i}from"./PreviewState-VcIZyCXJ.js";import{t as a}from"./ErrorCard-Bu_0QAJ9.js";import{r as o}from"./errorReporter-hCgThzof.js";import{a as s}from"./HostBridgeProvider-BV-UGU3Q.js";var c=e(t(),1),l=[`allow-scripts`,`allow-downloads`,`allow-forms`,`allow-modals`,`allow-popups`,`allow-presentation`].join(` `),u=`data-nexus-chat-html-normalized`;function d(e){if(!e)return``;let t=e.publicId?` PUBLIC "${e.publicId}"`:``,n=e.systemId?`${e.publicId?``:` SYSTEM`} "${e.systemId}"`:``;return`<!DOCTYPE ${e.name}${t}${n}>`}function f(e,t=`light`){if(typeof DOMParser>`u`)return e;let n=new DOMParser().parseFromString(e,`text/html`);if(!n.documentElement)return e;if(!n.head.querySelector(`meta[${u}]`)){let e=n.createElement(`meta`);e.setAttribute(`charset`,`utf-8`),e.setAttribute(u,`true`),n.head.prepend(e)}if(!n.head.querySelector(`meta[name="color-scheme" i]`)){let e=n.createElement(`meta`);e.setAttribute(`name`,`color-scheme`),e.setAttribute(`content`,t===`dark`?`dark light`:`light dark`),n.head.prepend(e)}return n.querySelectorAll(`a[href^="#"]`).forEach(e=>{let t=e.getAttribute(`href`);t&&e.setAttribute(`href`,`about:srcdoc${t}`)}),n.querySelectorAll(`a[href]`).forEach(e=>{var t;(t=e.getAttribute(`href`))!=null&&t.startsWith(`about:srcdoc#`)||(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}),`${d(n.doctype)}${n.documentElement.outerHTML}`}var p=n();function m({content:e,sourceUrl:t,title:n}){let u=r(),{theme:d}=s(),m=(0,c.useRef)(null),h=(0,c.useRef)(null),g=(0,c.useRef)(null),_=o(),v=t??e,[y,b]=(0,c.useState)({documentKey:v,status:`loading`}),x=y.documentKey===v?y.status:`loading`,S=e.startsWith(`blob:`),C=(0,c.useMemo)(()=>t||S?void 0:f(e,d),[e,S,t,d]),w=(0,c.useCallback)(()=>{let e=h.current;if(!e)return;let t=e.style.width;e.style.width=`calc(100% - 1px)`,g.current!==null&&window.cancelAnimationFrame(g.current),g.current=window.requestAnimationFrame(()=>{e.style.width=t,g.current=null})},[]);return(0,c.useEffect)(()=>{let e=m.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(w);return t.observe(e),()=>t.disconnect()},[w]),(0,c.useEffect)(()=>()=>{g.current!==null&&window.cancelAnimationFrame(g.current)},[]),(0,p.jsxs)(`div`,{className:`nexus-chat-html-renderer`,ref:m,children:[x===`loading`?(0,p.jsx)(`div`,{"aria-label":u(`context.loadingSource`,{title:n}),className:`nexus-chat-html-renderer__loading`,children:(0,p.jsx)(i,{loading:!0})}):null,x===`error`?(0,p.jsx)(a,{compact:!0,message:u(`artifact.htmlDisplayFailed`)}):null,(0,p.jsx)(`iframe`,{className:`nexus-chat-html-renderer__frame`,"data-ready":x===`ready`?`true`:`false`,"data-testid":`html-artifact-frame`,loading:`eager`,onError:()=>{_(`html-artifact`,Error(`The HTML artifact "${n}" failed to load.`)),b({documentKey:v,status:`error`})},onLoad:()=>{b({documentKey:v,status:`ready`}),w()},ref:h,referrerPolicy:`no-referrer`,sandbox:l,src:t??(S?e:void 0),srcDoc:C,title:n})]})}export{m as HtmlArtifactRenderer};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./vite-preload-helper-B7qeedMF.js";import{n,t as r}from"./jsx-runtime-DE3RlOCf.js";var i=e(n(),1);function a(e,t){let n=t&&t.cache?t.cache:h,r=t&&t.serializer?t.serializer:p;return(t&&t.strategy?t.strategy:u)(e,{cache:n,serializer:r})}function o(e){return e==null||typeof e==`number`||typeof e==`boolean`}function s(e,t,n,r){let i=o(r)?r:n(r),a=t.get(i);return a===void 0&&(a=e.call(this,r),t.set(i,a)),a}function c(e,t,n){let r=Array.prototype.slice.call(arguments,3),i=n(r),a=t.get(i);return a===void 0&&(a=e.apply(this,r),t.set(i,a)),a}function l(e,t,n,r,i){return n.bind(t,e,r,i)}function u(e,t){let n=e.length===1?s:c;return l(e,this,n,t.cache.create(),t.serializer)}function d(e,t){return l(e,this,c,t.cache.create(),t.serializer)}function f(e,t){return l(e,this,s,t.cache.create(),t.serializer)}var p=function(){return JSON.stringify(arguments)},m=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}},h={create:function(){return new m}},g={variadic:d,monadic:f},ee=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function te(e){let t={};return e.replace(ee,e=>{let n=e.length;switch(e[0]){case`G`:t.era=n===4?`long`:n===5?`narrow`:`short`;break;case`y`:t.year=n===2?`2-digit`:`numeric`;break;case`Y`:case`u`:case`U`:case`r`:throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case`q`:case`Q`:throw RangeError("`q/Q` (quarter) patterns are not supported");case`M`:case`L`:t.month=[`numeric`,`2-digit`,`short`,`long`,`narrow`][n-1];break;case`w`:case`W`:throw RangeError("`w/W` (week) patterns are not supported");case`d`:t.day=[`numeric`,`2-digit`][n-1];break;case`D`:case`F`:case`g`:throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case`E`:t.weekday=n===4?`long`:n===5?`narrow`:`short`;break;case`e`:if(n<4)throw RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=[`short`,`long`,`narrow`,`short`][n-4];break;case`c`:if(n<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=[`short`,`long`,`narrow`,`short`][n-4];break;case`a`:t.hour12=!0;break;case`b`:case`B`:throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case`h`:t.hourCycle=`h12`,t.hour=[`numeric`,`2-digit`][n-1];break;case`H`:t.hourCycle=`h23`,t.hour=[`numeric`,`2-digit`][n-1];break;case`K`:t.hourCycle=`h11`,t.hour=[`numeric`,`2-digit`][n-1];break;case`k`:t.hourCycle=`h24`,t.hour=[`numeric`,`2-digit`][n-1];break;case`j`:case`J`:case`C`:throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case`m`:t.minute=[`numeric`,`2-digit`][n-1];break;case`s`:t.second=[`numeric`,`2-digit`][n-1];break;case`S`:case`A`:throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case`z`:t.timeZoneName=n<4?`short`:`long`;break;case`Z`:case`O`:case`v`:case`V`:case`X`:case`x`:throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return``}),t}var ne=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function re(e){if(e.length===0)throw Error(`Number skeleton cannot be empty`);let t=e.split(ne).filter(e=>e.length>0),n=[];for(let e of t){let t=e.split(`/`);if(t.length===0)throw Error(`Invalid number skeleton`);let[r,...i]=t;for(let e of i)if(e.length===0)throw Error(`Invalid number skeleton`);n.push({stem:r,options:i})}return n}function ie(e){return e.replace(/^(.*?)-/,``)}var _=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,v=/^(@+)?(\+|#+)?[rs]?$/g,ae=/(\*)(0+)|(#+)(0+)|(0+)/g,y=/^(0+)$/;function b(e){let t={};return e[e.length-1]===`r`?t.roundingPriority=`morePrecision`:e[e.length-1]===`s`&&(t.roundingPriority=`lessPrecision`),e.replace(v,function(e,n,r){return typeof r==`string`?r===`+`?t.minimumSignificantDigits=n.length:n[0]===`#`?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof r==`string`?r.length:0)):(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length),``}),t}function x(e){switch(e){case`sign-auto`:return{signDisplay:`auto`};case`sign-accounting`:case`()`:return{currencySign:`accounting`};case`sign-always`:case`+!`:return{signDisplay:`always`};case`sign-accounting-always`:case`()!`:return{signDisplay:`always`,currencySign:`accounting`};case`sign-except-zero`:case`+?`:return{signDisplay:`exceptZero`};case`sign-accounting-except-zero`:case`()?`:return{signDisplay:`exceptZero`,currencySign:`accounting`};case`sign-never`:case`+_`:return{signDisplay:`never`}}}function oe(e){let t;if(e[0]===`E`&&e[1]===`E`?(t={notation:`engineering`},e=e.slice(2)):e[0]===`E`&&(t={notation:`scientific`},e=e.slice(1)),t){let n=e.slice(0,2);if(n===`+!`?(t.signDisplay=`always`,e=e.slice(2)):n===`+?`&&(t.signDisplay=`exceptZero`,e=e.slice(2)),!y.test(e))throw Error(`Malformed concise eng/scientific notation`);t.minimumIntegerDigits=e.length}return t}function S(e){return x(e)||{}}function se(e){let t={};for(let n of e){switch(n.stem){case`percent`:case`%`:t.style=`percent`;continue;case`%x100`:t.style=`percent`,t.scale=100;continue;case`currency`:t.style=`currency`,t.currency=n.options[0];continue;case`group-off`:case`,_`:t.useGrouping=!1;continue;case`precision-integer`:case`.`:t.maximumFractionDigits=0;continue;case`measure-unit`:case`unit`:t.style=`unit`,t.unit=ie(n.options[0]);continue;case`compact-short`:case`K`:t.notation=`compact`,t.compactDisplay=`short`;continue;case`compact-long`:case`KK`:t.notation=`compact`,t.compactDisplay=`long`;continue;case`scientific`:t={...t,notation:`scientific`,...n.options.reduce((e,t)=>({...e,...S(t)}),{})};continue;case`engineering`:t={...t,notation:`engineering`,...n.options.reduce((e,t)=>({...e,...S(t)}),{})};continue;case`notation-simple`:t.notation=`standard`;continue;case`unit-width-narrow`:t.currencyDisplay=`narrowSymbol`,t.unitDisplay=`narrow`;continue;case`unit-width-short`:t.currencyDisplay=`code`,t.unitDisplay=`short`;continue;case`unit-width-full-name`:t.currencyDisplay=`name`,t.unitDisplay=`long`;continue;case`unit-width-iso-code`:t.currencyDisplay=`symbol`;continue;case`scale`:t.scale=parseFloat(n.options[0]);continue;case`rounding-mode-floor`:t.roundingMode=`floor`;continue;case`rounding-mode-ceiling`:t.roundingMode=`ceil`;continue;case`rounding-mode-down`:t.roundingMode=`trunc`;continue;case`rounding-mode-up`:t.roundingMode=`expand`;continue;case`rounding-mode-half-even`:t.roundingMode=`halfEven`;continue;case`rounding-mode-half-down`:t.roundingMode=`halfTrunc`;continue;case`rounding-mode-half-up`:t.roundingMode=`halfExpand`;continue;case`integer-width`:if(n.options.length>1)throw RangeError(`integer-width stems only accept a single optional option`);n.options[0].replace(ae,function(e,n,r,i,a,o){if(n)t.minimumIntegerDigits=r.length;else if(i&&a)throw Error(`We currently do not support maximum integer digits`);else if(o)throw Error(`We currently do not support exact integer digits`);return``});continue}if(y.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(_.test(n.stem)){if(n.options.length>1)throw RangeError(`Fraction-precision stems only accept a single optional option`);n.stem.replace(_,function(e,n,r,i,a,o){return r===`*`?t.minimumFractionDigits=n.length:i&&i[0]===`#`?t.maximumFractionDigits=i.length:a&&o?(t.minimumFractionDigits=a.length,t.maximumFractionDigits=a.length+o.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),``});let e=n.options[0];e===`w`?t={...t,trailingZeroDisplay:`stripIfInteger`}:e&&(t={...t,...b(e)});continue}if(v.test(n.stem)){t={...t,...b(n.stem)};continue}let e=x(n.stem);e&&(t={...t,...e});let r=oe(n.stem);r&&(t={...t,...r})}return t}var ce=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]=`EXPECT_ARGUMENT_CLOSING_BRACE`,e[e.EMPTY_ARGUMENT=2]=`EMPTY_ARGUMENT`,e[e.MALFORMED_ARGUMENT=3]=`MALFORMED_ARGUMENT`,e[e.EXPECT_ARGUMENT_TYPE=4]=`EXPECT_ARGUMENT_TYPE`,e[e.INVALID_ARGUMENT_TYPE=5]=`INVALID_ARGUMENT_TYPE`,e[e.EXPECT_ARGUMENT_STYLE=6]=`EXPECT_ARGUMENT_STYLE`,e[e.INVALID_NUMBER_SKELETON=7]=`INVALID_NUMBER_SKELETON`,e[e.INVALID_DATE_TIME_SKELETON=8]=`INVALID_DATE_TIME_SKELETON`,e[e.EXPECT_NUMBER_SKELETON=9]=`EXPECT_NUMBER_SKELETON`,e[e.EXPECT_DATE_TIME_SKELETON=10]=`EXPECT_DATE_TIME_SKELETON`,e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]=`UNCLOSED_QUOTE_IN_ARGUMENT_STYLE`,e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]=`EXPECT_SELECT_ARGUMENT_OPTIONS`,e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]=`EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE`,e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]=`INVALID_PLURAL_ARGUMENT_OFFSET_VALUE`,e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]=`EXPECT_SELECT_ARGUMENT_SELECTOR`,e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]=`EXPECT_PLURAL_ARGUMENT_SELECTOR`,e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]=`EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT`,e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]=`EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT`,e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]=`INVALID_PLURAL_ARGUMENT_SELECTOR`,e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]=`DUPLICATE_PLURAL_ARGUMENT_SELECTOR`,e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]=`DUPLICATE_SELECT_ARGUMENT_SELECTOR`,e[e.MISSING_OTHER_CLAUSE=22]=`MISSING_OTHER_CLAUSE`,e[e.INVALID_TAG=23]=`INVALID_TAG`,e[e.INVALID_TAG_NAME=25]=`INVALID_TAG_NAME`,e[e.UNMATCHED_CLOSING_TAG=26]=`UNMATCHED_CLOSING_TAG`,e[e.UNCLOSED_TAG=27]=`UNCLOSED_TAG`,e}({}),le=function(e){return e[e.literal=0]=`literal`,e[e.argument=1]=`argument`,e[e.number=2]=`number`,e[e.date=3]=`date`,e[e.time=4]=`time`,e[e.select=5]=`select`,e[e.plural=6]=`plural`,e[e.pound=7]=`pound`,e[e.tag=8]=`tag`,e}({});function ue(e){return e.type===0}function de(e){return e.type===1}function fe(e){return e.type===2}function pe(e){return e.type===3}function me(e){return e.type===4}function he(e){return e.type===5}function ge(e){return e.type===6}function _e(e){return e.type===7}function ve(e){return e.type===8}function ye(e){return!!(e&&typeof e==`object`&&e.type===0)}function C(e){return!!(e&&typeof e==`object`&&e.type===1)}var be=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,w={"001":[`H`,`h`],419:[`h`,`H`,`hB`,`hb`],AC:[`H`,`h`,`hb`,`hB`],AD:[`H`,`hB`],AE:[`h`,`hB`,`hb`,`H`],AF:[`H`,`hb`,`hB`,`h`],AG:[`h`,`hb`,`H`,`hB`],AI:[`H`,`h`,`hb`,`hB`],AL:[`h`,`H`,`hB`],AM:[`H`,`hB`],AO:[`H`,`hB`],AR:[`h`,`H`,`hB`,`hb`],AS:[`h`,`H`],AT:[`H`,`hB`],AU:[`h`,`hb`,`H`,`hB`],AW:[`H`,`hB`],AX:[`H`],AZ:[`H`,`hB`,`h`],BA:[`H`,`hB`,`h`],BB:[`h`,`hb`,`H`,`hB`],BD:[`h`,`hB`,`H`],BE:[`H`,`hB`],BF:[`H`,`hB`],BG:[`H`,`hB`,`h`],BH:[`h`,`hB`,`hb`,`H`],BI:[`H`,`h`],BJ:[`H`,`hB`],BL:[`H`,`hB`],BM:[`h`,`hb`,`H`,`hB`],BN:[`hb`,`hB`,`h`,`H`],BO:[`h`,`H`,`hB`,`hb`],BQ:[`H`],BR:[`H`,`hB`],BS:[`h`,`hb`,`H`,`hB`],BT:[`h`,`H`],BW:[`H`,`h`,`hb`,`hB`],BY:[`H`,`h`],BZ:[`H`,`h`,`hb`,`hB`],CA:[`h`,`hb`,`H`,`hB`],CC:[`H`,`h`,`hb`,`hB`],CD:[`hB`,`H`],CF:[`H`,`h`,`hB`],CG:[`H`,`hB`],CH:[`H`,`hB`,`h`],CI:[`H`,`hB`],CK:[`H`,`h`,`hb`,`hB`],CL:[`h`,`H`,`hB`,`hb`],CM:[`H`,`h`,`hB`],CN:[`H`,`hB`,`hb`,`h`],CO:[`h`,`H`,`hB`,`hb`],CP:[`H`],CR:[`h`,`H`,`hB`,`hb`],CU:[`h`,`H`,`hB`,`hb`],CV:[`H`,`hB`],CW:[`H`,`hB`],CX:[`H`,`h`,`hb`,`hB`],CY:[`h`,`H`,`hb`,`hB`],CZ:[`H`],DE:[`H`,`hB`],DG:[`H`,`h`,`hb`,`hB`],DJ:[`h`,`H`],DK:[`H`],DM:[`h`,`hb`,`H`,`hB`],DO:[`h`,`H`,`hB`,`hb`],DZ:[`h`,`hB`,`hb`,`H`],EA:[`H`,`h`,`hB`,`hb`],EC:[`h`,`H`,`hB`,`hb`],EE:[`H`,`hB`],EG:[`h`,`hB`,`hb`,`H`],EH:[`h`,`hB`,`hb`,`H`],ER:[`h`,`H`],ES:[`H`,`hB`,`h`,`hb`],ET:[`hB`,`hb`,`h`,`H`],FI:[`H`],FJ:[`h`,`hb`,`H`,`hB`],FK:[`H`,`h`,`hb`,`hB`],FM:[`h`,`hb`,`H`,`hB`],FO:[`H`,`h`],FR:[`H`,`hB`],GA:[`H`,`hB`],GB:[`H`,`h`,`hb`,`hB`],GD:[`h`,`hb`,`H`,`hB`],GE:[`H`,`hB`,`h`],GF:[`H`,`hB`],GG:[`H`,`h`,`hb`,`hB`],GH:[`h`,`H`],GI:[`H`,`h`,`hb`,`hB`],GL:[`H`,`h`],GM:[`h`,`hb`,`H`,`hB`],GN:[`H`,`hB`],GP:[`H`,`hB`],GQ:[`H`,`hB`,`h`,`hb`],GR:[`h`,`H`,`hb`,`hB`],GS:[`H`,`h`,`hb`,`hB`],GT:[`h`,`H`,`hB`,`hb`],GU:[`h`,`hb`,`H`,`hB`],GW:[`H`,`hB`],GY:[`h`,`hb`,`H`,`hB`],HK:[`h`,`hB`,`hb`,`H`],HN:[`h`,`H`,`hB`,`hb`],HR:[`H`,`hB`],HU:[`H`,`h`],IC:[`H`,`h`,`hB`,`hb`],ID:[`H`],IE:[`H`,`h`,`hb`,`hB`],IL:[`H`,`hB`],IM:[`H`,`h`,`hb`,`hB`],IN:[`h`,`H`],IO:[`H`,`h`,`hb`,`hB`],IQ:[`h`,`hB`,`hb`,`H`],IR:[`hB`,`H`],IS:[`H`],IT:[`H`,`hB`],JE:[`H`,`h`,`hb`,`hB`],JM:[`h`,`hb`,`H`,`hB`],JO:[`h`,`hB`,`hb`,`H`],JP:[`H`,`K`,`h`],KE:[`hB`,`hb`,`H`,`h`],KG:[`H`,`h`,`hB`,`hb`],KH:[`hB`,`h`,`H`,`hb`],KI:[`h`,`hb`,`H`,`hB`],KM:[`H`,`h`,`hB`,`hb`],KN:[`h`,`hb`,`H`,`hB`],KP:[`h`,`H`,`hB`,`hb`],KR:[`h`,`H`,`hB`,`hb`],KW:[`h`,`hB`,`hb`,`H`],KY:[`h`,`hb`,`H`,`hB`],KZ:[`H`,`hB`],LA:[`H`,`hb`,`hB`,`h`],LB:[`h`,`hB`,`hb`,`H`],LC:[`h`,`hb`,`H`,`hB`],LI:[`H`,`hB`,`h`],LK:[`H`,`h`,`hB`,`hb`],LR:[`h`,`hb`,`H`,`hB`],LS:[`h`,`H`],LT:[`H`,`h`,`hb`,`hB`],LU:[`H`,`h`,`hB`],LV:[`H`,`hB`,`hb`,`h`],LY:[`h`,`hB`,`hb`,`H`],MA:[`H`,`h`,`hB`,`hb`],MC:[`H`,`hB`],MD:[`H`,`hB`],ME:[`H`,`hB`,`h`],MF:[`H`,`hB`],MG:[`H`,`h`],MH:[`h`,`hb`,`H`,`hB`],MK:[`H`,`h`,`hb`,`hB`],ML:[`H`],MM:[`hB`,`hb`,`H`,`h`],MN:[`H`,`h`,`hb`,`hB`],MO:[`h`,`hB`,`hb`,`H`],MP:[`h`,`hb`,`H`,`hB`],MQ:[`H`,`hB`],MR:[`h`,`hB`,`hb`,`H`],MS:[`H`,`h`,`hb`,`hB`],MT:[`H`,`h`],MU:[`H`,`h`],MV:[`H`,`h`],MW:[`h`,`hb`,`H`,`hB`],MX:[`h`,`H`,`hB`,`hb`],MY:[`hb`,`hB`,`h`,`H`],MZ:[`H`,`hB`],NA:[`h`,`H`,`hB`,`hb`],NC:[`H`,`hB`],NE:[`H`],NF:[`H`,`h`,`hb`,`hB`],NG:[`H`,`h`,`hb`,`hB`],NI:[`h`,`H`,`hB`,`hb`],NL:[`H`,`hB`],NO:[`H`,`h`],NP:[`H`,`h`,`hB`],NR:[`H`,`h`,`hb`,`hB`],NU:[`H`,`h`,`hb`,`hB`],NZ:[`h`,`hb`,`H`,`hB`],OM:[`h`,`hB`,`hb`,`H`],PA:[`h`,`H`,`hB`,`hb`],PE:[`h`,`H`,`hB`,`hb`],PF:[`H`,`h`,`hB`],PG:[`h`,`H`],PH:[`h`,`hB`,`hb`,`H`],PK:[`h`,`hB`,`H`],PL:[`H`,`h`],PM:[`H`,`hB`],PN:[`H`,`h`,`hb`,`hB`],PR:[`h`,`H`,`hB`,`hb`],PS:[`h`,`hB`,`hb`,`H`],PT:[`H`,`hB`],PW:[`h`,`H`],PY:[`h`,`H`,`hB`,`hb`],QA:[`h`,`hB`,`hb`,`H`],RE:[`H`,`hB`],RO:[`H`,`hB`],RS:[`H`,`hB`,`h`],RU:[`H`],RW:[`H`,`h`],SA:[`h`,`hB`,`hb`,`H`],SB:[`h`,`hb`,`H`,`hB`],SC:[`H`,`h`,`hB`],SD:[`h`,`hB`,`hb`,`H`],SE:[`H`],SG:[`h`,`hb`,`H`,`hB`],SH:[`H`,`h`,`hb`,`hB`],SI:[`H`,`hB`],SJ:[`H`],SK:[`H`],SL:[`h`,`hb`,`H`,`hB`],SM:[`H`,`h`,`hB`],SN:[`H`,`h`,`hB`],SO:[`h`,`H`],SR:[`H`,`hB`],SS:[`h`,`hb`,`H`,`hB`],ST:[`H`,`hB`],SV:[`h`,`H`,`hB`,`hb`],SX:[`H`,`h`,`hb`,`hB`],SY:[`h`,`hB`,`hb`,`H`],SZ:[`h`,`hb`,`H`,`hB`],TA:[`H`,`h`,`hb`,`hB`],TC:[`h`,`hb`,`H`,`hB`],TD:[`h`,`H`,`hB`],TF:[`H`,`h`,`hB`],TG:[`H`,`hB`],TH:[`H`,`h`],TJ:[`H`,`h`],TL:[`H`,`hB`,`hb`,`h`],TM:[`H`,`h`],TN:[`h`,`hB`,`hb`,`H`],TO:[`h`,`H`],TR:[`H`,`hB`],TT:[`h`,`hb`,`H`,`hB`],TW:[`hB`,`hb`,`h`,`H`],TZ:[`hB`,`hb`,`H`,`h`],UA:[`H`,`hB`,`h`],UG:[`hB`,`hb`,`H`,`h`],UM:[`h`,`hb`,`H`,`hB`],US:[`h`,`hb`,`H`,`hB`],UY:[`h`,`H`,`hB`,`hb`],UZ:[`H`,`hB`,`h`],VA:[`H`,`h`,`hB`],VC:[`h`,`hb`,`H`,`hB`],VE:[`h`,`H`,`hB`,`hb`],VG:[`h`,`hb`,`H`,`hB`],VI:[`h`,`hb`,`H`,`hB`],VN:[`H`,`h`],VU:[`h`,`H`],WF:[`H`,`hB`],WS:[`h`,`H`],XK:[`H`,`hB`,`h`],YE:[`h`,`hB`,`hb`,`H`],YT:[`H`,`hB`],ZA:[`H`,`h`,`hb`,`hB`],ZM:[`h`,`hb`,`H`,`hB`],ZW:[`H`,`h`],"af-ZA":[`H`,`h`,`hB`,`hb`],"ar-001":[`h`,`hB`,`hb`,`H`],"ca-ES":[`H`,`h`,`hB`],"en-001":[`h`,`hb`,`H`,`hB`],"en-HK":[`h`,`hb`,`H`,`hB`],"en-IL":[`H`,`h`,`hb`,`hB`],"en-MY":[`h`,`hb`,`H`,`hB`],"es-BR":[`H`,`h`,`hB`,`hb`],"es-ES":[`H`,`h`,`hB`,`hb`],"es-GQ":[`H`,`h`,`hB`,`hb`],"fr-CA":[`H`,`h`,`hB`],"gl-ES":[`H`,`h`,`hB`],"gu-IN":[`hB`,`hb`,`h`,`H`],"hi-IN":[`hB`,`h`,`H`],"it-CH":[`H`,`h`,`hB`],"it-IT":[`H`,`h`,`hB`],"kn-IN":[`hB`,`h`,`H`],"ku-SY":[`H`,`hB`],"ml-IN":[`hB`,`h`,`H`],"mr-IN":[`hB`,`hb`,`h`,`H`],"pa-IN":[`hB`,`hb`,`h`,`H`],"ta-IN":[`hB`,`h`,`hb`,`H`],"te-IN":[`hB`,`h`,`H`],"zu-ZA":[`H`,`hB`,`hb`,`h`]};function xe(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(i===`j`){let a=0;for(;r+1<e.length&&e.charAt(r+1)===i;)a++,r++;let o=1+(a&1),s=a<2?1:3+(a>>1),c=Se(t);for((c==`H`||c==`k`)&&(s=0);s-->0;)n+=`a`;for(;o-->0;)n=c+n}else n+=i===`J`?`H`:i}return n}function Se(e){let t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case`h24`:return`k`;case`h23`:return`H`;case`h12`:return`h`;case`h11`:return`K`;default:throw Error(`Invalid hourCycle`)}let n=e.language,r;return n!==`root`&&(r=e.maximize().region),(w[r||``]||w[n||``]||w[`${n}-001`]||w[`001`])[0]}var Ce=RegExp(`^${be.source}*`),we=RegExp(`${be.source}*$`);function T(e,t){return{start:e,end:t}}var Te=!!Object.fromEntries,Ee=!!String.prototype.trimStart,De=!!String.prototype.trimEnd,E=Te?Object.fromEntries:function(e){let t={};for(let[n,r]of e)t[n]=r;return t},Oe=Ee?function(e){return e.trimStart()}:function(e){return e.replace(Ce,``)},ke=De?function(e){return e.trimEnd()}:function(e){return e.replace(we,``)},D=RegExp(`([^\\p{White_Space}\\p{Pattern_Syntax}]*)`,`yu`);function Ae(e,t){return D.lastIndex=t,D.exec(e)[1]??``}function je(e){if(e.length===0)return null;let t=1,n=1;for(let r=0;r<e.length;){let i=e.charCodeAt(r);switch(i){case 35:case 39:case 60:case 123:case 125:return null}if(i===10)t++,n=1,r++;else if(n++,i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);r+=t>=56320&&t<=57343?2:1}else r++}return{offset:e.length,line:t,column:n}}var Me=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(this.offset()!==0)throw Error(`parser can only be used once`);if(this.message.length>0){let e=this.message.charCodeAt(0);if(e!==35&&e!==39&&e!==60&&e!==123&&e!==125){let e=je(this.message);if(e){let t=this.clonePosition();return this.position=e,{val:[{type:0,value:this.message,location:T(t,this.clonePosition())}],err:null}}}}return this.parseMessage(0,``,!1)}parseMessage(e,t,n){let r=[];for(;!this.isEOF();){let i=this.char();if(i===123){let t=this.parseArgument(e,n);if(t.err)return t;r.push(t.val)}else if(i===125&&e>0)break;else if(i===35&&(t===`plural`||t===`selectordinal`)){let e=this.clonePosition();this.bump(),r.push({type:7,location:T(e,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(26,T(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&O(this.peek()||0)){let n=this.parseTag(e,t);if(n.err)return n;r.push(n.val)}else{let n=this.parseLiteral(e,t);if(n.err)return n;r.push(n.val)}}return{val:r,err:null}}parseTag(e,t){let n=this.clonePosition();this.bump();let r=this.parseTagName();if(this.bumpSpace(),this.bumpIf(`/>`))return{val:{type:0,value:`<${r}/>`,location:T(n,this.clonePosition())},err:null};if(this.bumpIf(`>`)){let i=this.parseMessage(e+1,t,!0);if(i.err)return i;let a=i.val,o=this.clonePosition();if(this.bumpIf(`</`)){if(this.isEOF()||!O(this.char()))return this.error(23,T(o,this.clonePosition()));let e=this.clonePosition();return r===this.parseTagName()?(this.bumpSpace(),this.bumpIf(`>`)?{val:{type:8,value:r,children:a,location:T(n,this.clonePosition())},err:null}:this.error(23,T(o,this.clonePosition()))):this.error(26,T(e,this.clonePosition()))}return this.error(27,T(n,this.clonePosition()))}return this.error(23,T(n,this.clonePosition()))}parseTagName(){let e=this.offset();for(this.bump();!this.isEOF()&&Pe(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){let n=this.clonePosition(),r=``;for(;;){let n=this.tryParseQuote(t);if(n){r+=n;continue}let i=this.tryParseUnquoted(e,t);if(i){r+=i;continue}let a=this.tryParseLeftAngleBracket();if(a){r+=a;continue}break}let i=T(n,this.clonePosition());return{val:{type:0,value:r,location:i},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Ne(this.peek()||0))?(this.bump(),`<`):null}tryParseQuote(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),`'`;case 123:case 60:case 62:case 125:break;case 35:if(e===`plural`||e===`selectordinal`)break;return null;default:return null}this.bump();let t=[this.char()];for(this.bump();!this.isEOF();){let e=this.char();if(e===39)if(this.peek()===39)t.push(39),this.bump();else{this.bump();break}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;let n=this.char();return n===60||n===123||n===35&&(t===`plural`||t===`selectordinal`)||n===125&&e>0?null:(this.bump(),String.fromCodePoint(n))}parseArgument(e,t){let n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(1,T(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(2,T(n,this.clonePosition()));let r=this.parseIdentifierIfPossible().value;if(!r)return this.error(3,T(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(1,T(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:1,value:r,location:T(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(1,T(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(3,T(n,this.clonePosition()))}}parseIdentifierIfPossible(){let e=this.clonePosition(),t=this.offset(),n=Ae(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:T(e,this.clonePosition())}}parseArgumentOptions(e,t,n,r){let i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(a){case``:return this.error(4,T(i,o));case`number`:case`date`:case`time`:{this.bumpSpace();let e=null;if(this.bumpIf(`,`)){this.bumpSpace();let t=this.clonePosition(),n=this.parseSimpleArgStyleIfPossible();if(n.err)return n;let r=ke(n.val);if(r.length===0)return this.error(6,T(this.clonePosition(),this.clonePosition()));e={style:r,styleLocation:T(t,this.clonePosition())}}let t=this.tryParseArgumentClose(r);if(t.err)return t;let i=T(r,this.clonePosition());if(e&&e.style.startsWith(`::`)){let t=Oe(e.style.slice(2));if(a===`number`){let r=this.parseNumberSkeletonFromString(t,e.styleLocation);return r.err?r:{val:{type:2,value:n,location:i,style:r.val},err:null}}{if(t.length===0)return this.error(10,i);let r=t;this.locale&&(r=xe(t,this.locale));let o={type:1,pattern:r,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?te(r):{}};return{val:{type:a===`date`?3:4,value:n,location:i,style:o},err:null}}}return{val:{type:a===`number`?2:a===`date`?3:4,value:n,location:i,style:(e==null?void 0:e.style)??null},err:null}}case`plural`:case`selectordinal`:case`select`:{let i=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(`,`))return this.error(12,T(i,{...i}));this.bumpSpace();let o=this.parseIdentifierIfPossible(),s=0;if(a!==`select`&&o.value===`offset`){if(!this.bumpIf(`:`))return this.error(13,T(this.clonePosition(),this.clonePosition()));this.bumpSpace();let e=this.tryParseDecimalInteger(13,14);if(e.err)return e;this.bumpSpace(),o=this.parseIdentifierIfPossible(),s=e.val}let c=this.tryParsePluralOrSelectOptions(e,a,t,o);if(c.err)return c;let l=this.tryParseArgumentClose(r);if(l.err)return l;let u=T(r,this.clonePosition());return a===`select`?{val:{type:5,value:n,options:E(c.val),location:u},err:null}:{val:{type:6,value:n,options:E(c.val),offset:s,pluralType:a===`plural`?`cardinal`:`ordinal`,location:u},err:null}}default:return this.error(5,T(i,o))}}tryParseArgumentClose(e){return this.isEOF()||this.char()!==125?this.error(1,T(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0,t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil(`'`))return this.error(11,T(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(e>0)--e;else return{val:this.message.slice(t.offset,this.offset()),err:null};break;default:this.bump();break}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let n=[];try{n=re(e)}catch{return this.error(7,t)}return{val:{type:0,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?se(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,r){let i=!1,a=[],o=new Set,{value:s,location:c}=r;for(;;){if(s.length===0){let e=this.clonePosition();if(t!==`select`&&this.bumpIf(`=`)){let t=this.tryParseDecimalInteger(16,19);if(t.err)return t;c=T(e,this.clonePosition()),s=this.message.slice(e.offset,this.offset())}else break}if(o.has(s))return this.error(t===`select`?21:20,c);s===`other`&&(i=!0),this.bumpSpace();let r=this.clonePosition();if(!this.bumpIf(`{`))return this.error(t===`select`?17:18,T(this.clonePosition(),this.clonePosition()));let l=this.parseMessage(e+1,t,n);if(l.err)return l;let u=this.tryParseArgumentClose(r);if(u.err)return u;a.push([s,{value:l.val,location:T(r,this.clonePosition())}]),o.add(s),this.bumpSpace(),{value:s,location:c}=this.parseIdentifierIfPossible()}return a.length===0?this.error(t===`select`?15:16,T(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(22,T(this.clonePosition(),this.clonePosition())):{val:a,err:null}}tryParseDecimalInteger(e,t){let n=1,r=this.clonePosition();this.bumpIf(`+`)||this.bumpIf(`-`)&&(n=-1);let i=!1,a=0;for(;!this.isEOF();){let e=this.char();if(e>=48&&e<=57)i=!0,a=a*10+(e-48),this.bump();else break}let o=T(r,this.clonePosition());return i?(a*=n,Number.isSafeInteger(a)?{val:a,err:null}:this.error(t,o)):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let e=this.position.offset;if(e>=this.message.length)throw Error(`out of bound`);let t=this.message.codePointAt(e);if(t===void 0)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;let e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){let t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){let t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Fe(this.char());)this.bump()}peek(){if(this.isEOF())return null;let e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function O(e){return e>=97&&e<=122||e>=65&&e<=90}function Ne(e){return O(e)||e===47}function Pe(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Fe(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function k(e){e.forEach(e=>{if(delete e.location,he(e)||ge(e))for(let t in e.options)delete e.options[t].location,k(e.options[t].value);else fe(e)&&ye(e.style)||(pe(e)||me(e))&&C(e.style)?delete e.style.location:ve(e)&&k(e.children)})}function Ie(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};let n=new Me(e,t).parse();if(n.err){let e=SyntaxError(ce[n.err.kind]);throw e.location=n.err.location,e.originalMessage=n.err.message,e}return t!=null&&t.captureLocation||k(n.val),n.val}var A,j=function(e){return e.MISSING_VALUE=`MISSING_VALUE`,e.INVALID_VALUE=`INVALID_VALUE`,e.MISSING_INTL_API=`MISSING_INTL_API`,e}({}),M=class extends Error{constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},N=class extends M{constructor(e,t,n,r){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join(`", "`)}"`,`INVALID_VALUE`,r)}},Le=class extends M{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,`INVALID_VALUE`,n)}},Re=class extends M{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,`MISSING_VALUE`,t)}};function ze(e){return e.length<2?e:e.reduce((e,t)=>{let n=e[e.length-1];return!n||n.type!==0||t.type!==0?e.push(t):n.value+=t.value,e},[])}function P(e){return typeof e==`function`}function F(e,t,n,r,i,a,o){if(e.length===1&&ue(e[0]))return[{type:0,value:e[0].value}];let s=[];for(let c of e){if(ue(c)){s.push({type:0,value:c.value});continue}if(_e(c)){typeof a==`number`&&s.push({type:0,value:n.getNumberFormat(t).format(a)});continue}let{value:e}=c;if(!(i&&e in i))throw new Re(e,o);let l=i[e];if(de(c)){(!l||typeof l==`string`||typeof l==`number`||typeof l==`bigint`)&&(l=typeof l==`string`||typeof l==`number`||typeof l==`bigint`?String(l):``),s.push({type:typeof l==`string`?0:1,value:l});continue}if(pe(c)){let e=typeof c.style==`string`?r.date[c.style]:C(c.style)?c.style.parsedOptions:void 0;s.push({type:0,value:n.getDateTimeFormat(t,e).format(l)});continue}if(me(c)){let e=typeof c.style==`string`?r.time[c.style]:C(c.style)?c.style.parsedOptions:r.time.medium;s.push({type:0,value:n.getDateTimeFormat(t,e).format(l)});continue}if(fe(c)){let e=typeof c.style==`string`?r.number[c.style]:ye(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){let t=e.scale||1;if(typeof l==`bigint`){if(!Number.isInteger(t))throw TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}s.push({type:0,value:n.getNumberFormat(t,e).format(l)});continue}if(ve(c)){let{children:e,value:l}=c,u=i[l];if(!P(u))throw new Le(l,`function`,o);let d=u(F(e,t,n,r,i,a).map(e=>e.value));Array.isArray(d)||(d=[d]),s.push(...d.map(e=>({type:typeof e==`string`?0:1,value:e})))}if(he(c)){let e=l,a=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!a)throw new N(c.value,l,Object.keys(c.options),o);s.push(...F(a.value,t,n,r,i));continue}if(ge(c)){let e=`=${l}`,a=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!a){if(!Intl.PluralRules)throw new M(`Intl.PluralRules is not available in this environment.
|
|
2
|
-
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3
|
-
`,`MISSING_INTL_API`,o);let e=typeof l==`bigint`?Number(l):l,r=n.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));a=(Object.prototype.hasOwnProperty.call(c.options,r)?c.options[r]:void 0)||c.options.other}if(!a)throw new N(c.value,l,Object.keys(c.options),o);let u=typeof l==`bigint`?Number(l):l;s.push(...F(a.value,t,n,r,i,u-(c.offset||0)));continue}}return ze(s)}function Be(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,r)=>(n[r]={...e[r],...t[r]},n),{})}:e}function Ve(e,t){return t?Object.keys(e).reduce((n,r)=>(n[r]=Be(e[r],t[r]),n),{...e}):e}function I(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function He(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:a((...e)=>new Intl.NumberFormat(...e),{cache:I(e.number),strategy:g.variadic}),getDateTimeFormat:a((...e)=>new Intl.DateTimeFormat(...e),{cache:I(e.dateTime),strategy:g.variadic}),getPluralRules:a((...e)=>new Intl.PluralRules(...e),{cache:I(e.pluralRules),strategy:g.variadic})}}var L=(A=class e{constructor(t,n=e.defaultLocale,r,i){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=e=>{let t=this.formatToParts(e);if(t.length===1)return t[0].value;let n=t.reduce((e,t)=>(!e.length||t.type!==0||typeof e[e.length-1]!=`string`?e.push(t.value):e[e.length-1]+=t.value,e),[]);return n.length<=1?n[0]||``:n},this.formatToParts=e=>F(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message),this.resolvedOptions=()=>{var e;return{locale:((e=this.resolvedLocale)==null?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}},this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t==`string`){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");let{...n}=i||{};this.ast=e.__parse(t,{...n,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError(`A message must be provided as a String or AST.`);this.formats=Ve(e.formats,r),this.formatters=i&&i.formatters||He(this.formatterCache)}static get defaultLocale(){return e.memoizedDefaultLocale||=new Intl.NumberFormat().resolvedOptions().locale,e.memoizedDefaultLocale}},A.memoizedDefaultLocale=null,A.resolveLocale=e=>{if(Intl.Locale===void 0)return;let t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e==`string`?e:e[0])},A.__parse=Ie,A.formats={number:{integer:{maximumFractionDigits:0},currency:{style:`currency`},percent:{style:`percent`}},date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}}},A),R=class e extends Error{constructor(t,n,r){let i=r?r instanceof Error?r:Error(String(r)):void 0;super(`[@formatjs/intl Error ${t}] ${n}
|
|
4
|
-
${i?`\n${i.message}\n${i.stack}`:``}`),this.code=t,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e)}},Ue=class extends R{constructor(e,t){super(`UNSUPPORTED_FORMATTER`,e,t)}},We=class extends R{constructor(e,t){super(`INVALID_CONFIG`,e,t)}},z=class extends R{constructor(e,t){super(`MISSING_DATA`,e,t)}},B=class extends R{constructor(e,t,n){super(`FORMAT_ERROR`,`${e}
|
|
5
|
-
Locale: ${t}
|
|
6
|
-
`,n),this.locale=t}},V=class extends B{constructor(e,t,n,r){super(`${e}
|
|
7
|
-
MessageID: ${n==null?void 0:n.id}
|
|
8
|
-
Default Message: ${n==null?void 0:n.defaultMessage}
|
|
9
|
-
Description: ${n==null?void 0:n.description}
|
|
10
|
-
`,t,r),this.descriptor=n,this.locale=t}},Ge=class extends R{constructor(e,t){super(`MISSING_TRANSLATION`,`Missing message: "${e.id}" for locale "${t}", using ${e.defaultMessage?`default message (${typeof e.defaultMessage==`string`?e.defaultMessage:e.defaultMessage.map(e=>e.value??JSON.stringify(e)).join()})`:`id`} as fallback.`),this.descriptor=e}};function Ke(e,t,n=Error){if(!e)throw new n(t)}function H(e,t,n={}){return t.reduce((t,r)=>(r in e?t[r]=e[r]:r in n&&(t[r]=n[r]),t),{})}var qe={formats:{},messages:{},timeZone:void 0,defaultLocale:`en`,defaultFormats:{},fallbackOnEmptyString:!0,onError:e=>{},onWarn:e=>{}};function Je(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function U(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function Ye(e=Je()){let t=Intl.RelativeTimeFormat,n=Intl.ListFormat,r=Intl.DisplayNames,i=a((...e)=>new Intl.DateTimeFormat(...e),{cache:U(e.dateTime),strategy:g.variadic}),o=a((...e)=>new Intl.NumberFormat(...e),{cache:U(e.number),strategy:g.variadic}),s=a((...e)=>new Intl.PluralRules(...e),{cache:U(e.pluralRules),strategy:g.variadic});return{getDateTimeFormat:i,getNumberFormat:o,getMessageFormat:a((e,t,n,r)=>new L(e,t,n,{formatters:{getNumberFormat:o,getDateTimeFormat:i,getPluralRules:s},...r}),{cache:U(e.message),strategy:g.variadic}),getRelativeTimeFormat:a((...e)=>new t(...e),{cache:U(e.relativeTime),strategy:g.variadic}),getPluralRules:s,getListFormat:a((...e)=>new n(...e),{cache:U(e.list),strategy:g.variadic}),getDisplayNames:a((...e)=>new r(...e),{cache:U(e.displayNames),strategy:g.variadic})}}function W(e,t,n,r){let i=e&&e[t],a;if(i&&(a=i[n]),a)return a;r(new Ue(`No ${t} format named: ${n}`))}function G(e,t){return Object.keys(e).reduce((n,r)=>(n[r]={timeZone:t,...e[r]},n),{})}function Xe(e,t){return Object.keys({...e,...t}).reduce((n,r)=>(n[r]={...e[r],...t[r]},n),{})}function Ze(e,t){if(!t)return e;let n=L.formats;return{...n,...e,date:Xe(G(n.date,t),G(e.date||{},t)),time:Xe(G(n.time,t),G(e.time||{},t))}}var K=({locale:e,formats:t,messages:n,defaultLocale:r,defaultFormats:i,fallbackOnEmptyString:a,onError:o,timeZone:s,defaultRichTextElements:c},l,u={id:``},d,f)=>{let{id:p,defaultMessage:m}=u;Ke(!!p,`[@formatjs/intl] An \`id\` must be provided to format a message. You can either:
|
|
11
|
-
1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.github.io/docs/tooling/babel-plugin)
|
|
12
|
-
or [@formatjs/ts-transformer](https://formatjs.github.io/docs/tooling/ts-transformer) OR
|
|
13
|
-
2. Configure your \`eslint\` config to include [eslint-plugin-formatjs](https://formatjs.github.io/docs/tooling/linter#enforce-id)
|
|
14
|
-
to autofix this issue`);let h=String(p),g=n&&Object.prototype.hasOwnProperty.call(n,h)&&n[h];if(Array.isArray(g)&&g.length===1&&g[0].type===le.literal)return g[0].value;if(d={...c,...d},t=Ze(t,s),i=Ze(i,s),!g){if(a===!1&&g===``)return g;if((!m||e&&e.toLowerCase()!==r.toLowerCase())&&o(new Ge(u,e)),m)try{return l.getMessageFormat(m,r,i,f).format(d)}catch(t){return o(new V(`Error formatting default message for: "${h}", rendering default message verbatim`,e,u,t)),typeof m==`string`?m:h}return h}try{return l.getMessageFormat(g,e,t,{formatters:l,...f}).format(d)}catch(t){o(new V(`Error formatting message: "${h}", using ${m?`default message`:`id`} as fallback.`,e,u,t))}if(m)try{return l.getMessageFormat(m,r,i,f).format(d)}catch(t){o(new V(`Error formatting the default message for: "${h}", rendering message verbatim`,e,u,t))}return typeof g==`string`?g:typeof m==`string`?m:h},Qe=[`formatMatcher`,`timeZone`,`hour12`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`,`hourCycle`,`dateStyle`,`timeStyle`,`calendar`,`numberingSystem`,`fractionalSecondDigits`];function q({locale:e,formats:t,onError:n,timeZone:r},i,a,o={}){let{format:s}=o,c=H(o,Qe,{...r&&{timeZone:r},...s&&W(t,i,s,n)});return i===`time`&&!c.hour&&!c.minute&&!c.second&&!c.timeStyle&&!c.dateStyle&&(c={...c,hour:`numeric`,minute:`numeric`}),a(e,c)}function $e(e,t,n,r={}){let i=typeof n==`string`?new Date(n||0):n;try{return q(e,`date`,t,r).format(i)}catch(t){e.onError(new B(`Error formatting date.`,e.locale,t))}return String(i)}function et(e,t,n,r={}){let i=typeof n==`string`?new Date(n||0):n;try{return q(e,`time`,t,r).format(i)}catch(t){e.onError(new B(`Error formatting time.`,e.locale,t))}return String(i)}function tt(e,t,n,r,i={}){let a=typeof n==`string`?new Date(n||0):n,o=typeof r==`string`?new Date(r||0):r;try{return q(e,`dateTimeRange`,t,i).formatRange(a,o)}catch(t){e.onError(new B(`Error formatting date time range.`,e.locale,t))}return String(a)}function nt(e,t,n,r={}){let i=typeof n==`string`?new Date(n||0):n;try{return q(e,`date`,t,r).formatToParts(i)}catch(t){e.onError(new B(`Error formatting date.`,e.locale,t))}return[]}function rt(e,t,n,r={}){let i=typeof n==`string`?new Date(n||0):n;try{return q(e,`time`,t,r).formatToParts(i)}catch(t){e.onError(new B(`Error formatting time.`,e.locale,t))}return[]}var it=[`style`,`type`,`fallback`,`languageDisplay`];function at({locale:e,onError:t},n,r,i){Intl.DisplayNames||t(new M(`Intl.DisplayNames is not available in this environment.
|
|
15
|
-
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
16
|
-
`,j.MISSING_INTL_API));let a=H(i,it);try{return n(e,a).of(r)}catch(n){t(new B(`Error formatting display name.`,e,n))}}var ot=[`type`,`style`],st=Date.now();function ct(e){return`${st}_${e}_${st}`}function lt(e,t,n,r={}){let i=ut(e,t,n,r).reduce((e,t)=>{let n=t.value;return typeof n==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=n:e.push(n),e},[]);return i.length===1?i[0]:i.length===0?``:i}function ut({locale:e,onError:t},n,r,i={}){Intl.ListFormat||t(new M(`Intl.ListFormat is not available in this environment.
|
|
17
|
-
Try polyfilling it using "@formatjs/intl-listformat"
|
|
18
|
-
`,j.MISSING_INTL_API));let a=H(i,ot);try{let t={},i=Array.from(r).map((e,n)=>{if(typeof e==`object`&&e){let r=ct(n);return t[r]=e,r}return String(e)});return n(e,a).formatToParts(i).map(e=>e.type===`literal`?e:{...e,value:t[e.value]||e.value})}catch(n){t(new B(`Error formatting list.`,e,n))}return r}var dt=[`type`];function ft({locale:e,onError:t},n,r,i={}){Intl.PluralRules||t(new M(`Intl.PluralRules is not available in this environment.
|
|
19
|
-
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
20
|
-
`,j.MISSING_INTL_API));let a=H(i,dt);try{return n(e,a).select(r)}catch(n){t(new B(`Error formatting plural.`,e,n))}return`other`}var pt=[`numeric`,`style`];function mt({locale:e,formats:t,onError:n},r,i={}){let{format:a}=i;return r(e,H(i,pt,!!a&&W(t,`relative`,a,n)||{}))}function ht(e,t,n,r,i={}){r||=`second`,Intl.RelativeTimeFormat||e.onError(new M(`Intl.RelativeTimeFormat is not available in this environment.
|
|
21
|
-
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
22
|
-
`,j.MISSING_INTL_API));try{return mt(e,t,i).format(n,r)}catch(t){e.onError(new B(`Error formatting relative time.`,e.locale,t))}return String(n)}var gt=[`style`,`currency`,`unit`,`unitDisplay`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`,`compactDisplay`,`currencyDisplay`,`currencySign`,`notation`,`signDisplay`,`unit`,`unitDisplay`,`numberingSystem`,`trailingZeroDisplay`,`roundingPriority`,`roundingIncrement`,`roundingMode`];function _t({locale:e,formats:t,onError:n},r,i={}){let{format:a}=i;return r(e,H(i,gt,a&&W(t,`number`,a,n)||{}))}function vt(e,t,n,r={}){try{return _t(e,t,r).format(n)}catch(t){e.onError(new B(`Error formatting number.`,e.locale,t))}return String(n)}function yt(e,t,n,r={}){try{return _t(e,t,r).formatToParts(n)}catch(t){e.onError(new B(`Error formatting number.`,e.locale,t))}return[]}function bt(e){return typeof(e?e[Object.keys(e)[0]]:void 0)==`string`}function xt(e){e.onWarn&&e.defaultRichTextElements&&bt(e.messages||{})&&e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
23
|
-
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
24
|
-
For more details see https://formatjs.github.io/docs/getting-started/message-distribution`)}function St(e,t){let n=Ye(t),r={...qe,...e},{locale:i,defaultLocale:a,onError:o}=r;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&o?o(new z(`Missing locale data for locale: "${i}" in Intl.NumberFormat. Using default locale: "${a}" as fallback. See https://formatjs.github.io/docs/react-intl#runtime-requirements for more details`)):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&o&&o(new z(`Missing locale data for locale: "${i}" in Intl.DateTimeFormat. Using default locale: "${a}" as fallback. See https://formatjs.github.io/docs/react-intl#runtime-requirements for more details`)):(o&&o(new We(`"locale" was not configured, using "${a}" as fallback. See https://formatjs.github.io/docs/react-intl/api#intlshape for more details`)),r.locale=r.defaultLocale||`en`),xt(r),{...r,formatters:n,formatNumber:vt.bind(null,r,n.getNumberFormat),formatNumberToParts:yt.bind(null,r,n.getNumberFormat),formatRelativeTime:ht.bind(null,r,n.getRelativeTimeFormat),formatDate:$e.bind(null,r,n.getDateTimeFormat),formatDateToParts:nt.bind(null,r,n.getDateTimeFormat),formatTime:et.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:tt.bind(null,r,n.getDateTimeFormat),formatTimeToParts:rt.bind(null,r,n.getDateTimeFormat),formatPlural:ft.bind(null,r,n.getPluralRules),formatMessage:K.bind(null,r,n),$t:K.bind(null,r,n),formatList:lt.bind(null,r,n.getListFormat),formatListToParts:ut.bind(null,r,n.getListFormat),formatDisplayName:at.bind(null,r,n.getDisplayNames)}}var J=r();function Ct(e,t,n=Error){if(!e)throw new n(t)}function wt(e){Ct(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var Tt={...qe,textComponent:i.Fragment},Et=e=>i.Children.toArray(e).map((e,t)=>i.isValidElement(e)?(0,J.jsx)(i.Fragment,{children:e},t):e);function Dt(e){return function(t){return e(Et(t))}}function Ot(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var o=n[a];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0}var kt=i.createContext(null);kt.Provider;function Y(){let e=i.useContext(kt);return wt(e),e}var At=function(e){return e.formatDate=`FormattedDate`,e.formatTime=`FormattedTime`,e.formatNumber=`FormattedNumber`,e.formatList=`FormattedList`,e.formatDisplayName=`FormattedDisplayName`,e}(At||{}),jt=function(e){return e.formatDate=`FormattedDateParts`,e.formatTime=`FormattedTimeParts`,e.formatNumber=`FormattedNumberParts`,e.formatList=`FormattedListParts`,e}(jt||{});function Mt(e){let t=t=>{let n=Y(),{value:r,children:i,...a}=t,o=typeof r==`string`?new Date(r||0):r;return i(e===`formatDate`?n.formatDateToParts(o,a):n.formatTimeToParts(o,a))};return t.displayName=jt[e],t}function X(e){let t=t=>{let n=Y(),{value:r,children:a,...o}=t,s=n[e](r,o);return typeof a==`function`?a(s):(0,J.jsx)(n.textComponent||i.Fragment,{children:s})};return t.displayName=At[e],t}function Nt(e){return e&&Object.keys(e).reduce((t,n)=>{let r=e[n];return t[n]=P(r)?Dt(r):r,t},{})}var Pt=(e,t,n,r,...i)=>{let a=K(e,t,n,Nt(r),...i);return Array.isArray(a)?Et(a):a},Ft=({defaultRichTextElements:e,...t},n)=>{let r=Nt(e),i=St({...Tt,...t,defaultRichTextElements:r},n),a={locale:i.locale,timeZone:i.timeZone,fallbackOnEmptyString:i.fallbackOnEmptyString,formats:i.formats,defaultLocale:i.defaultLocale,defaultFormats:i.defaultFormats,messages:i.messages,onError:i.onError,defaultRichTextElements:r};return{...i,formatMessage:Pt.bind(null,a,i.formatters),$t:Pt.bind(null,a,i.formatters)}};function It(e,t){let{values:n,...r}=e,{values:i,...a}=t;return Ot(i,n)&&Ot(r,a)}function Lt(e){let{formatMessage:t,textComponent:n=i.Fragment}=Y(),{id:r,description:a,defaultMessage:o,values:s,children:c,tagName:l=n,ignoreTag:u}=e,d=t({id:r,description:a,defaultMessage:o},s,{ignoreTag:u});return typeof c==`function`?c(Array.isArray(d)?d:[d]):l?(0,J.jsx)(l,{children:d}):(0,J.jsx)(J.Fragment,{children:d})}Lt.displayName=`FormattedMessage`;var Rt=i.memo(Lt,It);Rt.displayName=`MemoizedFormattedMessage`,X(`formatDate`),X(`formatTime`),X(`formatNumber`),X(`formatList`),X(`formatDisplayName`),Mt(`formatDate`),Mt(`formatTime`);var Z={"action.groupLabel":`Suggested actions`,"action.submitting":`This action is being submitted.`,"action.suggested":`Suggested action`,"action.unavailable":`This action is unavailable.`,"artifact.action.download":`download`,"artifact.action.open":`open`,"artifact.action.save":`save`,"artifact.action.share":`share`,"artifact.actionComplete":`{action} complete`,"artifact.actionFailed":`The artifact {action} action failed.`,"artifact.actionInProgress":`{action} in progress`,"artifact.cannotOpenHere":`This artifact cannot be opened here.`,"artifact.cannotSaveHere":`This artifact cannot be saved from here.`,"artifact.canvas":`Artifact canvas`,"artifact.canvasActions":`Canvas actions`,"artifact.closeCanvas":`Close canvas`,"artifact.contentLoadFailed":`The artifact content could not be loaded.`,"artifact.contentReadFailed":`The artifact content could not be read.`,"artifact.displayFailed":`This {noun} could not be displayed.`,"artifact.download":`Download artifact`,"artifact.exitFullscreen":`Exit fullscreen`,"artifact.generated":`Generated artifacts`,"artifact.hostRendererMountFailed":`The host renderer could not be mounted.`,"artifact.hostRendererUpdateFailed":`The host renderer could not be updated.`,"artifact.htmlDisplayFailed":`This HTML artifact could not be displayed.`,"artifact.loadFailed":`The artifact could not be loaded`,"artifact.mermaidSource":`Mermaid source`,"artifact.mermaidUnavailable":`Diagram rendering is unavailable until the optional Mermaid renderer passes its CSP and accessibility gate.`,"artifact.moreActions":`More actions`,"artifact.noDownload":`No downloadable content.`,"artifact.noRenderer":`No renderer is available for this {kind} artifact. You can still use the artifact actions when the host provides them.`,"artifact.openFailed":`The {noun} could not be opened.`,"artifact.openInEditor":`Open in editor`,"artifact.previewDescription":`Preview for the selected {kind} artifact.`,"artifact.previewTitle":`Artifact preview`,"artifact.report":`Report`,"artifact.saveFailed":`The save failed.`,"artifact.saveUnrecorded":`Saved to the catalog, but the conversation could not record it. Save again to retry.`,"artifact.selectPrompt":`Select an artifact from the conversation.`,"artifact.share":`Share artifact`,"artifact.shareIncomplete":`Sharing was not completed.`,"artifact.snapshot":`Snapshot`,"artifact.snapshotHint":`A snapshot of the data at the time of the answer. Open the {noun} to see live data.`,"artifact.unavailable":`This artifact is not available.`,"artifact.viewAsChart":`View as chart`,"artifact.viewAsTable":`View as table`,"artifact.viewFullscreen":`View fullscreen`,"artifact.viewing":`Viewing`,"artifact.visualizationLabel":`{kind} visualization`,"artifact.visualizationUnavailable":`Visualization unavailable`,"brand.name":`Incorta Intelligence`,"code.copy":`Copy code`,"code.insert":`Insert code`,"common.cancel":`Cancel`,"common.delete":`Delete`,"common.download":`Download`,"common.edit":`Edit`,"common.loading":`Loading…`,"common.next":`Next`,"common.open":`Open`,"common.preview":`Preview`,"common.previous":`Previous`,"common.rename":`Rename`,"common.retry":`Retry`,"common.save":`Save`,"common.search":`Search`,"common.searching":`Searching…`,"common.share":`Share`,"common.showLess":`Show less`,"common.showMore":`Show more`,"composer.agentOptions":`Agent options`,"composer.agentOptionsHeading":`{agent} options`,"composer.agentOptionsWithValue":`Agent options: {value}`,"composer.appliedToNextRequest":`Applied to the next request`,"composer.chooseAgent":`Choose an agent`,"composer.chooseAgentCommand":`Choose an agent command`,"composer.collapseInput":`Collapse input`,"composer.commandsStartEmptyPrompt":`Commands start at the beginning of an empty prompt`,"composer.disclaimer":`Incorta AI can make mistakes; verify important decisions.`,"composer.expandInput":`Expand input`,"composer.loadingAgentOptions":`Loading agent options`,"composer.mentionColumn":`Mention a column`,"composer.mentionColumnLabel":`Mention a Business View column`,"composer.mentionColumnRequiresOneView":`Attach exactly one Business View to mention a column`,"composer.placeholder":`Ask Incorta Intelligence`,"composer.removeAgent":`Remove {agent} agent`,"composer.searchValues":`Search values in the attached Business View`,"composer.searchValuesLabel":`Search Business View values`,"composer.searchValuesRequiresOneView":`Attach exactly one Business View to search its values`,"composer.sendMessage":`Send message`,"composer.stopResponse":`Stop response`,"composer.suggestions":`Composer suggestions`,"composer.unavailable":`The message composer could not be displayed.`,"context.add":`Add analysis context`,"context.kind.aiContainers":`AI Containers`,"context.kind.businessView":`Business view`,"context.kind.file":`File`,"context.kind.insight":`Insight`,"context.kind.knowledgeStore":`Knowledge Store`,"context.kind.physicalTable":`Tables`,"context.loadingSource":`Loading {title}…`,"context.noItems":`No available items.`,"context.previewName":`Preview {name}`,"context.removeName":`Remove {name}`,"context.searchSource":`Search {title}`,"context.selectedLabel":`Selected analysis context`,"context.selectedSummary":`Selected analysis context: {contexts}`,"context.showMore":`Show more selected contexts`,"context.showPrevious":`Show previous selected contexts`,"context.sourceFailed":`{title} could not be loaded.`,"context.sourceNoun":`{count, plural, one {source} other {sources}}`,"context.unsupportedByAgent":`Not supported by the current agent.`,"context.uploadAnalysisFiles":`Upload analysis files`,"context.uploadFiles":`Upload files`,"csv.goToPage":`Go to page {page}`,"csv.nextPage":`Go to next page`,"csv.previousPage":`Go to previous page`,"csv.summary":`Rows {from}–{to} of {total} · Page {page} of {pages}`,"file.blockedUrl":`This file link uses a blocked URL scheme.`,"file.downloadFailed":`The file could not be downloaded.`,"file.downloadName":`Download {name}`,"file.invalidData":`The file data is invalid.`,"file.noContent":`This file has no downloadable content.`,"file.noContentYet":`This file has no downloadable content yet.`,"file.openName":`Open {name}`,"file.openUnsupported":`Opening this file is not supported here.`,"file.pdfPreviewFailed":`This PDF could not be previewed.`,"file.pdfTooLarge":`This PDF is too large to preview here.`,"file.previewFailed":`This file could not be previewed.`,"file.readFailed":`This file could not be read.`,"file.tooLargeToDownload":`This file is too large to download here.`,"file.tooLargeToPreview":`This file is too large to preview here.`,"file.type.archive":`Archive · {format}`,"file.type.document":`Document · {format}`,"file.type.env":`Env`,"file.type.file":`File`,"file.type.format":`{format}`,"file.type.image":`Image · {format}`,"file.type.log":`Log`,"file.type.markdown":`Markdown`,"file.type.slides":`Slides · {format}`,"file.type.spreadsheet":`Spreadsheet · {format}`,"file.type.text":`Text`,"file.unpreviewable":`{name} cannot be previewed here. Download it to open in its own application.`,"history.collapse":`Collapse chat history`,"history.conversationRunning":`Conversation is running`,"history.delete.description":`This conversation will be removed from chat history.`,"history.delete.descriptionNamed":`“{title}” will be removed from chat history.`,"history.delete.title":`Delete conversation?`,"history.deleteFailed":`The conversation could not be deleted.`,"history.dismissError":`Dismiss history error`,"history.empty":`No chats yet`,"history.expand":`Expand chat history`,"history.group.older":`Older`,"history.group.previous7Days":`Previous 7 days`,"history.group.today":`Today`,"history.group.yesterday":`Yesterday`,"history.loadFailed":`Chats could not be loaded.`,"history.loadMoreConversations":`Load more conversations`,"history.loadingConversations":`Loading conversations…`,"history.moreActions":`More actions for {title}`,"history.newAnswer":`New answer`,"history.newChat":`New chat`,"history.notSavedYet":`This conversation is not saved yet.`,"history.rename.description":`Choose a short title that makes this analysis easy to find.`,"history.rename.inputLabel":`Conversation title`,"history.rename.title":`Rename conversation`,"history.renameFailed":`The conversation could not be renamed.`,"history.search.assistantAnswer":`Assistant answer`,"history.search.conversations":`Conversations`,"history.search.description":`Search conversation titles and previews.`,"history.search.empty":`No conversations found.`,"history.search.failed":`Conversation search failed.`,"history.search.moreResults":`{count, plural, one {# more result} other {# more results}}`,"history.search.noMatch":`No chats match “{query}”`,"history.search.placeholder":`Search chats…`,"history.search.resultCount":`{count, plural, one {# result} other {# results}}`,"history.search.searching":`Searching conversations`,"history.search.userQuestion":`User question`,"history.searchChats":`Search chats`,"history.sheetDescription":`Create, search, and reopen conversations.`,"history.startNewChat":`Start new chat`,"history.title":`Chat history`,"markdown.scrollableTable":`Scrollable table`,"message.conversationLost":`This conversation is no longer available. Start a new session to continue.`,"message.copy":`Copy message`,"message.download":`Download response`,"message.downloadCsv":`Table as CSV`,"message.downloadMarkdown":`Markdown (.md)`,"message.downloadText":`Plain text (.txt)`,"message.errorDetails":`Error details`,"message.errorDetailsDescription":`Technical details returned by Incorta Intelligence for this response.`,"message.feedbackFailed":`Feedback could not be sent`,"message.helpful":`Helpful response`,"message.lastExecuted":`Last Executed: {time}`,"message.notSaved":`Conversation was not saved`,"message.startNewSession":`Start new session`,"message.taskFailed":`The answer could not be completed`,"message.unhelpful":`Unhelpful response`,"message.viewErrorDetails":`View Error Details`,"preview.noData":`No data to be displayed`,"session.actions":`Chat actions`,"session.clickToRename":`Click to rename`,"session.delete":`Delete chat`,"session.untitled":`Untitled`,"shell.canvasUnavailable":`The canvas could not be displayed.`,"shell.close":`Close chat`,"shell.dock":`Dock to the side`,"shell.enterFullScreen":`Enter full screen`,"shell.exitFullScreen":`Exit full screen`,"shell.historyUnavailable":`The chat history could not be displayed.`,"shell.openHistory":`Open chat history`,"shell.resizeHandle":`Resize conversation and canvas`,"shell.threadUnavailable":`The conversation area could not be displayed.`,"shell.unavailable":`NexusChat is unavailable`,"shell.undock":`Undock`,"shell.workspace":`Conversation workspace`,"source.cite":`Source {index}`,"source.content":`Content`,"source.copy":`Copy content`,"source.count":`{count, plural, one {# source} other {# sources}}`,"source.kind.aiContainer":`AI Container`,"source.kind.businessView":`Business View`,"source.kind.document":`Document`,"source.kind.file":`File`,"source.kind.insight":`Insight`,"source.kind.knowledgeStore":`Knowledge Store`,"source.next":`Next source`,"source.open":`Open source`,"source.position":`{index} of {total}`,"source.preview":`Showing {shown, number} of {total, number} characters.`,"source.previous":`Previous source`,"source.showAll":`Show all`,"source.title":`Sources`,"source.untitled":`Untitled source`,"table.column":`Column {index}`,"task.backendReason":`Backend reason: {reason}`,"task.clarificationFailed":`The clarification could not be submitted.`,"task.contextRequestPreview":`Context request`,"task.launchUnresolved":`The prompt submission outcome is unresolved because no remote task identity was returned. Refresh conversation history before retrying.`,"task.pollFailed":`The interrupted task could not be resumed.`,"task.responseFailed":`The response could not be generated.`,"thinking.analyzingThis":`Analyzing this`,"thinking.checkingDetails":`Checking details`,"thinking.checkingRequest":`Checking request`,"thinking.consideringDetails":`Considering details`,"thinking.evaluatingDetails":`Evaluating details`,"thinking.examiningRequest":`Examining request`,"thinking.lookingIntoIt":`Looking into it`,"thinking.lookingOverRequest":`Looking over request`,"thinking.parsingRequest":`Parsing request`,"thinking.processing":`Processing`,"thinking.readingThroughIt":`Reading through it`,"thinking.reasoningThroughIt":`Reasoning through it`,"thinking.reviewingThis":`Reviewing this`,"thinking.sortingThroughDetails":`Sorting through details`,"thinking.takingCloserLook":`Taking a closer look`,"thinking.thinking":`Thinking`,"thinking.thinkingItThrough":`Thinking it through`,"thinking.understandingRequest":`Understanding request`,"thinking.workingOnIt":`Working on it`,"thinking.workingThroughIt":`Working through it`,"thread.agentActivity":`Agent activity`,"thread.inputNeeded":`Additional input needed`,"thread.inputRequiredDefault":`Additional input is required to continue.`,"thread.loadingConversation":`Loading conversation`,"thread.loadingConversationEllipsis":`Loading conversation…`,"thread.loadingEarlier":`Loading earlier messages`,"thread.messagesRegion":`Messages`,"thread.olderMessagesFailed":`Older messages could not be loaded.`,"thread.renderFailed":`This conversation could not be displayed.`,"thread.responseStopped":`You stopped this response.`,"thread.retryLoadEarlier":`Retry loading earlier messages`,"thread.scrollToLatest":`Scroll to latest message`,"thread.thoughts":`Thoughts`,"thread.unsupportedPart":`Unsupported A2A part: {kind}`,"thread.unsupportedPartDetail":`The response contained a part this NexusChat build cannot render.`,"time.justNow":`just now`,"tool.input":`Input`,"tool.moreRows":`{count, plural, one {# more row} other {# more rows}}`,"tool.output":`Output`,"tool.unsupportedContent":`This tool content type is not supported by this NexusChat build.`,"upload.agentCannotUseFile":`The selected agent cannot use this file context.`,"upload.alreadyAttached":`“{name}” is already attached.`,"upload.attachFailed":`File could not be attached`,"upload.failed":`File upload failed.`,"upload.failedShort":`Upload failed`,"upload.fileTooLarge":`File “{name}” exceeds the maximum size of {maxMb} MB.`,"upload.progress":`Uploading {percent, number, percent}`,"upload.recentFile":`Recent file`,"upload.sessionFailed":`A file-upload session could not be created.`,"upload.tooManyFiles":`You can add a maximum of {max} files.`,"upload.unsupportedFormat":`File “{name}” is not supported. Supported formats: {formats}.`,"upload.unsupportedShort":`Unsupported format. Supported: {formats}`,"upload.uploadingName":`Uploading {name}`,"upload.waitForConnection":`Wait for the current conversation to connect before adding files.`,"usage.cached":`({percent} cached)`,"usage.calls":`{count, plural, one {# call} other {# calls}}`,"usage.columnIn":`↑in`,"usage.columnModel":`model`,"usage.columnOut":`↓out`,"usage.duration":`{minutes}, {seconds}`,"usage.label":`Model usage`,"usage.models":`{count, plural, one {# model} other {# models}}`,"usage.title":`Token distribution`,"welcome.about":`About Incorta Intelligence`,"welcome.attachContextHint":`Attach a supported context to ground your question.`,"welcome.connecting":`Connecting to Incorta Intelligence…`,"welcome.connectionFailed":`Can't reach Incorta Intelligence right now.`,"welcome.greeting.afternoon":`{named, select, true {Good afternoon, {name}} other {Good afternoon}}`,"welcome.greeting.evening":`{named, select, true {Good evening, {name}} other {Good evening}}`,"welcome.greeting.morning":`{named, select, true {Good morning, {name}} other {Good morning}}`,"welcome.greeting.welcomeBack":`{named, select, true {Welcome back, {name}} other {Welcome back}}`,"welcome.retryConnecting":`Retry connecting to Incorta Intelligence`,"welcome.skill.buildDashboards":`Build dashboards`,"welcome.skill.createInsights":`Create insights`,"welcome.skill.exploreData":`Explore data`,"welcome.skill.generateReports":`Generate reports`,"welcome.subline":`How can I help you today?`},zt=[`en`,`ar`,`de`,`es`,`fr`,`it`,`ja`,`zh`];function Bt(e){let t=(e??``).replace(/_/g,`-`).toLowerCase();if(zt.includes(t))return t;let n=t.split(`-`)[0];return zt.find(e=>e===n)??`en`}function Vt(e,t){var n;let r=(e??``).replace(/_/g,`-`);if(((n=r.split(`-`)[0])==null?void 0:n.toLowerCase())!==t)return t;try{return Intl.getCanonicalLocales(r)[0]??t}catch{return t}}var Ht={ar:()=>t(()=>import(`./ar-BV81JAir.js`),[],import.meta.url),de:()=>t(()=>import(`./de-BXJlhmC2.js`),[],import.meta.url),es:()=>t(()=>import(`./es-nnw68YFM.js`),[],import.meta.url),fr:()=>t(()=>import(`./fr-CJIAbbzn.js`),[],import.meta.url),it:()=>t(()=>import(`./it-D3TiEKfy.js`),[],import.meta.url),ja:()=>t(()=>import(`./ja-ZB0L4Lsc.js`),[],import.meta.url),zh:()=>t(()=>import(`./zh-De2Ilp0M.js`),[],import.meta.url)},Ut=Je();function Wt(e,t){return Ft({locale:e,defaultLocale:`en`,messages:t},Ut)}function Gt(e){return(t,n)=>e().formatMessage({id:t},n)}var Q=Wt(`en`,Z),Kt={getIntl:()=>Q,subscribe:()=>()=>void 0,setLocale:()=>void 0,t:Gt(()=>Q),dispose:()=>void 0};function qt(e){let t=Q,n=0,r=new Set;async function i(e){let i=Bt(e),a=++n,o=i===`en`?Z:{...Z,...(await Ht[i]()).default};a===n&&(t=Wt(Vt(e,i),o),r.forEach(e=>e()))}let a={getIntl:()=>t,subscribe(e){return r.add(e),()=>{r.delete(e)}},setLocale(e){i(e).catch(e=>{console.error(`[NexusChat] locale catalog failed to load; keeping the current one.`,e)})},t:Gt(()=>t),dispose(){n++,r.clear()}};return a.setLocale(e),a}var $=(0,i.createContext)(Kt.getIntl());function Jt(){return(0,i.useContext)($).locale}function Yt(){let{formatMessage:e}=(0,i.useContext)($);return(0,i.useCallback)((t,n)=>e({id:t},n),[e])}export{Kt as a,qt as i,Jt as n,Yt as r,$ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DE3RlOCf.js";import{t}from"./spinner-eqRx6Fq-.js";import{r as n}from"./I18nContext-BlQKoDmv.js";var r=e();function i({loading:e=!1}){let i=n();return(0,r.jsxs)(`div`,{className:`nexus-chat-preview-state`,role:`status`,children:[e?(0,r.jsx)(t,{"aria-hidden":`true`}):null,(0,r.jsx)(`span`,{children:i(e?`common.loading`:`preview.noData`)})]})}export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./defineProperty-BbfpZ9Tg.js";import{n,t as r}from"./jsx-runtime-DE3RlOCf.js";import{n as i,t as a}from"./createLucideIcon-D1A0JYKN.js";import{d as o,f as s,l as c}from"./floating-ui.utils.dom-ObnfY4F6.js";import{_ as l,g as u,h as d,m as f,n as p,o as m,p as h,r as g,t as _}from"./button-CO0tH6F2.js";import{n as v,r as y,t as b}from"./UnsupportedArtifact-CeOCu_J6.js";import{r as x}from"./I18nContext-BlQKoDmv.js";import{n as S,t as C}from"./react-dom-FxOPXJ08.js";import{Bt as w,F as T,H as E,I as D,Jt as O,Kt as k,L as A,N as j,O as M,R as N,Rt as P,Tt as ee,Ut as F,V as I,Wt as L,Xt as R,Y as te,Yt as z,Z as ne,_ as re,bt as B,c as ie,cn as ae,dn as oe,f as se,fn as ce,g as le,h as ue,ht as V,i as de,j as H,kt as fe,l as pe,ln as U,m as me,o as he,on as ge,p as _e,pn as ve,q as ye,qt as be,r as xe,s as Se,t as Ce,tn as W,u as we,un as Te,v as Ee,vt as G,w as De,x as Oe,xt as K,y as ke,yt as Ae,z as je,zt as q}from"./useBaseUiId-Dpqq0brK.js";import{i as Me,n as Ne,r as Pe,t as Fe}from"./usePositioner-BhCjFmeW.js";import{n as Ie,r as Le,t as Re}from"./store-FaSYSP4_.js";var ze={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};ze.node;var Be=a(ze),Ve={name:`chart-no-axes-column-increasing`,size:24,node:[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V9`,key:`uvy0l4`}],[`path`,{d:`M19 21V3`,key:`11j9sm`}]],aliases:[`bar-chart`]};Ve.node;var He=a(Ve),Ue={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Ue.node;var We=a(Ue),Ge={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Ge.node;var Ke=a(Ge),qe={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};qe.node;var Je=a(qe),Ye={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};Ye.node;var Xe=a(Ye),Ze={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Ze.node;var Qe=a(Ze),J=r(),Y=e(n(),1),{useSyncExternalStoreWithSelector:$e}=e(S(),1).default,et=e=>e;function tt(e,t=et,n){let r=$e(e.subscribe,e.getState,e.getInitialState,t,n);return Y.useDebugValue(r),r}function nt(e,t){return e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))}var rt=(0,Y.createContext)(null);function it(){let e=(0,Y.useContext)(rt);if(!e)throw Error(`useNexusChatRuntime must be used inside NexusChatProvider.`);return e}function at(){return it().actions}function ot(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return nt(e,t);if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>{let r=e[n],i=t[n];return Object.is(r,i)?!0:Array.isArray(r)&&Array.isArray(i)?nt(r,i):!1})}function st(e,t=ot){let{actions:n}=it();return tt(n.store,e,t)}var ct=Y.createContext(void 0);function X(e){let t=Y.useContext(ct);if(t===void 0&&!e)throw Error(h(72));return t}function lt(e,t){return t!=null&&!W(t)?0:typeof e==`function`?e():e}function Z(e,t,n){let r=lt(e,n);return typeof r==`number`?r:r==null?void 0:r[t]}function ut(e){return typeof e==`function`?e():e}function dt(e,t){return t||e===`click`||e===`mousedown`}function ft(e){return(e==null?void 0:e.includes(`mouse`))&&e!==`mousedown`}var pt=Y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new U,currentIdRef:{current:null},currentContextRef:{current:null}});function mt(e,t){e.current=t.current}function ht(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=Y.useRef(n),a=Y.useRef(n),o=Y.useRef(null),s=Y.useRef(null),c=Te();return d(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Z(i.current,`open`),close:Z(n,`close`)}},[n,o,i,a]),(0,J.jsx)(pt.Provider,{value:Y.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function gt(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:f}=Y.useContext(pt),[p,m]=Y.useState(!1),h=Y.useRef(n),g=Y.useRef(!1);return d(()=>{h.current=n},[n]),d(()=>()=>{g.current=!0},[]),d(()=>{function e(){var e;g.current||m(!1),(e=l.current)==null||e.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,f.clear()}if(a.current&&!n&&a.current===i){if(m(!1),s){let t=i;return f.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(h.current||a.current!==t)&&f.clear()}}e()}},[n,i,a,o,s,c,l,f,r]),d(()=>{if(!n)return;let e=l.current,t=a.current;f.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:m},a.current=i,o.current={open:0,close:Z(c.current,`close`)},t!==null&&t!==i?(m(!0),e==null||e.setIsInstantPhase(!0),e==null||e.onOpenChange(!1,K(`none`))):(m(!1),e==null||e.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,f]),d(()=>()=>{if(a.current===i){if(l.current=null,!h.current)return;a.current=null,mt(o,c),f.clear()}},[l,a,o,i,c,f]),Y.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:p}),[u,o,p])}function _t(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){var a;let o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},s=t.axis===`x`||t.axis===`both`,c=t.axis===`y`||t.axis===`both`,l=[`mouseenter`,`mousemove`].includes(((a=t.dataRef.current.openEvent)==null?void 0:a.type)||``)&&t.pointerType!==`touch`,u=o.width,d=o.height,f=o.x,p=o.y;return n==null&&t.x&&s&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),f-=n||0,p-=r||0,u=0,d=0,!i||l?(u=t.axis===`y`?o.width:0,d=t.axis===`x`?o.height:0,f=s&&t.x!=null?t.x:f,p=c&&t.y!=null?t.y:p):i&&!l&&(d=t.axis===`x`?o.height:d,u=t.axis===`y`?o.width:u),i=!0,{width:u,height:d,x:f,y:p,top:p,right:f+u,bottom:p+d,left:f}}}}function vt(e){return e!=null&&e.clientX!=null}function yt(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),l=i.context.dataRef,d=Y.useRef(!1),f=Y.useRef(null),[p,m]=Y.useState(),[h,g]=Y.useState([]),_=u(e=>{i.set(`positionReference`,e)}),v=u((e,t,n)=>{d.current||l.current.openEvent&&!vt(l.current.openEvent)||i.set(`positionReference`,_t(n??s,{x:e,y:t,axis:r,dataRef:l,pointerType:p}))}),y=u(e=>{a?f.current||(v(e.clientX,e.clientY,e.currentTarget),g([])):v(e.clientX,e.clientY,e.currentTarget)}),b=W(p)?o:a;Y.useEffect(()=>{if(!n){_(s);return}if(!b)return;function e(){var e;(e=f.current)==null||e.call(f),f.current=null}let t=c(o);function r(t){let n=R(t);z(o,n)?e():v(t.clientX,t.clientY)}return!l.current.openEvent||vt(l.current.openEvent)?f.current=B(t,`mousemove`,r):_(s),e},[b,n,o,l,s,i,v,_,h]),Y.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),Y.useEffect(()=>{n&&!o&&(d.current=!1)},[n,o]),Y.useEffect(()=>{!n&&a&&(d.current=!0)},[n,a]);let x=Y.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return Y.useMemo(()=>n?{reference:x,trigger:x}:{},[n,x])}function bt(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function xt(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function St(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(xt(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:bt(r,i,a,o)}}function Ct(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function wt(e){return bt(e.left,e.top,e.right,e.bottom)}function Tt(e,t,n){let{lines:r}=St(e.getClientRects());if(r.length<2)return;let i=Ct(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function Et(e,t,n){let{lines:r,fallback:i}=St(e.getClientRects());if(r.length<2)return null;let a=n==null?void 0:n.x,o=n==null?void 0:n.y,s=t[0];if((n==null?void 0:n.lineIndex)!=null&&r[n.lineIndex])return wt(r[n.lineIndex]);if(a!=null&&o!=null){let e=Ct(r,a,o);if(e!==-1)return wt(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return bt(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return bt(l,f.top,u,p.bottom)}function Dt(e){return`contextElement`in e&&e.contextElement?e.contextElement:o(e)?e:void 0}function Ot(e,t){function n(t){kt(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function kt(e,t,n,r){let i=Tt(t,n,r);return e.current=i,i}function At(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof(n==null?void 0:n.getClientRects)!=`function`)return{};let r=Dt(n),i=e.current,a=(i==null?void 0:i.element)===n||(i==null?void 0:i.element)===r?i:void 0,o=Et(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var jt=ae&≥function Mt(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:l}=i.context,u=Y.useRef(!1),d=Y.useRef(null),f=Y.useRef(!0),p=Te();Y.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=c(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&s(e)&&e===O(V(e))&&(u.current=!0)}function a(){f.current=!0}function o(){f.current=!1}return Ae(B(t,`blur`,r),jt&&B(t,`keydown`,a,!0),jt&&B(t,`pointerdown`,o,!0))},[i,n]),Y.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);o(e)&&(d.current=e,u.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let m=Y.useMemo(()=>{function e(){u.current=!1,d.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(u.current){if(d.current===n)return;e()}let a=R(t.nativeEvent);if(o(a)){if(jt&&!t.relatedTarget){if(!f.current&&!k(a))return}else if(!be(a))return}let s=L(t.relatedTarget,i.context.triggerElements),{nativeEvent:c,currentTarget:l}=t,m=typeof r==`function`?r():r;if(i.select(`open`)&&s||m===0||m===void 0){i.setOpen(!0,K(P,c,l));return}p.start(m,()=>{u.current||i.setOpen(!0,K(P,c,l))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=o(n)&&n.hasAttribute(te(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;p.start(0,()=>{var e;let t=i.select(`domReferenceElement`),o=O(V(t));!n&&o===t||z((e=l.current.floatingContext)==null?void 0:e.refs.floating.current,o)||z(t,o)||a||L(n??o,i.context.triggerElements)||i.setOpen(!1,K(P,r))})}}},[l,r,i,p]);return Y.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}var Nt=class e{constructor(){t(this,`dispose`,()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),t(this,`disposeEffect`,()=>this.dispose),this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new U,this.restTimeout=new U,this.handleCloseOptions=void 0}static create(){return new e}},Pt=new WeakMap;function Ft(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Pt.get(t)===e){var n,r,i;(n=e.pointerEventsScopeElement)==null||n.style.removeProperty(`pointer-events`),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty(`pointer-events`),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty(`pointer-events`),Pt.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function It(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Pt.get(n);a&&a!==e&&Ft(a),Ft(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Pt.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Lt(e){let t=e.context.dataRef.current,n=l(()=>t.hoverInteractionState??Nt.create()).current;return t.hoverInteractionState||=n,oe(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Rt(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,s=a.useState(`open`),c=a.useState(`floatingElement`),l=a.useState(`domReferenceElement`),{dataRef:f}=a.context,p=je(),m=N(),h=Lt(a),g=Te(),_=u(()=>{var e;return dt((e=f.current.openEvent)==null?void 0:e.type,h.interactedInside)}),v=u(()=>{var e;return ft((e=f.current.openEvent)==null?void 0:e.type)}),y=u(()=>{Ft(h)});d(()=>{s||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,y())},[s,h,y]),Y.useEffect(()=>y,[y]),d(()=>{var e;if(n&&s&&(e=h.handleCloseOptions)!=null&&e.blockPointerEvents&&v()&&o(l)&&c){var t,r,i;let e=l,n=c,a=V(c),o=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;o&&(o.style.pointerEvents=``);let s=h.pointerEventsScopeElement===n?null:h.pointerEventsScopeElement,u=o===n?null:o,d=((r=h.handleCloseOptions)==null||(i=r.getScope)==null?void 0:i.call(r))??s??u??e.closest(`[data-rootownerid]`)??a.body;return It(h,{scopeElement:d,referenceElement:e,floatingElement:n}),()=>{y()}}},[n,s,l,c,h,v,p,m,y]),Y.useEffect(()=>{if(!n)return;function e(){return!!(p&&m&&ne(p.nodesRef.current,m).length>0)}function t(e){let t=Z(r,`close`,h.pointerType),n=()=>{a.setOpen(!1,K(q,e)),p==null||p.events.emit(`floating.closed`,e)};t?h.openChangeTimeout.start(t,n):(h.openChangeTimeout.clear(),n())}function s(e){let t=R(e);if(!F(t)){h.interactedInside=!1;return}h.interactedInside=(t==null?void 0:t.closest(`[aria-haspopup]`))!=null}function l(){h.openChangeTimeout.clear(),g.clear(),p==null||p.events.off(`floating.closed`,d),y()}function u(n){var r;if(e()&&p){p.events.on(`floating.closed`,d);return}if(L(n.relatedTarget,a.context.triggerElements))return;let s=((r=f.current.floatingContext)==null?void 0:r.nodeId)??i,c=n.relatedTarget;if(!(p&&s&&o(c)&&ne(p.nodesRef.current,s,!1).some(e=>{var t;return z((t=e.context)==null?void 0:t.elements.floating,c)}))){if(h.handler){h.handler(n);return}y(),v()&&!_()&&t(n)}}function d(t){!p||!m||e()||g.start(0,()=>{p.events.off(`floating.closed`,d),a.setOpen(!1,K(q,t)),p.events.emit(`floating.closed`,t)})}let b=c;return Ae(b&&B(b,`mouseenter`,l),b&&B(b,`mouseleave`,u),b&&B(b,`pointerdown`,s,!0),()=>{p==null||p.events.off(`floating.closed`,d)})},[n,c,a,f,r,i,v,_,y,h,p,m,g])}var zt=e(C(),1),Bt={current:null};function Vt(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:s=0,move:c=!0,triggerElementRef:l=Bt,externalTree:d,isActiveTrigger:f=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:h}=t,g=`rootStore`in e?e.rootStore:e,{dataRef:_,events:v}=g.context,y=je(d),b=Lt(g),x=Y.useRef(!1),S=G(i),C=G(r),w=G(s),T=G(n),E=G(h),D=G(m),O=u(()=>{var e;return dt((e=_.current.openEvent)==null?void 0:e.type,b.interactedInside)}),k=u(()=>{var e;return((e=E.current)==null?void 0:e.call(E))!==!1}),A=u((e,t,n)=>{let r=g.context.triggerElements;if(r.hasElement(t))return!e||!z(e,t);if(!o(n))return!1;let i=n;return r.hasMatchingElement(e=>z(e,i))&&(!e||!z(e,i))}),j=u(()=>{b.handler&&=(V(g.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=u(()=>{Ft(b)});if(f){var N;b.handleCloseOptions=(N=S.current)==null?void 0:N.__options}return Y.useEffect(()=>j,[j]),Y.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===q,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,j]),Y.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Z(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{g.setOpen(!1,K(q,e)),y==null||y.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),g.setOpen(!1,K(q,e)),y==null||y.events.emit(`floating.closed`,e))}let t=l.current??(f?g.select(`domReferenceElement`):null);if(!o(t))return;function r(e){var t;if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!W(b.pointerType))return;let n=ut(w.current),r=Z(C.current,`open`,b.pointerType),i=R(e),s=e.currentTarget??null,c=g.select(`domReferenceElement`),l=s;if(o(i)&&!g.context.triggerElements.hasElement(i)){for(let e of g.context.triggerElements.elements())if(z(e,i)){l=e;break}}o(s)&&o(c)&&!g.context.triggerElements.hasElement(s)&&z(s,c)&&(l=c);let u=l!=null&&A(c,l,i),d=g.select(`open`),f=((t=D.current)==null?void 0:t.call(D))??g.select(`transitionStatus`)===`ending`,p=!d&&f&&x.current,m=!u&&o(l)&&o(c)&&z(c,l)&&p,h=n>0&&!r,_=u&&(d||p)||m,v=!d||u;if(_){k()&&g.setOpen(!0,K(q,e,l));return}h||(r?b.openChangeTimeout.start(r,()=>{v&&k()&&g.setOpen(!0,K(q,e,l))}):v&&k()&&g.setOpen(!0,K(q,e,l)))}function i(t){if(O()){M();return}j();let n=g.select(`domReferenceElement`),r=V(n);b.restTimeout.clear(),b.restTimeoutPending=!1;let i=_.current.floatingContext??(p==null?void 0:p());if(!L(t.relatedTarget,g.context.triggerElements)){if(S.current&&i){g.select(`open`)||b.openChangeTimeout.clear();let n=l.current;b.handler=S.current({...i,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&n===g.select(`domReferenceElement`)&&e(t,!0)}}),r.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!z(g.select(`floatingElement`),t.relatedTarget))&&e(t)}}return c?Ae(B(t,`mousemove`,r,{once:!0}),B(t,`mouseenter`,r),B(t,`mouseleave`,i)):Ae(B(t,`mouseenter`,r),B(t,`mouseleave`,i))},[j,M,_,C,g,n,S,b,f,A,O,a,c,w,l,y,T,p,D,k]),Y.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){var t;let{nativeEvent:n}=e,r=e.currentTarget,i=g.select(`domReferenceElement`),o=g.select(`open`),s=A(i,r,e.target);if(a&&!W(b.pointerType))return;if(o&&s&&(t=b.handleCloseOptions)!=null&&t.blockPointerEvents){let e=g.select(`floatingElement`);if(e){var c,l;let t=((c=b.handleCloseOptions)==null||(l=c.getScope)==null?void 0:l.call(c))??r.ownerDocument.body;It(b,{scopeElement:t,referenceElement:r,floatingElement:e})}}let u=ut(w.current);if(o&&!s||u===0||!s&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function d(){if(b.restTimeoutPending=!1,O())return;let e=g.select(`open`);!b.blockMouseMove&&(!e||s)&&k()&&g.setOpen(!0,K(q,n,r))}b.pointerType===`touch`?zt.flushSync(()=>{d()}):s&&o?d():(b.restTimeoutPending=!0,b.restTimeout.start(u,d))}}},[n,b,O,A,a,g,w,k])}var Ht=.1,Ut=Ht*Ht,Q=.5;function Wt(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Gt(e,t,n,r,i,a,o,s,c,l){let u=!1;return Wt(e,t,n,r,i,a)&&(u=!u),Wt(e,t,i,a,o,s)&&(u=!u),Wt(e,t,o,s,c,l)&&(u=!u),Wt(e,t,c,l,n,r)&&(u=!u),u}function Kt(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function qt(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Jt(e={}){let{blockPointerEvents:t=!1}=e,n=new U,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:s,tree:c})=>{let l=r==null?void 0:r.split(`-`)[0],u=!1,d=null,f=null,p=typeof performance<`u`?performance.now():0;function m(e,t){let n=performance.now(),r=n-p;if(d===null||f===null||r===0)return d=e,f=t,p=n,!1;let i=e-d,a=t-f,o=i*i+a*a,s=r*r*Ut;return d=e,f=t,p=n,o<s}function h(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,d=i.floating;if(!a||!d||l==null||e==null||t==null)return;let{clientX:f,clientY:p}=r,g=R(r),_=r.type===`mouseleave`,v=z(d,g),y=z(a,g);if(v&&(u=!0,!_))return;if(y&&(u=!1,!_)){u=!0;return}if(_&&o(r.relatedTarget)&&z(d,r.relatedTarget))return;function b(){return!!(c&&ne(c.nodesRef.current,s).length>0)}function x(){b()||h()}if(b())return;let S=a.getBoundingClientRect(),C=d.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>S.width,D=C.height>S.height,O=(E?S:C).left,k=(E?S:C).right,A=(D?S:C).top,j=(D?S:C).bottom;if(l===`top`&&t>=S.bottom-1||l===`bottom`&&t<=S.top+1||l===`left`&&e>=S.right-1||l===`right`&&e<=S.left+1){x();return}let M=!1;switch(l){case`top`:M=qt(f,p,O,S.top+1,k,C.bottom-1);break;case`bottom`:M=qt(f,p,O,C.top+1,k,S.bottom-1);break;case`left`:M=qt(f,p,C.right-1,j,S.left+1,A);break;case`right`:M=qt(f,p,S.right-1,j,C.left+1,A)}if(M)return;if(u&&!Kt(f,p,S)){x();return}if(!_&&m(f,p)){x();return}let N=!1;switch(l){case`top`:{let n=E?Q/2:Q*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+Q+1,o=w||E?C.bottom-Q:C.top,s=w?E?C.bottom-Q:C.top:C.bottom-Q;N=Gt(f,p,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?Q/2:Q*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-Q,o=w||E?C.top+Q:C.bottom,s=w?E?C.top+Q:C.bottom:C.top+Q;N=Gt(f,p,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?Q/2:Q*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+Q+1,o=T||D?C.right-Q:C.left,s=T?D?C.right-Q:C.left:C.right-Q;N=Gt(f,p,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?Q/2:Q*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-Q,o=T||D?C.left+Q:C.right,s=T?D?C.left+Q:C.right:C.left+Q;N=Gt(f,p,a,r,a,i,o,C.top,s,C.bottom);break}}N?u||n.start(40,x):x()}};return r.__options={...e,blockPointerEvents:t},r}var Yt={...Le,disabled:H(e=>e.disabled),instantType:H(e=>e.instantType),isInstantPhase:H(e=>e.isInstantPhase),trackCursorAxis:H(e=>e.trackCursorAxis),disableHoverablePopup:H(e=>e.disableHoverablePopup),lastOpenChangeReason:H(e=>e.openChangeReason),closeOnClick:H(e=>e.closeOnClick),closeDelay:H(e=>e.closeDelay),hasViewport:H(e=>e.hasViewport)},Xt=class e extends M{constructor(e,n,r=!1){let i=new Se,a={...Zt(),...e};a.floatingRootContext=Ie(i,n,r),super(a,{popupRef:Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i},Yt),t(this,`setOpen`,(e,t)=>{pe(this,e,t,{extraState:{openChangeReason:t.reason}})})}cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,K(w,e))}static useStore(t,n){return Ee(t,(t,r)=>new e(n,t,r)).store}};function Zt(){return{...Re(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Qt=ce(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:f=null,children:p}=e,m=Xt.useStore(l==null?void 0:l.store,{open:n,openProp:r,activeTriggerId:f,triggerIdProp:u});me(m,r,n,f),m.useControlledProp(`openProp`,r),m.useControlledProp(`triggerIdProp`,u),m.useContextCallback(`onOpenChange`,s),m.useContextCallback(`onOpenChangeComplete`,c);let h=m.useState(`open`),g=!t&&h,_=m.useState(`activeTriggerId`),v=m.useState(`mounted`),y=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),m.useSyncedValue(`disabled`,t),_e(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=ue(g,m),S=m.useState(`isInstantPhase`),C=m.useState(`instantType`),w=m.useState(`lastOpenChangeReason`),T=Y.useRef(null);d(()=>{h&&t&&m.setOpen(!1,K(ee))},[h,t,m]),d(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),m.set(`instantType`,`delay`)):T.current!==null&&(m.set(`instantType`,T.current),T.current=null)},[x,S,w,C,m]),d(()=>{g&&(_??m.set(`payload`,void 0))},[m,_,g]);let E=Y.useCallback(()=>{m.setOpen(!1,K(fe))},[m]);Y.useImperativeHandle(o,()=>({unmount:b,close:E}),[b,E]);let D=g||v||!t&&a!==`none`;return(0,J.jsxs)(ct.Provider,{value:m,children:[D&&(0,J.jsx)($t,{store:m,disabled:t,trackCursorAxis:a}),typeof p==`function`?p({payload:y}):p]})});function $t({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=j(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=yt(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=Y.useMemo(()=>f(a.reference,i.reference),[a.reference,i.reference]),s=Y.useMemo(()=>f(a.trigger,i.trigger),[a.trigger,i.trigger]),c=Y.useMemo(()=>f(ie,a.floating,i.floating),[a.floating,i.floating]);return le(e,{activeTriggerProps:o,inactiveTriggerProps:s,popupProps:c}),null}var en=Y.createContext(void 0);function tn(){return Y.useContext(en)}var nn=function(e){return e[e.popupOpen=xe.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),rn=`data-base-ui-tooltip-trigger`;function an(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(o(n))return n}}let t=e.target;return o(t)?t:null}function on(e){let t=e;for(;t;){if(t.hasAttribute(rn))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&o(n.host)?n.host:null}return null}var sn=ve(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=X(!0),m=(a==null?void 0:a.store)??p;if(!m)throw Error(h(82));let _=Ce(d),v=m.useState(`isTriggerActive`,_),y=m.useState(`isOpenedByTrigger`,_),b=m.useState(`floatingRootContext`),x=Y.useRef(null),S=c??600,C=u??0,{registerTrigger:w,isMountedByThisTrigger:T}=ke(_,x,m,{payload:o,closeOnClick:l,closeDelay:C}),E=tn(),{delayRef:D,isInstantPhase:O,hasProvider:k}=gt(b,{open:y}),A=Lt(b);m.useSyncedValue(`isInstantPhase`,O);let j=m.useState(`disabled`),M=s??j,N=G(M),P=m.useState(`trackCursorAxis`),ee=m.useState(`disableHoverablePopup`),F=Y.useRef(!1),I=Te(),L=Y.useRef(void 0);function R(){let e=E==null?void 0:E.delay,t=typeof D.current==`object`?D.current.open:void 0,n=S;return k&&(n=t===0?0:c??e??S),n}function te(e){let t=x.current;if(!t||!e)return!1;let n=on(e);return n!==null&&n!==t&&z(t,n)}function ne(e){let t=te(e);return F.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,I.clear()),t}let re=Vt(b,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!ee&&P!==`both`?Jt():null,restMs:R,delay(){let e=typeof D.current==`object`?D.current.close:void 0,t=C;return u==null&&k&&(t=e),{close:t}},triggerElementRef:x,isActiveTrigger:v,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),B=Mt(b,{enabled:!M}).reference,ie=e=>{let t=F.current,n=an(e),r=ne(n),i=x.current,a=i&&n&&z(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,K(q,e));return}if(t&&!r&&a&&!N.current&&!m.select(`open`)&&i&&W(L.current)){let t=()=>{!F.current&&!N.current&&!m.select(`open`)&&m.setOpen(!0,K(q,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ae=m.useState(`triggerProps`,T);return g(`button`,e,{state:{open:y},ref:[t,w,x],props:[re,B,T||P!==`none`?ae:void 0,{onMouseOver(e){ie(e.nativeEvent)},onFocus(e){te(an(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:_,[nn.triggerDisabled]:M?``:void 0,[rn]:M?void 0:``},f],stateAttributesMapping:he})}),cn=Y.createContext(void 0);function ln(){let e=Y.useContext(cn);if(e===void 0)throw Error(h(70));return e}var un=Y.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=E({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,J.jsxs)(Y.Fragment,{children:[l,c&&zt.createPortal(n,c)]})}),dn=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return X().useState(`mounted`)||n?(0,J.jsx)(cn.Provider,{value:n,children:(0,J.jsx)(un,{ref:t,...r})}):null}),fn=Y.createContext(void 0);function pn(){let e=Y.useContext(fn);if(e===void 0)throw Error(h(71));return e}var mn=Y.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=ye,style:g,..._}=e,v=X(),y=ln(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=v.useState(`hasViewport`),O=Pe({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:D?Me:void 0}),k=Y.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,O.side,O.align,O.anchorHidden,S,T]),A=Fe(e,k,{styles:O.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,J.jsx)(fn.Provider,{value:O,children:A})}),hn={...de,...De},gn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=X(),{side:s,align:c}=pn(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Oe({open:l,ref:o.context.popupRef,onComplete(){if(l){var e,t;(e=(t=o.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),Rt(p,{enabled:!m,closeDelay:h});let _=o.useStateSetter(`popupElement`);return g(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,_],props:[f,Ne(d),a],stateAttributesMapping:hn})}),_n=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=X(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=pn(),f={open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)};return g(`div`,e,{state:f,ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:de})}),vn=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=Y.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=Y.useMemo(()=>({open:t,close:n}),[t,n]);return(0,J.jsx)(en.Provider,{value:i,children:(0,J.jsx)(ht,{delay:a,timeoutMs:r,children:e.children})})},yn=class{constructor(){this.store=new Xt}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!t)throw Error(h(81,e));this.store.setOpen(!0,K(fe,void 0,t))}close(){this.store.setOpen(!1,K(fe,void 0,void 0))}get isOpen(){return this.store.select(`open`)}};function bn(){return new yn}function xn({delay:e=0,...t}){return(0,J.jsx)(vn,{"data-slot":`tooltip-provider`,delay:e,...t})}var Sn=(0,Y.createContext)(null),Cn=(0,Y.createContext)(null),wn=`data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm`,Tn=`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`;function En({children:e,...t}){let[n]=(0,Y.useState)(()=>bn());return(0,J.jsx)(xn,{...t,children:(0,J.jsxs)(Sn.Provider,{value:n,children:[e,(0,J.jsx)(Qt,{disableHoverablePopup:!0,handle:n,children:({payload:e})=>{let{align:t=`center`,alignOffset:n=0,children:r,popupProps:i={},side:a=`top`,sideOffset:o=4}=e??{},{className:s,...c}=i;return(0,J.jsx)(dn,{keepMounted:!0,children:(0,J.jsx)(mn,{align:t,alignOffset:n,side:a,sideOffset:o,className:`nexus-chat-tooltip-positioner isolate z-50`,children:(0,J.jsxs)(gn,{"data-slot":`tooltip-content`,className:[wn,s].filter(Boolean).join(` `),...c,children:[r,(0,J.jsx)(_n,{className:Tn})]})})})}})]})})}function Dn({children:e}){let t=null;return Y.Children.forEach(e,e=>{if(!(0,Y.isValidElement)(e)||e.type!==kn)return;let{align:n=`center`,alignOffset:r=0,children:i,side:a=`top`,sideOffset:o=4,...s}=e.props;t={align:n,alignOffset:r,children:i,popupProps:s,side:a,sideOffset:o}}),(0,J.jsx)(Cn.Provider,{value:t,children:e})}function On(e){let t=(0,Y.useContext)(Sn),n=(0,Y.useContext)(Cn);if(!t)throw Error(`TooltipTrigger must be rendered inside TooltipProvider.`);return(0,J.jsx)(sn,{"data-slot":`tooltip-trigger`,...e,handle:t,payload:n??void 0})}function kn(e){return null}function An({label:e,children:t,...n}){return(0,J.jsxs)(Dn,{children:[(0,J.jsx)(On,{render:(0,J.jsx)(_,{"aria-label":e,size:`icon-sm`,variant:`ghost`,...n,children:t})}),(0,J.jsx)(kn,{children:e})]})}var jn=new Set([`submitted`,`working`,`input-required`,`completed`,`cancelled`,`failed`,`rejected`,`auth-required`,`unknown`]),Mn=new Set([`completed`,`cancelled`,`failed`,`rejected`,`auth-required`,`unknown`]),Nn=new Set([`submitted`,`working`]),Pn=new Set([`submitted`,`working`,`input-required`]);function Fn(e){let t=e===`canceled`?`cancelled`:e;return jn.has(t)?t:`unknown`}function In(e){return Mn.has(e)}function Ln(e){return e!==void 0&&Nn.has(e)}function Rn(e){return e!==void 0&&Pn.has(e)}function zn(e){return e===`completed`?`complete`:In(e)?`incomplete`:`running`}var Bn={partType:`part_type`,partId:`part_id`,schemaVersion:`schema_version`,title:`title`,description:`description`,htmlType:`html_type`,contentDeferred:`content_deferred`,status:`status`,stepType:`step_type`,taskInstanceId:`task_instance_id`,subTaskId:`sub_task_id`,toolName:`tool_name`,agentName:`agent_name`,conversationContext:`conversation_context`,error:`error`,persistenceWarning:`persistence_warning`,usedDatasets:`used_datasets`,metrics:`metrics`,tokenUsage:`token_usage`,duration:`duration`,llmCallCount:`llm_call_count`};function Vn(e){let{id:t,kind:n,metadata:r}=e,i=`content`in e?e.content:e,a=r==null?void 0:r[Bn.schemaVersion];return{id:t,kind:n===`host`?e.hostKind:n,data:i,metadata:r,...typeof a==`number`?{schemaVersion:a}:{}}}function Hn(e,t){if(!e)return!1;try{return e.can(t)}catch{return!1}}function Un(e){if(e.kind!==`host`&&e.kind!==`insight`)return[];let t=Vn(e);return[{type:`open-host-artifact`,artifact:t,target:`edit`},{type:`open-host-artifact`,artifact:t,target:`view`}]}function Wn(e,t){if(!t)return null;try{return Un(e).find(e=>t.can(e))??null}catch{return null}}function Gn(e,t){return e.kind!==`host`&&e.kind!==`insight`?!1:Hn(t,Vn(e))}function Kn(e){let t=e.split(`_`).filter(Boolean).at(-1);return t?t.toLowerCase():`artifact`}function qn(e){if(!(`content`in e))return null;if(typeof e.content==`string`)return e.content;if(e.content===null||e.content===void 0)return null;try{return JSON.stringify(e.content,null,2)}catch{return String(e.content)}}var Jn=Y.createContext(void 0);function Yn(e){let t=Y.useContext(Jn);if(t===void 0&&!e)throw Error(h(50));return t}var Xn={...Le,instantType:H(e=>e.instantType),hasViewport:H(e=>e.hasViewport)},Zn=class e extends M{constructor(e,n,r=!1){let i=new Se,a={...Qn(),...e};a.floatingRootContext=Ie(i,n,r),super(a,{popupRef:Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i,closeDelayRef:{current:300},inlineRectCoordsRef:{current:void 0}},Xn),t(this,`setOpen`,(e,t)=>{let{inlineRectCoordsRef:n}=this.context;pe(this,e,t,{onBeforeDispatch(){var r;let i=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in i&&`clientY`in i&&((r=n.current)==null?void 0:r.element)!==t.trigger&&kt(n,t.trigger,i.clientX,i.clientY)}})})}static useStore(t,n){return Ee(t,(t,r)=>new e(n,t,r)).store}};function Qn(){return{...Re(),instantType:void 0,hasViewport:!1}}function $n(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:o,triggerId:s,defaultTriggerId:c=null,children:l}=e,u=Zn.useStore(o==null?void 0:o.store,{open:n,openProp:t,activeTriggerId:c,triggerIdProp:s});me(u,t,n,c),u.useControlledProp(`openProp`,t),u.useControlledProp(`triggerIdProp`,s),u.useContextCallback(`onOpenChange`,r),u.useContextCallback(`onOpenChangeComplete`,i);let f=u.useState(`open`),p=u.useState(`activeTriggerId`),m=u.useState(`mounted`),h=u.useState(`payload`);_e(u,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:g}=ue(f,u,()=>{u.context.inlineRectCoordsRef.current=void 0});d(()=>{f&&(p??u.set(`payload`,void 0))},[u,p,f]);let _=Y.useCallback(()=>{u.setOpen(!1,K(fe))},[u]);Y.useImperativeHandle(a,()=>({unmount:g,close:_}),[g,_]);let v=f||m;return(0,J.jsxs)(Jn.Provider,{value:u,children:[v&&(0,J.jsx)(er,{store:u}),typeof l==`function`?l({payload:h}):l]})}function er({store:e}){let t=e.useState(`floatingRootContext`),n=j(t),r=n.reference??m,i=n.trigger??m,a=Y.useMemo(()=>f(ie,n.floating),[n.floating]);return le(e,{activeTriggerProps:r,inactiveTriggerProps:i,popupProps:a}),null}var tr=ce(function(e){return Yn(!0)?(0,J.jsx)($n,{...e}):(0,J.jsx)(D,{children:(0,J.jsx)($n,{...e})})}),nr=Y.createContext(void 0);function rr(){let e=Y.useContext(nr);if(e===void 0)throw Error(h(48));return e}var ir=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Yn().useState(`mounted`)||n?(0,J.jsx)(nr.Provider,{value:n,children:(0,J.jsx)(un,{ref:t,...r})}):null}),ar=ve(function(e,t){let{render:n,className:r,delay:i,closeDelay:a,id:o,payload:s,handle:c,style:l,...u}=e,f=Yn(!0),p=(c==null?void 0:c.store)??f;if(!p)throw Error(h(89));let m=Ce(o),_=p.useState(`isTriggerActive`,m),v=p.useState(`isOpenedByTrigger`,m),y=p.useState(`floatingRootContext`),b=p.context.inlineRectCoordsRef,x=Y.useRef(null),S=i??600,C=a??300,{registerTrigger:w,isMountedByThisTrigger:T}=ke(m,x,p,{payload:s});d(()=>{T&&(p.context.closeDelayRef.current=C)},[p,T,C]);let E=Vt(y,{mouseOnly:!0,move:!1,handleClose:Jt(),delay:()=>({open:S,close:C}),triggerElementRef:x,isActiveTrigger:_,isClosing:()=>p.select(`transitionStatus`)===`ending`}),D=Mt(y,{delay:S}),O={open:v},k=p.useState(`triggerProps`,T),A=Ot(b,v);return g(`a`,e,{state:O,ref:[t,w,x],props:[E,D.reference,k,A,{id:m},u],stateAttributesMapping:he})}),or=Y.createContext(void 0);function sr(){let e=Y.useContext(or);if(e===void 0)throw Error(h(49));return e}var cr=Y.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=ye,style:_,...v}=e,y=Yn(),b=rr(),x=A(),S=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=y.useState(`hasViewport`),k=y.context.inlineRectCoordsRef,j=Pe({anchor:i,floatingRootContext:w,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:p,collisionBoundary:u,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:b,nodeId:x,collisionAvoidance:g,adaptiveOrigin:O?Me:void 0,inline:At(k)}),M=j.update;d(()=>{S&&C&&M()},[S,C,M]);let N={open:S,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:E},P=Fe(e,N,{styles:j.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!S});return(0,J.jsx)(or.Provider,{value:j,children:(0,J.jsx)(T,{id:x,children:P})})}),lr={...de,...De},ur=Y.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=Yn(),{side:s,align:c}=sr(),l=o.useState(`open`),d=o.useState(`instantType`),f=o.useState(`transitionStatus`),p=o.useState(`popupProps`),m=o.useState(`floatingRootContext`);return Oe({open:l,ref:o.context.popupRef,onComplete(){if(l){var e,t;(e=(t=o.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),Rt(m,{closeDelay:u(()=>o.context.closeDelayRef.current)}),g(`div`,e,{state:{open:l,side:s,align:c,instant:d,transitionStatus:f},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[p,Ne(f),a],stateAttributesMapping:lr})});function dr(e){return g(e.defaultTagName??`div`,e,e)}var fr=p(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive-border aria-invalid:ring-destructive-border/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive text-destructive-foreground focus-visible:ring-destructive-border/40 [a]:hover:bg-[color-mix(in_oklch,var(--destructive),var(--foreground)_5%)]`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-secondary-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function pr({className:e,variant:t=`default`,render:n,...r}){return dr({defaultTagName:`span`,props:f({className:i(fr({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var mr=Y.createContext(void 0);function hr(e){let t=Y.useContext(mr);if(t===void 0&&!e)throw Error(h(47));return t}function gr(){return{...Re(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var _r={...Le,disabled:H(e=>e.disabled),instantType:H(e=>e.instantType),openMethod:H(e=>e.openMethod),openChangeReason:H(e=>e.openChangeReason),modal:H(e=>e.modal),focusManagerModal:H(e=>e.focusManagerModal),stickIfOpen:H(e=>e.stickIfOpen),titleElementId:H(e=>e.titleElementId),descriptionElementId:H(e=>e.descriptionElementId),openOnHover:H(e=>e.openOnHover),closeDelay:H(e=>e.closeDelay),hasViewport:H(e=>e.hasViewport)},vr=class e extends M{constructor(e,n,r=!1){let i={...gr(),...e},a=new Se;i.open&&(e==null?void 0:e.mounted)===void 0&&(i.mounted=!0),i.floatingRootContext=Ie(a,n,r),super(i,{popupRef:Y.createRef(),backdropRef:Y.createRef(),internalBackdropRef:Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:Y.createRef(),beforeContentFocusGuardRef:Y.createRef(),stickIfOpenTimeout:new U,triggerElements:a},_r),t(this,`setOpen`,(e,t)=>{var n,r;let i=t.reason===q,a=t.reason===`trigger-press`&&t.event.detail===0,o=!e&&(t.reason===`escape-key`||t.reason==null),s=we(t),c=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select(`activeTriggerElement`)??void 0),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n={open:e,openChangeReason:t.reason};se(n,e,t.trigger,s()),this.update(n)};i?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),zt.flushSync(l)):l(),a||o?this.set(`instantType`,a?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)}),t(this,`disposeEffect`,()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(t,n){let{store:r,internalStore:i}=Ee(t,(t,r)=>new e(n,t,r));return Y.useEffect(()=>i==null?void 0:i.disposeEffect(),[i]),r}};function yr({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=vr.useStore(s==null?void 0:s.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});me(u,n,r,l),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`),m=N()!=null;u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),re(u,d),_e(u);let{forceUnmount:h}=ue(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o,nested:m}),Y.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=Y.useCallback(()=>{u.setOpen(!1,K(fe))},[u]);Y.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,v=Y.useMemo(()=>({store:u}),[u]);return(0,J.jsxs)(mr.Provider,{value:v,children:[_&&(0,J.jsx)(xr,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function br(e){return hr(!0)?(0,J.jsx)(yr,{props:e}):(0,J.jsx)(D,{children:(0,J.jsx)(yr,{props:e})})}function xr({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=j(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference??m,a=r.trigger??m,o=Y.useMemo(()=>f(ie,r.floating),[r.floating]);return le(e,{activeTriggerProps:i,inactiveTriggerProps:a,popupProps:o}),null}var Sr=Y.createContext(void 0);function Cr(){let e=Y.useContext(Sr);if(e===void 0)throw Error(h(45));return e}var wr=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hr();return i.useState(`mounted`)||n?(0,J.jsx)(Sr.Provider,{value:n,children:(0,J.jsx)(I,{ref:t,...r})}):null}),Tr=(0,Y.createContext)(null);function Er(){let e=(0,Y.useContext)(Tr);if(!e)throw Error(`usePortalContainer must be used inside PortalRoot.`);return e}function Dr({container:e,children:t}){return(0,J.jsx)(Tr.Provider,{value:e,children:(0,J.jsx)(br,{children:(0,J.jsx)(wr,{container:e,className:`nexus-chat-portal-layer contents`,keepMounted:!0,children:t})})})}function Or({kind:e}){switch(e){case`business-view`:return(0,J.jsx)(Ke,{"aria-hidden":`true`});case`insight`:return(0,J.jsx)(He,{"aria-hidden":`true`});case`file`:return(0,J.jsx)(Xe,{"aria-hidden":`true`});case`knowledge-store`:return(0,J.jsx)(Qe,{"aria-hidden":`true`});case`ai-container`:return(0,J.jsx)(Be,{"aria-hidden":`true`})}}var kr={"ai-container":`source.kind.aiContainer`,"business-view":`source.kind.businessView`,document:`source.kind.document`,file:`source.kind.file`,insight:`source.kind.insight`,"knowledge-store":`source.kind.knowledgeStore`},Ar=2e4;function jr(e,t){return t||e.length<=2e4?{text:e,hidden:0}:{text:e.slice(0,Ar),hidden:e.length-Ar}}var Mr={"ai-container":`AI`,"business-view":`TBL`,document:`DOC`,file:`FILE`,insight:`INS`,"knowledge-store":`KB`};function Nr(e,t){var n;let r=t&&((n=/\.([a-z0-9]{1,4})$/i.exec(t))==null?void 0:n[1]);return r?r.toUpperCase():Mr[e]}function Pr(e){let t=e.replace(/[_-]+/g,` `).trim();return t.charAt(0).toUpperCase()+t.slice(1)}function Fr(e,t){let n=e.toLowerCase()===`score`?Number(t):NaN;return Number.isFinite(n)?n.toFixed(2):String(t)}var Ir=new Set([`type`,`insight_guid`,`dashboard_guid`,`layout_guid`]);function Lr(e,t){return Object.entries(e).flatMap(([e,n])=>!Ir.has(e)&&[`string`,`number`,`boolean`].includes(typeof n)&&String(n)!==``&&!t.includes(String(n))?[{key:Pr(e),value:Fr(e,n)}]:[])}function Rr(e){return e.data&&typeof e.data==`object`&&!Array.isArray(e.data)?e.data:e}function $(e){return typeof e==`string`&&e?e:void 0}function zr(e){var t;let n=(t=$(e.type))==null?void 0:t.toLowerCase().replace(/_/g,`-`);if(n){if(n.includes(`business`))return`business-view`;if(n.includes(`insight`))return`insight`;if(n.includes(`file`))return`file`;if(n.includes(`container`))return`ai-container`;if(n.includes(`space`)||n.includes(`knowledge`))return`knowledge-store`}let r=Rr(e);return $(r.insight_title)||$(r.insight_guid)||$(r.insight_reserved_name)?`insight`:$(r.file_name)||$(r.filename)?`file`:$(r.ai_container_name)?`ai-container`:$(r.space_name)||$(r.space_id)?`knowledge-store`:$(r.schema_name)&&$(r.table_name)?`business-view`:`document`}function Br(e){let t=Rr(e),n=$(t.insight_guid),r=$(t.dashboard_guid),i=$(t.layout_guid),a=i?{tabId:i}:{};if(n)return{type:`open-insight`,insightId:n,...r?{dashboardId:r}:{},...a};if(r)return{type:`open-dashboard`,dashboardId:r,...a}}function Vr(e,t){var n;if(!e||typeof e!=`object`||Array.isArray(e))return[];let r=(n=Object.entries(e).find(([e])=>e.toLowerCase()===t))==null?void 0:n[1];return Array.isArray(r)?r.filter(e=>!!e&&typeof e==`object`):[]}function Hr(e,t){let n=Rr(e),r=$(n.schema_name),i=$(n.table_name),a=$(n.file_name)??$(n.filename),o=$(n.document_id)??a??$(n.insight_title)??$(n.ai_container_name)??$(n.space_name)??$(n.dashboard_name)??$(n.title)??$(n.name)??(r&&i?`${r}.${i}`:void 0),s=$(n.text)??$(n.description),c=zr(e),l=Br(e);return{kind:c,label:o??``,...t?{tag:Nr(c,a??$(n.document_id))}:{},...s?{excerpt:s}:{},fields:Lr(n,[o??``,s??``]),...l?{intent:l}:{}}}function Ur(e){var t;return((t=e.metadata)==null?void 0:t.source)===`task.used_datasets`}function Wr(e){if(!(`content`in e))return null;let t=Ur(e),n=[...(t?[]:Vr(e.content,`sources`)).map(e=>Hr(e,!0)),...Vr(e.content,t?`sources`:`datasets`).map(e=>Hr(e,!1))];return n.length>0?n:null}var Gr=4;function Kr({source:e,size:t}){return(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`nexus-chat-source-tile`,"data-size":t,"data-tag":e.tag,children:e.tag??(0,J.jsx)(Or,{kind:e.kind===`document`?`file`:e.kind})})}var qr=(0,Y.createContext)(null);function Jr({artifact:e,children:t}){let n=at(),r=(0,Y.useMemo)(()=>{var t;let r=e&&!Ur(e)?((t=Wr(e))==null?void 0:t.length)??0:0;return e&&r>0?{count:r,open:t=>n.openSources(e.id,t)}:null},[n,e]);return(0,J.jsx)(qr,{value:r,children:t})}function Yr({index:e,children:t}){let n=(0,Y.useContext)(qr),r=x();return!n||e<1||e>n.count?(0,J.jsx)(`code`,{children:t}):(0,J.jsx)(`button`,{"aria-label":r(`source.cite`,{index:e}),className:`nexus-chat-citation-marker`,onClick:()=>n.open(e-1),type:`button`,children:e})}function Xr({sources:e}){let t=x();return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`nexus-chat-sources-pill__stack`,children:e.slice(0,Gr).map((e,t)=>(0,J.jsx)(Kr,{source:e},`${e.label}-${t}`))}),t(`source.count`,{count:e.length})]})}function Zr({artifact:e}){let t=at(),n=Wr(e);return n?Ur(e)?(0,J.jsx)(Qr,{sources:n},e.id):(0,J.jsx)(`button`,{className:`nexus-chat-sources-pill`,onClick:()=>t.openSources(e.id,null),type:`button`,children:(0,J.jsx)(Xr,{sources:n})}):(0,J.jsx)(b,{artifact:e})}function Qr({sources:e}){var t;let n=x(),[r,i]=(0,Y.useState)(0),[a,o]=(0,Y.useState)(!1),s=(0,Y.useRef)(null),c=Er(),l=e[Math.min(r,e.length-1)],u=e.length>1,d=(t=l.fields.find(e=>e.key===`Score`))==null?void 0:t.value,f=t=>i(n=>(n+t+e.length)%e.length);return(0,Y.useEffect)(()=>{if(!a)return;let e=s.current;if(!e)return;let t=e.closest(`.nexus-chat-thread__viewport`),n=()=>o(!1);t==null||t.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`resize`,n,{passive:!0});let r=typeof IntersectionObserver>`u`?null:new IntersectionObserver(([e])=>{e!=null&&e.isIntersecting||n()},{root:t});return r==null||r.observe(e),()=>{t==null||t.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),r==null||r.disconnect()}},[a]),(0,J.jsxs)(tr,{onOpenChange:o,open:a,children:[(0,J.jsx)(ar,{closeDelay:150,delay:250,onClick:()=>o(!0),render:(0,J.jsx)(`button`,{"aria-expanded":a,className:`nexus-chat-sources-pill`,ref:s,type:`button`}),children:(0,J.jsx)(Xr,{sources:e})}),(0,J.jsx)(ir,{container:c,children:(0,J.jsx)(cr,{align:`start`,className:`nexus-chat-citation-positioner`,collisionAvoidance:{align:`shift`,side:`flip`},positionMethod:`fixed`,side:`top`,sideOffset:8,children:(0,J.jsxs)(ur,{className:`nexus-chat-citation`,children:[(0,J.jsxs)(`div`,{className:`nexus-chat-citation__nav`,children:[u?(0,J.jsx)(_,{"aria-label":n(`source.previous`),onClick:()=>f(-1),size:`icon-xs`,type:`button`,variant:`ghost`,children:(0,J.jsx)(y,{"aria-hidden":`true`})}):null,(0,J.jsx)(`span`,{"aria-live":`polite`,className:`nexus-chat-citation__position`,children:n(`source.position`,{index:r+1,total:e.length})}),u?(0,J.jsx)(_,{"aria-label":n(`source.next`),onClick:()=>f(1),size:`icon-xs`,type:`button`,variant:`ghost`,children:(0,J.jsx)(v,{"aria-hidden":`true`})}):null]}),(0,J.jsxs)(`div`,{className:`nexus-chat-citation__source`,children:[(0,J.jsx)(Kr,{source:l}),(0,J.jsxs)(`span`,{className:`nexus-chat-citation__heading`,children:[(0,J.jsx)(`span`,{className:`nexus-chat-citation__name`,title:l.label,children:l.label||n(`source.untitled`)}),(0,J.jsx)(`span`,{className:`nexus-chat-citation__kind`,children:n(kr[l.kind])})]}),d?(0,J.jsx)(pr,{variant:`outline`,children:d}):null]}),l.excerpt?(0,J.jsx)(`p`,{className:`nexus-chat-citation__excerpt`,children:l.excerpt}):null]})})})]})}export{An as A,st as B,Vn as C,In as D,Ln as E,Jt as F,Je as G,it as H,Vt as I,Ke as K,Rt as L,kn as M,En as N,zn as O,On as P,Mt as R,Gn as S,Rn as T,nt as U,rt as V,Xe as W,dr as _,kr as a,Hn as b,jr as c,Er as d,wr as f,pr as g,hr as h,Zr as i,Dn as j,Fn as k,Or as l,br as m,Jr as n,Ar as o,Cr as p,We as q,Kr as r,Wr as s,Yr as t,Dr as u,qn as v,Bn as w,Wn as x,Kn as y,at as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{t as r}from"./button-CO0tH6F2.js";import{A as i,B as a,G as o,a as s,b as c,c as l,o as u,q as d,r as f,s as p,z as m}from"./SourceCitations-DvApeC9N.js";import{n as h,r as g,t as _}from"./UnsupportedArtifact-CeOCu_J6.js";import{r as v}from"./I18nContext-BlQKoDmv.js";import{r as y}from"./HostBridgeProvider-BV-UGU3Q.js";var b=e(t(),1),x=n(),S=e=>{var t;return((t=e.sessionsById[e.activeSessionId])==null?void 0:t.canvas.sourceIndex)??null};function C({artifact:e}){let t=v(),n=m(),o=p(e),s=a(S),c=(0,b.useRef)(null),l=e=>t=>{!t||c.current!==e||(c.current=null,t.focus())};if(!o)return(0,x.jsx)(_,{artifact:e});let u=s===null?null:Math.min(s,o.length-1);if(u===null)return(0,x.jsx)(`ol`,{"aria-label":t(`source.title`),className:`nexus-chat-sources`,children:o.map((e,r)=>(0,x.jsx)(`li`,{children:(0,x.jsxs)(`button`,{className:`nexus-chat-sources__row`,onClick:()=>{c.current=`back`,n.showSource(r)},ref:l(r),type:`button`,children:[(0,x.jsx)(`span`,{className:`nexus-chat-sources__index`,children:r+1}),(0,x.jsx)(f,{source:e}),(0,x.jsxs)(`span`,{className:`nexus-chat-sources__body`,children:[(0,x.jsx)(`span`,{className:`nexus-chat-sources__title`,children:e.label||t(`source.untitled`)}),e.excerpt?(0,x.jsx)(`span`,{className:`nexus-chat-sources__snippet`,children:e.excerpt}):null,e.fields.length>0?(0,x.jsx)(`span`,{className:`nexus-chat-sources__meta`,children:e.fields.slice(0,3).map(e=>`${e.key} ${e.value}`).join(` · `)}):null]})]})},`${e.label}-${r}`))});let d=e=>n.showSource((u+e+o.length)%o.length);return(0,x.jsxs)(`div`,{className:`nexus-chat-source`,children:[(0,x.jsxs)(`div`,{className:`nexus-chat-source__nav`,children:[(0,x.jsxs)(r,{onClick:()=>{c.current=u,n.showSource(null)},ref:l(`back`),size:`sm`,type:`button`,variant:`ghost`,children:[(0,x.jsx)(g,{"aria-hidden":`true`}),t(`source.title`)]}),(0,x.jsx)(`span`,{"aria-live":`polite`,className:`nexus-chat-source__position`,children:t(`source.position`,{index:u+1,total:o.length})}),o.length>1?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i,{label:t(`source.previous`),onClick:()=>d(-1),children:(0,x.jsx)(g,{"aria-hidden":`true`})}),(0,x.jsx)(i,{label:t(`source.next`),onClick:()=>d(1),children:(0,x.jsx)(h,{"aria-hidden":`true`})})]}):null]}),(0,x.jsx)(w,{source:o[u]},`${e.id}:${u}`)]})}function w({source:e}){let t=v(),[n,a]=(0,b.useState)(!1),o=e.excerpt?l(e.excerpt,n):null;return(0,x.jsxs)(`article`,{className:`nexus-chat-source__detail`,children:[(0,x.jsxs)(`header`,{className:`nexus-chat-source__header`,children:[(0,x.jsx)(f,{size:`lg`,source:e}),(0,x.jsxs)(`div`,{className:`nexus-chat-source__heading`,children:[(0,x.jsx)(`h3`,{children:e.label||t(`source.untitled`)}),(0,x.jsx)(`p`,{children:t(s[e.kind])})]}),(0,x.jsxs)(`div`,{className:`nexus-chat-source__actions`,children:[e.excerpt?(0,x.jsx)(i,{label:t(`source.copy`),onClick:()=>{var t;(t=navigator.clipboard)==null||t.writeText(e.excerpt).catch(()=>void 0)},children:(0,x.jsx)(d,{"aria-hidden":`true`})}):null,e.intent?(0,x.jsx)(T,{intent:e.intent}):null]})]}),e.fields.length>0?(0,x.jsx)(`dl`,{className:`nexus-chat-source__fields`,children:e.fields.map((e,t)=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:e.key}),(0,x.jsx)(`dd`,{children:e.value})]},`${e.key}-${t}`))}):null,o?(0,x.jsxs)(`section`,{className:`nexus-chat-source__content`,children:[(0,x.jsx)(`h4`,{children:t(`source.content`)}),(0,x.jsx)(`p`,{children:o.text}),o.hidden>0?(0,x.jsxs)(`p`,{className:`nexus-chat-source__footnote`,children:[t(`source.preview`,{shown:u,total:e.excerpt.length}),(0,x.jsx)(r,{onClick:()=>a(!0),size:`sm`,type:`button`,variant:`link`,children:t(`source.showAll`)})]}):null]}):null]})}function T({intent:e}){var t;let n=(t=y().actions)==null?void 0:t.open,r=v();return!n||!c(n,e)?null:(0,x.jsx)(i,{label:r(`source.open`),onClick:()=>void n.run(e),children:(0,x.jsx)(o,{"aria-hidden":`true`})})}export{C as SourcesArtifactRenderer};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DE3RlOCf.js";import{n as t}from"./createLucideIcon-D1A0JYKN.js";import{t as n}from"./UnsupportedArtifact-CeOCu_J6.js";import{r}from"./I18nContext-BlQKoDmv.js";import{t as i}from"./PreviewState-VcIZyCXJ.js";var a=e();function o({className:e,...n}){return(0,a.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,a.jsx)(`table`,{"data-slot":`table`,className:t(`w-full caption-bottom text-sm`,e),...n})})}function s({className:e,...n}){return(0,a.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...n})}function c({className:e,...n}){return(0,a.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...n})}function l({className:e,...n}){return(0,a.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...n})}function u({className:e,...n}){return(0,a.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground has-[[role=checkbox]]:pr-0`,e),...n})}function d({className:e,...n}){return(0,a.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-2 align-middle whitespace-nowrap has-[[role=checkbox]]:pr-0`,e),...n})}function f(e,t){var n,r;if(!e||typeof e!=`object`)return null;if(Array.isArray(e)){let n=e[0];if(n&&typeof n==`object`&&!Array.isArray(n)){let t=Object.keys(n);return{headers:t,rows:e.map(e=>t.map(t=>e[t]))}}if(Array.isArray(n))return{headers:n.map((e,n)=>t(`table.column`,{index:n+1})),rows:e}}let i=e;if(!Array.isArray(i.data))return null;let a=i.data,o=((n=a[0])==null?void 0:n.length)??((r=i.metadata)==null||(r=r.labels)==null?void 0:r.length)??0;return{headers:Array.from({length:o},(e,n)=>{var r;return((r=i.metadata)==null||(r=r.labels)==null||(r=r[n])==null?void 0:r.label)??t(`table.column`,{index:n+1})}),rows:a.map(e=>e.map(e=>e&&typeof e==`object`&&`value`in e?e.value:e))}}var p=/^[\s\p{Cc}]*[=+\-@\t\r]/u;function m(e){let t=e==null?``:typeof e==`object`?JSON.stringify(e):String(e),n=typeof e==`string`&&p.test(t)?`'${t}`:t;return/[",\r\n]/.test(n)?`"${n.replaceAll(`"`,`""`)}"`:n}function h(e){return[e.headers,...e.rows].map(e=>e.map(m).join(`,`)).join(`\r
|
|
2
|
-
`)}function g(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function _({artifact:e}){let t=r(),p=`content`in e?f(e.content,t):null;return e.content==null||Array.isArray(e.content)&&e.content.length===0?(0,a.jsx)(i,{}):p?p.rows.length===0?(0,a.jsx)(i,{}):(0,a.jsx)(`div`,{className:`nexus-chat-table-artifact`,tabIndex:0,children:(0,a.jsxs)(o,{children:[(0,a.jsx)(s,{children:(0,a.jsx)(l,{children:p.headers.map((e,t)=>(0,a.jsx)(u,{children:e},`${e}-${t}`))})}),(0,a.jsx)(c,{children:p.rows.map((e,t)=>(0,a.jsx)(l,{children:e.map((e,t)=>(0,a.jsx)(d,{children:g(e)},t))},t))})]})}):(0,a.jsx)(n,{artifact:e})}export{c as a,s as c,o as i,l,f as n,d as o,h as r,u as s,_ as t};
|