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