@overmap-ai/blocks 0.0.9-alpha.3 → 0.0.9-alpha.5

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.
@@ -1,6 +1,6 @@
1
- (function(a,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("@radix-ui/themes/styles.css"),require("@radix-ui/colors"),require("@radix-ui/react-icons"),require("@radix-ui/themes"),require("react/jsx-runtime"),require("react"),require("react-responsive"),require("@radix-ui/react-dialog"),require("re-resizable"),require("@radix-ui/react-dismissable-layer"),require("react-transition-group"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-toast")):typeof define=="function"&&define.amd?define(["exports","@radix-ui/themes/styles.css","@radix-ui/colors","@radix-ui/react-icons","@radix-ui/themes","react/jsx-runtime","react","react-responsive","@radix-ui/react-dialog","re-resizable","@radix-ui/react-dismissable-layer","react-transition-group","@radix-ui/react-toggle-group","@radix-ui/react-toolbar","@radix-ui/react-toast"],G):(a=typeof globalThis<"u"?globalThis:a||self,G(a.blocks={},null,a.colors,a.reactIcons,a.themes,a.jsxRuntime,a.React,a.reactResponsive,a.RadixDialogPrimitive,a.reResizable,a.reactDismissableLayer,a.reactTransitionGroup,a.reactToggleGroup,a.reactToolbar,a.RadixToast))})(this,function(a,G,de,M,n,e,t,W,ze,V,ke,ee,ue,Ae,te){"use strict";function fe(i){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const l in i)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(i,l);Object.defineProperty(s,l,r.get?r:{enumerable:!0,get:()=>i[l]})}}return s.default=i,Object.freeze(s)}const q=fe(ze),F=fe(te);function Me(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var pe={exports:{}};/*!
1
+ (function(h,X){typeof exports=="object"&&typeof module<"u"?X(exports,require("@radix-ui/themes/styles.css"),require("@radix-ui/colors"),require("@radix-ui/react-icons"),require("@radix-ui/themes"),require("react/jsx-runtime"),require("react"),require("react-responsive"),require("@radix-ui/react-dialog"),require("re-resizable"),require("@radix-ui/react-dismissable-layer"),require("react-transition-group"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-toast"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","@radix-ui/themes/styles.css","@radix-ui/colors","@radix-ui/react-icons","@radix-ui/themes","react/jsx-runtime","react","react-responsive","@radix-ui/react-dialog","re-resizable","@radix-ui/react-dismissable-layer","react-transition-group","@radix-ui/react-toggle-group","@radix-ui/react-toolbar","@radix-ui/react-toast","react-dom"],X):(h=typeof globalThis<"u"?globalThis:h||self,X(h.blocks={},null,h.colors,h.reactIcons,h.themes,h.jsxRuntime,h.React,h.reactResponsive,h.RadixDialogPrimitive,h.reResizable,h.reactDismissableLayer,h.reactTransitionGroup,h.reactToggleGroup,h.reactToolbar,h.RadixToast,h.reactDom))})(this,function(h,X,Ce,D,a,s,n,V,Ye,Q,Ze,ie,ve,Je,se,Re){"use strict";function me(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,t.get?t:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Y=me(Ye),G=me(se);function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ye={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */(function(i){(function(){var s={}.hasOwnProperty;function l(){for(var r=[],c=0;c<arguments.length;c++){var o=arguments[c];if(o){var u=typeof o;if(u==="string"||u==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var d=l.apply(null,o);d&&r.push(d)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var p in o)s.call(o,p)&&o[p]&&r.push(p)}}}return r.join(" ")}i.exports?(l.default=l,i.exports=l):window.classNames=l})()})(pe);var $e=pe.exports;const m=Me($e);function $(i,s){return t.useMemo(()=>{if(i!==void 0)if(typeof i=="object"){if(!("initial"in i))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(i).map(([l,r])=>[l,s[r]]))}else return s[i]},[s,i])}const je={success:"green",danger:"red",info:"gray"},P=i=>{const s=n.useThemeContext();if(i)return i==="primary"?s.accentColor:je[i]},Ie=()=>{const[i,s]=t.useState("initial"),[l,r]=t.useState("initial"),c=W.useMediaQuery({minWidth:"520px"}),o=W.useMediaQuery({minWidth:"768px"}),u=W.useMediaQuery({minWidth:"1024px"}),d=W.useMediaQuery({minWidth:"1280px"}),p=W.useMediaQuery({minWidth:"1640px"});return t.useLayoutEffect(()=>{r(f=>(s(f),p?"xl":d?"lg":u?"md":o?"sm":c?"xs":"initial"))},[d,u,o,p,c]),{size:l,prevSize:i,xs:c,sm:o,md:u,lg:d,xl:p}},Ne=t.forwardRef(function({className:s,severity:l="primary",color:r,children:c,...o},u){const d=P(l);return e.jsx(n.Badge,{className:m("overmap-badge",s),ref:u,color:r||d,...o,children:c})}),Ee=t.memo(Ne),H={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},ge={spin90Clockwise:H.hoverSpin90Clockwise,spin180Clockwise:H.hoverSpin180Clockwise,spin360Clockwise:H.hoverSpin360Clockwise},Be={role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.currentTarget.click()}},N={small:"1",medium:"2",large:"3"},he=t.createContext({}),ne=()=>t.useContext(he),Le=t.forwardRef(function(s,l){const r=ne(),{className:c,type:o="button",fluid:u=r.fluid??!1,size:d=r.size??"medium",severity:p=r.severity??"primary",hoverEffects:f=r.hoverEffects??[],variant:h=r.variant,...C}=s,b=P(p),v=f.map(g=>ge[g]);return e.jsx(n.Button,{ref:l,type:o,className:m(c,v,{[H.fluid]:u}),color:b,size:$(d,N),variant:h,...C})}),Q=t.memo(Le),We=t.forwardRef(function(s,l){const r=ne(),{className:c,children:o,type:u="button",fluid:d=r.fluid??!1,size:p=r.size??"medium",severity:f=r.severity??"primary",hoverEffects:h=r.hoverEffects??[],variant:C=r.variant,...b}=s,v=P(f),g=(h==null?void 0:h.map(_=>ge[_]))||[];return e.jsx(n.IconButton,{className:m(c,g,{[H.fluid]:d}),ref:l,color:v,size:$(p,N),variant:C,type:u,...b,children:o})}),re=t.memo(We),Fe={merged:"_merged_wdgxo_1"},He={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},Ge=t.forwardRef(function({className:s,merged:l=!1,children:r,gap:c,direction:o="row",severity:u,size:d="medium",variant:p,hoverEffects:f,fluid:h,...C},b){const v=$(d,He[o]),g=p==="ghost"?v:"0";return e.jsx(n.Flex,{className:m("overmap-button-group",s,{[Fe.merged]:l}),ref:b,gap:l?c??g:c??"2",direction:o,"data-direction":o,...C,children:e.jsx(he.Provider,{value:{size:d,severity:u,variant:p,hoverEffects:f,fluid:h},children:r})})}),oe=t.memo(Ge),Ve={separators:"_separators_1f7v1_1"},qe=t.memo(t.forwardRef((i,s)=>{const{children:l,border:r,before:c,after:o,size:u}=i,d=r?"surface":"ghost",p=$(u,N),f=c&&o?e.jsx(n.Inset,{side:"x",pt:"current",pb:"current",children:l}):c?e.jsx(n.Inset,{side:"bottom",pt:"current",children:l}):o?e.jsx(n.Inset,{side:"top",pb:"current",children:l}):e.jsx(n.Inset,{children:l}),h=e.jsxs(n.Card,{ref:s,size:p,variant:d,children:[c,f,o]});return d==="ghost"?e.jsx(n.Box,{p:"3",children:h}):h})),Qe=t.memo(t.forwardRef((i,s)=>{const{children:l,variant:r="outline",size:c,className:o,...u}=i,d=r==="outline"||r==="surface",p=r==="outline"?"ghost":r==="surface"?"soft":r;return e.jsx(qe,{...u,border:d,size:c,children:e.jsx(oe,{size:c,severity:"info",variant:p,className:m(o,Ve.separators),merged:!0,gap:"0",direction:"column",ref:s,children:l})})})),Ue=t.memo(t.forwardRef((i,s)=>{const{variant:l}=ne(),r=e.jsx(Q,{ref:s,...i,radius:"large",variant:l});return l==="ghost"?e.jsx(n.Box,{asChild:!0,my:"1",mx:"2",children:r}):r})),Xe={Root:Qe,Item:Ue},Ke=t.memo(function(s){const{title:l,description:r,content:c,closeDialog:o}=s;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{justify:"between",children:[e.jsx(n.Dialog.Title,{mb:"0",children:l}),e.jsx(n.Dialog.Close,{children:e.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:e.jsx(M.Cross1Icon,{})})})]}),r&&e.jsx(n.Dialog.Description,{children:r})]}),c(o)]})}),Ye=t.memo(t.forwardRef((i,s)=>{const{children:l,content:r,title:c,description:o,onOpen:u,defaultOpen:d,onCloseInterrupt:p,...f}=i,[h,C]=t.useState(d??!1),b=t.useCallback(g=>{if(g&&u)u();else if(!g&&p)return p(()=>C(!1));C(g)},[u,p]),v=t.useCallback(g=>{if(g!=null&&g.force)return C(!1);b(!1)},[b]);return e.jsxs(n.Dialog.Root,{open:h,onOpenChange:b,children:[e.jsx(n.Dialog.Trigger,{children:l}),e.jsx(n.Dialog.Content,{ref:s,...f,children:e.jsx(Ke,{closeDialog:v,content:r,title:c,description:o})})]})})),Ce=i=>e.jsx(n.AlertDialog.Title,{mb:"0",...i}),Je=i=>{const{title:s,description:l,actionText:r="Confirm",cancelText:c="Cancel",onAction:o,onCancel:u,severity:d}=i;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsx(Ce,{children:s}),e.jsx(n.AlertDialog.Description,{children:l})]}),e.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[e.jsx(n.AlertDialog.Cancel,{children:e.jsx(Q,{variant:"soft",severity:"info",onClick:u,children:c})}),e.jsx(n.AlertDialog.Action,{children:e.jsx(Q,{variant:"solid",severity:d,onClick:o,children:r})})]})]})},be=t.memo(function(s){const{open:l,setOpen:r,children:c,...o}=s,u=t.useMemo(()=>({close:()=>r(!1),Title:Ce,Description:n.AlertDialog.Description}),[r]);return e.jsxs(n.AlertDialog.Root,{open:l,onOpenChange:r,children:[e.jsx(n.AlertDialog.Content,{children:"content"in o?o.content(u):e.jsx(Je,{...o})}),c]})}),ie=t.createContext(()=>{throw new Error("No AlertDialogProvider found")}),Ze={content:()=>null},Re=t.memo(function({children:s}){const[l,r]=t.useState(!1),[c,o]=t.useState(Ze),u=t.useCallback(d=>{if(l)throw new Error("AlertDialog is already open");o(d),r(!0)},[l]);return e.jsx(be,{open:l,setOpen:r,...c,children:e.jsx(ie.Provider,{value:u,children:s})})}),ve=()=>t.useContext(ie),et=()=>{const i=ve();return t.useCallback(s=>i({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:s.onDiscard,onCancel:s.onCancel}),[i])},le={zeroMinWidth:"_zeroMinWidth_curjh_1",zeroMinHeight:"_zeroMinHeight_curjh_5",radius:"_radius_curjh_9"},U=t.memo(t.forwardRef(({className:i,radius:s=!1,children:l,zeroMinWidth:r=!1,zeroMinHeight:c=!1,...o},u)=>e.jsx(n.Flex,{className:m(i,{[le.radius]:s,[le.zeroMinWidth]:r,[le.zeroMinHeight]:c}),ref:u,...o,children:l}))),tt=t.memo(function({severity:s,itemContent:l,closeOnSelect:r=!0,onSelect:c,...o}){const u=P(s),d=t.useCallback(p=>{r||p.preventDefault(),c&&c(p)},[r,c]);return e.jsx(n.DropdownMenu.Item,{onSelect:d,color:u,...o,children:l})}),nt=t.memo(function({defaultOpen:s,open:l,onOpenChange:r,modal:c,trigger:o,label:u,severity:d="info",children:p,...f}){const h=P(d);return e.jsxs(n.DropdownMenu.Root,{defaultOpen:s,open:l,onOpenChange:r,modal:c,children:[e.jsx(n.DropdownMenu.Trigger,{children:o}),e.jsxs(n.DropdownMenu.Content,{color:h,...f,children:[u&&e.jsx(n.DropdownMenu.Label,{children:u}),p]})]})}),rt=t.memo(function({separatorBelow:s=!1,separatorAbove:l=!1,children:r,...c}){return e.jsxs(e.Fragment,{children:[l&&e.jsx(n.DropdownMenu.Separator,{}),e.jsx(n.DropdownMenu.Group,{...c,children:r}),s&&e.jsx(n.DropdownMenu.Separator,{})]})}),ot=t.memo(function({defaultOpen:s,open:l,onOpenChange:r,trigger:c,children:o,...u}){return e.jsxs(n.DropdownMenu.Sub,{defaultOpen:s,open:l,onOpenChange:r,children:[e.jsx(n.DropdownMenu.SubTrigger,{children:c}),e.jsx(n.DropdownMenu.SubContent,{...u,children:o})]})}),it={Root:nt,ItemGroup:rt,Item:tt,SubMenu:ot},lt=t.memo(function({children:s}){const[l,r]=t.useState(!1),c=t.useCallback(()=>{r(!0)},[]),o=t.useCallback(()=>{r(!1)},[]);return s({isHovered:l,onPointerEnter:c,onPointerLeave:o})}),_e={fluid:"_fluid_7n1wr_1"},at=t.forwardRef(function({className:s,fluid:l,size:r="medium",variant:c="surface",severity:o="primary",itemSeverity:u="info",placeholder:d="Select",side:p,items:f=[],value:h,id:C,...b},v){const g=$(r,N),_=P(o),y=P(u);return t.createElement(n.Select.Root,{size:g,...b,key:h===void 0?1:0,value:h},e.jsx(n.Select.Trigger,{className:m(s,{[_e.fluid]:l}),id:C,ref:v,variant:c,placeholder:d,color:_}),e.jsx(n.Select.Content,{side:p,className:_e.contentDefault,position:"popper",variant:c!=="surface"?"soft":"solid",color:y,children:f.map(({itemContent:S,value:w,...T})=>e.jsx(n.Select.Item,{className:"overmap-select-item",value:w,...T,children:S},w))}))}),st=t.memo(at),ye=t.memo(t.forwardRef((i,s)=>{const{checked:l,label:r,value:c,size:o="2"}=i;return e.jsx(n.Box,{asChild:!0,px:o,children:e.jsx(n.Select.Item,{value:c,ref:s,children:e.jsxs(n.Flex,{gap:o,align:"center",children:[e.jsx(n.Checkbox,{checked:l}),r]})})})})),X="__select_all__",ct=t.memo(t.forwardRef((i,s)=>{const[l,r]=t.useState(!1),{placeholder:c,value:o,onValueChange:u,options:d,disabled:p,name:f,...h}=i,C=$(i.size,N),b=P(i.severity),v=t.useMemo(()=>new Map(d.map(w=>[w.value,w.label])),[d]),g=o.length>4?`${o.length} options selected`:e.jsx("span",{children:o.flatMap(w=>[v.get(w),", "]).slice(0,-1)}),_=t.useCallback(()=>r(!1),[]),y=t.useCallback(w=>{w&&r(!0)},[]),S=t.useCallback(w=>{let T;w===X?T=o.length===d.length?[]:d.map(L=>L.value):T=o.includes(w)?o.filter(I=>I!==w):[...o,w],u(T)},[u,d,o]);return t.useEffect(()=>{if(d.some(({value:w})=>w===X))throw new Error(`Cannot have an option with the value "${X}"`)},[d]),e.jsxs(n.Select.Root,{open:l,value:"",onOpenChange:y,onValueChange:S,disabled:p,size:C,name:f,autoComplete:"off",children:[e.jsx(n.Select.Trigger,{ref:s,color:b,placeholder:o.length>0?g:c,"data-placeholder":o.length>0?void 0:!0,...h}),e.jsxs(n.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:_,onPointerDownOutside:_,children:[e.jsx(ye,{value:X,label:"Select all",checked:o.length===d.length,size:C}),d.map(w=>e.jsx(ye,{...w,checked:o.includes(w.value),size:C},w.value))]})]})})),dt={default:"_default_u936h_1"},ut=t.forwardRef(function({className:s,severity:l="primary",icon:r,defaultChecked:c=!1,onCheckedChange:o,...u},d){const p=t.useRef(null),[f,h]=t.useState(u.checked?u.checked:c),[C,b]=t.useState(),v=P(l);t.useLayoutEffect(()=>{var S;const y=d||p;"current"in y&&y.current&&b((S=y.current)==null?void 0:S.querySelector("span.rt-SwitchThumb"))},[d]);const g=t.useCallback(y=>{h(y),o&&o(y)},[o]),_=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(n.Switch,{className:m("overmap-switch",s,dt.default),ref:d||p,color:v,radius:"full",defaultChecked:c,onCheckedChange:g,...u}),e.jsx(n.Portal,{container:C,asChild:!0,children:r&&"checked"in r?_?r.checked:r.unchecked:r})]})}),ft=t.memo(ut),E={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},pt={width:"auto",height:"100%"},gt=t.forwardRef(function({side:s="left",modal:l=!0,children:r,open:c,containerSelector:o,overlay:u=!0,resizable:d=!0,minWidth:p="300px",maxWidth:f="500px",...h},C){const b=s==="right",v=s==="left",[g,_]=t.useState();return t.useEffect(()=>{const y=o??'[data-is-root-theme="true"]',S=document.querySelector(y);if(S===void 0)throw new Error(`Could not find a container element using the following selector ${y}`);_(S)},[o]),e.jsx(q.Root,{open:c,modal:l,children:e.jsxs(q.Portal,{container:g,children:[u&&e.jsx(q.Overlay,{className:m(E.overlay)}),e.jsx(q.Content,{className:m("overmap-sidebar","rt-DialogContent",E.sidebarContent,{[E.left]:v,[E.right]:b}),ref:C,asChild:!0,...h,children:e.jsx(n.Box,{width:"auto",children:e.jsx(V.Resizable,{minWidth:p,maxWidth:f,defaultSize:pt,enable:{right:d&&v,left:d&&b},handleClasses:{left:E.resizeHandle,right:E.resizeHandle},handleComponent:{right:e.jsx(M.DragHandleDots2Icon,{}),left:e.jsx(M.DragHandleDots2Icon,{})},children:r})})})]})})}),ht=t.memo(gt),k={outerContent:"_outerContent_1vw5z_1",enter:"_enter_1vw5z_4",right:"_right_1vw5z_4",left:"_left_1vw5z_8",enterActive:"_enterActive_1vw5z_12",exitActive:"_exitActive_1vw5z_22",exitDone:"_exitDone_1vw5z_32",resizable:"_resizable_1vw5z_41",slideOutOverlay:"_slideOutOverlay_1vw5z_45"},Ct=200,bt=t.memo(function({className:s,open:l,side:r="left",children:c,minWidth:o,maxWidth:u,resizable:d=!0,overlay:p=!1,modal:f=!1,resizeHandle:h,position:C="absolute",...b}){const v=t.useRef(null),[g,_]=t.useState(o),y=r==="left",S=r==="right",w=t.useCallback((T,I,L,Pe)=>{_(L.clientWidth),v.current&&(v.current.style.width=`${L.clientWidth}px`)},[]);return e.jsx(ee.CSSTransition,{in:l,classNames:{enter:k.enter,enterActive:k.enterActive,exitActive:k.exitActive,exitDone:k.exitDone},timeout:Ct,nodeRef:v,unmountOnExit:!0,mountOnEnter:!0,children:e.jsxs(e.Fragment,{children:[p&&e.jsx("div",{className:k.slideOutOverlay}),e.jsx(ke.DismissableLayer,{disableOutsidePointerEvents:f,asChild:!0,...b,children:e.jsx(n.Flex,{className:m("overmap-slide-out",s,k.outerContent,{[k.left]:y,[k.right]:S}),style:{"--slide-out-width":`${g}px`},height:"100%",width:"auto",position:C,top:"0",bottom:"0",left:y?"0":void 0,right:S?"0":void 0,ref:v,children:e.jsx(V.Resizable,{className:k.resizable,defaultSize:{width:g,height:"100%"},onResize:w,enable:{right:d&&y,left:d&&S},handleComponent:{left:h,right:h},minWidth:o,maxWidth:u,children:c})})})]})})}),B={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},vt=t.forwardRef(function({className:s,leftSlot:l,rightSlot:r,size:c="medium",showInputLength:o,value:u,variant:d,severity:p="primary",...f},h){const C=$(c,N),b=P(p),v=o||o===void 0&&f.maxLength!==void 0,g=u!==void 0?u.toString():void 0;return e.jsxs(n.TextField.Root,{className:m(B.wrapper,{[B.accommodateCharCount]:v}),size:C,variant:d,color:b,children:[l&&e.jsx(n.TextField.Slot,{children:l}),e.jsx(n.TextField.Input,{className:m(B.default,s,{[B.noLeftIcon]:!l,[B.noRightIcon]:!r}),ref:h,size:C,variant:d,color:b,...f}),r&&e.jsx(n.TextField.Slot,{children:r}),v&&e.jsx(n.Text,{as:"p",className:B.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${g==null?void 0:g.length}/${f.maxLength}`:`${g==null?void 0:g.length}`})]})}),_t=t.memo(vt),yt={wrapper:"_wrapper_tmtz0_1"},wt=t.forwardRef(function({className:s,defaultOpen:l=!1,modal:r=!1,content:c,children:o,...u},d){return e.jsxs(n.Popover.Root,{defaultOpen:l,modal:r,children:[e.jsx(n.Popover.Trigger,{children:o}),e.jsx(n.Popover.Content,{ref:d,className:m("overmap-popover",s,yt.wrapper),...u,children:c(n.Popover.Close)})]})}),mt=t.memo(wt),D={wrapper:"_wrapper_1ssf2_1",panelContent:"_panelContent_1ssf2_6",left:"_left_1ssf2_14",right:"_right_1ssf2_18",resizable:"_resizable_1ssf2_23",resizeHandle:"_resizeHandle_1ssf2_28",panelMainContent:"_panelMainContent_1ssf2_48"},we=200,j=150,St=t.memo(function({children:s,showLeft:l,leftPanel:r,leftMinWidth:c=we,showRight:o,rightPanel:u,rightMinWidth:d=we,resizeable:p}){const f=t.useRef(null),h=t.useRef(null),[C,b]=t.useState(0),[v,g]=t.useState(),_=t.useRef(null),[y,S]=t.useState(0),[w,T]=t.useState(),I=t.useCallback((O,x,z)=>(A,De,xe,ce)=>{if(!f.current)return;const J=O+ce.width;z(f.current.clientWidth-J),x(()=>J)},[]),L=t.useCallback((O,x,z,A)=>I(C,b,T)(O,x,z,A),[I,C]),Pe=t.useCallback((O,x,z,A)=>I(y,S,g)(O,x,z,A),[I,y]),K=t.useCallback((O,x,z,A,De,xe,ce,J)=>{if(!f.current)return;let Z=O;if(Z===0&&(Z=x,z(Z)),xe){const R=f.current.clientWidth-Z;J(R),De>R&&(ce(R),A(f.current.clientWidth-R))}},[]),Vt=t.useCallback(()=>K(y,d,S,T,C,l,b,g),[K,C,d,y,l]),qt=t.useCallback(()=>K(C,c,b,g,y,o,S,T),[K,c,C,y,o]),Y=t.useCallback((O,x)=>{f.current&&O&&x(f.current.clientWidth)},[]),Qt=t.useCallback(()=>Y(l,g),[Y,l]),Ut=t.useCallback(()=>Y(o,T),[Y,o]),Te=t.useCallback(()=>{var O,x,z,A;f.current&&(g(f.current.clientWidth-(((O=_.current)==null?void 0:O.clientWidth)||0)),T(f.current.clientWidth-(((x=h.current)==null?void 0:x.clientWidth)||0)),b(((z=h.current)==null?void 0:z.clientWidth)||0),S(((A=_.current)==null?void 0:A.clientWidth)||0))},[]);t.useEffect(()=>{if(!f.current)return;const O=new ResizeObserver(Te);return O.observe(f.current),()=>{O.disconnect()}},[Te]);const Xt=t.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${j}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${j}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${j}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),Kt=t.useMemo(()=>({entering:{transform:`translateX(${y}px)`,marginLeft:`${-y}px`,transitionProperty:"transform, margin-left",transitionDuration:`${j}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${j}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${y}px)`,marginLeft:`${-y}px`,transitionProperty:"transform, margin-left",transitionDuration:`${j}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[y]);return e.jsxs(n.Flex,{className:D.wrapper,style:{minWidth:`${c+d}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[e.jsx(ee.Transition,{nodeRef:h,timeout:l?0:j,in:l,unmountOnExit:!0,onEntering:qt,onExited:Ut,children:O=>e.jsx(n.Box,{ref:h,className:m(D.panelContent,D.left),style:Xt[O],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(V.Resizable,{className:D.resizable,size:{width:C,height:"100%"},onResizeStop:L,enable:{right:(p==null?void 0:p.left)!==void 0?p.left:!0},minWidth:c,maxWidth:v,handleClasses:{right:m(D.resizeHandle,D.left)},handleComponent:{right:e.jsx(M.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:r})})}),e.jsx("div",{className:D.panelMainContent,children:s}),e.jsx(ee.Transition,{nodeRef:_,timeout:o?0:j,in:o,unmountOnExit:!0,onEntering:Vt,onExited:Qt,children:O=>e.jsx(n.Box,{ref:_,className:m(D.panelContent,D.right),style:Kt[O],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(V.Resizable,{className:D.resizable,size:{width:y,height:"100%"},onResizeStop:Pe,enable:{left:(p==null?void 0:p.right)!==void 0?p.right:!0},minWidth:d,maxWidth:w,handleClasses:{left:m(D.resizeHandle,D.right)},handleComponent:{left:e.jsx(M.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),Ot={charCount:"_charCount_17uut_1"},Pt=t.forwardRef(function({className:s,showInputLength:l,inputLengthTemplate:r,value:c,severity:o="primary",resize:u,...d},p){const f=P(o),h=P("info"),C=l||l===void 0&&(d.maxLength!==void 0||d.minLength!==void 0),b=c!==void 0?c.toString():"",v=t.useMemo(()=>{if(r){let g=r.replace("{current}",b.length.toString());return d.minLength!==void 0&&(g=g.replace("{min}",d.minLength.toString())),d.maxLength!==void 0&&(g=g.replace("{max}",d.maxLength.toString())),g}return b.length},[r,d.maxLength,d.minLength,b.length]);return e.jsxs(e.Fragment,{children:[e.jsx(n.TextArea,{className:m("overmap-textarea",s),style:{resize:u},ref:p,value:c,color:f,...d}),C&&e.jsx(n.Text,{as:"p",className:Ot.charCount,color:h,align:"right",children:v})]})}),Tt=t.memo(Pt),Dt=t.forwardRef(function({loop:s,type:l,rovingFocus:r,value:c,onValueChange:o,defaultValue:u,disabled:d,items:p,className:f,direction:h="row",...C},b){return e.jsx(ue.Root,{type:l,className:m("overmap-toggle-group",f),ref:b,value:c,onValueChange:o,disabled:d,orientation:h==="column"?"vertical":"horizontal",loop:s,rovingFocus:r,defaultValue:u,asChild:!0,children:e.jsx(oe,{direction:h,...C,children:p.map(({children:v,...g})=>t.createElement(ue.Item,{asChild:!0,...g,key:g.value},e.jsx(re,{className:m("overmap-toggle-group-button"),"aria-label":g.value,variant:g.value===c?"solid":"soft",children:v})))})})}),xt=t.memo(Dt),zt={default:"_default_xqvoc_1"},me=t.memo(t.forwardRef(({className:i,minContentGap:s="2",children:l,...r},c)=>e.jsx(Ae.Root,{className:m(i,"overmap-toolbar",zt.default),ref:c,asChild:!0,...r,children:e.jsx(U,{grow:"1",width:"100%",height:"max-content",align:"center",gap:s,wrap:"nowrap",children:l})}))),kt=t.memo(t.forwardRef(({children:i,gap:s="2"},l)=>e.jsx(U,{ref:l,grow:"1",width:"max-content",height:"100%",align:"center",gap:s,children:i}))),At=t.memo(t.forwardRef(({children:i,gap:s},l)=>e.jsx(U,{ref:l,grow:"1",width:"max-content",direction:"row-reverse",height:"100%",align:"center",gap:s||"2",children:i}))),Mt={Root:me,LeftContent:kt,RightContent:At},ae={ToastViewport:"_ToastViewport_1i6bp_1",actionButton:"_actionButton_1i6bp_20",ToastRoot:"_ToastRoot_1i6bp_24",slideIn:"_slideIn_1i6bp_1",swipeOut:"_swipeOut_1i6bp_1"},$t=t.forwardRef(function({title:s,description:l,icon:r,severity:c="primary",size:o,onClose:u,sensitivity:d,action:p,...f},h){const[C,b]=t.useState(!0),v=P(c),g=t.useCallback(_=>{!_&&u&&u(),b(_)},[u]);return e.jsx(F.Root,{asChild:!0,ref:h,...f,open:C,type:d,onOpenChange:g,children:e.jsx(n.Callout.Root,{className:ae.ToastRoot,variant:"surface",color:v,size:o,children:e.jsxs(n.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[e.jsxs(n.Flex,{align:"center",gap:"3",children:[e.jsx(n.Callout.Icon,{children:r}),e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(F.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{size:"3",weight:"medium",children:s})}),e.jsx(F.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{children:l})})]}),p&&e.jsx(F.Action,{className:ae.actionButton,altText:p.altText,asChild:!0,children:p.content})]})]}),e.jsx(F.Close,{asChild:!0,children:e.jsx(re,{"aria-label":"Close",variant:"ghost",severity:c,children:e.jsx(M.Cross2Icon,{})})})]})})})}),Se=t.memo($t),se=t.createContext({}),jt=()=>{const i=t.useContext(se);if(!i)throw new Error("useToast must be used within a ToastProvider");return i},It=240/60,Oe=5e3,Nt=i=>{if(i.duration&&i.duration>=Oe)return i.duration;const s=i.severity==="danger"?1.5:1,l=i.description.split(" ").length+i.title.split(" ").length;return(Oe+l/It)*s};a.unsafeShowToast=void 0;const Et=t.memo(function({children:s,className:l,hotkey:r,...c}){const[o,u]=t.useState([]),d=t.useCallback((f,h,C)=>{u(b=>{const v=b.find(g=>g.id===f);return v&&h===0&&clearTimeout(v.timeout),b.filter(g=>g.id!==f)}),C&&C()},[]),p=t.useMemo(()=>{let f=0;const h=_=>{const y=Nt(_),S=f.toString();f+=1;const w=setTimeout(()=>d(S,1,_.onClose),y);u(T=>[...T,{..._,timeout:w,duration:y,id:S}])},C=_=>h({..._,severity:"primary"}),b=_=>h({..._,severity:"success"}),v=_=>h({..._,severity:"danger"}),g=_=>h({..._,severity:"info"});return a.unsafeShowToast=h,{showToast:h,showPrimary:C,showSuccess:b,showError:v,showInfo:g}},[d]);return t.useEffect(()=>()=>{for(const{timeout:f}of o)clearTimeout(f)},[]),e.jsx(se.Provider,{value:p,children:e.jsxs(te.ToastProvider,{...c,children:[s,e.jsx(te.ToastViewport,{className:m(l,ae.ToastViewport),hotkey:r}),o.map(({id:f,onClose:h,...C})=>e.jsx(Se,{...C,onClose:()=>d(f,0,h)},f))]})})}),Bt={noWrap:"_noWrap_1wpa5_1"},Lt=t.memo(t.forwardRef(({className:i,noWrap:s,severity:l,as:r,...c},o)=>{const u=P(l);return e.jsx(n.Text,{ref:o,as:r,className:m(i,{[Bt.noWrap]:s}),color:u,...c})})),Hn="",Wt=t.memo(t.forwardRef((i,s)=>{const{panelBackground:l="solid",radius:r="full",...c}=i;return e.jsx(n.Theme,{panelBackground:l,radius:r,ref:s,...c})})),Ft={1:"max-content",2:"max-content",3:"max-content",4:"100%"},Ht=t.forwardRef(function({severity:s="info",weight:l="light",gap:r="1",text:c,orientation:o="horizontal",size:u,...d},p){const f=$(u,Ft),h=P(s);return e.jsxs(n.Flex,{ref:p,width:o==="horizontal"?f:"max-content",height:o==="vertical"?f:"max-content",direction:o==="vertical"?"column":"row",align:"center",gap:r,children:[e.jsx(n.Separator,{size:u,orientation:o,color:h,...d}),c&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{as:"span",size:"1",weight:l,color:h,children:c}),e.jsx(n.Separator,{size:u,orientation:o,color:h,...d})]})]})}),Gt=t.memo(Ht);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>n.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>n.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>n.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>n.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>n.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>n.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>n.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>n.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>n.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>n.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>n.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>n.Em}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>n.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>n.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>n.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>n.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>n.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>n.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>n.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>n.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>n.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>n.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>n.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>n.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>n.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>n.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>n.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>n.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>n.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>n.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>n.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>n.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>n.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>n.useThemeContext}),a.AlertDialog=be,a.AlertDialogContent=ie,a.AlertDialogProvider=Re,a.Badge=Ee,a.Button=Q,a.ButtonGroup=oe,a.ButtonList=Xe,a.DefaultTheme=Wt,a.Dialog=Ye,a.DropdownMenu=it,a.Flex=U,a.HoverUtility=lt,a.IconButton=re,a.Input=_t,a.LeftAndRightPanels=St,a.MultiSelect=ct,a.Popover=mt,a.Root=me,a.Select=st,a.Separator=Gt,a.Sidebar=ht,a.SlideOut=bt,a.Switch=ft,a.Text=Lt,a.TextArea=Tt,a.Toast=Se,a.ToastContext=se,a.ToastProvider=Et,a.ToggleGroup=xt,a.Toolbar=Mt,a.divButtonProps=Be,a.useAlertDialog=ve,a.useDiscardAlertDialog=et,a.useSeverityColor=P,a.useToast=jt,a.useViewportSize=Ie,Object.keys(de).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&Object.defineProperty(a,i,{enumerable:!0,get:()=>de[i]})}),Object.keys(M).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&Object.defineProperty(a,i,{enumerable:!0,get:()=>M[i]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
5
+ */(function(e){(function(){var r={}.hasOwnProperty;function o(){for(var t=[],l=0;l<arguments.length;l++){var i=arguments[l];if(i){var u=typeof i;if(u==="string"||u==="number")t.push(i);else if(Array.isArray(i)){if(i.length){var c=o.apply(null,i);c&&t.push(c)}}else if(u==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){t.push(i.toString());continue}for(var f in i)r.call(i,f)&&i[f]&&t.push(f)}}}return t.join(" ")}e.exports?(o.default=o,e.exports=o):window.classNames=o})()})(ye);var nn=ye.exports;const _=en(nn);function z(e,r){return n.useMemo(()=>{if(e!==void 0)if(typeof e=="object"){if(!("initial"in e))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,r[t]]))}else return r[e]},[r,e])}const tn={success:"green",danger:"red",info:"gray"},P=e=>{const r=a.useThemeContext();if(e)return e==="primary"?r.accentColor:tn[e]},on=()=>{const[e,r]=n.useState("initial"),[o,t]=n.useState("initial"),l=V.useMediaQuery({minWidth:"520px"}),i=V.useMediaQuery({minWidth:"768px"}),u=V.useMediaQuery({minWidth:"1024px"}),c=V.useMediaQuery({minWidth:"1280px"}),f=V.useMediaQuery({minWidth:"1640px"});return n.useLayoutEffect(()=>{t(d=>(r(d),f?"xl":c?"lg":u?"md":i?"sm":l?"xs":"initial"))},[c,u,i,f,l]),{size:o,prevSize:e,xs:l,sm:i,md:u,lg:c,xl:f}},_e=(e,r,o)=>{const[t,l]=n.useState([]),[i,u]=n.useState(!0),c=n.useCallback(g=>{const{repeat:p,key:C}=g;u(!0),!(p||t.includes(C))&&l(v=>[...v,C])},[t]),f=n.useCallback(g=>{const{key:p}=g;u(!1),t.includes(p)&&l(C=>{const v=[...C];return v.splice(C.indexOf(p),1),v})},[t]);n.useEffect(()=>(r||document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0)}),[r,c]),n.useEffect(()=>(r||document.addEventListener("keyup",f,!0),()=>{document.removeEventListener("keyup",f,!0)}),[r,f]);const d=n.useMemo(()=>!r&&i&&t.length===e.length&&t.every(g=>e.includes(g)),[r,i,t,e]);return n.useEffect(()=>{d&&o()},[d,o]),d},rn=n.forwardRef(function({className:r,severity:o="primary",color:t,children:l,...i},u){const c=P(o);return s.jsx(a.Badge,{className:_("overmap-badge",r),ref:u,color:t||c,...i,children:l})}),sn=n.memo(rn),U={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},we={spin90Clockwise:U.hoverSpin90Clockwise,spin180Clockwise:U.hoverSpin180Clockwise,spin360Clockwise:U.hoverSpin360Clockwise},ln={role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.currentTarget.click()}},j={small:"1",medium:"2",large:"3"},Se=n.createContext({}),le=()=>n.useContext(Se),cn=n.forwardRef(function(r,o){const t=le(),{className:l,type:i="button",fluid:u=t.fluid??!1,size:c=t.size??"medium",severity:f=t.severity??"primary",hoverEffects:d=t.hoverEffects??[],variant:g=t.variant,shortcut:p={keys:[],action:()=>{},disabled:!1},...C}=r,v=P(f),b=d.map(y=>we[y]);return _e(p.keys,p.disabled||p.keys.length===0,p.action),s.jsx(a.Button,{ref:o,type:i,className:_(l,b,{[U.fluid]:u}),color:v,size:z(c,j),variant:g,...C})}),K=n.memo(cn),an=n.forwardRef(function(r,o){const t=le(),{className:l,children:i,type:u="button",fluid:c=t.fluid??!1,size:f=t.size??"medium",severity:d=t.severity??"primary",hoverEffects:g=t.hoverEffects??[],variant:p=t.variant,shortcut:C={keys:[],action:()=>{},disabled:!1},...v}=r,b=P(d),y=(g==null?void 0:g.map(m=>we[m]))||[];return _e(C.keys,C.disabled||C.keys.length===0,C.action),s.jsx(a.IconButton,{className:_(l,y,{[U.fluid]:c}),ref:o,color:b,size:z(f,j),variant:p,type:u,...v,children:i})}),ce=n.memo(an),un={merged:"_merged_wdgxo_1"},dn={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},fn=n.forwardRef(function({className:r,merged:o=!1,children:t,gap:l,direction:i="row",severity:u,size:c="medium",variant:f,hoverEffects:d,fluid:g,...p},C){const v=z(c,dn[i]),b=f==="ghost"?v:"0";return s.jsx(a.Flex,{className:_("overmap-button-group",r,{[un.merged]:o}),ref:C,gap:o?l??b:l??"2",direction:i,"data-direction":i,...p,children:s.jsx(Se.Provider,{value:{size:c,severity:u,variant:f,hoverEffects:d,fluid:g},children:t})})}),ae=n.memo(fn),hn={separators:"_separators_1f7v1_1"},pn=n.memo(n.forwardRef((e,r)=>{const{children:o,border:t,before:l,after:i,size:u}=e,c=t?"surface":"ghost",f=z(u,j),d=l&&i?s.jsx(a.Inset,{side:"x",pt:"current",pb:"current",children:o}):l?s.jsx(a.Inset,{side:"bottom",pt:"current",children:o}):i?s.jsx(a.Inset,{side:"top",pb:"current",children:o}):s.jsx(a.Inset,{children:o}),g=s.jsxs(a.Card,{ref:r,size:f,variant:c,children:[l,d,i]});return c==="ghost"?s.jsx(a.Box,{p:"3",children:g}):g})),gn=n.memo(n.forwardRef((e,r)=>{const{children:o,variant:t="outline",size:l,className:i,...u}=e,c=t==="outline"||t==="surface",f=t==="outline"?"ghost":t==="surface"?"soft":t;return s.jsx(pn,{...u,border:c,size:l,children:s.jsx(ae,{size:l,severity:"info",variant:f,className:_(i,hn.separators),merged:!0,gap:"0",direction:"column",ref:r,children:o})})})),bn=n.memo(n.forwardRef((e,r)=>{const{variant:o}=le(),t=s.jsx(K,{ref:r,...e,radius:"large",variant:o});return o==="ghost"?s.jsx(a.Box,{asChild:!0,my:"1",mx:"2",children:t}):t})),Cn={Root:gn,Item:bn},vn=n.memo(function(r){const{title:o,description:t,content:l,closeDialog:i}=r;return s.jsxs(a.Flex,{direction:"column",gap:"2",children:[s.jsxs(a.Flex,{direction:"column",gap:"1",children:[s.jsxs(a.Flex,{justify:"between",children:[s.jsx(a.Dialog.Title,{mb:"0",children:o}),s.jsx(a.Dialog.Close,{children:s.jsx(a.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:s.jsx(D.Cross1Icon,{})})})]}),t&&s.jsx(a.Dialog.Description,{children:t})]}),l(i)]})}),mn=n.memo(n.forwardRef((e,r)=>{const{children:o,content:t,title:l,description:i,onOpen:u,defaultOpen:c,onCloseInterrupt:f,...d}=e,[g,p]=n.useState(c??!1),C=n.useCallback(b=>{if(b&&u)u();else if(!b&&f)return f(()=>p(!1));p(b)},[u,f]),v=n.useCallback(b=>{if(b!=null&&b.force)return p(!1);C(!1)},[C]);return s.jsxs(a.Dialog.Root,{open:g,onOpenChange:C,children:[s.jsx(a.Dialog.Trigger,{children:o}),s.jsx(a.Dialog.Content,{ref:r,...d,children:s.jsx(vn,{closeDialog:v,content:t,title:l,description:i})})]})})),$e=e=>s.jsx(a.AlertDialog.Title,{mb:"0",...e}),yn=e=>{const{title:r,description:o,actionText:t="Confirm",cancelText:l="Cancel",onAction:i,onCancel:u,severity:c}=e;return s.jsxs(a.Flex,{direction:"column",gap:"2",children:[s.jsxs(a.Flex,{direction:"column",gap:"1",children:[s.jsx($e,{children:r}),s.jsx(a.AlertDialog.Description,{children:o})]}),s.jsxs(a.Flex,{gap:"3",mt:"4",justify:"end",children:[s.jsx(a.AlertDialog.Cancel,{children:s.jsx(K,{variant:"soft",severity:"info",onClick:u,children:l})}),s.jsx(a.AlertDialog.Action,{children:s.jsx(K,{variant:"solid",severity:c,onClick:i,children:t})})]})]})},xe=n.memo(function(r){const{open:o,setOpen:t,children:l,...i}=r,u=n.useMemo(()=>({close:()=>t(!1),Title:$e,Description:a.AlertDialog.Description}),[t]);return s.jsxs(a.AlertDialog.Root,{open:o,onOpenChange:t,children:[s.jsx(a.AlertDialog.Content,{children:"content"in i?i.content(u):s.jsx(yn,{...i})}),l]})}),ue=n.createContext(()=>{throw new Error("No AlertDialogProvider found")}),_n={content:()=>null},wn=n.memo(function({children:r}){const[o,t]=n.useState(!1),[l,i]=n.useState(_n),u=n.useCallback(c=>{if(o)throw new Error("AlertDialog is already open");i(c),t(!0)},[o]);return s.jsx(xe,{open:o,setOpen:t,...l,children:s.jsx(ue.Provider,{value:u,children:r})})}),Pe=()=>n.useContext(ue),Sn=()=>{const e=Pe();return n.useCallback(r=>e({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:r.onDiscard,onCancel:r.onCancel}),[e])},de={zeroMinWidth:"_zeroMinWidth_curjh_1",zeroMinHeight:"_zeroMinHeight_curjh_5",radius:"_radius_curjh_9"},Z=n.memo(n.forwardRef(({className:e,radius:r=!1,children:o,zeroMinWidth:t=!1,zeroMinHeight:l=!1,...i},u)=>s.jsx(a.Flex,{className:_(e,{[de.radius]:r,[de.zeroMinWidth]:t,[de.zeroMinHeight]:l}),ref:u,...i,children:o}))),$n=n.memo(function({severity:r,itemContent:o,closeOnSelect:t=!0,onSelect:l,...i}){const u=P(r),c=n.useCallback(f=>{t||f.preventDefault(),l&&l(f)},[t,l]);return s.jsx(a.DropdownMenu.Item,{onSelect:c,color:u,...i,children:o})}),xn=n.memo(function({defaultOpen:r,open:o,onOpenChange:t,modal:l,trigger:i,label:u,severity:c="info",children:f,...d}){const g=P(c);return s.jsxs(a.DropdownMenu.Root,{defaultOpen:r,open:o,onOpenChange:t,modal:l,children:[s.jsx(a.DropdownMenu.Trigger,{children:i}),s.jsxs(a.DropdownMenu.Content,{color:g,...d,children:[u&&s.jsx(a.DropdownMenu.Label,{children:u}),f]})]})}),Pn=n.memo(function({separatorBelow:r=!1,separatorAbove:o=!1,children:t,...l}){return s.jsxs(s.Fragment,{children:[o&&s.jsx(a.DropdownMenu.Separator,{}),s.jsx(a.DropdownMenu.Group,{...l,children:t}),r&&s.jsx(a.DropdownMenu.Separator,{})]})}),kn=n.memo(function({defaultOpen:r,open:o,onOpenChange:t,trigger:l,children:i,...u}){return s.jsxs(a.DropdownMenu.Sub,{defaultOpen:r,open:o,onOpenChange:t,children:[s.jsx(a.DropdownMenu.SubTrigger,{children:l}),s.jsx(a.DropdownMenu.SubContent,{...u,children:i})]})}),Tn={Root:xn,ItemGroup:Pn,Item:$n,SubMenu:kn},ke=n.memo(function({children:r}){const[o,t]=n.useState(!1),l=n.useCallback(()=>{t(!0)},[]),i=n.useCallback(()=>{t(!1)},[]);return r({isHovered:o,onPointerEnter:l,onPointerLeave:i})}),Te={fluid:"_fluid_7n1wr_1"},On=n.forwardRef(function({className:r,fluid:o,size:t="medium",variant:l="surface",severity:i="primary",itemSeverity:u="info",placeholder:c="Select",side:f,items:d=[],value:g,id:p,...C},v){const b=z(t,j),y=P(i),m=P(u);return n.createElement(a.Select.Root,{size:b,...C,key:g===void 0?1:0,value:g},s.jsx(a.Select.Trigger,{className:_(r,{[Te.fluid]:o}),id:p,ref:v,variant:l,placeholder:c,color:y}),s.jsx(a.Select.Content,{side:f,className:Te.contentDefault,position:"popper",variant:l!=="surface"?"soft":"solid",color:m,children:d.map(({itemContent:$,value:w,...S})=>s.jsx(a.Select.Item,{className:"overmap-select-item",value:w,...S,children:$},w))}))}),Dn=n.memo(On),Oe=n.memo(n.forwardRef((e,r)=>{const{checked:o,label:t,value:l,size:i="2"}=e;return s.jsx(a.Box,{asChild:!0,px:i,children:s.jsx(a.Select.Item,{value:l,ref:r,children:s.jsxs(a.Flex,{gap:i,align:"center",children:[s.jsx(a.Checkbox,{checked:o}),t]})})})})),J="__select_all__",Nn=n.memo(n.forwardRef((e,r)=>{const[o,t]=n.useState(!1),{placeholder:l,value:i,onValueChange:u,options:c,disabled:f,name:d,...g}=e,p=z(e.size,j),C=P(e.severity),v=n.useMemo(()=>new Map(c.map(w=>[w.value,w.label])),[c]),b=i.length>4?`${i.length} options selected`:s.jsx("span",{children:i.flatMap(w=>[v.get(w),", "]).slice(0,-1)}),y=n.useCallback(()=>t(!1),[]),m=n.useCallback(w=>{w&&t(!0)},[]),$=n.useCallback(w=>{let S;w===J?S=i.length===c.length?[]:c.map(q=>q.value):S=i.includes(w)?i.filter(k=>k!==w):[...i,w],u(S)},[u,c,i]);return n.useEffect(()=>{if(c.some(({value:w})=>w===J))throw new Error(`Cannot have an option with the value "${J}"`)},[c]),s.jsxs(a.Select.Root,{open:o,value:"",onOpenChange:m,onValueChange:$,disabled:f,size:p,name:d,autoComplete:"off",children:[s.jsx(a.Select.Trigger,{ref:r,color:C,placeholder:i.length>0?b:l,"data-placeholder":i.length>0?void 0:!0,...g}),s.jsxs(a.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:y,onPointerDownOutside:y,children:[s.jsx(Oe,{value:J,label:"Select all",checked:i.length===c.length,size:p}),c.map(w=>s.jsx(Oe,{...w,checked:i.includes(w.value),size:p},w.value))]})]})})),En={default:"_default_u936h_1"},An=n.forwardRef(function({className:r,severity:o="primary",icon:t,defaultChecked:l=!1,onCheckedChange:i,...u},c){const f=n.useRef(null),[d,g]=n.useState(u.checked?u.checked:l),[p,C]=n.useState(),v=P(o);n.useLayoutEffect(()=>{var $;const m=c||f;"current"in m&&m.current&&C(($=m.current)==null?void 0:$.querySelector("span.rt-SwitchThumb"))},[c]);const b=n.useCallback(m=>{g(m),i&&i(m)},[i]),y=u.checked?u.checked:d;return s.jsxs(s.Fragment,{children:[s.jsx(a.Switch,{className:_("overmap-switch",r,En.default),ref:c||f,color:v,radius:"full",defaultChecked:l,onCheckedChange:b,...u}),s.jsx(a.Portal,{container:p,asChild:!0,children:t&&"checked"in t?y?t.checked:t.unchecked:t})]})}),zn=n.memo(An),L={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},Mn={width:"auto",height:"100%"},In=n.forwardRef(function({side:r="left",modal:o=!0,children:t,open:l,containerSelector:i,overlay:u=!0,resizable:c=!0,minWidth:f="300px",maxWidth:d="500px",...g},p){const C=r==="right",v=r==="left",[b,y]=n.useState();return n.useEffect(()=>{const m=i??'[data-is-root-theme="true"]',$=document.querySelector(m);if($===void 0)throw new Error(`Could not find a container element using the following selector ${m}`);y($)},[i]),s.jsx(Y.Root,{open:l,modal:o,children:s.jsxs(Y.Portal,{container:b,children:[u&&s.jsx(Y.Overlay,{className:_(L.overlay)}),s.jsx(Y.Content,{className:_("overmap-sidebar","rt-DialogContent",L.sidebarContent,{[L.left]:v,[L.right]:C}),ref:p,asChild:!0,...g,children:s.jsx(a.Box,{width:"auto",children:s.jsx(Q.Resizable,{minWidth:f,maxWidth:d,defaultSize:Mn,enable:{right:c&&v,left:c&&C},handleClasses:{left:L.resizeHandle,right:L.resizeHandle},handleComponent:{right:s.jsx(D.DragHandleDots2Icon,{}),left:s.jsx(D.DragHandleDots2Icon,{})},children:t})})})]})})}),Bn=n.memo(In),E={outerContent:"_outerContent_1iy9c_1",enter:"_enter_1iy9c_4",right:"_right_1iy9c_4",left:"_left_1iy9c_8",enterActive:"_enterActive_1iy9c_12",exitActive:"_exitActive_1iy9c_22",exitDone:"_exitDone_1iy9c_32",resizable:"_resizable_1iy9c_41",slideOutOverlay:"_slideOutOverlay_1iy9c_47"},jn=200,Ln=n.memo(function({className:r,open:o,side:t="left",children:l,minWidth:i,maxWidth:u,resizable:c=!0,overlay:f=!1,modal:d=!1,resizeHandle:g,position:p="absolute",...C}){const v=n.useRef(null),[b,y]=n.useState(i),m=t==="left",$=t==="right",w=n.useCallback((S,k,q,Ue)=>{y(q.clientWidth),v.current&&(v.current.style.width=`${q.clientWidth}px`)},[]);return s.jsx(ie.CSSTransition,{in:o,classNames:{enter:E.enter,enterActive:E.enterActive,exitActive:E.exitActive,exitDone:E.exitDone},timeout:jn,nodeRef:v,unmountOnExit:!0,mountOnEnter:!0,children:s.jsxs(s.Fragment,{children:[f&&s.jsx("div",{className:_("overamp-slide-out-overlay",E.slideOutOverlay)}),s.jsx(Ze.DismissableLayer,{disableOutsidePointerEvents:d,asChild:!0,...C,children:s.jsx(a.Flex,{className:_("overmap-slide-out",r,E.outerContent,{[E.left]:m,[E.right]:$}),style:{"--slide-out-width":`${b}px`},height:"100%",width:"auto",position:p,top:"0",bottom:"0",left:m?"0":void 0,right:$?"0":void 0,ref:v,children:s.jsx(Q.Resizable,{className:E.resizable,defaultSize:{width:b,height:"100%"},onResize:w,enable:{right:c&&m,left:c&&$},handleComponent:{left:g,right:g},minWidth:i,maxWidth:u,children:l})})})]})})}),F={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},Fn=n.forwardRef(function({className:r,leftSlot:o,rightSlot:t,size:l="medium",showInputLength:i,value:u,variant:c,severity:f="primary",...d},g){const p=z(l,j),C=P(f),v=i||i===void 0&&d.maxLength!==void 0,b=u!==void 0?u.toString():void 0;return s.jsxs(a.TextField.Root,{className:_(F.wrapper,{[F.accommodateCharCount]:v}),size:p,variant:c,color:C,children:[o&&s.jsx(a.TextField.Slot,{children:o}),s.jsx(a.TextField.Input,{className:_(F.default,r,{[F.noLeftIcon]:!o,[F.noRightIcon]:!t}),ref:g,size:p,variant:c,color:C,...d}),t&&s.jsx(a.TextField.Slot,{children:t}),v&&s.jsx(a.Text,{as:"p",className:F.charCount,size:"1",color:"gray",children:d.maxLength!==void 0?`${b==null?void 0:b.length}/${d.maxLength}`:`${b==null?void 0:b.length}`})]})}),Hn=n.memo(Fn),Wn={wrapper:"_wrapper_tmtz0_1"},qn=n.forwardRef(function({className:r,defaultOpen:o=!1,modal:t=!1,content:l,children:i,...u},c){return s.jsxs(a.Popover.Root,{defaultOpen:o,modal:t,children:[s.jsx(a.Popover.Trigger,{children:i}),s.jsx(a.Popover.Content,{ref:c,className:_("overmap-popover",r,Wn.wrapper),...u,children:l(a.Popover.Close)})]})}),De=n.memo(qn),T={wrapper:"_wrapper_1ssf2_1",panelContent:"_panelContent_1ssf2_6",left:"_left_1ssf2_14",right:"_right_1ssf2_18",resizable:"_resizable_1ssf2_23",resizeHandle:"_resizeHandle_1ssf2_28",panelMainContent:"_panelMainContent_1ssf2_48"},Ne=200,M=150,Vn=n.memo(function({children:r,showLeft:o,leftPanel:t,leftMinWidth:l=Ne,showRight:i,rightPanel:u,rightMinWidth:c=Ne,resizeable:f}){const d=n.useRef(null),g=n.useRef(null),[p,C]=n.useState(0),[v,b]=n.useState(),y=n.useRef(null),[m,$]=n.useState(0),[w,S]=n.useState(),k=n.useCallback((x,O,N)=>(A,Xe,Qe,be)=>{if(!d.current)return;const te=x+be.width;N(d.current.clientWidth-te),O(()=>te)},[]),q=n.useCallback((x,O,N,A)=>k(p,C,S)(x,O,N,A),[k,p]),Ue=n.useCallback((x,O,N,A)=>k(m,$,b)(x,O,N,A),[k,m]),ee=n.useCallback((x,O,N,A,Xe,Qe,be,te)=>{if(!d.current)return;let oe=x;if(oe===0&&(oe=O,N(oe)),Qe){const re=d.current.clientWidth-oe;te(re),Xe>re&&(be(re),A(d.current.clientWidth-re))}},[]),jt=n.useCallback(()=>ee(m,c,$,S,p,o,C,b),[ee,p,c,m,o]),Lt=n.useCallback(()=>ee(p,l,C,b,m,i,$,S),[ee,l,p,m,i]),ne=n.useCallback((x,O)=>{d.current&&x&&O(d.current.clientWidth)},[]),Ft=n.useCallback(()=>ne(o,b),[ne,o]),Ht=n.useCallback(()=>ne(i,S),[ne,i]),Ke=n.useCallback(()=>{var x,O,N,A;d.current&&(b(d.current.clientWidth-(((x=y.current)==null?void 0:x.clientWidth)||0)),S(d.current.clientWidth-(((O=g.current)==null?void 0:O.clientWidth)||0)),C(((N=g.current)==null?void 0:N.clientWidth)||0),$(((A=y.current)==null?void 0:A.clientWidth)||0))},[]);n.useEffect(()=>{if(!d.current)return;const x=new ResizeObserver(Ke);return x.observe(d.current),()=>{x.disconnect()}},[Ke]);const Wt=n.useMemo(()=>({entering:{transform:`translateX(-${p}px)`,marginRight:`-${p}px`,transitionProperty:"transform, margin-right",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${p}px)`,marginRight:`-${p}px`,transitionProperty:"transform, margin-right",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[p]),qt=n.useMemo(()=>({entering:{transform:`translateX(${m}px)`,marginLeft:`${-m}px`,transitionProperty:"transform, margin-left",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${m}px)`,marginLeft:`${-m}px`,transitionProperty:"transform, margin-left",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[m]);return s.jsxs(a.Flex,{className:T.wrapper,style:{minWidth:`${l+c}px`},ref:d,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[s.jsx(ie.Transition,{nodeRef:g,timeout:o?0:M,in:o,unmountOnExit:!0,onEntering:Lt,onExited:Ht,children:x=>s.jsx(a.Box,{ref:g,className:_(T.panelContent,T.left),style:Wt[x],width:"auto",height:"100%",m:"0",p:"0",children:s.jsx(Q.Resizable,{className:T.resizable,size:{width:p,height:"100%"},onResizeStop:q,enable:{right:(f==null?void 0:f.left)!==void 0?f.left:!0},minWidth:l,maxWidth:v,handleClasses:{right:_(T.resizeHandle,T.left)},handleComponent:{right:s.jsx(D.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:t})})}),s.jsx("div",{className:T.panelMainContent,children:r}),s.jsx(ie.Transition,{nodeRef:y,timeout:i?0:M,in:i,unmountOnExit:!0,onEntering:jt,onExited:Ft,children:x=>s.jsx(a.Box,{ref:y,className:_(T.panelContent,T.right),style:qt[x],width:"auto",height:"100%",m:"0",p:"0",children:s.jsx(Q.Resizable,{className:T.resizable,size:{width:m,height:"100%"},onResizeStop:Ue,enable:{left:(f==null?void 0:f.right)!==void 0?f.right:!0},minWidth:c,maxWidth:w,handleClasses:{left:_(T.resizeHandle,T.right)},handleComponent:{left:s.jsx(D.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),H={multiPagePopover:"_multiPagePopover_1w3ey_1",light:"_light_1w3ey_15",dark:"_dark_1w3ey_20",pageTitle:"_pageTitle_1w3ey_28",buttonContainer:"_buttonContainer_1w3ey_33",optionsButtonContainer:"_optionsButtonContainer_1w3ey_38",optionsButton:"_optionsButton_1w3ey_38"};function Ee(e,r,o,t=0){if(!e.options)return e.content||s.jsx(s.Fragment,{});const l=e.options.map((i,u)=>s.jsx(K,{className:_(H.optionsButton,i.buttonClassName),variant:"ghost",radius:"large",style:{width:o==="vertical"?"100%":"auto"},onClick:i.onClick||(()=>r(Ee(i.page||{},r,o,t+1))),children:i.label},`${i.value}-page-${t}-button-${u}`));return s.jsxs(s.Fragment,{children:[e.title&&s.jsx("div",{className:H.pageTitle,children:e.title}),e.content,s.jsx("div",{className:_(H.optionsButtonContainer,e.buttonsContainerClassName),style:{flexDirection:o==="vertical"?"column":"row"},children:l})]})}const Gn=n.forwardRef(function({page:r,className:o,direction:t="vertical",color:l="light",...i},u){const[c,f]=n.useState(void 0),d=n.useCallback(()=>{f(Ee(r,f,t,0))},[t,r]);n.useEffect(()=>{d()},[d]);const g=n.useCallback(p=>c,[c]);return s.jsx(De,{className:_(H.multiPagePopover,l==="light"?H.light:H.dark,o),content:g,ref:u,...i,onCloseAutoFocus:d})}),Un=n.memo(Gn),Kn={charCount:"_charCount_17uut_1"},Xn=n.forwardRef(function({className:r,showInputLength:o,inputLengthTemplate:t,value:l,severity:i="primary",resize:u,...c},f){const d=P(i),g=P("info"),p=o||o===void 0&&(c.maxLength!==void 0||c.minLength!==void 0),C=l!==void 0?l.toString():"",v=n.useMemo(()=>{if(t){let b=t.replace("{current}",C.length.toString());return c.minLength!==void 0&&(b=b.replace("{min}",c.minLength.toString())),c.maxLength!==void 0&&(b=b.replace("{max}",c.maxLength.toString())),b}return C.length},[t,c.maxLength,c.minLength,C.length]);return s.jsxs(s.Fragment,{children:[s.jsx(a.TextArea,{className:_("overmap-textarea",r),style:{resize:u},ref:f,value:l,color:d,...c}),p&&s.jsx(a.Text,{as:"p",className:Kn.charCount,color:g,align:"right",children:v})]})}),Qn=n.memo(Xn),Yn=n.forwardRef(function({loop:r,type:o,rovingFocus:t,value:l,onValueChange:i,defaultValue:u,disabled:c,items:f,className:d,direction:g="row",...p},C){return s.jsx(ve.Root,{type:o,className:_("overmap-toggle-group",d),ref:C,value:l,onValueChange:i,disabled:c,orientation:g==="column"?"vertical":"horizontal",loop:r,rovingFocus:t,defaultValue:u,asChild:!0,children:s.jsx(ae,{direction:g,...p,children:f.map(({children:v,...b})=>n.createElement(ve.Item,{asChild:!0,...b,key:b.value},s.jsx(ce,{className:_("overmap-toggle-group-button"),"aria-label":b.value,variant:b.value===l?"solid":"soft",children:v})))})})}),Zn=n.memo(Yn),Jn={default:"_default_xqvoc_1"},Ae=n.memo(n.forwardRef(({className:e,minContentGap:r="2",children:o,...t},l)=>s.jsx(Je.Root,{className:_(e,"overmap-toolbar",Jn.default),ref:l,asChild:!0,...t,children:s.jsx(Z,{grow:"1",width:"100%",height:"max-content",align:"center",gap:r,wrap:"nowrap",children:o})}))),Rn=n.memo(n.forwardRef(({children:e,gap:r="2"},o)=>s.jsx(Z,{ref:o,grow:"1",width:"max-content",height:"100%",align:"center",gap:r,children:e}))),et=n.memo(n.forwardRef(({children:e,gap:r},o)=>s.jsx(Z,{ref:o,grow:"1",width:"max-content",direction:"row-reverse",height:"100%",align:"center",gap:r||"2",children:e}))),nt={Root:Ae,LeftContent:Rn,RightContent:et},fe={ToastViewport:"_ToastViewport_1i6bp_1",actionButton:"_actionButton_1i6bp_20",ToastRoot:"_ToastRoot_1i6bp_24",slideIn:"_slideIn_1i6bp_1",swipeOut:"_swipeOut_1i6bp_1"},tt=n.forwardRef(function({title:r,description:o,icon:t,severity:l="primary",size:i,onClose:u,sensitivity:c,action:f,...d},g){const[p,C]=n.useState(!0),v=P(l),b=n.useCallback(y=>{!y&&u&&u(),C(y)},[u]);return s.jsx(G.Root,{asChild:!0,ref:g,...d,open:p,type:c,onOpenChange:b,children:s.jsx(a.Callout.Root,{className:fe.ToastRoot,variant:"surface",color:v,size:i,children:s.jsxs(a.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[s.jsxs(a.Flex,{align:"center",gap:"3",children:[s.jsx(a.Callout.Icon,{children:t}),s.jsxs(a.Flex,{direction:"column",gap:"2",children:[s.jsxs(a.Flex,{direction:"column",gap:"0",children:[s.jsx(G.Title,{asChild:!0,children:s.jsx(a.Callout.Text,{size:"3",weight:"medium",children:r})}),s.jsx(G.Description,{asChild:!0,children:s.jsx(a.Callout.Text,{children:o})})]}),f&&s.jsx(G.Action,{className:fe.actionButton,altText:f.altText,asChild:!0,children:f.content})]})]}),s.jsx(G.Close,{asChild:!0,children:s.jsx(ce,{"aria-label":"Close",variant:"ghost",severity:l,children:s.jsx(D.Cross2Icon,{})})})]})})})}),ze=n.memo(tt),he=n.createContext({}),ot=()=>{const e=n.useContext(he);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},rt=240/60,Me=5e3,it=e=>{if(e.duration&&e.duration>=Me)return e.duration;const r=e.severity==="danger"?1.5:1,o=e.description.split(" ").length+e.title.split(" ").length;return(Me+o/rt)*r};h.unsafeShowToast=void 0;const st=n.memo(function({children:r,className:o,hotkey:t,...l}){const[i,u]=n.useState([]),c=n.useCallback((d,g,p)=>{u(C=>{const v=C.find(b=>b.id===d);return v&&g===0&&clearTimeout(v.timeout),C.filter(b=>b.id!==d)}),p&&p()},[]),f=n.useMemo(()=>{let d=0;const g=y=>{const m=it(y),$=d.toString();d+=1;const w=setTimeout(()=>c($,1,y.onClose),m);u(S=>[...S,{...y,timeout:w,duration:m,id:$}])},p=y=>g({...y,severity:"primary"}),C=y=>g({...y,severity:"success"}),v=y=>g({...y,severity:"danger"}),b=y=>g({...y,severity:"info"});return h.unsafeShowToast=g,{showToast:g,showPrimary:p,showSuccess:C,showError:v,showInfo:b}},[c]);return n.useEffect(()=>()=>{for(const{timeout:d}of i)clearTimeout(d)},[]),s.jsx(he.Provider,{value:f,children:s.jsxs(se.ToastProvider,{...l,children:[r,s.jsx(se.ToastViewport,{className:_(o,fe.ToastViewport),hotkey:t}),i.map(({id:d,onClose:g,...p})=>s.jsx(ze,{...p,onClose:()=>c(d,0,g)},d))]})})}),lt={default:"_default_1odpt_1"},ct=n.memo(n.forwardRef(({className:e,children:r,content:o,...t},l)=>s.jsx(a.Tooltip,{className:_("overmap-tooltip",e,lt.default),ref:l,content:s.jsx(a.Flex,{align:"center",gap:"1",width:"max-content",height:"max-content",justify:"center",children:o}),...t,children:r}))),at={noWrap:"_noWrap_1wpa5_1"},ut=n.memo(n.forwardRef(({className:e,noWrap:r,severity:o,as:t,...l},i)=>{const u=P(o);return s.jsx(a.Text,{ref:i,as:t,className:_(e,{[at.noWrap]:r}),color:u,...l})})),qo="",dt=n.memo(n.forwardRef((e,r)=>{const{panelBackground:o="solid",radius:t="full",...l}=e;return s.jsx(a.Theme,{panelBackground:o,radius:t,ref:r,...l})})),ft={1:"max-content",2:"max-content",3:"max-content",4:"100%"},ht=n.forwardRef(function({severity:r="info",weight:o="light",gap:t="1",text:l,orientation:i="horizontal",size:u,...c},f){const d=z(u,ft),g=P(r);return s.jsxs(a.Flex,{ref:f,width:i==="horizontal"?d:"max-content",height:i==="vertical"?d:"max-content",direction:i==="vertical"?"column":"row",align:"center",gap:t,children:[s.jsx(a.Separator,{size:u,orientation:i,color:g,...c}),l&&s.jsxs(s.Fragment,{children:[s.jsx(a.Text,{as:"span",size:"1",weight:o,color:g,children:l}),s.jsx(a.Separator,{size:u,orientation:i,color:g,...c})]})]})}),pt=n.memo(ht);function I(){return I=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},I.apply(this,arguments)}function gt(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function Ie(...e){return r=>e.forEach(o=>gt(o,r))}function Be(...e){return n.useCallback(Ie(...e),e)}function bt(e,r=[]){let o=[];function t(i,u){const c=n.createContext(u),f=o.length;o=[...o,u];function d(p){const{scope:C,children:v,...b}=p,y=(C==null?void 0:C[e][f])||c,m=n.useMemo(()=>b,Object.values(b));return n.createElement(y.Provider,{value:m},v)}function g(p,C){const v=(C==null?void 0:C[e][f])||c,b=n.useContext(v);if(b)return b;if(u!==void 0)return u;throw new Error(`\`${p}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,g]}const l=()=>{const i=o.map(u=>n.createContext(u));return function(c){const f=(c==null?void 0:c[e])||i;return n.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return l.scopeName=e,[t,Ct(l,...r)]}function Ct(...e){const r=e[0];if(e.length===1)return r;const o=()=>{const t=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(i){const u=t.reduce((c,{useScope:f,scopeName:d})=>{const p=f(i)[`__scope${d}`];return{...c,...p}},{});return n.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])}};return o.scopeName=r.scopeName,o}function je(e,r,{checkForDefaultPrevented:o=!0}={}){return function(l){if(e==null||e(l),o===!1||!l.defaultPrevented)return r==null?void 0:r(l)}}function Le(e){const r=n.useRef(e);return n.useEffect(()=>{r.current=e}),n.useMemo(()=>(...o)=>{var t;return(t=r.current)===null||t===void 0?void 0:t.call(r,...o)},[])}function vt({prop:e,defaultProp:r,onChange:o=()=>{}}){const[t,l]=mt({defaultProp:r,onChange:o}),i=e!==void 0,u=i?e:t,c=Le(o),f=n.useCallback(d=>{if(i){const p=typeof d=="function"?d(e):d;p!==e&&c(p)}else l(d)},[i,e,l,c]);return[u,f]}function mt({defaultProp:e,onChange:r}){const o=n.useState(e),[t]=o,l=n.useRef(t),i=Le(r);return n.useEffect(()=>{l.current!==t&&(i(t),l.current=t)},[t,l,i]),o}function yt(e){const r=n.useRef({value:e,previous:e});return n.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}const pe=globalThis!=null&&globalThis.document?n.useLayoutEffect:()=>{};function _t(e){const[r,o]=n.useState(void 0);return pe(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const i=l[0];let u,c;if("borderBoxSize"in i){const f=i.borderBoxSize,d=Array.isArray(f)?f[0]:f;u=d.inlineSize,c=d.blockSize}else u=e.offsetWidth,c=e.offsetHeight;o({width:u,height:c})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}else o(void 0)},[e]),r}function wt(e,r){return n.useReducer((o,t)=>{const l=r[o][t];return l??o},e)}const Fe=e=>{const{present:r,children:o}=e,t=St(r),l=typeof o=="function"?o({present:t.isPresent}):n.Children.only(o),i=Be(t.ref,l.ref);return typeof o=="function"||t.isPresent?n.cloneElement(l,{ref:i}):null};Fe.displayName="Presence";function St(e){const[r,o]=n.useState(),t=n.useRef({}),l=n.useRef(e),i=n.useRef("none"),u=e?"mounted":"unmounted",[c,f]=wt(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const d=R(t.current);i.current=c==="mounted"?d:"none"},[c]),pe(()=>{const d=t.current,g=l.current;if(g!==e){const C=i.current,v=R(d);e?f("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(g&&C!==v?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,f]),pe(()=>{if(r){const d=p=>{const v=R(t.current).includes(p.animationName);p.target===r&&v&&Re.flushSync(()=>f("ANIMATION_END"))},g=p=>{p.target===r&&(i.current=R(t.current))};return r.addEventListener("animationstart",g),r.addEventListener("animationcancel",d),r.addEventListener("animationend",d),()=>{r.removeEventListener("animationstart",g),r.removeEventListener("animationcancel",d),r.removeEventListener("animationend",d)}}else f("ANIMATION_END")},[r,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback(d=>{d&&(t.current=getComputedStyle(d)),o(d)},[])}}function R(e){return(e==null?void 0:e.animationName)||"none"}const He=n.forwardRef((e,r)=>{const{children:o,...t}=e,l=n.Children.toArray(o),i=l.find(xt);if(i){const u=i.props.children,c=l.map(f=>f===i?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:f);return n.createElement(ge,I({},t,{ref:r}),n.isValidElement(u)?n.cloneElement(u,void 0,c):null)}return n.createElement(ge,I({},t,{ref:r}),o)});He.displayName="Slot";const ge=n.forwardRef((e,r)=>{const{children:o,...t}=e;return n.isValidElement(o)?n.cloneElement(o,{...Pt(t,o.props),ref:r?Ie(r,o.ref):o.ref}):n.Children.count(o)>1?n.Children.only(null):null});ge.displayName="SlotClone";const $t=({children:e})=>n.createElement(n.Fragment,null,e);function xt(e){return n.isValidElement(e)&&e.type===$t}function Pt(e,r){const o={...r};for(const t in r){const l=e[t],i=r[t];/^on[A-Z]/.test(t)?l&&i?o[t]=(...c)=>{i(...c),l(...c)}:l&&(o[t]=l):t==="style"?o[t]={...l,...i}:t==="className"&&(o[t]=[l,i].filter(Boolean).join(" "))}return{...e,...o}}const We=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,r)=>{const o=n.forwardRef((t,l)=>{const{asChild:i,...u}=t,c=i?He:r;return n.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.createElement(c,I({},u,{ref:l}))});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),qe="Checkbox",[kt,Go]=bt(qe),[Tt,Ot]=kt(qe),Dt=n.forwardRef((e,r)=>{const{__scopeCheckbox:o,name:t,checked:l,defaultChecked:i,required:u,disabled:c,value:f="on",onCheckedChange:d,...g}=e,[p,C]=n.useState(null),v=Be(r,S=>C(S)),b=n.useRef(!1),y=p?!!p.closest("form"):!0,[m=!1,$]=vt({prop:l,defaultProp:i,onChange:d}),w=n.useRef(m);return n.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const k=()=>$(w.current);return S.addEventListener("reset",k),()=>S.removeEventListener("reset",k)}},[p,$]),n.createElement(Tt,{scope:o,state:m,disabled:c},n.createElement(We.button,I({type:"button",role:"checkbox","aria-checked":B(m)?"mixed":m,"aria-required":u,"data-state":Ve(m),"data-disabled":c?"":void 0,disabled:c,value:f},g,{ref:v,onKeyDown:je(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:je(e.onClick,S=>{$(k=>B(k)?!0:!k),y&&(b.current=S.isPropagationStopped(),b.current||S.stopPropagation())})})),y&&n.createElement(At,{control:p,bubbles:!b.current,name:t,value:f,checked:m,required:u,disabled:c,style:{transform:"translateX(-100%)"}}))}),Nt="CheckboxIndicator",Et=n.forwardRef((e,r)=>{const{__scopeCheckbox:o,forceMount:t,...l}=e,i=Ot(Nt,o);return n.createElement(Fe,{present:t||B(i.state)||i.state===!0},n.createElement(We.span,I({"data-state":Ve(i.state),"data-disabled":i.disabled?"":void 0},l,{ref:r,style:{pointerEvents:"none",...e.style}})))}),At=e=>{const{control:r,checked:o,bubbles:t=!0,...l}=e,i=n.useRef(null),u=yt(o),c=_t(r);return n.useEffect(()=>{const f=i.current,d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(u!==o&&p){const C=new Event("click",{bubbles:t});f.indeterminate=B(o),p.call(f,B(o)?!1:o),f.dispatchEvent(C)}},[u,o,t]),n.createElement("input",I({type:"checkbox","aria-hidden":!0,defaultChecked:B(o)?!1:o},l,{tabIndex:-1,ref:i,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function B(e){return e==="indeterminate"}function Ve(e){return B(e)?"indeterminate":e?"checked":"unchecked"}const zt=Dt,Mt=Et,W={checkboxContainer:"_checkboxContainer_pb9za_5",checkbox:"_checkbox_pb9za_5",checkboxIndicator:"_checkboxIndicator_pb9za_27",checkboxLabel:"_checkboxLabel_pb9za_38",noTextHighlight:"_noTextHighlight_pb9za_42",checkboxHidden:"_checkboxHidden_pb9za_51"},It=n.forwardRef(function({className:r,labelClassName:o,label:t,checked:l,onCheckedChange:i,...u},c){const f=`c-${t}-${new Date}`;return s.jsx(ke,{children:({isHovered:d,...g})=>s.jsxs(a.Flex,{className:W.checkboxContainer,...g,children:[s.jsx(zt,{id:f,className:_(W.checkbox,!d&&!l&&W.checkboxHidden,r),checked:l,onCheckedChange:p=>{i&&i(p)},ref:c,...u,children:s.jsx(Mt,{className:W.checkboxIndicator,children:l==="indeterminate"?s.jsx(D.DividerHorizontalIcon,{width:"13px"}):s.jsx(D.CheckIcon,{})})}),t&&s.jsx("label",{className:_(W.checkboxLabel,o,W.noTextHighlight),htmlFor:f,children:t})]})})}),Ge=n.memo(It);Ge.displayName="Checkbox";const Bt=n.memo(function({className:r,labelClassName:o,label:t,onCheckedChange:l,children:i,...u}){const[c,f]=n.useState(!1),[d,g]=n.useState(Array(i.length).fill(!1)),p=v=>{const b=c==="indeterminate"||!v;g(d.map(y=>!b)),l&&l(v)};n.useEffect(()=>{const v=d.filter(b=>b).length;v===0?f(!1):v===i.length?f(!0):f("indeterminate")},[i,d]);const C=n.Children.map(i,(v,b)=>n.cloneElement(v,{...v.props,checked:!!v.props.checked||d[b],onCheckedChange:y=>{const m=[...d];m[b]=y,g(m),v.props.onCheckedChange&&v.props.onCheckedChange(y)}}));return s.jsxs(s.Fragment,{children:[s.jsx(Ge,{className:r,labelClassName:o,label:t,checked:c,onCheckedChange:p,...u}),C]})});Object.defineProperty(h,"AccessibleIcon",{enumerable:!0,get:()=>a.AccessibleIcon}),Object.defineProperty(h,"AspectRatio",{enumerable:!0,get:()=>a.AspectRatio}),Object.defineProperty(h,"Avatar",{enumerable:!0,get:()=>a.Avatar}),Object.defineProperty(h,"Blockquote",{enumerable:!0,get:()=>a.Blockquote}),Object.defineProperty(h,"Box",{enumerable:!0,get:()=>a.Box}),Object.defineProperty(h,"Callout",{enumerable:!0,get:()=>a.Callout}),Object.defineProperty(h,"Card",{enumerable:!0,get:()=>a.Card}),Object.defineProperty(h,"Checkbox",{enumerable:!0,get:()=>a.Checkbox}),Object.defineProperty(h,"Code",{enumerable:!0,get:()=>a.Code}),Object.defineProperty(h,"Container",{enumerable:!0,get:()=>a.Container}),Object.defineProperty(h,"ContextMenu",{enumerable:!0,get:()=>a.ContextMenu}),Object.defineProperty(h,"Em",{enumerable:!0,get:()=>a.Em}),Object.defineProperty(h,"Grid",{enumerable:!0,get:()=>a.Grid}),Object.defineProperty(h,"Heading",{enumerable:!0,get:()=>a.Heading}),Object.defineProperty(h,"HoverCard",{enumerable:!0,get:()=>a.HoverCard}),Object.defineProperty(h,"Inset",{enumerable:!0,get:()=>a.Inset}),Object.defineProperty(h,"Kbd",{enumerable:!0,get:()=>a.Kbd}),Object.defineProperty(h,"Link",{enumerable:!0,get:()=>a.Link}),Object.defineProperty(h,"Portal",{enumerable:!0,get:()=>a.Portal}),Object.defineProperty(h,"Quote",{enumerable:!0,get:()=>a.Quote}),Object.defineProperty(h,"RadioGroup",{enumerable:!0,get:()=>a.RadioGroup}),Object.defineProperty(h,"ScrollArea",{enumerable:!0,get:()=>a.ScrollArea}),Object.defineProperty(h,"Section",{enumerable:!0,get:()=>a.Section}),Object.defineProperty(h,"Slider",{enumerable:!0,get:()=>a.Slider}),Object.defineProperty(h,"Slot",{enumerable:!0,get:()=>a.Slot}),Object.defineProperty(h,"Strong",{enumerable:!0,get:()=>a.Strong}),Object.defineProperty(h,"Table",{enumerable:!0,get:()=>a.Table}),Object.defineProperty(h,"Tabs",{enumerable:!0,get:()=>a.Tabs}),Object.defineProperty(h,"TextField",{enumerable:!0,get:()=>a.TextField}),Object.defineProperty(h,"Theme",{enumerable:!0,get:()=>a.Theme}),Object.defineProperty(h,"VisuallyHidden",{enumerable:!0,get:()=>a.VisuallyHidden}),Object.defineProperty(h,"updateThemeAppearanceClass",{enumerable:!0,get:()=>a.updateThemeAppearanceClass}),Object.defineProperty(h,"useThemeContext",{enumerable:!0,get:()=>a.useThemeContext}),h.AlertDialog=xe,h.AlertDialogContent=ue,h.AlertDialogProvider=wn,h.Badge=sn,h.Button=K,h.ButtonGroup=ae,h.ButtonList=Cn,h.DefaultTheme=dt,h.Dialog=mn,h.DropdownMenu=Tn,h.Flex=Z,h.HoverUtility=ke,h.IconButton=ce,h.Input=Hn,h.LeftAndRightPanels=Vn,h.MultiPagePopover=Un,h.MultiSelect=Nn,h.Popover=De,h.Root=Ae,h.Select=Dn,h.SelectAllCheckbox=Bt,h.Separator=pt,h.Sidebar=Bn,h.SlideOut=Ln,h.Switch=zn,h.Text=ut,h.TextArea=Qn,h.Toast=ze,h.ToastContext=he,h.ToastProvider=st,h.ToggleGroup=Zn,h.Toolbar=nt,h.Tooltip=ct,h.divButtonProps=ln,h.useAlertDialog=Pe,h.useDiscardAlertDialog=Sn,h.useSeverityColor=P,h.useToast=ot,h.useViewportSize=on,Object.keys(Ce).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(h,e)&&Object.defineProperty(h,e,{enumerable:!0,get:()=>Ce[e]})}),Object.keys(D).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(h,e)&&Object.defineProperty(h,e,{enumerable:!0,get:()=>D[e]})}),Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
6
6
  //# sourceMappingURL=blocks.umd.cjs.map