@overmap-ai/blocks 0.0.7-alpha.2 → 0.0.7
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/blocks.js +247 -247
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +1 -1
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/blocks.umd.cjs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
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),je=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(je),ze=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(ze),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))}},[]),jn=t.useCallback(()=>V(w,d,P,O,C,l,b,g),[V,C,d,w,l]),zn=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:zn,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:jn,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_1joop_1",actionButton:"_actionButton_1joop_20",ToastRoot:"_ToastRoot_1joop_24",slideIn:"_slideIn_1joop_1",swipeOut:"_swipeOut_1joop_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.jsx(j.InfoCircledIcon,{})}),e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(N.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"medium",children:c})}),e.jsx(N.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"light",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",size:"small",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(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"})});
|
|
6
6
|
//# sourceMappingURL=blocks.umd.cjs.map
|