@overmap-ai/blocks 0.0.9-alpha.6 → 0.0.9
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/dist/Dialogs/AlertDialog/typings.d.ts +2 -2
- package/dist/Dialogs/Dialog/typings.d.ts +17 -13
- package/dist/DropdownMenu/typings.d.ts +1 -0
- package/dist/Popover/typings.d.ts +7 -5
- package/dist/blocks.js +308 -296
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +2 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(
|
|
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,ve,D,d,s,n,V,Ye,Q,Ze,ie,me,Je,se,Re){"use strict";function ye(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=ye(Ye),G=ye(se);function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e={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(e){(function(){var r={}.hasOwnProperty;function o(){for(var t=[],l=0;l<arguments.length;l++){var i=arguments[l];if(i){var a=typeof i;if(a==="string"||a==="number")t.push(i);else if(Array.isArray(i)){if(i.length){var c=o.apply(null,i);c&&t.push(c)}}else if(a==="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 w=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=u.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"}),a=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":a?"md":i?"sm":l?"xs":"initial"))},[c,a,i,f,l]),{size:o,prevSize:e,xs:l,sm:i,md:a,lg:c,xl:f}},_e=(e,r,o)=>{const[t,l]=n.useState([]),[i,a]=n.useState(!0),c=n.useCallback(g=>{const{repeat:h,key:v}=g;a(!0),!(h||t.includes(v))&&l(C=>[...C,v])},[t]),f=n.useCallback(g=>{const{key:h}=g;a(!1),t.includes(h)&&l(v=>{const C=[...v];return C.splice(v.indexOf(h),1),C})},[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},a){const c=P(o);return s.jsx(u.Badge,{className:w("overmap-badge",r),ref:a,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:a=t.fluid??!1,size:c=t.size??"medium",severity:f=t.severity??"primary",hoverEffects:d=t.hoverEffects??[],variant:g=t.variant,shortcut:h={keys:[],action:()=>{},disabled:!1},...v}=r,C=P(f),b=d.map(y=>we[y]);return _e(h.keys,h.disabled||h.keys.length===0,h.action),s.jsx(u.Button,{ref:o,type:i,className:w(l,b,{[U.fluid]:a}),color:C,size:z(c,j),variant:g,...v})}),K=n.memo(cn),an=n.forwardRef(function(r,o){const t=le(),{className:l,children:i,type:a="button",fluid:c=t.fluid??!1,size:f=t.size??"medium",severity:d=t.severity??"primary",hoverEffects:g=t.hoverEffects??[],variant:h=t.variant,shortcut:v={keys:[],action:()=>{},disabled:!1},...C}=r,b=P(d),y=(g==null?void 0:g.map(m=>we[m]))||[];return _e(v.keys,v.disabled||v.keys.length===0,v.action),s.jsx(u.IconButton,{className:w(l,y,{[U.fluid]:c}),ref:o,color:b,size:z(f,j),variant:h,type:a,...C,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:a,size:c="medium",variant:f,hoverEffects:d,fluid:g,...h},v){const C=z(c,dn[i]),b=f==="ghost"?C:"0";return s.jsx(u.Flex,{className:w("overmap-button-group",r,{[un.merged]:o}),ref:v,gap:o?l??b:l??"2",direction:i,"data-direction":i,...h,children:s.jsx(Se.Provider,{value:{size:c,severity:a,variant:f,hoverEffects:d,fluid:g},children:t})})}),ae=n.memo(fn),pn={separators:"_separators_1f7v1_1"},hn=n.memo(n.forwardRef((e,r)=>{const{children:o,border:t,before:l,after:i,size:a}=e,c=t?"surface":"ghost",f=z(a,j),d=l&&i?s.jsx(u.Inset,{side:"x",pt:"current",pb:"current",children:o}):l?s.jsx(u.Inset,{side:"bottom",pt:"current",children:o}):i?s.jsx(u.Inset,{side:"top",pb:"current",children:o}):s.jsx(u.Inset,{children:o}),g=s.jsxs(u.Card,{ref:r,size:f,variant:c,children:[l,d,i]});return c==="ghost"?s.jsx(u.Box,{p:"3",children:g}):g})),gn=n.memo(n.forwardRef((e,r)=>{const{children:o,variant:t="outline",size:l,className:i,...a}=e,c=t==="outline"||t==="surface",f=t==="outline"?"ghost":t==="surface"?"soft":t;return s.jsx(hn,{...a,border:c,size:l,children:s.jsx(ae,{size:l,severity:"info",variant:f,className:w(i,pn.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(u.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(u.Flex,{direction:"column",gap:"2",children:[s.jsxs(u.Flex,{direction:"column",gap:"1",children:[s.jsxs(u.Flex,{justify:"between",children:[s.jsx(u.Dialog.Title,{mb:"0",children:o}),s.jsx(u.Dialog.Close,{children:s.jsx(u.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:s.jsx(D.Cross1Icon,{})})})]}),t&&s.jsx(u.Dialog.Description,{children:t})]}),l(i)]})}),mn=n.memo(n.forwardRef((e,r)=>{const{children:o,content:t,title:l,description:i,onOpen:a,defaultOpen:c,onCloseInterrupt:f,open:d,onOpenChange:g,...h}=e,[v,C]=n.useState(c??!1),b=d??v;if((f||a)&&g)throw new Error("Neither the `onCloseInterrupt` nor `onOpen` props can be used with `onOpenChange`.");if(d!==void 0&&g===void 0)throw new Error("The `open` prop requires the `onOpenChange` prop.");const y=n.useCallback(_=>{if(g)return g(_);if(_&&a)a();else if(!_&&f)return f(()=>C(!1));C(_)},[g,a,f]),m=n.useCallback(_=>{if(_!=null&&_.force)return C(!1);y(!1)},[y]);return s.jsxs(u.Dialog.Root,{open:b,onOpenChange:y,children:[s.jsx(u.Dialog.Trigger,{children:o}),s.jsx(u.Dialog.Content,{ref:r,...h,children:s.jsx(vn,{closeDialog:m,content:t,title:l,description:i})})]})})),xe=e=>s.jsx(u.AlertDialog.Title,{mb:"0",...e}),yn=e=>{const{title:r,description:o,actionText:t="Confirm",cancelText:l="Cancel",onAction:i,onCancel:a,severity:c}=e;return s.jsxs(u.Flex,{direction:"column",gap:"2",children:[s.jsxs(u.Flex,{direction:"column",gap:"1",children:[s.jsx(xe,{children:r}),s.jsx(u.AlertDialog.Description,{children:o})]}),s.jsxs(u.Flex,{gap:"3",mt:"4",justify:"end",children:[s.jsx(u.AlertDialog.Cancel,{children:s.jsx(K,{variant:"soft",severity:"info",onClick:a,children:l})}),s.jsx(u.AlertDialog.Action,{children:s.jsx(K,{variant:"solid",severity:c,onClick:i,children:t})})]})]})},$e=n.memo(function(r){const{open:o,setOpen:t,children:l,...i}=r,a=n.useMemo(()=>({close:()=>t(!1),Title:xe,Description:u.AlertDialog.Description}),[t]);return s.jsxs(u.AlertDialog.Root,{open:o,onOpenChange:t,children:[s.jsx(u.AlertDialog.Content,{children:"content"in i?i.content(a):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),a=n.useCallback(c=>{if(o)throw new Error("AlertDialog is already open");i(c),t(!0)},[o]);return s.jsx($e,{open:o,setOpen:t,...l,children:s.jsx(ue.Provider,{value:a,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},a)=>s.jsx(u.Flex,{className:w(e,{[de.radius]:r,[de.zeroMinWidth]:t,[de.zeroMinHeight]:l}),ref:a,...i,children:o}))),xn=n.memo(function({severity:r,itemContent:o,closeOnSelect:t=!0,onSelect:l,...i}){const a=P(r),c=n.useCallback(f=>{t||f.preventDefault(),l&&l(f)},[t,l]);return s.jsx(u.DropdownMenu.Item,{onSelect:c,color:a,...i,children:o})}),$n=n.memo(function({defaultOpen:r,open:o,onOpenChange:t,modal:l,trigger:i,label:a,severity:c="info",children:f,...d}){const g=P(c);return s.jsxs(u.DropdownMenu.Root,{defaultOpen:r,open:o,onOpenChange:t,modal:l,children:[s.jsx(u.DropdownMenu.Trigger,{children:i}),s.jsxs(u.DropdownMenu.Content,{color:g,...d,children:[a&&s.jsx(u.DropdownMenu.Label,{children:a}),f]})]})}),Pn=n.memo(function({separatorBelow:r=!1,separatorAbove:o=!1,children:t,...l}){return s.jsxs(s.Fragment,{children:[o&&s.jsx(u.DropdownMenu.Separator,{}),s.jsx(u.DropdownMenu.Group,{...l,children:t}),r&&s.jsx(u.DropdownMenu.Separator,{})]})}),kn=n.memo(function({defaultOpen:r,open:o,onOpenChange:t,trigger:l,children:i,...a}){return s.jsxs(u.DropdownMenu.Sub,{defaultOpen:r,open:o,onOpenChange:t,children:[s.jsx(u.DropdownMenu.SubTrigger,{children:l}),s.jsx(u.DropdownMenu.SubContent,{...a,children:i})]})}),On={Root:$n,ItemGroup:Pn,Item:xn,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})}),Oe={fluid:"_fluid_7n1wr_1"},Tn=n.forwardRef(function({className:r,fluid:o,size:t="medium",variant:l="surface",severity:i="primary",itemSeverity:a="info",placeholder:c="Select",side:f,items:d=[],value:g,id:h,...v},C){const b=z(t,j),y=P(i),m=P(a);return n.createElement(u.Select.Root,{size:b,...v,key:g===void 0?1:0,value:g},s.jsx(u.Select.Trigger,{className:w(r,{[Oe.fluid]:o}),id:h,ref:C,variant:l,placeholder:c,color:y}),s.jsx(u.Select.Content,{side:f,className:Oe.contentDefault,position:"popper",variant:l!=="surface"?"soft":"solid",color:m,children:d.map(({itemContent:_,value:S,...x})=>s.jsx(u.Select.Item,{className:"overmap-select-item",value:S,...x,children:_},S))}))}),Dn=n.memo(Tn),Te=n.memo(n.forwardRef((e,r)=>{const{checked:o,label:t,value:l,size:i="2"}=e;return s.jsx(u.Box,{asChild:!0,px:i,children:s.jsx(u.Select.Item,{value:l,ref:r,children:s.jsxs(u.Flex,{gap:i,align:"center",children:[s.jsx(u.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:a,options:c,disabled:f,name:d,...g}=e,h=z(e.size,j),v=P(e.severity),C=n.useMemo(()=>new Map(c.map(S=>[S.value,S.label])),[c]),b=i.length>4?`${i.length} options selected`:s.jsx("span",{children:i.flatMap(S=>[C.get(S),", "]).slice(0,-1)}),y=n.useCallback(()=>t(!1),[]),m=n.useCallback(S=>{S&&t(!0)},[]),_=n.useCallback(S=>{let x;S===J?x=i.length===c.length?[]:c.map(q=>q.value):x=i.includes(S)?i.filter(k=>k!==S):[...i,S],a(x)},[a,c,i]);return n.useEffect(()=>{if(c.some(({value:S})=>S===J))throw new Error(`Cannot have an option with the value "${J}"`)},[c]),s.jsxs(u.Select.Root,{open:o,value:"",onOpenChange:m,onValueChange:_,disabled:f,size:h,name:d,autoComplete:"off",children:[s.jsx(u.Select.Trigger,{ref:r,color:v,placeholder:i.length>0?b:l,"data-placeholder":i.length>0?void 0:!0,...g}),s.jsxs(u.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:y,onPointerDownOutside:y,children:[s.jsx(Te,{value:J,label:"Select all",checked:i.length===c.length,size:h}),c.map(S=>s.jsx(Te,{...S,checked:i.includes(S.value),size:h},S.value))]})]})})),En={default:"_default_u936h_1"},An=n.forwardRef(function({className:r,severity:o="primary",icon:t,defaultChecked:l=!1,onCheckedChange:i,...a},c){const f=n.useRef(null),[d,g]=n.useState(a.checked?a.checked:l),[h,v]=n.useState(),C=P(o);n.useLayoutEffect(()=>{var _;const m=c||f;"current"in m&&m.current&&v((_=m.current)==null?void 0:_.querySelector("span.rt-SwitchThumb"))},[c]);const b=n.useCallback(m=>{g(m),i&&i(m)},[i]),y=a.checked?a.checked:d;return s.jsxs(s.Fragment,{children:[s.jsx(u.Switch,{className:w("overmap-switch",r,En.default),ref:c||f,color:C,radius:"full",defaultChecked:l,onCheckedChange:b,...a}),s.jsx(u.Portal,{container:h,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:a=!0,resizable:c=!0,minWidth:f="300px",maxWidth:d="500px",...g},h){const v=r==="right",C=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:[a&&s.jsx(Y.Overlay,{className:w(L.overlay)}),s.jsx(Y.Content,{className:w("overmap-sidebar","rt-DialogContent",L.sidebarContent,{[L.left]:C,[L.right]:v}),ref:h,asChild:!0,...g,children:s.jsx(u.Box,{width:"auto",children:s.jsx(Q.Resizable,{minWidth:f,maxWidth:d,defaultSize:Mn,enable:{right:c&&C,left:c&&v},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:a,resizable:c=!0,overlay:f=!1,modal:d=!1,resizeHandle:g,position:h="absolute",...v}){const C=n.useRef(null),[b,y]=n.useState(i),m=t==="left",_=t==="right",S=n.useCallback((x,k,q,Ue)=>{y(q.clientWidth),C.current&&(C.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:C,unmountOnExit:!0,mountOnEnter:!0,children:s.jsxs(s.Fragment,{children:[f&&s.jsx("div",{className:w("overamp-slide-out-overlay",E.slideOutOverlay)}),s.jsx(Ze.DismissableLayer,{disableOutsidePointerEvents:d,asChild:!0,...v,children:s.jsx(u.Flex,{className:w("overmap-slide-out",r,E.outerContent,{[E.left]:m,[E.right]:_}),style:{"--slide-out-width":`${b}px`},height:"100%",width:"auto",position:h,top:"0",bottom:"0",left:m?"0":void 0,right:_?"0":void 0,ref:C,children:s.jsx(Q.Resizable,{className:E.resizable,defaultSize:{width:b,height:"100%"},onResize:S,enable:{right:c&&m,left:c&&_},handleComponent:{left:g,right:g},minWidth:i,maxWidth:a,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:a,variant:c,severity:f="primary",...d},g){const h=z(l,j),v=P(f),C=i||i===void 0&&d.maxLength!==void 0,b=a!==void 0?a.toString():void 0;return s.jsxs(u.TextField.Root,{className:w(F.wrapper,{[F.accommodateCharCount]:C}),size:h,variant:c,color:v,children:[o&&s.jsx(u.TextField.Slot,{children:o}),s.jsx(u.TextField.Input,{className:w(F.default,r,{[F.noLeftIcon]:!o,[F.noRightIcon]:!t}),ref:g,size:h,variant:c,color:v,...d}),t&&s.jsx(u.TextField.Slot,{children:t}),C&&s.jsx(u.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,...a},c){return s.jsxs(u.Popover.Root,{defaultOpen:o,modal:t,children:[s.jsx(u.Popover.Trigger,{children:i}),s.jsx(u.Popover.Content,{ref:c,className:w("overmap-popover",r,Wn.wrapper),...a,children:l(u.Popover.Close)})]})}),De=n.memo(qn),O={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:a,rightMinWidth:c=Ne,resizeable:f}){const d=n.useRef(null),g=n.useRef(null),[h,v]=n.useState(0),[C,b]=n.useState(),y=n.useRef(null),[m,_]=n.useState(0),[S,x]=n.useState(),k=n.useCallback(($,T,N)=>(A,Xe,Qe,be)=>{if(!d.current)return;const te=$+be.width;N(d.current.clientWidth-te),T(()=>te)},[]),q=n.useCallback(($,T,N,A)=>k(h,v,x)($,T,N,A),[k,h]),Ue=n.useCallback(($,T,N,A)=>k(m,_,b)($,T,N,A),[k,m]),ee=n.useCallback(($,T,N,A,Xe,Qe,be,te)=>{if(!d.current)return;let oe=$;if(oe===0&&(oe=T,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,_,x,h,o,v,b),[ee,h,c,m,o]),Lt=n.useCallback(()=>ee(h,l,v,b,m,i,_,x),[ee,l,h,m,i]),ne=n.useCallback(($,T)=>{d.current&&$&&T(d.current.clientWidth)},[]),Ft=n.useCallback(()=>ne(o,b),[ne,o]),Ht=n.useCallback(()=>ne(i,x),[ne,i]),Ke=n.useCallback(()=>{var $,T,N,A;d.current&&(b(d.current.clientWidth-((($=y.current)==null?void 0:$.clientWidth)||0)),x(d.current.clientWidth-(((T=g.current)==null?void 0:T.clientWidth)||0)),v(((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 $=new ResizeObserver(Ke);return $.observe(d.current),()=>{$.disconnect()}},[Ke]);const Wt=n.useMemo(()=>({entering:{transform:`translateX(-${h}px)`,marginRight:`-${h}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(-${h}px)`,marginRight:`-${h}px`,transitionProperty:"transform, margin-right",transitionDuration:`${M}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[h]),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(u.Flex,{className:O.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:$=>s.jsx(u.Box,{ref:g,className:w(O.panelContent,O.left),style:Wt[$],width:"auto",height:"100%",m:"0",p:"0",children:s.jsx(Q.Resizable,{className:O.resizable,size:{width:h,height:"100%"},onResizeStop:q,enable:{right:(f==null?void 0:f.left)!==void 0?f.left:!0},minWidth:l,maxWidth:C,handleClasses:{right:w(O.resizeHandle,O.left)},handleComponent:{right:s.jsx(D.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:t})})}),s.jsx("div",{className:O.panelMainContent,children:r}),s.jsx(ie.Transition,{nodeRef:y,timeout:i?0:M,in:i,unmountOnExit:!0,onEntering:jt,onExited:Ft,children:$=>s.jsx(u.Box,{ref:y,className:w(O.panelContent,O.right),style:qt[$],width:"auto",height:"100%",m:"0",p:"0",children:s.jsx(Q.Resizable,{className:O.resizable,size:{width:m,height:"100%"},onResizeStop:Ue,enable:{left:(f==null?void 0:f.right)!==void 0?f.right:!0},minWidth:c,maxWidth:S,handleClasses:{left:w(O.resizeHandle,O.right)},handleComponent:{left:s.jsx(D.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:a})})})]})}),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,a)=>s.jsx(K,{className:w(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-${a}`));return s.jsxs(s.Fragment,{children:[e.title&&s.jsx("div",{className:H.pageTitle,children:e.title}),e.content,s.jsx("div",{className:w(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},a){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(h=>c,[c]);return s.jsx(De,{className:w(H.multiPagePopover,l==="light"?H.light:H.dark,o),content:g,ref:a,...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:a,...c},f){const d=P(i),g=P("info"),h=o||o===void 0&&(c.maxLength!==void 0||c.minLength!==void 0),v=l!==void 0?l.toString():"",C=n.useMemo(()=>{if(t){let b=t.replace("{current}",v.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 v.length},[t,c.maxLength,c.minLength,v.length]);return s.jsxs(s.Fragment,{children:[s.jsx(u.TextArea,{className:w("overmap-textarea",r),style:{resize:a},ref:f,value:l,color:d,...c}),h&&s.jsx(u.Text,{as:"p",className:Kn.charCount,color:g,align:"right",children:C})]})}),Qn=n.memo(Xn),Yn=n.forwardRef(function({loop:r,type:o,rovingFocus:t,value:l,onValueChange:i,defaultValue:a,disabled:c,items:f,className:d,direction:g="row",...h},v){return s.jsx(ve.Root,{type:o,className:w("overmap-toggle-group",d),ref:v,value:l,onValueChange:i,disabled:c,orientation:g==="column"?"vertical":"horizontal",loop:r,rovingFocus:t,defaultValue:a,asChild:!0,children:s.jsx(ae,{direction:g,...h,children:f.map(({children:C,...b})=>n.createElement(ve.Item,{asChild:!0,...b,key:b.value},s.jsx(ce,{className:w("overmap-toggle-group-button"),"aria-label":b.value,variant:b.value===l?"solid":"soft",children:C})))})})}),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:w(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:a,sensitivity:c,action:f,...d},g){const[h,v]=n.useState(!0),C=P(l),b=n.useCallback(y=>{!y&&a&&a(),v(y)},[a]);return s.jsx(G.Root,{asChild:!0,ref:g,...d,open:h,type:c,onOpenChange:b,children:s.jsx(u.Callout.Root,{className:fe.ToastRoot,variant:"surface",color:C,size:i,children:s.jsxs(u.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[s.jsxs(u.Flex,{align:"center",gap:"3",children:[s.jsx(u.Callout.Icon,{children:t}),s.jsxs(u.Flex,{direction:"column",gap:"2",children:[s.jsxs(u.Flex,{direction:"column",gap:"0",children:[s.jsx(G.Title,{asChild:!0,children:s.jsx(u.Callout.Text,{size:"3",weight:"medium",children:r})}),s.jsx(G.Description,{asChild:!0,children:s.jsx(u.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),pe=n.createContext({}),ot=()=>{const e=n.useContext(pe);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};p.unsafeShowToast=void 0;const st=n.memo(function({children:r,className:o,hotkey:t,...l}){const[i,a]=n.useState([]),c=n.useCallback((d,g,h)=>{a(v=>{const C=v.find(b=>b.id===d);return C&&g===0&&clearTimeout(C.timeout),v.filter(b=>b.id!==d)}),h&&h()},[]),f=n.useMemo(()=>{let d=0;const g=y=>{const m=it(y),_=d.toString();d+=1;const S=setTimeout(()=>c(_,1,y.onClose),m);a(x=>[...x,{...y,timeout:S,duration:m,id:_}])},h=y=>g({...y,severity:"primary"}),v=y=>g({...y,severity:"success"}),C=y=>g({...y,severity:"danger"}),b=y=>g({...y,severity:"info"});return p.unsafeShowToast=g,{showToast:g,showPrimary:h,showSuccess:v,showError:C,showInfo:b}},[c]);return n.useEffect(()=>()=>{for(const{timeout:d}of i)clearTimeout(d)},[]),s.jsx(pe.Provider,{value:f,children:s.jsxs(se.ToastProvider,{...l,children:[r,s.jsx(se.ToastViewport,{className:w(o,fe.ToastViewport),hotkey:t}),i.map(({id:d,onClose:g,...h})=>s.jsx(ze,{...h,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(u.Tooltip,{className:w("overmap-tooltip",e,lt.default),ref:l,content:s.jsx(u.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 a=P(o);return s.jsx(u.Text,{ref:i,as:t,className:w(e,{[at.noWrap]:r}),color:a,...l})})),qo="",dt=n.memo(n.forwardRef((e,r)=>{const{panelBackground:o="solid",radius:t="full",...l}=e;return s.jsx(u.Theme,{panelBackground:o,radius:t,ref:r,...l})})),ft={1:"max-content",2:"max-content",3:"max-content",4:"100%"},pt=n.forwardRef(function({severity:r="info",weight:o="light",gap:t="1",text:l,orientation:i="horizontal",size:a,...c},f){const d=z(a,ft),g=P(r);return s.jsxs(u.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(u.Separator,{size:a,orientation:i,color:g,...c}),l&&s.jsxs(s.Fragment,{children:[s.jsx(u.Text,{as:"span",size:"1",weight:o,color:g,children:l}),s.jsx(u.Separator,{size:a,orientation:i,color:g,...c})]})]})}),ht=n.memo(pt);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,a){const c=n.createContext(a),f=o.length;o=[...o,a];function d(h){const{scope:v,children:C,...b}=h,y=(v==null?void 0:v[e][f])||c,m=n.useMemo(()=>b,Object.values(b));return n.createElement(y.Provider,{value:m},C)}function g(h,v){const C=(v==null?void 0:v[e][f])||c,b=n.useContext(C);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,g]}const l=()=>{const i=o.map(a=>n.createContext(a));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 a=t.reduce((c,{useScope:f,scopeName:d})=>{const h=f(i)[`__scope${d}`];return{...c,...h}},{});return n.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};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,a=i?e:t,c=Le(o),f=n.useCallback(d=>{if(i){const h=typeof d=="function"?d(e):d;h!==e&&c(h)}else l(d)},[i,e,l,c]);return[a,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 he=globalThis!=null&&globalThis.document?n.useLayoutEffect:()=>{};function _t(e){const[r,o]=n.useState(void 0);return he(()=>{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 a,c;if("borderBoxSize"in i){const f=i.borderBoxSize,d=Array.isArray(f)?f[0]:f;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;o({width:a,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"),a=e?"mounted":"unmounted",[c,f]=wt(a,{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]),he(()=>{const d=t.current,g=l.current;if(g!==e){const v=i.current,C=R(d);e?f("MOUNT"):C==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(g&&v!==C?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,f]),he(()=>{if(r){const d=h=>{const C=R(t.current).includes(h.animationName);h.target===r&&C&&Re.flushSync(()=>f("ANIMATION_END"))},g=h=>{h.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($t);if(i){const a=i.props.children,c=l.map(f=>f===i?n.Children.count(a)>1?n.Children.only(null):n.isValidElement(a)?a.props.children:null:f);return n.createElement(ge,I({},t,{ref:r}),n.isValidElement(a)?n.cloneElement(a,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 xt=({children:e})=>n.createElement(n.Fragment,null,e);function $t(e){return n.isValidElement(e)&&e.type===xt}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,...a}=t,c=i?He:r;return n.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.createElement(c,I({},a,{ref:l}))});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),qe="Checkbox",[kt,Go]=bt(qe),[Ot,Tt]=kt(qe),Dt=n.forwardRef((e,r)=>{const{__scopeCheckbox:o,name:t,checked:l,defaultChecked:i,required:a,disabled:c,value:f="on",onCheckedChange:d,...g}=e,[h,v]=n.useState(null),C=Be(r,x=>v(x)),b=n.useRef(!1),y=h?!!h.closest("form"):!0,[m=!1,_]=vt({prop:l,defaultProp:i,onChange:d}),S=n.useRef(m);return n.useEffect(()=>{const x=h==null?void 0:h.form;if(x){const k=()=>_(S.current);return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[h,_]),n.createElement(Ot,{scope:o,state:m,disabled:c},n.createElement(We.button,I({type:"button",role:"checkbox","aria-checked":B(m)?"mixed":m,"aria-required":a,"data-state":Ve(m),"data-disabled":c?"":void 0,disabled:c,value:f},g,{ref:C,onKeyDown:je(e.onKeyDown,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:je(e.onClick,x=>{_(k=>B(k)?!0:!k),y&&(b.current=x.isPropagationStopped(),b.current||x.stopPropagation())})})),y&&n.createElement(At,{control:h,bubbles:!b.current,name:t,value:f,checked:m,required:a,disabled:c,style:{transform:"translateX(-100%)"}}))}),Nt="CheckboxIndicator",Et=n.forwardRef((e,r)=>{const{__scopeCheckbox:o,forceMount:t,...l}=e,i=Tt(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),a=yt(o),c=_t(r);return n.useEffect(()=>{const f=i.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==o&&h){const v=new Event("click",{bubbles:t});f.indeterminate=B(o),h.call(f,B(o)?!1:o),f.dispatchEvent(v)}},[a,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,...a},c){const f=`c-${t}-${new Date}`;return s.jsx(ke,{children:({isHovered:d,...g})=>s.jsxs(u.Flex,{className:W.checkboxContainer,...g,children:[s.jsx(zt,{id:f,className:w(W.checkbox,!d&&!l&&W.checkboxHidden,r),checked:l,onCheckedChange:h=>{i&&i(h)},ref:c,...a,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(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,...a}){const[c,f]=n.useState(!1),[d,g]=n.useState(Array(i.length).fill(!1)),h=C=>{const b=c==="indeterminate"||!C;g(d.map(y=>!b)),l&&l(C)};n.useEffect(()=>{const C=d.filter(b=>b).length;C===0?f(!1):C===i.length?f(!0):f("indeterminate")},[i,d]);const v=n.Children.map(i,(C,b)=>n.cloneElement(C,{...C.props,checked:!!C.props.checked||d[b],onCheckedChange:y=>{const m=[...d];m[b]=y,g(m),C.props.onCheckedChange&&C.props.onCheckedChange(y)}}));return s.jsxs(s.Fragment,{children:[s.jsx(Ge,{className:r,labelClassName:o,label:t,checked:c,onCheckedChange:h,...a}),v]})});Object.defineProperty(p,"AccessibleIcon",{enumerable:!0,get:()=>u.AccessibleIcon}),Object.defineProperty(p,"AspectRatio",{enumerable:!0,get:()=>u.AspectRatio}),Object.defineProperty(p,"Avatar",{enumerable:!0,get:()=>u.Avatar}),Object.defineProperty(p,"Blockquote",{enumerable:!0,get:()=>u.Blockquote}),Object.defineProperty(p,"Box",{enumerable:!0,get:()=>u.Box}),Object.defineProperty(p,"Callout",{enumerable:!0,get:()=>u.Callout}),Object.defineProperty(p,"Card",{enumerable:!0,get:()=>u.Card}),Object.defineProperty(p,"Checkbox",{enumerable:!0,get:()=>u.Checkbox}),Object.defineProperty(p,"Code",{enumerable:!0,get:()=>u.Code}),Object.defineProperty(p,"Container",{enumerable:!0,get:()=>u.Container}),Object.defineProperty(p,"ContextMenu",{enumerable:!0,get:()=>u.ContextMenu}),Object.defineProperty(p,"Em",{enumerable:!0,get:()=>u.Em}),Object.defineProperty(p,"Grid",{enumerable:!0,get:()=>u.Grid}),Object.defineProperty(p,"Heading",{enumerable:!0,get:()=>u.Heading}),Object.defineProperty(p,"HoverCard",{enumerable:!0,get:()=>u.HoverCard}),Object.defineProperty(p,"Inset",{enumerable:!0,get:()=>u.Inset}),Object.defineProperty(p,"Kbd",{enumerable:!0,get:()=>u.Kbd}),Object.defineProperty(p,"Link",{enumerable:!0,get:()=>u.Link}),Object.defineProperty(p,"Portal",{enumerable:!0,get:()=>u.Portal}),Object.defineProperty(p,"Quote",{enumerable:!0,get:()=>u.Quote}),Object.defineProperty(p,"RadioGroup",{enumerable:!0,get:()=>u.RadioGroup}),Object.defineProperty(p,"ScrollArea",{enumerable:!0,get:()=>u.ScrollArea}),Object.defineProperty(p,"Section",{enumerable:!0,get:()=>u.Section}),Object.defineProperty(p,"Slider",{enumerable:!0,get:()=>u.Slider}),Object.defineProperty(p,"Slot",{enumerable:!0,get:()=>u.Slot}),Object.defineProperty(p,"Strong",{enumerable:!0,get:()=>u.Strong}),Object.defineProperty(p,"Table",{enumerable:!0,get:()=>u.Table}),Object.defineProperty(p,"Tabs",{enumerable:!0,get:()=>u.Tabs}),Object.defineProperty(p,"TextField",{enumerable:!0,get:()=>u.TextField}),Object.defineProperty(p,"Theme",{enumerable:!0,get:()=>u.Theme}),Object.defineProperty(p,"VisuallyHidden",{enumerable:!0,get:()=>u.VisuallyHidden}),Object.defineProperty(p,"updateThemeAppearanceClass",{enumerable:!0,get:()=>u.updateThemeAppearanceClass}),Object.defineProperty(p,"useThemeContext",{enumerable:!0,get:()=>u.useThemeContext}),p.AlertDialog=$e,p.AlertDialogContent=ue,p.AlertDialogProvider=wn,p.Badge=sn,p.Button=K,p.ButtonGroup=ae,p.ButtonList=Cn,p.DefaultTheme=dt,p.Dialog=mn,p.DropdownMenu=On,p.Flex=Z,p.HoverUtility=ke,p.IconButton=ce,p.Input=Hn,p.LeftAndRightPanels=Vn,p.MultiPagePopover=Un,p.MultiSelect=Nn,p.Popover=De,p.Root=Ae,p.Select=Dn,p.SelectAllCheckbox=Bt,p.Separator=ht,p.Sidebar=Bn,p.SlideOut=Ln,p.Switch=zn,p.Text=ut,p.TextArea=Qn,p.Toast=ze,p.ToastContext=pe,p.ToastProvider=st,p.ToggleGroup=Zn,p.Toolbar=nt,p.Tooltip=ct,p.divButtonProps=ln,p.useAlertDialog=Pe,p.useDiscardAlertDialog=Sn,p.useSeverityColor=P,p.useToast=ot,p.useViewportSize=on,Object.keys(Ce).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(p,e)&&Object.defineProperty(p,e,{enumerable:!0,get:()=>Ce[e]})}),Object.keys(D).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(p,e)&&Object.defineProperty(p,e,{enumerable:!0,get:()=>D[e]})}),Object.defineProperty(p,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 a=typeof i;if(a==="string"||a==="number")t.push(i);else if(Array.isArray(i)){if(i.length){var c=o.apply(null,i);c&&t.push(c)}}else if(a==="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})()})(_e);var nn=_e.exports;const w=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=d.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"}),a=V.useMediaQuery({minWidth:"1024px"}),c=V.useMediaQuery({minWidth:"1280px"}),f=V.useMediaQuery({minWidth:"1640px"});return n.useLayoutEffect(()=>{t(u=>(r(u),f?"xl":c?"lg":a?"md":i?"sm":l?"xs":"initial"))},[c,a,i,f,l]),{size:o,prevSize:e,xs:l,sm:i,md:a,lg:c,xl:f}},we=(e,r,o)=>{const[t,l]=n.useState([]),[i,a]=n.useState(!0),c=n.useCallback(g=>{const{repeat:p,key:C}=g;a(!0),!(p||t.includes(C))&&l(v=>[...v,C])},[t]),f=n.useCallback(g=>{const{key:p}=g;a(!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 u=n.useMemo(()=>!r&&i&&t.length===e.length&&t.every(g=>e.includes(g)),[r,i,t,e]);return n.useEffect(()=>{u&&o()},[u,o]),u},rn=n.forwardRef(function({className:r,severity:o="primary",color:t,children:l,...i},a){const c=P(o);return s.jsx(d.Badge,{className:w("overmap-badge",r),ref:a,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"},Se={spin90Clockwise:U.hoverSpin90Clockwise,spin180Clockwise:U.hoverSpin180Clockwise,spin360Clockwise:U.hoverSpin360Clockwise},ln={role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.currentTarget.click()}},L={small:"1",medium:"2",large:"3"},$e=n.createContext({}),le=()=>n.useContext($e),cn=n.forwardRef(function(r,o){const t=le(),{className:l,type:i="button",fluid:a=t.fluid??!1,size:c=t.size??"medium",severity:f=t.severity??"primary",hoverEffects:u=t.hoverEffects??[],variant:g=t.variant,shortcut:p={keys:[],action:()=>{},disabled:!1},...C}=r,v=P(f),b=u.map(y=>Se[y]);return we(p.keys,p.disabled||p.keys.length===0,p.action),s.jsx(d.Button,{ref:o,type:i,className:w(l,b,{[U.fluid]:a}),color:v,size:z(c,L),variant:g,...C})}),K=n.memo(cn),an=n.forwardRef(function(r,o){const t=le(),{className:l,children:i,type:a="button",fluid:c=t.fluid??!1,size:f=t.size??"medium",severity:u=t.severity??"primary",hoverEffects:g=t.hoverEffects??[],variant:p=t.variant,shortcut:C={keys:[],action:()=>{},disabled:!1},...v}=r,b=P(u),y=(g==null?void 0:g.map(m=>Se[m]))||[];return we(C.keys,C.disabled||C.keys.length===0,C.action),s.jsx(d.IconButton,{className:w(l,y,{[U.fluid]:c}),ref:o,color:b,size:z(f,L),variant:p,type:a,...v,children:i})}),ce=n.memo(an),dn={merged:"_merged_wdgxo_1"},un={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:a,size:c="medium",variant:f,hoverEffects:u,fluid:g,...p},C){const v=z(c,un[i]),b=f==="ghost"?v:"0";return s.jsx(d.Flex,{className:w("overmap-button-group",r,{[dn.merged]:o}),ref:C,gap:o?l??b:l??"2",direction:i,"data-direction":i,...p,children:s.jsx($e.Provider,{value:{size:c,severity:a,variant:f,hoverEffects:u,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:a}=e,c=t?"surface":"ghost",f=z(a,L),u=l&&i?s.jsx(d.Inset,{side:"x",pt:"current",pb:"current",children:o}):l?s.jsx(d.Inset,{side:"bottom",pt:"current",children:o}):i?s.jsx(d.Inset,{side:"top",pb:"current",children:o}):s.jsx(d.Inset,{children:o}),g=s.jsxs(d.Card,{ref:r,size:f,variant:c,children:[l,u,i]});return c==="ghost"?s.jsx(d.Box,{p:"3",children:g}):g})),gn=n.memo(n.forwardRef((e,r)=>{const{children:o,variant:t="outline",size:l,className:i,...a}=e,c=t==="outline"||t==="surface",f=t==="outline"?"ghost":t==="surface"?"soft":t;return s.jsx(pn,{...a,border:c,size:l,children:s.jsx(ae,{size:l,severity:"info",variant:f,className:w(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(d.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(d.Flex,{direction:"column",gap:"2",children:[s.jsxs(d.Flex,{direction:"column",gap:"1",children:[s.jsxs(d.Flex,{justify:"between",children:[s.jsx(d.Dialog.Title,{mb:"0",children:o}),s.jsx(d.Dialog.Close,{children:s.jsx(d.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:s.jsx(D.Cross1Icon,{})})})]}),t&&s.jsx(d.Dialog.Description,{children:t})]}),l(i)]})}),mn=n.memo(n.forwardRef((e,r)=>{const{children:o,content:t,title:l,description:i,onOpen:a,onClose:c,defaultOpen:f,onCloseInterrupt:u,open:g,onOpenChange:p,...C}=e,[v,b]=n.useState(f??!1),y=g??v;if((u||a)&&p)throw new Error("Neither the `onCloseInterrupt` nor `onOpen` props can be used with `onOpenChange`.");if(g!==void 0&&p===void 0)throw new Error("The `open` prop requires the `onOpenChange` prop.");if(!o&&g===void 0)throw new Error("Either the `children` or `open` prop must be defined.");if(o&&g!==void 0)throw new Error("The `children` and `open` props cannot be used together.");const m=n.useCallback(_=>{if(p)return p(_);if(_&&a)a();else{if(!_&&u)return u(()=>{b(!1),c&&c()});!_&&c&&c()}b(_)},[p,a,c,u]),S=n.useCallback(_=>{if(_!=null&&_.force)return b(!1);m(!1)},[m]);return s.jsxs(d.Dialog.Root,{open:y,onOpenChange:m,children:[s.jsx(d.Dialog.Trigger,{children:o}),s.jsx(d.Dialog.Content,{ref:r,...C,children:s.jsx(vn,{closeDialog:S,content:t,title:l,description:i})})]})})),xe=e=>s.jsx(d.AlertDialog.Title,{mb:"0",...e}),yn=e=>{const{title:r,description:o,actionText:t="Confirm",cancelText:l="Cancel",onAction:i,onCancel:a,severity:c}=e;return s.jsxs(d.Flex,{direction:"column",gap:"2",children:[s.jsxs(d.Flex,{direction:"column",gap:"1",children:[s.jsx(xe,{children:r}),s.jsx(d.AlertDialog.Description,{children:o})]}),s.jsxs(d.Flex,{gap:"3",mt:"4",justify:"end",children:[s.jsx(d.AlertDialog.Cancel,{children:s.jsx(K,{variant:"soft",severity:"info",onClick:a,children:l})}),s.jsx(d.AlertDialog.Action,{children:s.jsx(K,{variant:"solid",severity:c,onClick:i,children:t})})]})]})},Pe=n.memo(function(r){const{open:o,setOpen:t,children:l,...i}=r,a=n.useMemo(()=>({close:()=>t(!1),Title:xe,Description:d.AlertDialog.Description}),[t]);return s.jsxs(d.AlertDialog.Root,{open:o,onOpenChange:t,children:[s.jsx(d.AlertDialog.Content,{children:"content"in i?i.content(a):s.jsx(yn,{...i})}),l]})}),de=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),a=n.useCallback(c=>{if(o)throw new Error("AlertDialog is already open");i(c),t(!0)},[o]);return s.jsx(Pe,{open:o,setOpen:t,...l,children:s.jsx(de.Provider,{value:a,children:r})})}),ke=()=>n.useContext(de),Sn=()=>{const e=ke();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])},ue={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},a)=>s.jsx(d.Flex,{className:w(e,{[ue.radius]:r,[ue.zeroMinWidth]:t,[ue.zeroMinHeight]:l}),ref:a,...i,children:o}))),$n=n.memo(function({severity:r,itemContent:o,closeOnSelect:t=!0,onSelect:l,...i}){const a=P(r),c=n.useCallback(f=>{t||f.preventDefault(),l&&l(f)},[t,l]);return s.jsx(d.DropdownMenu.Item,{onSelect:c,color:a,...i,children:o})}),xn=n.memo(function({defaultOpen:r,open:o,onOpenChange:t,modal:l,trigger:i,label:a,severity:c="info",disabled:f=!1,children:u,...g}){const p=P(c);return s.jsxs(d.DropdownMenu.Root,{defaultOpen:r,open:o,onOpenChange:t,modal:l,children:[s.jsx(d.DropdownMenu.Trigger,{disabled:f,children:i}),s.jsxs(d.DropdownMenu.Content,{color:p,...g,children:[a&&s.jsx(d.DropdownMenu.Label,{children:a}),u]})]})}),Pn=n.memo(function({separatorBelow:r=!1,separatorAbove:o=!1,children:t,...l}){return s.jsxs(s.Fragment,{children:[o&&s.jsx(d.DropdownMenu.Separator,{}),s.jsx(d.DropdownMenu.Group,{...l,children:t}),r&&s.jsx(d.DropdownMenu.Separator,{})]})}),kn=n.memo(function({defaultOpen:r,open:o,onOpenChange:t,trigger:l,children:i,...a}){return s.jsxs(d.DropdownMenu.Sub,{defaultOpen:r,open:o,onOpenChange:t,children:[s.jsx(d.DropdownMenu.SubTrigger,{children:l}),s.jsx(d.DropdownMenu.SubContent,{...a,children:i})]})}),On={Root:xn,ItemGroup:Pn,Item:$n,SubMenu:kn},Oe=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"},Tn=n.forwardRef(function({className:r,fluid:o,size:t="medium",variant:l="surface",severity:i="primary",itemSeverity:a="info",placeholder:c="Select",side:f,items:u=[],value:g,id:p,...C},v){const b=z(t,L),y=P(i),m=P(a);return n.createElement(d.Select.Root,{size:b,...C,key:g===void 0?1:0,value:g},s.jsx(d.Select.Trigger,{className:w(r,{[Te.fluid]:o}),id:p,ref:v,variant:l,placeholder:c,color:y}),s.jsx(d.Select.Content,{side:f,className:Te.contentDefault,position:"popper",variant:l!=="surface"?"soft":"solid",color:m,children:u.map(({itemContent:S,value:_,...$})=>s.jsx(d.Select.Item,{className:"overmap-select-item",value:_,...$,children:S},_))}))}),Dn=n.memo(Tn),De=n.memo(n.forwardRef((e,r)=>{const{checked:o,label:t,value:l,size:i="2"}=e;return s.jsx(d.Box,{asChild:!0,px:i,children:s.jsx(d.Select.Item,{value:l,ref:r,children:s.jsxs(d.Flex,{gap:i,align:"center",children:[s.jsx(d.Checkbox,{checked:o}),t]})})})})),J="__select_all__",En=n.memo(n.forwardRef((e,r)=>{const[o,t]=n.useState(!1),{placeholder:l,value:i,onValueChange:a,options:c,disabled:f,name:u,...g}=e,p=z(e.size,L),C=P(e.severity),v=n.useMemo(()=>new Map(c.map(_=>[_.value,_.label])),[c]),b=i.length>4?`${i.length} options selected`:s.jsx("span",{children:i.flatMap(_=>[v.get(_),", "]).slice(0,-1)}),y=n.useCallback(()=>t(!1),[]),m=n.useCallback(_=>{_&&t(!0)},[]),S=n.useCallback(_=>{let $;_===J?$=i.length===c.length?[]:c.map(q=>q.value):$=i.includes(_)?i.filter(k=>k!==_):[...i,_],a($)},[a,c,i]);return n.useEffect(()=>{if(c.some(({value:_})=>_===J))throw new Error(`Cannot have an option with the value "${J}"`)},[c]),s.jsxs(d.Select.Root,{open:o,value:"",onOpenChange:m,onValueChange:S,disabled:f,size:p,name:u,autoComplete:"off",children:[s.jsx(d.Select.Trigger,{ref:r,color:C,placeholder:i.length>0?b:l,"data-placeholder":i.length>0?void 0:!0,...g}),s.jsxs(d.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:y,onPointerDownOutside:y,children:[s.jsx(De,{value:J,label:"Select all",checked:i.length===c.length,size:p}),c.map(_=>s.jsx(De,{..._,checked:i.includes(_.value),size:p},_.value))]})]})})),Nn={default:"_default_u936h_1"},An=n.forwardRef(function({className:r,severity:o="primary",icon:t,defaultChecked:l=!1,onCheckedChange:i,...a},c){const f=n.useRef(null),[u,g]=n.useState(a.checked?a.checked:l),[p,C]=n.useState(),v=P(o);n.useLayoutEffect(()=>{var S;const m=c||f;"current"in m&&m.current&&C((S=m.current)==null?void 0:S.querySelector("span.rt-SwitchThumb"))},[c]);const b=n.useCallback(m=>{g(m),i&&i(m)},[i]),y=a.checked?a.checked:u;return s.jsxs(s.Fragment,{children:[s.jsx(d.Switch,{className:w("overmap-switch",r,Nn.default),ref:c||f,color:v,radius:"full",defaultChecked:l,onCheckedChange:b,...a}),s.jsx(d.Portal,{container:p,asChild:!0,children:t&&"checked"in t?y?t.checked:t.unchecked:t})]})}),zn=n.memo(An),j={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:a=!0,resizable:c=!0,minWidth:f="300px",maxWidth:u="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"]',S=document.querySelector(m);if(S===void 0)throw new Error(`Could not find a container element using the following selector ${m}`);y(S)},[i]),s.jsx(Y.Root,{open:l,modal:o,children:s.jsxs(Y.Portal,{container:b,children:[a&&s.jsx(Y.Overlay,{className:w(j.overlay)}),s.jsx(Y.Content,{className:w("overmap-sidebar","rt-DialogContent",j.sidebarContent,{[j.left]:v,[j.right]:C}),ref:p,asChild:!0,...g,children:s.jsx(d.Box,{width:"auto",children:s.jsx(Q.Resizable,{minWidth:f,maxWidth:u,defaultSize:Mn,enable:{right:c&&v,left:c&&C},handleClasses:{left:j.resizeHandle,right:j.resizeHandle},handleComponent:{right:s.jsx(D.DragHandleDots2Icon,{}),left:s.jsx(D.DragHandleDots2Icon,{})},children:t})})})]})})}),Bn=n.memo(In),N={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"},Ln=200,jn=n.memo(function({className:r,open:o,side:t="left",children:l,minWidth:i,maxWidth:a,resizable:c=!0,overlay:f=!1,modal:u=!1,resizeHandle:g,position:p="absolute",...C}){const v=n.useRef(null),[b,y]=n.useState(i),m=t==="left",S=t==="right",_=n.useCallback(($,k,q,Ue)=>{y(q.clientWidth),v.current&&(v.current.style.width=`${q.clientWidth}px`)},[]);return s.jsx(ie.CSSTransition,{in:o,classNames:{enter:N.enter,enterActive:N.enterActive,exitActive:N.exitActive,exitDone:N.exitDone},timeout:Ln,nodeRef:v,unmountOnExit:!0,mountOnEnter:!0,children:s.jsxs(s.Fragment,{children:[f&&s.jsx("div",{className:w("overamp-slide-out-overlay",N.slideOutOverlay)}),s.jsx(Ze.DismissableLayer,{disableOutsidePointerEvents:u,asChild:!0,...C,children:s.jsx(d.Flex,{className:w("overmap-slide-out",r,N.outerContent,{[N.left]:m,[N.right]:S}),style:{"--slide-out-width":`${b}px`},height:"100%",width:"auto",position:p,top:"0",bottom:"0",left:m?"0":void 0,right:S?"0":void 0,ref:v,children:s.jsx(Q.Resizable,{className:N.resizable,defaultSize:{width:b,height:"100%"},onResize:_,enable:{right:c&&m,left:c&&S},handleComponent:{left:g,right:g},minWidth:i,maxWidth:a,children:l})})})]})})}),F={accommodateCharCount:"_accommodateCharCount_yobgh_1",wrapper:"_wrapper_yobgh_5",default:"_default_yobgh_10",noLeftIcon:"_noLeftIcon_yobgh_14",noRightIcon:"_noRightIcon_yobgh_18",charCount:"_charCount_yobgh_22"},Fn=n.forwardRef(function({className:r,leftSlot:o,rightSlot:t,size:l="medium",showInputLength:i,value:a,variant:c,severity:f="primary",...u},g){const p=z(l,L),C=P(f),v=i||i===void 0&&u.maxLength!==void 0,b=a!==void 0?a.toString():void 0;return s.jsxs(d.TextField.Root,{className:w(F.wrapper,r,{[F.accommodateCharCount]:v}),size:p,variant:c,color:C,children:[o&&s.jsx(d.TextField.Slot,{children:o}),s.jsx(d.TextField.Input,{className:w(F.default,{[F.noLeftIcon]:!o,[F.noRightIcon]:!t}),ref:g,value:a,size:p,variant:c,color:C,...u}),t&&s.jsx(d.TextField.Slot,{children:t}),v&&s.jsx(d.Text,{as:"p",className:F.charCount,size:"1",color:"gray",children:u.maxLength!==void 0?`${b==null?void 0:b.length}/${u.maxLength}`:`${b==null?void 0:b.length}`})]})}),Hn=n.memo(Fn),Wn={wrapper:"_wrapper_tmtz0_1"},qn=n.forwardRef(function({className:r,trigger:o,open:t,onOpenChange:l,defaultOpen:i=!1,modal:a=!1,children:c,...f},u){return s.jsxs(d.Popover.Root,{defaultOpen:i,modal:a,open:t,onOpenChange:l,children:[s.jsx(d.Popover.Trigger,{children:o}),s.jsx(d.Popover.Content,{ref:u,className:w("overmap-popover",r,Wn.wrapper),...f,children:c(d.Popover.Close)})]})}),Ee=n.memo(qn),O={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:a,rightMinWidth:c=Ne,resizeable:f}){const u=n.useRef(null),g=n.useRef(null),[p,C]=n.useState(0),[v,b]=n.useState(),y=n.useRef(null),[m,S]=n.useState(0),[_,$]=n.useState(),k=n.useCallback((x,T,E)=>(A,Xe,Qe,Ce)=>{if(!u.current)return;const te=x+Ce.width;E(u.current.clientWidth-te),T(()=>te)},[]),q=n.useCallback((x,T,E,A)=>k(p,C,$)(x,T,E,A),[k,p]),Ue=n.useCallback((x,T,E,A)=>k(m,S,b)(x,T,E,A),[k,m]),ee=n.useCallback((x,T,E,A,Xe,Qe,Ce,te)=>{if(!u.current)return;let oe=x;if(oe===0&&(oe=T,E(oe)),Qe){const re=u.current.clientWidth-oe;te(re),Xe>re&&(Ce(re),A(u.current.clientWidth-re))}},[]),Lt=n.useCallback(()=>ee(m,c,S,$,p,o,C,b),[ee,p,c,m,o]),jt=n.useCallback(()=>ee(p,l,C,b,m,i,S,$),[ee,l,p,m,i]),ne=n.useCallback((x,T)=>{u.current&&x&&T(u.current.clientWidth)},[]),Ft=n.useCallback(()=>ne(o,b),[ne,o]),Ht=n.useCallback(()=>ne(i,$),[ne,i]),Ke=n.useCallback(()=>{var x,T,E,A;u.current&&(b(u.current.clientWidth-(((x=y.current)==null?void 0:x.clientWidth)||0)),$(u.current.clientWidth-(((T=g.current)==null?void 0:T.clientWidth)||0)),C(((E=g.current)==null?void 0:E.clientWidth)||0),S(((A=y.current)==null?void 0:A.clientWidth)||0))},[]);n.useEffect(()=>{if(!u.current)return;const x=new ResizeObserver(Ke);return x.observe(u.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(d.Flex,{className:O.wrapper,style:{minWidth:`${l+c}px`},ref:u,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:jt,onExited:Ht,children:x=>s.jsx(d.Box,{ref:g,className:w(O.panelContent,O.left),style:Wt[x],width:"auto",height:"100%",m:"0",p:"0",children:s.jsx(Q.Resizable,{className:O.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:w(O.resizeHandle,O.left)},handleComponent:{right:s.jsx(D.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:t})})}),s.jsx("div",{className:O.panelMainContent,children:r}),s.jsx(ie.Transition,{nodeRef:y,timeout:i?0:M,in:i,unmountOnExit:!0,onEntering:Lt,onExited:Ft,children:x=>s.jsx(d.Box,{ref:y,className:w(O.panelContent,O.right),style:qt[x],width:"auto",height:"100%",m:"0",p:"0",children:s.jsx(Q.Resizable,{className:O.resizable,size:{width:m,height:"100%"},onResizeStop:Ue,enable:{left:(f==null?void 0:f.right)!==void 0?f.right:!0},minWidth:c,maxWidth:_,handleClasses:{left:w(O.resizeHandle,O.right)},handleComponent:{left:s.jsx(D.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:a})})})]})}),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 Ae(e,r,o,t=0){if(!e.options)return e.content||s.jsx(s.Fragment,{});const l=e.options.map((i,a)=>s.jsx(K,{className:w(H.optionsButton,i.buttonClassName),variant:"ghost",radius:"large",style:{width:o==="vertical"?"100%":"auto"},onClick:i.onClick||(()=>r(Ae(i.page||{},r,o,t+1))),children:i.label},`${i.value}-page-${t}-button-${a}`));return s.jsxs(s.Fragment,{children:[e.title&&s.jsx("div",{className:H.pageTitle,children:e.title}),e.content,s.jsx("div",{className:w(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},a){const[c,f]=n.useState(void 0),u=n.useCallback(()=>{f(Ae(r,f,t,0))},[t,r]);n.useEffect(()=>{u()},[u]);const g=n.useCallback(p=>c,[c]);return s.jsx(Ee,{className:w(H.multiPagePopover,l==="light"?H.light:H.dark,o),ref:a,...i,onCloseAutoFocus:u,children:p=>g(p)})}),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:a,...c},f){const u=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(d.TextArea,{className:w("overmap-textarea",r),style:{resize:a},ref:f,value:l,color:u,...c}),p&&s.jsx(d.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:a,disabled:c,items:f,className:u,direction:g="row",...p},C){return s.jsx(me.Root,{type:o,className:w("overmap-toggle-group",u),ref:C,value:l,onValueChange:i,disabled:c,orientation:g==="column"?"vertical":"horizontal",loop:r,rovingFocus:t,defaultValue:a,asChild:!0,children:s.jsx(ae,{direction:g,...p,children:f.map(({children:v,...b})=>n.createElement(me.Item,{asChild:!0,...b,key:b.value},s.jsx(ce,{className:w("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"},ze=n.memo(n.forwardRef(({className:e,minContentGap:r="2",children:o,...t},l)=>s.jsx(Je.Root,{className:w(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:ze,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:a,sensitivity:c,action:f,...u},g){const[p,C]=n.useState(!0),v=P(l),b=n.useCallback(y=>{!y&&a&&a(),C(y)},[a]);return s.jsx(G.Root,{asChild:!0,ref:g,...u,open:p,type:c,onOpenChange:b,children:s.jsx(d.Callout.Root,{className:fe.ToastRoot,variant:"surface",color:v,size:i,children:s.jsxs(d.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[s.jsxs(d.Flex,{align:"center",gap:"3",children:[s.jsx(d.Callout.Icon,{children:t}),s.jsxs(d.Flex,{direction:"column",gap:"2",children:[s.jsxs(d.Flex,{direction:"column",gap:"0",children:[s.jsx(G.Title,{asChild:!0,children:s.jsx(d.Callout.Text,{size:"3",weight:"medium",children:r})}),s.jsx(G.Description,{asChild:!0,children:s.jsx(d.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,{})})})]})})})}),Me=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,Ie=5e3,it=e=>{if(e.duration&&e.duration>=Ie)return e.duration;const r=e.severity==="danger"?1.5:1,o=e.description.split(" ").length+e.title.split(" ").length;return(Ie+o/rt)*r};h.unsafeShowToast=void 0;const st=n.memo(function({children:r,className:o,hotkey:t,...l}){const[i,a]=n.useState([]),c=n.useCallback((u,g,p)=>{a(C=>{const v=C.find(b=>b.id===u);return v&&g===0&&clearTimeout(v.timeout),C.filter(b=>b.id!==u)}),p&&p()},[]),f=n.useMemo(()=>{let u=0;const g=y=>{const m=it(y),S=u.toString();u+=1;const _=setTimeout(()=>c(S,1,y.onClose),m);a($=>[...$,{...y,timeout:_,duration:m,id:S}])},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:u}of i)clearTimeout(u)},[]),s.jsx(he.Provider,{value:f,children:s.jsxs(se.ToastProvider,{...l,children:[r,s.jsx(se.ToastViewport,{className:w(o,fe.ToastViewport),hotkey:t}),i.map(({id:u,onClose:g,...p})=>s.jsx(Me,{...p,onClose:()=>c(u,0,g)},u))]})})}),lt={default:"_default_1odpt_1"},ct=n.memo(n.forwardRef(({className:e,children:r,content:o,...t},l)=>s.jsx(d.Tooltip,{className:w("overmap-tooltip",e,lt.default),ref:l,content:s.jsx(d.Flex,{align:"center",gap:"1",width:"max-content",height:"max-content",justify:"center",children:o}),...t,children:r}))),at={noWrap:"_noWrap_1wpa5_1"},dt=n.memo(n.forwardRef(({className:e,noWrap:r,severity:o,as:t,...l},i)=>{const a=P(o);return s.jsx(d.Text,{ref:i,as:t,className:w(e,{[at.noWrap]:r}),color:a,...l})})),qo="",ut=n.memo(n.forwardRef((e,r)=>{const{panelBackground:o="solid",radius:t="full",...l}=e;return s.jsx(d.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:a,...c},f){const u=z(a,ft),g=P(r);return s.jsxs(d.Flex,{ref:f,width:i==="horizontal"?u:"max-content",height:i==="vertical"?u:"max-content",direction:i==="vertical"?"column":"row",align:"center",gap:t,children:[s.jsx(d.Separator,{size:a,orientation:i,color:g,...c}),l&&s.jsxs(s.Fragment,{children:[s.jsx(d.Text,{as:"span",size:"1",weight:o,color:g,children:l}),s.jsx(d.Separator,{size:a,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 Be(...e){return r=>e.forEach(o=>gt(o,r))}function Le(...e){return n.useCallback(Be(...e),e)}function bt(e,r=[]){let o=[];function t(i,a){const c=n.createContext(a),f=o.length;o=[...o,a];function u(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(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,g]}const l=()=>{const i=o.map(a=>n.createContext(a));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 a=t.reduce((c,{useScope:f,scopeName:u})=>{const p=f(i)[`__scope${u}`];return{...c,...p}},{});return n.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};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 Fe(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,a=i?e:t,c=Fe(o),f=n.useCallback(u=>{if(i){const p=typeof u=="function"?u(e):u;p!==e&&c(p)}else l(u)},[i,e,l,c]);return[a,f]}function mt({defaultProp:e,onChange:r}){const o=n.useState(e),[t]=o,l=n.useRef(t),i=Fe(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 a,c;if("borderBoxSize"in i){const f=i.borderBoxSize,u=Array.isArray(f)?f[0]:f;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;o({width:a,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 He=e=>{const{present:r,children:o}=e,t=St(r),l=typeof o=="function"?o({present:t.isPresent}):n.Children.only(o),i=Le(t.ref,l.ref);return typeof o=="function"||t.isPresent?n.cloneElement(l,{ref:i}):null};He.displayName="Presence";function St(e){const[r,o]=n.useState(),t=n.useRef({}),l=n.useRef(e),i=n.useRef("none"),a=e?"mounted":"unmounted",[c,f]=wt(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const u=R(t.current);i.current=c==="mounted"?u:"none"},[c]),pe(()=>{const u=t.current,g=l.current;if(g!==e){const C=i.current,v=R(u);e?f("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?f("UNMOUNT"):f(g&&C!==v?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,f]),pe(()=>{if(r){const u=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",u),r.addEventListener("animationend",u),()=>{r.removeEventListener("animationstart",g),r.removeEventListener("animationcancel",u),r.removeEventListener("animationend",u)}}else f("ANIMATION_END")},[r,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback(u=>{u&&(t.current=getComputedStyle(u)),o(u)},[])}}function R(e){return(e==null?void 0:e.animationName)||"none"}const We=n.forwardRef((e,r)=>{const{children:o,...t}=e,l=n.Children.toArray(o),i=l.find(xt);if(i){const a=i.props.children,c=l.map(f=>f===i?n.Children.count(a)>1?n.Children.only(null):n.isValidElement(a)?a.props.children:null:f);return n.createElement(ge,I({},t,{ref:r}),n.isValidElement(a)?n.cloneElement(a,void 0,c):null)}return n.createElement(ge,I({},t,{ref:r}),o)});We.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?Be(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 qe=["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,...a}=t,c=i?We:r;return n.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.createElement(c,I({},a,{ref:l}))});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),Ve="Checkbox",[kt,Go]=bt(Ve),[Ot,Tt]=kt(Ve),Dt=n.forwardRef((e,r)=>{const{__scopeCheckbox:o,name:t,checked:l,defaultChecked:i,required:a,disabled:c,value:f="on",onCheckedChange:u,...g}=e,[p,C]=n.useState(null),v=Le(r,$=>C($)),b=n.useRef(!1),y=p?!!p.closest("form"):!0,[m=!1,S]=vt({prop:l,defaultProp:i,onChange:u}),_=n.useRef(m);return n.useEffect(()=>{const $=p==null?void 0:p.form;if($){const k=()=>S(_.current);return $.addEventListener("reset",k),()=>$.removeEventListener("reset",k)}},[p,S]),n.createElement(Ot,{scope:o,state:m,disabled:c},n.createElement(qe.button,I({type:"button",role:"checkbox","aria-checked":B(m)?"mixed":m,"aria-required":a,"data-state":Ge(m),"data-disabled":c?"":void 0,disabled:c,value:f},g,{ref:v,onKeyDown:je(e.onKeyDown,$=>{$.key==="Enter"&&$.preventDefault()}),onClick:je(e.onClick,$=>{S(k=>B(k)?!0:!k),y&&(b.current=$.isPropagationStopped(),b.current||$.stopPropagation())})})),y&&n.createElement(At,{control:p,bubbles:!b.current,name:t,value:f,checked:m,required:a,disabled:c,style:{transform:"translateX(-100%)"}}))}),Et="CheckboxIndicator",Nt=n.forwardRef((e,r)=>{const{__scopeCheckbox:o,forceMount:t,...l}=e,i=Tt(Et,o);return n.createElement(He,{present:t||B(i.state)||i.state===!0},n.createElement(qe.span,I({"data-state":Ge(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),a=yt(o),c=_t(r);return n.useEffect(()=>{const f=i.current,u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==o&&p){const C=new Event("click",{bubbles:t});f.indeterminate=B(o),p.call(f,B(o)?!1:o),f.dispatchEvent(C)}},[a,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 Ge(e){return B(e)?"indeterminate":e?"checked":"unchecked"}const zt=Dt,Mt=Nt,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,...a},c){const f=`c-${t}-${new Date}`;return s.jsx(Oe,{children:({isHovered:u,...g})=>s.jsxs(d.Flex,{className:W.checkboxContainer,...g,children:[s.jsx(zt,{id:f,className:w(W.checkbox,!u&&!l&&W.checkboxHidden,r),checked:l,onCheckedChange:p=>{i&&i(p)},ref:c,...a,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(W.checkboxLabel,o,W.noTextHighlight),htmlFor:f,children:t})]})})}),be=n.memo(It);be.displayName="Checkbox";const Bt=n.memo(function({className:r,labelClassName:o,label:t,onCheckedChange:l,children:i,...a}){const[c,f]=n.useState(!1),[u,g]=n.useState(Array(i.length).fill(!1)),p=v=>{const b=c==="indeterminate"||!v;g(u.map(y=>!b)),l&&l(v)};n.useEffect(()=>{const v=u.filter(b=>b).length;v===0?f(!1):v===i.length?f(!0):f("indeterminate")},[i,u]);const C=n.Children.map(i,(v,b)=>n.cloneElement(v,{...v.props,checked:!!v.props.checked||u[b],onCheckedChange:y=>{const m=[...u];m[b]=y,g(m),v.props.onCheckedChange&&v.props.onCheckedChange(y)}}));return s.jsxs(s.Fragment,{children:[s.jsx(be,{className:r,labelClassName:o,label:t,checked:c,onCheckedChange:p,...a}),C]})});Object.defineProperty(h,"AccessibleIcon",{enumerable:!0,get:()=>d.AccessibleIcon}),Object.defineProperty(h,"AspectRatio",{enumerable:!0,get:()=>d.AspectRatio}),Object.defineProperty(h,"Avatar",{enumerable:!0,get:()=>d.Avatar}),Object.defineProperty(h,"Blockquote",{enumerable:!0,get:()=>d.Blockquote}),Object.defineProperty(h,"Box",{enumerable:!0,get:()=>d.Box}),Object.defineProperty(h,"Callout",{enumerable:!0,get:()=>d.Callout}),Object.defineProperty(h,"Card",{enumerable:!0,get:()=>d.Card}),Object.defineProperty(h,"Code",{enumerable:!0,get:()=>d.Code}),Object.defineProperty(h,"Container",{enumerable:!0,get:()=>d.Container}),Object.defineProperty(h,"ContextMenu",{enumerable:!0,get:()=>d.ContextMenu}),Object.defineProperty(h,"Em",{enumerable:!0,get:()=>d.Em}),Object.defineProperty(h,"Grid",{enumerable:!0,get:()=>d.Grid}),Object.defineProperty(h,"Heading",{enumerable:!0,get:()=>d.Heading}),Object.defineProperty(h,"HoverCard",{enumerable:!0,get:()=>d.HoverCard}),Object.defineProperty(h,"Inset",{enumerable:!0,get:()=>d.Inset}),Object.defineProperty(h,"Kbd",{enumerable:!0,get:()=>d.Kbd}),Object.defineProperty(h,"Link",{enumerable:!0,get:()=>d.Link}),Object.defineProperty(h,"Portal",{enumerable:!0,get:()=>d.Portal}),Object.defineProperty(h,"Quote",{enumerable:!0,get:()=>d.Quote}),Object.defineProperty(h,"RadioGroup",{enumerable:!0,get:()=>d.RadioGroup}),Object.defineProperty(h,"ScrollArea",{enumerable:!0,get:()=>d.ScrollArea}),Object.defineProperty(h,"Section",{enumerable:!0,get:()=>d.Section}),Object.defineProperty(h,"Slider",{enumerable:!0,get:()=>d.Slider}),Object.defineProperty(h,"Slot",{enumerable:!0,get:()=>d.Slot}),Object.defineProperty(h,"Strong",{enumerable:!0,get:()=>d.Strong}),Object.defineProperty(h,"Table",{enumerable:!0,get:()=>d.Table}),Object.defineProperty(h,"Tabs",{enumerable:!0,get:()=>d.Tabs}),Object.defineProperty(h,"TextField",{enumerable:!0,get:()=>d.TextField}),Object.defineProperty(h,"Theme",{enumerable:!0,get:()=>d.Theme}),Object.defineProperty(h,"VisuallyHidden",{enumerable:!0,get:()=>d.VisuallyHidden}),Object.defineProperty(h,"updateThemeAppearanceClass",{enumerable:!0,get:()=>d.updateThemeAppearanceClass}),Object.defineProperty(h,"useThemeContext",{enumerable:!0,get:()=>d.useThemeContext}),h.AlertDialog=Pe,h.AlertDialogContent=de,h.AlertDialogProvider=wn,h.Badge=sn,h.Button=K,h.ButtonGroup=ae,h.ButtonList=Cn,h.Checkbox=be,h.DefaultTheme=ut,h.Dialog=mn,h.DropdownMenu=On,h.Flex=Z,h.HoverUtility=Oe,h.IconButton=ce,h.Input=Hn,h.LeftAndRightPanels=Vn,h.MultiPagePopover=Un,h.MultiSelect=En,h.Popover=Ee,h.Root=ze,h.Select=Dn,h.SelectAllCheckbox=Bt,h.Separator=pt,h.Sidebar=Bn,h.SlideOut=jn,h.Switch=zn,h.Text=dt,h.TextArea=Qn,h.Toast=Me,h.ToastContext=he,h.ToastProvider=st,h.ToggleGroup=Zn,h.Toolbar=nt,h.Tooltip=ct,h.divButtonProps=ln,h.useAlertDialog=ke,h.useDiscardAlertDialog=Sn,h.useSeverityColor=P,h.useToast=ot,h.useViewportSize=on,Object.keys(ve).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(h,e)&&Object.defineProperty(h,e,{enumerable:!0,get:()=>ve[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
|