@overmap-ai/blocks 0.0.7 → 0.0.8
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/SlideOut/SlideOut.d.ts +37 -0
- package/dist/SlideOut/index.d.ts +1 -0
- package/dist/blocks.js +767 -684
- 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 -0
- package/dist/style.css +1 -1
- package/dist/utils.d.ts +10 -0
- package/package.json +4 -2
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(a,
|
|
1
|
+
(function(a,q){typeof exports=="object"&&typeof module<"u"?q(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("react-transition-group"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toast")):typeof define=="function"&&define.amd?define(["exports","@radix-ui/themes/styles.css","@radix-ui/colors","@radix-ui/react-icons","@radix-ui/themes","react/jsx-runtime","react","react-responsive","@radix-ui/react-dialog","re-resizable","react-transition-group","@radix-ui/react-toggle-group","@radix-ui/react-toast"],q):(a=typeof globalThis<"u"?globalThis:a||self,q(a.blocks={},null,a.colors,a.reactIcons,a.themes,a.jsxRuntime,a.React,null,a.RadixDialogPrimitive,a.reResizable,a.reactTransitionGroup,a.reactToggleGroup,a.RadixToast))})(this,function(a,q,de,z,t,e,n,Wn,L,U,R,ue,ee){"use strict";function fe(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const i in l)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(l,i);Object.defineProperty(s,i,r.get?r:{enumerable:!0,get:()=>l[i]})}}return s.default=l,Object.freeze(s)}const X=fe(L),F=fe(ee);function xe(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var pe={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(i){(function(){var c={}.hasOwnProperty;function l(){for(var o=[],s=0;s<arguments.length;s++){var r=arguments[s];if(r){var u=typeof r;if(u==="string"||u==="number")o.push(r);else if(Array.isArray(r)){if(r.length){var d=l.apply(null,r);d&&o.push(d)}}else if(u==="object"){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){o.push(r.toString());continue}for(var p in r)c.call(r,p)&&r[p]&&o.push(p)}}}return o.join(" ")}i.exports?(l.default=l,i.exports=l):window.classNames=l})()})(se);var Te=se.exports;const m=Pe(Te);function I(i,c){return t.useMemo(()=>{if(i!==void 0)if(typeof i=="object"){if(!("initial"in i))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(i).map(([l,o])=>[l,c[o]]))}else return c[i]},[c,i])}const Oe={success:"green",danger:"red",info:"gray"},T=i=>{const c=n.useThemeContext();if(i)return i==="primary"?c.accentColor:Oe[i]},De=t.forwardRef(function({className:c,severity:l="primary",color:o,children:s,...r},u){const d=T(l);return e.jsx(n.Badge,{className:m("overmap-badge",c),ref:u,color:o||d,...r,children:s})}),xe=t.memo(De),L={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},de={spin90Clockwise:L.hoverSpin90Clockwise,spin180Clockwise:L.hoverSpin180Clockwise,spin360Clockwise:L.hoverSpin360Clockwise},ke={role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.currentTarget.click()}},B={small:"1",medium:"2",large:"3"},ue=t.createContext({}),J=()=>t.useContext(ue),ze=t.forwardRef(function(c,l){const o=J(),{className:s,type:r="button",fluid:u=o.fluid??!1,size:d=o.size??"medium",severity:p=o.severity??"primary",hoverEffects:f=o.hoverEffects??[],variant:h=o.variant,...C}=c,b=T(p),y=f.map(g=>de[g]);return e.jsx(n.Button,{ref:l,type:r,className:m(s,y,{[L.fluid]:u}),color:b,size:I(d,B),variant:h,...C})}),W=t.memo(ze),je=t.forwardRef(function(c,l){const o=J(),{className:s,children:r,type:u="button",fluid:d=o.fluid??!1,size:p=o.size??"medium",severity:f=o.severity??"primary",hoverEffects:h=o.hoverEffects??[],variant:C=o.variant,...b}=c,y=T(f),g=(h==null?void 0:h.map(v=>de[v]))||[];return e.jsx(n.IconButton,{className:m(s,g,{[L.fluid]:d}),ref:l,color:y,size:I(p,B),variant:C,type:u,...b,children:r})}),Z=t.memo(je),Ie={merged:"_merged_wdgxo_1"},Ae={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},$e=t.forwardRef(function({className:c,merged:l=!1,children:o,gap:s,direction:r="row",severity:u,size:d="medium",variant:p,hoverEffects:f,fluid:h,...C},b){const y=I(d,Ae[r]),g=p==="ghost"?y:"0";return e.jsx(n.Flex,{className:m("overmap-button-group",c,{[Ie.merged]:l}),ref:b,gap:l?s??g:s??"2",direction:r,"data-direction":r,...C,children:e.jsx(ue.Provider,{value:{size:d,severity:u,variant:p,hoverEffects:f,fluid:h},children:o})})}),R=t.memo($e),Be={separators:"_separators_1f7v1_1"},Me=t.memo(t.forwardRef((i,c)=>{const{children:l,border:o,before:s,after:r,size:u}=i,d=o?"surface":"ghost",p=I(u,B),f=s&&r?e.jsx(n.Inset,{side:"x",pt:"current",pb:"current",children:l}):s?e.jsx(n.Inset,{side:"bottom",pt:"current",children:l}):r?e.jsx(n.Inset,{side:"top",pb:"current",children:l}):e.jsx(n.Inset,{children:l}),h=e.jsxs(n.Card,{ref:c,size:p,variant:d,children:[s,f,r]});return d==="ghost"?e.jsx(n.Box,{p:"3",children:h}):h})),Ee=t.memo(t.forwardRef((i,c)=>{const{children:l,variant:o="outline",size:s,className:r,...u}=i,d=o==="outline"||o==="surface",p=o==="outline"?"ghost":o==="surface"?"soft":o;return e.jsx(Me,{...u,border:d,size:s,children:e.jsx(R,{size:s,severity:"info",variant:p,className:m(r,Be.separators),merged:!0,gap:"0",direction:"column",ref:c,children:l})})})),Ne=t.memo(t.forwardRef((i,c)=>{const{variant:l}=J(),o=e.jsx(W,{ref:c,...i,radius:"large",variant:l});return l==="ghost"?e.jsx(n.Box,{asChild:!0,my:"1",mx:"2",children:o}):o})),Le={Root:Ee,Item:Ne},Fe=t.memo(function(c){const{title:l,description:o,content:s,closeDialog:r}=c;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{justify:"between",children:[e.jsx(n.Dialog.Title,{mb:"0",children:l}),e.jsx(n.Dialog.Close,{children:e.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:e.jsx(j.Cross1Icon,{})})})]}),o&&e.jsx(n.Dialog.Description,{children:o})]}),s(r)]})}),He=t.memo(t.forwardRef((i,c)=>{const{children:l,content:o,title:s,description:r,onOpen:u,defaultOpen:d,onCloseInterrupt:p,...f}=i,[h,C]=t.useState(d??!1),b=t.useCallback(g=>{if(g&&u)u();else if(!g&&p)return p(()=>C(!1));C(g)},[u,p]),y=t.useCallback(g=>{if(g!=null&&g.force)return C(!1);b(!1)},[b]);return e.jsxs(n.Dialog.Root,{open:h,onOpenChange:b,children:[e.jsx(n.Dialog.Trigger,{children:l}),e.jsx(n.Dialog.Content,{ref:c,...f,children:e.jsx(Fe,{closeDialog:y,content:o,title:s,description:r})})]})})),fe=i=>e.jsx(n.AlertDialog.Title,{mb:"0",...i}),We=i=>{const{title:c,description:l,actionText:o="Confirm",cancelText:s="Cancel",onAction:r,onCancel:u,severity:d}=i;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsx(fe,{children:c}),e.jsx(n.AlertDialog.Description,{children:l})]}),e.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[e.jsx(n.AlertDialog.Cancel,{children:e.jsx(W,{variant:"soft",severity:"info",onClick:u,children:s})}),e.jsx(n.AlertDialog.Action,{children:e.jsx(W,{variant:"solid",severity:d,onClick:r,children:o})})]})]})},pe=t.memo(function(c){const{open:l,setOpen:o,children:s,...r}=c,u=t.useMemo(()=>({close:()=>o(!1),Title:fe,Description:n.AlertDialog.Description}),[o]);return e.jsxs(n.AlertDialog.Root,{open:l,onOpenChange:o,children:[e.jsx(n.AlertDialog.Content,{children:"content"in r?r.content(u):e.jsx(We,{...r})}),s]})}),ee=t.createContext(()=>{throw new Error("No AlertDialogProvider found")}),Ge={content:()=>null},Ve=t.memo(function({children:c}){const[l,o]=t.useState(!1),[s,r]=t.useState(Ge),u=t.useCallback(d=>{if(l)throw new Error("AlertDialog is already open");r(d),o(!0)},[l]);return e.jsx(pe,{open:l,setOpen:o,...s,children:e.jsx(ee.Provider,{value:u,children:c})})}),ge=()=>t.useContext(ee),qe=()=>{const i=ge();return t.useCallback(c=>i({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:c.onDiscard,onCancel:c.onCancel}),[i])},Ue=t.memo(function({severity:c,itemContent:l,closeOnSelect:o=!0,onSelect:s,...r}){const u=T(c),d=t.useCallback(p=>{o||p.preventDefault(),s&&s(p)},[o,s]);return e.jsx(n.DropdownMenu.Item,{onSelect:d,color:u,...r,children:l})}),Xe=t.memo(function({defaultOpen:c,open:l,onOpenChange:o,modal:s,trigger:r,label:u,severity:d="info",children:p,...f}){const h=T(d);return e.jsxs(n.DropdownMenu.Root,{defaultOpen:c,open:l,onOpenChange:o,modal:s,children:[e.jsx(n.DropdownMenu.Trigger,{children:r}),e.jsxs(n.DropdownMenu.Content,{color:h,...f,children:[u&&e.jsx(n.DropdownMenu.Label,{children:u}),p]})]})}),Ke=t.memo(function({separatorBelow:c=!1,separatorAbove:l=!1,children:o,...s}){return e.jsxs(e.Fragment,{children:[l&&e.jsx(n.DropdownMenu.Separator,{}),e.jsx(n.DropdownMenu.Group,{...s,children:o}),c&&e.jsx(n.DropdownMenu.Separator,{})]})}),Qe=t.memo(function({defaultOpen:c,open:l,onOpenChange:o,trigger:s,children:r,...u}){return e.jsxs(n.DropdownMenu.Sub,{defaultOpen:c,open:l,onOpenChange:o,children:[e.jsx(n.DropdownMenu.SubTrigger,{children:s}),e.jsx(n.DropdownMenu.SubContent,{...u,children:r})]})}),Ye={Root:Xe,ItemGroup:Ke,Item:Ue,SubMenu:Qe},Je=t.memo(function({children:c}){const[l,o]=t.useState(!1),s=t.useCallback(()=>{o(!0)},[]),r=t.useCallback(()=>{o(!1)},[]);return c({isHovered:l,onPointerEnter:s,onPointerLeave:r})}),he={fluid:"_fluid_7n1wr_1"},Ze=t.forwardRef(function({className:c,fluid:l,size:o="medium",variant:s="surface",severity:r="primary",itemSeverity:u="info",placeholder:d="Select",side:p,items:f=[],value:h,id:C,...b},y){const g=I(o,B),v=T(r),w=T(u);return t.createElement(n.Select.Root,{size:g,...b,key:h===void 0?1:0,value:h},e.jsx(n.Select.Trigger,{className:m(c,{[he.fluid]:l}),id:C,ref:y,variant:s,placeholder:d,color:v}),e.jsx(n.Select.Content,{side:p,className:he.contentDefault,position:"popper",variant:s!=="surface"?"soft":"solid",color:w,children:f.map(({itemContent:P,value:_,...O})=>e.jsx(n.Select.Item,{className:"overmap-select-item",value:_,...O,children:P},_))}))}),Re=t.memo(Ze),Ce=t.memo(t.forwardRef((i,c)=>{const{checked:l,label:o,value:s,size:r="2"}=i;return e.jsx(n.Box,{asChild:!0,px:r,children:e.jsx(n.Select.Item,{value:s,ref:c,children:e.jsxs(n.Flex,{gap:r,align:"center",children:[e.jsx(n.Checkbox,{checked:l}),o]})})})})),G="__select_all__",en=t.memo(t.forwardRef((i,c)=>{const[l,o]=t.useState(!1),{placeholder:s,value:r,onValueChange:u,options:d,disabled:p,name:f,...h}=i,C=I(i.size,B),b=T(i.severity),y=t.useMemo(()=>new Map(d.map(_=>[_.value,_.label])),[d]),g=r.length>4?`${r.length} options selected`:e.jsx("span",{children:r.flatMap(_=>[y.get(_),", "]).slice(0,-1)}),v=t.useCallback(()=>o(!1),[]),w=t.useCallback(_=>{_&&o(!0)},[]),P=t.useCallback(_=>{let O;_===G?O=r.length===d.length?[]:d.map(oe=>oe.value):O=r.includes(_)?r.filter($=>$!==_):[...r,_],u(O)},[u,d,r]);return t.useEffect(()=>{if(d.some(({value:_})=>_===G))throw new Error(`Cannot have an option with the value "${G}"`)},[d]),e.jsxs(n.Select.Root,{open:l,value:"",onOpenChange:w,onValueChange:P,disabled:p,size:C,name:f,autoComplete:"off",children:[e.jsx(n.Select.Trigger,{ref:c,color:b,placeholder:r.length>0?g:s,"data-placeholder":r.length>0?void 0:!0,...h}),e.jsxs(n.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:v,onPointerDownOutside:v,children:[e.jsx(Ce,{value:G,label:"Select all",checked:r.length===d.length,size:C}),d.map(_=>e.jsx(Ce,{..._,checked:r.includes(_.value),size:C},_.value))]})]})})),nn={default:"_default_u936h_1"},tn=t.forwardRef(function({className:c,severity:l="primary",icon:o,defaultChecked:s=!1,onCheckedChange:r,...u},d){const p=t.useRef(null),[f,h]=t.useState(u.checked?u.checked:s),[C,b]=t.useState(),y=T(l);t.useLayoutEffect(()=>{var P;const w=d||p;"current"in w&&w.current&&b((P=w.current)==null?void 0:P.querySelector("span.rt-SwitchThumb"))},[d]);const g=t.useCallback(w=>{h(w),r&&r(w)},[r]),v=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(n.Switch,{className:m("overmap-switch",c,nn.default),ref:d||p,color:y,radius:"full",defaultChecked:s,onCheckedChange:g,...u}),e.jsx(n.Portal,{container:C,asChild:!0,children:o&&"checked"in o?v?o.checked:o.unchecked:o})]})}),on=t.memo(tn),M={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},rn=t.forwardRef(function({side:c="left",modal:l=!0,children:o,open:s,containerSelector:r,overlay:u=!0,resizable:d=!0,minWidth:p="300px",maxWidth:f="500px",...h},C){const b=c==="right",y=c==="left",[g,v]=t.useState();return t.useEffect(()=>{const w=r??'[data-is-root-theme="true"]',P=document.querySelector(w);if(P===void 0)throw new Error(`Could not find a container element using the following selector ${w}`);v(P)},[r]),e.jsx(H.Root,{open:s,modal:l,children:e.jsxs(H.Portal,{container:g,children:[u&&e.jsx(H.Overlay,{className:m(M.overlay)}),e.jsx(H.Content,{className:m("overmap-sidebar","rt-DialogContent",M.sidebarContent,{[M.left]:y,[M.right]:b}),ref:C,asChild:!0,...h,children:e.jsx(n.Box,{width:"auto",children:e.jsx(Q.Resizable,{minWidth:p,maxWidth:f,defaultSize:{width:"300px",height:"100%"},enable:{right:d&&y,left:d&&b},handleClasses:{left:M.resizeHandle,right:M.resizeHandle},handleComponent:{right:e.jsx(j.DragHandleDots2Icon,{}),left:e.jsx(j.DragHandleDots2Icon,{})},children:o})})})]})})}),ln=t.memo(rn),E={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},an=t.forwardRef(function({className:c,leftSlot:l,rightSlot:o,size:s="medium",showInputLength:r,value:u,variant:d,severity:p="primary",...f},h){const C=I(s,B),b=T(p),y=r||r===void 0&&f.maxLength!==void 0,g=u!==void 0?u.toString():void 0;return e.jsxs(n.TextField.Root,{className:m(E.wrapper,{[E.accommodateCharCount]:y}),size:C,variant:d,color:b,children:[l&&e.jsx(n.TextField.Slot,{children:l}),e.jsx(n.TextField.Input,{className:m(E.default,c,{[E.noLeftIcon]:!l,[E.noRightIcon]:!o}),ref:h,size:C,variant:d,color:b,...f}),o&&e.jsx(n.TextField.Slot,{children:o}),y&&e.jsx(n.Text,{as:"p",className:E.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${g==null?void 0:g.length}/${f.maxLength}`:`${g==null?void 0:g.length}`})]})}),cn=t.memo(an),sn={wrapper:"_wrapper_tmtz0_1"},dn=t.forwardRef(function({className:c,defaultOpen:l=!1,modal:o=!1,content:s,children:r,...u},d){return e.jsxs(n.Popover.Root,{defaultOpen:l,modal:o,children:[e.jsx(n.Popover.Trigger,{children:r}),e.jsx(n.Popover.Content,{ref:d,className:m("overmap-popover",c,sn.wrapper),...u,children:s(n.Popover.Close)})]})}),un=t.memo(dn),D={wrapper:"_wrapper_1mz2e_1",panelContent:"_panelContent_1mz2e_6",left:"_left_1mz2e_14",right:"_right_1mz2e_18",resizable:"_resizable_1mz2e_23",resizeHandle:"_resizeHandle_1mz2e_28",panelMainContent:"_panelMainContent_1mz2e_48"},be=200,A=150,fn=t.memo(function({children:c,showLeft:l,leftPanel:o,leftMinWidth:s=be,showRight:r,rightPanel:u,rightMinWidth:d=be,resizeable:p}){const f=t.useRef(null),h=t.useRef(null),[C,b]=t.useState(0),[y,g]=t.useState(),v=t.useRef(null),[w,P]=t.useState(0),[_,O]=t.useState(),$=t.useCallback((S,x,k)=>(z,_e,me,re)=>{if(!f.current)return;const U=S+re.width;k(f.current.clientWidth-U),x(()=>U)},[]),oe=t.useCallback((S,x,k,z)=>$(C,b,O)(S,x,k,z),[$,C]),kn=t.useCallback((S,x,k,z)=>$(w,P,g)(S,x,k,z),[$,w]),V=t.useCallback((S,x,k,z,_e,me,re,U)=>{if(!f.current)return;let X=S;if(X===0&&(X=x,k(X)),me){const K=f.current.clientWidth-X;U(K),_e>K&&(re(K),z(f.current.clientWidth-K))}},[]),zn=t.useCallback(()=>V(w,d,P,O,C,l,b,g),[V,C,d,w,l]),jn=t.useCallback(()=>V(C,s,b,g,w,r,P,O),[V,s,C,w,r]),q=t.useCallback((S,x)=>{f.current&&S&&x(f.current.clientWidth)},[]),In=t.useCallback(()=>q(l,g),[q,l]),An=t.useCallback(()=>q(r,O),[q,r]),we=t.useCallback(()=>{var S,x,k,z;f.current&&(g(f.current.clientWidth-(((S=v.current)==null?void 0:S.clientWidth)||0)),O(f.current.clientWidth-(((x=h.current)==null?void 0:x.clientWidth)||0)),b(((k=h.current)==null?void 0:k.clientWidth)||0),P(((z=v.current)==null?void 0:z.clientWidth)||0))},[]);t.useEffect(()=>{if(!f.current)return;const S=new ResizeObserver(we);return S.observe(f.current),()=>{S.disconnect()}},[we]);const $n=t.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),Bn=t.useMemo(()=>({entering:{transform:`translateX(${w}px)`,marginLeft:`${-w}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${w}px)`,marginLeft:`${-w}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[w]);return e.jsxs(n.Flex,{className:D.wrapper,style:{minWidth:`${s+d}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[e.jsx(le.Transition,{nodeRef:h,timeout:l?0:A,in:l,unmountOnExit:!0,onEntering:jn,onExited:An,children:S=>e.jsx(n.Box,{ref:h,className:m(D.panelContent,D.left),style:$n[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Q.Resizable,{className:D.resizable,size:{width:C,height:"100%"},onResizeStop:oe,enable:{right:(p==null?void 0:p.left)!==void 0?p.left:!0},minWidth:s,maxWidth:y,handleClasses:{right:m(D.resizeHandle,D.left)},handleComponent:{right:e.jsx(j.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:o})})}),e.jsx(n.Box,{className:D.panelMainContent,width:"max-content",children:c}),e.jsx(le.Transition,{nodeRef:v,timeout:r?0:A,in:r,unmountOnExit:!0,onEntering:zn,onExited:In,children:S=>e.jsx(n.Box,{ref:v,className:m(D.panelContent,D.right),style:Bn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Q.Resizable,{className:D.resizable,size:{width:w,height:"100%"},onResizeStop:kn,enable:{left:(p==null?void 0:p.right)!==void 0?p.right:!0},minWidth:d,maxWidth:_,handleClasses:{left:m(D.resizeHandle,D.right)},handleComponent:{left:e.jsx(j.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),pn={charCount:"_charCount_17uut_1"},gn=t.forwardRef(function({className:c,showInputLength:l,inputLengthTemplate:o,value:s,severity:r="primary",resize:u,...d},p){const f=T(r),h=T("info"),C=l||l===void 0&&(d.maxLength!==void 0||d.minLength!==void 0),b=s!==void 0?s.toString():"",y=t.useMemo(()=>{if(o){let g=o.replace("{current}",b.length.toString());return d.minLength!==void 0&&(g=g.replace("{min}",d.minLength.toString())),d.maxLength!==void 0&&(g=g.replace("{max}",d.maxLength.toString())),g}return b.length},[o,d.maxLength,d.minLength,b.length]);return e.jsxs(e.Fragment,{children:[e.jsx(n.TextArea,{className:m("overmap-textarea",c),style:{resize:u},ref:p,value:s,color:f,...d}),C&&e.jsx(n.Text,{as:"p",className:pn.charCount,color:h,align:"right",children:y})]})}),hn=t.memo(gn),Cn=t.forwardRef(function({loop:c,type:l,rovingFocus:o,value:s,onValueChange:r,defaultValue:u,disabled:d,items:p,className:f,direction:h="row",...C},b){return e.jsx(ae.Root,{type:l,className:m("overmap-toggle-group",f),ref:b,value:s,onValueChange:r,disabled:d,orientation:h==="column"?"vertical":"horizontal",loop:c,rovingFocus:o,defaultValue:u,asChild:!0,children:e.jsx(R,{direction:h,...C,children:p.map(({children:y,...g})=>t.createElement(ae.Item,{asChild:!0,...g,key:g.value},e.jsx(Z,{className:m("overmap-toggle-group-button"),"aria-label":g.value,variant:g.value===s?"solid":"soft",children:y})))})})}),bn=t.memo(Cn),ne={ToastViewport:"_ToastViewport_1i6bp_1",actionButton:"_actionButton_1i6bp_20",ToastRoot:"_ToastRoot_1i6bp_24",slideIn:"_slideIn_1i6bp_1",swipeOut:"_swipeOut_1i6bp_1"},yn=t.forwardRef(function({title:c,description:l,icon:o,severity:s="primary",size:r,onClose:u,sensitivity:d,action:p,...f},h){const[C,b]=t.useState(!0),y=T(s),g=t.useCallback(v=>{!v&&u&&u(),b(v)},[u]);return e.jsx(N.Root,{asChild:!0,ref:h,...f,open:C,type:d,onOpenChange:g,children:e.jsx(n.Callout.Root,{className:ne.ToastRoot,variant:"surface",color:y,size:r,children:e.jsxs(n.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[e.jsxs(n.Flex,{align:"center",gap:"3",children:[e.jsx(n.Callout.Icon,{children:o}),e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(N.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{size:"3",weight:"medium",children:c})}),e.jsx(N.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{children:l})})]}),p&&e.jsx(N.Action,{className:ne.actionButton,altText:p.altText,asChild:!0,children:p.content})]})]}),e.jsx(N.Close,{asChild:!0,children:e.jsx(Z,{"aria-label":"Close",variant:"ghost",severity:s,children:e.jsx(j.Cross2Icon,{})})})]})})})}),ye=t.memo(yn),te=t.createContext({}),vn=()=>{const i=t.useContext(te);if(!i)throw new Error("useToast must be used within a ToastProvider");return i},wn=240/60,ve=5e3,_n=i=>{if(i.duration&&i.duration>=ve)return i.duration;const c=i.severity==="danger"?1.5:1,l=i.description.split(" ").length+i.title.split(" ").length;return(ve+l/wn)*c};a.unsafeShowToast=void 0;const mn=t.memo(function({children:c,className:l,hotkey:o,...s}){const[r,u]=t.useState([]),d=t.useCallback((f,h,C)=>{u(b=>{const y=b.find(g=>g.id===f);return y&&h===0&&clearTimeout(y.timeout),b.filter(g=>g.id!==f)}),C&&C()},[]),p=t.useMemo(()=>{let f=0;const h=v=>{const w=_n(v),P=f.toString();f+=1;const _=setTimeout(()=>d(P,1,v.onClose),w);u(O=>[...O,{...v,timeout:_,duration:w,id:P}])},C=v=>h({...v,severity:"primary"}),b=v=>h({...v,severity:"success"}),y=v=>h({...v,severity:"danger"}),g=v=>h({...v,severity:"info"});return a.unsafeShowToast=h,{showToast:h,showPrimary:C,showSuccess:b,showError:y,showInfo:g}},[d]);return t.useEffect(()=>()=>{for(const{timeout:f}of r)clearTimeout(f)},[]),e.jsx(te.Provider,{value:p,children:e.jsxs(Y.ToastProvider,{...s,children:[c,e.jsx(Y.ToastViewport,{className:m(l,ne.ToastViewport),hotkey:o}),r.map(({id:f,onClose:h,...C})=>e.jsx(ye,{...C,onClose:()=>d(f,0,h)},f))]})})}),Sn={noWrap:"_noWrap_1wpa5_1"},Pn=t.memo(t.forwardRef(({className:i,noWrap:c,severity:l,as:o,...s},r)=>{const u=T(l);return e.jsx(n.Text,{ref:r,as:o,className:m(i,{[Sn.noWrap]:c}),color:u,...s})})),ht="",Tn=t.memo(t.forwardRef((i,c)=>{const{panelBackground:l="solid",radius:o="full",...s}=i;return e.jsx(n.Theme,{panelBackground:l,radius:o,ref:c,...s})})),On={1:"max-content",2:"max-content",3:"max-content",4:"100%"},Dn=t.forwardRef(function({severity:c="info",weight:l="light",gap:o="1",text:s,orientation:r="horizontal",size:u,...d},p){const f=I(u,On),h=T(c);return e.jsxs(n.Flex,{ref:p,width:r==="horizontal"?f:"max-content",height:r==="vertical"?f:"max-content",direction:r==="vertical"?"column":"row",align:"center",gap:o,children:[e.jsx(n.Separator,{size:u,orientation:r,color:h,...d}),s&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{as:"span",size:"1",weight:l,color:h,children:s}),e.jsx(n.Separator,{size:u,orientation:r,color:h,...d})]})]})}),xn=t.memo(Dn);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>n.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>n.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>n.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>n.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>n.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>n.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>n.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>n.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>n.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>n.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>n.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>n.Em}),Object.defineProperty(a,"Flex",{enumerable:!0,get:()=>n.Flex}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>n.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>n.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>n.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>n.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>n.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>n.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>n.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>n.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>n.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>n.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>n.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>n.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>n.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>n.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>n.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>n.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>n.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>n.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>n.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>n.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>n.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>n.useThemeContext}),a.AlertDialog=pe,a.AlertDialogContent=ee,a.AlertDialogProvider=Ve,a.Badge=xe,a.Button=W,a.ButtonGroup=R,a.ButtonList=Le,a.DefaultTheme=Tn,a.Dialog=He,a.DropdownMenu=Ye,a.HoverUtility=Je,a.IconButton=Z,a.Input=cn,a.LeftAndRightPanels=fn,a.MultiSelect=en,a.Popover=un,a.Select=Re,a.Separator=xn,a.Sidebar=ln,a.Switch=on,a.Text=Pn,a.TextArea=hn,a.Toast=ye,a.ToastContext=te,a.ToastProvider=mn,a.ToggleGroup=bn,a.divButtonProps=ke,a.useAlertDialog=ge,a.useDiscardAlertDialog=qe,a.useSeverityColor=T,a.useToast=vn,Object.keys(ie).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&Object.defineProperty(a,i,{enumerable:!0,get:()=>ie[i]})}),Object.keys(j).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&Object.defineProperty(a,i,{enumerable:!0,get:()=>j[i]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/(function(l){(function(){var s={}.hasOwnProperty;function i(){for(var r=[],c=0;c<arguments.length;c++){var o=arguments[c];if(o){var u=typeof o;if(u==="string"||u==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var d=i.apply(null,o);d&&r.push(d)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var p in o)s.call(o,p)&&o[p]&&r.push(p)}}}return r.join(" ")}l.exports?(i.default=i,l.exports=i):window.classNames=i})()})(pe);var je=pe.exports;const S=xe(je);function E(l,s){return n.useMemo(()=>{if(l!==void 0)if(typeof l=="object"){if(!("initial"in l))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(l).map(([i,r])=>[i,s[r]]))}else return s[l]},[s,l])}const ze={success:"green",danger:"red",info:"gray"},P=l=>{const s=t.useThemeContext();if(l)return l==="primary"?s.accentColor:ze[l]},Ie=n.forwardRef(function({className:s,severity:i="primary",color:r,children:c,...o},u){const d=P(i);return e.jsx(t.Badge,{className:S("overmap-badge",s),ref:u,color:r||d,...o,children:c})}),Ee=n.memo(Ie),W={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},ge={spin90Clockwise:W.hoverSpin90Clockwise,spin180Clockwise:W.hoverSpin180Clockwise,spin360Clockwise:W.hoverSpin360Clockwise},$e={role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.currentTarget.click()}},A={small:"1",medium:"2",large:"3"},he=n.createContext({}),ne=()=>n.useContext(he),Ae=n.forwardRef(function(s,i){const r=ne(),{className:c,type:o="button",fluid:u=r.fluid??!1,size:d=r.size??"medium",severity:p=r.severity??"primary",hoverEffects:f=r.hoverEffects??[],variant:g=r.variant,...C}=s,b=P(p),y=f.map(h=>ge[h]);return e.jsx(t.Button,{ref:i,type:o,className:S(c,y,{[W.fluid]:u}),color:b,size:E(d,A),variant:g,...C})}),K=n.memo(Ae),Ne=n.forwardRef(function(s,i){const r=ne(),{className:c,children:o,type:u="button",fluid:d=r.fluid??!1,size:p=r.size??"medium",severity:f=r.severity??"primary",hoverEffects:g=r.hoverEffects??[],variant:C=r.variant,...b}=s,y=P(f),h=(g==null?void 0:g.map(v=>ge[v]))||[];return e.jsx(t.IconButton,{className:S(c,h,{[W.fluid]:d}),ref:i,color:y,size:E(p,A),variant:C,type:u,...b,children:o})}),te=n.memo(Ne),Be={merged:"_merged_wdgxo_1"},Me={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},Le=n.forwardRef(function({className:s,merged:i=!1,children:r,gap:c,direction:o="row",severity:u,size:d="medium",variant:p,hoverEffects:f,fluid:g,...C},b){const y=E(d,Me[o]),h=p==="ghost"?y:"0";return e.jsx(t.Flex,{className:S("overmap-button-group",s,{[Be.merged]:i}),ref:b,gap:i?c??h:c??"2",direction:o,"data-direction":o,...C,children:e.jsx(he.Provider,{value:{size:d,severity:u,variant:p,hoverEffects:f,fluid:g},children:r})})}),re=n.memo(Le),Fe={separators:"_separators_1f7v1_1"},We=n.memo(n.forwardRef((l,s)=>{const{children:i,border:r,before:c,after:o,size:u}=l,d=r?"surface":"ghost",p=E(u,A),f=c&&o?e.jsx(t.Inset,{side:"x",pt:"current",pb:"current",children:i}):c?e.jsx(t.Inset,{side:"bottom",pt:"current",children:i}):o?e.jsx(t.Inset,{side:"top",pb:"current",children:i}):e.jsx(t.Inset,{children:i}),g=e.jsxs(t.Card,{ref:s,size:p,variant:d,children:[c,f,o]});return d==="ghost"?e.jsx(t.Box,{p:"3",children:g}):g})),He=n.memo(n.forwardRef((l,s)=>{const{children:i,variant:r="outline",size:c,className:o,...u}=l,d=r==="outline"||r==="surface",p=r==="outline"?"ghost":r==="surface"?"soft":r;return e.jsx(We,{...u,border:d,size:c,children:e.jsx(re,{size:c,severity:"info",variant:p,className:S(o,Fe.separators),merged:!0,gap:"0",direction:"column",ref:s,children:i})})})),Ge=n.memo(n.forwardRef((l,s)=>{const{variant:i}=ne(),r=e.jsx(K,{ref:s,...l,radius:"large",variant:i});return i==="ghost"?e.jsx(t.Box,{asChild:!0,my:"1",mx:"2",children:r}):r})),Ve={Root:He,Item:Ge},qe=n.memo(function(s){const{title:i,description:r,content:c,closeDialog:o}=s;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(z.Cross1Icon,{})})})]}),r&&e.jsx(t.Dialog.Description,{children:r})]}),c(o)]})}),Ue=n.memo(n.forwardRef((l,s)=>{const{children:i,content:r,title:c,description:o,onOpen:u,defaultOpen:d,onCloseInterrupt:p,...f}=l,[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:s,...f,children:e.jsx(qe,{closeDialog:y,content:r,title:c,description:o})})]})})),Ce=l=>e.jsx(t.AlertDialog.Title,{mb:"0",...l}),Xe=l=>{const{title:s,description:i,actionText:r="Confirm",cancelText:c="Cancel",onAction:o,onCancel:u,severity:d}=l;return e.jsxs(t.Flex,{direction:"column",gap:"2",children:[e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsx(Ce,{children:s}),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:o,children:r})})]})]})},be=n.memo(function(s){const{open:i,setOpen:r,children:c,...o}=s,u=n.useMemo(()=>({close:()=>r(!1),Title:Ce,Description:t.AlertDialog.Description}),[r]);return e.jsxs(t.AlertDialog.Root,{open:i,onOpenChange:r,children:[e.jsx(t.AlertDialog.Content,{children:"content"in o?o.content(u):e.jsx(Xe,{...o})}),c]})}),oe=n.createContext(()=>{throw new Error("No AlertDialogProvider found")}),Ke={content:()=>null},Qe=n.memo(function({children:s}){const[i,r]=n.useState(!1),[c,o]=n.useState(Ke),u=n.useCallback(d=>{if(i)throw new Error("AlertDialog is already open");o(d),r(!0)},[i]);return e.jsx(be,{open:i,setOpen:r,...c,children:e.jsx(oe.Provider,{value:u,children:s})})}),ye=()=>n.useContext(oe),Ye=()=>{const l=ye();return n.useCallback(s=>l({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:s.onDiscard,onCancel:s.onCancel}),[l])},Je=n.memo(function({severity:s,itemContent:i,closeOnSelect:r=!0,onSelect:c,...o}){const u=P(s),d=n.useCallback(p=>{r||p.preventDefault(),c&&c(p)},[r,c]);return e.jsx(t.DropdownMenu.Item,{onSelect:d,color:u,...o,children:i})}),Ze=n.memo(function({defaultOpen:s,open:i,onOpenChange:r,modal:c,trigger:o,label:u,severity:d="info",children:p,...f}){const g=P(d);return e.jsxs(t.DropdownMenu.Root,{defaultOpen:s,open:i,onOpenChange:r,modal:c,children:[e.jsx(t.DropdownMenu.Trigger,{children:o}),e.jsxs(t.DropdownMenu.Content,{color:g,...f,children:[u&&e.jsx(t.DropdownMenu.Label,{children:u}),p]})]})}),Re=n.memo(function({separatorBelow:s=!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}),s&&e.jsx(t.DropdownMenu.Separator,{})]})}),en=n.memo(function({defaultOpen:s,open:i,onOpenChange:r,trigger:c,children:o,...u}){return e.jsxs(t.DropdownMenu.Sub,{defaultOpen:s,open:i,onOpenChange:r,children:[e.jsx(t.DropdownMenu.SubTrigger,{children:c}),e.jsx(t.DropdownMenu.SubContent,{...u,children:o})]})}),nn={Root:Ze,ItemGroup:Re,Item:Je,SubMenu:en},tn=n.memo(function({children:s}){const[i,r]=n.useState(!1),c=n.useCallback(()=>{r(!0)},[]),o=n.useCallback(()=>{r(!1)},[]);return s({isHovered:i,onPointerEnter:c,onPointerLeave:o})}),ve={fluid:"_fluid_7n1wr_1"},rn=n.forwardRef(function({className:s,fluid:i,size:r="medium",variant:c="surface",severity:o="primary",itemSeverity:u="info",placeholder:d="Select",side:p,items:f=[],value:g,id:C,...b},y){const h=E(r,A),v=P(o),_=P(u);return n.createElement(t.Select.Root,{size:h,...b,key:g===void 0?1:0,value:g},e.jsx(t.Select.Trigger,{className:S(s,{[ve.fluid]:i}),id:C,ref:y,variant:c,placeholder:d,color:v}),e.jsx(t.Select.Content,{side:p,className:ve.contentDefault,position:"popper",variant:c!=="surface"?"soft":"solid",color:_,children:f.map(({itemContent:m,value:w,...T})=>e.jsx(t.Select.Item,{className:"overmap-select-item",value:w,...T,children:m},w))}))}),on=n.memo(rn),_e=n.memo(n.forwardRef((l,s)=>{const{checked:i,label:r,value:c,size:o="2"}=l;return e.jsx(t.Box,{asChild:!0,px:o,children:e.jsx(t.Select.Item,{value:c,ref:s,children:e.jsxs(t.Flex,{gap:o,align:"center",children:[e.jsx(t.Checkbox,{checked:i}),r]})})})})),Q="__select_all__",ln=n.memo(n.forwardRef((l,s)=>{const[i,r]=n.useState(!1),{placeholder:c,value:o,onValueChange:u,options:d,disabled:p,name:f,...g}=l,C=E(l.size,A),b=P(l.severity),y=n.useMemo(()=>new Map(d.map(w=>[w.value,w.label])),[d]),h=o.length>4?`${o.length} options selected`:e.jsx("span",{children:o.flatMap(w=>[y.get(w),", "]).slice(0,-1)}),v=n.useCallback(()=>r(!1),[]),_=n.useCallback(w=>{w&&r(!0)},[]),m=n.useCallback(w=>{let T;w===Q?T=o.length===d.length?[]:d.map(M=>M.value):T=o.includes(w)?o.filter(x=>x!==w):[...o,w],u(T)},[u,d,o]);return n.useEffect(()=>{if(d.some(({value:w})=>w===Q))throw new Error(`Cannot have an option with the value "${Q}"`)},[d]),e.jsxs(t.Select.Root,{open:i,value:"",onOpenChange:_,onValueChange:m,disabled:p,size:C,name:f,autoComplete:"off",children:[e.jsx(t.Select.Trigger,{ref:s,color:b,placeholder:o.length>0?h:c,"data-placeholder":o.length>0?void 0:!0,...g}),e.jsxs(t.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:v,onPointerDownOutside:v,children:[e.jsx(_e,{value:Q,label:"Select all",checked:o.length===d.length,size:C}),d.map(w=>e.jsx(_e,{...w,checked:o.includes(w.value),size:C},w.value))]})]})})),an={default:"_default_u936h_1"},sn=n.forwardRef(function({className:s,severity:i="primary",icon:r,defaultChecked:c=!1,onCheckedChange:o,...u},d){const p=n.useRef(null),[f,g]=n.useState(u.checked?u.checked:c),[C,b]=n.useState(),y=P(i);n.useLayoutEffect(()=>{var m;const _=d||p;"current"in _&&_.current&&b((m=_.current)==null?void 0:m.querySelector("span.rt-SwitchThumb"))},[d]);const h=n.useCallback(_=>{g(_),o&&o(_)},[o]),v=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(t.Switch,{className:S("overmap-switch",s,an.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?v?r.checked:r.unchecked:r})]})}),cn=n.memo(sn),N={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},dn={width:"auto",height:"100%"},un=n.forwardRef(function({side:s="left",modal:i=!0,children:r,open:c,containerSelector:o,overlay:u=!0,resizable:d=!0,minWidth:p="300px",maxWidth:f="500px",...g},C){const b=s==="right",y=s==="left",[h,v]=n.useState();return n.useEffect(()=>{const _=o??'[data-is-root-theme="true"]',m=document.querySelector(_);if(m===void 0)throw new Error(`Could not find a container element using the following selector ${_}`);v(m)},[o]),e.jsx(X.Root,{open:c,modal:i,children:e.jsxs(X.Portal,{container:h,children:[u&&e.jsx(X.Overlay,{className:S(N.overlay)}),e.jsx(X.Content,{className:S("overmap-sidebar","rt-DialogContent",N.sidebarContent,{[N.left]:y,[N.right]:b}),ref:C,asChild:!0,...g,children:e.jsx(t.Box,{width:"auto",children:e.jsx(U.Resizable,{minWidth:p,maxWidth:f,defaultSize:dn,enable:{right:d&&y,left:d&&b},handleClasses:{left:N.resizeHandle,right:N.resizeHandle},handleComponent:{right:e.jsx(z.DragHandleDots2Icon,{}),left:e.jsx(z.DragHandleDots2Icon,{})},children:r})})})]})})}),fn=n.memo(un),H={content:"_content_jyaca_1",left:"_left_jyaca_10",right:"_right_jyaca_13",resizable:"_resizable_jyaca_17",slideOutOverlay:"_slideOutOverlay_jyaca_21"},we=200,pn={enter:0,exit:we},gn=n.memo(function({open:s,side:i="left",container:r,children:c,minWidth:o,maxWidth:u,resizable:d=!0,overlay:p=!1,modal:f=!1,resizeHandle:g,...C}){const b=n.useRef(null),[y,h]=n.useState(o),[v,_]=n.useState(),m=i==="left",w=i==="right";n.useEffect(()=>{_(document.querySelector('[data-is-root-theme="true"]'))},[]);const T=n.useCallback((G,Pe,se,V)=>{h(se.clientWidth)},[]),x=n.useCallback(()=>{b.current&&(b.current.style.transform=`translateX(${w?100:-100}%)`)},[w]),M=n.useCallback(()=>{b.current&&(b.current.style.transition=`transform ${we}ms linear`)},[]),ae=n.useCallback(()=>{b.current&&(b.current.style.transform="translateX(0)")},[]);return e.jsx(L.Root,{open:!0,modal:f,children:e.jsx(R.Transition,{in:s,timeout:pn,nodeRef:b,onEnter:x,onEntering:M,onEntered:ae,onExiting:M,onExit:x,unmountOnExit:!0,mountOnEnter:!0,children:()=>e.jsxs(L.Portal,{container:r||v,children:[p&&e.jsx(L.Overlay,{className:H.slideOutOverlay}),e.jsx(L.Content,{className:S("overmap-slide-out",H.content,{[H.left]:m,[H.right]:w}),asChild:!0,...C,children:e.jsx(t.Box,{width:"auto",ref:b,children:e.jsx(U.Resizable,{className:H.resizable,defaultSize:{width:y,height:"100%"},onResize:T,enable:{right:d&&m,left:d&&w},handleComponent:{left:g,right:g},minWidth:o,maxWidth:u,children:c})})})]})})})}),B={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},hn=n.forwardRef(function({className:s,leftSlot:i,rightSlot:r,size:c="medium",showInputLength:o,value:u,variant:d,severity:p="primary",...f},g){const C=E(c,A),b=P(p),y=o||o===void 0&&f.maxLength!==void 0,h=u!==void 0?u.toString():void 0;return e.jsxs(t.TextField.Root,{className:S(B.wrapper,{[B.accommodateCharCount]:y}),size:C,variant:d,color:b,children:[i&&e.jsx(t.TextField.Slot,{children:i}),e.jsx(t.TextField.Input,{className:S(B.default,s,{[B.noLeftIcon]:!i,[B.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:B.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${h==null?void 0:h.length}/${f.maxLength}`:`${h==null?void 0:h.length}`})]})}),Cn=n.memo(hn),bn={wrapper:"_wrapper_tmtz0_1"},yn=n.forwardRef(function({className:s,defaultOpen:i=!1,modal:r=!1,content:c,children:o,...u},d){return e.jsxs(t.Popover.Root,{defaultOpen:i,modal:r,children:[e.jsx(t.Popover.Trigger,{children:o}),e.jsx(t.Popover.Content,{ref:d,className:S("overmap-popover",s,bn.wrapper),...u,children:c(t.Popover.Close)})]})}),vn=n.memo(yn),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"},Se=200,$=150,_n=n.memo(function({children:s,showLeft:i,leftPanel:r,leftMinWidth:c=Se,showRight:o,rightPanel:u,rightMinWidth:d=Se,resizeable:p}){const f=n.useRef(null),g=n.useRef(null),[C,b]=n.useState(0),[y,h]=n.useState(),v=n.useRef(null),[_,m]=n.useState(0),[w,T]=n.useState(),x=n.useCallback((O,k,j)=>(I,De,ke,ce)=>{if(!f.current)return;const Y=O+ce.width;j(f.current.clientWidth-Y),k(()=>Y)},[]),M=n.useCallback((O,k,j,I)=>x(C,b,T)(O,k,j,I),[x,C]),ae=n.useCallback((O,k,j,I)=>x(_,m,h)(O,k,j,I),[x,_]),G=n.useCallback((O,k,j,I,De,ke,ce,Y)=>{if(!f.current)return;let J=O;if(J===0&&(J=k,j(J)),ke){const Z=f.current.clientWidth-J;Y(Z),De>Z&&(ce(Z),I(f.current.clientWidth-Z))}},[]),Pe=n.useCallback(()=>G(_,d,m,T,C,i,b,h),[G,C,d,_,i]),se=n.useCallback(()=>G(C,c,b,h,_,o,m,T),[G,c,C,_,o]),V=n.useCallback((O,k)=>{f.current&&O&&k(f.current.clientWidth)},[]),Bn=n.useCallback(()=>V(i,h),[V,i]),Mn=n.useCallback(()=>V(o,T),[V,o]),Te=n.useCallback(()=>{var O,k,j,I;f.current&&(h(f.current.clientWidth-(((O=v.current)==null?void 0:O.clientWidth)||0)),T(f.current.clientWidth-(((k=g.current)==null?void 0:k.clientWidth)||0)),b(((j=g.current)==null?void 0:j.clientWidth)||0),m(((I=v.current)==null?void 0:I.clientWidth)||0))},[]);n.useEffect(()=>{if(!f.current)return;const O=new ResizeObserver(Te);return O.observe(f.current),()=>{O.disconnect()}},[Te]);const Ln=n.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${$}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${$}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${$}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),Fn=n.useMemo(()=>({entering:{transform:`translateX(${_}px)`,marginLeft:`${-_}px`,transitionProperty:"transform, margin-left",transitionDuration:`${$}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${$}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${_}px)`,marginLeft:`${-_}px`,transitionProperty:"transform, margin-left",transitionDuration:`${$}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[_]);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(R.Transition,{nodeRef:g,timeout:i?0:$,in:i,unmountOnExit:!0,onEntering:se,onExited:Mn,children:O=>e.jsx(t.Box,{ref:g,className:S(D.panelContent,D.left),style:Ln[O],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(U.Resizable,{className:D.resizable,size:{width:C,height:"100%"},onResizeStop:M,enable:{right:(p==null?void 0:p.left)!==void 0?p.left:!0},minWidth:c,maxWidth:y,handleClasses:{right:S(D.resizeHandle,D.left)},handleComponent:{right:e.jsx(z.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:r})})}),e.jsx("div",{className:D.panelMainContent,children:s}),e.jsx(R.Transition,{nodeRef:v,timeout:o?0:$,in:o,unmountOnExit:!0,onEntering:Pe,onExited:Bn,children:O=>e.jsx(t.Box,{ref:v,className:S(D.panelContent,D.right),style:Fn[O],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(U.Resizable,{className:D.resizable,size:{width:_,height:"100%"},onResizeStop:ae,enable:{left:(p==null?void 0:p.right)!==void 0?p.right:!0},minWidth:d,maxWidth:w,handleClasses:{left:S(D.resizeHandle,D.right)},handleComponent:{left:e.jsx(z.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),wn={charCount:"_charCount_17uut_1"},Sn=n.forwardRef(function({className:s,showInputLength:i,inputLengthTemplate:r,value:c,severity:o="primary",resize:u,...d},p){const f=P(o),g=P("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:S("overmap-textarea",s),style:{resize:u},ref:p,value:c,color:f,...d}),C&&e.jsx(t.Text,{as:"p",className:wn.charCount,color:g,align:"right",children:y})]})}),mn=n.memo(Sn),On=n.forwardRef(function({loop:s,type:i,rovingFocus:r,value:c,onValueChange:o,defaultValue:u,disabled:d,items:p,className:f,direction:g="row",...C},b){return e.jsx(ue.Root,{type:i,className:S("overmap-toggle-group",f),ref:b,value:c,onValueChange:o,disabled:d,orientation:g==="column"?"vertical":"horizontal",loop:s,rovingFocus:r,defaultValue:u,asChild:!0,children:e.jsx(re,{direction:g,...C,children:p.map(({children:y,...h})=>n.createElement(ue.Item,{asChild:!0,...h,key:h.value},e.jsx(te,{className:S("overmap-toggle-group-button"),"aria-label":h.value,variant:h.value===c?"solid":"soft",children:y})))})})}),Pn=n.memo(On),le={ToastViewport:"_ToastViewport_1joop_1",actionButton:"_actionButton_1joop_20",ToastRoot:"_ToastRoot_1joop_24",slideIn:"_slideIn_1joop_1",swipeOut:"_swipeOut_1joop_1"},Tn=n.forwardRef(function({title:s,description:i,icon:r,severity:c="primary",size:o,onClose:u,sensitivity:d,action:p,...f},g){const[C,b]=n.useState(!0),y=P(c),h=n.useCallback(v=>{!v&&u&&u(),b(v)},[u]);return e.jsx(F.Root,{asChild:!0,ref:g,...f,open:C,type:d,onOpenChange:h,children:e.jsx(t.Callout.Root,{className:le.ToastRoot,variant:"surface",color:y,size:o,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.jsx(z.InfoCircledIcon,{})}),e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsxs(t.Flex,{direction:"column",gap:"0",children:[e.jsx(F.Title,{asChild:!0,children:e.jsx(t.Callout.Text,{weight:"medium",children:s})}),e.jsx(F.Description,{asChild:!0,children:e.jsx(t.Callout.Text,{weight:"light",children:i})})]}),p&&e.jsx(F.Action,{className:le.actionButton,altText:p.altText,asChild:!0,children:p.content})]})]}),e.jsx(F.Close,{asChild:!0,children:e.jsx(te,{"aria-label":"Close",variant:"ghost",size:"small",severity:c,children:e.jsx(z.Cross2Icon,{})})})]})})})}),me=n.memo(Tn),ie=n.createContext({}),Dn=()=>{const l=n.useContext(ie);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},kn=240/60,Oe=5e3,xn=l=>{if(l.duration&&l.duration>=Oe)return l.duration;const s=l.severity==="danger"?1.5:1,i=l.description.split(" ").length+l.title.split(" ").length;return(Oe+i/kn)*s};a.unsafeShowToast=void 0;const jn=n.memo(function({children:s,className:i,hotkey:r,...c}){const[o,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=v=>{const _=xn(v),m=f.toString();f+=1;const w=setTimeout(()=>d(m,1,v.onClose),_);u(T=>[...T,{...v,timeout:w,duration:_,id:m}])},C=v=>g({...v,severity:"primary"}),b=v=>g({...v,severity:"success"}),y=v=>g({...v,severity:"danger"}),h=v=>g({...v,severity:"info"});return a.unsafeShowToast=g,{showToast:g,showPrimary:C,showSuccess:b,showError:y,showInfo:h}},[d]);return n.useEffect(()=>()=>{for(const{timeout:f}of o)clearTimeout(f)},[]),e.jsx(ie.Provider,{value:p,children:e.jsxs(ee.ToastProvider,{...c,children:[s,e.jsx(ee.ToastViewport,{className:S(i,le.ToastViewport),hotkey:r}),o.map(({id:f,onClose:g,...C})=>e.jsx(me,{...C,onClose:()=>d(f,0,g)},f))]})})}),zn={noWrap:"_noWrap_1wpa5_1"},In=n.memo(n.forwardRef(({className:l,noWrap:s,severity:i,as:r,...c},o)=>{const u=P(i);return e.jsx(t.Text,{ref:o,as:r,className:S(l,{[zn.noWrap]:s}),color:u,...c})})),Tt="",En=n.memo(n.forwardRef((l,s)=>{const{panelBackground:i="solid",radius:r="full",...c}=l;return e.jsx(t.Theme,{panelBackground:i,radius:r,ref:s,...c})})),$n={1:"max-content",2:"max-content",3:"max-content",4:"100%"},An=n.forwardRef(function({severity:s="info",weight:i="light",gap:r="1",text:c,orientation:o="horizontal",size:u,...d},p){const f=E(u,$n),g=P(s);return e.jsxs(t.Flex,{ref:p,width:o==="horizontal"?f:"max-content",height:o==="vertical"?f:"max-content",direction:o==="vertical"?"column":"row",align:"center",gap:r,children:[e.jsx(t.Separator,{size:u,orientation:o,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:o,color:g,...d})]})]})}),Nn=n.memo(An);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>t.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>t.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>t.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>t.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>t.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>t.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>t.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>t.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>t.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>t.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>t.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>t.Em}),Object.defineProperty(a,"Flex",{enumerable:!0,get:()=>t.Flex}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>t.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>t.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>t.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>t.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>t.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>t.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>t.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>t.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>t.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>t.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>t.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>t.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>t.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>t.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>t.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>t.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>t.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>t.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>t.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>t.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>t.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>t.useThemeContext}),a.AlertDialog=be,a.AlertDialogContent=oe,a.AlertDialogProvider=Qe,a.Badge=Ee,a.Button=K,a.ButtonGroup=re,a.ButtonList=Ve,a.DefaultTheme=En,a.Dialog=Ue,a.DropdownMenu=nn,a.HoverUtility=tn,a.IconButton=te,a.Input=Cn,a.LeftAndRightPanels=_n,a.MultiSelect=ln,a.Popover=vn,a.Select=on,a.Separator=Nn,a.Sidebar=fn,a.SlideOut=gn,a.Switch=cn,a.Text=In,a.TextArea=mn,a.Toast=me,a.ToastContext=ie,a.ToastProvider=jn,a.ToggleGroup=Pn,a.divButtonProps=$e,a.useAlertDialog=ye,a.useDiscardAlertDialog=Ye,a.useSeverityColor=P,a.useToast=Dn,Object.keys(de).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>de[l]})}),Object.keys(z).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>z[l]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=blocks.umd.cjs.map
|