@gamecrafters/base-ui 0.0.19 → 0.0.20
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/build/main.cjs.js
CHANGED
|
@@ -28,7 +28,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
28
28
|
`:null,(0,W.jsx)(`span`,{className:gf.line,children:e.map((e,t)=>(0,W.jsx)(`span`,{className:gf.token,style:e.style,children:e.content},t))})]},t))})})}_f.displayName=`CodeBlock.Code`;var vf=U(_f);const yf=e=>{let[t,n]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(e.current===null)return;let t=new ResizeObserver(e=>{for(let t of e)if(t.target.scrollHeight>t.target.clientHeight||t.target.scrollWidth>t.target.clientWidth){n(!0);break}});return t.observe(e.current),()=>{t.disconnect()}},[e]),t},bf={root:`code-block-content`};function xf(e,t){let{as:n=`div`,className:r,...i}=e,a=l.useRef(null),o=R(t,a),s=yf(a);return(0,W.jsx)(n,{ref:o,tabIndex:s?0:void 0,className:H(bf.root,r),"data-component":`CodeBlock.Content`,...i})}xf.displayName=`CodeBlock.Content`;var Sf=U(xf);const Cf={root:`code-block-header`};function wf(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Cf.root,r),"data-component":`CodeBlock.Header`,...i})}wf.displayName=`CodeBlock.Header`;var Tf=U(wf);const Ef={root:`code-block-title`};function Df(e,t){let{as:n=`span`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Ef.root,r),"data-component":`CodeBlock.Title`,...i})}Df.displayName=`CodeBlock.Title`;var Of=U(Df);const kf=Object.assign(hf,{Header:Tf,Title:Of,Content:Sf,Code:vf}),Af=(0,l.createContext)({}),jf={root:`block`};function Mf(e,t){let{as:n=`div`,className:r,open:i,defaultOpen:a,disabled:o,onChange:s,...c}=e,u=K(),d=i!==void 0,[f,p]=l.useState(!!a),m=d?i:f,h={triggerId:`${u}-trigger`,contentId:`${u}-content`,isOpen:m,disabled:!!o,toggle:()=>{if(o)return;let e=!m;d||p(e),s?.(e)}};return(0,W.jsx)(Af.Provider,{value:h,children:(0,W.jsx)(n,{ref:t,className:H(jf.root,r),"data-component":`Collapsible`,"data-open":m,"data-disabled":!!o,...c})})}Mf.displayName=`Collapsible`;var Nf=U(Mf);const Pf={root:`collapsible-content`,open:`motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-top-1 motion-safe:duration-short`};function Ff(e,t){let{as:n=`div`,className:r,...i}=e,{contentId:a,isOpen:o}=l.useContext(Af);return(0,W.jsx)(n,{ref:t,id:a,hidden:!o,className:H(Pf.root,o&&Pf.open,r),"data-component":`Collapsible.Content`,"data-open":!!o,...i})}Ff.displayName=`Collapsible.Content`;var If=U(Ff);const Lf={root:`collapsible-trigger`,disabled:`collapsible-trigger-disabled`,labelEnd:`min-w-0 grow`,label:`min-w-0`,indicator:`collapsible-trigger-indicator`,indicatorOpen:`rotate-180`,indicatorStart:`-rotate-90`,indicatorStartOpen:`rotate-0`};function Rf(e,t){let{className:n,children:r,indicator:i=`end`,onClick:a,...o}=e,{triggerId:s,contentId:c,isOpen:u,disabled:d,toggle:f}=l.useContext(Af),p=e=>{a?.(e),!e.defaultPrevented&&f?.()},m=i===`none`?null:(0,W.jsx)(un,{className:H(Lf.indicator,i===`start`?u?Lf.indicatorStartOpen:Lf.indicatorStart:u&&Lf.indicatorOpen),"aria-hidden":`true`});return(0,W.jsxs)(`button`,{ref:t,type:`button`,id:s,className:H(Lf.root,d&&Lf.disabled,n),onClick:p,disabled:d,"aria-expanded":!!u,"aria-controls":c,"data-component":`Collapsible.Trigger`,"data-open":!!u,"data-indicator":i,...o,children:[i===`start`?m:null,(0,W.jsx)(`span`,{className:i===`end`?Lf.labelEnd:Lf.label,children:r}),i===`end`?m:null]})}Rf.displayName=`Collapsible.Trigger`;var zf=U(Rf);const Bf=Object.assign(Nf,{Trigger:zf,Content:If}),Vf=(e,t)=>{let n=0,r=0;for(let i of t){let t=e.indexOf(i,n);if(t===-1)return 0;r+=t-n,n=t+1}return Math.max(.5-r*.01,.1)},Hf=(e,t)=>{if(e===t)return 1;if(e.startsWith(t))return .9;let n=e.indexOf(t);return n>0?/\s|[-_/]/.test(e[n-1])?.8:.6:Vf(e,t)},Uf=(e,t,n=[])=>{let r=t.trim().toLowerCase();return r===``?1:[e,...n].map(e=>Hf(e.trim().toLowerCase(),r)).reduce((e,t)=>Math.max(e,t),0)},Wf=(0,l.createContext)(null),Gf=(0,l.createContext)(null),Kf={root:`command-palette`,hidden:`sr-only`},qf=(e,t)=>e.map((e,t)=>({entry:e,index:t})).filter(({entry:e})=>e.forceMount||(t[e.value]??0)>0).sort((e,n)=>{let r=(t[n.entry.value]??0)-(t[e.entry.value]??0);return r===0?e.index-n.index:r}).map(({entry:e})=>e.value);function Jf(e,t){let{search:n,defaultSearch:r=``,onSearchChange:i,value:a,defaultValue:o=``,onValueChange:s,onSelect:c,filter:u=Uf,shouldFilter:d=!0,loop:f=!1,label:p=`Command palette`,className:m,children:h,...g}=e,_=K(),v=K(),y=n!==void 0,[b,x]=l.useState(r),S=y?n:b,C=a!==void 0,[w,T]=l.useState(o),E=C?a:w,[D,O]=l.useState([]),k=l.useCallback(e=>{O(t=>[...t.filter(t=>t.value!==e.value),e])},[]),A=l.useCallback(e=>{O(t=>t.filter(t=>t.value!==e))},[]),j=l.useMemo(()=>{let e={};for(let t of D)e[t.value]=d?u(t.value,S,t.keywords):1;return e},[D,u,S,d]),M=l.useMemo(()=>qf(D,j),[D,j]),N=l.useMemo(()=>M.filter(e=>!D.find(t=>t.value===e)?.disabled),[D,M]),P=N.includes(E)?E:N[0]??``,F=D.find(e=>e.value===P)?.id,I=l.useCallback(e=>{C||T(e),s?.(e)},[C,s]),L=l.useRef(P);l.useEffect(()=>{L.current!==P&&(L.current=P,s?.(P))},[s,P]);let ee=l.useCallback(e=>{y||x(e),i?.(e)},[y,i]),te=l.useCallback(e=>{c?.(e)},[c]),ne=e=>{if(N.length===0)return;let t=N.indexOf(P)+e,n=f?(t+N.length)%N.length:Math.min(Math.max(t,0),N.length-1);I(N[n])},R=e=>{if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),ne(e.key===`ArrowDown`?1:-1);return}e.key===`Enter`&&P!==``&&(e.preventDefault(),te(P))}},re=l.useMemo(()=>({search:S,setSearch:ee,value:P,activeId:F,setValue:I,order:M,entries:D,scores:j,register:k,unregister:A,onSelect:te,listId:_,labelId:v,shouldFilter:d}),[F,D,te,v,_,M,k,j,S,ee,I,d,A,P]);return(0,W.jsx)(Wf.Provider,{value:re,children:(0,W.jsxs)(`div`,{ref:t,className:H(Kf.root,m),onKeyDown:R,"data-component":`CommandPalette`,...g,children:[(0,W.jsx)(`span`,{id:v,className:Kf.hidden,children:p}),h]})})}Jf.displayName=`CommandPalette`;var Yf=U(Jf);let Xf=0,Zf=``,Qf=``;const $f=e=>{(0,l.useEffect)(()=>{if(!e){if(Xf++,Xf===1){let e=window.innerWidth-document.body.clientWidth;Zf=document.body.style.overflow,Qf=document.body.style.paddingRight,document.body.style.overflow=`hidden`,document.body.style.paddingRight=`${e}px`,document.body.setAttribute(`data-scroll-locked`,``)}return()=>{Xf--,Xf===0&&(document.body.style.overflow=Zf,document.body.style.paddingRight=Qf,document.body.removeAttribute(`data-scroll-locked`))}}},[e])},ep={backdrop:`command-palette-backdrop motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,panel:`command-palette-panel motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-short`};function tp(e,t){let{open:n,onOpenChange:r,returnFocusRef:i,overlayClassName:a,className:o,children:s,...c}=e,u=l.useRef(null);return Ui({containerRef:u,returnFocusRef:i,disabled:!n}),qi(e=>{n&&(e.preventDefault(),r(!1))}),$f(!n),n?(0,W.jsx)(aa,{children:(0,W.jsx)(`div`,{className:H(ep.backdrop,a),onMouseDown:e=>{e.target===e.currentTarget&&r(!1)},"data-component":`CommandPalette.Backdrop`,children:(0,W.jsx)(`div`,{ref:u,role:`dialog`,"aria-modal":`true`,"aria-label":c.label??`Command palette`,className:ep.panel,"data-component":`CommandPalette.Dialog`,children:(0,W.jsx)(Yf,{ref:t,className:o,...c,children:s})})})}):null}tp.displayName=`CommandPalette.Dialog`;var np=U(tp);const rp={root:`command-palette-empty`};function ip(e,t){let{className:n,children:r=`No results found`,...i}=e,a=l.useContext(Wf);return!a||a.entries.length===0||a.order.length>0?null:(0,W.jsx)(`div`,{ref:t,role:`presentation`,className:H(rp.root,n),"data-component":`CommandPalette.Empty`,...i,children:r})}ip.displayName=`CommandPalette.Empty`;var ap=U(ip);const op={root:`command-palette-group`,heading:`command-palette-group-heading`,hidden:`hidden`};function sp(e,t){let{heading:n,forceMount:r=!1,className:i,children:a,...o}=e,s=K(),c=K(),u=l.useContext(Wf),d=l.useMemo(()=>({groupId:s}),[s]),f=(u?.entries??[]).filter(e=>e.groupId===s),p=f.map(e=>u?.order.indexOf(e.value)??-1).filter(e=>e!==-1),m=r||f.length===0||p.length>0;return(0,W.jsx)(Gf.Provider,{value:d,children:(0,W.jsxs)(`div`,{ref:t,role:`group`,"aria-labelledby":n?c:void 0,className:H(op.root,!m&&op.hidden,i),style:{order:p.length>0?Math.min(...p):void 0},"data-component":`CommandPalette.Group`,...o,children:[n?(0,W.jsx)(`div`,{id:c,className:op.heading,"data-component":`CommandPalette.GroupHeading`,children:n}):null,a]})})}sp.displayName=`CommandPalette.Group`;var cp=U(sp);const lp={root:`command-palette-input`};function up(e,t){let{className:n,placeholder:r=`Type a command or search`,...i}=e,a=l.useContext(Wf);return a?(0,W.jsx)(Qo,{ref:t,type:`text`,size:`large`,block:!0,role:`combobox`,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-controls":a.listId,"aria-labelledby":a.labelId,"aria-activedescendant":a.activeId,autoComplete:`off`,leadingVisual:Bn,placeholder:r,value:a.search,onChange:e=>a.setSearch(e.target.value),className:H(lp.root,n),"data-component":`CommandPalette.Input`,...i}):null}up.displayName=`CommandPalette.Input`;var dp=U(up);const fp={root:`command-palette-item`,active:`command-palette-item-active`,unavailable:`command-palette-item-unavailable`,hidden:`hidden`};function pp(e,t){let{value:n,keywords:r,disabled:i=!1,forceMount:a=!1,onSelect:o,className:s,children:c,onClick:u,onPointerMove:d,...f}=e,p=K(),m=l.useContext(Wf),h=l.useContext(Gf),g=l.useRef(null),_=R(t,g),[v,y]=l.useState(n??``);Wi(()=>{y(n??(g.current?.textContent??``).trim())},[n,c]);let b=(r??[]).join(`\0`),x=m?.register,S=m?.unregister,C=h?.groupId;l.useEffect(()=>{if(!(!x||!S||v===``))return x({value:v,id:p,keywords:b===``?[]:b.split(`\0`),groupId:C,disabled:i,forceMount:a}),()=>{S(v)}},[i,a,C,p,b,x,S,v]);let w=m?.order.indexOf(v)??-1,T=m?.value===v&&v!==``,E=m===null||v===``||m.scores[v]===void 0||w!==-1;return l.useEffect(()=>{T&&g.current?.scrollIntoView?.({block:`nearest`})},[T]),(0,W.jsx)(`div`,{ref:_,id:p,role:`option`,"aria-selected":T,"aria-disabled":i||void 0,className:H(fp.root,T&&fp.active,i&&fp.unavailable,!E&&fp.hidden,s),style:{order:w===-1?void 0:w},onClick:e=>{u?.(e),!(i||e.defaultPrevented)&&(o?.(v),m?.onSelect(v))},onPointerMove:e=>{d?.(e),!i&&!T&&m?.setValue(v)},"data-component":`CommandPalette.Item`,"data-value":v||void 0,"data-active":T||void 0,"data-disabled":i||void 0,...f,children:c})}pp.displayName=`CommandPalette.Item`;var mp=U(pp);const hp={root:`command-palette-list`};function gp(e,t){let{maxHeight:n=400,className:r,style:i,children:a,...o}=e,s=l.useContext(Wf);return s?(0,W.jsx)(`div`,{ref:t,id:s.listId,role:`listbox`,"aria-labelledby":s.labelId,className:H(hp.root,r),style:{...i,maxHeight:`${n}px`},"data-component":`CommandPalette.List`,...o,children:a}):null}gp.displayName=`CommandPalette.List`;var _p=U(gp);const vp={root:`command-palette-loading`};function yp(e,t){let{label:n=`Loading`,className:r,children:i,...a}=e;return(0,W.jsx)(`div`,{ref:t,role:`presentation`,className:H(vp.root,r),"data-component":`CommandPalette.Loading`,...a,children:i??(0,W.jsx)(ri,{size:`small`,srText:n})})}yp.displayName=`CommandPalette.Loading`;var bp=U(yp);const xp={root:`command-palette-separator`};function Sp(e,t){let{alwaysRender:n=!1,className:r,...i}=e,a=l.useContext(Wf);return!n&&a!==null&&a.search.trim()!==``?null:(0,W.jsx)(`div`,{ref:t,role:`separator`,className:H(xp.root,r),"data-component":`CommandPalette.Separator`,...i})}Sp.displayName=`CommandPalette.Separator`;var Cp=U(Sp);const wp=Object.assign(Yf,{Dialog:np,Input:dp,List:_p,Group:cp,Item:mp,Separator:Cp,Empty:ap,Loading:bp}),Tp={root:`scrollable-region`};function Ep(e,t){let{as:n=`div`,className:r,"aria-label":i,"aria-labelledby":a,...o}=e,s=l.useRef(null),c=R(t,s),u=yf(s)?{role:`region`,tabIndex:0,"aria-label":i,"aria-labelledby":a}:{};return(0,W.jsx)(n,{ref:c,className:H(Tp.root,r),"data-component":`ScrollableRegion`,...u,...o})}Ep.displayName=`ScrollableRegion`;var Dp=U(Ep);const Op={root:`dialog-body`};function kp(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Op.root,r),"data-component":`Dialog.Body`,...i})}kp.displayName=`Dialog.Body`;var Ap=U(kp);const jp=(0,l.createContext)(void 0);function Mp({buttons:e}){let t=l.useContext(jp),n=e.findIndex(e=>e.autoFocus),r=R(t?.autoFocusRef,e[n]?.ref);return(0,W.jsx)(W.Fragment,{children:e.map((e,t)=>{let{content:i,buttonType:a=`default`,autoFocus:o,ref:s,...c}=e;return(0,W.jsx)(_i,{ref:o&&t===n?r:s,variant:a===`normal`?`default`:a,"data-component":`Dialog.FooterButton`,...c,children:i},t)})})}Mp.displayName=`Dialog.Buttons`;function Np(e,t){let{onClose:n,...r}=e;return(0,W.jsx)(bi,{ref:t,icon:Sn,"aria-label":`Close`,variant:`invisible`,onClick:n,"data-component":`Dialog.CloseButton`,...r})}Np.displayName=`Dialog.CloseButton`;var Pp=U(Np);const Fp={root:`dialog-footer`,scroll:`dialog-footer-scroll`};function Ip(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Fp.root,Fp.scroll,r),"data-component":`Dialog.Footer`,...i})}Ip.displayName=`Dialog.Footer`;var Lp=U(Ip);const Rp={root:`dialog-header`};function zp(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Rp.root,r),"data-component":`Dialog.Header`,...i})}zp.displayName=`Dialog.Header`;var Bp=U(zp);const Vp={root:`dialog-subtitle`};function Hp(e,t){let{as:n=`h2`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Vp.root,r),"data-component":`Dialog.Subtitle`,...i})}Hp.displayName=`Dialog.Subtitle`;var Up=U(Hp);const Wp={root:`dialog-title`};function Gp(e,t){let{as:n=`h1`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Wp.root,r),"data-component":`Dialog.Title`,...i})}Gp.displayName=`Dialog.Title`;var Kp=U(Gp);const qp={backdrop:`dialog-backdrop motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,backdropPosition:{center:`dialog-backdrop-center`,left:`dialog-backdrop-left`,right:`dialog-backdrop-right`},backdropNarrowPosition:{center:`dialog-backdrop-narrow-center`,bottom:`dialog-backdrop-narrow-bottom`,fullscreen:`dialog-backdrop-narrow-fullscreen`},backdropAlign:{top:`dialog-backdrop-align-top`,center:`dialog-backdrop-align-center`,bottom:`dialog-backdrop-align-bottom`},backdropNarrowAlign:{top:`dialog-backdrop-narrow-align-top`,center:`dialog-backdrop-narrow-align-center`,bottom:`dialog-backdrop-narrow-align-bottom`},root:`dialog motion-safe:animate-in motion-safe:duration-short`,width:{small:`dialog-width-small`,medium:`dialog-width-medium`,large:`dialog-width-large`,xlarge:`dialog-width-xlarge`},customWidth:`dialog-width-custom`,height:{small:`dialog-height-small`,large:`dialog-height-large`,auto:`dialog-height-auto`},position:{center:`motion-safe:fade-in motion-safe:zoom-in-50`,left:`dialog-left motion-safe:slide-in-from-left`,right:`dialog-right motion-safe:slide-in-from-right`},narrowPosition:{center:``,bottom:`dialog-narrow-bottom max-medium:motion-safe:zoom-in-100 max-medium:motion-safe:slide-in-from-bottom`,fullscreen:`dialog-narrow-fullscreen`},align:{top:`dialog-align-top`,center:``,bottom:`dialog-align-bottom`},headerInner:`dialog-header-inner`,headerContent:`dialog-header-content`,overflowWrapper:`dialog-overflow-wrapper`,overflowWrapperBordered:`dialog-overflow-wrapper-bordered`},Jp={narrow:`center`,regular:`center`};let Yp=0,Xp=``,Zp=``;const Qp=e=>typeof e==`string`&&e in qp.width,$p=e=>typeof e==`number`?`${e}px`:e,em=({title:e,subtitle:t,dialogLabelId:n,dialogDescriptionId:r,onClose:i})=>(0,W.jsx)(Bp,{children:(0,W.jsxs)(`div`,{className:qp.headerInner,children:[(0,W.jsxs)(`div`,{className:qp.headerContent,children:[(0,W.jsx)(Kp,{id:n,children:e}),t?(0,W.jsx)(Up,{id:r,children:t}):null]}),(0,W.jsx)(Pp,{onClose:()=>i(`close-button`)})]})}),tm=({children:e})=>(0,W.jsx)(Ap,{children:e}),nm=e=>{let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(e.defaultPrevented||t===0)return;let n=Array.from(e.currentTarget.querySelectorAll(`[data-component='Dialog.FooterButton']:not([disabled])`)),r=n.indexOf(document.activeElement);r!==-1&&(e.preventDefault(),n[(r+t+n.length)%n.length].focus())},rm=({footerButtons:e})=>e?(0,W.jsx)(Lp,{onKeyDown:nm,children:(0,W.jsx)(Mp,{buttons:e})}):null;function im(e,t){let{title:n=`Dialog`,subtitle:r=``,renderHeader:i,renderBody:a,renderFooter:o,footerButtons:s,onClose:c,role:u=`dialog`,width:d=`xlarge`,height:f=`auto`,position:p=Jp,align:m,returnFocusRef:h,initialFocusRef:g,className:_,style:v,children:y,...b}=e,x=K(),S=K(),C=l.useRef(null),w=R(t,C),T=l.useRef(null),E=l.useRef(null),D=l.useRef(null),[O,k]=l.useState(!1),[A,j]=l.useState(`wrap`),M=yf(E);Ui({containerRef:C,initialFocusRef:g??D,returnFocusRef:h}),qi(e=>{c(`escape`),e.preventDefault()}),l.useEffect(()=>{if(Yp++,Yp===1){let e=window.innerWidth-document.body.clientWidth;Xp=document.body.style.overflow,Zp=document.body.style.paddingRight,document.body.style.overflow=`hidden`,document.body.style.paddingRight=`${e}px`,document.body.setAttribute(`data-dialog-scroll-disabled`,``)}return()=>{Yp--,Yp===0&&(document.body.style.overflow=Xp,document.body.style.paddingRight=Zp,document.body.removeAttribute(`data-dialog-scroll-disabled`))}},[]);let[N,P]=Tr(y,{header:Bp,body:Ap,footer:Lp}),F={...e,title:n,subtitle:r,role:u,footerButtons:s,dialogLabelId:x,dialogDescriptionId:S},I=N.header??(i??em)(F),L=N.body??(a??tm)({...F,children:P}),ee=N.footer??(o??rm)(F),te=!!ee,ne=l.useCallback(()=>{let e=C.current,t=E.current;if(!te||!e||!t)return;e.setAttribute(`data-footer-button-layout`,`wrap`);let n=t.clientHeight>=48?`wrap`:`scroll`;e.setAttribute(`data-footer-button-layout`,n),j(n)},[te]);l.useEffect(()=>{let e=T.current;if(!e)return;let t=new ResizeObserver(ne);return t.observe(e),()=>{t.disconnect()}},[ne]);let re=e=>{e.target===e.currentTarget&&O&&c(`escape`)},ie=typeof p==`string`?{regular:p}:p,ae=ie.regular??`center`,oe=ie.narrow,se=ae===`center`?m:void 0,ce=Ji(`position`,ie),le=m?{"data-align":m}:void 0;return(0,W.jsx)(jp.Provider,{value:{autoFocusRef:D},children:(0,W.jsx)(aa,{children:(0,W.jsx)(`div`,{ref:T,className:H(qp.backdrop,qp.backdropPosition[ae],se&&qp.backdropAlign[se],oe&&qp.backdropNarrowPosition[oe],oe===`center`&&se&&qp.backdropNarrowAlign[se]),onClick:re,onMouseDown:e=>{k(e.target===e.currentTarget)},"data-component":`Dialog.Backdrop`,...ce,...le,children:(0,W.jsxs)(`div`,{ref:w,role:u,"aria-labelledby":x,"aria-describedby":S,"aria-modal":!0,className:H(qp.root,Qp(d)?qp.width[d]:qp.customWidth,qp.height[f],qp.position[ae],se&&qp.align[se],oe&&qp.narrowPosition[oe],_),style:{...v,...Qp(d)?{}:{"--dialog-width":$p(d)}},"data-component":`Dialog`,"data-width":Qp(d)?d:void 0,"data-height":f,"data-has-footer":te?``:void 0,"data-footer-button-layout":te?A:void 0,...ce,...le,...b,children:[I,(0,W.jsx)(Dp,{ref:E,"aria-labelledby":x,className:H(qp.overflowWrapper,te&&M&&qp.overflowWrapperBordered),children:L}),ee]})})})})}im.displayName=`Dialog`;var am=U(im);function om(e,t){let{onClose:n,title:r,cancelButtonContent:i=`Cancel`,confirmButtonContent:a=`OK`,confirmButtonType:o=`normal`,cancelButtonLoading:s=!1,confirmButtonLoading:c=!1,overrideButtonFocus:l,width:u=`medium`,height:d,className:f,children:p}=e,m=l??(o===`danger`?`cancel`:`confirm`);return(0,W.jsx)(am,{ref:t,title:r,onClose:n,footerButtons:[{content:i,onClick:()=>n(`cancel`),autoFocus:m===`cancel`,loading:s},{content:a,buttonType:o,onClick:()=>n(`confirm`),autoFocus:m===`confirm`,loading:c}],role:`alertdialog`,width:u,height:d,className:f,"data-component":`ConfirmationDialog`,children:p})}om.displayName=`ConfirmationDialog`;var sm=U(om);const cm=({content:e,...t})=>new Promise(n=>{let r=document.createElement(`div`);document.body.append(r);let i=(0,h.createRoot)(r);i.render((0,W.jsx)(sm,{...t,onClose:e=>{queueMicrotask(()=>{i.unmount(),r.remove()}),n(e===`confirm`)},children:e}))}),lm=()=>cm,um={wrapper:`data-table-wrapper`},dm=V(`data-table`,{variants:{cellPadding:{condensed:`data-table-cell-padding-condensed`,normal:`data-table-cell-padding-normal`,spacious:`data-table-cell-padding-spacious`}}});function fm(e,t){let{className:n,style:r,cellPadding:i=`normal`,gridTemplateColumns:a,"aria-labelledby":o,...s}=e;return(0,W.jsx)(Dp,{...o?{"aria-labelledby":o}:{"aria-label":`Table`},className:um.wrapper,children:(0,W.jsx)(`table`,{ref:t,role:`table`,"aria-labelledby":o,className:H(dm({cellPadding:i}),n),style:{...r,"--table-grid-template-columns":a},"data-component":`Table`,"data-cell-padding":i,...s})})}fm.displayName=`Table`;var pm=U(fm);const mm={root:`data-table-actions`};function hm(e,t){let{className:n,...r}=e;return(0,W.jsx)(`div`,{ref:t,className:H(mm.root,n),"data-component":`Table.Actions`,...r})}hm.displayName=`Table.Actions`;var gm=U(hm);const _m=`data-table-subgrid`,vm=e=>e.map(e=>{let t=e.width??`grow`,n=`auto`,r=`1fr`;return t===`auto`&&(r=`auto`),t===`grow`&&!e.maxWidth&&(n=`max-content`),t===`growCollapse`&&(n=`0`),e.minWidth&&(n=typeof e.minWidth==`number`?`${e.minWidth}px`:e.minWidth),e.maxWidth&&(r=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),typeof t!=`number`&&[`grow`,`growCollapse`,`auto`].includes(t)?n===r?n:`minmax(${n}, ${r})`:typeof t==`number`?`${t}px`:t}),ym=e=>vm(e).join(` `);function bm(e,t){let{className:n,...r}=e;return(0,W.jsx)(`tbody`,{ref:t,role:`rowgroup`,className:H(_m,n),"data-component":`Table.Body`,...r})}bm.displayName=`Table.Body`;var xm=U(bm);const Sm={root:`data-table-cell`,end:`data-table-cell-end`,rowHeader:`data-table-cell-row-header`};function Cm(e,t){let{className:n,align:r,scope:i,...a}=e;return(0,W.jsx)(i?`th`:`td`,{ref:t,scope:i,role:i?`rowheader`:`cell`,className:H(Sm.root,r===`end`&&Sm.end,i&&Sm.rowHeader,n),"data-component":`Table.Cell`,"data-cell-align":r,...a})}Cm.displayName=`Table.Cell`;var wm=U(Cm);const Tm={root:`data-table-cell-placeholder`};function Em(e,t){let{className:n,...r}=e;return(0,W.jsx)(Vo,{ref:t,className:H(Tm.root,n),"data-component":`Table.CellPlaceholder`,...r})}Em.displayName=`Table.CellPlaceholder`;var Dm=U(Em);const Om={root:`data-table-container`,spacing:`data-table-container-spacing`};function km(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Om.root,Om.spacing,r),"data-component":`Table.Container`,...i})}km.displayName=`Table.Container`;var Am=U(km);const jm={root:`data-table-divider`};function Mm(e,t){let{className:n,...r}=e;return(0,W.jsx)(`div`,{ref:t,role:`presentation`,className:H(jm.root,n),"data-component":`Table.Divider`,...r})}Mm.displayName=`Table.Divider`;var Nm=U(Mm);function Pm(e,t){let{title:n=`Error`,children:r,onRetry:i,onDismiss:a}=e;return(0,W.jsx)(sm,{ref:t,title:n,confirmButtonContent:`Retry`,cancelButtonContent:`Dismiss`,onClose:e=>{if(e===`confirm`){i?.();return}a?.()},children:r})}Pm.displayName=`Table.ErrorDialog`;var Fm=U(Pm);function Im(e,t){let{className:n,...r}=e;return(0,W.jsx)(`thead`,{ref:t,role:`rowgroup`,className:H(_m,n),"data-component":`Table.Head`,...r})}Im.displayName=`Table.Head`;var Lm=U(Im);const Rm={root:`data-table-header`,end:`data-table-header-end`,sorted:`data-table-header-sorted`};function zm(e,t){let{className:n,align:r,...i}=e;return(0,W.jsx)(`th`,{ref:t,role:`columnheader`,scope:`col`,className:H(Rm.root,Rm.sorted,r===`end`&&Rm.end,n),"data-component":`Table.Header`,"data-cell-align":r,...i})}zm.displayName=`Table.Header`;var Bm=U(zm);const Vm=(e,t,n,r,i)=>{let a={type:`previous`,num:t-1,disabled:t===1},o={type:`next`,num:t+1,disabled:t===e};if(!n)return[a,o];if(e<=0)return[a,{...o,disabled:!0}];let s=[],c=(e,n,r=!1)=>{for(let i=e;i<=n;i++)s.push({type:`number`,num:i,selected:i===t,precedesBreak:i===n&&r})},l=e=>{s.push({type:`break`,num:e+1})},u=i+r;if(e<=u+u+3)return c(1,e),[a,...s,o];let d=0,f=0;t-u-1<=1?f=t-u-2:d=t-u-1;let p=0,m=0;e-t-u<=1?m=e-t-u-1:p=e-t-u;let h=d>0,g=p>0;return c(1,r,h),h&&l(r),c(r+d+m+1,e-f-p-r,g),g&&l(e-f-p-r),c(e-r+1,e),[a,...s,o]},Hm=(e,t,n)=>{if(e.type===`break`)return{key:`page-${e.num}-break`,content:`…`,presentational:!0,props:{}};if(e.type===`number`)return{key:`page-${e.num}`,content:String(e.num),props:{href:t(e.num),"aria-label":`Page ${e.num}${e.precedesBreak?`...`:``}`,"aria-current":e.selected?`page`:void 0,onClick:n}};let r=e.type===`previous`?`prev`:`next`,i=e.type===`previous`?`Previous`:`Next`,a=`page-${r}`;return e.disabled?{key:a,content:i,props:{rel:r,"aria-hidden":!0,"aria-disabled":!0}}:{key:a,content:i,props:{rel:r,href:t(e.num),"aria-label":`${i} Page`,onClick:n}}},Um=[`narrow`,`regular`,`wide`],Wm={narrow:!1},Gm=e=>typeof e==`object`?Um.filter(t=>e[t]===!1):e?[]:[...Um],Km={root:`data-table-pagination`,range:`data-table-pagination-range`,steps:`data-table-pagination-steps`,step:`data-table-pagination-step`,button:`data-table-pagination-button`,truncation:`data-table-pagination-truncation`,icon:`data-table-pagination-icon`,hiddenRange:{narrow:`data-table-pagination-hidden-range-narrow`,regular:`data-table-pagination-hidden-range-regular`,wide:`data-table-pagination-hidden-range-wide`},hidden:`sr-only`},qm=V([Km.button,`data-table-pagination-jump`],{variants:{enabled:{true:`data-table-pagination-jump-enabled`,false:``}}}),Jm=V([Km.button,`data-table-pagination-page`],{variants:{active:{true:`data-table-pagination-page-active`,false:``}}}),Ym=({defaultPageIndex:e,onChange:t,pageSize:n,totalCount:r})=>{let i=Math.ceil(r/n),a=e=>e!==void 0&&e>=0&&e<i,[o,s]=l.useState(()=>a(e)?e:0),[c,u]=l.useState(o);return a(e)&&o!==e&&(s(e),u(e),t?.({pageIndex:e})),{pageIndex:c,pageCount:i,pageStart:c*n,pageEnd:Math.min((c+1)*n,r),hasPreviousPage:c>0,hasNextPage:c+1<i,selectPage:e=>{c!==e&&(u(e),t?.({pageIndex:e}))}}},Xm=({children:e})=>(0,W.jsx)(`li`,{className:Km.step,"data-component":`Table.Pagination.Step`,children:e});function Zm(e,t){let{className:n,totalCount:r,pageSize:i=25,defaultPageIndex:a,onChange:o,showPages:s=Wm,...c}=e,{pageIndex:u,pageCount:d,pageStart:f,pageEnd:p,hasPreviousPage:m,hasNextPage:h,selectPage:g}=Ym({defaultPageIndex:a,onChange:o,pageSize:i,totalCount:r}),_=l.useMemo(()=>Vm(d,u+1,!!s,1,2),[d,u,s]),v=Gm(s),y=f+1;return(0,W.jsxs)(`nav`,{ref:t,className:H(Km.root,n),"data-component":`Table.Pagination`,...c,children:[(0,W.jsxs)(`span`,{role:`status`,"aria-live":`polite`,className:Km.hidden,children:[`Showing `,y,` through `,p,` of `,r]}),(0,W.jsxs)(`p`,{className:Km.range,"data-component":`Table.Pagination.Range`,children:[y,(0,W.jsx)(`span`,{className:Km.hidden,children:` through `}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`‒`}),p,` of `,r]}),(0,W.jsxs)(`ol`,{className:H(Km.steps,v.map(e=>Km.hiddenRange[e])),"data-hidden-viewport-ranges":v.join(` `)||void 0,children:[(0,W.jsx)(Xm,{children:(0,W.jsxs)(`button`,{type:`button`,className:H(qm({enabled:m})),"data-has-page":m||void 0,"aria-disabled":!m||void 0,onClick:()=>{m&&g(u-1)},"data-component":`Table.Pagination.PreviousPageButton`,children:[m?(0,W.jsx)(dn,{className:Km.icon}):null,(0,W.jsx)(`span`,{children:`Previous`}),(0,W.jsx)(`span`,{className:Km.hidden,children:`\xA0page`})]})}),_.map((e,t)=>e.type===`break`?(0,W.jsx)(`li`,{"aria-hidden":`true`,className:Km.truncation,"data-component":`Table.Pagination.TruncationStep`,children:`…`},`break-${t}`):e.type===`number`?(0,W.jsx)(Xm,{children:(0,W.jsxs)(`button`,{type:`button`,className:H(Jm({active:e.selected})),"data-active":e.selected||void 0,"aria-current":e.selected||void 0,onClick:()=>g(e.num-1),"data-component":`Table.Pagination.Page`,children:[(0,W.jsx)(`span`,{className:Km.hidden,children:`Page\xA0`}),e.num,e.precedesBreak?(0,W.jsx)(`span`,{className:Km.hidden,children:`…`}):null]})},`page-${e.num}`):null),(0,W.jsx)(Xm,{children:(0,W.jsxs)(`button`,{type:`button`,className:H(qm({enabled:h})),"data-has-page":h||void 0,"aria-disabled":!h||void 0,onClick:()=>{h&&g(u+1)},"data-component":`Table.Pagination.NextPageButton`,children:[(0,W.jsx)(`span`,{children:`Next`}),(0,W.jsx)(`span`,{className:Km.hidden,children:`\xA0page`}),h?(0,W.jsx)(fn,{className:Km.icon}):null]})})]})]})}Zm.displayName=`Table.Pagination`;var Qm=U(Zm);function $m(e,t){let{className:n,...r}=e;return(0,W.jsx)(`tr`,{ref:t,role:`row`,className:H(_m,n),"data-component":`Table.Row`,...r})}$m.displayName=`Table.Row`;var eh=U($m);const th={root:`skeleton-box`,shimmer:`motion-safe:shimmer`};function nh(e,t){let{as:n=`div`,className:r,width:i,height:a,style:o,...s}=e;return(0,W.jsx)(n,{ref:t,className:H(th.root,th.shimmer,r),style:{...o,"--skeleton-box-width":i,"--skeleton-box-height":a},"data-component":`SkeletonBox`,...s})}nh.displayName=`SkeletonBox`;var rh=U(nh);const ih={wrapper:`skeleton-text-wrapper`},ah=V(`skeleton-text`,{variants:{size:{display:`skeleton-text-display`,titleLarge:`skeleton-text-title-large`,titleMedium:`skeleton-text-title-medium`,titleSmall:`skeleton-text-title-small`,bodyLarge:`skeleton-text-body-large`,bodyMedium:`skeleton-text-body-medium`,bodySmall:`skeleton-text-body-small`,subtitle:`skeleton-text-subtitle`},multiline:{true:`skeleton-text-multiline`,false:``}}});function oh({lines:e=1,maxWidth:t,size:n=`bodyMedium`,className:r,style:i,...a}){return e<2?(0,W.jsx)(rh,{width:`100%`,height:`var(--skeleton-text-font-size)`,className:H(ah({size:n}),r),style:{...i,maxWidth:t},"data-size":n,...a,"data-component":`SkeletonText`}):(0,W.jsx)(`div`,{className:ih.wrapper,style:{...i,maxWidth:t},"data-component":`SkeletonText`,children:Array.from({length:e},(e,t)=>(0,W.jsx)(rh,{height:`var(--skeleton-text-font-size)`,className:H(ah({size:n,multiline:!0}),r),"data-size":n,...a},t))})}oh.displayName=`SkeletonText`;const sh={cell:`data-table-skeleton-cell`,items:`data-table-skeleton-items`,item:`data-table-skeleton-item`,hidden:`sr-only`};function ch(e,t){let{columns:n,cellPadding:r,rows:i=10,...a}=e;return(0,W.jsxs)(pm,{ref:t,cellPadding:r,gridTemplateColumns:ym(n),"data-component":`Table.Skeleton`,...a,children:[(0,W.jsx)(Lm,{children:(0,W.jsx)(eh,{children:n.map((e,t)=>(0,W.jsx)(Bm,{children:typeof e.header==`string`?e.header:e.header()},e.id??e.field??t))})}),(0,W.jsx)(xm,{children:(0,W.jsx)(eh,{children:n.map((e,t)=>(0,W.jsxs)(wm,{className:sh.cell,"data-cell-skeleton":``,children:[(0,W.jsx)(`span`,{className:sh.hidden,children:`Loading`}),(0,W.jsx)(`div`,{className:sh.items,children:Array.from({length:i},(e,t)=>(0,W.jsx)(`div`,{className:sh.item,"data-cell-skeleton-item":``,children:(0,W.jsx)(oh,{})},t))})]},e.id??e.field??t))})})]})}ch.displayName=`Table.Skeleton`;var lh=U(ch);const uh={header:`data-table-sort-header`,button:`data-table-sort-header-button`,buttonEnd:`data-table-sort-header-button-end`,icon:`data-table-sort-header-icon`,iconResting:`data-table-sort-header-icon-resting`,hidden:`sr-only`};function dh(e,t){let{className:n,align:r,children:i,direction:a,onToggleSort:o,...s}=e,c=a===`ASC`?`ascending`:a===`DESC`?`descending`:void 0,l=a===`DESC`?en:tn;return(0,W.jsx)(Bm,{ref:t,align:r,"aria-sort":c,className:H(uh.header,n),"data-component":`Table.SortHeader`,...s,children:(0,W.jsxs)(`button`,{type:`button`,onClick:o,className:H(uh.button,r===`end`&&uh.buttonEnd),"data-component":`Table.SortHeader.Button`,children:[i,(0,W.jsx)(l,{className:H(uh.icon,a===`NONE`&&uh.iconResting),"aria-hidden":`true`,"data-sort-icon":a===`DESC`?`descending`:`ascending`}),a===`NONE`?(0,W.jsx)(`span`,{className:uh.hidden,children:`sort ascending`}):null]})})}dh.displayName=`Table.SortHeader`;var fh=U(dh);const ph={root:`data-table-subtitle`};function mh(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(ph.root,r),"data-component":`Table.Subtitle`,...i})}mh.displayName=`Table.Subtitle`;var hh=U(mh);const gh={root:`data-table-title`};function _h(e,t){let{as:n=`h2`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(gh.root,r),"data-component":`Table.Title`,...i})}_h.displayName=`Table.Title`;var vh=U(_h);const yh=e=>e===`ASC`?`DESC`:`ASC`,bh=(e,t)=>e===t?0:e<t?-1:1,xh=(e,t)=>{let n=e instanceof Date?e.getTime():e,r=t instanceof Date?t.getTime():t;return n>r?1:n<r?-1:0},Sh=e=>{let t=[],n=0;for(;n<e.length;){let r=e[n];if(Ch(r)){for(;n+1<e.length&&Ch(e[n+1]);)r+=e[n+1],n++;t.push(parseInt(r,10))}else{for(;n+1<e.length&&!Ch(e[n+1]);)r+=e[n+1],n++;t.push(r)}n++}return t},Ch=e=>!Number.isNaN(parseInt(e,10)),wh={alphanumeric:(e,t)=>{let n=Sh(e),r=Sh(t);for(;n.length!==0&&r.length!==0;){let e=n.shift(),t=r.shift();if(e!==t){if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`number`&&typeof t==`number`)return e>t?1:-1;if(typeof e==`number`&&typeof t==`string`)return-1;if(typeof e==`string`&&typeof t==`number`)return 1;if(e===void 0||t===void 0)break}}return n.length>r.length?1:-1},basic:bh,datetime:xh},Th=(e,t)=>{let n=e;for(let e of t.split(`.`))n=n[e];return n},Eh=e=>e==null||e===``,Dh=(e,t,n)=>{let r=e=>e.sortBy!==void 0&&e.sortBy!==!1;if(t!==void 0){let i=e.find(e=>e.id===t||e.field===t);return!i||!r(i)?null:{id:`${t}`,direction:n??`ASC`}}if(n!==void 0){let t=e.find(r),i=t?.id??t?.field;return i===void 0?null:{id:i,direction:n}}return null},Oh=({columns:e,data:t,initialSortColumn:n,initialSortDirection:r,externalSorting:i,getRowId:a})=>{let[o,s]=l.useState(t),[c,u]=l.useState(t),[d,f]=l.useState(e),[p,m]=l.useState(()=>Dh(e,n,r)),h=ym(e);e!==d&&(f(e),p&&(e.some(e=>(e.id??e.field)===p.id)||m(null)));let g=e.map(e=>{let t=e.id??e.field;if(t===void 0)throw Error("Expected either an `id` or a `field` to be given for a Column");let n=e.sortBy!==void 0&&e.sortBy!==!1;return{id:t,column:e,isSortable:()=>n,getSortDirection:()=>p&&p.id===t?p.direction:`NONE`}}),_=e=>{let t=g.find(t=>t.id===e.id);if(!t)throw Error(`Unable to find a header with the id: ${e.id}`);let{sortBy:n,field:r}=t.column;if(n===!1||n===void 0)throw Error(`The column for this header cannot be sorted`);if(i)return;let a=typeof n==`string`?wh[n]:wh.basic;s(t=>t.slice().sort((t,i)=>{if(typeof n==`function`)return e.direction===`ASC`?n(t,i):n(i,t);if(r===void 0)return 0;let o=Th(t,r),s=Th(i,r),c=Eh(o),l=Eh(s);return!c&&!l?e.direction===`ASC`?a(o,s):a(s,o):c?+!l:-1}))};return t!==c&&(u(t),s(t),p&&_(p)),{headers:g,rows:o.map(e=>{let t=a(e);return{id:`${t}`,getValue:()=>e,getCells:()=>g.map(n=>({id:`${t}:${n.id}`,column:n.column,rowHeader:n.column.rowHeader??!1,getValue:()=>{if(n.column.field===void 0)throw Error(`Unable to get a value for the column: ${n.id}`);return Th(e,n.column.field)}}))}}),actions:{sortBy:e=>{let t={id:e.id,direction:p&&p.id===e.id?yh(p.direction):`ASC`};m(t),_(t)}},gridTemplateColumns:h}},kh=e=>typeof e.header==`string`?e.header:e.header(),Ah=e=>e.id;function jh(e,t){let{data:n,columns:r,cellPadding:i,initialSortColumn:a,initialSortDirection:o,externalSorting:s,getRowId:c=Ah,onToggleSort:l,"aria-labelledby":u,"aria-describedby":d}=e,{headers:f,rows:p,actions:m,gridTemplateColumns:h}=Oh({data:n,columns:r,initialSortColumn:a,initialSortDirection:o,externalSorting:s,getRowId:c});return(0,W.jsxs)(pm,{ref:t,"aria-labelledby":u,"aria-describedby":d,cellPadding:i,gridTemplateColumns:h,children:[(0,W.jsx)(Lm,{children:(0,W.jsx)(eh,{children:f.map(e=>e.isSortable()?(0,W.jsx)(fh,{align:e.column.align,direction:e.getSortDirection(),onToggleSort:()=>{let t=e.getSortDirection()===`ASC`?`DESC`:`ASC`;m.sortBy(e),l?.(e.id,t)},children:kh(e.column)},e.id):(0,W.jsx)(Bm,{align:e.column.align,children:kh(e.column)},e.id))})}),(0,W.jsx)(xm,{children:p.map(e=>(0,W.jsx)(eh,{children:e.getCells().map(t=>(0,W.jsx)(wm,{scope:t.rowHeader?`row`:void 0,align:t.column.align,children:t.column.renderCell?t.column.renderCell(e.getValue()):t.getValue()},t.id))},e.id))})]})}jh.displayName=`DataTable`;var Mh=U(jh);const Nh=()=>({column:e=>({...e,id:e.id??e.field})}),Ph=Object.assign(pm,{Container:Am,Title:vh,Subtitle:hh,Actions:gm,Divider:Nm,Skeleton:lh,Head:Lm,Body:xm,Header:Bm,SortHeader:fh,Row:eh,Cell:wm,CellPlaceholder:Dm,Pagination:Qm,ErrorDialog:Fm}),Fh={root:`date-picker`,block:`date-picker-block`,overlay:`date-picker-overlay`};function Ih(e,t){let{mode:n=`single`,value:r,defaultValue:i,onChange:a,format:o=`YYYY-MM-DD`,rangeSeparator:s=` - `,open:c,defaultOpen:u=!1,onOpenChange:d,min:f,max:p,isDateDisabled:m,weekStartsOn:h,fixedWeeks:g=!0,showWeekNumbers:_,monthFormat:v,calendarButtonLabel:y=`Choose a date`,calendarLabel:b=`Choose a date`,placeholder:x,disabled:S,block:C,onBlur:w,inputClassName:T,className:E,...D}=e,O=K(),k=l.useRef(null),A=l.useRef(null),j=R(t,A),M=l.useRef(null),N=hl(f),P=hl(p),F=n===`range`,I=r!==void 0,[L,ee]=l.useState(()=>vl(i,F)),te=I?vl(r,F):L,ne=c!==void 0,[re,ie]=l.useState(u),ae=ne?c:re,oe=({from:e,to:t})=>e===null?``:!F||t===null?e.format(o):`${e.format(o)}${s}${t.format(o)}`,se=e=>{if(e.trim()===``)return _l;let t=(F?e.split(s):[e]).map(e=>Ol(e.trim(),o));if(t.length>2||t.some(e=>e===null))return;let[n,r=null]=t;return F?r&&n.isAfter(r,`day`)?{from:r,to:n}:{from:n,to:r}:{from:n,to:n}},[ce,le]=l.useState(null),ue=ce??oe(te),de=(e,t)=>{ne||ie(e),d?.(e,t)},fe=e=>{if([e.from,e.to].every(e=>e===null||Cl(e,N,P,m))){if(I||ee(e),F){a?.({from:e.from?.toDate()??null,to:e.to?.toDate()??null});return}a?.(e.from?.toDate()??null)}},pe=e=>{let t=e.target.value;le(t);let n=se(t);n&&fe(n)},me=e=>{le(null),w?.(e)},he=e=>{le(null),fe(vl(e,!1)),de(!1,`date-select`)},ge=e=>{le(null),fe(vl(e,!0)),e.from&&e.to&&de(!1,`date-select`)},_e=e=>{de(!1,e===`escape`?`escape`:`click-outside`)},ve={min:f,max:p,isDateDisabled:m,weekStartsOn:h,fixedWeeks:g,showWeekNumbers:_,monthFormat:v,focusableDayRef:M,"data-component":`DatePicker.Calendar`};return(0,W.jsxs)(`span`,{className:H(Fh.root,C&&Fh.block,E),"data-component":`DatePicker`,"data-open":ae,children:[(0,W.jsx)(`span`,{ref:k,className:H(Fh.root,C&&Fh.block),"data-component":`DatePicker.Field`,children:(0,W.jsx)(Qo,{ref:j,type:`text`,value:ue,onChange:pe,onBlur:me,placeholder:x??(F?`${o}${s}${o}`:o),disabled:S,block:C,className:T,trailingAction:(0,W.jsx)(Qo.Action,{icon:sn,"aria-label":y,"aria-haspopup":`dialog`,"aria-expanded":ae,"aria-controls":ae?O:void 0,disabled:S,onClick:()=>de(!ae,`button`),"data-component":`DatePicker.CalendarButton`}),...D})}),(0,W.jsx)(ga,{renderAnchor:null,anchorRef:k,open:ae,onClose:_e,side:`outside-bottom`,align:`start`,className:Fh.overlay,overlayProps:{id:O,role:`dialog`,"aria-label":b},focusTrapSettings:{initialFocusRef:M,returnFocusRef:A},children:F?(0,W.jsx)(Nl,{mode:`range`,value:{from:te.from,to:te.to},onChange:ge,...ve}):(0,W.jsx)(Nl,{value:te.from,onChange:he,...ve})})]})}Ih.displayName=`DatePicker`;var Lh=U(Ih);const Rh={root:`details`};function zh(e,t){let{className:n,open:r,defaultOpen:i,closeOnOutsideClick:a,onChange:o,onToggle:s,...c}=e,u=l.useRef(null),d=R(t,u),f=r!==void 0,[p,m]=l.useState(!!i),h=f?r:p;return l.useEffect(()=>{let e=u.current;e&&e.open!==h&&(e.open=h)}),l.useEffect(()=>{if(!a||!h)return;let e=e=>{let{target:t}=e;!(t instanceof Element)||t.closest(`details`)===u.current||(m(!1),o?.(!1))};return document.addEventListener(`click`,e),()=>{document.removeEventListener(`click`,e)}},[a,h,o]),(0,W.jsx)(`details`,{ref:d,open:h,onToggle:e=>{s?.(e);let{open:t}=e.currentTarget;m(t),t!==h&&o?.(t)},className:H(Rh.root,n),"data-component":`Details`,...c})}zh.displayName=`Details`;var Bh=U(zh);const Vh={root:`details-summary`};function Hh(e,t){let{as:n,className:r,...i}=e,a=n??`summary`,o=a===`summary`?{}:{as:`summary`};return(0,W.jsx)(a,{ref:t,className:H(Vh.root,r),"data-component":`Details.Summary`,...o,...i})}Hh.displayName=`Details.Summary`;var Uh=U(Hh);const Wh=Object.assign(Bh,{Summary:Uh}),Gh=Object.assign(am,{Header:Bp,Title:Kp,Subtitle:Up,Body:Ap,Footer:Lp,Buttons:Mp,CloseButton:Pp}),Kh={root:`drawer-body`};function qh(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Kh.root,r),"data-component":`Drawer.Body`,...i})}qh.displayName=`Drawer.Body`;var Jh=U(qh);const Yh=(0,l.createContext)({}),Xh={root:`drawer-close-button`};function Zh(e,t){let{className:n,onClose:r,...i}=e,{onClose:a}=l.useContext(Yh);return(0,W.jsx)(bi,{ref:t,icon:Sn,"aria-label":`Close`,variant:`invisible`,className:H(Xh.root,n),onClick:r??a,"data-component":`Drawer.CloseButton`,...i})}Zh.displayName=`Drawer.CloseButton`;var Qh=U(Zh);const $h={root:`drawer-footer`};function eg(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H($h.root,r),"data-component":`Drawer.Footer`,...i})}eg.displayName=`Drawer.Footer`;var tg=U(eg);const ng={root:`drawer-header`,directTitle:`drawer-header-direct-title`};function rg(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(ng.root,ng.directTitle,r),"data-component":`Drawer.Header`,...i})}rg.displayName=`Drawer.Header`;var ig=U(rg);const ag={root:`drawer-subtitle`};function og(e,t){let{as:n=`h2`,className:r,id:i,...a}=e,{descriptionId:o}=l.useContext(Yh);return(0,W.jsx)(n,{ref:t,id:i??o,className:H(ag.root,r),"data-component":`Drawer.Subtitle`,...a})}og.displayName=`Drawer.Subtitle`;var sg=U(og);const cg={root:`drawer-title`};function lg(e,t){let{as:n=`h1`,className:r,id:i,...a}=e,{labelId:o}=l.useContext(Yh);return(0,W.jsx)(n,{ref:t,id:i??o,className:H(cg.root,r),"data-component":`Drawer.Title`,...a})}lg.displayName=`Drawer.Title`;var ug=U(lg);const dg={backdrop:`drawer-backdrop motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,backdropModeless:`drawer-backdrop-modeless`,backdropPosition:{left:`drawer-backdrop-left`,right:`drawer-backdrop-right`,top:`drawer-backdrop-top`,bottom:`drawer-backdrop-bottom`},root:`drawer motion-safe:animate-in motion-safe:duration-short`,rootModeless:`drawer-modeless`,position:{left:`drawer-left motion-safe:slide-in-from-left`,right:`drawer-right motion-safe:slide-in-from-right`,top:`drawer-top motion-safe:slide-in-from-top`,bottom:`drawer-bottom motion-safe:slide-in-from-bottom`},inlineSize:{small:`drawer-inline-size-small`,medium:`drawer-inline-size-medium`,large:`drawer-inline-size-large`,xlarge:`drawer-inline-size-xlarge`},blockSize:{small:`drawer-block-size-small`,medium:`drawer-block-size-medium`,large:`drawer-block-size-large`,xlarge:`drawer-block-size-xlarge`},customInlineSize:`drawer-inline-size-custom`,customBlockSize:`drawer-block-size-custom`,headerContent:`drawer-header-content`,overflowWrapper:`drawer-overflow-wrapper`,overflowWrapperBordered:`drawer-overflow-wrapper-bordered`},fg=e=>typeof e==`string`&&e in dg.inlineSize,pg=e=>typeof e==`number`?`${e}px`:e;function mg(e,t){let{title:n=`Drawer`,subtitle:r=``,onClose:i,position:a=`right`,size:o=`medium`,modal:s=!0,returnFocusRef:c,initialFocusRef:u,className:d,style:f,children:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=e,v=K(),y=K(),b=l.useRef(null),x=R(t,b),S=l.useRef(null),[C,w]=l.useState(!1),T=yf(S);Ui({containerRef:b,initialFocusRef:u,returnFocusRef:c,disabled:!s}),qi(e=>{i(`escape`),s&&e.preventDefault()}),$f(!s);let[E,D]=Tr(p,{header:ig,body:Jh,footer:tg}),O=()=>{i(`close-button`)},k=e=>{s&&e.target===e.currentTarget&&C&&i(`escape`)},A=E.header??(0,W.jsxs)(ig,{children:[(0,W.jsxs)(`div`,{className:dg.headerContent,children:[(0,W.jsx)(ug,{children:n}),r?(0,W.jsx)(sg,{children:r}):null]}),(0,W.jsx)(Qh,{})]}),j=E.body??(0,W.jsx)(Jh,{children:D}),M=E.footer,N=!!M,P=a===`left`||a===`right`,F=fg(o),I=h??(m?void 0:v),L=g??(r?y:void 0);return(0,W.jsx)(Yh.Provider,{value:{labelId:v,descriptionId:y,onClose:O},children:(0,W.jsx)(aa,{children:(0,W.jsx)(`div`,{className:H(dg.backdrop,dg.backdropPosition[a],!s&&dg.backdropModeless),onClick:k,onMouseDown:e=>{w(e.target===e.currentTarget)},"data-component":`Drawer.Backdrop`,"data-position":a,"data-modal":s,children:(0,W.jsxs)(`div`,{ref:x,role:`dialog`,"aria-labelledby":I,"aria-describedby":L,"aria-label":m,"aria-modal":s||void 0,className:H(dg.root,dg.position[a],F?P?dg.inlineSize[o]:dg.blockSize[o]:P?dg.customInlineSize:dg.customBlockSize,!s&&dg.rootModeless,d),style:{...f,...F?{}:{"--drawer-size":pg(o)}},"data-component":`Drawer`,"data-position":a,"data-size":F?o:void 0,"data-modal":s,"data-has-footer":N?``:void 0,..._,children:[A,(0,W.jsx)(Dp,{ref:S,"aria-labelledby":v,className:H(dg.overflowWrapper,N&&T&&dg.overflowWrapperBordered),children:j}),M]})})})})}mg.displayName=`Drawer`;var hg=U(mg);const gg=Object.assign(hg,{Header:ig,Title:ug,Subtitle:sg,Body:Jh,Footer:tg,CloseButton:Qh}),_g=V(`em`,{variants:{size:{large:`em-size-large`,medium:`em-size-medium`,small:`em-size-small`},weight:{light:`em-weight-light`,normal:`em-weight-normal`,medium:`em-weight-medium`,semibold:`em-weight-semibold`}}});function vg(e,t){let{as:n=`em`,className:r,size:i,weight:a,...o}=e;return(0,W.jsx)(n,{ref:t,className:H(_g({size:i,weight:a}),r),"data-component":`Em`,"data-size":i,"data-weight":a,...o})}vg.displayName=`Em`;var yg=U(vg);const bg=V(`empty-state`,{variants:{size:{small:`empty-state-small`,medium:`empty-state-medium`}}}),xg={icon:`empty-state-icon`,title:`empty-state-title`,description:`empty-state-description`,actions:`empty-state-actions`},Sg=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,W.jsx)(e,{});function Cg(e,t){let{as:n=`div`,className:r,children:i,title:a,description:o,icon:s,size:c=`medium`,actions:l,...u}=e;return(0,W.jsxs)(n,{ref:t,className:H(bg({size:c}),r),"data-component":`EmptyState`,"data-size":c,...u,children:[s===void 0?null:(0,W.jsx)(`span`,{className:xg.icon,"aria-hidden":`true`,"data-component":`EmptyState.Icon`,children:Sg(s)}),(0,W.jsx)(`span`,{className:xg.title,"data-component":`EmptyState.Title`,children:a}),o?(0,W.jsx)(`span`,{className:xg.description,"data-component":`EmptyState.Description`,children:o}):null,i,l?(0,W.jsx)(`div`,{className:xg.actions,"data-component":`EmptyState.Actions`,children:l}):null]})}Cg.displayName=`EmptyState`;var wg=U(Cg);const Tg=1024,Eg=[`bytes`,`KB`,`MB`,`GB`,`TB`],Dg=e=>{if(!Number.isFinite(e)||e<=0)return`0 ${Eg[0]}`;let t=e,n=0;for(;t>=Tg&&n<Eg.length-1;)t/=Tg,n+=1;return`${n===0?Math.round(t):Math.round(t*10)/10} ${Eg[n]}`},Og=(e,t)=>{let n=(t??``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(e.slice(0,-1)):i===e)},kg=(e,t)=>{let{accept:n,maxSize:r,multiple:i}=t,a=[],o=[];return e.forEach(e=>{if(!Og(e,n)){o.push({file:e,reason:`type`});return}if(r!==void 0&&e.size>r){o.push({file:e,reason:`size`});return}if(!i&&a.length>0){o.push({file:e,reason:`count`});return}a.push(e)}),{accepted:a,rejected:o}},Ag=(0,l.createContext)({}),jg={root:`file-upload-description`};function Mg(e,t){let{className:n,id:r,...i}=e,{descriptionId:a}=l.useContext(Ag);return(0,W.jsx)(`span`,{ref:t,id:r??a,className:H(jg.root,n),"data-component":`FileUpload.Description`,...i})}Mg.displayName=`FileUpload.Description`;var Ng=U(Mg);const Pg={root:`file-upload-icon`};function Fg(e,t){let{icon:n=an,className:r,"aria-label":i,...a}=e;return(0,W.jsx)(`span`,{ref:t,role:i?`img`:void 0,"aria-label":i,"aria-hidden":!i||void 0,className:H(Pg.root,r),"data-component":`FileUpload.Icon`,...a,children:(0,W.jsx)(n,{})})}Fg.displayName=`FileUpload.Icon`;var Ig=U(Fg);const Lg={root:`file-upload-label`};function Rg(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(Ag);return(0,W.jsx)(`span`,{ref:t,id:r??a,className:H(Lg.root,n),"data-component":`FileUpload.Label`,...i})}Rg.displayName=`FileUpload.Label`;var zg=U(Rg);const Bg={root:`file-upload-list`};function Vg(e,t){let{className:n,children:r,...i}=e;return l.Children.toArray(r).length===0?null:(0,W.jsx)(`ul`,{ref:t,role:`list`,className:H(Bg.root,n),"data-component":`FileUpload.List`,...i,children:r})}Vg.displayName=`FileUpload.List`;var Hg=U(Vg);const Ug={input:`sr-only`},Wg=V(`file-upload`,{variants:{size:{small:`file-upload-small`,medium:`file-upload-medium`,large:`file-upload-large`}}}),Gg=V(`file-upload-zone`,{variants:{dragging:{true:`file-upload-zone-dragging`,false:``},disabled:{true:`file-upload-zone-disabled`,false:`file-upload-zone-interactive`},validation:{error:`file-upload-zone-error`,success:`file-upload-zone-success`}}}),Kg=(e,t)=>{if(!e||typeof DataTransfer>`u`)return;let n=new DataTransfer;t.forEach(e=>n.items.add(e)),e.files=n.files};function qg(e,t){let{className:n,children:r,size:i=`medium`,accept:a,multiple:o,disabled:s,required:c,name:u,maxSize:d,validationStatus:f,onSelect:p,onReject:m,id:h,"aria-label":g,"aria-labelledby":_,"aria-describedby":v,...y}=e,b=l.useRef(null),x=K(h),S=K(),C=K(),w=l.useRef(0),[T,E]=l.useState(!1),[D,O]=Tr(r,{icon:Ig,label:zg,description:Ng,list:Hg}),k=(e,t)=>{let{accepted:n,rejected:r}=kg(e,{accept:a,maxSize:d,multiple:o});t===`drop`&&n.length>0&&Kg(b.current,n),r.length>0&&m?.(r,t),n.length>0&&p?.(n,t)},A=e=>{k(Array.from(e.target.files??[]),`input`)},j=e=>{s||(e.preventDefault(),w.current+=1,E(!0))},M=e=>{s||(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))},N=()=>{s||(w.current=Math.max(w.current-1,0),w.current===0&&E(!1))},P=e=>{s||(e.preventDefault(),w.current=0,E(!1),k(Array.from(e.dataTransfer?.files??[]),`drop`))},F=_??(D.label&&!g?S:void 0),I=[D.description?C:void 0,v].filter(Boolean).join(` `)||void 0;return(0,W.jsx)(Ag.Provider,{value:{labelId:S,descriptionId:C},children:(0,W.jsxs)(`div`,{ref:t,className:H(Wg({size:i}),n),"data-component":`FileUpload`,"data-size":i,"data-disabled":s,"data-dragging":T||void 0,"data-validation":f,...y,children:[(0,W.jsxs)(`label`,{className:H(Gg({dragging:T,disabled:!!s,validation:f})),onDragEnter:j,onDragOver:M,onDragLeave:N,onDrop:P,"data-component":`FileUpload.Zone`,children:[(0,W.jsx)(`input`,{ref:b,id:x,type:`file`,name:u,accept:a,multiple:o,disabled:s,required:c,onChange:A,className:Ug.input,"aria-label":g,"aria-labelledby":F,"aria-describedby":I,"aria-invalid":f===`error`||void 0,"data-component":`FileUpload.Input`}),D.icon,D.label,D.description]}),D.list,O]})})}qg.displayName=`FileUpload`;var Jg=U(qg);const Yg=V(`progress-bar-item`,{variants:{variant:{accent:`progress-bar-item-accent`,attention:`progress-bar-item-attention`,danger:`progress-bar-item-danger`,done:`progress-bar-item-done`,neutral:`progress-bar-item-neutral`,severe:`progress-bar-item-severe`,sponsors:`progress-bar-item-sponsors`,success:`progress-bar-item-success`},animated:{true:`motion-safe:shimmer`,false:``}}});function Xg(e,t){let{as:n=`span`,className:r,progress:i=0,variant:a=`success`,animated:o,style:s,"aria-valuenow":c,...l}=e;return(0,W.jsx)(n,{ref:t,role:`progressbar`,"aria-valuenow":c??Math.round(Math.max(i,0)),"aria-valuemin":0,"aria-valuemax":100,className:H(Yg({variant:a,animated:o}),r),style:{...s,"--progress-bar-item-width":`${i}%`},"data-component":`ProgressBar.Item`,"data-variant":a,"data-animated":o,...l})}Xg.displayName=`ProgressBar.Item`;var Zg=U(Xg);const Qg=V(`progress-bar`,{variants:{size:{small:`progress-bar-small`,medium:`progress-bar-medium`,large:`progress-bar-large`},inline:{true:`progress-bar-inline`,false:``}}});function $g(e,t){let{as:n=`span`,className:r,progress:i,size:a=`medium`,variant:o=`success`,inline:s,animated:c,children:u,"aria-label":d,"aria-valuenow":f,"aria-valuetext":p,...m}=e;if(u&&i)throw Error("Pass either `progress` or children to ProgressBar, not both.");let h=l.Children.toArray(u).length>0;return(0,W.jsx)(n,{ref:t,className:H(Qg({size:a,inline:s}),r),"data-component":`ProgressBar`,"data-size":a,"data-inline":s,...m,children:h?u:(0,W.jsx)(Zg,{progress:i,variant:o,animated:c,"aria-label":d,"aria-valuenow":f,"aria-valuetext":p})})}$g.displayName=`ProgressBar`;var e_=U($g);const t_=Object.assign(e_,{Item:Zg}),n_={root:`file-upload-item`,icon:`file-upload-item-icon`,body:`file-upload-item-body`,heading:`file-upload-item-heading`,name:`file-upload-item-name`,fileSize:`file-upload-item-file-size`,description:`file-upload-item-description`,descriptionError:`file-upload-item-description-error`,status:`file-upload-item-status`,statusSuccess:`file-upload-item-status-success`,statusError:`file-upload-item-status-error`},r_={success:{icon:cn,className:n_.statusSuccess},error:{icon:wn,className:n_.statusError}};function i_(e,t){let{className:n,name:r,fileSize:i,status:a=`pending`,progress:o,description:s,icon:c=Cn,onRemove:l,removeLabel:u,children:d,...f}=e,p=a===`success`||a===`error`?r_[a]:void 0,m=p?.icon;return(0,W.jsxs)(`li`,{ref:t,className:H(n_.root,n),"data-component":`FileUpload.Item`,"data-status":a,...f,children:[(0,W.jsx)(`span`,{className:n_.icon,"aria-hidden":`true`,"data-component":`FileUpload.Item.Icon`,children:(0,W.jsx)(c,{})}),(0,W.jsxs)(`span`,{className:n_.body,children:[(0,W.jsxs)(`span`,{className:n_.heading,children:[(0,W.jsx)(`span`,{className:n_.name,"data-component":`FileUpload.Item.Name`,children:r}),i===void 0?null:(0,W.jsx)(`span`,{className:n_.fileSize,"data-component":`FileUpload.Item.Size`,children:Dg(i)})]}),a===`uploading`?(0,W.jsx)(t_,{progress:o,variant:`accent`,size:`small`,animated:!0,"aria-label":`Uploading ${r}`}):null,s?(0,W.jsx)(`span`,{className:H(n_.description,a===`error`&&n_.descriptionError),"data-component":`FileUpload.Item.Description`,children:s}):null,d]}),m?(0,W.jsx)(`span`,{className:H(n_.status,p?.className),"aria-hidden":`true`,"data-component":`FileUpload.Item.Status`,children:(0,W.jsx)(m,{})}):null,l?(0,W.jsx)(bi,{icon:Sn,variant:`invisible`,size:`small`,"aria-label":u??`Remove ${r}`,onClick:l,"data-component":`FileUpload.Item.RemoveButton`}):null]})}i_.displayName=`FileUpload.Item`;var a_=U(i_);const o_=Object.assign(Jg,{Icon:Ig,Label:zg,Description:Ng,List:Hg,Item:a_});function s_(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function c_(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=process.env.NODE_ENV!==`production`&&!!n.key&&!!n.debug?.call(n),s=0;o&&(s=Date.now());let c=e();if(!(c.length!==r.length||c.some((e,t)=>r[t]!==e)))return i;r=c;let l=0;if(o&&(l=Date.now()),i=t(...c),o){let e=Math.round((Date.now()-s)*100)/100,t=Math.round((Date.now()-l)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
29
29
|
font-size: .6rem;
|
|
30
30
|
font-weight: bold;
|
|
31
|
-
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function l_(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}const u_=(e,t)=>Math.abs(e-t)<1.01,d_=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}};let f_;const p_=()=>{if(f_!==void 0)return f_;if(typeof navigator>`u`)return f_=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f_=!0;let e=navigator.maxTouchPoints;return f_=navigator.platform===`MacIntel`&&e!==void 0&&e>0},m_=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},h_=e=>e,g_=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},__=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(m_(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(m_(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},v_={passive:!0},y_=typeof window>`u`||`onscrollend`in window,b_=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&y_,o=0,s=a?null:d_(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,v_),a&&r.addEventListener(`scrollend`,u,v_),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},x_=(e,t)=>b_(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),S_=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},C_=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};var w_=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:h_,rangeExtractor:g_,onChange:()=>{},measureElement:S_,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=c_(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:process.env.NODE_ENV!==`production`&&`maybeNotify`,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!p_()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,v_),e.addEventListener(`touchend`,n,v_),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(p_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=c_(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=c_(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=s_(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!==`production`&&`getMeasurements`,debug:()=>this.options.debug}),this.calculateRange=c_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=D_(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:process.env.NODE_ENV!==`production`&&`calculateRange`,debug:()=>this.options.debug}),this.getVirtualIndexes=c_(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:process.env.NODE_ENV!==`production`&&`getVirtualIndexes`,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=c_(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:process.env.NODE_ENV!==`production`&&`getVirtualItems`,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return l_(t[T_(0,t.length-1,r?e=>n[e*2]:e=>l_(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e!==0&&(process.env.NODE_ENV!==`production`&&this.options.debug&&console.info(`correction`,e),p_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&u_(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}};const T_=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function E_(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function D_(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=E_(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=T_(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}const O_=typeof document<`u`?u.useLayoutEffect:u.useEffect;function k_({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=u.useReducer(e=>e+1,0)[1],a=u.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,d.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=u.useState(()=>{let e=new w_(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),O_(()=>l._didMount(),[]),O_(()=>(o(l),l._willUpdate())),O_(()=>{s(l)}),l}function A_(e){return k_({observeElementRect:__,observeElementOffset:x_,scrollToFn:C_,...e})}const j_={root:`filtered-action-list-input`};function M_(e){let{inputRef:t,value:n,onInputChange:r,onInputKeyDown:i,placeholderText:a,listId:o,inputDescriptionId:s,loading:c=!1,...l}=e;return(0,W.jsx)(`div`,{className:j_.root,"data-component":`FilteredActionList.Header`,children:(0,W.jsx)(Qo,{ref:t,block:!0,value:n,onChange:r,onKeyDown:i,placeholder:a,role:`combobox`,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-controls":o,"aria-label":a,"aria-describedby":s,loading:c,loaderPosition:`leading`,...l})})}M_.displayName=`FilteredActionList.Input`;const N_=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,W.jsx)(e,{});function P_(e,t){if(typeof e.renderItem==`function`)return e.renderItem(e);let{id:n,text:r,description:i,descriptionVariant:a,leadingVisual:o,trailingVisual:s,onAction:c,children:l,groupId:u,renderItem:d,...f}=e;return(0,W.jsxs)(Fi.Item,{ref:t,role:`option`,onSelect:t=>c?.(e,t),"data-id":n,...f,children:[o?(0,W.jsx)(Fi.LeadingVisual,{children:(0,W.jsx)(o,{})}):null,l,r,i?(0,W.jsx)(Fi.Description,{variant:a,children:i}):null,s?(0,W.jsx)(Fi.TrailingVisual,{children:N_(s)}):null]})}P_.displayName=`FilteredActionList.Item`;var F_=U(P_);const I_=V(`stack`,{variants:{gap:{none:`stack-gap-none`,tight:`stack-gap-tight`,condensed:`stack-gap-condensed`,cozy:`stack-gap-cozy`,normal:`stack-gap-normal`,spacious:`stack-gap-spacious`},direction:{horizontal:`stack-horizontal`,vertical:`stack-vertical`},align:{stretch:`stack-align-stretch`,start:`stack-align-start`,center:`stack-align-center`,end:`stack-align-end`,baseline:`stack-align-baseline`},wrap:{wrap:`stack-wrap`,nowrap:`stack-nowrap`},justify:{start:`stack-justify-start`,center:`stack-justify-center`,end:`stack-justify-end`,"space-between":`stack-justify-space-between`,"space-evenly":`stack-justify-space-evenly`},padding:{none:`stack-padding-none`,tight:`stack-padding-tight`,condensed:`stack-padding-condensed`,cozy:`stack-padding-cozy`,normal:`stack-padding-normal`,spacious:`stack-padding-spacious`},paddingBlock:{none:`stack-padding-block-none`,tight:`stack-padding-block-tight`,condensed:`stack-padding-block-condensed`,cozy:`stack-padding-block-cozy`,normal:`stack-padding-block-normal`,spacious:`stack-padding-block-spacious`},paddingInline:{none:`stack-padding-inline-none`,tight:`stack-padding-inline-tight`,condensed:`stack-padding-inline-condensed`,cozy:`stack-padding-inline-cozy`,normal:`stack-padding-inline-normal`,spacious:`stack-padding-inline-spacious`}}});function L_(e,t){let{as:n=`div`,className:r,gap:i,direction:a=`vertical`,align:o=`stretch`,wrap:s=`nowrap`,justify:c=`start`,padding:l=`none`,paddingBlock:u,paddingInline:d,...f}=e;return(0,W.jsx)(n,{ref:t,className:H(I_({gap:i,direction:a,align:o,wrap:s,justify:c,padding:l,paddingBlock:u,paddingInline:d}),r),"data-component":`Stack`,"data-gap":i,"data-direction":a,"data-align":o,"data-wrap":s,"data-justify":c,"data-padding":l,"data-padding-block":u,"data-padding-inline":d,...f})}L_.displayName=`Stack`;var R_=U(L_);const z_=V(`stack-item`,{variants:{grow:{true:`stack-item-grow`,false:`stack-item-no-grow`},shrink:{true:`stack-item-shrink`,false:`stack-item-no-shrink`}}});function B_(e,t){let{as:n=`div`,className:r,grow:i,shrink:a,...o}=e;return(0,W.jsx)(n,{ref:t,className:H(z_({grow:i,shrink:a}),r),"data-component":`StackItem`,"data-grow":i,"data-shrink":a,...o})}B_.displayName=`StackItem`;var V_=U(B_);const H_=Object.assign(R_,{Item:V_}),U_={spinner:`filtered-action-list-spinner`,skeleton:`filtered-action-list-skeleton`},W_=[`80%`,`52.5%`,`67.5%`,`40%`,`72.5%`];function G_(e){let{loadingType:t,height:n=0,className:r,...i}=e;if(t===`input`)return null;if(t===`body-skeleton`){let e=Math.max(Math.floor(n/24),3);return(0,W.jsx)(H_,{gap:`condensed`,justify:`center`,className:H(U_.skeleton,r),"data-component":`FilteredActionList.Skeleton`,...i,children:Array.from({length:e},(e,t)=>(0,W.jsxs)(H_,{direction:`horizontal`,gap:`condensed`,align:`center`,children:[(0,W.jsx)(rh,{width:`16px`,height:`16px`}),(0,W.jsx)(rh,{width:W_[t%W_.length],height:`10px`})]},t))})}return(0,W.jsx)(`div`,{className:H(U_.spinner,r),"data-component":`FilteredActionList.Spinner`,...i,children:(0,W.jsx)(ri,{})})}G_.displayName=`FilteredActionList.BodyLoader`;const K_=({items:e,enabled:t=!0,loading:n=!1,messageText:r})=>{let[i,a]=l.useState(``),o=e.length,s=e.filter(e=>e.selected).length,c=o===0&&!n,u=r?`${r.title}. ${r.description}`:``,d=c?u:`${o} item${o===1?``:`s`} available, ${s} selected.`,f=l.useRef(d);return l.useEffect(()=>{if(!t||d===f.current)return;f.current=d;let e=window.setTimeout(()=>a(d),500);return()=>{window.clearTimeout(e)}},[t,d]),t?i:``},q_={root:`filtered-action-list`,container:`filtered-action-list-container`,list:`filtered-action-list-list`,message:`filtered-action-list-message`,virtualList:`filtered-action-list-virtual-list`,virtualItem:`filtered-action-list-virtual-item`,selectAll:`filtered-action-list-select-all`,selectAllLabel:`filtered-action-list-select-all-label`,hidden:`sr-only`},J_=(e,t)=>e.key??e.id?.toString()??t.toString();function Y_(e){let{items:t,groupMetadata:n,filterValue:r,onFilterChange:i,placeholderText:a,loading:o=!1,loadingType:s=`body-spinner`,message:c,messageText:u,selectionVariant:d,showItemDividers:f,onSelectAllChange:p,renderItem:m,announcementsEnabled:h=!0,virtualized:g=!1,textInputProps:_,actionListProps:v,inputRef:y,scrollContainerRef:b,onListContainerRefChanged:x,onInputRefChanged:S,className:C}=e,w=r!==void 0,[T,E]=l.useState(``),D=w?r:T,O=l.useRef(null),k=R(y,O),A=l.useRef(null),j=R(b,A),M=l.useRef(null),N=l.useCallback(e=>{M.current=e,x?.(e)},[x]);l.useEffect(()=>{S?.(O)},[S]);let P=o&&s!==`input`,[F,I]=l.useState(0);Wi(()=>{let e=A.current;if(!e||!P)return;let t=()=>I(e.clientHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[P]);let L=K(v?.id),ee=K(),te=K(),ne=g&&!n?.length,re=A_({count:t.length,getScrollElement:()=>A.current,estimateSize:()=>32,overscan:10,enabled:ne,getItemKey:e=>{let n=t[e];return n?J_(n,e):e.toString()},measureElement:e=>e.scrollHeight}),ie=ne?re.getVirtualItems():void 0,[ae,oe]=l.useState(null);l.useEffect(()=>{if(ae===null)return;let e=M.current?.querySelector(`[data-index="${ae}"]`);e&&(e.focus(),oe(null))},[ae,ie]);let se=l.useCallback(e=>{if(!(e<0||e>=t.length)){if(ne){re.scrollToIndex(e,{align:`auto`}),oe(e);return}(M.current?.querySelectorAll(`[role="option"]`))?.[e]?.focus()}},[ne,t.length,re]),ce=l.useCallback(e=>t.filter(t=>t.groupId===e),[t]),le=n?.length?n.map(e=>ce(e.groupId)[0]).find(Boolean):t[0],ue=e=>{let{value:t}=e.target;w||E(t),i(t,e)},de=e=>{if(e.key===`ArrowDown`){e.preventDefault(),se(0);return}e.key===`Enter`&&le?.onAction&&(e.preventDefault(),le.onAction(le,e))},fe=e=>{if(!ne||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let n=e.target.closest(`[data-index]`),r=n?Number(n.dataset.index):-1,i=e.key===`ArrowDown`?r+1:e.key===`ArrowUp`?r-1:e.key===`Home`?0:e.key===`End`?t.length-1:null;i!==null&&(e.preventDefault(),se(i))},pe=t.length>0&&t.every(e=>e.selected),me=!pe&&t.some(e=>e.selected),he=K_({items:t,enabled:h,loading:o,messageText:u}),ge=l.useMemo(()=>({container:`FilteredActionList`,listRole:`listbox`,selectionAttribute:`aria-selected`,enableFocusZone:!ne}),[ne]),_e=()=>n?.length?n.map(e=>(0,W.jsxs)(Fi.Group,{children:[(0,W.jsx)(Fi.GroupHeading,{variant:e.header?.variant,children:e.header?.title??`Group ${e.groupId}`}),ce(e.groupId).map((e,t)=>(0,l.createElement)(F_,{...e,key:J_(e,t),renderItem:e.renderItem??m}))]},e.groupId)):ie?ie.map(e=>{let n=t[e.index];return(0,l.createElement)(F_,{...n,key:e.key,ref:re.measureElement,renderItem:n.renderItem??m,"data-index":e.index,className:H(q_.virtualItem,n.className),style:{...n.style,transform:`translateY(${e.start}px)`}})}):t.map((e,t)=>(0,l.createElement)(F_,{...e,key:J_(e,t),renderItem:e.renderItem??m})),ve=()=>P?(0,W.jsx)(G_,{loadingType:s,height:F}):c?(0,W.jsx)(`div`,{className:q_.message,"data-component":`FilteredActionList.Message`,children:c}):(0,W.jsx)(Pr.Provider,{value:ge,children:(0,W.jsx)(Fi,{ref:N,id:L,selectionVariant:d,showDividers:f,...v,className:H(q_.list,ne&&q_.virtualList,v?.className),style:ne?{...v?.style,height:re.getTotalSize()}:v?.style,children:_e()})});return(0,W.jsxs)(`div`,{className:H(q_.root,C),"data-component":`FilteredActionList`,"data-virtualized":ne?``:void 0,children:[(0,W.jsx)(M_,{inputRef:k,value:D,onInputChange:ue,onInputKeyDown:de,placeholderText:a,listId:L,inputDescriptionId:ee,loading:o&&s===`input`,..._}),(0,W.jsx)(`span`,{id:ee,className:q_.hidden,children:`Items will be filtered as you type`}),p?(0,W.jsxs)(`div`,{className:q_.selectAll,"data-component":`FilteredActionList.SelectAll`,children:[(0,W.jsx)(sd,{id:te,checked:pe,indeterminate:me,onChange:e=>p(e.target.checked),"data-component":`FilteredActionList.SelectAllCheckbox`}),(0,W.jsx)(`label`,{htmlFor:te,className:q_.selectAllLabel,children:pe?`Deselect all`:`Select all`})]}):null,(0,W.jsx)(`div`,{ref:j,className:q_.container,onKeyDown:fe,"data-component":`FilteredActionList.Container`,children:ve()}),(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:q_.hidden,"data-component":`FilteredActionList.Announcement`,children:he})]})}Y_.displayName=`FilteredActionList`;const X_=Object.assign(Y_,{Input:M_,Item:F_,BodyLoader:G_}),Z_={width:320,height:240},Q_={x:24,y:24},$_={width:200,height:120},ev=(e,t,n)=>Math.min(Math.max(e,t),n),tv=(e,t)=>t&&t>0?Math.round(e/t)*t:e,nv=(e,t,n)=>({width:ev(e.width,t.width,Math.max(t.width,n?.width??1/0)),height:ev(e.height,t.height,Math.max(t.height,n?.height??1/0))}),rv=(e,t,n,r)=>!n||r?e:{x:ev(e.x,n.x,Math.max(n.x,n.x+n.width-t.width)),y:ev(e.y,n.y,Math.max(n.y,n.y+n.height-t.height))},iv=e=>e.includes(`e`)||e.includes(`w`),av=(e,t,n,r)=>{let{minSize:i,maxSize:a,boundary:o,allowOverflow:s,lockAspectRatio:c,gridSize:l}=r,u=e.width,d=e.height;if(t.includes(`e`)&&(u=e.width+n.x),t.includes(`w`)&&(u=e.width-n.x),t.includes(`s`)&&(d=e.height+n.y),t.includes(`n`)&&(d=e.height-n.y),u=tv(u,l),d=tv(d,l),c&&e.width>0&&e.height>0){let n=e.width/e.height;iv(t)?d=u/n:u=d*n}let f=nv({width:u,height:d},i,a),p={x:t.includes(`w`)?e.x+e.width-f.width:e.x,y:t.includes(`n`)?e.y+e.height-f.height:e.y};return{...rv(p,f,o,s),...f}},ov=(e,t,n)=>{let{boundary:r,allowOverflow:i,gridSize:a}=n,o={x:tv(e.x+t.x,a),y:tv(e.y+t.y,a)};return rv(o,e,r,i)},sv=e=>{if(e){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}if(!(typeof window>`u`))return{x:0,y:0,width:window.innerWidth,height:window.innerHeight}},cv=(0,l.createContext)({open:!1,setOpen:()=>void 0,position:Q_,size:Z_,stage:`default`,setStage:()=>void 0,dragging:!1,resizing:!1,draggable:!1,resizable:!1,canDrag:!1,canResize:!1,disabled:!1,strategy:`fixed`,triggerId:``,contentId:``,titleId:``,startDrag:()=>void 0,startResize:()=>void 0,moveBy:()=>void 0,resizeBy:()=>void 0}),lv=()=>(0,l.useContext)(cv);function uv(e){let{open:t,defaultOpen:n,onOpenChange:r,position:i,defaultPosition:a,onPositionChange:o,onPositionChangeEnd:s,size:c,defaultSize:u,onSizeChange:d,onSizeChangeEnd:f,stage:p,defaultStage:m,onStageChange:h,minSize:g=$_,maxSize:_,draggable:v=!0,resizable:y=!0,disabled:b=!1,closeOnEscape:x=!0,lockAspectRatio:S,allowOverflow:C,gridSize:w,strategy:T=`fixed`,getBoundaryElement:E,children:D}=e,O=K(),k=t!==void 0,[A,j]=l.useState(!!n),M=k?t:A,N=i!==void 0,[P,F]=l.useState(()=>a??Q_),I=N?i:P,L=c!==void 0,[ee,te]=l.useState(()=>u??Z_),ne=L?c:ee,R=p!==void 0,[re,ie]=l.useState(()=>m??`default`),ae=R?p:re,[oe,se]=l.useState(!1),[ce,le]=l.useState(!1),ue=l.useRef(null),de=e=>{k||j(e),r?.(e)},fe=e=>{R||ie(e),h?.(e)},pe=e=>{N||F(e),o?.(e)},me=e=>{L||te(e),d?.(e)},he=()=>({boundary:sv(E?.()),allowOverflow:C,gridSize:w});qi(e=>{!M||!x||(de(!1),e.preventDefault())});let ge=!b&&v&&ae!==`maximized`,_e=!b&&y&&ae==="default",ve=(e,t)=>{e.preventDefault(),ue.current=t,t.kind===`drag`?se(!0):le(!0)},ye=e=>{if(!ge)return;let t={...I,...ne};ve(e,{kind:`drag`,origin:{x:e.clientX,y:e.clientY},rect:t,latest:t})},be=(e,t)=>{if(!_e)return;let n={...I,...ne};ve(e,{kind:`resize`,axis:t,origin:{x:e.clientX,y:e.clientY},rect:n,latest:n})};l.useEffect(()=>{if(!oe&&!ce)return;let e=e=>{let t=ue.current;if(!t)return;let n={x:e.clientX-t.origin.x,y:e.clientY-t.origin.y};if(t.kind===`drag`){let e=ov(t.rect,n,he());t.latest={...t.rect,...e},pe(e);return}let r=av(t.rect,t.axis,n,{...he(),minSize:g,maxSize:_,lockAspectRatio:S});t.latest=r,pe({x:r.x,y:r.y}),me({width:r.width,height:r.height})},t=()=>{let e=ue.current;ue.current=null,se(!1),le(!1),e&&(s?.({x:e.latest.x,y:e.latest.y}),e.kind===`resize`&&f?.({width:e.latest.width,height:e.latest.height}))};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}});let xe={open:M,setOpen:de,position:I,size:ne,stage:ae,setStage:fe,dragging:oe,resizing:ce,draggable:v,resizable:y,canDrag:ge,canResize:_e,disabled:b,strategy:T,triggerId:`${O}-trigger`,contentId:`${O}-content`,titleId:`${O}-title`,startDrag:ye,startResize:be,moveBy:e=>{if(!ge)return;let t={...I,...ne},n=ov(t,e,he());pe(n),s?.(n)},resizeBy:(e,t)=>{if(!_e)return;let n={...I,...ne},r=av(n,e,t,{...he(),minSize:g,maxSize:_,lockAspectRatio:S});pe({x:r.x,y:r.y}),me({width:r.width,height:r.height}),s?.({x:r.x,y:r.y}),f?.({width:r.width,height:r.height})}};return(0,W.jsx)(cv.Provider,{value:xe,children:D})}uv.displayName=`FloatingPanel`;const dv={root:`floating-panel-body`};function fv(e,t){let{as:n=`div`,className:r,...i}=e,{stage:a}=lv();return a===`minimized`?null:(0,W.jsx)(n,{ref:t,className:H(dv.root,r),"data-component":`FloatingPanel.Body`,...i})}fv.displayName=`FloatingPanel.Body`;var pv=U(fv);function mv(e,t){let{onClick:n,...r}=e,{setOpen:i}=lv();return(0,W.jsx)(bi,{ref:t,icon:Sn,"aria-label":`Close panel`,variant:`invisible`,size:`small`,onClick:e=>{n?.(e),!e.defaultPrevented&&i(!1)},"data-component":`FloatingPanel.CloseTrigger`,...r})}mv.displayName=`FloatingPanel.CloseTrigger`;var hv=U(mv);const gv={root:`floating-panel-content`},_v={ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0},ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1}};function vv(e,t){let{as:n=`div`,className:r,onKeyDown:i,...a}=e,{stage:o,dragging:s,resizing:c,disabled:l,contentId:u,titleId:d,moveBy:f}=lv();return(0,W.jsx)(n,{ref:t,role:`dialog`,id:u,"aria-labelledby":d,tabIndex:-1,className:H(gv.root,r),onKeyDown:e=>{i?.(e);let t=_v[e.key];if(e.defaultPrevented||!t||e.target!==e.currentTarget)return;let n=e.shiftKey?40:8;e.preventDefault(),f({x:t.x*n,y:t.y*n})},"data-component":`FloatingPanel.Content`,"data-stage":o,"data-dragging":s?``:void 0,"data-resizing":c?``:void 0,"data-disabled":l?``:void 0,...a})}vv.displayName=`FloatingPanel.Content`;var yv=U(vv);const bv={root:`floating-panel-control`};function xv(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(bv.root,r),"data-component":`FloatingPanel.Control`,...i})}xv.displayName=`FloatingPanel.Control`;var Sv=U(xv);const Cv={root:`floating-panel-drag-trigger`};function wv(e,t){let{as:n=`div`,className:r,onPointerDown:i,...a}=e,{startDrag:o,dragging:s,canDrag:c}=lv();return(0,W.jsx)(n,{ref:t,className:H(Cv.root,r),onPointerDown:e=>{i?.(e),!e.defaultPrevented&&e.button===0&&(e.target.closest(`button, a, input, select, textarea`)||o(e))},"data-component":`FloatingPanel.DragTrigger`,"data-draggable":c?``:void 0,"data-dragging":s?``:void 0,...a})}wv.displayName=`FloatingPanel.DragTrigger`;var Tv=U(wv);const Ev={root:`floating-panel-header`};function Dv(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Ev.root,r),"data-component":`FloatingPanel.Header`,...i})}Dv.displayName=`FloatingPanel.Header`;var Ov=U(Dv);const kv={root:`floating-panel-positioner`};function Av(e,t){let{as:n=`div`,className:r,style:i,...a}=e,{open:o,position:s,size:c,stage:l,strategy:u,dragging:d,resizing:f,contentId:p}=lv();if(!o)return null;let m=(0,W.jsx)(n,{ref:t,className:H(kv.root,r),style:{...i,"--floating-panel-x":`${s.x}px`,"--floating-panel-y":`${s.y}px`,"--floating-panel-width":`${c.width}px`,"--floating-panel-height":`${c.height}px`},"data-component":`FloatingPanel.Positioner`,"data-strategy":u,"data-stage":l,"data-dragging":d?``:void 0,"data-resizing":f?``:void 0,"data-panel":p,...a});return u===`fixed`?(0,W.jsx)(aa,{children:m}):m}Av.displayName=`FloatingPanel.Positioner`;var jv=U(Av);const Mv={root:`floating-panel-resize-trigger`},Nv={n:`top`,e:`right`,s:`bottom`,w:`left`,ne:`top right`,nw:`top left`,se:`bottom right`,sw:`bottom left`},Pv={ArrowLeft:{x:-8,y:0},ArrowRight:{x:8,y:0},ArrowUp:{x:0,y:-8},ArrowDown:{x:0,y:8}};function Fv(e,t){let{axis:n,className:r,onPointerDown:i,onKeyDown:a,...o}=e,{startResize:s,resizeBy:c,resizing:l,canResize:u}=lv();return(0,W.jsx)(`div`,{ref:t,role:`button`,tabIndex:u?0:-1,"aria-label":`Resize panel from the ${Nv[n]}`,"aria-disabled":!u||void 0,className:H(Mv.root,r),onPointerDown:e=>{i?.(e),!(e.defaultPrevented||e.button!==0)&&s(e,n)},onKeyDown:e=>{a?.(e);let t=Pv[e.key];e.defaultPrevented||!t||(e.preventDefault(),c(n,t))},"data-component":`FloatingPanel.ResizeTrigger`,"data-axis":n,"data-resizing":l?``:void 0,...o})}Fv.displayName=`FloatingPanel.ResizeTrigger`;var Iv=U(Fv);const Lv={minimized:{icon:Kn,label:`Minimize panel`},maximized:{icon:Xt,label:`Maximize panel`},default:{icon:Zt,label:`Restore panel`}};function Rv(e,t){let{stage:n,onClick:r,...i}=e,{stage:a,setStage:o,disabled:s}=lv(),c=a===n,l=c?`default`:n,{icon:u,label:d}=Lv[l];return(0,W.jsx)(bi,{ref:t,icon:u,"aria-label":d,variant:`invisible`,size:`small`,disabled:s,onClick:e=>{r?.(e),!e.defaultPrevented&&o(l)},"data-component":`FloatingPanel.StageTrigger`,"data-stage":n,"data-active":c?``:void 0,...i})}Rv.displayName=`FloatingPanel.StageTrigger`;var zv=U(Rv);const Bv={root:`floating-panel-title`};function Vv(e,t){let{as:n=`h2`,className:r,...i}=e,{titleId:a}=lv();return(0,W.jsx)(n,{ref:t,id:a,className:H(Bv.root,r),"data-component":`FloatingPanel.Title`,...i})}Vv.displayName=`FloatingPanel.Title`;var Hv=U(Vv);const Uv={root:`floating-panel-trigger`};function Wv(e,t){let{className:n,onClick:r,...i}=e,{open:a,setOpen:o,triggerId:s,contentId:c}=lv();return(0,W.jsx)(`button`,{ref:t,type:`button`,id:s,className:H(Uv.root,n),onClick:e=>{r?.(e),!e.defaultPrevented&&o(!a)},"aria-expanded":a,"aria-controls":a?c:void 0,"data-component":`FloatingPanel.Trigger`,"data-open":a?``:void 0,...i})}Wv.displayName=`FloatingPanel.Trigger`;var Gv=U(Wv);const Kv=Object.assign(uv,{Trigger:Gv,Positioner:jv,Content:yv,DragTrigger:Tv,Header:Ov,Title:Hv,Control:Sv,StageTrigger:zv,CloseTrigger:hv,Body:pv,ResizeTrigger:Iv}),qv=e=>Math.round(e*100)/100,Jv=(e,t,n,r)=>{if(n===`vertical`){let n=qv(e.x+e.width/2),i=qv(e.y+e.height),a=qv(t.x+t.width/2),o=qv(t.y),s=a-n,c=o-i;if(Math.abs(s)<=2||Math.abs(c)<=2)return`M ${n} ${i} L ${a} ${o}`;let l=qv(i+c/2),u=qv(Math.min(r,Math.abs(s)/2,Math.abs(c)/2)),d=s>0?u:-u;return[`M ${n} ${i}`,`V ${qv(l-u)}`,`Q ${n} ${l} ${qv(n+d)} ${l}`,`H ${qv(a-d)}`,`Q ${a} ${l} ${a} ${qv(l+u)}`,`V ${o}`].join(` `)}let i=qv(e.x+e.width),a=qv(e.y+e.height/2),o=qv(t.x),s=qv(t.y+t.height/2),c=o-i,l=s-a;if(Math.abs(l)<=2||Math.abs(c)<=2)return`M ${i} ${a} L ${o} ${s}`;let u=qv(i+c/2),d=qv(Math.min(r,Math.abs(c)/2,Math.abs(l)/2)),f=l>0?d:-d;return[`M ${i} ${a}`,`H ${qv(u-d)}`,`Q ${u} ${a} ${u} ${qv(a+f)}`,`V ${qv(s-f)}`,`Q ${u} ${s} ${qv(u+d)} ${s}`,`H ${o}`].join(` `)},Yv={root:`flow-connectors`,path:`flow-connector`,disabled:`flow-connector-disabled`,arrowhead:`flow-arrowhead`},Xv={width:0,height:0},Zv=({edges:e,positions:t,sizes:n,orientation:r,cornerRadius:i,width:a,height:o,markerId:s,className:c})=>{let l=e.map(e=>{let a=t[e.from],o=t[e.to];return!a||!o?null:{edge:e,d:Jv({...a,...n[e.from]??Xv},{...o,...n[e.to]??Xv},r,i)}}).filter(e=>e!==null),u=[...l.filter(e=>e.edge.disabled),...l.filter(e=>!e.edge.disabled)];return(0,W.jsxs)(`svg`,{className:H(Yv.root,c),width:a,height:o,viewBox:`0 0 ${a} ${o}`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,"data-component":`Flow.Connectors`,children:[(0,W.jsx)(`defs`,{children:(0,W.jsx)(`marker`,{id:s,className:Yv.arrowhead,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,W.jsx)(`path`,{d:`M 0 0 L 6 3 L 0 6 Z`})})}),u.map(({edge:e,d:t})=>(0,W.jsx)(`path`,{className:H(Yv.path,e.disabled&&Yv.disabled),d:t,markerEnd:`url(#${s})`,"data-component":`Flow.Connector`,"data-from":e.from,"data-to":e.to,"data-disabled":e.disabled},`${e.from}--${e.to}`))]})};Zv.displayName=`Flow.Connectors`;const Qv=(0,l.createContext)({}),$v={root:`flow-group`,list:`flow-group-list`};function ey(e,t){let{className:n,children:r,...i}=e;return(0,W.jsx)(`li`,{ref:t,role:`listitem`,className:H($v.root,n),"data-component":`Flow.List`,...i,children:(0,W.jsx)(`ol`,{role:`list`,className:$v.list,children:r})})}ey.displayName=`Flow.List`;var ty=U(ey);const ny={root:`flow-node`,disabled:`flow-node-disabled`};function ry(e,t){let{className:n,id:r,disabled:i,style:a,...o}=e,{positions:s,reportSize:c,measured:u}=l.useContext(Qv),d=l.useRef(null),f=R(t,d),p=r??``;Wi(()=>{let e=d.current;if(!e||!c||p===``)return;let t=()=>{c(p,{width:e.offsetWidth,height:e.offsetHeight})};if(t(),typeof ResizeObserver>`u`)return()=>{c(p,null)};let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),c(p,null)}},[p,c]);let m=s?.[p];return(0,W.jsx)(`li`,{ref:f,className:H(ny.root,i&&ny.disabled,n),style:{...a,insetInlineStart:m?`${m.x}px`:void 0,insetBlockStart:m?`${m.y}px`:void 0},"data-component":`Flow.Node`,"data-node-id":p||void 0,"data-disabled":i,"aria-hidden":!u||void 0,...o})}ry.displayName=`Flow.Node`;var iy=U(ry);const ay={root:`flow-group`,list:`flow-group-list`};function oy(e,t){let{className:n,children:r,align:i=`start`,...a}=e;return(0,W.jsx)(`li`,{ref:t,role:`listitem`,className:H(ay.root,n),"data-component":`Flow.Parallel`,"data-align":i,...a,children:(0,W.jsx)(`ol`,{role:`list`,className:ay.list,children:r})})}oy.displayName=`Flow.Parallel`;var sy=U(oy);const cy={width:0,height:0},ly=({sizes:e,orientation:t,columnGap:n,rowGap:r})=>{let i=new Map,a=o=>{let s=i.get(o);if(s)return s;let c;if(o.kind===`node`){let n=e[o.id]??cy;c=t===`horizontal`?{main:n.width,cross:n.height}:{main:n.height,cross:n.width}}else c=o.kind===`list`?o.children.reduce((e,t,r)=>{let i=a(t);return{main:e.main+i.main+(r>0?n:0),cross:Math.max(e.cross,i.cross)}},{main:0,cross:0}):o.children.reduce((e,t,n)=>{let i=a(t);return{main:Math.max(e.main,i.main),cross:e.cross+i.cross+(n>0?r:0)}},{main:0,cross:0});return i.set(o,c),c};return a},uy=(e,t)=>{let{orientation:n,align:r,columnGap:i,rowGap:a}=t,o=ly(t),s={},c=(e,t,l)=>{if(e.kind===`node`){s[e.id]=n===`horizontal`?{x:t,y:l}:{x:l,y:t};return}let u=o(e);if(e.kind===`list`){let n=t;e.children.forEach(e=>{let t=o(e),a=r===`center`?l+(u.cross-t.cross)/2:l;c(e,n,a),n+=t.main+i});return}let d=l;e.children.forEach(n=>{let r=o(n),i=e.align===`end`?t+(u.main-r.main):t;c(n,i,d),d+=r.cross+a})};return c(e,0,0),s},dy=e=>{if(e.kind===`node`)return[e.id];if(e.kind===`parallel`)return e.children.flatMap(dy);for(let t of e.children){let e=dy(t);if(e.length>0)return e}return[]},fy=e=>{if(e.kind===`node`)return[e.id];if(e.kind===`parallel`)return e.children.flatMap(fy);for(let t=e.children.length-1;t>=0;--t){let n=fy(e.children[t]);if(n.length>0)return n}return[]},py=e=>e.kind===`node`?[e.id]:e.children.flatMap(py),my=(e,t=new Set)=>e.kind===`node`?(e.disabled&&t.add(e.id),t):(e.children.forEach(e=>my(e,t)),t),hy=e=>{let t=my(e),n=[],r=e=>{if(e.kind!==`node`&&(e.children.forEach(r),e.kind===`list`))for(let r=0;r<e.children.length-1;r+=1){let i=e.children[r],a=e.children[r+1];(i.kind!==`parallel`||a.kind!==`parallel`)&&fy(i).forEach(e=>{dy(a).forEach(r=>{n.push({from:e,to:r,disabled:t.has(e)||t.has(r)||void 0})})})}};return r(e),n},gy=(e,t)=>Object.entries(e).reduce((e,[n,r])=>{let i=t[n]??cy;return{width:Math.max(e.width,r.x+i.width),height:Math.max(e.height,r.y+i.height)}},{width:0,height:0}),_y={root:`flow`,canvas:`flow-canvas`,list:`flow-list`},vy=(e,t)=>{let n=[],r=[];return l.Children.toArray(e).forEach((e,i)=>{if(!l.isValidElement(e)){r.push(e);return}let a=t===``?`${i}`:`${t}-${i}`;if(e.type===iy){let t=e,i=t.props.id??`node-${a}`;n.push({kind:`node`,id:i,disabled:t.props.disabled}),r.push(l.cloneElement(t,{id:i}));return}if(e.type===ty){let t=e,i=vy(t.props.children,a);n.push({kind:`list`,children:i.branches}),r.push(l.cloneElement(t,void 0,i.elements));return}if(e.type===sy){let t=e,i=vy(t.props.children,a);n.push({kind:`parallel`,align:t.props.align,children:i.branches}),r.push(l.cloneElement(t,void 0,i.elements));return}r.push(e)}),{branches:n,elements:r}};function yy(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,align:a=`start`,columnGap:o=64,rowGap:s=16,cornerRadius:c=8,children:u,"aria-label":d,"aria-labelledby":f,...p}=e,m=`${K().replace(/[^a-zA-Z0-9-]/g,``)}-flow-arrowhead`,h=l.useRef(null),g=R(t,h),_=yf(h),[v,y]=l.useState({}),b=l.useCallback((e,t)=>{y(n=>{if(t===null){if(!(e in n))return n;let t={...n};return delete t[e],t}let r=n[e];return r&&r.width===t.width&&r.height===t.height?n:{...n,[e]:t}})},[]),{tree:x,elements:S}=l.useMemo(()=>{let e=vy(u,``);return{tree:{kind:`list`,children:e.branches},elements:e.elements}},[u]),C=l.useMemo(()=>py(x).every(e=>e in v),[x,v]),w=l.useMemo(()=>uy(x,{sizes:v,orientation:i,align:a,columnGap:o,rowGap:s}),[x,v,i,a,o,s]),T=l.useMemo(()=>hy(x),[x]),E=l.useMemo(()=>gy(w,v),[w,v]),D={orientation:i,positions:w,measured:C,reportSize:b},O=_?{role:d||f?`region`:void 0,tabIndex:0}:{};return(0,W.jsx)(Qv.Provider,{value:D,children:(0,W.jsx)(n,{ref:g,className:H(_y.root,r),"aria-label":d,"aria-labelledby":f,"data-component":`Flow`,"data-orientation":i,"data-align":a,"data-measured":C,...O,...p,children:(0,W.jsxs)(`div`,{className:_y.canvas,style:{width:`${E.width}px`,height:`${E.height}px`},"data-component":`Flow.Canvas`,children:[(0,W.jsx)(Zv,{edges:T,positions:w,sizes:v,orientation:i,cornerRadius:c,width:E.width,height:E.height,markerId:m}),(0,W.jsx)(`ol`,{role:`list`,className:_y.list,"data-component":`Flow.Steps`,children:S})]})})})}yy.displayName=`Flow`;var by=U(yy);const xy=Object.assign(by,{Node:iy,List:ty,Parallel:sy}),Sy=(0,l.createContext)({}),Cy={root:`radio`,checked:`radio-checked`,disabled:`radio-disabled`};function wy(e,t){let{className:n,name:r,required:i,validationStatus:a,value:o,onChange:s,...c}=e,u=l.useContext(Sy);return(0,W.jsx)(`input`,{ref:t,type:`radio`,value:o,name:r??u.name,required:i,"aria-required":i?!0:void 0,"aria-invalid":a===`error`||void 0,onChange:e=>{u.onChange?.(e),s?.(e)},className:H(Cy.root,Cy.checked,Cy.disabled,n),"data-component":`Radio`,...c})}wy.displayName=`Radio`;var Ty=U(wy);const Ey={select:`select-control`,indicator:`select-indicator`},Dy=V(`select`,{variants:{size:{small:`select-small`,medium:`select-medium`,large:`select-large`},block:{true:`select-block`,false:``},disabled:{true:`select-disabled`,false:``},validation:{error:`select-error`,success:`select-success`}}});function Oy(e,t){let{className:n,children:r,placeholder:i,size:a=`medium`,block:o,disabled:s,required:c,validationStatus:l,defaultValue:u,...d}=e,f=`value`in d;return(0,W.jsxs)(`span`,{className:H(Dy({size:a,block:o,disabled:s,validation:l}),n),"data-component":`Select`,"data-size":a,"data-block":o,"data-disabled":s,"data-validation":l,children:[(0,W.jsxs)(`select`,{ref:t,disabled:s,required:c,"aria-invalid":l===`error`||void 0,className:Ey.select,defaultValue:f?void 0:u??(i?``:void 0),"data-has-placeholder":!!i||void 0,...d,children:[i?(0,W.jsx)(`option`,{value:``,disabled:c,hidden:c,"data-component":`Select.Option`,children:i}):null,r]}),(0,W.jsx)(pn,{className:Ey.indicator,"aria-hidden":`true`})]})}Oy.displayName=`Select`;var ky=U(Oy);const Ay=`both`,jy={counter:`textarea-counter`,counterOverLimit:`textarea-counter-over-limit`,counterIcon:`textarea-counter-icon`,hidden:`sr-only`},My=V(`textarea-field`,{variants:{block:{true:`textarea-field-block`,false:``},contrast:{true:`textarea-field-contrast`,false:``},disabled:{true:`textarea-field-disabled`,false:``},validation:{error:`textarea-field-error`,success:`textarea-field-success`}}}),Ny=V(`textarea`,{variants:{resize:{none:`textarea-resize-none`,both:`textarea-resize-both`,horizontal:`textarea-resize-horizontal`,vertical:`textarea-resize-vertical`}}});function Py(e,t){let{className:n,style:r,value:i,defaultValue:a,onChange:o,rows:s=7,cols:c=30,resize:u=Ay,block:d,contrast:f,disabled:p,required:m,validationStatus:h,minHeight:g,maxHeight:_,characterLimit:v,"aria-describedby":y,...b}=e,x=K(),S=i!==void 0,[C,w]=l.useState(()=>a===void 0?0:String(a).length),T=S?String(i).length:C,E=v?Ho(T,v):void 0,D=E?.isOverLimit??!1,O=D?`error`:h,k=l.useRef(!1),[A,j]=l.useState(``),M=E?.message;return l.useEffect(()=>{if(!k.current)return;let e=window.setTimeout(()=>{j(M??``)},500);return()=>{window.clearTimeout(e)}},[M]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:H(My({block:d,contrast:f,disabled:p,validation:O}),n),"data-component":`Textarea`,"data-block":d,"data-contrast":f,"data-disabled":p,"data-validation":O,children:(0,W.jsx)(`textarea`,{ref:t,value:i,defaultValue:a,rows:s,cols:c,disabled:p,required:m,"aria-required":m?!0:void 0,"aria-invalid":O===`error`||void 0,"aria-describedby":v?[x,y].filter(Boolean).join(` `):y,onChange:e=>{k.current=!0,v&&!S&&w(e.target.value.length),o?.(e)},className:H(Ny({resize:u})),style:{minHeight:g,maxHeight:_,...r},"data-resize":u,...b})}),E?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:jy.hidden,children:A}),(0,W.jsxs)(`span`,{id:x,className:jy.hidden,children:[`You can enter up to `,v,` `,v===1?`character`:`characters`]}),(0,W.jsxs)(Vo,{"aria-hidden":`true`,size:`small`,className:H(jy.counter,D&&jy.counterOverLimit),"data-component":`Textarea.CharacterCount`,children:[D?(0,W.jsx)(wn,{className:jy.counterIcon}):null,E.message]})]}):null]})}Py.displayName=`Textarea`;var Fy=U(Py);const Iy={root:`form-control-caption`,disabled:`form-control-caption-disabled`};function Ly(e,t){let{className:n,id:r,...i}=e,{captionId:a,disabled:o}=l.useContext(Jd);return(0,W.jsx)(`span`,{ref:t,id:r??a,className:H(Iy.root,o&&Iy.disabled,n),"data-component":`FormControl.Caption`,"data-control-disabled":o,...i})}Ly.displayName=`FormControl.Caption`;var Ry=U(Ly);const zy={root:`form-control-label`,disabled:`form-control-label-disabled`,hidden:`sr-only`,required:`form-control-label-required`};function By(e,t){let{as:n=`label`,className:r,children:i,htmlFor:a,id:o,visuallyHidden:s,requiredIndicator:c=!0,requiredText:u,...d}=e,{id:f,disabled:p,required:m,labelId:h}=l.useContext(Jd);return(0,W.jsx)(n,{ref:t,id:o??h,htmlFor:n===`label`?a??f:void 0,className:H(zy.root,p&&zy.disabled,s&&zy.hidden,r),"data-component":`FormControl.Label`,"data-control-disabled":p,...d,children:m||u?(0,W.jsxs)(`span`,{className:zy.required,children:[(0,W.jsx)(`span`,{children:i}),(0,W.jsx)(`span`,{"aria-hidden":!c||void 0,children:u??`*`})]}):i})}By.displayName=`FormControl.Label`;var Vy=U(By);const Hy={root:`form-control-leading-visual`,disabled:`form-control-leading-visual-disabled`,withCaption:`form-control-leading-visual-with-caption`};function Uy(e,t){let{className:n,...r}=e,{captionId:i,disabled:a}=l.useContext(Jd);return(0,W.jsx)(`div`,{ref:t,className:H(Hy.root,i&&Hy.withCaption,a&&Hy.disabled,n),"data-component":`FormControl.LeadingVisual`,"data-control-disabled":a,"data-has-caption":i?!0:void 0,...r})}Uy.displayName=`FormControl.LeadingVisual`;var Wy=U(Uy);const Gy={success:cn,error:wn},Ky={icon:`form-control-validation-icon`},qy=V(`form-control-validation`,{variants:{variant:{success:`form-control-validation-success`,error:`form-control-validation-error`}}});function Jy(e,t){let{className:n,children:r,variant:i,id:a,...o}=e,{validationMessageId:s}=l.useContext(Jd),c=Gy[i];return(0,W.jsxs)(`span`,{ref:t,className:H(qy({variant:i}),n),"data-component":`FormControl.Validation`,"data-validation-status":i,...o,children:[(0,W.jsx)(`span`,{className:Ky.icon,"data-component":`FormControl.Validation.Icon`,"aria-hidden":`true`,children:(0,W.jsx)(c,{})}),(0,W.jsx)(`span`,{id:a??s,children:r})]})}Jy.displayName=`FormControl.Validation`;var Yy=U(Jy);const Xy={vertical:`form-control-vertical`,verticalWithLabel:`form-control-vertical-with-label`,horizontal:`form-control-horizontal`,horizontalWithLeadingVisual:`form-control-horizontal-with-leading-visual`,choiceInput:`form-control-choice-input`,labelContainer:`form-control-label-container`},Zy=[sd,Ty,ky,Fy,Jo],Qy=(e,t)=>l.isValidElement(e)&&(e.type===t||Sr(e,t));function $y(e,t){let{className:n,children:r,disabled:i,required:a,layout:o=`vertical`,id:s,...c}=e,[u,d]=Tr(r,{label:Vy,caption:Ry,leadingVisual:Wy,validation:Yy}),f=l.useContext(rd),p=l.useContext(Sy),m=f.disabled||p.disabled||i,h=K(s),g=u.caption?`${h}-caption`:void 0,_=u.validation?`${h}-validation`:void 0,v=l.isValidElement(u.label)?u.label:void 0,y=v?v.props.id??`${h}-label`:void 0,b=v?!v.props.visuallyHidden:!1,x=l.isValidElement(u.validation)?u.validation.props.variant:void 0,S=d.find(e=>Zy.some(t=>Qy(e,t))),C=Qy(S,sd)||Qy(S,Ty),w=Qy(S,Ty),T=C||o===`horizontal`,E=d.filter(e=>e!==S),D={id:h,disabled:m,required:a,captionId:g,validationMessageId:_,labelId:y},O=l.isValidElement(S)?l.cloneElement(S,T?{id:h,disabled:m,required:a&&!w,"aria-describedby":g}:{id:h,disabled:m,required:a,validationStatus:x,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,...S.props}):null;return(0,W.jsx)(Jd.Provider,{value:D,children:T?(0,W.jsxs)(`div`,{ref:t,className:H(Xy.horizontal,u.leadingVisual&&Xy.horizontalWithLeadingVisual,n),"data-component":`FormControl`,"data-layout":`horizontal`,"data-disabled":m,"data-required":a,"data-has-leading-visual":u.leadingVisual?!0:void 0,...c,children:[(0,W.jsxs)(`div`,{className:Xy.choiceInput,children:[O,E]}),u.leadingVisual,(0,W.jsxs)(`div`,{className:Xy.labelContainer,children:[u.label,u.caption]})]}):(0,W.jsxs)(`div`,{ref:t,className:H(Xy.vertical,b&&Xy.verticalWithLabel,n),"data-component":`FormControl`,"data-layout":`vertical`,"data-disabled":m,"data-required":a,"data-has-label":b?!0:void 0,...c,children:[u.label,O,E,u.validation,u.caption]})})}$y.displayName=`FormControl`;var eb=U($y);const tb=Object.assign(eb,{Label:Vy,Caption:Ry,LeadingVisual:Wy,Validation:Yy}),nb=`en-US`,rb=(e,t)=>t?`${e}|${Object.entries(t).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:1).map(([e,t])=>`${e}=${String(t)}`).join(`,`)}`:e,ib=e=>{let t=new Map;return(n,r)=>{let i=rb(n,r),a=t.get(i);if(a)return a;let o=e(n,r);return t.set(i,o),o}},ab=new Set([`Adlm`,`Arab`,`Armi`,`Avst`,`Hebr`,`Mand`,`Mend`,`Nkoo`,`Rohg`,`Samr`,`Syrc`,`Thaa`]),ob=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]),sb=e=>{try{return new Intl.Locale(e).maximize().script}catch{return}},cb=e=>{let t=sb(e);return t?ab.has(t):ob.has(e.split(`-`)[0].toLowerCase())},lb=e=>cb(e)?`rtl`:`ltr`,ub=()=>{let e=typeof navigator>`u`?void 0:navigator.language;if(!e)return nb;try{return Intl.DateTimeFormat.supportedLocalesOf([e]),e}catch{return nb}},db=ib((e,t)=>new Intl.Collator(e,t)),fb=(e=nb,t={})=>db(e,t),pb=RegExp(`\\p{P}`,`gu`),mb=ib((e,t={})=>{let n=db(e,{usage:`search`,...t}),r=e=>{let t=e.normalize(`NFC`);return n.resolvedOptions().ignorePunctuation?t.replace(pb,``):t},i=(e,t)=>n.compare(e,t)===0;return{startsWith:(e,t)=>{if(t.length===0)return!0;let[n,a]=[r(e),r(t)];return i(n.slice(0,a.length),a)},endsWith:(e,t)=>{if(t.length===0)return!0;let[n,a]=[r(e),r(t)];return i(n.slice(-a.length),a)},contains:(e,t)=>{if(t.length===0)return!0;let[n,a]=[r(e),r(t)];for(let e=0;e+a.length<=n.length;e++)if(i(n.slice(e,e+a.length),a))return!0;return!1}}}),hb=({locale:e,...t}={})=>mb(e??`en-US`,t),gb=ib((e,t)=>new Intl.NumberFormat(e,t)),_b=(e=nb,t={})=>gb(e,t),vb=(e,t=nb,n={})=>gb(t,n).format(e),yb=ib((e,t)=>new Intl.DateTimeFormat(e,t)),bb=(e=nb,t={})=>yb(e,t),xb=[``,`kilo`,`mega`,`giga`,`tera`],Sb=[``,`kilo`,`mega`,`giga`,`tera`,`peta`],Cb=(e,t=nb,n={})=>{if(Number.isNaN(e))return``;if(e===0)return`0 B`;let{precision:r=3,unitSystem:i=`decimal`,unit:a=`byte`,unitDisplay:o=`short`}=n,s=i===`binary`?1024:1e3,c=a===`bit`?xb:Sb,l=Math.abs(e),u=0;for(;l>=s&&u<c.length-1;)l/=s,u++;let d=parseFloat(l.toPrecision(r));return vb(e<0?-d:d,t,{style:`unit`,unit:c[u]+a,unitDisplay:o})},wb=(0,l.createContext)({direction:`ltr`}),Tb=(0,l.createContext)({locale:nb,direction:lb(nb)}),Eb=()=>(0,l.useContext)(Tb),Db=e=>(window?.addEventListener?.(`languagechange`,e),()=>window?.removeEventListener?.(`languagechange`,e)),Ob=()=>nb,kb=()=>l.useSyncExternalStore(Db,ub,Ob);function Ab({children:e,className:t,contextOnly:n,...r}){let{locale:i}=Eb(),a=kb(),o=r.locale??i,s=o===`auto`?a:o,c=lb(s),u=l.useMemo(()=>({locale:s,direction:c}),[s,c]),d=l.useMemo(()=>({direction:c}),[c]),f=n?e:(0,W.jsx)(`div`,{className:t,"data-component":`LocaleProvider`,lang:s,dir:c,children:e});return(0,W.jsx)(Tb.Provider,{value:u,children:(0,W.jsx)(wb.Provider,{value:d,children:f})})}Ab.displayName=`LocaleProvider`;const jb=({locale:e,...t}={})=>{let{locale:n}=Eb();return fb(e??n,t)},Mb=({locale:e,...t}={})=>{let{locale:n}=Eb();return bb(e??n,t)},Nb=({locale:e,...t}={})=>{let{locale:n}=Eb();return hb({locale:e??n,...t})},Pb=({locale:e,...t}={})=>{let{locale:n}=Eb();return _b(e??n,t)};function Fb(e,t){let{as:n=`span`,children:r,value:i,format:a,locale:o,...s}=e,{locale:c}=Eb();return(0,W.jsx)(n,{ref:t,"data-component":`FormatByte`,...s,children:r??Cb(i,o??c,a)})}Fb.displayName=`FormatByte`;var Ib=U(Fb);function Lb(e,t){let{as:n=`span`,children:r,value:i,format:a,locale:o,...s}=e,c=Pb({locale:o,...a});return(0,W.jsx)(n,{ref:t,"data-component":`FormatNumber`,...s,children:r??c.format(i)})}Lb.displayName=`FormatNumber`;var Rb=U(Lb);function zb({onMount:e,onUnmount:t,children:n}){let r=l.useRef({onMount:e,onUnmount:t});return l.useEffect(()=>{r.current={onMount:e,onUnmount:t}},[e,t]),l.useEffect(()=>(r.current.onMount?.(),()=>{r.current.onUnmount?.()}),[]),(0,W.jsx)(W.Fragment,{children:n})}zb.displayName=`Frame.Content`;const Bb={root:`frame`},Vb=`frame-root`,Hb=`<!doctype html><html><head><style>*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}</style></head><body><div class="${Vb}"></div></body></html>`,Ub=e=>{let t=e.contentWindow?.document;return t?t.body.querySelector(`.frame-root`)??t.body:null};function Wb(e,t){let{children:n,head:r,onMount:i,onUnmount:a,srcDoc:o=Hb,className:s,title:c,...u}=e,f=K(),[p,m]=l.useState(null),[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{m(e)},[]),b=R(t,y);return Wi(()=>{if(!p)return;let e=p.contentWindow?.document;e&&(e.open(),e.write(o),e.close(),g(Ub(p)),v(e.head))},[p,o]),l.useEffect(()=>{if(!p||!h)return;let e=p.contentWindow;if(!e?.ResizeObserver)return;let t=()=>{p.style.setProperty(`--frame-content-width`,`${h.scrollWidth}px`),p.style.setProperty(`--frame-content-height`,`${h.scrollHeight}px`)},n=new e.ResizeObserver(()=>{e.requestAnimationFrame(t)});return t(),n.observe(h),()=>{n.disconnect()}},[p,h]),(0,W.jsxs)(`iframe`,{ref:b,title:c??`Frame ${f}`,className:H(Bb.root,s),"data-component":`Frame`,...u,children:[h?(0,d.createPortal)((0,W.jsx)(zb,{onMount:i,onUnmount:a,children:n}),h):null,r&&_?(0,d.createPortal)(r,_):null]})}Wb.displayName=`Frame`;var Gb=U(Wb);const Kb={root:`header`};function qb(e,t){let{as:n=`header`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Kb.root,r),"data-component":`Header`,...i})}qb.displayName=`Header`;var Jb=U(qb);const Yb={root:`header-item`,full:`header-item-full`};function Xb(e,t){let{className:n,full:r,...i}=e;return(0,W.jsx)(`div`,{ref:t,className:H(Yb.root,r&&Yb.full,n),"data-component":`Header.Item`,"data-full":r?``:void 0,...i})}Xb.displayName=`Header.Item`;var Zb=U(Xb);const Qb={root:`header-link`};function $b(e,t){let{as:n=`a`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Qb.root,r),"data-component":`Header.Link`,...i})}$b.displayName=`Header.Link`;var ex=U($b);const tx=Object.assign(Jb,{Item:Zb,Link:ex}),nx={when:{narrow:`hidden-narrow`,regular:`hidden-regular`,wide:`hidden-wide`}};function rx(e,t){let{as:n=`div`,className:r,when:i,...a}=e,o=Array.isArray(i)?i:[i];return(0,W.jsx)(n,{ref:t,className:H(o.map(e=>nx.when[e]),r),"data-component":`Hidden`,"data-when":o.join(` `),...a})}rx.displayName=`Hidden`;var ix=U(rx);const ax=V(`mark`,{variants:{variant:{attention:`mark-attention`,accent:`mark-accent`,success:`mark-success`,danger:`mark-danger`,neutral:`mark-neutral`},size:{large:`mark-size-large`,medium:`mark-size-medium`,small:`mark-size-small`},weight:{light:`mark-weight-light`,normal:`mark-weight-normal`,medium:`mark-weight-medium`,semibold:`mark-weight-semibold`}}});function ox(e,t){let{as:n=`mark`,className:r,variant:i=`attention`,size:a,weight:o,...s}=e;return(0,W.jsx)(n,{ref:t,className:H(ax({variant:i,size:a,weight:o}),r),"data-component":`Mark`,"data-variant":i,"data-size":a,"data-weight":o,...s})}ox.displayName=`Mark`;var sx=U(ox);const cx=e=>(typeof e==`string`?[e]:e??[]).filter(e=>e.length>0).sort((e,t)=>t.length-e.length),lx=(e,t,n=!1)=>{let r=cx(t);if(e.length===0)return[];if(r.length===0)return[{text:e,matched:!1}];let i=n?e:e.toLowerCase(),a=n?r:r.map(e=>e.toLowerCase()),o=[],s=0,c=0,l=t=>{t>c&&o.push({text:e.slice(c,t),matched:!1})};for(;s<e.length;){let t=a.find(e=>i.startsWith(e,s));if(t===void 0){s+=1;continue}l(s);let n=s+t.length,r=o[o.length-1];r?.matched?r.text+=e.slice(s,n):o.push({text:e.slice(s,n),matched:!0}),s=n,c=n}return l(e.length),o};function ux(e,t){let{as:n=`span`,children:r=``,match:i,caseSensitive:a=!1,variant:o=`attention`,...s}=e,c=l.useMemo(()=>lx(r,i,a),[r,i,a]);return(0,W.jsx)(n,{ref:t,"data-component":`Highlight`,"data-variant":o,"data-case-sensitive":a,...s,children:c.map((e,t)=>e.matched?(0,W.jsx)(sx,{variant:o,children:e.text},t):e.text)})}ux.displayName=`Highlight`;var dx=U(ux);const fx=(0,l.createContext)({}),px={root:`hover-card-content`};function mx(e,t){let{className:n,...r}=e;return(0,W.jsx)(`div`,{ref:t,className:H(px.root,n),"data-component":`HoverCard.Content`,...r})}mx.displayName=`HoverCard.Content`;var hx=U(mx);function gx(e){let{children:t}=e,{triggerHandlers:n}=l.useContext(fx),r=l.Children.only(t);if(!l.isValidElement(r)||!n)return null;let i=r.props;return l.cloneElement(r,{ref:n.ref,"aria-describedby":[i[`aria-describedby`],n[`aria-describedby`]].filter(Boolean).join(` `)||void 0,onPointerEnter:e=>{n.onPointerEnter(e),i.onPointerEnter?.(e)},onPointerLeave:e=>{n.onPointerLeave(e),i.onPointerLeave?.(e)},onFocus:e=>{n.onFocus(e),i.onFocus?.(e)},onBlur:e=>{n.onBlur(e),i.onBlur?.(e)}})}gx.displayName=`HoverCard.Trigger`;const _x={root:[`hover-card`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short motion-safe:data-[side=outside-bottom]:slide-in-from-top-2 motion-safe:data-[side=outside-top]:slide-in-from-bottom-2 motion-safe:data-[side=outside-right]:slide-in-from-left-2 motion-safe:data-[side=outside-left]:slide-in-from-right-2`],unplaced:`invisible`},vx=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function yx(e){let{className:t,children:n,side:r=`outside-bottom`,align:i=`start`,anchorOffset:a,alignmentOffset:o,openDelay:s=500,closeDelay:c=300,open:u,onOpenChange:d,disabled:f=!1,portalContainerName:p}=e,m=K(),[h]=Tr(n,{trigger:gx,content:hx}),g=l.useRef(null),_=l.useRef(null),v=l.useRef(null),y=l.useRef(null),[b,x]=l.useState(!1),S=u!==void 0,C=(S?u:b)&&!f,w=l.useRef(null),[T,E]=l.useState(null),D=l.useCallback(()=>{v.current!==null&&(window.clearTimeout(v.current),v.current=null),y.current!==null&&(window.clearTimeout(y.current),y.current=null)},[]);l.useEffect(()=>D,[D]);let O=e=>{D(),S||x(e),d?.(e)},k=()=>{f||(D(),v.current=window.setTimeout(()=>{v.current=null,O(!0)},s))},A=()=>{D(),y.current=window.setTimeout(()=>{y.current=null,O(!1)},c)},j=l.useCallback(()=>{let e=g.current,t=_.current;if(!e||!t)return;let n=ua(t,e,{side:r,align:i,anchorOffset:a,alignmentOffset:o});w.current&&vx(w.current,n)||(w.current=n,E(n))},[r,i,a,o]);Wi(()=>{if(!C){w.current=null,E(null);return}j();let e=new ResizeObserver(j);return _.current&&e.observe(_.current),window.addEventListener(`resize`,j),window.addEventListener(`scroll`,j,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,j),window.removeEventListener(`scroll`,j,!0)}},[C,j]),qi(e=>{C&&(e.preventDefault(),O(!1))});let M={ref:g,"aria-describedby":C?m:void 0,onPointerEnter:e=>{e.pointerType!==`touch`&&k()},onPointerLeave:e=>{e.pointerType!==`touch`&&A()},onFocus:e=>{try{if(!e.target.matches(`:focus-visible`))return}catch{}O(!0)},onBlur:e=>{e.relatedTarget instanceof Node&&_.current?.contains(e.relatedTarget)||O(!1)}};return(0,W.jsxs)(fx.Provider,{value:{triggerHandlers:M},children:[h.trigger,C?(0,W.jsx)(aa,{containerName:p,children:(0,W.jsx)(`div`,{ref:_,id:m,className:H(_x.root,!T&&_x.unplaced,t),style:{"--hover-card-top":`${T?.top??0}px`,"--hover-card-left":`${T?.left??0}px`},onPointerEnter:D,onPointerLeave:A,"data-component":`HoverCard`,"data-side":T?.anchorSide??r,"data-align":T?.anchorAlign??i,"data-visibility":T?`visible`:`hidden`,children:h.content})}):null]})}yx.displayName=`HoverCard`;const bx=Object.assign(yx,{Trigger:gx,Content:hx}),xx=V(`image`,{variants:{fit:{contain:`image-fit-contain`,cover:`image-fit-cover`,fill:`image-fit-fill`,none:`image-fit-none`,"scale-down":`image-fit-scale-down`},borderRadius:{none:`image-radius-none`,small:`image-radius-small`,medium:`image-radius-medium`,large:`image-radius-large`,full:`image-radius-full`}}});function Sx(e,t){let{as:n=`img`,className:r,alt:i=``,borderRadius:a=`none`,fit:o=`cover`,fallbackSrc:s,loading:c=`lazy`,src:u,onError:d,...f}=e,[p,m]=l.useState(void 0),h=s!==void 0&&u!==void 0&&u===p;return(0,W.jsx)(n,{ref:t,alt:i,src:h?s:u,loading:c,onError:e=>{m(u),d?.(e)},className:H(xx({borderRadius:a,fit:o}),r),"data-component":`Image`,"data-border-radius":a,"data-fit":o,"data-fallback":h||void 0,...f})}Sx.displayName=`Image`;var Cx=U(Sx);const wx={icon:`inline-message-icon`},Tx=V(`inline-message`,{variants:{size:{small:`inline-message-small`,medium:`inline-message-medium`},variant:{critical:`inline-message-critical`,success:`inline-message-success`,unavailable:`inline-message-unavailable`,warning:`inline-message-warning`}}}),Ex={critical:wn,success:cn,unavailable:rr,warning:rr},Dx=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,W.jsx)(e,{});function Ox(e,t){let{className:n,children:r,size:i=`medium`,variant:a,leadingVisual:o,...s}=e,c=a?Ex[a]:An;return(0,W.jsxs)(`div`,{ref:t,className:H(Tx({size:i,variant:a}),n),"data-component":`InlineMessage`,"data-size":i,"data-variant":a,...s,children:[(0,W.jsx)(`span`,{className:wx.icon,"data-component":`InlineMessage.Icon`,children:o===void 0?(0,W.jsx)(c,{}):Dx(o)}),(0,W.jsx)(`span`,{"data-component":`InlineMessage.Content`,children:r})]})}Ox.displayName=`InlineMessage`;var kx=U(Ox);const Ax=([e,...t])=>(e?.toUpperCase()??``)+t.join(``).toLowerCase(),jx=e=>({alt:e===`apple`?`⌥`:`Alt`,control:`⌃`,shift:`⇧`,meta:e===`apple`?`⌘`:e===`windows`?`Win`:`Meta`,mod:e===`apple`?`⌘`:`⌃`,pageup:`PgUp`,pagedown:`PgDn`,arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,plus:`+`,backspace:`⌫`,delete:`Del`,space:`␣`,tab:`⇥`,enter:`⏎`,escape:`Esc`,function:`Fn`,capslock:`CapsLock`,insert:`Ins`,printscreen:`PrtScn`}),Mx=e=>({alt:e===`apple`?`Option`:`Alt`,meta:e===`apple`?`Command`:e===`windows`?`Windows`:`Meta`,mod:e===`apple`?`Command`:`Control`,"+":`Plus`,pageup:`Page Up`,pagedown:`Page Down`,arrowup:`Up Arrow`,arrowdown:`Down Arrow`,arrowleft:`Left Arrow`,arrowright:`Right Arrow`,capslock:`Caps Lock`,printscreen:`Print Screen`}),Nx=e=>({alt:e===`apple`?`option`:`alt`,meta:e===`apple`?`command`:e===`windows`?`Windows`:`meta`,mod:e===`apple`?`command`:`control`,pageup:`page up`,pagedown:`page down`,arrowup:`up arrow`,arrowdown:`down arrow`,arrowleft:`left arrow`,arrowright:`right arrow`,capslock:`caps lock`,printscreen:`print screen`,"`":`backtick`,"~":`tilde`,"!":`exclamation point`,"@":`at`,"#":`hash`,$:`dollar sign`,"%":`percent`,"^":`caret`,"&":`ampersand`,"*":`asterisk`,"(":`left parenthesis`,")":`right parenthesis`,_:`underscore`,"-":`dash`,"+":`plus`,"=":`equals`,"[":`left bracket`,"{":`left curly brace`,"]":`right bracket`,"}":`right curly brace`,"\\":`backslash`,"|":`pipe`,";":`semicolon`,":":`colon`,"'":`single quote`,'"':`double quote`,",":`comma`,"<":`left angle bracket`,".":`period`,">":`right angle bracket`,"/":`forward slash`,"?":`question mark`," ":`space`}),Px=(e,t)=>jx(t)[e]??Ax(e),Fx=(e,t)=>Mx(t)[e]??Ax(e),Ix=(e,t)=>Nx(t)[e]??e.toLowerCase(),Lx={control:1,meta:2,alt:3,option:4,shift:5,function:6},Rx=e=>Lx[e]??1/0,zx=e=>e.split(`+`).map(e=>e.toLowerCase()).sort((e,t)=>Rx(e)-Rx(t)),Bx=e=>e.split(` `),Vx=(e,t)=>zx(e).map(e=>Ix(e,t)).join(` `),Hx=(e,t)=>Bx(e).map(e=>Vx(e,t)).join(` then `),Ux=(e,t)=>Hx(e,t),Wx=(0,l.createContext)(null),Gx=()=>()=>{},Kx=()=>typeof navigator>`u`?``:`${navigator.platform} ${navigator.userAgent}`,qx=()=>{let e=Kx();return/mac|iphone|ipad|ipod/i.test(e)?`apple`:/win/i.test(e)?`windows`:`other`},Jx=()=>`other`,Yx=()=>{let e=(0,l.useContext)(Wx),t=(0,l.useSyncExternalStore)(Gx,qx,Jx);return e??t},Xx={hidden:`sr-only`};function Zx(e){let{name:t,format:n=`condensed`}=e,r=Yx();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:Xx.hidden,children:Ix(t,r)}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:n===`condensed`?Px(t,r):Fx(t,r)})]})}Zx.displayName=`KeybindingHint.Key`;const Qx=V(`keybinding-hint-chord`,{variants:{variant:{normal:`keybinding-hint-chord-normal`,onEmphasis:`keybinding-hint-chord-on-emphasis`,onPrimary:`keybinding-hint-chord-on-primary`},size:{normal:`keybinding-hint-chord-size-normal`,small:`keybinding-hint-chord-size-small`}}});function $x(e){let{keys:t,format:n=`condensed`,variant:r=`normal`,size:i=`normal`}=e;return(0,W.jsx)(`span`,{className:H(Qx({variant:r,size:i})),"data-component":`KeybindingHint.Chord`,children:zx(t).map((e,t)=>(0,W.jsxs)(l.Fragment,{children:[t>0&&n===`full`?(0,W.jsx)(`span`,{"aria-hidden":`true`,children:` + `}):` `,(0,W.jsx)(Zx,{name:e,format:n})]},t))})}$x.displayName=`KeybindingHint.Chord`;const eS={root:`keybinding-hint`,hidden:`sr-only`};function tS(e,t){let{className:n,keys:r,format:i=`condensed`,variant:a=`normal`,size:o=`normal`,...s}=e;return(0,W.jsx)(`kbd`,{ref:t,className:H(eS.root,n),"data-component":`KeybindingHint`,"data-format":i,"data-variant":a,"data-size":o,...s,children:Bx(r).map((e,t)=>(0,W.jsxs)(l.Fragment,{children:[t>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:eS.hidden,children:`then`}),` `]}):null,(0,W.jsx)($x,{keys:e,format:i,variant:a,size:o})]},t))})}tS.displayName=`KeybindingHint`;var nS=U(tS);const rS=V(`label`,{variants:{size:{small:`label-small`,medium:`label-medium`,large:`label-large`},variant:{default:`label-default`,primary:`label-primary`,secondary:`label-secondary`,accent:`label-accent`,success:`label-success`,attention:`label-attention`,severe:`label-severe`,danger:`label-danger`,done:`label-done`,sponsors:`label-sponsors`}}});function iS(e,t){let{as:n=`span`,className:r,size:i=`small`,variant:a=`default`,...o}=e;return(0,W.jsx)(n,{ref:t,className:H(rS({size:i,variant:a}),r),"data-component":`Label`,"data-size":i,"data-variant":a,...o})}iS.displayName=`Label`;var aS=U(iS);const oS=()=>(0,l.useContext)(wb).direction,sS=()=>oS()===`rtl`;function cS({children:e,className:t,contextOnly:n,...r}){let i=oS(),a=r.direction??i,o=l.useMemo(()=>({direction:a}),[a]);return n?(0,W.jsx)(wb.Provider,{value:o,children:e}):(0,W.jsx)(wb.Provider,{value:o,children:(0,W.jsx)(`div`,{className:t,"data-component":`DirectionProvider`,dir:a,children:e})})}cS.displayName=`DirectionProvider`;const lS=new Set,uS=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),dS=({containerRef:e,childCount:t,reservedWidth:n,disabled:r})=>{let[i,a]=l.useState(lS),o=sS();return l.useEffect(()=>{let t=e.current;if(!t||r)return;let i=new IntersectionObserver(e=>{a(t=>{let n=new Set(t);for(let t of e){let e=Number(t.target.getAttribute(`data-index`));t.intersectionRatio<1?n.add(e):n.delete(e)}return uS(t,n)?t:n})},{root:t,rootMargin:o?`0px 0px 0px ${-n}px`:`0px ${-n}px 0px 0px`,threshold:1});for(let e of t.querySelectorAll(`[data-index]`))i.observe(e);return()=>{i.disconnect()}},[e,t,n,r,o]),i},fS={item:`label-group-item`,hidden:`label-group-item-hidden`,toggle:`label-group-toggle`,overlay:`label-group-overlay`,overlayItems:`label-group-overlay-items`,overlayCloseButton:`label-group-overlay-close-button`,srOnly:`sr-only`},pS=V(`label-group`,{variants:{wrap:{true:`label-group-wrap`,false:``},list:{true:`label-group-list`,false:``}}}),mS=new Set;function hS(e,t){let{as:n=`ul`,className:r,children:i,overflowStyle:a=`overlay`,visibleChildCount:o,...s}=e,c=l.useRef(null),u=R(t,c),d=l.useRef(null),f=l.useRef(null),p=l.useRef(null),m=l.useRef(void 0),[h,g]=l.useState(!1),[_,v]=l.useState(0),y=l.useCallback(e=>{d.current=e},[]),b=l.Children.toArray(i),x=b.length,S=n===`ul`||n===`ol`,C=S?`li`:`span`,w=o!==void 0,T=h&&a===`inline`;Wi(()=>{let e=d.current;if(!e||o!==`auto`||T)return;let t=()=>v(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[o,T]);let E=dS({containerRef:c,childCount:x,reservedWidth:_,disabled:o!==`auto`||T}),D=l.useMemo(()=>{if(o===void 0||T)return mS;if(o===`auto`)return E;let e=Math.max(x-o,0);return new Set(Array.from({length:e},(e,t)=>o+t))},[o,T,E,x]),O=D.size;l.useEffect(()=>{O>0&&(m.current=Math.min(...D))},[D,O]);let k=l.useRef(h);l.useEffect(()=>{let e=k.current;if(k.current=h,a===`overlay`||e===h)return;if(!h){f.current?.focus();return}let t=c.current?.querySelector(`[data-index="${m.current}"]`);(vr(t??null)[0]??p.current)?.focus()},[h,a]);let A=()=>g(!0),j=()=>g(!1),M=()=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:fS.srOnly,children:[`Show +`,O,` more`]}),(0,W.jsxs)(`span`,{"aria-hidden":`true`,children:[`+`,O]})]}),N=()=>a===`inline`?h?(0,W.jsx)(_i,{ref:p,size:`small`,variant:`invisible`,onClick:j,children:`Show less`}):O>0?(0,W.jsx)(_i,{ref:f,size:`small`,variant:`invisible`,onClick:A,children:M()}):null:O>0?(0,W.jsx)(ga,{open:h,onOpen:A,onClose:j,side:`outside-bottom`,align:`end`,width:`auto`,height:`auto`,overlayProps:{role:`dialog`,"aria-modal":!0,"aria-label":`All ${x} labels`},renderAnchor:e=>(0,W.jsx)(_i,{...e,size:`small`,variant:`invisible`,children:M()}),children:(0,W.jsxs)(`div`,{className:fS.overlay,children:[(0,W.jsx)(`div`,{className:fS.overlayItems,children:i}),(0,W.jsx)(bi,{icon:Sn,"aria-label":`Close`,size:`small`,variant:`invisible`,onClick:j,className:fS.overlayCloseButton,"data-component":`LabelGroup.CloseButton`})]})}):null,P=!w||T;return(0,W.jsxs)(n,{ref:u,className:H(pS({wrap:P,list:S}),r),"data-component":`LabelGroup`,"data-overflow":P?`inline`:void 0,"data-list":S||void 0,...s,children:[b.map((e,t)=>(0,W.jsx)(C,{"data-index":t,"data-hidden":D.has(t)?``:void 0,className:H(fS.item,D.has(t)&&fS.hidden),children:e},t)),w?(0,W.jsx)(C,{ref:y,className:fS.toggle,"data-component":`LabelGroup.Toggle`,children:N()}):null]})}hS.displayName=`LabelGroup`;var gS=U(hS);function _S(e,t){let{as:n=`a`,...r}=e;return(0,W.jsx)(hi,{ref:t,as:n,"data-component":`LinkButton`,...r})}_S.displayName=`LinkButton`;var vS=U(_S);const yS=V(`list`,{variants:{variant:{bullet:`list-bullet`,number:`list-number`,plain:`list-plain`},spacing:{condensed:`list-condensed`,normal:`list-normal`,spacious:`list-spacious`}}});function bS(e,t){let{as:n,className:r,variant:i=`bullet`,spacing:a=`normal`,...o}=e;return(0,W.jsx)(n??(i===`number`?`ol`:`ul`),{ref:t,role:i===`plain`?`list`:void 0,className:H(yS({variant:i,spacing:a}),r),"data-component":`List`,"data-variant":i,"data-spacing":a,...o})}bS.displayName=`List`;var xS=U(bS);const SS={root:`list-item`};function CS(e,t){let{as:n=`li`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(SS.root,r),"data-component":`List.Item`,...i})}CS.displayName=`List.Item`;var wS=U(CS);const TS=Object.assign(xS,{Item:wS});var ES={ADD:`add`,REMOVE:`remove`},DS={PROPERTYCHANGE:`propertychange`};function OS(e){for(let t in e)delete e[t]}function kS(e){let t;for(t in e)return!1;return!t}function AS(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function jS(e,t,n,r){return AS(e,t,n,r,!0)}function MS(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),OS(e))}var q={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},NS=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function PS(e,t,n){let r,i;n||=FS;let a=0,o=e.length,s=!1;for(;a<o;)r=a+(o-a>>1),i=+n(e[r],t),i<0?a=r+1:(o=r,s=!i);return s?a:~a}function FS(e,t){return e>t?1:e<t?-1:0}function IS(e,t){return e<t?1:e>t?-1:0}function LS(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function RS(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function zS(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function BS(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function VS(e,t,n){let r=t||FS;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function HS(){return!0}function US(){return!1}function WS(){}function GS(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return(!n||this!==r||!BS(i,n))&&(r=this,n=i,t=e.apply(this,arguments)),t}}function KS(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return t instanceof Promise?t:Promise.resolve(t)}return t()}var qS=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},JS=class extends NS{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new qS(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,WS);delete a[n]}return s}disposeInternal(){this.listeners_&&OS(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=WS,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},YS=class extends JS{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(q.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=AS(this,e[i],t);return r}return AS(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=jS(this,e[i],t)}else n=jS(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)XS(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};YS.prototype.on,YS.prototype.once,YS.prototype.un;function XS(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)MS(e[t]);else MS(e)}function ZS(){throw Error(`Unimplemented abstract method.`)}let QS=0;function J(e){return e.ol_uid||=String(++QS)}var $S=class extends qS{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},eC=class extends YS{constructor(e){super(),this.on,this.once,this.un,J(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new $S(n,e,t)),n=DS.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new $S(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],kS(this.values_)&&(this.values_=null),t||this.notify(e,n)}}};const tC={LENGTH:`length`};var nC=class extends qS{constructor(e,t,n){super(e),this.element=t,this.index=n}},rC=class extends eC{constructor(e,t){if(super(),this.on,this.once,this.un,t||={},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let e=1,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(tC.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new nC(ES.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new nC(ES.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new nC(ES.REMOVE,n,e)),this.dispatchEvent(new nC(ES.ADD,t,e))}updateLength_(){this.set(tC.LENGTH,this.array_.length)}assertUnique_(e,t){let n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e&&r!==t)throw Error(`Duplicate item added to a unique collection`)}};function iC(e,t){if(!e)throw Error(t)}var aC=class e extends eC{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_=`geometry`,this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e){if(typeof e.getSimplifiedGeometry==`function`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}}clone(){let t=new e,n=this.geometryName_;t.setGeometryName(n);let r=this.getPropertiesInternal();if(r){let e=this.getGeometry();for(let i in r)i===n&&e?t.set(i,e.clone()):t.set(i,r[i],!0)}let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&=(MS(this.geometryChangeKey_),null);let e=this.getGeometry();e&&(this.geometryChangeKey_=AS(e,q.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?oC(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){e!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}};function oC(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(iC(typeof e.getZIndex==`function`,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}var sC={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function cC(e){let t=_C();for(let n=0,r=e.length;n<r;++n)TC(t,e[n]);return t}function lC(e,t,n){return vC(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}function uC(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function dC(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function fC(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function pC(e,t){return hC(e,t[0],t[1])}function mC(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function hC(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function gC(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=sC.UNKNOWN;return o<n?c|=sC.LEFT:o>i&&(c|=sC.RIGHT),s<r?c|=sC.BELOW:s>a&&(c|=sC.ABOVE),c===sC.UNKNOWN&&(c=sC.INTERSECTING),c}function _C(){return[1/0,1/0,-1/0,-1/0]}function vC(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function yC(e){return vC(1/0,1/0,-1/0,-1/0,e)}function bC(e,t){let n=e[0],r=e[1];return vC(n,r,n,r,t)}function xC(e,t,n,r,i){return EC(yC(i),e,t,n,r)}function SC(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function CC(e,t,n){return Math.abs(e[0]-t[0])<n&&Math.abs(e[2]-t[2])<n&&Math.abs(e[1]-t[1])<n&&Math.abs(e[3]-t[3])<n}function wC(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function TC(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function EC(e,t,n,r,i){for(;n<r;n+=i)DC(e,t[n],t[n+1]);return e}function DC(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function OC(e,t){let n;return n=t(AC(e)),n||(n=t(jC(e)),n)||(n=t(BC(e)),n)||(n=t(zC(e)),n)?n:!1}function kC(e){let t=0;return UC(e)||(t=VC(e)*IC(e)),t}function AC(e){return[e[0],e[1]]}function jC(e){return[e[2],e[1]]}function MC(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function NC(e,t){let n;if(t===`bottom-left`)n=AC(e);else if(t===`bottom-right`)n=jC(e);else if(t===`top-left`)n=zC(e);else if(t===`top-right`)n=BC(e);else throw Error(`Invalid corner`);return n}function PC(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=FC(e,t,n,r);return vC(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function FC(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function IC(e){return e[3]-e[1]}function LC(e,t,n){let r=n||_C();return HC(e,t)?(r[0]=e[0]>t[0]?e[0]:t[0],r[1]=e[1]>t[1]?e[1]:t[1],r[2]=e[2]<t[2]?e[2]:t[2],r[3]=e[3]<t[3]?e[3]:t[3]):yC(r),r}function RC(e,t){if(!HC(e,t))return[e.slice()];if(mC(t,e))return[];let[n,r,i,a]=e,o=Math.max(n,t[0]),s=Math.max(r,t[1]),c=Math.min(i,t[2]),l=Math.min(a,t[3]),u=[];return o>n&&u.push([n,r,o,a]),c<i&&u.push([c,r,i,a]),s>r&&u.push([o,r,c,s]),l<a&&u.push([o,l,c,a]),u}function zC(e){return[e[0],e[3]]}function BC(e){return[e[2],e[3]]}function VC(e){return e[2]-e[0]}function HC(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function UC(e){return e[2]<e[0]||e[3]<e[1]}function WC(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function GC(e,t){let n=(e[2]-e[0])/2*(t-1),r=(e[3]-e[1])/2*(t-1);e[0]-=n,e[2]+=n,e[1]-=r,e[3]+=r}function KC(e,t,n){let r=!1,i=gC(e,t),a=gC(e,n);if(i===sC.INTERSECTING||a===sC.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&sC.ABOVE&&!(i&sC.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&sC.RIGHT&&!(i&sC.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&sC.BELOW&&!(i&sC.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&sC.LEFT&&!(i&sC.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function qC(e,t,n,r){if(UC(e))return yC(n);let i=[];if(r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a<r;++a)i.push(e[0]+t*a/r,e[1],e[2],e[1]+n*a/r,e[2]-t*a/r,e[3],e[0],e[3]-n*a/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let a=[],o=[];for(let e=0,t=i.length;e<t;e+=2)a.push(i[e]),o.push(i[e+1]);return lC(a,o,n)}function JC(e,t){let n=t.getExtent(),r=MC(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=VC(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function YC(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];JC(e,t);let i=VC(r);if(VC(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function XC(e,t){let n=[e];for(let e=0,r=t.length;e<r&&n.length>0;++e){let r=[];for(let i=0,a=n.length;i<a;++i)r.push(...RC(n[i],t[e]));n=r}return n}function ZC(e,t,n){return Math.min(Math.max(e,t),n)}function QC(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return $C(e,t,n,r)}function $C(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function ew(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function tw(e){return e*180/Math.PI}function nw(e){return e*Math.PI/180}function rw(e,t){let n=e%t;return n*t<0?n+t:n}function iw(e,t,n){return e+n*(t-e)}function aw(e,t){let n=10**t;return Math.round(e*n)/n}function ow(e,t){return Math.floor(aw(e,t))}function sw(e,t){return Math.ceil(aw(e,t))}function cw(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}function lw(e,t,n){n||=6371008.8;let r=nw(e[1]),i=nw(t[1]),a=(i-r)/2,o=nw(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}function uw(e,t){let n=0;for(let r=0,i=e.length;r<i-1;++r)n+=lw(e[r],e[r+1],t);return n}function dw(e,t){t||={};let n=t.radius||6371008.8,r=t.projection||`EPSG:3857`,i=e.getType();i!==`GeometryCollection`&&(e=e.clone().transform(r,`EPSG:4326`));let a=0,o,s,c,l,u,d;switch(i){case`Point`:case`MultiPoint`:break;case`LineString`:case`LinearRing`:o=e.getCoordinates(),a=uw(o,n);break;case`MultiLineString`:case`Polygon`:for(o=e.getCoordinates(),c=0,l=o.length;c<l;++c)a+=uw(o[c],n);break;case`MultiPolygon`:for(o=e.getCoordinates(),c=0,l=o.length;c<l;++c)for(s=o[c],u=0,d=s.length;u<d;++u)a+=uw(s[u],n);break;case`GeometryCollection`:{let n=e.getGeometries();for(c=0,l=n.length;c<l;++c)a+=dw(n[c],t);break}default:throw Error(`Unsupported geometry type: `+i)}return a}function fw(e,t){let n=0,r=e.length,i=e[r-1][0],a=e[r-1][1];for(let t=0;t<r;t++){let r=e[t][0],o=e[t][1];n+=nw(r-i)*(2+Math.sin(nw(a))+Math.sin(nw(o))),i=r,a=o}return n*t*t/2}function pw(e,t){t||={};let n=t.radius||6371008.8,r=t.projection||`EPSG:3857`,i=e.getType();i!==`GeometryCollection`&&(e=e.clone().transform(r,`EPSG:4326`));let a=0,o,s,c,l,u,d;switch(i){case`Point`:case`MultiPoint`:case`LineString`:case`MultiLineString`:case`LinearRing`:break;case`Polygon`:for(o=e.getCoordinates(),a=Math.abs(fw(o[0],n)),c=1,l=o.length;c<l;++c)a-=Math.abs(fw(o[c],n));break;case`MultiPolygon`:for(o=e.getCoordinates(),c=0,l=o.length;c<l;++c)for(s=o[c],a+=Math.abs(fw(s[0],n)),u=1,d=s.length;u<d;++u)a-=Math.abs(fw(s[u],n));break;case`GeometryCollection`:{let n=e.getGeometries();for(c=0,l=n.length;c<l;++c)a+=pw(n[c],t);break}default:throw Error(`Unsupported geometry type: `+i)}return a}const mw={info:1,warn:2,error:3,none:4};let hw=mw.info;function gw(...e){hw>mw.warn||console.warn(...e)}function _w(e,t,n){let r=n===void 0?``+e:e.toFixed(n),i=r.indexOf(`.`);return i=i===-1?r.length:i,i>t?r:Array(1+t-i).join(`0`)+r}function vw(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function yw(e,t){let n=t.getRadius(),r=t.getCenter(),i=r[0],a=r[1],o=e[0],s=e[1],c=o-i,l=s-a;c===0&&l===0&&(c=1);let u=Math.sqrt(c*c+l*l);return[i+n*c/u,a+n*l/u]}function bw(e,t){let n=e[0],r=e[1],i=t[0],a=t[1],o=i[0],s=i[1],c=a[0],l=a[1],u=c-o,d=l-s,f=u===0&&d===0?0:(u*(n-o)+d*(r-s))/(u*u+d*d||0),p,m;return f<=0?(p=o,m=s):f>=1?(p=c,m=l):(p=o+f*u,m=s+f*d),[p,m]}function xw(e,t,n){let r=rw(t+180,360)-180,i=Math.abs(3600*r),a=n||0,o=Math.floor(i/3600),s=Math.floor((i-o*3600)/60),c=aw(i-o*3600-s*60,a);c>=60&&(c=0,s+=1),s>=60&&(s=0,o+=1);let l=o+`°`;return(s!==0||c!==0)&&(l+=` `+_w(s,2)+`′`),c!==0&&(l+=` `+_w(c,2,a)+`″`),r!==0&&(l+=` `+e.charAt(+(r<0))),l}function Sw(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Cw(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function ww(e,t){return e[0]*=t,e[1]*=t,e}function Tw(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Ew(e,t){return Math.sqrt(Tw(e,t))}function Dw(e,t){return Tw(e,bw(e,t))}function Ow(e,t){if(t.canWrapX()){let n=VC(t.getExtent()),r=kw(e,t,n);r&&(e[0]-=r*n)}return e}function kw(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n||=VC(r),i=Math.floor((e[0]-r[0])/n)),i}function Aw(e,t,n){let r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=[(t[0]-e[0])/r,(t[1]-e[1])/r],a=[-i[1],i[0]],o=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),s=[(n[0]-e[0])/o,(n[1]-e[1])/o],c=r===0||o===0?0:Math.acos(ZC(s[0]*i[0]+s[1]*i[1],-1,1));return c=Math.max(c,1e-5),s[0]*a[0]+s[1]*a[1]>0?c:Math.PI*2-c}const jw={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};var Mw=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global!==void 0&&e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||jw[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const Nw=6378137,Pw=Math.PI*Nw,Fw=[-Pw,-Pw,Pw,Pw],Iw=[-180,-85,180,85],Lw=Nw*Math.log(Math.tan(Math.PI/2));var Rw=class extends Mw{constructor(e){super({code:e,units:`m`,extent:Fw,global:!0,worldExtent:Iw,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Nw)}})}};const zw=[new Rw(`EPSG:3857`),new Rw(`EPSG:102100`),new Rw(`EPSG:102113`),new Rw(`EPSG:900913`),new Rw(`http://www.opengis.net/def/crs/EPSG/0/3857`),new Rw(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function Bw(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=Pw*e[n]/180;let r=Nw*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>Lw?r=Lw:r<-Lw&&(r=-Lw),t[n+1]=r}return t}function Vw(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/Pw,t[n+1]=360*Math.atan(Math.exp(e[n+1]/Nw))/Math.PI-90;return t}const Hw=[-180,-90,180,90],Uw=Math.PI*6378137/180;var Ww=class extends Mw{constructor(e,t){super({code:e,units:`degrees`,extent:Hw,axisOrientation:t,global:!0,metersPerUnit:Uw,worldExtent:Hw})}};const Gw=[new Ww(`CRS:84`),new Ww(`EPSG:4326`,`neu`),new Ww(`urn:ogc:def:crs:OGC:1.3:CRS84`),new Ww(`urn:ogc:def:crs:OGC:2:84`),new Ww(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new Ww(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new Ww(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)];let Kw={};function qw(e){return Kw[e]||Kw[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function Jw(e,t){Kw[e]=t}let Yw={};function Xw(e,t,n){let r=e.getCode(),i=t.getCode();r in Yw||(Yw[r]={}),Yw[r][i]=n}function Zw(e,t){return e in Yw&&t in Yw[e]?Yw[e][t]:null}const Qw=.9996,$w=.00669438,eT=$w/.99330562,tT=Math.sqrt(.99330562),nT=(1-tT)/(1+tT),rT=nT*nT,iT=rT*nT,aT=iT*nT,oT=aT*nT,sT=1-$w/4-.0001344441707532/64-15000339463446782e-22/256,cT=3/2*nT-27/32*iT+269/512*oT,lT=21/16*rT-55/32*aT,uT=151/96*iT-417/128*oT,dT=1097/512*aT,fT=6378137;function pT(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/Qw/(fT*sT),a=i+cT*Math.sin(2*i)+lT*Math.sin(4*i)+uT*Math.sin(6*i)+dT*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-$w*s,p=Math.sqrt(1-$w*s),m=fT/p,h=.99330562/f,g=eT*c**2,_=g*g,v=r/(m*Qw),y=v*v,b=y*v,x=b*v,S=x*v,C=S*v,w=a-l/h*(y/2-x/24*(5+3*u+10*g-4*_-9*eT))+C/720*(61+90*u+298*g+45*d-252*eT-3*_),T=(v-b/6*(1+2*u+g)+S/120*(5-2*g+28*u-3*_+8*eT+24*d))/c;return T=cw(T+nw(hT(n.number)),-Math.PI,Math.PI),[tw(T),tw(w)]}function mT(e,t,n){e=cw(e,-180,180),t<-80?t=-80:t>84&&(t=84);let r=nw(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=nw(e),u=nw(hT(n.number)),d=fT/Math.sqrt(1-$w*i**2),f=eT*a**2,p=a*cw(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=fT*(sT*r-.002514607064228144*Math.sin(2*r)+26390466021299826e-22*Math.sin(4*r)-3.418046101696858e-9*Math.sin(6*r)),b=Qw*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*eT))+5e5,x=Qw*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*eT)));return n.north||(x+=1e7),[b,x]}function hT(e){return(e-1)*6-180+3}const gT=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function _T(e){let t=0;for(let n of gT){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function vT(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function yT(e){return _T(e)?new Mw({code:e,units:`m`}):null}function bT(e){let t=_T(e.getCode());return t?{forward:vT(mT,t),inverse:vT(pT,t)}:null}const xT=[bT],ST=[yT];let CT=!0;function wT(e){CT=!(e===void 0||e)}function TT(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function ET(e,t){if(t!==void 0&&e!==t){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];e=t}return e}function DT(e){Jw(e.getCode(),e),Xw(e,e,TT)}function OT(e){e.forEach(DT)}function kT(e){if(typeof e!=`string`)return e;let t=qw(e);if(t)return t;for(let t of ST){let n=t(e);if(n)return n}return null}function AT(e,t,n,r){e=kT(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/jw[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=RT(e,kT(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(lw(e.slice(0,2),e.slice(2,4))+lw(e.slice(4,6),e.slice(6,8)))/2}let s=r?jw[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function jT(e){OT(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Xw(t,e,TT)})})}function MT(e,t,n,r){e.forEach(function(e){t.forEach(function(t){Xw(e,t,n),Xw(t,e,r)})})}function NT(e,t){return e?typeof e==`string`?kT(e):e:kT(t)}function PT(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function FT(e,t){return wT(),VT(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function IT(e,t){let n=VT(e,t===void 0?`EPSG:3857`:t,`EPSG:4326`),r=n[0];return(r<-180||r>180)&&(n[0]=rw(r+180,360)-180),n}function LT(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||RT(e,t)===TT)&&n}function RT(e,t){let n=e.getCode(),r=t.getCode(),i=Zw(n,r);if(i)return i;let a=null,o=null;for(let n of xT)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=Zw(s,r);e&&(i=zT(a.inverse,e))}else if(a)i=zT(a.inverse,o.forward);else{let e=Zw(n,s);e&&(i=zT(e,o.forward))}return i&&(DT(e),DT(t),Xw(e,t,i)),i}function zT(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function BT(e,t){return RT(kT(e),kT(t))}function VT(e,t,n){let r=BT(t,n);if(!r){let e=kT(t).getCode(),r=kT(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function HT(){return null}function UT(e,t){return e}function WT(e,t){return CT&&!Sw(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(CT=!1,gw(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e}function GT(e,t){return e}function KT(e,t){return e}function qT(e,t){return e}function JT(){jT(zw),jT(Gw),MT(Gw,zw,Bw,Vw)}JT();const YT=[1,0,0,1,0,0],XT=[,,,,,,];function ZT(){return YT.slice(0)}function QT(e){return eE(e,1,0,0,1,0,0)}function $T(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return e[0]=n*c+i*l,e[1]=r*c+a*l,e[2]=n*u+i*d,e[3]=r*u+a*d,e[4]=n*f+i*p+o,e[5]=r*f+a*p+s,e}function eE(e,t,n,r,i,a,o){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e}function tE(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function nE(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function rE(e,t){let n=Math.cos(t),r=Math.sin(t);return $T(e,eE(XT,n,r,-r,n,0,0))}function iE(e,t,n){return $T(e,eE(XT,t,0,0,n,0,0))}function aE(e,t,n){return $T(e,eE(XT,1,0,0,1,t,n))}function oE(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function sE(e,t){let n=cE(t);iC(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function cE(e){return e[0]*e[3]-e[1]*e[2]}const lE=[1e5,1e5,1e5,1e5,2,2];function uE(e){return`matrix(`+e.join(`, `)+`)`}function dE(e){return e.substring(7,e.length-1).split(`,`).map(parseFloat)}function fE(e,t){let n=dE(e),r=dE(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*lE[e])!==0)return!1;return!0}function pE(e,t,n,r,i,a,o){a||=[],o||=2;let s=0;for(let c=t;c<n;c+=r){let t=e[c],n=e[c+1];a[s++]=i[0]*t+i[2]*n+i[4],a[s++]=i[1]*t+i[3]*n+i[5];for(let t=2;t<o;t++)a[s++]=e[c+t]}return a&&a.length!=s&&(a.length=s),a}function mE(e,t,n,r,i,a,o){o||=[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function hE(e,t,n,r,i,a,o,s){s||=[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function gE(e,t,n,r,i,a,o){o||=[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}const _E=ZT(),vE=[NaN,NaN];var yE=class extends eC{constructor(){super(),this.extent_=_C(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=GS((e,t,n)=>{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return ZS()}closestPointXY(e,t,n,r){return ZS()}containsXY(e,t){return this.closestPointXY(e,t,vE,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t||=[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return ZS()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&yC(e),this.extentRevision_=this.getRevision()}return WC(this.extent_,e)}rotate(e,t){ZS()}scale(e,t,n){ZS()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return ZS()}getType(){return ZS()}applyTransform(e){ZS()}intersectsExtent(e){return ZS()}translate(e,t){ZS()}transform(e,t){let n=kT(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=IC(o)/IC(a);oE(_E,o[0],o[3],s,-s,0,0,0);let c=pE(e,0,e.length,i,_E,r),l=BT(n,t);return l?l(c,c,i):c}:BT(n,t);return this.applyTransform(r),this}},bE=class extends yE{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return xC(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return ZS()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=SE(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){ZS()}setLayout(e,t,n){let r;if(e)r=SE(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=xE(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith(`XYZ`)?3:2,this.stride),this.changed())}rotate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();mE(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||=MC(this.getExtent());let r=this.getFlatCoordinates();if(r){let i=this.getStride();hE(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();gE(n,0,n.length,r,e,t,n),this.changed()}}};function xE(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function SE(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function CE(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return pE(r,0,r.length,i,t,n)}function wE(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1],s=0,c=0;for(;t<n;t+=r){let n=e[t]-a,r=e[t+1]-o;i+=c*n-s*r,s=n,c=r}return i/2}function TE(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=wE(e,t,o,r),t=o}return i}function EE(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=TE(e,t,o,r),t=o[o.length-1]}return i}function DE(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=iw(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function OE(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=$C(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function kE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=OE(e,t,o,r,i),t=o}return i}function AE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=kE(e,t,o,r,i),t=o[o.length-1]}return i}function jE(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=$C(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u||=[NaN,NaN];let p=t+r;for(;p<n;)if(DE(e,p-r,p,r,o,s,u),f=$C(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(DE(e,n-r,t,r,o,s,u),f=$C(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}function ME(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=jE(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function NE(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=ME(e,t,f,r,i,a,o,s,c,l,u),t=f[f.length-1]}return l}function PE(e,t,n,r){for(let r=0,i=n.length;r<i;++r)e[t++]=n[r];return t}function FE(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function IE(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=FE(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function LE(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=IE(e,t,n[o],r,i[a]);s.length===0&&(s[0]=t),i[a++]=s,t=s[s.length-1]}return i.length=a,i}function RE(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function zE(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=RE(e,t,s,r,i[a]),t=s}return i.length=a,i}function BE(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:zE(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function VE(e,t,n,r,i){return!OC(i,function(i){return!HE(e,t,n,r,i[0],i[1])})}function HE(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function UE(e,t,n,r,i,a){if(n.length===0||!HE(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(HE(e,n[t-1],n[t],r,i,a))return!1;return!0}function WE(e,t,n,r,i,a){if(n.length===0)return!1;for(let o=0,s=n.length;o<s;++o){let s=n[o];if(UE(e,t,s,r,i,a))return!0;t=s[s.length-1]}return!1}function GE(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function KE(e,t){let[n,r]=e,[i,a]=t,o=((n[0]-i[0])*(i[1]-a[1])-(n[1]-i[1])*(i[0]-a[0]))/((n[0]-r[0])*(i[1]-a[1])-(n[1]-r[1])*(i[0]-a[0])),s=((n[0]-i[0])*(n[1]-r[1])-(n[1]-i[1])*(n[0]-r[0]))/((n[0]-r[0])*(i[1]-a[1])-(n[1]-r[1])*(i[0]-a[0]));if(0<=o&&o<=1&&0<=s&&s<=1)return[n[0]+o*(r[0]-n[0]),n[1]+o*(r[1]-n[1])]}function qE(e,t,n,r,i,a){return a??=EC(_C(),e,t,n,r),HC(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]||GE(e,t,n,r,function(e,t){return KC(i,e,t)}):!1}function JE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){if(qE(e,t,n[a],r,i))return!0;t=n[a]}return!1}function YE(e,t,n,r,i){return!!(qE(e,t,n,r,i)||HE(e,t,n,r,i[0],i[1])||HE(e,t,n,r,i[0],i[3])||HE(e,t,n,r,i[2],i[1])||HE(e,t,n,r,i[2],i[3]))}function XE(e,t,n,r,i){if(!YE(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(VE(e,n[t-1],n[t],r,i)&&!qE(e,n[t-1],n[t],r,i))return!1;return!0}function ZE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(XE(e,t,o,r,i))return!0;t=o[o.length-1]}return!1}function QE(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=e[t],r=e[t+1],i=QC(n,r,s,d,f,p);i>o&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function $E(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=QE(e,t,l,r,i,a,o),s.push(o),t=l}return o}function eD(e,t){return t*Math.round(e/t)}function tD(e,t,n,r,i,a,o){if(t==n)return o;let s=eD(e[t],i),c=eD(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=eD(e[t],i),u=eD(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=eD(e[t],i),d=eD(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;if(f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function nD(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=tD(e,t,l,r,i,a,o),s.push(o),t=l}return o}function rD(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c],u=[];o=nD(e,t,l,r,i,a,o,u),s.push(u),t=l[l.length-1]}return o}var iD=class e extends bE{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(OE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return wE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return RE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=QE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return qE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=FE(this.flatCoordinates,0,e,this.stride),this.changed()}},aD=class e extends bE{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=$C(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return bC(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return hC(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||=[],this.flatCoordinates.length=PE(this.flatCoordinates,0,e,this.stride),this.changed()}};function oD(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m=i[a+1],h=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(u=e[a-r],f=e[a-r+1],s=t;s<a;s+=r)d=e[s],p=e[s+1],(m<=f&&p<=m||f<=m&&m<=p)&&(l=(m-f)/(p-f)*(d-u)+u,h.push(l)),u=d,f=p}let g=NaN,_=-1/0;for(h.sort(FS),u=h[0],s=1,c=h.length;s<c;++s){d=h[s];let i=Math.abs(d-u);i>_&&(l=(u+d)/2,UE(e,t,n,r,l,m)&&(g=l,_=i)),u=d}return isNaN(g)&&(g=i[a]),o?(o.push(g,m,_),o):[g,m,_]}function sD(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=oD(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function cD(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function lD(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function uD(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=lD(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function dD(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(!uD(e,t,o,r,i))return!1;o.length&&(t=o[o.length-1])}return!0}function fD(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=lD(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&cD(e,t,o,r),t=o}return t}function pD(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=fD(e,t,n[a],r,i);return t}function mD(e,t){let n=[],r=0,i=0,a;for(let o=0,s=t.length;o<s;++o){let s=t[o],c=lD(e,r,s,2);if(a===void 0&&(a=c),c===a)n.push(t.slice(i,o+1));else{if(n.length===0)continue;n[n.length-1].push(t[i])}i=o+1,r=s}return n}var hD=class e extends bE{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?zS(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(kE(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ME(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return UE(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return TE(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),fD(t,0,this.ends_,this.stride,e)),zE(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=MC(this.getExtent());this.flatInteriorPoint_=oD(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new aD(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new iD(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new iD(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;uD(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=fD(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=nD(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return XE(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=IE(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function gD(e){if(UC(e))throw Error(`Cannot create polygon from empty extent`);let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new hD(a,`XY`,[a.length])}function _D(e,t,n){t||=32;let r=e.getStride(),i=e.getLayout(),a=e.getCenter(),o=r*(t+1),s=Array(o);for(let e=0;e<o;e+=r){s[e]=0,s[e+1]=0;for(let t=2;t<r;t++)s[e+t]=a[t]}let c=new hD(s,i,[s.length]);return vD(c,a,e.getRadius(),n),c}function vD(e,t,n,r){let i=e.getFlatCoordinates(),a=e.getStride(),o=i.length/a-1,s=r||0;for(let e=0;e<=o;++e){let r=e*a,c=s+rw(e,o)*2*Math.PI/o;i[r]=t[0]+n*Math.cos(c),i[r+1]=t[1]+n*Math.sin(c)}e.changed()}var yD={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};const bD=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``,xD=bD.includes(`safari`)&&!bD.includes(`chrom`)&&(bD.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(bD)),SD=bD.includes(`webkit`)&&!bD.includes(`edge`),CD=bD.includes(`macintosh`),wD=typeof devicePixelRatio<`u`?devicePixelRatio:1,TD=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,ED=typeof Image<`u`&&Image.prototype.decode,DD=(function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})();function OD(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[jS(r,q.LOAD,function(){o=!0,a||t()})];return r.src&&ED?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(jS(r,q.ERROR,n)),function(){i=!1,s.forEach(MS)}}function kD(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function AD(e,t){return t&&(e.src=t),e.src&&ED?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):kD(e)}var Y={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function jD(e){return e**3}function MD(e){return 1-jD(1-e)}function ND(e){return 3*e*e-2*e*e*e}function PD(e){return e}var FD=class extends JS{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(q.CHANGE)}release(){this.setState(Y.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==Y.EMPTY){if(this.state!==Y.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){ZS()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:jD(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}};function ID(e,t,n,r){let i;return i=n&&n.length?n.shift():TD?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}let LD;function RD(){return LD||=ID(1,1),LD}function zD(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function BD(e){let t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),t}function VD(e){let t=e.offsetHeight,n=getComputedStyle(e);return t+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),t}function HD(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function UD(e){for(;e.lastChild;)e.lastChild.remove()}function WD(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;if(i!==a){if(!i){e.appendChild(a);continue}if(!a){e.removeChild(i),--r;continue}e.insertBefore(a,i)}}}function GD(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){let t=this.childNodes.indexOf(e);if(t===-1)throw Error(`Node to remove was not found`);return this.childNodes.splice(t,1),e},insertBefore:function(e,t){let n=this.childNodes.indexOf(t);if(n===-1)throw Error(`Reference node not found`);return this.childNodes.splice(n,0,e),e},style:{}},{get(e,t,n){return t===`firstElementChild`?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,n)}})}function KD(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas}var qD=class extends FD{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=n,this.key=n,this.image_,TD?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=Y.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=Y.ERROR,this.unlistenImage_(),this.image_=JD(),this.changed()}handleImageLoad_(){if(TD)this.state=Y.LOADED;else{let e=this.image_;this.state=e.naturalWidth&&e.naturalHeight?Y.LOADED:Y.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==Y.ERROR&&(this.state=Y.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==Y.IDLE&&(this.state=Y.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=OD(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function JD(){let e=ID(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var YD=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}};function XD(e,t,n,r,i,a,o){let s,c,l=(n-t)/r;if(l===1)s=t;else if(l===2)s=t,c=i;else if(l!==0){let a=e[t],o=e[t+1],l=0,u=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];l+=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),u.push(l),a=t,o=n}let d=i*l,f=PS(u,d);f<0?(c=(d-u[-f-2])/(u[-f-1]-u[-f-2]),s=t+(-f-2)*r):s=t+f*r}o=o>1?o:2,a||=Array(o);for(let t=0;t<o;++t)a[t]=s===void 0?NaN:c===void 0?e[s+t]:iw(e[s+t],e[s+r+t],c);return a}function ZD(e,t,n,r,i,a){if(n==t)return null;let o;if(i<e[t+r-1])return a?(o=e.slice(t,t+r),o[r-1]=i,o):null;if(e[n-1]<i)return a?(o=e.slice(n-r,n),o[r-1]=i,o):null;if(i==e[t+r-1])return e.slice(t,t+r);let s=t/r,c=n/r;for(;s<c;){let t=s+c>>1;i<e[(t+1)*r-1]?c=t:s=t+1}let l=e[s*r-1];if(i==l)return e.slice((s-1)*r,(s-1)*r+r);let u=e[(s+1)*r-1],d=(i-l)/(u-l);o=[];for(let t=0;t<r-1;++t)o.push(iw(e[(s-1)*r+t],e[s*r+t],d));return o.push(i),o}function QD(e,t,n,r,i,a,o){if(o)return ZD(e,t,n[n.length-1],r,i,a);let s;if(i<e[r-1])return a?(s=e.slice(0,r),s[r-1]=i,s):null;if(e[e.length-1]<i)return a?(s=e.slice(e.length-r),s[r-1]=i,s):null;for(let a=0,o=n.length;a<o;++a){let o=n[a];if(t!=o){if(i<e[t+r-1])return null;if(i<=e[o-1])return ZD(e,t,o,r,i,!1);t=o}}return null}function $D(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}var eO=class e extends bE{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){zS(this.flatCoordinates,e),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(OE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,n,r))}forEachSegment(e){return GE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!=`XYM`&&this.layout!=`XYZM`?null:(t=t!==void 0&&t,ZD(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return RE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return XD(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return $D(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){let n=[];return n.length=QE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LineString`}intersectsExtent(e){return qE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=FE(this.flatCoordinates,0,e,this.stride),this.changed()}};function tO(e,t,n){let r=[],i=e(0),a=e(1),o=t(i),s=t(a),c=[a,i],l=[s,o],u=[1,0],d={},f=1e5,p,m,h,g,_,v;for(;--f>0&&u.length>0;)h=u.pop(),i=c.pop(),o=l.pop(),v=h.toString(),v in d||(r.push(o[0],o[1]),d[v]=!0),g=u.pop(),a=c.pop(),s=l.pop(),_=(h+g)/2,p=e(_),m=t(p),QC(m[0],m[1],o[0],o[1],s[0],s[1])<n?(r.push(s[0],s[1]),v=g.toString(),d[v]=!0):(u.push(g,_,_,h),l.push(s,m,m,o),c.push(a,p,p,i));return r}function nO(e,t,n,r,i){return tO(function(r){return[e,t+(n-t)*r]},BT(kT(`EPSG:4326`),r),i)}function rO(e,t,n,r,i){return tO(function(r){return[t+(n-t)*r,e]},BT(kT(`EPSG:4326`),r),i)}const iO=[NaN,NaN,NaN,0];let aO;function oO(){return aO||=ID(1,1,void 0,{willReadFrequently:!0,desynchronized:!0}),aO}const sO=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,cO=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,lO=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,uO=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function dO(e,t){return e.endsWith(`%`)?Number(e.substring(0,e.length-1))/t:Number(e)}function fO(e){throw Error(`failed to parse "`+e+`" as color`)}function pO(e){if(e.toLowerCase().startsWith(`rgb`)){let t=e.match(cO)||e.match(sO)||e.match(lO);if(t){let e=t[4],n=100/255;return[ZC(dO(t[1],n)+.5|0,0,255),ZC(dO(t[2],n)+.5|0,0,255),ZC(dO(t[3],n)+.5|0,0,255),e===void 0?1:ZC(dO(e,100),0,1)]}fO(e)}if(e.startsWith(`#`)){if(uO.test(e)){let t=e.substring(1),n=t.length<=4?1:2,r=[0,0,0,255];for(let e=0,i=t.length;e<i;e+=n){let i=parseInt(t.substring(e,e+n),16);n===1&&(i+=i<<4),r[e/n]=i}return r[3]/=255,r}fO(e)}let t=oO();t.fillStyle=`#abcdef`;let n=t.fillStyle;t.fillStyle=e,t.fillStyle===n&&(t.fillStyle=`#fedcba`,n=t.fillStyle,t.fillStyle=e,t.fillStyle===n&&fO(e));let r=t.fillStyle;if(r.startsWith(`#`)||r.startsWith(`rgba`))return pO(r);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let i=Array.from(t.getImageData(0,0,1,1).data);return i[3]=aw(i[3]/255,3),i}function mO(e){return typeof e==`string`?e:EO(e)}const hO={};let gO=0;function _O(e){if(e.length===4)return e;let t=e.slice();return t[3]=1,t}function vO(e){return e>.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function yO(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function bO(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function xO(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function SO(e){let t=bO(e[0]),n=bO(e[1]),r=bO(e[2]),i=xO(t*.222488403+n*.716873169+r*.06060791),a=500*(xO(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-xO(t*.016863605+n*.117638439+r*.865350722)),s=180/Math.PI*Math.atan2(o,a);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function CO(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=yO(t),a=yO(t+n/500*Math.cos(r)),o=yO(t-n/200*Math.sin(r)),s=vO(a*3.021973625-i*1.617392459-o*.404875592),c=vO(a*-.943766287+i*1.916279586+o*.027607165),l=vO(a*.069407491-i*.22898585+o*1.159737864);return[ZC(s+.5|0,0,255),ZC(c+.5|0,0,255),ZC(l+.5|0,0,255),e[3]]}function wO(e){if(e===`none`)return iO;if(hO.hasOwnProperty(e))return hO[e];if(gO>=1024){let e=0;for(let t in hO)e++&3||(delete hO[t],--gO)}let t=pO(e);t.length!==4&&fO(e);for(let n of t)isNaN(n)&&fO(e);return hO[e]=t,++gO,t}function TO(e){return Array.isArray(e)?e:wO(e)}function EO(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}var DO=class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t){let n=OO(e,t);return n in this.cache_?this.cache_[n]:null}getPattern(e,t){let n=OO(e,t);return n in this.patternCache_?this.patternCache_[n]:null}set(e,t,n,r){let i=OO(e,t),a=i in this.cache_;this.cache_[i]=n,r&&(n.getImageState()===yD.IDLE&&n.load(),n.getImageState()===yD.LOADING?n.ready().then(()=>{this.patternCache_[i]=RD().createPattern(n.getImage(1),`repeat`)}):this.patternCache_[i]=RD().createPattern(n.getImage(1),`repeat`)),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function OO(e,t){let n=t?TO(t):`null`;return e+`:`+n}const kO=new DO;let AO=null;var jO=class extends JS{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n?.crossOrigin,this.referrerPolicy_=n?.referrerPolicy,this.canvas_={},this.color_=i,this.imageState_=r===void 0?yD.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===yD.LOADED){AO||=ID(1,1,void 0,{willReadFrequently:!0}),AO.drawImage(this.image_,0,0);try{AO.getImageData(0,0,1,1),this.tainted_=!1}catch{AO=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(q.CHANGE)}handleImageError_(){this.imageState_=yD.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=yD.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}setImage(e){this.image_=e}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_){if(this.isTainted_()){let e=this.size_[0],t=this.size_[1],n=ID(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_}return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===yD.IDLE){this.image_||this.initializeImage_(),this.imageState_=yD.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&AD(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==yD.LOADED)return;let t=this.image_,n=ID(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=mO(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||=new Promise(e=>{if(this.imageState_===yD.LOADED||this.imageState_===yD.ERROR)e();else{let t=()=>{(this.imageState_===yD.LOADED||this.imageState_===yD.ERROR)&&(this.removeEventListener(q.CHANGE,t),e())};this.addEventListener(q.CHANGE,t)}}),this.ready_}};function MO(e,t,n,r,i,a){let o=t===void 0?void 0:kO.get(t,i);return o||(o=new jO(e,e&&`src`in e?e.src||void 0:t,n,r,i),kO.set(t,i,o,a)),a&&o&&!kO.getPattern(t,i)&&kO.set(t,i,o,a),o}function NO(e){return e?Array.isArray(e)?EO(e):typeof e==`object`&&`src`in e?PO(e):e:null}function PO(e){if(!e.offset||!e.size)return kO.getPattern(e.src,e.color);let t=e.src+`:`+e.offset,n=kO.getPattern(t,e.color);if(n)return n;let r=kO.get(e.src,null);if(r.getImageState()!==yD.LOADED)return null;let i=ID(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),MO(i.canvas,t,void 0,yD.LOADED,e.color,!0),kO.getPattern(t,e.color)}function FO(e,t,n,r,i,a,o,s){o??=[],s??=r;let c=e[t+r],l=e[t+r+1],u=e[n-2*r],d=e[n-2*r+1],f,p,m,h,g,_,v,y,b=0;for(let x=t;x<n;x+=r){m=f,h=p,g=void 0,_=void 0,x+r<n&&(g=e[x+r],_=e[x+r+1]),a&&x===t&&(m=u,h=d),a&&x===n-r&&(g=c,_=l),f=e[x],p=e[x+1],[v,y]=IO(f,p,m,h,g,_,i),o[b++]=v,o[b++]=y;for(let t=2;t<s;t++)o[b++]=e[x+t]}return o.length!=b&&(o.length=b),o}function IO(e,t,n,r,i,a,o){let s,c;n!==void 0&&r!==void 0?(s=e-n,c=t-r):i!==void 0&&a!==void 0?(s=i-e,c=a-t):(s=1,c=0);let l=Math.hypot(s,c),u=s/l,d=c/l;if(s=-d,c=u,n===void 0||r===void 0||i===void 0||a===void 0)return[e+s*o,t+c*o];let f=Aw([e,t],[n,r],[i,a]);if(Math.cos(f)>.998)return[e+u*o,t+d*o];let p=Math.cos(f/2),m=Math.sin(f/2),h=m*s+p*c,g=-p*s+m*c,_=1/m*h,v=1/m*g;return[e+_*o,t+v*o]}function LO(e,t,n=!1){for(let r=0,i=e.length-2;r<i;r+=t){let i=n&&r===0?e.length-3*t:e.length-2*t;for(let n=i;n>r+t;n-=t){let i=e[r],a=e[r+1],o=e[r+t],s=e[r+t+1],c=e[n],l=e[n+1],u=e[n+t],d=e[n+t+1],f=(d-l)*(o-i)-(u-c)*(s-a);if(f===0)continue;let p=((u-c)*(a-l)-(d-l)*(i-c))/f,m=((o-i)*(a-l)-(s-a)*(i-c))/f;if(p>0&&p<1&&m>0&&m<1){let c=i+p*(o-i),l=a+p*(s-a);e[r+t]=c,e[r+t+1]=l,e.splice(r+2*t,n-r-t);break}}}return e}var RO=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}};const zO=`ol-hidden`,BO=`ol-unsupported`,VO=`ol-collapsed`,HO=new RegExp([`^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)`,`(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?`,`(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))`,`(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))`,`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(``),`i`),UO=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],WO={normal:400,bold:700},GO=function(e){let t=e.match(HO);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=UO.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[UO[e]]=typeof r==`string`?r.trim():r)}return isNaN(Number(n.weight))&&n.weight in WO&&(n.weight=WO[n.weight]),n.families=n.family.split(/,\s?/).map(e=>e.trim().replace(/^['"]|['"]$/g,``)),n},KO=`#000`,qO=`round`,JO=[],YO=`round`,XO=`#000`,ZO=`center`,QO=[0,0,0,0],$O=new eC;let ek=null,tk;const nk={},rk=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function ik(e,t,n){return`${e} ${t} 16px "${n}"`}const ak=(function(){let e,t;async function n(e){await t.ready;let n=GO(e),r=n.families[0].toLowerCase(),i=n.weight,a=[];return t.forEach(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),o=WO[e.weight]||e.weight;t===r&&e.style===n.style&&o==i&&a.push(e)}),a.length!==0&&(await Promise.all(a.map(e=>e.load().then(()=>!0,()=>!1)))).some(e=>e)}async function r(){await t.ready;let i=!0,a=$O.getProperties(),o=Object.keys(a).filter(e=>a[e]<100);for(let e=o.length-1;e>=0;--e){let t=o[e],r=a[t];r<100&&(await n(t)?(OS(nk),$O.set(t,100)):(r+=10,$O.set(t,r,!0),r<100&&(i=!1)))}e=void 0,i||(e=setTimeout(r,100))}return async function(n){t||=TD?self.fonts:document.fonts;let i=GO(n);if(!i)return;let a=i.families,o=!1;for(let e of a){if(rk.has(e))continue;let t=ik(i.style,i.weight,e);$O.get(t)===void 0&&($O.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}})(),ok=(function(){let e;return function(t){let n=nk[t];if(n==null){if(TD){let e=GO(t),r=sk(t,`Žg`);n=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);nk[t]=n}return n}})();function sk(e,t){return ek||=ID(1,1),e!=tk&&(ek.font=e,tk=ek.font),ek.measureText(t)}function ck(e,t){return sk(e,t).width}function lk(e,t,n){if(t in n)return n[t];let r=t.split(`
|
|
31
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function l_(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}const u_=(e,t)=>Math.abs(e-t)<1.01,d_=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}};let f_;const p_=()=>{if(f_!==void 0)return f_;if(typeof navigator>`u`)return f_=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f_=!0;let e=navigator.maxTouchPoints;return f_=navigator.platform===`MacIntel`&&e!==void 0&&e>0},m_=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},h_=e=>e,g_=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},__=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(m_(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(m_(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},v_={passive:!0},y_=typeof window>`u`||`onscrollend`in window,b_=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&y_,o=0,s=a?null:d_(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,v_),a&&r.addEventListener(`scrollend`,u,v_),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},x_=(e,t)=>b_(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),S_=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},C_=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};var w_=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:h_,rangeExtractor:g_,onChange:()=>{},measureElement:S_,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=c_(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:process.env.NODE_ENV!==`production`&&`maybeNotify`,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!p_()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,v_),e.addEventListener(`touchend`,n,v_),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(p_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=c_(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=c_(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=s_(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!==`production`&&`getMeasurements`,debug:()=>this.options.debug}),this.calculateRange=c_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=D_(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:process.env.NODE_ENV!==`production`&&`calculateRange`,debug:()=>this.options.debug}),this.getVirtualIndexes=c_(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:process.env.NODE_ENV!==`production`&&`getVirtualIndexes`,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=c_(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:process.env.NODE_ENV!==`production`&&`getVirtualItems`,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return l_(t[T_(0,t.length-1,r?e=>n[e*2]:e=>l_(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e!==0&&(process.env.NODE_ENV!==`production`&&this.options.debug&&console.info(`correction`,e),p_()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&u_(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}};const T_=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function E_(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function D_(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=E_(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=T_(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}const O_=typeof document<`u`?u.useLayoutEffect:u.useEffect;function k_({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=u.useReducer(e=>e+1,0)[1],a=u.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,d.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=u.useState(()=>{let e=new w_(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),O_(()=>l._didMount(),[]),O_(()=>(o(l),l._willUpdate())),O_(()=>{s(l)}),l}function A_(e){return k_({observeElementRect:__,observeElementOffset:x_,scrollToFn:C_,...e})}const j_={root:`filtered-action-list-input`};function M_(e){let{inputRef:t,value:n,onInputChange:r,onInputKeyDown:i,placeholderText:a,listId:o,inputDescriptionId:s,loading:c=!1,...l}=e;return(0,W.jsx)(`div`,{className:j_.root,"data-component":`FilteredActionList.Header`,children:(0,W.jsx)(Qo,{ref:t,block:!0,value:n,onChange:r,onKeyDown:i,placeholder:a,role:`combobox`,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-controls":o,"aria-label":a,"aria-describedby":s,loading:c,loaderPosition:`leading`,...l})})}M_.displayName=`FilteredActionList.Input`;const N_=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,W.jsx)(e,{});function P_(e,t){if(typeof e.renderItem==`function`)return e.renderItem(e);let{id:n,text:r,description:i,descriptionVariant:a,leadingVisual:o,trailingVisual:s,onAction:c,children:l,groupId:u,renderItem:d,...f}=e;return(0,W.jsxs)(Fi.Item,{ref:t,role:`option`,onSelect:t=>c?.(e,t),"data-id":n,...f,children:[o?(0,W.jsx)(Fi.LeadingVisual,{children:(0,W.jsx)(o,{})}):null,l,r,i?(0,W.jsx)(Fi.Description,{variant:a,children:i}):null,s?(0,W.jsx)(Fi.TrailingVisual,{children:N_(s)}):null]})}P_.displayName=`FilteredActionList.Item`;var F_=U(P_);const I_=V(`stack`,{variants:{gap:{none:`stack-gap-none`,tight:`stack-gap-tight`,condensed:`stack-gap-condensed`,cozy:`stack-gap-cozy`,normal:`stack-gap-normal`,spacious:`stack-gap-spacious`},direction:{horizontal:`stack-horizontal`,vertical:`stack-vertical`},align:{stretch:`stack-align-stretch`,start:`stack-align-start`,center:`stack-align-center`,end:`stack-align-end`,baseline:`stack-align-baseline`},wrap:{wrap:`stack-wrap`,nowrap:`stack-nowrap`},justify:{start:`stack-justify-start`,center:`stack-justify-center`,end:`stack-justify-end`,"space-between":`stack-justify-space-between`,"space-evenly":`stack-justify-space-evenly`},padding:{none:`stack-padding-none`,tight:`stack-padding-tight`,condensed:`stack-padding-condensed`,cozy:`stack-padding-cozy`,normal:`stack-padding-normal`,spacious:`stack-padding-spacious`},paddingBlock:{none:`stack-padding-block-none`,tight:`stack-padding-block-tight`,condensed:`stack-padding-block-condensed`,cozy:`stack-padding-block-cozy`,normal:`stack-padding-block-normal`,spacious:`stack-padding-block-spacious`},paddingInline:{none:`stack-padding-inline-none`,tight:`stack-padding-inline-tight`,condensed:`stack-padding-inline-condensed`,cozy:`stack-padding-inline-cozy`,normal:`stack-padding-inline-normal`,spacious:`stack-padding-inline-spacious`}}});function L_(e,t){let{as:n=`div`,className:r,gap:i,direction:a=`vertical`,align:o=`stretch`,wrap:s=`nowrap`,justify:c=`start`,padding:l=`none`,paddingBlock:u,paddingInline:d,...f}=e;return(0,W.jsx)(n,{ref:t,className:H(I_({gap:i,direction:a,align:o,wrap:s,justify:c,padding:l,paddingBlock:u,paddingInline:d}),r),"data-component":`Stack`,"data-gap":i,"data-direction":a,"data-align":o,"data-wrap":s,"data-justify":c,"data-padding":l,"data-padding-block":u,"data-padding-inline":d,...f})}L_.displayName=`Stack`;var R_=U(L_);const z_=V(`stack-item`,{variants:{grow:{true:`stack-item-grow`,false:`stack-item-no-grow`},shrink:{true:`stack-item-shrink`,false:`stack-item-no-shrink`}}});function B_(e,t){let{as:n=`div`,className:r,grow:i,shrink:a,...o}=e;return(0,W.jsx)(n,{ref:t,className:H(z_({grow:i,shrink:a}),r),"data-component":`StackItem`,"data-grow":i,"data-shrink":a,...o})}B_.displayName=`StackItem`;var V_=U(B_);const H_=Object.assign(R_,{Item:V_}),U_={spinner:`filtered-action-list-spinner`,skeleton:`filtered-action-list-skeleton`},W_=[`80%`,`52.5%`,`67.5%`,`40%`,`72.5%`];function G_(e){let{loadingType:t,height:n=0,className:r,...i}=e;if(t===`input`)return null;if(t===`body-skeleton`){let e=Math.max(Math.floor(n/24),3);return(0,W.jsx)(H_,{gap:`condensed`,justify:`center`,className:H(U_.skeleton,r),"data-component":`FilteredActionList.Skeleton`,...i,children:Array.from({length:e},(e,t)=>(0,W.jsxs)(H_,{direction:`horizontal`,gap:`condensed`,align:`center`,children:[(0,W.jsx)(rh,{width:`16px`,height:`16px`}),(0,W.jsx)(rh,{width:W_[t%W_.length],height:`10px`})]},t))})}return(0,W.jsx)(`div`,{className:H(U_.spinner,r),"data-component":`FilteredActionList.Spinner`,...i,children:(0,W.jsx)(ri,{})})}G_.displayName=`FilteredActionList.BodyLoader`;const K_=({items:e,enabled:t=!0,loading:n=!1,messageText:r})=>{let[i,a]=l.useState(``),o=e.length,s=e.filter(e=>e.selected).length,c=o===0&&!n,u=r?`${r.title}. ${r.description}`:``,d=c?u:`${o} item${o===1?``:`s`} available, ${s} selected.`,f=l.useRef(d);return l.useEffect(()=>{if(!t||d===f.current)return;f.current=d;let e=window.setTimeout(()=>a(d),500);return()=>{window.clearTimeout(e)}},[t,d]),t?i:``},q_={root:`filtered-action-list`,container:`filtered-action-list-container`,list:`filtered-action-list-list`,message:`filtered-action-list-message`,virtualList:`filtered-action-list-virtual-list`,virtualItem:`filtered-action-list-virtual-item`,selectAll:`filtered-action-list-select-all`,selectAllLabel:`filtered-action-list-select-all-label`,hidden:`sr-only`},J_=(e,t)=>e.key??e.id?.toString()??t.toString();function Y_(e){let{items:t,groupMetadata:n,filterValue:r,onFilterChange:i,placeholderText:a,loading:o=!1,loadingType:s=`body-spinner`,message:c,messageText:u,selectionVariant:d,showItemDividers:f,onSelectAllChange:p,renderItem:m,announcementsEnabled:h=!0,virtualized:g=!1,textInputProps:_,actionListProps:v,inputRef:y,scrollContainerRef:b,onListContainerRefChanged:x,onInputRefChanged:S,className:C}=e,w=r!==void 0,[T,E]=l.useState(``),D=w?r:T,O=l.useRef(null),k=R(y,O),A=l.useRef(null),j=R(b,A),M=l.useRef(null),N=l.useCallback(e=>{M.current=e,x?.(e)},[x]);l.useEffect(()=>{S?.(O)},[S]);let P=o&&s!==`input`,[F,I]=l.useState(0);Wi(()=>{let e=A.current;if(!e||!P)return;let t=()=>I(e.clientHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[P]);let L=K(v?.id),ee=K(),te=K(),ne=g&&!n?.length,re=A_({count:t.length,getScrollElement:()=>A.current,estimateSize:()=>32,overscan:10,enabled:ne,getItemKey:e=>{let n=t[e];return n?J_(n,e):e.toString()},measureElement:e=>e.scrollHeight}),ie=ne?re.getVirtualItems():void 0,[ae,oe]=l.useState(null);l.useEffect(()=>{if(ae===null)return;let e=M.current?.querySelector(`[data-index="${ae}"]`);e&&(e.focus(),oe(null))},[ae,ie]);let se=l.useCallback(e=>{if(!(e<0||e>=t.length)){if(ne){re.scrollToIndex(e,{align:`auto`}),oe(e);return}(M.current?.querySelectorAll(`[role="option"]`))?.[e]?.focus()}},[ne,t.length,re]),ce=l.useCallback(e=>t.filter(t=>t.groupId===e),[t]),le=n?.length?n.map(e=>ce(e.groupId)[0]).find(Boolean):t[0],ue=e=>{let{value:t}=e.target;w||E(t),i(t,e)},de=e=>{if(e.key===`ArrowDown`){e.preventDefault(),se(0);return}e.key===`Enter`&&le?.onAction&&(e.preventDefault(),le.onAction(le,e))},fe=e=>{if(!ne||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let n=e.target.closest(`[data-index]`),r=n?Number(n.dataset.index):-1,i=e.key===`ArrowDown`?r+1:e.key===`ArrowUp`?r-1:e.key===`Home`?0:e.key===`End`?t.length-1:null;i!==null&&(e.preventDefault(),se(i))},pe=t.length>0&&t.every(e=>e.selected),me=!pe&&t.some(e=>e.selected),he=K_({items:t,enabled:h,loading:o,messageText:u}),ge=l.useMemo(()=>({container:`FilteredActionList`,listRole:`listbox`,selectionAttribute:`aria-selected`,enableFocusZone:!ne}),[ne]),_e=()=>n?.length?n.map(e=>(0,W.jsxs)(Fi.Group,{children:[(0,W.jsx)(Fi.GroupHeading,{variant:e.header?.variant,children:e.header?.title??`Group ${e.groupId}`}),ce(e.groupId).map((e,t)=>(0,l.createElement)(F_,{...e,key:J_(e,t),renderItem:e.renderItem??m}))]},e.groupId)):ie?ie.map(e=>{let n=t[e.index];return(0,l.createElement)(F_,{...n,key:e.key,ref:re.measureElement,renderItem:n.renderItem??m,"data-index":e.index,className:H(q_.virtualItem,n.className),style:{...n.style,transform:`translateY(${e.start}px)`}})}):t.map((e,t)=>(0,l.createElement)(F_,{...e,key:J_(e,t),renderItem:e.renderItem??m})),ve=()=>P?(0,W.jsx)(G_,{loadingType:s,height:F}):c?(0,W.jsx)(`div`,{className:q_.message,"data-component":`FilteredActionList.Message`,children:c}):(0,W.jsx)(Pr.Provider,{value:ge,children:(0,W.jsx)(Fi,{ref:N,id:L,selectionVariant:d,showDividers:f,...v,className:H(q_.list,ne&&q_.virtualList,v?.className),style:ne?{...v?.style,height:re.getTotalSize()}:v?.style,children:_e()})});return(0,W.jsxs)(`div`,{className:H(q_.root,C),"data-component":`FilteredActionList`,"data-virtualized":ne?``:void 0,children:[(0,W.jsx)(M_,{inputRef:k,value:D,onInputChange:ue,onInputKeyDown:de,placeholderText:a,listId:L,inputDescriptionId:ee,loading:o&&s===`input`,..._}),(0,W.jsx)(`span`,{id:ee,className:q_.hidden,children:`Items will be filtered as you type`}),p?(0,W.jsxs)(`div`,{className:q_.selectAll,"data-component":`FilteredActionList.SelectAll`,children:[(0,W.jsx)(sd,{id:te,checked:pe,indeterminate:me,onChange:e=>p(e.target.checked),"data-component":`FilteredActionList.SelectAllCheckbox`}),(0,W.jsx)(`label`,{htmlFor:te,className:q_.selectAllLabel,children:pe?`Deselect all`:`Select all`})]}):null,(0,W.jsx)(`div`,{ref:j,className:q_.container,onKeyDown:fe,"data-component":`FilteredActionList.Container`,children:ve()}),(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:q_.hidden,"data-component":`FilteredActionList.Announcement`,children:he})]})}Y_.displayName=`FilteredActionList`;const X_=Object.assign(Y_,{Input:M_,Item:F_,BodyLoader:G_}),Z_={width:320,height:240},Q_={x:24,y:24},$_={width:200,height:120},ev=(e,t,n)=>Math.min(Math.max(e,t),n),tv=(e,t)=>t&&t>0?Math.round(e/t)*t:e,nv=(e,t,n)=>({width:ev(e.width,t.width,Math.max(t.width,n?.width??1/0)),height:ev(e.height,t.height,Math.max(t.height,n?.height??1/0))}),rv=(e,t,n,r)=>!n||r?e:{x:ev(e.x,n.x,Math.max(n.x,n.x+n.width-t.width)),y:ev(e.y,n.y,Math.max(n.y,n.y+n.height-t.height))},iv=e=>e.includes(`e`)||e.includes(`w`),av=(e,t,n,r)=>{let{minSize:i,maxSize:a,boundary:o,allowOverflow:s,lockAspectRatio:c,gridSize:l}=r,u=e.width,d=e.height;if(t.includes(`e`)&&(u=e.width+n.x),t.includes(`w`)&&(u=e.width-n.x),t.includes(`s`)&&(d=e.height+n.y),t.includes(`n`)&&(d=e.height-n.y),u=tv(u,l),d=tv(d,l),c&&e.width>0&&e.height>0){let n=e.width/e.height;iv(t)?d=u/n:u=d*n}let f=nv({width:u,height:d},i,a),p={x:t.includes(`w`)?e.x+e.width-f.width:e.x,y:t.includes(`n`)?e.y+e.height-f.height:e.y};return{...rv(p,f,o,s),...f}},ov=(e,t,n)=>{let{boundary:r,allowOverflow:i,gridSize:a}=n,o={x:tv(e.x+t.x,a),y:tv(e.y+t.y,a)};return rv(o,e,r,i)},sv=e=>{if(e){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}if(!(typeof window>`u`))return{x:0,y:0,width:window.innerWidth,height:window.innerHeight}},cv=(0,l.createContext)({open:!1,setOpen:()=>void 0,position:Q_,size:Z_,stage:`default`,setStage:()=>void 0,dragging:!1,resizing:!1,draggable:!1,resizable:!1,canDrag:!1,canResize:!1,disabled:!1,strategy:`fixed`,triggerId:``,contentId:``,titleId:``,startDrag:()=>void 0,startResize:()=>void 0,moveBy:()=>void 0,resizeBy:()=>void 0}),lv=()=>(0,l.useContext)(cv);function uv(e){let{open:t,defaultOpen:n,onOpenChange:r,position:i,defaultPosition:a,onPositionChange:o,onPositionChangeEnd:s,size:c,defaultSize:u,onSizeChange:d,onSizeChangeEnd:f,stage:p,defaultStage:m,onStageChange:h,minSize:g=$_,maxSize:_,draggable:v=!0,resizable:y=!0,disabled:b=!1,closeOnEscape:x=!0,lockAspectRatio:S,allowOverflow:C,gridSize:w,strategy:T=`fixed`,getBoundaryElement:E,children:D}=e,O=K(),k=t!==void 0,[A,j]=l.useState(!!n),M=k?t:A,N=i!==void 0,[P,F]=l.useState(()=>a??Q_),I=N?i:P,L=c!==void 0,[ee,te]=l.useState(()=>u??Z_),ne=L?c:ee,R=p!==void 0,[re,ie]=l.useState(()=>m??`default`),ae=R?p:re,[oe,se]=l.useState(!1),[ce,le]=l.useState(!1),ue=l.useRef(null),de=e=>{k||j(e),r?.(e)},fe=e=>{R||ie(e),h?.(e)},pe=e=>{N||F(e),o?.(e)},me=e=>{L||te(e),d?.(e)},he=()=>({boundary:sv(E?.()),allowOverflow:C,gridSize:w});qi(e=>{!M||!x||(de(!1),e.preventDefault())});let ge=!b&&v&&ae!==`maximized`,_e=!b&&y&&ae==="default",ve=(e,t)=>{e.preventDefault(),ue.current=t,t.kind===`drag`?se(!0):le(!0)},ye=e=>{if(!ge)return;let t={...I,...ne};ve(e,{kind:`drag`,origin:{x:e.clientX,y:e.clientY},rect:t,latest:t})},be=(e,t)=>{if(!_e)return;let n={...I,...ne};ve(e,{kind:`resize`,axis:t,origin:{x:e.clientX,y:e.clientY},rect:n,latest:n})};l.useEffect(()=>{if(!oe&&!ce)return;let e=e=>{let t=ue.current;if(!t)return;let n={x:e.clientX-t.origin.x,y:e.clientY-t.origin.y};if(t.kind===`drag`){let e=ov(t.rect,n,he());t.latest={...t.rect,...e},pe(e);return}let r=av(t.rect,t.axis,n,{...he(),minSize:g,maxSize:_,lockAspectRatio:S});t.latest=r,pe({x:r.x,y:r.y}),me({width:r.width,height:r.height})},t=()=>{let e=ue.current;ue.current=null,se(!1),le(!1),e&&(s?.({x:e.latest.x,y:e.latest.y}),e.kind===`resize`&&f?.({width:e.latest.width,height:e.latest.height}))};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}});let xe={open:M,setOpen:de,position:I,size:ne,stage:ae,setStage:fe,dragging:oe,resizing:ce,draggable:v,resizable:y,canDrag:ge,canResize:_e,disabled:b,strategy:T,triggerId:`${O}-trigger`,contentId:`${O}-content`,titleId:`${O}-title`,startDrag:ye,startResize:be,moveBy:e=>{if(!ge)return;let t={...I,...ne},n=ov(t,e,he());pe(n),s?.(n)},resizeBy:(e,t)=>{if(!_e)return;let n={...I,...ne},r=av(n,e,t,{...he(),minSize:g,maxSize:_,lockAspectRatio:S});pe({x:r.x,y:r.y}),me({width:r.width,height:r.height}),s?.({x:r.x,y:r.y}),f?.({width:r.width,height:r.height})}};return(0,W.jsx)(cv.Provider,{value:xe,children:D})}uv.displayName=`FloatingPanel`;const dv={root:`floating-panel-body`};function fv(e,t){let{as:n=`div`,className:r,...i}=e,{stage:a}=lv();return a===`minimized`?null:(0,W.jsx)(n,{ref:t,className:H(dv.root,r),"data-component":`FloatingPanel.Body`,...i})}fv.displayName=`FloatingPanel.Body`;var pv=U(fv);function mv(e,t){let{onClick:n,...r}=e,{setOpen:i}=lv();return(0,W.jsx)(bi,{ref:t,icon:Sn,"aria-label":`Close panel`,variant:`invisible`,size:`small`,onClick:e=>{n?.(e),!e.defaultPrevented&&i(!1)},"data-component":`FloatingPanel.CloseTrigger`,...r})}mv.displayName=`FloatingPanel.CloseTrigger`;var hv=U(mv);const gv={root:`floating-panel-content`},_v={ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0},ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1}};function vv(e,t){let{as:n=`div`,className:r,onKeyDown:i,...a}=e,{stage:o,dragging:s,resizing:c,disabled:l,contentId:u,titleId:d,moveBy:f}=lv();return(0,W.jsx)(n,{ref:t,role:`dialog`,id:u,"aria-labelledby":d,tabIndex:-1,className:H(gv.root,r),onKeyDown:e=>{i?.(e);let t=_v[e.key];if(e.defaultPrevented||!t||e.target!==e.currentTarget)return;let n=e.shiftKey?40:8;e.preventDefault(),f({x:t.x*n,y:t.y*n})},"data-component":`FloatingPanel.Content`,"data-stage":o,"data-dragging":s?``:void 0,"data-resizing":c?``:void 0,"data-disabled":l?``:void 0,...a})}vv.displayName=`FloatingPanel.Content`;var yv=U(vv);const bv={root:`floating-panel-control`};function xv(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(bv.root,r),"data-component":`FloatingPanel.Control`,...i})}xv.displayName=`FloatingPanel.Control`;var Sv=U(xv);const Cv={root:`floating-panel-drag-trigger`};function wv(e,t){let{as:n=`div`,className:r,onPointerDown:i,...a}=e,{startDrag:o,dragging:s,canDrag:c}=lv();return(0,W.jsx)(n,{ref:t,className:H(Cv.root,r),onPointerDown:e=>{i?.(e),!e.defaultPrevented&&e.button===0&&(e.target.closest(`button, a, input, select, textarea`)||o(e))},"data-component":`FloatingPanel.DragTrigger`,"data-draggable":c?``:void 0,"data-dragging":s?``:void 0,...a})}wv.displayName=`FloatingPanel.DragTrigger`;var Tv=U(wv);const Ev={root:`floating-panel-header`};function Dv(e,t){let{as:n=`div`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Ev.root,r),"data-component":`FloatingPanel.Header`,...i})}Dv.displayName=`FloatingPanel.Header`;var Ov=U(Dv);const kv={root:`floating-panel-positioner`};function Av(e,t){let{as:n=`div`,className:r,style:i,...a}=e,{open:o,position:s,size:c,stage:l,strategy:u,dragging:d,resizing:f,contentId:p}=lv();if(!o)return null;let m=(0,W.jsx)(n,{ref:t,className:H(kv.root,r),style:{...i,"--floating-panel-x":`${s.x}px`,"--floating-panel-y":`${s.y}px`,"--floating-panel-width":`${c.width}px`,"--floating-panel-height":`${c.height}px`},"data-component":`FloatingPanel.Positioner`,"data-strategy":u,"data-stage":l,"data-dragging":d?``:void 0,"data-resizing":f?``:void 0,"data-panel":p,...a});return u===`fixed`?(0,W.jsx)(aa,{children:m}):m}Av.displayName=`FloatingPanel.Positioner`;var jv=U(Av);const Mv={root:`floating-panel-resize-trigger`},Nv={n:`top`,e:`right`,s:`bottom`,w:`left`,ne:`top right`,nw:`top left`,se:`bottom right`,sw:`bottom left`},Pv={ArrowLeft:{x:-8,y:0},ArrowRight:{x:8,y:0},ArrowUp:{x:0,y:-8},ArrowDown:{x:0,y:8}};function Fv(e,t){let{axis:n,className:r,onPointerDown:i,onKeyDown:a,...o}=e,{startResize:s,resizeBy:c,resizing:l,canResize:u}=lv();return(0,W.jsx)(`div`,{ref:t,role:`button`,tabIndex:u?0:-1,"aria-label":`Resize panel from the ${Nv[n]}`,"aria-disabled":!u||void 0,className:H(Mv.root,r),onPointerDown:e=>{i?.(e),!(e.defaultPrevented||e.button!==0)&&s(e,n)},onKeyDown:e=>{a?.(e);let t=Pv[e.key];e.defaultPrevented||!t||(e.preventDefault(),c(n,t))},"data-component":`FloatingPanel.ResizeTrigger`,"data-axis":n,"data-resizing":l?``:void 0,...o})}Fv.displayName=`FloatingPanel.ResizeTrigger`;var Iv=U(Fv);const Lv={minimized:{icon:Kn,label:`Minimize panel`},maximized:{icon:Xt,label:`Maximize panel`},default:{icon:Zt,label:`Restore panel`}};function Rv(e,t){let{stage:n,onClick:r,...i}=e,{stage:a,setStage:o,disabled:s}=lv(),c=a===n,l=c?`default`:n,{icon:u,label:d}=Lv[l];return(0,W.jsx)(bi,{ref:t,icon:u,"aria-label":d,variant:`invisible`,size:`small`,disabled:s,onClick:e=>{r?.(e),!e.defaultPrevented&&o(l)},"data-component":`FloatingPanel.StageTrigger`,"data-stage":n,"data-active":c?``:void 0,...i})}Rv.displayName=`FloatingPanel.StageTrigger`;var zv=U(Rv);const Bv={root:`floating-panel-title`};function Vv(e,t){let{as:n=`h2`,className:r,...i}=e,{titleId:a}=lv();return(0,W.jsx)(n,{ref:t,id:a,className:H(Bv.root,r),"data-component":`FloatingPanel.Title`,...i})}Vv.displayName=`FloatingPanel.Title`;var Hv=U(Vv);const Uv={root:`floating-panel-trigger`};function Wv(e,t){let{className:n,onClick:r,...i}=e,{open:a,setOpen:o,triggerId:s,contentId:c}=lv();return(0,W.jsx)(`button`,{ref:t,type:`button`,id:s,className:H(Uv.root,n),onClick:e=>{r?.(e),!e.defaultPrevented&&o(!a)},"aria-expanded":a,"aria-controls":a?c:void 0,"data-component":`FloatingPanel.Trigger`,"data-open":a?``:void 0,...i})}Wv.displayName=`FloatingPanel.Trigger`;var Gv=U(Wv);const Kv=Object.assign(uv,{Trigger:Gv,Positioner:jv,Content:yv,DragTrigger:Tv,Header:Ov,Title:Hv,Control:Sv,StageTrigger:zv,CloseTrigger:hv,Body:pv,ResizeTrigger:Iv}),qv=e=>Math.round(e*100)/100,Jv=(e,t,n,r)=>{if(n===`vertical`){let n=qv(e.x+e.width/2),i=qv(e.y+e.height),a=qv(t.x+t.width/2),o=qv(t.y),s=a-n,c=o-i;if(Math.abs(s)<=2||Math.abs(c)<=2)return`M ${n} ${i} L ${a} ${o}`;let l=qv(i+c/2),u=qv(Math.min(r,Math.abs(s)/2,Math.abs(c)/2)),d=s>0?u:-u;return[`M ${n} ${i}`,`V ${qv(l-u)}`,`Q ${n} ${l} ${qv(n+d)} ${l}`,`H ${qv(a-d)}`,`Q ${a} ${l} ${a} ${qv(l+u)}`,`V ${o}`].join(` `)}let i=qv(e.x+e.width),a=qv(e.y+e.height/2),o=qv(t.x),s=qv(t.y+t.height/2),c=o-i,l=s-a;if(Math.abs(l)<=2||Math.abs(c)<=2)return`M ${i} ${a} L ${o} ${s}`;let u=qv(i+c/2),d=qv(Math.min(r,Math.abs(c)/2,Math.abs(l)/2)),f=l>0?d:-d;return[`M ${i} ${a}`,`H ${qv(u-d)}`,`Q ${u} ${a} ${u} ${qv(a+f)}`,`V ${qv(s-f)}`,`Q ${u} ${s} ${qv(u+d)} ${s}`,`H ${o}`].join(` `)},Yv={root:`flow-connectors`,path:`flow-connector`,disabled:`flow-connector-disabled`,arrowhead:`flow-arrowhead`},Xv={width:0,height:0},Zv=({edges:e,positions:t,sizes:n,orientation:r,cornerRadius:i,width:a,height:o,markerId:s,className:c})=>{let l=e.map(e=>{let a=t[e.from],o=t[e.to];return!a||!o?null:{edge:e,d:Jv({...a,...n[e.from]??Xv},{...o,...n[e.to]??Xv},r,i)}}).filter(e=>e!==null),u=[...l.filter(e=>e.edge.disabled),...l.filter(e=>!e.edge.disabled)];return(0,W.jsxs)(`svg`,{className:H(Yv.root,c),width:a,height:o,viewBox:`0 0 ${a} ${o}`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,"data-component":`Flow.Connectors`,children:[(0,W.jsx)(`defs`,{children:(0,W.jsx)(`marker`,{id:s,className:Yv.arrowhead,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,W.jsx)(`path`,{d:`M 0 0 L 6 3 L 0 6 Z`})})}),u.map(({edge:e,d:t})=>(0,W.jsx)(`path`,{className:H(Yv.path,e.disabled&&Yv.disabled),d:t,markerEnd:`url(#${s})`,"data-component":`Flow.Connector`,"data-from":e.from,"data-to":e.to,"data-disabled":e.disabled},`${e.from}--${e.to}`))]})};Zv.displayName=`Flow.Connectors`;const Qv=(0,l.createContext)({}),$v={root:`flow-group`,list:`flow-group-list`};function ey(e,t){let{className:n,children:r,...i}=e;return(0,W.jsx)(`li`,{ref:t,role:`listitem`,className:H($v.root,n),"data-component":`Flow.List`,...i,children:(0,W.jsx)(`ol`,{role:`list`,className:$v.list,children:r})})}ey.displayName=`Flow.List`;var ty=U(ey);const ny={root:`flow-node`,disabled:`flow-node-disabled`};function ry(e,t){let{className:n,id:r,disabled:i,style:a,...o}=e,{positions:s,reportSize:c,measured:u}=l.useContext(Qv),d=l.useRef(null),f=R(t,d),p=r??``;Wi(()=>{let e=d.current;if(!e||!c||p===``)return;let t=()=>{c(p,{width:e.offsetWidth,height:e.offsetHeight})};if(t(),typeof ResizeObserver>`u`)return()=>{c(p,null)};let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),c(p,null)}},[p,c]);let m=s?.[p];return(0,W.jsx)(`li`,{ref:f,className:H(ny.root,i&&ny.disabled,n),style:{...a,insetInlineStart:m?`${m.x}px`:void 0,insetBlockStart:m?`${m.y}px`:void 0},"data-component":`Flow.Node`,"data-node-id":p||void 0,"data-disabled":i,"aria-hidden":!u||void 0,...o})}ry.displayName=`Flow.Node`;var iy=U(ry);const ay={root:`flow-group`,list:`flow-group-list`};function oy(e,t){let{className:n,children:r,align:i=`start`,...a}=e;return(0,W.jsx)(`li`,{ref:t,role:`listitem`,className:H(ay.root,n),"data-component":`Flow.Parallel`,"data-align":i,...a,children:(0,W.jsx)(`ol`,{role:`list`,className:ay.list,children:r})})}oy.displayName=`Flow.Parallel`;var sy=U(oy);const cy={width:0,height:0},ly=({sizes:e,orientation:t,columnGap:n,rowGap:r})=>{let i=new Map,a=o=>{let s=i.get(o);if(s)return s;let c;if(o.kind===`node`){let n=e[o.id]??cy;c=t===`horizontal`?{main:n.width,cross:n.height}:{main:n.height,cross:n.width}}else c=o.kind===`list`?o.children.reduce((e,t,r)=>{let i=a(t);return{main:e.main+i.main+(r>0?n:0),cross:Math.max(e.cross,i.cross)}},{main:0,cross:0}):o.children.reduce((e,t,n)=>{let i=a(t);return{main:Math.max(e.main,i.main),cross:e.cross+i.cross+(n>0?r:0)}},{main:0,cross:0});return i.set(o,c),c};return a},uy=(e,t)=>{let{orientation:n,align:r,columnGap:i,rowGap:a}=t,o=ly(t),s={},c=(e,t,l)=>{if(e.kind===`node`){s[e.id]=n===`horizontal`?{x:t,y:l}:{x:l,y:t};return}let u=o(e);if(e.kind===`list`){let n=t;e.children.forEach(e=>{let t=o(e),a=r===`center`?l+(u.cross-t.cross)/2:l;c(e,n,a),n+=t.main+i});return}let d=l;e.children.forEach(n=>{let r=o(n),i=e.align===`end`?t+(u.main-r.main):t;c(n,i,d),d+=r.cross+a})};return c(e,0,0),s},dy=e=>{if(e.kind===`node`)return[e.id];if(e.kind===`parallel`)return e.children.flatMap(dy);for(let t of e.children){let e=dy(t);if(e.length>0)return e}return[]},fy=e=>{if(e.kind===`node`)return[e.id];if(e.kind===`parallel`)return e.children.flatMap(fy);for(let t=e.children.length-1;t>=0;--t){let n=fy(e.children[t]);if(n.length>0)return n}return[]},py=e=>e.kind===`node`?[e.id]:e.children.flatMap(py),my=(e,t=new Set)=>e.kind===`node`?(e.disabled&&t.add(e.id),t):(e.children.forEach(e=>my(e,t)),t),hy=e=>{let t=my(e),n=[],r=e=>{if(e.kind!==`node`&&(e.children.forEach(r),e.kind===`list`))for(let r=0;r<e.children.length-1;r+=1){let i=e.children[r],a=e.children[r+1];(i.kind!==`parallel`||a.kind!==`parallel`)&&fy(i).forEach(e=>{dy(a).forEach(r=>{n.push({from:e,to:r,disabled:t.has(e)||t.has(r)||void 0})})})}};return r(e),n},gy=(e,t)=>Object.entries(e).reduce((e,[n,r])=>{let i=t[n]??cy;return{width:Math.max(e.width,r.x+i.width),height:Math.max(e.height,r.y+i.height)}},{width:0,height:0}),_y={root:`flow`,canvas:`flow-canvas`,list:`flow-list`},vy=(e,t)=>{let n=[],r=[];return l.Children.toArray(e).forEach((e,i)=>{if(!l.isValidElement(e)){r.push(e);return}let a=t===``?`${i}`:`${t}-${i}`;if(e.type===iy){let t=e,i=t.props.id??`node-${a}`;n.push({kind:`node`,id:i,disabled:t.props.disabled}),r.push(l.cloneElement(t,{id:i}));return}if(e.type===ty){let t=e,i=vy(t.props.children,a);n.push({kind:`list`,children:i.branches}),r.push(l.cloneElement(t,void 0,i.elements));return}if(e.type===sy){let t=e,i=vy(t.props.children,a);n.push({kind:`parallel`,align:t.props.align,children:i.branches}),r.push(l.cloneElement(t,void 0,i.elements));return}r.push(e)}),{branches:n,elements:r}};function yy(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,align:a=`start`,columnGap:o=64,rowGap:s=16,cornerRadius:c=8,children:u,"aria-label":d,"aria-labelledby":f,...p}=e,m=`${K().replace(/[^a-zA-Z0-9-]/g,``)}-flow-arrowhead`,h=l.useRef(null),g=R(t,h),_=yf(h),[v,y]=l.useState({}),b=l.useCallback((e,t)=>{y(n=>{if(t===null){if(!(e in n))return n;let t={...n};return delete t[e],t}let r=n[e];return r&&r.width===t.width&&r.height===t.height?n:{...n,[e]:t}})},[]),{tree:x,elements:S}=l.useMemo(()=>{let e=vy(u,``);return{tree:{kind:`list`,children:e.branches},elements:e.elements}},[u]),C=l.useMemo(()=>py(x).every(e=>e in v),[x,v]),w=l.useMemo(()=>uy(x,{sizes:v,orientation:i,align:a,columnGap:o,rowGap:s}),[x,v,i,a,o,s]),T=l.useMemo(()=>hy(x),[x]),E=l.useMemo(()=>gy(w,v),[w,v]),D={orientation:i,positions:w,measured:C,reportSize:b},O=_?{role:d||f?`region`:void 0,tabIndex:0}:{};return(0,W.jsx)(Qv.Provider,{value:D,children:(0,W.jsx)(n,{ref:g,className:H(_y.root,r),"aria-label":d,"aria-labelledby":f,"data-component":`Flow`,"data-orientation":i,"data-align":a,"data-measured":C,...O,...p,children:(0,W.jsxs)(`div`,{className:_y.canvas,style:{width:`${E.width}px`,height:`${E.height}px`},"data-component":`Flow.Canvas`,children:[(0,W.jsx)(Zv,{edges:T,positions:w,sizes:v,orientation:i,cornerRadius:c,width:E.width,height:E.height,markerId:m}),(0,W.jsx)(`ol`,{role:`list`,className:_y.list,"data-component":`Flow.Steps`,children:S})]})})})}yy.displayName=`Flow`;var by=U(yy);const xy=Object.assign(by,{Node:iy,List:ty,Parallel:sy}),Sy=(0,l.createContext)({}),Cy={root:`radio`,checked:`radio-checked`,disabled:`radio-disabled`};function wy(e,t){let{className:n,name:r,required:i,validationStatus:a,value:o,onChange:s,...c}=e,u=l.useContext(Sy);return(0,W.jsx)(`input`,{ref:t,type:`radio`,value:o,name:r??u.name,required:i,"aria-required":i?!0:void 0,"aria-invalid":a===`error`||void 0,onChange:e=>{u.onChange?.(e),s?.(e)},className:H(Cy.root,Cy.checked,Cy.disabled,n),"data-component":`Radio`,...c})}wy.displayName=`Radio`;var Ty=U(wy);const Ey={select:`select-control`,indicator:`select-indicator`},Dy=V(`select`,{variants:{size:{small:`select-small`,medium:`select-medium`,large:`select-large`},block:{true:`select-block`,false:``},disabled:{true:`select-disabled`,false:``},validation:{error:`select-error`,success:`select-success`}}});function Oy(e,t){let{className:n,children:r,placeholder:i,size:a=`medium`,block:o,disabled:s,required:c,validationStatus:l,defaultValue:u,...d}=e,f=`value`in d;return(0,W.jsxs)(`span`,{className:H(Dy({size:a,block:o,disabled:s,validation:l}),n),"data-component":`Select`,"data-size":a,"data-block":o,"data-disabled":s,"data-validation":l,children:[(0,W.jsxs)(`select`,{ref:t,disabled:s,required:c,"aria-invalid":l===`error`||void 0,className:Ey.select,defaultValue:f?void 0:u??(i?``:void 0),"data-has-placeholder":!!i||void 0,...d,children:[i?(0,W.jsx)(`option`,{value:``,disabled:c,hidden:c,"data-component":`Select.Option`,children:i}):null,r]}),(0,W.jsx)(pn,{className:Ey.indicator,"aria-hidden":`true`})]})}Oy.displayName=`Select`;var ky=U(Oy);const Ay=`both`,jy={counter:`textarea-counter`,counterOverLimit:`textarea-counter-over-limit`,counterIcon:`textarea-counter-icon`,hidden:`sr-only`},My=V(`textarea-field`,{variants:{block:{true:`textarea-field-block`,false:``},contrast:{true:`textarea-field-contrast`,false:``},disabled:{true:`textarea-field-disabled`,false:``},validation:{error:`textarea-field-error`,success:`textarea-field-success`}}}),Ny=V(`textarea`,{variants:{resize:{none:`textarea-resize-none`,both:`textarea-resize-both`,horizontal:`textarea-resize-horizontal`,vertical:`textarea-resize-vertical`}}});function Py(e,t){let{className:n,style:r,value:i,defaultValue:a,onChange:o,rows:s=7,cols:c=30,resize:u=Ay,block:d,contrast:f,disabled:p,required:m,validationStatus:h,minHeight:g,maxHeight:_,characterLimit:v,"aria-describedby":y,...b}=e,x=K(),S=i!==void 0,[C,w]=l.useState(()=>a===void 0?0:String(a).length),T=S?String(i).length:C,E=v?Ho(T,v):void 0,D=E?.isOverLimit??!1,O=D?`error`:h,k=l.useRef(!1),[A,j]=l.useState(``),M=E?.message;return l.useEffect(()=>{if(!k.current)return;let e=window.setTimeout(()=>{j(M??``)},500);return()=>{window.clearTimeout(e)}},[M]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:H(My({block:d,contrast:f,disabled:p,validation:O}),n),"data-component":`Textarea`,"data-block":d,"data-contrast":f,"data-disabled":p,"data-validation":O,children:(0,W.jsx)(`textarea`,{ref:t,value:i,defaultValue:a,rows:s,cols:c,disabled:p,required:m,"aria-required":m?!0:void 0,"aria-invalid":O===`error`||void 0,"aria-describedby":v?[x,y].filter(Boolean).join(` `):y,onChange:e=>{k.current=!0,v&&!S&&w(e.target.value.length),o?.(e)},className:H(Ny({resize:u})),style:{minHeight:g,maxHeight:_,...r},"data-resize":u,...b})}),E?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:jy.hidden,children:A}),(0,W.jsxs)(`span`,{id:x,className:jy.hidden,children:[`You can enter up to `,v,` `,v===1?`character`:`characters`]}),(0,W.jsxs)(Vo,{"aria-hidden":`true`,size:`small`,className:H(jy.counter,D&&jy.counterOverLimit),"data-component":`Textarea.CharacterCount`,children:[D?(0,W.jsx)(wn,{className:jy.counterIcon}):null,E.message]})]}):null]})}Py.displayName=`Textarea`;var Fy=U(Py);const Iy={root:`form-control-caption`,disabled:`form-control-caption-disabled`};function Ly(e,t){let{className:n,id:r,...i}=e,{captionId:a,disabled:o}=l.useContext(Jd);return(0,W.jsx)(`span`,{ref:t,id:r??a,className:H(Iy.root,o&&Iy.disabled,n),"data-component":`FormControl.Caption`,"data-control-disabled":o,...i})}Ly.displayName=`FormControl.Caption`;var Ry=U(Ly);const zy={root:`form-control-label`,disabled:`form-control-label-disabled`,hidden:`sr-only`,required:`form-control-label-required`};function By(e,t){let{as:n=`label`,className:r,children:i,htmlFor:a,id:o,visuallyHidden:s,requiredIndicator:c=!0,requiredText:u,...d}=e,{id:f,disabled:p,required:m,labelId:h}=l.useContext(Jd);return(0,W.jsx)(n,{ref:t,id:o??h,htmlFor:n===`label`?a??f:void 0,className:H(zy.root,p&&zy.disabled,s&&zy.hidden,r),"data-component":`FormControl.Label`,"data-control-disabled":p,...d,children:m||u?(0,W.jsxs)(`span`,{className:zy.required,children:[(0,W.jsx)(`span`,{children:i}),(0,W.jsx)(`span`,{"aria-hidden":!c||void 0,children:u??`*`})]}):i})}By.displayName=`FormControl.Label`;var Vy=U(By);const Hy={root:`form-control-leading-visual`,disabled:`form-control-leading-visual-disabled`,withCaption:`form-control-leading-visual-with-caption`};function Uy(e,t){let{className:n,...r}=e,{captionId:i,disabled:a}=l.useContext(Jd);return(0,W.jsx)(`div`,{ref:t,className:H(Hy.root,i&&Hy.withCaption,a&&Hy.disabled,n),"data-component":`FormControl.LeadingVisual`,"data-control-disabled":a,"data-has-caption":i?!0:void 0,...r})}Uy.displayName=`FormControl.LeadingVisual`;var Wy=U(Uy);const Gy={success:cn,error:wn},Ky={icon:`form-control-validation-icon`},qy=V(`form-control-validation`,{variants:{variant:{success:`form-control-validation-success`,error:`form-control-validation-error`}}});function Jy(e,t){let{className:n,children:r,variant:i,id:a,...o}=e,{validationMessageId:s}=l.useContext(Jd),c=Gy[i];return(0,W.jsxs)(`span`,{ref:t,className:H(qy({variant:i}),n),"data-component":`FormControl.Validation`,"data-validation-status":i,...o,children:[(0,W.jsx)(`span`,{className:Ky.icon,"data-component":`FormControl.Validation.Icon`,"aria-hidden":`true`,children:(0,W.jsx)(c,{})}),(0,W.jsx)(`span`,{id:a??s,children:r})]})}Jy.displayName=`FormControl.Validation`;var Yy=U(Jy);const Xy={vertical:`form-control-vertical`,verticalWithLabel:`form-control-vertical-with-label`,horizontal:`form-control-horizontal`,horizontalWithLeadingVisual:`form-control-horizontal-with-leading-visual`,choiceInput:`form-control-choice-input`,labelContainer:`form-control-label-container`},Zy=[sd,Ty,ky,Fy,Jo],Qy=(e,t)=>l.isValidElement(e)&&(e.type===t||Sr(e,t));function $y(e,t){let{className:n,children:r,disabled:i,required:a,layout:o=`vertical`,id:s,...c}=e,[u,d]=Tr(r,{label:Vy,caption:Ry,leadingVisual:Wy,validation:Yy}),f=l.useContext(rd),p=l.useContext(Sy),m=f.disabled||p.disabled||i,h=K(s),g=u.caption?`${h}-caption`:void 0,_=u.validation?`${h}-validation`:void 0,v=l.isValidElement(u.label)?u.label:void 0,y=v?v.props.id??`${h}-label`:void 0,b=v?!v.props.visuallyHidden:!1,x=l.isValidElement(u.validation)?u.validation.props.variant:void 0,S=d.find(e=>Zy.some(t=>Qy(e,t))),C=Qy(S,sd)||Qy(S,Ty),w=Qy(S,Ty),T=C||o===`horizontal`,E=d.filter(e=>e!==S),D={id:h,disabled:m,required:a,captionId:g,validationMessageId:_,labelId:y},O=l.isValidElement(S)?l.cloneElement(S,T?{id:h,disabled:m,required:a&&!w,"aria-describedby":g}:{id:h,disabled:m,required:a,validationStatus:x,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,...S.props}):null;return(0,W.jsx)(Jd.Provider,{value:D,children:T?(0,W.jsxs)(`div`,{ref:t,className:H(Xy.horizontal,u.leadingVisual&&Xy.horizontalWithLeadingVisual,n),"data-component":`FormControl`,"data-layout":`horizontal`,"data-disabled":m,"data-required":a,"data-has-leading-visual":u.leadingVisual?!0:void 0,...c,children:[(0,W.jsxs)(`div`,{className:Xy.choiceInput,children:[O,E]}),u.leadingVisual,(0,W.jsxs)(`div`,{className:Xy.labelContainer,children:[u.label,u.caption]})]}):(0,W.jsxs)(`div`,{ref:t,className:H(Xy.vertical,b&&Xy.verticalWithLabel,n),"data-component":`FormControl`,"data-layout":`vertical`,"data-disabled":m,"data-required":a,"data-has-label":b?!0:void 0,...c,children:[u.label,O,E,u.validation,u.caption]})})}$y.displayName=`FormControl`;var eb=U($y);const tb=Object.assign(eb,{Label:Vy,Caption:Ry,LeadingVisual:Wy,Validation:Yy}),nb=`en-US`,rb=(e,t)=>t?`${e}|${Object.entries(t).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:1).map(([e,t])=>`${e}=${String(t)}`).join(`,`)}`:e,ib=e=>{let t=new Map;return(n,r)=>{let i=rb(n,r),a=t.get(i);if(a)return a;let o=e(n,r);return t.set(i,o),o}},ab=new Set([`Adlm`,`Arab`,`Armi`,`Avst`,`Hebr`,`Mand`,`Mend`,`Nkoo`,`Rohg`,`Samr`,`Syrc`,`Thaa`]),ob=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]),sb=e=>{try{return new Intl.Locale(e).maximize().script}catch{return}},cb=e=>{let t=sb(e);return t?ab.has(t):ob.has(e.split(`-`)[0].toLowerCase())},lb=e=>cb(e)?`rtl`:`ltr`,ub=()=>{let e=typeof navigator>`u`?void 0:navigator.language;if(!e)return nb;try{return Intl.DateTimeFormat.supportedLocalesOf([e]),e}catch{return nb}},db=ib((e,t)=>new Intl.Collator(e,t)),fb=(e=nb,t={})=>db(e,t),pb=RegExp(`\\p{P}`,`gu`),mb=ib((e,t={})=>{let n=db(e,{usage:`search`,...t}),r=e=>{let t=e.normalize(`NFC`);return n.resolvedOptions().ignorePunctuation?t.replace(pb,``):t},i=(e,t)=>n.compare(e,t)===0;return{startsWith:(e,t)=>{if(t.length===0)return!0;let[n,a]=[r(e),r(t)];return i(n.slice(0,a.length),a)},endsWith:(e,t)=>{if(t.length===0)return!0;let[n,a]=[r(e),r(t)];return i(n.slice(-a.length),a)},contains:(e,t)=>{if(t.length===0)return!0;let[n,a]=[r(e),r(t)];for(let e=0;e+a.length<=n.length;e++)if(i(n.slice(e,e+a.length),a))return!0;return!1}}}),hb=({locale:e,...t}={})=>mb(e??`en-US`,t),gb=ib((e,t)=>new Intl.NumberFormat(e,t)),_b=(e=nb,t={})=>gb(e,t),vb=(e,t=nb,n={})=>gb(t,n).format(e),yb=ib((e,t)=>new Intl.DateTimeFormat(e,t)),bb=(e=nb,t={})=>yb(e,t),xb=[``,`kilo`,`mega`,`giga`,`tera`],Sb=[``,`kilo`,`mega`,`giga`,`tera`,`peta`],Cb=(e,t=nb,n={})=>{if(Number.isNaN(e))return``;if(e===0)return`0 B`;let{precision:r=3,unitSystem:i=`decimal`,unit:a=`byte`,unitDisplay:o=`short`}=n,s=i===`binary`?1024:1e3,c=a===`bit`?xb:Sb,l=Math.abs(e),u=0;for(;l>=s&&u<c.length-1;)l/=s,u++;let d=parseFloat(l.toPrecision(r));return vb(e<0?-d:d,t,{style:`unit`,unit:c[u]+a,unitDisplay:o})},wb=(0,l.createContext)({direction:`ltr`}),Tb=(0,l.createContext)({locale:nb,direction:lb(nb)}),Eb=()=>(0,l.useContext)(Tb),Db=e=>(window?.addEventListener?.(`languagechange`,e),()=>window?.removeEventListener?.(`languagechange`,e)),Ob=()=>nb,kb=()=>l.useSyncExternalStore(Db,ub,Ob);function Ab({children:e,className:t,...n}){let{locale:r}=Eb(),i=kb(),a=n.locale??r,o=a===`auto`?i:a,s=lb(o),c=l.useMemo(()=>({locale:o,direction:s}),[o,s]),u=l.useMemo(()=>({direction:s}),[s]);return(0,W.jsx)(Tb.Provider,{value:c,children:(0,W.jsx)(wb.Provider,{value:u,children:(0,W.jsx)(`div`,{className:t,"data-component":`LocaleProvider`,lang:o,dir:s,children:e})})})}Ab.displayName=`LocaleProvider`;const jb=({locale:e,...t}={})=>{let{locale:n}=Eb();return fb(e??n,t)},Mb=({locale:e,...t}={})=>{let{locale:n}=Eb();return bb(e??n,t)},Nb=({locale:e,...t}={})=>{let{locale:n}=Eb();return hb({locale:e??n,...t})},Pb=({locale:e,...t}={})=>{let{locale:n}=Eb();return _b(e??n,t)};function Fb(e,t){let{as:n=`span`,children:r,value:i,format:a,locale:o,...s}=e,{locale:c}=Eb();return(0,W.jsx)(n,{ref:t,"data-component":`FormatByte`,...s,children:r??Cb(i,o??c,a)})}Fb.displayName=`FormatByte`;var Ib=U(Fb);function Lb(e,t){let{as:n=`span`,children:r,value:i,format:a,locale:o,...s}=e,c=Pb({locale:o,...a});return(0,W.jsx)(n,{ref:t,"data-component":`FormatNumber`,...s,children:r??c.format(i)})}Lb.displayName=`FormatNumber`;var Rb=U(Lb);function zb({onMount:e,onUnmount:t,children:n}){let r=l.useRef({onMount:e,onUnmount:t});return l.useEffect(()=>{r.current={onMount:e,onUnmount:t}},[e,t]),l.useEffect(()=>(r.current.onMount?.(),()=>{r.current.onUnmount?.()}),[]),(0,W.jsx)(W.Fragment,{children:n})}zb.displayName=`Frame.Content`;const Bb={root:`frame`},Vb=`frame-root`,Hb=`<!doctype html><html><head><style>*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}</style></head><body><div class="${Vb}"></div></body></html>`,Ub=e=>{let t=e.contentWindow?.document;return t?t.body.querySelector(`.frame-root`)??t.body:null};function Wb(e,t){let{children:n,head:r,onMount:i,onUnmount:a,srcDoc:o=Hb,className:s,title:c,...u}=e,f=K(),[p,m]=l.useState(null),[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{m(e)},[]),b=R(t,y);return Wi(()=>{if(!p)return;let e=p.contentWindow?.document;e&&(e.open(),e.write(o),e.close(),g(Ub(p)),v(e.head))},[p,o]),l.useEffect(()=>{if(!p||!h)return;let e=p.contentWindow;if(!e?.ResizeObserver)return;let t=()=>{p.style.setProperty(`--frame-content-width`,`${h.scrollWidth}px`),p.style.setProperty(`--frame-content-height`,`${h.scrollHeight}px`)},n=new e.ResizeObserver(()=>{e.requestAnimationFrame(t)});return t(),n.observe(h),()=>{n.disconnect()}},[p,h]),(0,W.jsxs)(`iframe`,{ref:b,title:c??`Frame ${f}`,className:H(Bb.root,s),"data-component":`Frame`,...u,children:[h?(0,d.createPortal)((0,W.jsx)(zb,{onMount:i,onUnmount:a,children:n}),h):null,r&&_?(0,d.createPortal)(r,_):null]})}Wb.displayName=`Frame`;var Gb=U(Wb);const Kb={root:`header`};function qb(e,t){let{as:n=`header`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Kb.root,r),"data-component":`Header`,...i})}qb.displayName=`Header`;var Jb=U(qb);const Yb={root:`header-item`,full:`header-item-full`};function Xb(e,t){let{className:n,full:r,...i}=e;return(0,W.jsx)(`div`,{ref:t,className:H(Yb.root,r&&Yb.full,n),"data-component":`Header.Item`,"data-full":r?``:void 0,...i})}Xb.displayName=`Header.Item`;var Zb=U(Xb);const Qb={root:`header-link`};function $b(e,t){let{as:n=`a`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(Qb.root,r),"data-component":`Header.Link`,...i})}$b.displayName=`Header.Link`;var ex=U($b);const tx=Object.assign(Jb,{Item:Zb,Link:ex}),nx={when:{narrow:`hidden-narrow`,regular:`hidden-regular`,wide:`hidden-wide`}};function rx(e,t){let{as:n=`div`,className:r,when:i,...a}=e,o=Array.isArray(i)?i:[i];return(0,W.jsx)(n,{ref:t,className:H(o.map(e=>nx.when[e]),r),"data-component":`Hidden`,"data-when":o.join(` `),...a})}rx.displayName=`Hidden`;var ix=U(rx);const ax=V(`mark`,{variants:{variant:{attention:`mark-attention`,accent:`mark-accent`,success:`mark-success`,danger:`mark-danger`,neutral:`mark-neutral`},size:{large:`mark-size-large`,medium:`mark-size-medium`,small:`mark-size-small`},weight:{light:`mark-weight-light`,normal:`mark-weight-normal`,medium:`mark-weight-medium`,semibold:`mark-weight-semibold`}}});function ox(e,t){let{as:n=`mark`,className:r,variant:i=`attention`,size:a,weight:o,...s}=e;return(0,W.jsx)(n,{ref:t,className:H(ax({variant:i,size:a,weight:o}),r),"data-component":`Mark`,"data-variant":i,"data-size":a,"data-weight":o,...s})}ox.displayName=`Mark`;var sx=U(ox);const cx=e=>(typeof e==`string`?[e]:e??[]).filter(e=>e.length>0).sort((e,t)=>t.length-e.length),lx=(e,t,n=!1)=>{let r=cx(t);if(e.length===0)return[];if(r.length===0)return[{text:e,matched:!1}];let i=n?e:e.toLowerCase(),a=n?r:r.map(e=>e.toLowerCase()),o=[],s=0,c=0,l=t=>{t>c&&o.push({text:e.slice(c,t),matched:!1})};for(;s<e.length;){let t=a.find(e=>i.startsWith(e,s));if(t===void 0){s+=1;continue}l(s);let n=s+t.length,r=o[o.length-1];r?.matched?r.text+=e.slice(s,n):o.push({text:e.slice(s,n),matched:!0}),s=n,c=n}return l(e.length),o};function ux(e,t){let{as:n=`span`,children:r=``,match:i,caseSensitive:a=!1,variant:o=`attention`,...s}=e,c=l.useMemo(()=>lx(r,i,a),[r,i,a]);return(0,W.jsx)(n,{ref:t,"data-component":`Highlight`,"data-variant":o,"data-case-sensitive":a,...s,children:c.map((e,t)=>e.matched?(0,W.jsx)(sx,{variant:o,children:e.text},t):e.text)})}ux.displayName=`Highlight`;var dx=U(ux);const fx=(0,l.createContext)({}),px={root:`hover-card-content`};function mx(e,t){let{className:n,...r}=e;return(0,W.jsx)(`div`,{ref:t,className:H(px.root,n),"data-component":`HoverCard.Content`,...r})}mx.displayName=`HoverCard.Content`;var hx=U(mx);function gx(e){let{children:t}=e,{triggerHandlers:n}=l.useContext(fx),r=l.Children.only(t);if(!l.isValidElement(r)||!n)return null;let i=r.props;return l.cloneElement(r,{ref:n.ref,"aria-describedby":[i[`aria-describedby`],n[`aria-describedby`]].filter(Boolean).join(` `)||void 0,onPointerEnter:e=>{n.onPointerEnter(e),i.onPointerEnter?.(e)},onPointerLeave:e=>{n.onPointerLeave(e),i.onPointerLeave?.(e)},onFocus:e=>{n.onFocus(e),i.onFocus?.(e)},onBlur:e=>{n.onBlur(e),i.onBlur?.(e)}})}gx.displayName=`HoverCard.Trigger`;const _x={root:[`hover-card`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short motion-safe:data-[side=outside-bottom]:slide-in-from-top-2 motion-safe:data-[side=outside-top]:slide-in-from-bottom-2 motion-safe:data-[side=outside-right]:slide-in-from-left-2 motion-safe:data-[side=outside-left]:slide-in-from-right-2`],unplaced:`invisible`},vx=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function yx(e){let{className:t,children:n,side:r=`outside-bottom`,align:i=`start`,anchorOffset:a,alignmentOffset:o,openDelay:s=500,closeDelay:c=300,open:u,onOpenChange:d,disabled:f=!1,portalContainerName:p}=e,m=K(),[h]=Tr(n,{trigger:gx,content:hx}),g=l.useRef(null),_=l.useRef(null),v=l.useRef(null),y=l.useRef(null),[b,x]=l.useState(!1),S=u!==void 0,C=(S?u:b)&&!f,w=l.useRef(null),[T,E]=l.useState(null),D=l.useCallback(()=>{v.current!==null&&(window.clearTimeout(v.current),v.current=null),y.current!==null&&(window.clearTimeout(y.current),y.current=null)},[]);l.useEffect(()=>D,[D]);let O=e=>{D(),S||x(e),d?.(e)},k=()=>{f||(D(),v.current=window.setTimeout(()=>{v.current=null,O(!0)},s))},A=()=>{D(),y.current=window.setTimeout(()=>{y.current=null,O(!1)},c)},j=l.useCallback(()=>{let e=g.current,t=_.current;if(!e||!t)return;let n=ua(t,e,{side:r,align:i,anchorOffset:a,alignmentOffset:o});w.current&&vx(w.current,n)||(w.current=n,E(n))},[r,i,a,o]);Wi(()=>{if(!C){w.current=null,E(null);return}j();let e=new ResizeObserver(j);return _.current&&e.observe(_.current),window.addEventListener(`resize`,j),window.addEventListener(`scroll`,j,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,j),window.removeEventListener(`scroll`,j,!0)}},[C,j]),qi(e=>{C&&(e.preventDefault(),O(!1))});let M={ref:g,"aria-describedby":C?m:void 0,onPointerEnter:e=>{e.pointerType!==`touch`&&k()},onPointerLeave:e=>{e.pointerType!==`touch`&&A()},onFocus:e=>{try{if(!e.target.matches(`:focus-visible`))return}catch{}O(!0)},onBlur:e=>{e.relatedTarget instanceof Node&&_.current?.contains(e.relatedTarget)||O(!1)}};return(0,W.jsxs)(fx.Provider,{value:{triggerHandlers:M},children:[h.trigger,C?(0,W.jsx)(aa,{containerName:p,children:(0,W.jsx)(`div`,{ref:_,id:m,className:H(_x.root,!T&&_x.unplaced,t),style:{"--hover-card-top":`${T?.top??0}px`,"--hover-card-left":`${T?.left??0}px`},onPointerEnter:D,onPointerLeave:A,"data-component":`HoverCard`,"data-side":T?.anchorSide??r,"data-align":T?.anchorAlign??i,"data-visibility":T?`visible`:`hidden`,children:h.content})}):null]})}yx.displayName=`HoverCard`;const bx=Object.assign(yx,{Trigger:gx,Content:hx}),xx=V(`image`,{variants:{fit:{contain:`image-fit-contain`,cover:`image-fit-cover`,fill:`image-fit-fill`,none:`image-fit-none`,"scale-down":`image-fit-scale-down`},borderRadius:{none:`image-radius-none`,small:`image-radius-small`,medium:`image-radius-medium`,large:`image-radius-large`,full:`image-radius-full`}}});function Sx(e,t){let{as:n=`img`,className:r,alt:i=``,borderRadius:a=`none`,fit:o=`cover`,fallbackSrc:s,loading:c=`lazy`,src:u,onError:d,...f}=e,[p,m]=l.useState(void 0),h=s!==void 0&&u!==void 0&&u===p;return(0,W.jsx)(n,{ref:t,alt:i,src:h?s:u,loading:c,onError:e=>{m(u),d?.(e)},className:H(xx({borderRadius:a,fit:o}),r),"data-component":`Image`,"data-border-radius":a,"data-fit":o,"data-fallback":h||void 0,...f})}Sx.displayName=`Image`;var Cx=U(Sx);const wx={icon:`inline-message-icon`},Tx=V(`inline-message`,{variants:{size:{small:`inline-message-small`,medium:`inline-message-medium`},variant:{critical:`inline-message-critical`,success:`inline-message-success`,unavailable:`inline-message-unavailable`,warning:`inline-message-warning`}}}),Ex={critical:wn,success:cn,unavailable:rr,warning:rr},Dx=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,W.jsx)(e,{});function Ox(e,t){let{className:n,children:r,size:i=`medium`,variant:a,leadingVisual:o,...s}=e,c=a?Ex[a]:An;return(0,W.jsxs)(`div`,{ref:t,className:H(Tx({size:i,variant:a}),n),"data-component":`InlineMessage`,"data-size":i,"data-variant":a,...s,children:[(0,W.jsx)(`span`,{className:wx.icon,"data-component":`InlineMessage.Icon`,children:o===void 0?(0,W.jsx)(c,{}):Dx(o)}),(0,W.jsx)(`span`,{"data-component":`InlineMessage.Content`,children:r})]})}Ox.displayName=`InlineMessage`;var kx=U(Ox);const Ax=([e,...t])=>(e?.toUpperCase()??``)+t.join(``).toLowerCase(),jx=e=>({alt:e===`apple`?`⌥`:`Alt`,control:`⌃`,shift:`⇧`,meta:e===`apple`?`⌘`:e===`windows`?`Win`:`Meta`,mod:e===`apple`?`⌘`:`⌃`,pageup:`PgUp`,pagedown:`PgDn`,arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,plus:`+`,backspace:`⌫`,delete:`Del`,space:`␣`,tab:`⇥`,enter:`⏎`,escape:`Esc`,function:`Fn`,capslock:`CapsLock`,insert:`Ins`,printscreen:`PrtScn`}),Mx=e=>({alt:e===`apple`?`Option`:`Alt`,meta:e===`apple`?`Command`:e===`windows`?`Windows`:`Meta`,mod:e===`apple`?`Command`:`Control`,"+":`Plus`,pageup:`Page Up`,pagedown:`Page Down`,arrowup:`Up Arrow`,arrowdown:`Down Arrow`,arrowleft:`Left Arrow`,arrowright:`Right Arrow`,capslock:`Caps Lock`,printscreen:`Print Screen`}),Nx=e=>({alt:e===`apple`?`option`:`alt`,meta:e===`apple`?`command`:e===`windows`?`Windows`:`meta`,mod:e===`apple`?`command`:`control`,pageup:`page up`,pagedown:`page down`,arrowup:`up arrow`,arrowdown:`down arrow`,arrowleft:`left arrow`,arrowright:`right arrow`,capslock:`caps lock`,printscreen:`print screen`,"`":`backtick`,"~":`tilde`,"!":`exclamation point`,"@":`at`,"#":`hash`,$:`dollar sign`,"%":`percent`,"^":`caret`,"&":`ampersand`,"*":`asterisk`,"(":`left parenthesis`,")":`right parenthesis`,_:`underscore`,"-":`dash`,"+":`plus`,"=":`equals`,"[":`left bracket`,"{":`left curly brace`,"]":`right bracket`,"}":`right curly brace`,"\\":`backslash`,"|":`pipe`,";":`semicolon`,":":`colon`,"'":`single quote`,'"':`double quote`,",":`comma`,"<":`left angle bracket`,".":`period`,">":`right angle bracket`,"/":`forward slash`,"?":`question mark`," ":`space`}),Px=(e,t)=>jx(t)[e]??Ax(e),Fx=(e,t)=>Mx(t)[e]??Ax(e),Ix=(e,t)=>Nx(t)[e]??e.toLowerCase(),Lx={control:1,meta:2,alt:3,option:4,shift:5,function:6},Rx=e=>Lx[e]??1/0,zx=e=>e.split(`+`).map(e=>e.toLowerCase()).sort((e,t)=>Rx(e)-Rx(t)),Bx=e=>e.split(` `),Vx=(e,t)=>zx(e).map(e=>Ix(e,t)).join(` `),Hx=(e,t)=>Bx(e).map(e=>Vx(e,t)).join(` then `),Ux=(e,t)=>Hx(e,t),Wx=(0,l.createContext)(null),Gx=()=>()=>{},Kx=()=>typeof navigator>`u`?``:`${navigator.platform} ${navigator.userAgent}`,qx=()=>{let e=Kx();return/mac|iphone|ipad|ipod/i.test(e)?`apple`:/win/i.test(e)?`windows`:`other`},Jx=()=>`other`,Yx=()=>{let e=(0,l.useContext)(Wx),t=(0,l.useSyncExternalStore)(Gx,qx,Jx);return e??t},Xx={hidden:`sr-only`};function Zx(e){let{name:t,format:n=`condensed`}=e,r=Yx();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:Xx.hidden,children:Ix(t,r)}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:n===`condensed`?Px(t,r):Fx(t,r)})]})}Zx.displayName=`KeybindingHint.Key`;const Qx=V(`keybinding-hint-chord`,{variants:{variant:{normal:`keybinding-hint-chord-normal`,onEmphasis:`keybinding-hint-chord-on-emphasis`,onPrimary:`keybinding-hint-chord-on-primary`},size:{normal:`keybinding-hint-chord-size-normal`,small:`keybinding-hint-chord-size-small`}}});function $x(e){let{keys:t,format:n=`condensed`,variant:r=`normal`,size:i=`normal`}=e;return(0,W.jsx)(`span`,{className:H(Qx({variant:r,size:i})),"data-component":`KeybindingHint.Chord`,children:zx(t).map((e,t)=>(0,W.jsxs)(l.Fragment,{children:[t>0&&n===`full`?(0,W.jsx)(`span`,{"aria-hidden":`true`,children:` + `}):` `,(0,W.jsx)(Zx,{name:e,format:n})]},t))})}$x.displayName=`KeybindingHint.Chord`;const eS={root:`keybinding-hint`,hidden:`sr-only`};function tS(e,t){let{className:n,keys:r,format:i=`condensed`,variant:a=`normal`,size:o=`normal`,...s}=e;return(0,W.jsx)(`kbd`,{ref:t,className:H(eS.root,n),"data-component":`KeybindingHint`,"data-format":i,"data-variant":a,"data-size":o,...s,children:Bx(r).map((e,t)=>(0,W.jsxs)(l.Fragment,{children:[t>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:eS.hidden,children:`then`}),` `]}):null,(0,W.jsx)($x,{keys:e,format:i,variant:a,size:o})]},t))})}tS.displayName=`KeybindingHint`;var nS=U(tS);const rS=V(`label`,{variants:{size:{small:`label-small`,medium:`label-medium`,large:`label-large`},variant:{default:`label-default`,primary:`label-primary`,secondary:`label-secondary`,accent:`label-accent`,success:`label-success`,attention:`label-attention`,severe:`label-severe`,danger:`label-danger`,done:`label-done`,sponsors:`label-sponsors`}}});function iS(e,t){let{as:n=`span`,className:r,size:i=`small`,variant:a=`default`,...o}=e;return(0,W.jsx)(n,{ref:t,className:H(rS({size:i,variant:a}),r),"data-component":`Label`,"data-size":i,"data-variant":a,...o})}iS.displayName=`Label`;var aS=U(iS);const oS=()=>(0,l.useContext)(wb).direction,sS=()=>oS()===`rtl`;function cS({children:e,className:t,contextOnly:n,...r}){let i=oS(),a=r.direction??i,o=l.useMemo(()=>({direction:a}),[a]);return n?(0,W.jsx)(wb.Provider,{value:o,children:e}):(0,W.jsx)(wb.Provider,{value:o,children:(0,W.jsx)(`div`,{className:t,"data-component":`DirectionProvider`,dir:a,children:e})})}cS.displayName=`DirectionProvider`;const lS=new Set,uS=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),dS=({containerRef:e,childCount:t,reservedWidth:n,disabled:r})=>{let[i,a]=l.useState(lS),o=sS();return l.useEffect(()=>{let t=e.current;if(!t||r)return;let i=new IntersectionObserver(e=>{a(t=>{let n=new Set(t);for(let t of e){let e=Number(t.target.getAttribute(`data-index`));t.intersectionRatio<1?n.add(e):n.delete(e)}return uS(t,n)?t:n})},{root:t,rootMargin:o?`0px 0px 0px ${-n}px`:`0px ${-n}px 0px 0px`,threshold:1});for(let e of t.querySelectorAll(`[data-index]`))i.observe(e);return()=>{i.disconnect()}},[e,t,n,r,o]),i},fS={item:`label-group-item`,hidden:`label-group-item-hidden`,toggle:`label-group-toggle`,overlay:`label-group-overlay`,overlayItems:`label-group-overlay-items`,overlayCloseButton:`label-group-overlay-close-button`,srOnly:`sr-only`},pS=V(`label-group`,{variants:{wrap:{true:`label-group-wrap`,false:``},list:{true:`label-group-list`,false:``}}}),mS=new Set;function hS(e,t){let{as:n=`ul`,className:r,children:i,overflowStyle:a=`overlay`,visibleChildCount:o,...s}=e,c=l.useRef(null),u=R(t,c),d=l.useRef(null),f=l.useRef(null),p=l.useRef(null),m=l.useRef(void 0),[h,g]=l.useState(!1),[_,v]=l.useState(0),y=l.useCallback(e=>{d.current=e},[]),b=l.Children.toArray(i),x=b.length,S=n===`ul`||n===`ol`,C=S?`li`:`span`,w=o!==void 0,T=h&&a===`inline`;Wi(()=>{let e=d.current;if(!e||o!==`auto`||T)return;let t=()=>v(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[o,T]);let E=dS({containerRef:c,childCount:x,reservedWidth:_,disabled:o!==`auto`||T}),D=l.useMemo(()=>{if(o===void 0||T)return mS;if(o===`auto`)return E;let e=Math.max(x-o,0);return new Set(Array.from({length:e},(e,t)=>o+t))},[o,T,E,x]),O=D.size;l.useEffect(()=>{O>0&&(m.current=Math.min(...D))},[D,O]);let k=l.useRef(h);l.useEffect(()=>{let e=k.current;if(k.current=h,a===`overlay`||e===h)return;if(!h){f.current?.focus();return}let t=c.current?.querySelector(`[data-index="${m.current}"]`);(vr(t??null)[0]??p.current)?.focus()},[h,a]);let A=()=>g(!0),j=()=>g(!1),M=()=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:fS.srOnly,children:[`Show +`,O,` more`]}),(0,W.jsxs)(`span`,{"aria-hidden":`true`,children:[`+`,O]})]}),N=()=>a===`inline`?h?(0,W.jsx)(_i,{ref:p,size:`small`,variant:`invisible`,onClick:j,children:`Show less`}):O>0?(0,W.jsx)(_i,{ref:f,size:`small`,variant:`invisible`,onClick:A,children:M()}):null:O>0?(0,W.jsx)(ga,{open:h,onOpen:A,onClose:j,side:`outside-bottom`,align:`end`,width:`auto`,height:`auto`,overlayProps:{role:`dialog`,"aria-modal":!0,"aria-label":`All ${x} labels`},renderAnchor:e=>(0,W.jsx)(_i,{...e,size:`small`,variant:`invisible`,children:M()}),children:(0,W.jsxs)(`div`,{className:fS.overlay,children:[(0,W.jsx)(`div`,{className:fS.overlayItems,children:i}),(0,W.jsx)(bi,{icon:Sn,"aria-label":`Close`,size:`small`,variant:`invisible`,onClick:j,className:fS.overlayCloseButton,"data-component":`LabelGroup.CloseButton`})]})}):null,P=!w||T;return(0,W.jsxs)(n,{ref:u,className:H(pS({wrap:P,list:S}),r),"data-component":`LabelGroup`,"data-overflow":P?`inline`:void 0,"data-list":S||void 0,...s,children:[b.map((e,t)=>(0,W.jsx)(C,{"data-index":t,"data-hidden":D.has(t)?``:void 0,className:H(fS.item,D.has(t)&&fS.hidden),children:e},t)),w?(0,W.jsx)(C,{ref:y,className:fS.toggle,"data-component":`LabelGroup.Toggle`,children:N()}):null]})}hS.displayName=`LabelGroup`;var gS=U(hS);function _S(e,t){let{as:n=`a`,...r}=e;return(0,W.jsx)(hi,{ref:t,as:n,"data-component":`LinkButton`,...r})}_S.displayName=`LinkButton`;var vS=U(_S);const yS=V(`list`,{variants:{variant:{bullet:`list-bullet`,number:`list-number`,plain:`list-plain`},spacing:{condensed:`list-condensed`,normal:`list-normal`,spacious:`list-spacious`}}});function bS(e,t){let{as:n,className:r,variant:i=`bullet`,spacing:a=`normal`,...o}=e;return(0,W.jsx)(n??(i===`number`?`ol`:`ul`),{ref:t,role:i===`plain`?`list`:void 0,className:H(yS({variant:i,spacing:a}),r),"data-component":`List`,"data-variant":i,"data-spacing":a,...o})}bS.displayName=`List`;var xS=U(bS);const SS={root:`list-item`};function CS(e,t){let{as:n=`li`,className:r,...i}=e;return(0,W.jsx)(n,{ref:t,className:H(SS.root,r),"data-component":`List.Item`,...i})}CS.displayName=`List.Item`;var wS=U(CS);const TS=Object.assign(xS,{Item:wS});var ES={ADD:`add`,REMOVE:`remove`},DS={PROPERTYCHANGE:`propertychange`};function OS(e){for(let t in e)delete e[t]}function kS(e){let t;for(t in e)return!1;return!t}function AS(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function jS(e,t,n,r){return AS(e,t,n,r,!0)}function MS(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),OS(e))}var q={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},NS=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function PS(e,t,n){let r,i;n||=FS;let a=0,o=e.length,s=!1;for(;a<o;)r=a+(o-a>>1),i=+n(e[r],t),i<0?a=r+1:(o=r,s=!i);return s?a:~a}function FS(e,t){return e>t?1:e<t?-1:0}function IS(e,t){return e<t?1:e>t?-1:0}function LS(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function RS(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function zS(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function BS(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function VS(e,t,n){let r=t||FS;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function HS(){return!0}function US(){return!1}function WS(){}function GS(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return(!n||this!==r||!BS(i,n))&&(r=this,n=i,t=e.apply(this,arguments)),t}}function KS(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return t instanceof Promise?t:Promise.resolve(t)}return t()}var qS=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},JS=class extends NS{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new qS(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,WS);delete a[n]}return s}disposeInternal(){this.listeners_&&OS(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=WS,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},YS=class extends JS{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(q.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=AS(this,e[i],t);return r}return AS(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=jS(this,e[i],t)}else n=jS(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)XS(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};YS.prototype.on,YS.prototype.once,YS.prototype.un;function XS(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)MS(e[t]);else MS(e)}function ZS(){throw Error(`Unimplemented abstract method.`)}let QS=0;function J(e){return e.ol_uid||=String(++QS)}var $S=class extends qS{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},eC=class extends YS{constructor(e){super(),this.on,this.once,this.un,J(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new $S(n,e,t)),n=DS.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new $S(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],kS(this.values_)&&(this.values_=null),t||this.notify(e,n)}}};const tC={LENGTH:`length`};var nC=class extends qS{constructor(e,t,n){super(e),this.element=t,this.index=n}},rC=class extends eC{constructor(e,t){if(super(),this.on,this.once,this.un,t||={},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let e=1,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(tC.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new nC(ES.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new nC(ES.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new nC(ES.REMOVE,n,e)),this.dispatchEvent(new nC(ES.ADD,t,e))}updateLength_(){this.set(tC.LENGTH,this.array_.length)}assertUnique_(e,t){let n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e&&r!==t)throw Error(`Duplicate item added to a unique collection`)}};function iC(e,t){if(!e)throw Error(t)}var aC=class e extends eC{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_=`geometry`,this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e){if(typeof e.getSimplifiedGeometry==`function`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}}clone(){let t=new e,n=this.geometryName_;t.setGeometryName(n);let r=this.getPropertiesInternal();if(r){let e=this.getGeometry();for(let i in r)i===n&&e?t.set(i,e.clone()):t.set(i,r[i],!0)}let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&=(MS(this.geometryChangeKey_),null);let e=this.getGeometry();e&&(this.geometryChangeKey_=AS(e,q.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?oC(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){e!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}};function oC(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(iC(typeof e.getZIndex==`function`,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}var sC={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function cC(e){let t=_C();for(let n=0,r=e.length;n<r;++n)TC(t,e[n]);return t}function lC(e,t,n){return vC(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}function uC(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function dC(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function fC(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function pC(e,t){return hC(e,t[0],t[1])}function mC(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function hC(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function gC(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=sC.UNKNOWN;return o<n?c|=sC.LEFT:o>i&&(c|=sC.RIGHT),s<r?c|=sC.BELOW:s>a&&(c|=sC.ABOVE),c===sC.UNKNOWN&&(c=sC.INTERSECTING),c}function _C(){return[1/0,1/0,-1/0,-1/0]}function vC(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function yC(e){return vC(1/0,1/0,-1/0,-1/0,e)}function bC(e,t){let n=e[0],r=e[1];return vC(n,r,n,r,t)}function xC(e,t,n,r,i){return EC(yC(i),e,t,n,r)}function SC(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function CC(e,t,n){return Math.abs(e[0]-t[0])<n&&Math.abs(e[2]-t[2])<n&&Math.abs(e[1]-t[1])<n&&Math.abs(e[3]-t[3])<n}function wC(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function TC(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function EC(e,t,n,r,i){for(;n<r;n+=i)DC(e,t[n],t[n+1]);return e}function DC(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function OC(e,t){let n;return n=t(AC(e)),n||(n=t(jC(e)),n)||(n=t(BC(e)),n)||(n=t(zC(e)),n)?n:!1}function kC(e){let t=0;return UC(e)||(t=VC(e)*IC(e)),t}function AC(e){return[e[0],e[1]]}function jC(e){return[e[2],e[1]]}function MC(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function NC(e,t){let n;if(t===`bottom-left`)n=AC(e);else if(t===`bottom-right`)n=jC(e);else if(t===`top-left`)n=zC(e);else if(t===`top-right`)n=BC(e);else throw Error(`Invalid corner`);return n}function PC(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=FC(e,t,n,r);return vC(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function FC(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function IC(e){return e[3]-e[1]}function LC(e,t,n){let r=n||_C();return HC(e,t)?(r[0]=e[0]>t[0]?e[0]:t[0],r[1]=e[1]>t[1]?e[1]:t[1],r[2]=e[2]<t[2]?e[2]:t[2],r[3]=e[3]<t[3]?e[3]:t[3]):yC(r),r}function RC(e,t){if(!HC(e,t))return[e.slice()];if(mC(t,e))return[];let[n,r,i,a]=e,o=Math.max(n,t[0]),s=Math.max(r,t[1]),c=Math.min(i,t[2]),l=Math.min(a,t[3]),u=[];return o>n&&u.push([n,r,o,a]),c<i&&u.push([c,r,i,a]),s>r&&u.push([o,r,c,s]),l<a&&u.push([o,l,c,a]),u}function zC(e){return[e[0],e[3]]}function BC(e){return[e[2],e[3]]}function VC(e){return e[2]-e[0]}function HC(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function UC(e){return e[2]<e[0]||e[3]<e[1]}function WC(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function GC(e,t){let n=(e[2]-e[0])/2*(t-1),r=(e[3]-e[1])/2*(t-1);e[0]-=n,e[2]+=n,e[1]-=r,e[3]+=r}function KC(e,t,n){let r=!1,i=gC(e,t),a=gC(e,n);if(i===sC.INTERSECTING||a===sC.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&sC.ABOVE&&!(i&sC.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&sC.RIGHT&&!(i&sC.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&sC.BELOW&&!(i&sC.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&sC.LEFT&&!(i&sC.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function qC(e,t,n,r){if(UC(e))return yC(n);let i=[];if(r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a<r;++a)i.push(e[0]+t*a/r,e[1],e[2],e[1]+n*a/r,e[2]-t*a/r,e[3],e[0],e[3]-n*a/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let a=[],o=[];for(let e=0,t=i.length;e<t;e+=2)a.push(i[e]),o.push(i[e+1]);return lC(a,o,n)}function JC(e,t){let n=t.getExtent(),r=MC(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=VC(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function YC(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];JC(e,t);let i=VC(r);if(VC(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function XC(e,t){let n=[e];for(let e=0,r=t.length;e<r&&n.length>0;++e){let r=[];for(let i=0,a=n.length;i<a;++i)r.push(...RC(n[i],t[e]));n=r}return n}function ZC(e,t,n){return Math.min(Math.max(e,t),n)}function QC(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return $C(e,t,n,r)}function $C(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function ew(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function tw(e){return e*180/Math.PI}function nw(e){return e*Math.PI/180}function rw(e,t){let n=e%t;return n*t<0?n+t:n}function iw(e,t,n){return e+n*(t-e)}function aw(e,t){let n=10**t;return Math.round(e*n)/n}function ow(e,t){return Math.floor(aw(e,t))}function sw(e,t){return Math.ceil(aw(e,t))}function cw(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}function lw(e,t,n){n||=6371008.8;let r=nw(e[1]),i=nw(t[1]),a=(i-r)/2,o=nw(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}function uw(e,t){let n=0;for(let r=0,i=e.length;r<i-1;++r)n+=lw(e[r],e[r+1],t);return n}function dw(e,t){t||={};let n=t.radius||6371008.8,r=t.projection||`EPSG:3857`,i=e.getType();i!==`GeometryCollection`&&(e=e.clone().transform(r,`EPSG:4326`));let a=0,o,s,c,l,u,d;switch(i){case`Point`:case`MultiPoint`:break;case`LineString`:case`LinearRing`:o=e.getCoordinates(),a=uw(o,n);break;case`MultiLineString`:case`Polygon`:for(o=e.getCoordinates(),c=0,l=o.length;c<l;++c)a+=uw(o[c],n);break;case`MultiPolygon`:for(o=e.getCoordinates(),c=0,l=o.length;c<l;++c)for(s=o[c],u=0,d=s.length;u<d;++u)a+=uw(s[u],n);break;case`GeometryCollection`:{let n=e.getGeometries();for(c=0,l=n.length;c<l;++c)a+=dw(n[c],t);break}default:throw Error(`Unsupported geometry type: `+i)}return a}function fw(e,t){let n=0,r=e.length,i=e[r-1][0],a=e[r-1][1];for(let t=0;t<r;t++){let r=e[t][0],o=e[t][1];n+=nw(r-i)*(2+Math.sin(nw(a))+Math.sin(nw(o))),i=r,a=o}return n*t*t/2}function pw(e,t){t||={};let n=t.radius||6371008.8,r=t.projection||`EPSG:3857`,i=e.getType();i!==`GeometryCollection`&&(e=e.clone().transform(r,`EPSG:4326`));let a=0,o,s,c,l,u,d;switch(i){case`Point`:case`MultiPoint`:case`LineString`:case`MultiLineString`:case`LinearRing`:break;case`Polygon`:for(o=e.getCoordinates(),a=Math.abs(fw(o[0],n)),c=1,l=o.length;c<l;++c)a-=Math.abs(fw(o[c],n));break;case`MultiPolygon`:for(o=e.getCoordinates(),c=0,l=o.length;c<l;++c)for(s=o[c],a+=Math.abs(fw(s[0],n)),u=1,d=s.length;u<d;++u)a-=Math.abs(fw(s[u],n));break;case`GeometryCollection`:{let n=e.getGeometries();for(c=0,l=n.length;c<l;++c)a+=pw(n[c],t);break}default:throw Error(`Unsupported geometry type: `+i)}return a}const mw={info:1,warn:2,error:3,none:4};let hw=mw.info;function gw(...e){hw>mw.warn||console.warn(...e)}function _w(e,t,n){let r=n===void 0?``+e:e.toFixed(n),i=r.indexOf(`.`);return i=i===-1?r.length:i,i>t?r:Array(1+t-i).join(`0`)+r}function vw(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function yw(e,t){let n=t.getRadius(),r=t.getCenter(),i=r[0],a=r[1],o=e[0],s=e[1],c=o-i,l=s-a;c===0&&l===0&&(c=1);let u=Math.sqrt(c*c+l*l);return[i+n*c/u,a+n*l/u]}function bw(e,t){let n=e[0],r=e[1],i=t[0],a=t[1],o=i[0],s=i[1],c=a[0],l=a[1],u=c-o,d=l-s,f=u===0&&d===0?0:(u*(n-o)+d*(r-s))/(u*u+d*d||0),p,m;return f<=0?(p=o,m=s):f>=1?(p=c,m=l):(p=o+f*u,m=s+f*d),[p,m]}function xw(e,t,n){let r=rw(t+180,360)-180,i=Math.abs(3600*r),a=n||0,o=Math.floor(i/3600),s=Math.floor((i-o*3600)/60),c=aw(i-o*3600-s*60,a);c>=60&&(c=0,s+=1),s>=60&&(s=0,o+=1);let l=o+`°`;return(s!==0||c!==0)&&(l+=` `+_w(s,2)+`′`),c!==0&&(l+=` `+_w(c,2,a)+`″`),r!==0&&(l+=` `+e.charAt(+(r<0))),l}function Sw(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Cw(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function ww(e,t){return e[0]*=t,e[1]*=t,e}function Tw(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Ew(e,t){return Math.sqrt(Tw(e,t))}function Dw(e,t){return Tw(e,bw(e,t))}function Ow(e,t){if(t.canWrapX()){let n=VC(t.getExtent()),r=kw(e,t,n);r&&(e[0]-=r*n)}return e}function kw(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n||=VC(r),i=Math.floor((e[0]-r[0])/n)),i}function Aw(e,t,n){let r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=[(t[0]-e[0])/r,(t[1]-e[1])/r],a=[-i[1],i[0]],o=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),s=[(n[0]-e[0])/o,(n[1]-e[1])/o],c=r===0||o===0?0:Math.acos(ZC(s[0]*i[0]+s[1]*i[1],-1,1));return c=Math.max(c,1e-5),s[0]*a[0]+s[1]*a[1]>0?c:Math.PI*2-c}const jw={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};var Mw=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global!==void 0&&e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||jw[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const Nw=6378137,Pw=Math.PI*Nw,Fw=[-Pw,-Pw,Pw,Pw],Iw=[-180,-85,180,85],Lw=Nw*Math.log(Math.tan(Math.PI/2));var Rw=class extends Mw{constructor(e){super({code:e,units:`m`,extent:Fw,global:!0,worldExtent:Iw,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Nw)}})}};const zw=[new Rw(`EPSG:3857`),new Rw(`EPSG:102100`),new Rw(`EPSG:102113`),new Rw(`EPSG:900913`),new Rw(`http://www.opengis.net/def/crs/EPSG/0/3857`),new Rw(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function Bw(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=Pw*e[n]/180;let r=Nw*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>Lw?r=Lw:r<-Lw&&(r=-Lw),t[n+1]=r}return t}function Vw(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/Pw,t[n+1]=360*Math.atan(Math.exp(e[n+1]/Nw))/Math.PI-90;return t}const Hw=[-180,-90,180,90],Uw=Math.PI*6378137/180;var Ww=class extends Mw{constructor(e,t){super({code:e,units:`degrees`,extent:Hw,axisOrientation:t,global:!0,metersPerUnit:Uw,worldExtent:Hw})}};const Gw=[new Ww(`CRS:84`),new Ww(`EPSG:4326`,`neu`),new Ww(`urn:ogc:def:crs:OGC:1.3:CRS84`),new Ww(`urn:ogc:def:crs:OGC:2:84`),new Ww(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new Ww(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new Ww(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)];let Kw={};function qw(e){return Kw[e]||Kw[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function Jw(e,t){Kw[e]=t}let Yw={};function Xw(e,t,n){let r=e.getCode(),i=t.getCode();r in Yw||(Yw[r]={}),Yw[r][i]=n}function Zw(e,t){return e in Yw&&t in Yw[e]?Yw[e][t]:null}const Qw=.9996,$w=.00669438,eT=$w/.99330562,tT=Math.sqrt(.99330562),nT=(1-tT)/(1+tT),rT=nT*nT,iT=rT*nT,aT=iT*nT,oT=aT*nT,sT=1-$w/4-.0001344441707532/64-15000339463446782e-22/256,cT=3/2*nT-27/32*iT+269/512*oT,lT=21/16*rT-55/32*aT,uT=151/96*iT-417/128*oT,dT=1097/512*aT,fT=6378137;function pT(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/Qw/(fT*sT),a=i+cT*Math.sin(2*i)+lT*Math.sin(4*i)+uT*Math.sin(6*i)+dT*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-$w*s,p=Math.sqrt(1-$w*s),m=fT/p,h=.99330562/f,g=eT*c**2,_=g*g,v=r/(m*Qw),y=v*v,b=y*v,x=b*v,S=x*v,C=S*v,w=a-l/h*(y/2-x/24*(5+3*u+10*g-4*_-9*eT))+C/720*(61+90*u+298*g+45*d-252*eT-3*_),T=(v-b/6*(1+2*u+g)+S/120*(5-2*g+28*u-3*_+8*eT+24*d))/c;return T=cw(T+nw(hT(n.number)),-Math.PI,Math.PI),[tw(T),tw(w)]}function mT(e,t,n){e=cw(e,-180,180),t<-80?t=-80:t>84&&(t=84);let r=nw(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=nw(e),u=nw(hT(n.number)),d=fT/Math.sqrt(1-$w*i**2),f=eT*a**2,p=a*cw(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=fT*(sT*r-.002514607064228144*Math.sin(2*r)+26390466021299826e-22*Math.sin(4*r)-3.418046101696858e-9*Math.sin(6*r)),b=Qw*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*eT))+5e5,x=Qw*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*eT)));return n.north||(x+=1e7),[b,x]}function hT(e){return(e-1)*6-180+3}const gT=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function _T(e){let t=0;for(let n of gT){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function vT(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function yT(e){return _T(e)?new Mw({code:e,units:`m`}):null}function bT(e){let t=_T(e.getCode());return t?{forward:vT(mT,t),inverse:vT(pT,t)}:null}const xT=[bT],ST=[yT];let CT=!0;function wT(e){CT=!(e===void 0||e)}function TT(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function ET(e,t){if(t!==void 0&&e!==t){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];e=t}return e}function DT(e){Jw(e.getCode(),e),Xw(e,e,TT)}function OT(e){e.forEach(DT)}function kT(e){if(typeof e!=`string`)return e;let t=qw(e);if(t)return t;for(let t of ST){let n=t(e);if(n)return n}return null}function AT(e,t,n,r){e=kT(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/jw[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=RT(e,kT(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(lw(e.slice(0,2),e.slice(2,4))+lw(e.slice(4,6),e.slice(6,8)))/2}let s=r?jw[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function jT(e){OT(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Xw(t,e,TT)})})}function MT(e,t,n,r){e.forEach(function(e){t.forEach(function(t){Xw(e,t,n),Xw(t,e,r)})})}function NT(e,t){return e?typeof e==`string`?kT(e):e:kT(t)}function PT(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function FT(e,t){return wT(),VT(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function IT(e,t){let n=VT(e,t===void 0?`EPSG:3857`:t,`EPSG:4326`),r=n[0];return(r<-180||r>180)&&(n[0]=rw(r+180,360)-180),n}function LT(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||RT(e,t)===TT)&&n}function RT(e,t){let n=e.getCode(),r=t.getCode(),i=Zw(n,r);if(i)return i;let a=null,o=null;for(let n of xT)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=Zw(s,r);e&&(i=zT(a.inverse,e))}else if(a)i=zT(a.inverse,o.forward);else{let e=Zw(n,s);e&&(i=zT(e,o.forward))}return i&&(DT(e),DT(t),Xw(e,t,i)),i}function zT(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function BT(e,t){return RT(kT(e),kT(t))}function VT(e,t,n){let r=BT(t,n);if(!r){let e=kT(t).getCode(),r=kT(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function HT(){return null}function UT(e,t){return e}function WT(e,t){return CT&&!Sw(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(CT=!1,gw(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e}function GT(e,t){return e}function KT(e,t){return e}function qT(e,t){return e}function JT(){jT(zw),jT(Gw),MT(Gw,zw,Bw,Vw)}JT();const YT=[1,0,0,1,0,0],XT=[,,,,,,];function ZT(){return YT.slice(0)}function QT(e){return eE(e,1,0,0,1,0,0)}function $T(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return e[0]=n*c+i*l,e[1]=r*c+a*l,e[2]=n*u+i*d,e[3]=r*u+a*d,e[4]=n*f+i*p+o,e[5]=r*f+a*p+s,e}function eE(e,t,n,r,i,a,o){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e}function tE(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function nE(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function rE(e,t){let n=Math.cos(t),r=Math.sin(t);return $T(e,eE(XT,n,r,-r,n,0,0))}function iE(e,t,n){return $T(e,eE(XT,t,0,0,n,0,0))}function aE(e,t,n){return $T(e,eE(XT,1,0,0,1,t,n))}function oE(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function sE(e,t){let n=cE(t);iC(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function cE(e){return e[0]*e[3]-e[1]*e[2]}const lE=[1e5,1e5,1e5,1e5,2,2];function uE(e){return`matrix(`+e.join(`, `)+`)`}function dE(e){return e.substring(7,e.length-1).split(`,`).map(parseFloat)}function fE(e,t){let n=dE(e),r=dE(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*lE[e])!==0)return!1;return!0}function pE(e,t,n,r,i,a,o){a||=[],o||=2;let s=0;for(let c=t;c<n;c+=r){let t=e[c],n=e[c+1];a[s++]=i[0]*t+i[2]*n+i[4],a[s++]=i[1]*t+i[3]*n+i[5];for(let t=2;t<o;t++)a[s++]=e[c+t]}return a&&a.length!=s&&(a.length=s),a}function mE(e,t,n,r,i,a,o){o||=[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function hE(e,t,n,r,i,a,o,s){s||=[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function gE(e,t,n,r,i,a,o){o||=[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}const _E=ZT(),vE=[NaN,NaN];var yE=class extends eC{constructor(){super(),this.extent_=_C(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=GS((e,t,n)=>{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return ZS()}closestPointXY(e,t,n,r){return ZS()}containsXY(e,t){return this.closestPointXY(e,t,vE,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t||=[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return ZS()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&yC(e),this.extentRevision_=this.getRevision()}return WC(this.extent_,e)}rotate(e,t){ZS()}scale(e,t,n){ZS()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return ZS()}getType(){return ZS()}applyTransform(e){ZS()}intersectsExtent(e){return ZS()}translate(e,t){ZS()}transform(e,t){let n=kT(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=IC(o)/IC(a);oE(_E,o[0],o[3],s,-s,0,0,0);let c=pE(e,0,e.length,i,_E,r),l=BT(n,t);return l?l(c,c,i):c}:BT(n,t);return this.applyTransform(r),this}},bE=class extends yE{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return xC(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return ZS()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=SE(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){ZS()}setLayout(e,t,n){let r;if(e)r=SE(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=xE(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith(`XYZ`)?3:2,this.stride),this.changed())}rotate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();mE(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||=MC(this.getExtent());let r=this.getFlatCoordinates();if(r){let i=this.getStride();hE(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();gE(n,0,n.length,r,e,t,n),this.changed()}}};function xE(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function SE(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function CE(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return pE(r,0,r.length,i,t,n)}function wE(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1],s=0,c=0;for(;t<n;t+=r){let n=e[t]-a,r=e[t+1]-o;i+=c*n-s*r,s=n,c=r}return i/2}function TE(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=wE(e,t,o,r),t=o}return i}function EE(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=TE(e,t,o,r),t=o[o.length-1]}return i}function DE(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=iw(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function OE(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=$C(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function kE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=OE(e,t,o,r,i),t=o}return i}function AE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=kE(e,t,o,r,i),t=o[o.length-1]}return i}function jE(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=$C(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u||=[NaN,NaN];let p=t+r;for(;p<n;)if(DE(e,p-r,p,r,o,s,u),f=$C(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(DE(e,n-r,t,r,o,s,u),f=$C(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}function ME(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=jE(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function NE(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=ME(e,t,f,r,i,a,o,s,c,l,u),t=f[f.length-1]}return l}function PE(e,t,n,r){for(let r=0,i=n.length;r<i;++r)e[t++]=n[r];return t}function FE(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function IE(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=FE(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function LE(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=IE(e,t,n[o],r,i[a]);s.length===0&&(s[0]=t),i[a++]=s,t=s[s.length-1]}return i.length=a,i}function RE(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function zE(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=RE(e,t,s,r,i[a]),t=s}return i.length=a,i}function BE(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:zE(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function VE(e,t,n,r,i){return!OC(i,function(i){return!HE(e,t,n,r,i[0],i[1])})}function HE(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function UE(e,t,n,r,i,a){if(n.length===0||!HE(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(HE(e,n[t-1],n[t],r,i,a))return!1;return!0}function WE(e,t,n,r,i,a){if(n.length===0)return!1;for(let o=0,s=n.length;o<s;++o){let s=n[o];if(UE(e,t,s,r,i,a))return!0;t=s[s.length-1]}return!1}function GE(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function KE(e,t){let[n,r]=e,[i,a]=t,o=((n[0]-i[0])*(i[1]-a[1])-(n[1]-i[1])*(i[0]-a[0]))/((n[0]-r[0])*(i[1]-a[1])-(n[1]-r[1])*(i[0]-a[0])),s=((n[0]-i[0])*(n[1]-r[1])-(n[1]-i[1])*(n[0]-r[0]))/((n[0]-r[0])*(i[1]-a[1])-(n[1]-r[1])*(i[0]-a[0]));if(0<=o&&o<=1&&0<=s&&s<=1)return[n[0]+o*(r[0]-n[0]),n[1]+o*(r[1]-n[1])]}function qE(e,t,n,r,i,a){return a??=EC(_C(),e,t,n,r),HC(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]||GE(e,t,n,r,function(e,t){return KC(i,e,t)}):!1}function JE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){if(qE(e,t,n[a],r,i))return!0;t=n[a]}return!1}function YE(e,t,n,r,i){return!!(qE(e,t,n,r,i)||HE(e,t,n,r,i[0],i[1])||HE(e,t,n,r,i[0],i[3])||HE(e,t,n,r,i[2],i[1])||HE(e,t,n,r,i[2],i[3]))}function XE(e,t,n,r,i){if(!YE(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(VE(e,n[t-1],n[t],r,i)&&!qE(e,n[t-1],n[t],r,i))return!1;return!0}function ZE(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(XE(e,t,o,r,i))return!0;t=o[o.length-1]}return!1}function QE(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=e[t],r=e[t+1],i=QC(n,r,s,d,f,p);i>o&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function $E(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=QE(e,t,l,r,i,a,o),s.push(o),t=l}return o}function eD(e,t){return t*Math.round(e/t)}function tD(e,t,n,r,i,a,o){if(t==n)return o;let s=eD(e[t],i),c=eD(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=eD(e[t],i),u=eD(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=eD(e[t],i),d=eD(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;if(f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function nD(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=tD(e,t,l,r,i,a,o),s.push(o),t=l}return o}function rD(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c],u=[];o=nD(e,t,l,r,i,a,o,u),s.push(u),t=l[l.length-1]}return o}var iD=class e extends bE{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(OE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return wE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return RE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=QE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return qE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=FE(this.flatCoordinates,0,e,this.stride),this.changed()}},aD=class e extends bE{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=$C(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return bC(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return hC(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||=[],this.flatCoordinates.length=PE(this.flatCoordinates,0,e,this.stride),this.changed()}};function oD(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m=i[a+1],h=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(u=e[a-r],f=e[a-r+1],s=t;s<a;s+=r)d=e[s],p=e[s+1],(m<=f&&p<=m||f<=m&&m<=p)&&(l=(m-f)/(p-f)*(d-u)+u,h.push(l)),u=d,f=p}let g=NaN,_=-1/0;for(h.sort(FS),u=h[0],s=1,c=h.length;s<c;++s){d=h[s];let i=Math.abs(d-u);i>_&&(l=(u+d)/2,UE(e,t,n,r,l,m)&&(g=l,_=i)),u=d}return isNaN(g)&&(g=i[a]),o?(o.push(g,m,_),o):[g,m,_]}function sD(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=oD(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function cD(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function lD(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function uD(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=lD(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function dD(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(!uD(e,t,o,r,i))return!1;o.length&&(t=o[o.length-1])}return!0}function fD(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=lD(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&cD(e,t,o,r),t=o}return t}function pD(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=fD(e,t,n[a],r,i);return t}function mD(e,t){let n=[],r=0,i=0,a;for(let o=0,s=t.length;o<s;++o){let s=t[o],c=lD(e,r,s,2);if(a===void 0&&(a=c),c===a)n.push(t.slice(i,o+1));else{if(n.length===0)continue;n[n.length-1].push(t[i])}i=o+1,r=s}return n}var hD=class e extends bE{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?zS(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(kE(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ME(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return UE(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return TE(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),fD(t,0,this.ends_,this.stride,e)),zE(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=MC(this.getExtent());this.flatInteriorPoint_=oD(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new aD(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new iD(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new iD(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;uD(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=fD(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=nD(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return XE(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=IE(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function gD(e){if(UC(e))throw Error(`Cannot create polygon from empty extent`);let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new hD(a,`XY`,[a.length])}function _D(e,t,n){t||=32;let r=e.getStride(),i=e.getLayout(),a=e.getCenter(),o=r*(t+1),s=Array(o);for(let e=0;e<o;e+=r){s[e]=0,s[e+1]=0;for(let t=2;t<r;t++)s[e+t]=a[t]}let c=new hD(s,i,[s.length]);return vD(c,a,e.getRadius(),n),c}function vD(e,t,n,r){let i=e.getFlatCoordinates(),a=e.getStride(),o=i.length/a-1,s=r||0;for(let e=0;e<=o;++e){let r=e*a,c=s+rw(e,o)*2*Math.PI/o;i[r]=t[0]+n*Math.cos(c),i[r+1]=t[1]+n*Math.sin(c)}e.changed()}var yD={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};const bD=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``,xD=bD.includes(`safari`)&&!bD.includes(`chrom`)&&(bD.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(bD)),SD=bD.includes(`webkit`)&&!bD.includes(`edge`),CD=bD.includes(`macintosh`),wD=typeof devicePixelRatio<`u`?devicePixelRatio:1,TD=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,ED=typeof Image<`u`&&Image.prototype.decode,DD=(function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})();function OD(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[jS(r,q.LOAD,function(){o=!0,a||t()})];return r.src&&ED?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(jS(r,q.ERROR,n)),function(){i=!1,s.forEach(MS)}}function kD(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function AD(e,t){return t&&(e.src=t),e.src&&ED?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):kD(e)}var Y={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function jD(e){return e**3}function MD(e){return 1-jD(1-e)}function ND(e){return 3*e*e-2*e*e*e}function PD(e){return e}var FD=class extends JS{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(q.CHANGE)}release(){this.setState(Y.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==Y.EMPTY){if(this.state!==Y.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){ZS()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:jD(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}};function ID(e,t,n,r){let i;return i=n&&n.length?n.shift():TD?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}let LD;function RD(){return LD||=ID(1,1),LD}function zD(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function BD(e){let t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),t}function VD(e){let t=e.offsetHeight,n=getComputedStyle(e);return t+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),t}function HD(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function UD(e){for(;e.lastChild;)e.lastChild.remove()}function WD(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;if(i!==a){if(!i){e.appendChild(a);continue}if(!a){e.removeChild(i),--r;continue}e.insertBefore(a,i)}}}function GD(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){let t=this.childNodes.indexOf(e);if(t===-1)throw Error(`Node to remove was not found`);return this.childNodes.splice(t,1),e},insertBefore:function(e,t){let n=this.childNodes.indexOf(t);if(n===-1)throw Error(`Reference node not found`);return this.childNodes.splice(n,0,e),e},style:{}},{get(e,t,n){return t===`firstElementChild`?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,n)}})}function KD(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas}var qD=class extends FD{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=n,this.key=n,this.image_,TD?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=Y.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=Y.ERROR,this.unlistenImage_(),this.image_=JD(),this.changed()}handleImageLoad_(){if(TD)this.state=Y.LOADED;else{let e=this.image_;this.state=e.naturalWidth&&e.naturalHeight?Y.LOADED:Y.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==Y.ERROR&&(this.state=Y.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==Y.IDLE&&(this.state=Y.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=OD(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function JD(){let e=ID(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var YD=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}};function XD(e,t,n,r,i,a,o){let s,c,l=(n-t)/r;if(l===1)s=t;else if(l===2)s=t,c=i;else if(l!==0){let a=e[t],o=e[t+1],l=0,u=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];l+=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),u.push(l),a=t,o=n}let d=i*l,f=PS(u,d);f<0?(c=(d-u[-f-2])/(u[-f-1]-u[-f-2]),s=t+(-f-2)*r):s=t+f*r}o=o>1?o:2,a||=Array(o);for(let t=0;t<o;++t)a[t]=s===void 0?NaN:c===void 0?e[s+t]:iw(e[s+t],e[s+r+t],c);return a}function ZD(e,t,n,r,i,a){if(n==t)return null;let o;if(i<e[t+r-1])return a?(o=e.slice(t,t+r),o[r-1]=i,o):null;if(e[n-1]<i)return a?(o=e.slice(n-r,n),o[r-1]=i,o):null;if(i==e[t+r-1])return e.slice(t,t+r);let s=t/r,c=n/r;for(;s<c;){let t=s+c>>1;i<e[(t+1)*r-1]?c=t:s=t+1}let l=e[s*r-1];if(i==l)return e.slice((s-1)*r,(s-1)*r+r);let u=e[(s+1)*r-1],d=(i-l)/(u-l);o=[];for(let t=0;t<r-1;++t)o.push(iw(e[(s-1)*r+t],e[s*r+t],d));return o.push(i),o}function QD(e,t,n,r,i,a,o){if(o)return ZD(e,t,n[n.length-1],r,i,a);let s;if(i<e[r-1])return a?(s=e.slice(0,r),s[r-1]=i,s):null;if(e[e.length-1]<i)return a?(s=e.slice(e.length-r),s[r-1]=i,s):null;for(let a=0,o=n.length;a<o;++a){let o=n[a];if(t!=o){if(i<e[t+r-1])return null;if(i<=e[o-1])return ZD(e,t,o,r,i,!1);t=o}}return null}function $D(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}var eO=class e extends bE{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){zS(this.flatCoordinates,e),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(OE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,n,r))}forEachSegment(e){return GE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!=`XYM`&&this.layout!=`XYZM`?null:(t=t!==void 0&&t,ZD(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return RE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return XD(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return $D(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){let n=[];return n.length=QE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LineString`}intersectsExtent(e){return qE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=FE(this.flatCoordinates,0,e,this.stride),this.changed()}};function tO(e,t,n){let r=[],i=e(0),a=e(1),o=t(i),s=t(a),c=[a,i],l=[s,o],u=[1,0],d={},f=1e5,p,m,h,g,_,v;for(;--f>0&&u.length>0;)h=u.pop(),i=c.pop(),o=l.pop(),v=h.toString(),v in d||(r.push(o[0],o[1]),d[v]=!0),g=u.pop(),a=c.pop(),s=l.pop(),_=(h+g)/2,p=e(_),m=t(p),QC(m[0],m[1],o[0],o[1],s[0],s[1])<n?(r.push(s[0],s[1]),v=g.toString(),d[v]=!0):(u.push(g,_,_,h),l.push(s,m,m,o),c.push(a,p,p,i));return r}function nO(e,t,n,r,i){return tO(function(r){return[e,t+(n-t)*r]},BT(kT(`EPSG:4326`),r),i)}function rO(e,t,n,r,i){return tO(function(r){return[t+(n-t)*r,e]},BT(kT(`EPSG:4326`),r),i)}const iO=[NaN,NaN,NaN,0];let aO;function oO(){return aO||=ID(1,1,void 0,{willReadFrequently:!0,desynchronized:!0}),aO}const sO=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,cO=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,lO=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,uO=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function dO(e,t){return e.endsWith(`%`)?Number(e.substring(0,e.length-1))/t:Number(e)}function fO(e){throw Error(`failed to parse "`+e+`" as color`)}function pO(e){if(e.toLowerCase().startsWith(`rgb`)){let t=e.match(cO)||e.match(sO)||e.match(lO);if(t){let e=t[4],n=100/255;return[ZC(dO(t[1],n)+.5|0,0,255),ZC(dO(t[2],n)+.5|0,0,255),ZC(dO(t[3],n)+.5|0,0,255),e===void 0?1:ZC(dO(e,100),0,1)]}fO(e)}if(e.startsWith(`#`)){if(uO.test(e)){let t=e.substring(1),n=t.length<=4?1:2,r=[0,0,0,255];for(let e=0,i=t.length;e<i;e+=n){let i=parseInt(t.substring(e,e+n),16);n===1&&(i+=i<<4),r[e/n]=i}return r[3]/=255,r}fO(e)}let t=oO();t.fillStyle=`#abcdef`;let n=t.fillStyle;t.fillStyle=e,t.fillStyle===n&&(t.fillStyle=`#fedcba`,n=t.fillStyle,t.fillStyle=e,t.fillStyle===n&&fO(e));let r=t.fillStyle;if(r.startsWith(`#`)||r.startsWith(`rgba`))return pO(r);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let i=Array.from(t.getImageData(0,0,1,1).data);return i[3]=aw(i[3]/255,3),i}function mO(e){return typeof e==`string`?e:EO(e)}const hO={};let gO=0;function _O(e){if(e.length===4)return e;let t=e.slice();return t[3]=1,t}function vO(e){return e>.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function yO(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function bO(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function xO(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function SO(e){let t=bO(e[0]),n=bO(e[1]),r=bO(e[2]),i=xO(t*.222488403+n*.716873169+r*.06060791),a=500*(xO(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-xO(t*.016863605+n*.117638439+r*.865350722)),s=180/Math.PI*Math.atan2(o,a);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function CO(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=yO(t),a=yO(t+n/500*Math.cos(r)),o=yO(t-n/200*Math.sin(r)),s=vO(a*3.021973625-i*1.617392459-o*.404875592),c=vO(a*-.943766287+i*1.916279586+o*.027607165),l=vO(a*.069407491-i*.22898585+o*1.159737864);return[ZC(s+.5|0,0,255),ZC(c+.5|0,0,255),ZC(l+.5|0,0,255),e[3]]}function wO(e){if(e===`none`)return iO;if(hO.hasOwnProperty(e))return hO[e];if(gO>=1024){let e=0;for(let t in hO)e++&3||(delete hO[t],--gO)}let t=pO(e);t.length!==4&&fO(e);for(let n of t)isNaN(n)&&fO(e);return hO[e]=t,++gO,t}function TO(e){return Array.isArray(e)?e:wO(e)}function EO(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}var DO=class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t){let n=OO(e,t);return n in this.cache_?this.cache_[n]:null}getPattern(e,t){let n=OO(e,t);return n in this.patternCache_?this.patternCache_[n]:null}set(e,t,n,r){let i=OO(e,t),a=i in this.cache_;this.cache_[i]=n,r&&(n.getImageState()===yD.IDLE&&n.load(),n.getImageState()===yD.LOADING?n.ready().then(()=>{this.patternCache_[i]=RD().createPattern(n.getImage(1),`repeat`)}):this.patternCache_[i]=RD().createPattern(n.getImage(1),`repeat`)),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function OO(e,t){let n=t?TO(t):`null`;return e+`:`+n}const kO=new DO;let AO=null;var jO=class extends JS{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n?.crossOrigin,this.referrerPolicy_=n?.referrerPolicy,this.canvas_={},this.color_=i,this.imageState_=r===void 0?yD.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===yD.LOADED){AO||=ID(1,1,void 0,{willReadFrequently:!0}),AO.drawImage(this.image_,0,0);try{AO.getImageData(0,0,1,1),this.tainted_=!1}catch{AO=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(q.CHANGE)}handleImageError_(){this.imageState_=yD.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=yD.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}setImage(e){this.image_=e}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_){if(this.isTainted_()){let e=this.size_[0],t=this.size_[1],n=ID(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_}return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===yD.IDLE){this.image_||this.initializeImage_(),this.imageState_=yD.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&AD(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==yD.LOADED)return;let t=this.image_,n=ID(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=mO(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||=new Promise(e=>{if(this.imageState_===yD.LOADED||this.imageState_===yD.ERROR)e();else{let t=()=>{(this.imageState_===yD.LOADED||this.imageState_===yD.ERROR)&&(this.removeEventListener(q.CHANGE,t),e())};this.addEventListener(q.CHANGE,t)}}),this.ready_}};function MO(e,t,n,r,i,a){let o=t===void 0?void 0:kO.get(t,i);return o||(o=new jO(e,e&&`src`in e?e.src||void 0:t,n,r,i),kO.set(t,i,o,a)),a&&o&&!kO.getPattern(t,i)&&kO.set(t,i,o,a),o}function NO(e){return e?Array.isArray(e)?EO(e):typeof e==`object`&&`src`in e?PO(e):e:null}function PO(e){if(!e.offset||!e.size)return kO.getPattern(e.src,e.color);let t=e.src+`:`+e.offset,n=kO.getPattern(t,e.color);if(n)return n;let r=kO.get(e.src,null);if(r.getImageState()!==yD.LOADED)return null;let i=ID(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),MO(i.canvas,t,void 0,yD.LOADED,e.color,!0),kO.getPattern(t,e.color)}function FO(e,t,n,r,i,a,o,s){o??=[],s??=r;let c=e[t+r],l=e[t+r+1],u=e[n-2*r],d=e[n-2*r+1],f,p,m,h,g,_,v,y,b=0;for(let x=t;x<n;x+=r){m=f,h=p,g=void 0,_=void 0,x+r<n&&(g=e[x+r],_=e[x+r+1]),a&&x===t&&(m=u,h=d),a&&x===n-r&&(g=c,_=l),f=e[x],p=e[x+1],[v,y]=IO(f,p,m,h,g,_,i),o[b++]=v,o[b++]=y;for(let t=2;t<s;t++)o[b++]=e[x+t]}return o.length!=b&&(o.length=b),o}function IO(e,t,n,r,i,a,o){let s,c;n!==void 0&&r!==void 0?(s=e-n,c=t-r):i!==void 0&&a!==void 0?(s=i-e,c=a-t):(s=1,c=0);let l=Math.hypot(s,c),u=s/l,d=c/l;if(s=-d,c=u,n===void 0||r===void 0||i===void 0||a===void 0)return[e+s*o,t+c*o];let f=Aw([e,t],[n,r],[i,a]);if(Math.cos(f)>.998)return[e+u*o,t+d*o];let p=Math.cos(f/2),m=Math.sin(f/2),h=m*s+p*c,g=-p*s+m*c,_=1/m*h,v=1/m*g;return[e+_*o,t+v*o]}function LO(e,t,n=!1){for(let r=0,i=e.length-2;r<i;r+=t){let i=n&&r===0?e.length-3*t:e.length-2*t;for(let n=i;n>r+t;n-=t){let i=e[r],a=e[r+1],o=e[r+t],s=e[r+t+1],c=e[n],l=e[n+1],u=e[n+t],d=e[n+t+1],f=(d-l)*(o-i)-(u-c)*(s-a);if(f===0)continue;let p=((u-c)*(a-l)-(d-l)*(i-c))/f,m=((o-i)*(a-l)-(s-a)*(i-c))/f;if(p>0&&p<1&&m>0&&m<1){let c=i+p*(o-i),l=a+p*(s-a);e[r+t]=c,e[r+t+1]=l,e.splice(r+2*t,n-r-t);break}}}return e}var RO=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}};const zO=`ol-hidden`,BO=`ol-unsupported`,VO=`ol-collapsed`,HO=new RegExp([`^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)`,`(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?`,`(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))`,`(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))`,`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(``),`i`),UO=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],WO={normal:400,bold:700},GO=function(e){let t=e.match(HO);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=UO.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[UO[e]]=typeof r==`string`?r.trim():r)}return isNaN(Number(n.weight))&&n.weight in WO&&(n.weight=WO[n.weight]),n.families=n.family.split(/,\s?/).map(e=>e.trim().replace(/^['"]|['"]$/g,``)),n},KO=`#000`,qO=`round`,JO=[],YO=`round`,XO=`#000`,ZO=`center`,QO=[0,0,0,0],$O=new eC;let ek=null,tk;const nk={},rk=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function ik(e,t,n){return`${e} ${t} 16px "${n}"`}const ak=(function(){let e,t;async function n(e){await t.ready;let n=GO(e),r=n.families[0].toLowerCase(),i=n.weight,a=[];return t.forEach(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),o=WO[e.weight]||e.weight;t===r&&e.style===n.style&&o==i&&a.push(e)}),a.length!==0&&(await Promise.all(a.map(e=>e.load().then(()=>!0,()=>!1)))).some(e=>e)}async function r(){await t.ready;let i=!0,a=$O.getProperties(),o=Object.keys(a).filter(e=>a[e]<100);for(let e=o.length-1;e>=0;--e){let t=o[e],r=a[t];r<100&&(await n(t)?(OS(nk),$O.set(t,100)):(r+=10,$O.set(t,r,!0),r<100&&(i=!1)))}e=void 0,i||(e=setTimeout(r,100))}return async function(n){t||=TD?self.fonts:document.fonts;let i=GO(n);if(!i)return;let a=i.families,o=!1;for(let e of a){if(rk.has(e))continue;let t=ik(i.style,i.weight,e);$O.get(t)===void 0&&($O.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}})(),ok=(function(){let e;return function(t){let n=nk[t];if(n==null){if(TD){let e=GO(t),r=sk(t,`Žg`);n=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);nk[t]=n}return n}})();function sk(e,t){return ek||=ID(1,1),e!=tk&&(ek.font=e,tk=ek.font),ek.measureText(t)}function ck(e,t){return sk(e,t).width}function lk(e,t,n){if(t in n)return n[t];let r=t.split(`
|
|
32
32
|
`).reduce((t,n)=>Math.max(t,ck(e,n)),0);return n[t]=r,r}function uk(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===`
|
|
33
33
|
`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=ck(f,d);n.push(p),o+=p;let m=ok(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function dk(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),fk(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function fk(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var pk=class extends RO{constructor(e,t,n,r,i,a,o){super(),this.context_=e,this.pixelRatio_=t,this.extent_=n,this.transform_=r,this.transformRotation_=r?aw(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=i,this.squaredTolerance_=a,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=ZT()}drawImages_(e,t,n,r){if(!this.image_)return;let i=pE(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,s=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=s*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let e=0,t=i.length;e<t;e+=2){let t=i[e]-this.imageAnchorX_,n=i[e+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){let e=t+this.imageAnchorX_,r=n+this.imageAnchorY_;oE(o,e,r,1,1,c,-e,-r),a.save(),a.transform.apply(a,o),a.translate(e,r),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,n,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=s)}drawText_(e,t,n,r){if(!this.textState_||this.text_===``)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let i=pE(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);t<n;t+=r){let e=i[t]+this.textOffsetX_,n=i[t+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(e-this.textOffsetX_,n-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,e,n),this.textFillState_&&a.fillText(this.text_,e,n))}}moveToLineTo_(e,t,n,r,i,a){let o=this.context_,s=pE(e,t,n,r,this.transform_,this.pixelCoordinates_);if(Math.abs(a)>0){let e=s.length,t=i||Math.abs(s[0]-s[e-2])<1e-6&&Math.abs(s[1]-s[e-1])<1e-6;s=FO(s,0,e,2,a,t,s),LO(s,2,t)}o.moveTo(s[0],s[1]);let c=s.length;i&&(c-=2);for(let e=2;e<c;e+=2)o.lineTo(s[e],s[e+1]);return i&&o.closePath(),n}drawRings_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=this.moveToLineTo_(e,t,n[a],r,!0,i);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),HC(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=CE(e,this.transform_,this.pixelCoordinates_),n=t[2]-t[0],r=t[3]-t[1],i=Math.sqrt(n*n+r*r),a=this.context_;a.beginPath(),a.arc(t[0],t[1],i,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==``&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case`Point`:this.drawPoint(e);break;case`LineString`:this.drawLineString(e);break;case`Polygon`:this.drawPolygon(e);break;case`MultiPoint`:this.drawMultiPoint(e);break;case`MultiLineString`:this.drawMultiLineString(e);break;case`MultiPolygon`:this.drawMultiPolygon(e);break;case`GeometryCollection`:this.drawGeometryCollection(e);break;case`Circle`:this.drawCircle(e)}}drawFeature(e,t){let n=t.getGeometryFunction()(e);n&&(this.setStyle(t),this.drawGeometry(n))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,n=t.length;e<n;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),HC(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(n,0,n.length,e.getStride(),!1,this.strokeState_.strokeOffset),t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(HC(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates(),r=0,i=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e)r=this.moveToLineTo_(n,r,i[e],a,!1,this.strokeState_.strokeOffset);t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),HC(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride(),this.strokeState_?.strokeOffset),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),HC(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getOrientedFlatCoordinates(),r=0,i=e.getEndss(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e){let t=i[e];r=this.drawRings_(n,r,t,a,this.strokeState_?.strokeOffset)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,n=this.contextFillState_;n?n.fillStyle!=e.fillStyle&&(n.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=e.lineCap&&(n.lineCap=e.lineCap,t.lineCap=e.lineCap),BS(n.lineDash,e.lineDash)||t.setLineDash(n.lineDash=e.lineDash),n.lineDashOffset!=e.lineDashOffset&&(n.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),n.lineJoin!=e.lineJoin&&(n.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),n.lineWidth!=e.lineWidth&&(n.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),n.miterLimit!=e.miterLimit&&(n.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),n.strokeStyle!=e.strokeStyle&&(n.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){let t=this.context_,n=this.contextTextState_,r=e.textAlign?e.textAlign:ZO;n?(n.font!=e.font&&(n.font=e.font,t.font=e.font),n.textAlign!=r&&(n.textAlign=r,t.textAlign=r),n.textBaseline!=e.textBaseline&&(n.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{let t=e.getColor();this.fillState_={fillStyle:NO(t||KO)}}if(!t)this.strokeState_=null;else{let e=t.getColor(),n=t.getLineCap(),r=t.getLineDash(),i=t.getLineDashOffset(),a=t.getLineJoin(),o=t.getWidth(),s=t.getMiterLimit(),c=r||JO,l=t.getOffset();this.strokeState_={lineCap:n===void 0?qO:n,lineDash:this.pixelRatio_===1?c:c.map(e=>e*this.pixelRatio_),lineDashOffset:(i||0)*this.pixelRatio_,lineJoin:a===void 0?YO:a,lineWidth:(o===void 0?1:o)*this.pixelRatio_,miterLimit:s===void 0?10:s,strokeStyle:NO(e||XO),strokeOffset:(l??0)*this.pixelRatio_}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();if(!t)this.textFillState_=null;else{let e=t.getColor();this.textFillState_={fillStyle:NO(e||KO)}}let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?qO:t,lineDash:r||JO,lineDashOffset:i||0,lineJoin:a===void 0?YO:a,lineWidth:o===void 0?1:o,miterLimit:s===void 0?10:s,strokeStyle:NO(e||XO)}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?`10px sans-serif`:r,textAlign:u===void 0?ZO:u,textBaseline:d===void 0?`middle`:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o!==void 0&&o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}};const mk={Point:Ek,LineString:Ck,Polygon:Ok,MultiPoint:Dk,MultiLineString:wk,MultiPolygon:Tk,GeometryCollection:Sk,Circle:vk};function hk(e,t){return parseInt(J(e),10)-parseInt(J(t),10)}function gk(e,t){let n=_k(e,t);return n*n}function _k(e,t){return .5*e/t}function vk(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Circle`);s.setFillStrokeStyle(a,o),s.drawCircle(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function yk(e,t,n,r,i,a,o,s){let c=[],l=n.getImage();if(l){let e=!0,t=l.getImageState();t==yD.LOADED||t==yD.ERROR?e=!1:t==yD.IDLE&&l.load(),e&&c.push(l.ready())}let u=n.getFill();u&&u.loading()&&c.push(u.ready());let d=c.length>0;return d&&Promise.all(c).then(()=>i(null)),bk(e,t,n,r,a,o,s),d}function bk(e,t,n,r,i,a,o){let s=n.getGeometryFunction()(t);if(!s)return;let c=s.simplifyTransformed(r,i);if(n.getRenderer())xk(e,c,n,t,o);else{let r=mk[c.getType()];r(e,c,n,t,o,a)}}function xk(e,t,n,r,i){if(t.getType()==`GeometryCollection`){let a=t.getGeometries();for(let t=0,o=a.length;t<o;++t)xk(e,a[t],n,r,i);return}e.getBuilder(n.getZIndex(),`Default`).drawCustom(t,r,n.getRenderer(),n.getHitDetectionRenderer(),i)}function Sk(e,t,n,r,i,a){let o=t.getGeometriesArray(),s,c;for(s=0,c=o.length;s<c;++s){let t=mk[o[s].getType()];t(e,o[s],n,r,i,a)}}function Ck(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function wk(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawMultiLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function Tk(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(o||a){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawMultiPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function Ek(e,t,n,r,i,a){let o=n.getImage(),s=n.getText(),c=s&&s.getText(),l=a&&o&&c?{}:void 0;if(o){if(o.getImageState()!=yD.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,l),a.drawPoint(t,r,i)}if(c){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s,l),a.drawText(t,r,i)}}function Dk(e,t,n,r,i,a){let o=n.getImage(),s=o&&o.getOpacity()!==0,c=n.getText(),l=c&&c.getText(),u=a&&s&&l?{}:void 0;if(s){if(o.getImageState()!=yD.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,u),a.drawMultiPoint(t,r,i)}if(l){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(c,u),a.drawText(t,r,i)}}function Ok(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function kk(e){if(!(e.context instanceof CanvasRenderingContext2D))throw Error(`Only works for render events from Canvas 2D layers`);let t=e.inversePixelTransform[0],n=e.inversePixelTransform[1],r=Math.sqrt(t*t+n*n),i=e.frameState,a=$T(e.inversePixelTransform.slice(),i.coordinateToPixelTransform),o=gk(i.viewState.resolution,r),s,c=HT();return c&&(s=RT(c,i.viewState.projection)),new pk(e.context,r,i.extent,a,i.viewState.rotation,o,s)}var Ak={PRERENDER:`prerender`,POSTRENDER:`postrender`,PRECOMPOSE:`precompose`,POSTCOMPOSE:`postcompose`,RENDERCOMPLETE:`rendercomplete`};function jk(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=!1,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.getType();try{let r;e==`text`||e==`json`?r=s.responseText:e==`xml`?r=s.responseXML||s.responseText:e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}catch{o()}}else o()},s.onerror=o,s.send()}function Mk(e,t){return function(n,r,i,a,o){jk(e,t,n,r,i,(e,t)=>{this.addFeatures(e),a!==void 0&&a(e)},()=>{this.changed(),o!==void 0&&o()})}}function Nk(e,t){return[[-1/0,-1/0,1/0,1/0]]}var Pk=class e extends bE{constructor(e,t,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&n)this.setFlatCoordinates(t,e),this.ends_=n;else{let t=e,n=[],r=[];for(let e=0,i=t.length;e<i;++e){let i=t[e];zS(n,i.getFlatCoordinates()),r.push(n.length)}let i=t.length===0?this.getLayout():t[0].getLayout();this.setFlatCoordinates(i,n),this.ends_=r}}appendLineString(e){zS(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(kE(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ME(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,n,r))}getCoordinateAtM(e,t,n){return this.layout!=`XYM`&&this.layout!=`XYZM`||this.flatCoordinates.length===0?null:(t=t!==void 0&&t,n=n!==void 0&&n,QD(this.flatCoordinates,0,this.ends_,this.stride,e,t,n))}getCoordinates(){return zE(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new eO(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){let e=this.flatCoordinates,t=this.ends_,n=this.layout,r=[],i=0;for(let a=0,o=t.length;a<o;++a){let o=t[a],s=new eO(e.slice(i,o),n);r.push(s),i=o}return r}getLength(){let e=this.ends_,t=0,n=0;for(let r=0,i=e.length;r<i;++r)n+=$D(this.flatCoordinates,t,e[r],this.stride),t=e[r];return n}getFlatMidpoints(){let e=[],t=this.flatCoordinates,n=0,r=this.ends_,i=this.stride;for(let a=0,o=r.length;a<o;++a){let o=r[a];zS(e,XD(t,n,o,i,.5)),n=o}return e}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=$E(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,`XY`,r)}getType(){return`MultiLineString`}intersectsExtent(e){return JE(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=IE(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},Fk=class e extends bE{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){zS(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<fC(this.getExtent(),e,t))return r;let i=this.flatCoordinates,a=this.stride;for(let o=0,s=i.length;o<s;o+=a){let s=$C(e,t,i[o],i[o+1]);if(s<r){r=s;for(let e=0;e<a;++e)n[e]=i[o+e];n.length=a}}return r}getCoordinates(){return RE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){let t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new aD(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){let e=this.flatCoordinates,t=this.layout,n=this.stride,r=[];for(let i=0,a=e.length;i<a;i+=n){let a=new aD(e.slice(i,i+n),t);r.push(a)}return r}getType(){return`MultiPoint`}intersectsExtent(e){let t=this.flatCoordinates,n=this.stride;for(let r=0,i=t.length;r<i;r+=n){let n=t[r],i=t[r+1];if(hC(e,n,i))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=FE(this.flatCoordinates,0,e,this.stride),this.changed()}};function Ik(e,t,n,r){let i=[],a=_C();for(let o=0,s=n.length;o<s;++o){let s=n[o];a=xC(e,t,s[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=s[s.length-1]}return i}var Lk=class e extends bE{constructor(e,t,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){let r=e,i=[],a=[];for(let e=0,t=r.length;e<t;++e){let t=r[e],n=i.length,o=t.getEnds();for(let e=0,t=o.length;e<t;++e)o[e]+=n;zS(i,t.getFlatCoordinates()),a.push(o)}t=r.length===0?this.getLayout():r[0].getLayout(),e=i,n=a}t!==void 0&&n?(this.setFlatCoordinates(t,e),this.endss_=n):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{let n=this.flatCoordinates.length;zS(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let e=0,r=t.length;e<r;++e)t[e]+=n}this.endss_.push(t),this.changed()}clone(){let t=this.endss_.length,n=Array(t);for(let e=0;e<t;++e)n[e]=this.endss_[e].slice();let r=new e(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,t,n,r){return r<fC(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(AE(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),NE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return WE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return EE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),pD(t,0,this.endss_,this.stride,e)),BE(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let e=Ik(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=sD(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Fk(this.getFlatInteriorPoints().slice(),`XYM`)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;dD(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=pD(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=rD(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{let n=this.endss_[e-1];t=n[n.length-1]}let n=this.endss_[e].slice(),r=n[n.length-1];if(t!==0)for(let e=0,r=n.length;e<r;++e)n[e]-=t;return new hD(this.flatCoordinates.slice(t,r),this.layout,n)}getPolygons(){let e=this.layout,t=this.flatCoordinates,n=this.endss_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a].slice(),s=o[o.length-1];if(i!==0)for(let e=0,t=o.length;e<t;++e)o[e]-=i;let c=new hD(t.slice(i,s),e,o);r.push(c),i=s}return r}getType(){return`MultiPolygon`}intersectsExtent(e){return ZE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||=[];let n=LE(this.flatCoordinates,0,e,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{let e=n[n.length-1];this.flatCoordinates.length=e.length===0?0:e[e.length-1]}this.changed()}};const Rk=ZT();var zk=class e{constructor(e,t,n,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=i,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||=this.type_===`Point`?bC(this.flatCoordinates_):xC(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let e=MC(this.getExtent());this.flatInteriorPoints_=oD(this.flatCoordinates_,0,this.ends_,this.stride_,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let e=mD(this.flatCoordinates_,this.ends_),t=Ik(this.flatCoordinates_,0,e,this.stride_);this.flatInteriorPoints_=sD(this.flatCoordinates_,0,e,this.stride_,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||=XD(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,.5),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let e=this.flatCoordinates_,t=0,n=this.ends_;for(let r=0,i=n.length;r<i;++r){let i=n[r],a=XD(e,t,i,this.stride_,.5);zS(this.flatMidpoints_,a),t=i}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=kT(e);let t=e.getExtent(),n=e.getWorldExtent();if(t&&n){let e=IC(n)/IC(t);oE(Rk,n[0],n[3],e,-e,0,0,0),pE(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,Rk,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new e(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=GS((t,n)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);let r=this.simplifiedGeometry_.getFlatCoordinates(),i;switch(this.type_){case`LineString`:r.length=QE(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,r,0),i=[r.length];break;case`MultiLineString`:i=[],r.length=$E(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,r,0,i);break;case`Polygon`:i=[],r.length=nD(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),r,0,i)}return i&&(this.simplifiedGeometry_=new e(this.type_,r,i,this.stride_,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};zk.prototype.getFlatCoordinates=zk.prototype.getOrientedFlatCoordinates;function Bk(e,t,n=0,r=e.length-1,i=Hk){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Bk(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(Vk(e,n,t),i(e[r],a)>0&&Vk(e,n,r);o<s;){for(Vk(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?Vk(e,n,s):(s++,Vk(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function Vk(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Hk(e,t){return e<t?-1:+(e>t)}var Uk=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!tA(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;tA(e,s)&&(t.leaf?n.push(o):eA(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!tA(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(tA(e,a)){if(t.leaf||eA(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=nA([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=Wk(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&eA(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=nA(e.slice(t,n+1)),Gk(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=nA([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));rA(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);rA(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return Gk(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Xk(o),c=Qk(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),qk(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=nA(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,Gk(n,this.toBBox),Gk(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=nA([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Gk(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=Kk(e,0,o,this.toBBox),s=Kk(e,o,n,this.toBBox),c=$k(t,s),l=Xk(t)+Xk(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Jk,i=e.leaf?this.compareMinY:Yk;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=Kk(e,0,t,i),o=Kk(e,n-t,n,i),s=Zk(a)+Zk(o);for(let r=t;r<n-t;r++){let t=e.children[r];qk(a,e.leaf?i(t):t),s+=Zk(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];qk(o,e.leaf?i(t):t),s+=Zk(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)qk(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():Gk(e[t],this.toBBox)}};function Wk(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Gk(e,t){Kk(e,0,e.children.length,t,e)}function Kk(e,t,n,r,i){i||=nA(null),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];qk(i,e.leaf?r(t):t)}return i}function qk(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Jk(e,t){return e.minX-t.minX}function Yk(e,t){return e.minY-t.minY}function Xk(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Zk(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Qk(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function $k(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function eA(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function tA(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function nA(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rA(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Bk(e,o,t,n,i),a.push(t,o,o,n)}}var iA=class{constructor(e){this.rbush_=new Uk(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[J(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=e[r],a=t[r],o={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:a};n[r]=o,this.items_[J(a)]=o}this.rbush_.load(n)}remove(e){let t=J(e),n=this.items_[t];return delete this.items_[t],this.rbush_.remove(n)!==null}update(e,t){let n=this.items_[J(t)];SC([n.minX,n.minY,n.maxX,n.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(e){return e.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let n;for(let r=0,i=e.length;r<i;r++)if(n=t(e[r]),n)return n;return n}isEmpty(){return kS(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return vC(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}},aA=class extends eC{constructor(e){super(),this.projection=kT(e.projection),this.attributions_=oA(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX!==void 0&&e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}ready(){let e=this.getState();return e===`ready`?Promise.resolve():e===`error`?Promise.reject(Error(`Source failed to load`)):new Promise((e,t)=>{let n=()=>{let r=this.getState();r===`ready`?(this.un(`change`,n),e()):r===`error`&&(this.un(`change`,n),t(Error(`Source failed to load`)))};this.on(`change`,n)})}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=oA(e),this.changed()}setState(e){this.state_=e,this.changed()}};function oA(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}var sA={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`},cA=class extends qS{constructor(e,t,n){super(e),this.feature=t,this.features=n}},lA=class extends aA{constructor(e){e||={},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0||e.wrapX}),this.on,this.once,this.un,this.loader_=WS,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0||e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(iC(this.format_,"`format` must be set when `url` is set"),this.loader_=Mk(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?Nk:e.strategy;let t=e.useSpatialIndex===void 0||e.useSpatialIndex;this.featuresRtree_=t?new iA:null,this.loadedExtentsRtree_=new iA,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new rC(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=J(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new cA(sA.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof zk||(this.featureChangeKeys_[e]=[AS(t,q.CHANGE,this.handleFeatureChange_,this),AS(t,DS.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let n=!0;if(t.getId()!==void 0){let e=String(t.getId());if(!(e in this.idIndex_))this.idIndex_[e]=t;else if(t instanceof zk){let r=this.idIndex_[e];r instanceof zk?Array.isArray(r)?r.push(t):this.idIndex_[e]=[r,t]:n=!1}else n=!1}return n&&(iC(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=J(r);this.addToIndex_(i,r)&&n.push(r)}for(let e=0,i=n.length;e<i;e++){let i=n[e],a=J(i);this.setupChangeEvents_(a,i);let o=i.getGeometry();if(o){let e=o.getExtent();t.push(e),r.push(i)}else this.nullGeometryFeatures_[a]=i}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(sA.ADDFEATURE))for(let e=0,t=n.length;e<t;e++)this.dispatchEvent(new cA(sA.ADDFEATURE,n[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(sA.ADDFEATURE,function(n){t||=(t=!0,e.push(n.feature),!1)}),this.addEventListener(sA.REMOVEFEATURE,function(n){t||=(t=!0,e.remove(n.feature),!1)}),e.addEventListener(ES.ADD,e=>{t||=(t=!0,this.addFeature(e.element),!1)}),e.addEventListener(ES.REMOVE,e=>{t||=(t=!0,this.removeFeature(e.element),!1)}),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(MS);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)});for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new cA(sA.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){let r=n.getGeometry();if(r instanceof zk||r.intersectsCoordinate(e))return t(n)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(n){let r=n.getGeometry();if(r instanceof zk||r.intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),kS(this.nullGeometryFeatures_)||zS(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let n=YC(e,t);return[].concat(...n.map(e=>this.featuresRtree_.getInExtent(e)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];return t||=HS,this.featuresRtree_.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry(),c=o;if(o=t instanceof zk?0:t.closestPointXY(n,r,a,o),o<c){i=e;let t=Math.sqrt(o);s[0]=n-t,s[1]=r-t,s[2]=n+t,s[3]=r+t}}}),i}getExtent(e){return this.featuresRtree_?.getExtent(e)??null}getFeatureById(e){let t=this.idIndex_[e.toString()];return t===void 0?null:t}getFeatureByUid(e){let t=this.uidIndex_[e];return t===void 0?null:t}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,n=J(t),r=t.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[n]=t);else{let e=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}let i=t.getId();if(i!==void 0){let e=i.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[n]=t;this.changed(),this.dispatchEvent(new cA(sA.CHANGEFEATURE,t))}hasFeature(e){let t=e.getId();if(t!==void 0){let n=this.idIndex_[String(t)];return Array.isArray(n)?n.includes(e):n===e}return J(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&kS(this.nullGeometryFeatures_):!this.featuresCollection_||this.featuresCollection_.getLength()===0}loadFeatures(e,t,n){let r=this.loadedExtentsRtree_,i=this.strategy_(e,t,n);for(let e=0,a=i.length;e<a;++e){let a=i[e];if(!r.forEachInExtent(a,function(e){return mC(e.extent,a)})){this.loading=Number(this.loading)+1,this.dispatchEvent(new cA(sA.FEATURESLOADSTART));let e=e=>{this.loading=Number(this.loading)-1,this.dispatchEvent(new cA(sA.FEATURESLOADEND,void 0,e))},i=()=>{this.changed(),this.loading=Number(this.loading)-1,this.dispatchEvent(new cA(sA.FEATURESLOADERROR))},o=!1,s=this.loader_.call(this,a,t,n,t=>o||e(t),()=>o||i());s instanceof Promise?(o=!0,s.then(t=>{this.addFeatures(t),e(t)}).catch(i)):this.loader_.length<4&&(this.loading=!1),r.insert(a,{extent:a.slice()})}}}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n=[];t.forEachInExtent(e,function(e){n.push(e)}),n.forEach(n=>{t.remove(n);let r=RC(n.extent,e);for(let e of r)t.insert(e,{extent:e})})}removeFeatures(e){let t=!1;for(let n=0,r=e.length;n<r;++n)t=this.removeFeatureInternal(e[n])||t;t&&this.changed()}removeFeature(e){e&&this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=J(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[t]?.forEach(MS),delete this.featureChangeKeys_[t];let n=e.getId();if(n!==void 0){let t=n.toString(),r=this.idIndex_[t];r===e?delete this.idIndex_[t]:Array.isArray(r)&&(r.splice(r.indexOf(e),1),r.length===1&&(this.idIndex_[t]=r[0]))}return delete this.uidIndex_[t],this.hasListener(sA.REMOVEFEATURE)&&this.dispatchEvent(new cA(sA.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(let t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){iC(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(Mk(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}},uA=class e{constructor(e){e||={},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){if(typeof e==`object`&&e&&`src`in e){let t=MO(null,e.src,{crossOrigin:`anonymous`},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===yD.IDLE&&t.load(),t.getImageState()===yD.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?J(e):typeof e==`object`&&`src`in e?e.src+`:`+e.offset:TO(e).toString():``}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}},dA=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.offset_=e.offset,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),offset:this.getOffset(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getOffset(){return this.offset_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}};function fA(e){return e[0]>0&&e[1]>0}function pA(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function mA(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var hA=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=mA(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return ZS()}getImage(e){return ZS()}getHitDetectionImage(){return ZS()}getPixelRatio(e){return 1}getImageState(){return ZS()}getImageSize(){return ZS()}getOrigin(){return ZS()}getSize(){return ZS()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mA(e)}listenImageChange(e){ZS()}load(){ZS()}unlistenImageChange(e){ZS()}ready(){return Promise.resolve()}},gA=class e extends hA{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?yD.LOADING:yD.LOADED,this.imageState_===yD.LOADING&&this.ready().then(()=>this.imageState_=yD.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=kO.get(n,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=ID(i,i);this.draw_(t,a,e),r=a.canvas;let o=new jO(r,void 0,null,yD.LOADED,null);kO.set(n,null,o),createImageBitmap(r).then(e=>{o.setImage(e)})}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m*2}createRenderOptions(){let e=qO,t=YO,n=0,r=null,i=0,a,o=0;this.stroke_&&(a=NO(this.stroke_.getColor()??`#000`),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??`round`,e=this.stroke_.getLineCap()??`round`,n=this.stroke_.getMiterLimit()??10);let s=this.calculateLineJoinSize_(t,o,n),c=Math.max(this.radius,this.radius2_||0),l=Math.ceil(2*c+s);return{strokeStyle:a,strokeWidth:o,size:l,lineCap:e,lineDash:r,lineDashOffset:i,lineJoin:t,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,n){if(t.scale(n,n),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();e===null&&(e=KO),t.fillStyle=NO(e),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let n=this.fill_.getColor(),r=0;typeof n==`string`&&(n=TO(n)),n===null?r=1:Array.isArray(n)&&(r=n.length===4?n[3]:1),r===0&&(t=ID(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_,n=this.radius;if(t===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(t*=2);let i=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let o=0;o<t;o++){let t=i+o*a,s=o%2==0?n:r;e.lineTo(s*Math.cos(t),s*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=KO,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}},_A=class e extends gA{constructor(e){e||={radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale===void 0?1:e.scale,rotation:e.rotation===void 0?0:e.rotation,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode})}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}},vA=class e{constructor(e){e||={},this.geometry_=null,this.geometryFunction_=CA,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill===void 0?null:e.fill,this.image_=e.image===void 0?null:e.image,this.renderer_=e.renderer===void 0?null:e.renderer,this.hitDetectionRenderer_=e.hitDetectionRenderer===void 0?null:e.hitDetectionRenderer,this.stroke_=e.stroke===void 0?null:e.stroke,this.text_=e.text===void 0?null:e.text,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&typeof t==`object`&&(t=t.clone()),new e({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e==`function`?this.geometryFunction_=e:typeof e==`string`?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=CA,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function yA(e){let t;if(typeof e==`function`)t=e;else{let n;Array.isArray(e)?n=e:(iC(typeof e.getZIndex==`function`,"Expected an `Style` or an array of `Style`"),n=[e]),t=function(){return n}}return t}let bA=null;function xA(e,t){if(!bA){let e=new uA({color:`rgba(255,255,255,0.4)`}),t=new dA({color:`#3399CC`,width:1.25});bA=[new vA({image:new _A({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return bA}function SA(){let e={},t=[255,255,255,1],n=[0,153,255,1];return e.Polygon=[new vA({fill:new uA({color:[255,255,255,.5]})})],e.MultiPolygon=e.Polygon,e.LineString=[new vA({stroke:new dA({color:t,width:5})}),new vA({stroke:new dA({color:n,width:3})})],e.MultiLineString=e.LineString,e.Circle=e.Polygon.concat(e.LineString),e.Point=[new vA({image:new _A({radius:6,fill:new uA({color:n}),stroke:new dA({color:t,width:3/2})}),zIndex:1/0})],e.MultiPoint=e.Point,e.GeometryCollection=e.Polygon.concat(e.LineString,e.Point),e}function CA(e){return e.getGeometry()}var wA=class e{constructor(e){e||={},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=mA(e.scale===void 0?1:e.scale),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill===void 0?new uA({color:`#333`}):e.fill,this.maxAngle_=e.maxAngle===void 0?Math.PI/4:e.maxAngle,this.placement_=e.placement===void 0?`point`:e.placement,this.overflow_=!!e.overflow,this.stroke_=e.stroke===void 0?null:e.stroke,this.offsetX_=e.offsetX===void 0?0:e.offsetX,this.offsetY_=e.offsetY===void 0?0:e.offsetY,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof uA?this.getFill().clone():this.getFill(),stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mA(e===void 0?1:e)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}},TA={ANIMATING:0,INTERACTING:1};const X={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},EA=[X.FILL],DA=[X.STROKE],OA=[X.BEGIN_PATH],kA=[X.CLOSE_PATH];var AA=class extends RO{constructor(e,t,n,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return t==1?e:e.map(function(e){return e*t})}appendFlatPointCoordinates(e,t){let n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,a=i.length;for(let o=0,s=e.length;o<s;o+=t)r[0]=e[o],r[1]=e[o+1],pC(n,r)&&(i[a++]=r[0],i[a++]=r[1]);return a}appendFlatLineCoordinates(e,t,n,r,i,a){let o=this.coordinates,s=o.length,c=this.getBufferedMaxExtent();a&&(t+=r);let l=e[t],u=e[t+1],d=this.tmpCoordinate_,f=!0,p,m,h;for(p=t+r;p<n;p+=r)d[0]=e[p],d[1]=e[p+1],h=gC(c,d),h===m?h===sC.INTERSECTING?(o[s++]=d[0],o[s++]=d[1],f=!1):f=!0:(f&&=(o[s++]=l,o[s++]=u,!1),o[s++]=d[0],o[s++]=d[1]),l=d[0],u=d[1],m=h;return(i&&f||p===t+r)&&(o[s++]=l,o[s++]=u),s}drawCustomCoordinates_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a],s=this.appendFlatLineCoordinates(e,t,o,r,!1,!1);i.push(s),t=o}return t}drawCustom(e,t,n,r,i){this.beginGeometry(e,t,i);let a=e.getType(),o=e.getStride(),s=this.coordinates.length,c,l,u,d,f;switch(a){case`MultiPolygon`:c=e.getOrientedFlatCoordinates(),d=[];let t=e.getEndss();f=0;for(let e=0,n=t.length;e<n;++e){let n=[];f=this.drawCustomCoordinates_(c,f,t[e],o,n),d.push(n)}this.instructions.push([X.CUSTOM,s,d,e,n,BE,i]),this.hitDetectionInstructions.push([X.CUSTOM,s,d,e,r||n,BE,i]);break;case`Polygon`:case`MultiLineString`:u=[],c=a==`Polygon`?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),f=this.drawCustomCoordinates_(c,0,e.getEnds(),o,u),this.instructions.push([X.CUSTOM,s,u,e,n,zE,i]),this.hitDetectionInstructions.push([X.CUSTOM,s,u,e,r||n,zE,i]);break;case`LineString`:case`Circle`:c=e.getFlatCoordinates(),l=this.appendFlatLineCoordinates(c,0,c.length,o,!1,!1),this.instructions.push([X.CUSTOM,s,l,e,n,RE,i]),this.hitDetectionInstructions.push([X.CUSTOM,s,l,e,r||n,RE,i]);break;case`MultiPoint`:c=e.getFlatCoordinates(),l=this.appendFlatPointCoordinates(c,o),l>s&&(this.instructions.push([X.CUSTOM,s,l,e,n,RE,i]),this.hitDetectionInstructions.push([X.CUSTOM,s,l,e,r||n,RE,i]));break;case`Point`:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([X.CUSTOM,s,l,e,n,void 0,i]),this.hitDetectionInstructions.push([X.CUSTOM,s,l,e,r||n,void 0,i])}this.endGeometry(t)}beginGeometry(e,t,n){this.beginGeometryInstruction1_=[X.BEGIN_GEOMETRY,t,0,e,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[X.BEGIN_GEOMETRY,t,0,e,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==X.END_GEOMETRY?a=t:i==X.BEGIN_GEOMETRY&&(r[2]=t,RS(this.hitDetectionInstructions,a,t),a=-1)}fillStyleToState(e,t={}){if(e){let n=e.getColor();t.fillPatternScale=n&&typeof n==`object`&&`src`in n?this.pixelRatio:1,t.fillStyle=NO(n||`#000`)??void 0}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){t.strokeStyle=NO(e.getColor()||XO);let n=e.getLineCap();t.lineCap=n===void 0?qO:n;let r=e.getLineDash();t.lineDash=r?r.slice():JO,t.lineDashOffset=e.getLineDashOffset()||0;let i=e.getLineJoin();t.lineJoin=i===void 0?YO:i;let a=e.getWidth();t.lineWidth=a===void 0?1:a;let o=e.getMiterLimit();t.miterLimit=o===void 0?10:o,t.strokeOffset=e.getOffset()??0,t.lineWidth>this.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0,t.strokeOffset=void 0;return t}setFillStrokeStyle(e,t){let n=this.state;this.fillStyleToState(e,n),this.strokeStyleToState(t,n)}createFill(e){let t=e.fillStyle,n=[X.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(e.fillPatternScale),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[X.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){let n=e.fillStyle;(n!==void 0&&typeof n!=`string`||e.currentFillStyle!=n)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit,l=e.strokeOffset;(e.currentStrokeStyle!=n||e.currentLineCap!=r||i!=e.currentLineDash&&!BS(e.currentLineDash,i)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=c||e.currentStrokeOffset!=l)&&(t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c,e.currentStrokeOffset=l)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[X.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=dC(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;uC(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},jA=class extends AA{constructor(e,t,n,r){super(e,t,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,n){if(!this.image_||this.maxExtent&&!pC(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,i);this.instructions.push([X.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([X.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,n){if(!this.image_)return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=[];for(let t=0,n=r.length;t<n;t+=e.getStride())(!this.maxExtent||pC(this.maxExtent,r.slice(t,t+2)))&&i.push(r[t],r[t+1]);let a=this.coordinates.length,o=this.appendFlatPointCoordinates(i,2);this.instructions.push([X.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([X.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){let n=e.getAnchor(),r=e.getSize(),i=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},MA=class extends AA{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinates_(e,t,n,r,i){let a=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,n,r,!1,!1);return this.instructions.push([X.MOVE_TO_LINE_TO,a,o,i*this.pixelRatio]),this.hitDetectionInstructions.push([X.MOVE_TO_LINE_TO,a,o,i]),n}drawLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,XO,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,JO,0],OA);let s=e.getFlatCoordinates(),c=e.getStride();this.drawFlatCoordinates_(s,0,s.length,c,o),this.hitDetectionInstructions.push(DA),this.endGeometry(t)}drawMultiLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,XO,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,JO,0],OA);let s=e.getEnds(),c=e.getFlatCoordinates(),l=e.getStride(),u=0;for(let e=0,t=s.length;e<t;++e)u=this.drawFlatCoordinates_(c,u,s[e],l,o);this.hitDetectionInstructions.push(DA),this.endGeometry(t)}finish(){let e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(DA),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(DA),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(OA)}},NA=class extends AA{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinatess_(e,t,n,r,i){let a=this.state,o=a.fillStyle!==void 0,s=a.strokeStyle!==void 0,c=n.length;this.instructions.push(OA),this.hitDetectionInstructions.push(OA);for(let a=0;a<c;++a){let o=n[a],c=this.coordinates.length,l=this.appendFlatLineCoordinates(e,t,o,r,!0,!s);this.instructions.push([X.MOVE_TO_LINE_TO,c,l,i*this.pixelRatio,!0]),this.hitDetectionInstructions.push([X.MOVE_TO_LINE_TO,c,l,i,!0]),s&&(this.instructions.push(kA),this.hitDetectionInstructions.push(kA)),t=o}return o&&(this.instructions.push(EA),this.hitDetectionInstructions.push(EA)),s&&(this.instructions.push(DA),this.hitDetectionInstructions.push(DA)),t}drawCircle(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawCircle(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([X.SET_FILL_STYLE,KO]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,XO,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,JO,0]);let s=e.getFlatCoordinates(),c=e.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,c,!1,!1);let u=[X.CIRCLE,l,o];this.instructions.push(OA,u),this.hitDetectionInstructions.push(OA,u),r.fillStyle!==void 0&&(this.instructions.push(EA),this.hitDetectionInstructions.push(EA)),r.strokeStyle!==void 0&&(this.instructions.push(DA),this.hitDetectionInstructions.push(DA)),this.endGeometry(t)}drawPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawPolygon(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([X.SET_FILL_STYLE,KO]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,XO,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,JO,0]);let s=e.getEnds(),c=e.getOrientedFlatCoordinates(),l=e.getStride();this.drawFlatCoordinatess_(c,0,s,l,o),this.endGeometry(t)}drawMultiPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawMultiPolygon(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([X.SET_FILL_STYLE,KO]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([X.SET_STROKE_STYLE,XO,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,JO,0]);let s=e.getEndss(),c=e.getOrientedFlatCoordinates(),l=e.getStride(),u=0;for(let e=0,t=s.length;e<t;++e)u=this.drawFlatCoordinatess_(c,u,s[e],l,o);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(e!==0){let t=this.coordinates;for(let n=0,r=t.length;n<r;++n)t[n]=eD(t[n],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}handleStrokeOffset_(e){let t=this.state,n=t.fillStyle,r=t.strokeStyle,i=t.strokeOffset;return Math.abs(i)>0&&n!==void 0&&r!==void 0&&(t.strokeStyle=void 0,t.strokeOffset=0,e(),t.fillStyle=void 0,t.strokeStyle=r,t.strokeOffset=i,e(),t.fillStyle=n,!0)}};let PA=0,FA=1;function IA(e,t,n,r,i,a,o,s){let c=o-i,l=s-a,u=0,d=1;if(c===0){if(i<e||i>n)return!1}else{let t=(e-i)/c,r=(n-i)/c;if(t>r){let e=t;t=r,r=e}if(t>u&&(u=t),r<d&&(d=r),u>d)return!1}if(l===0){if(a<t||a>r)return!1}else{let e=(t-a)/l,n=(r-a)/l;if(e>n){let t=e;e=n,n=t}if(e>u&&(u=e),n<d&&(d=n),u>d)return!1}return PA=u,FA=d,!0}function LA(e,t,n,r){let i=r[0],a=r[1],o=r[2],s=r[3],c=[],l=[],u=!1,d,f,p=0;for(let r=0,m=t.length;r<m;++r){let m=t[r],h=e[p],g=e[p+1],_=!1;for(let t=p+n;t<m;t+=n){let n=e[t],r=e[t+1];if(IA(i,a,o,s,h,g,n,r)){let e=n-h,t=r-g,i=h+PA*e,a=g+PA*t,o=h+FA*e,s=g+FA*t;u&&_&&i===d&&a===f?c.push(o,s):(u&&l.push(c.length),c.push(i,a,o,s),u=!0),d=o,f=s,_=!0}h=n,g=r}p=m}return u&&l.push(c.length),{flatCoordinates:c,ends:l}}function RA(e,t,n,r,i){let a=[],o=n,s=0,c=t.slice(n,2);for(;s<e&&o+i<r;){let[n,r]=c.slice(-2),l=t[o+i],u=t[o+i+1],d=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r));if(s+=d,s>=e){let t=(e-s+d)/d,f=iw(n,l,t),p=iw(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s<e)c.push(t[o+i],t[o+i+1]),o+=i;else{let e=d-s,t=iw(n,l,e/d),f=iw(r,u,e/d);c.push(t,f),a.push(c),c=[t,f],s=0,o+=i}}return s>0&&a.push(c),a}function zA(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;d<r;d+=i){let n=t[d],r=t[d+1];m!==void 0&&(v=n-m,y=r-h,p=Math.sqrt(v*v+y*y),g!==void 0&&(c+=f,u=Math.acos((g*v+_*y)/(f*p)),u>e&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p,c>s?[l,d]:[a,o]}const BA={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},VA={Circle:NA,Default:AA,Image:jA,LineString:MA,Polygon:NA,Text:class extends AA{constructor(e,t,n,r){super(e,t,n,r),this.labels_=null,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[KO]={fillStyle:KO},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,n){let r=this.textFillState_,i=this.textStrokeState_,a=this.textState_;if(this.text_===``||!a||!r&&!i)return;let o=this.coordinates,s=o.length,c=e.getType(),l=null,u=e.getStride();if(a.placement===`line`&&(c==`LineString`||c==`MultiLineString`||c==`Polygon`||c==`MultiPolygon`)){let r=e.getExtent();if(!HC(this.maxExtent,r))return;let i;if(l=e.getFlatCoordinates(),c==`LineString`)i=[l.length];else if(c==`MultiLineString`)i=e.getEnds();else if(c==`Polygon`)i=e.getEnds().slice(0,1);else if(c==`MultiPolygon`){let t=e.getEndss();i=[];for(let e=0,n=t.length;e<n;++e)i.push(t[e][0])}if((c==`LineString`||c==`MultiLineString`)&&!mC(this.getBufferedMaxExtent(),r)){let e=LA(l,i,u,this.getBufferedMaxExtent());if(l=e.flatCoordinates,i=e.ends,u=2,i.length===0)return}this.beginGeometry(e,t,n);let d=a.repeat,f=d?void 0:a.textAlign,p=0;for(let e=0,t=i.length;e<t;++e){let t;t=d?RA(d*this.resolution,l,p,i[e],u):[l.slice(p,i[e])];for(let n=0,r=t.length;n<r;++n){let r=t[n],c=0,l=r.length;if(f==null){let e=zA(a.maxAngle,r,0,r.length,2);c=e[0],l=e[1]}for(let e=c;e<l;e+=u)o.push(r[e],r[e+1]);let d=o.length;p=i[e],this.drawChars_(s,d),s=d}}this.endGeometry(t)}else{let r=a.overflow?null:[];switch(c){case`Point`:case`MultiPoint`:l=e.getFlatCoordinates();break;case`LineString`:l=e.getFlatMidpoint();break;case`Circle`:l=e.getCenter();break;case`MultiLineString`:l=e.getFlatMidpoints(),u=2;break;case`Polygon`:l=e.getFlatInteriorPoint(),a.overflow||r.push(l[2]/this.resolution),u=3;break;case`MultiPolygon`:let t=e.getFlatInteriorPoints();l=[];for(let e=0,n=t.length;e<n;e+=3)a.overflow||r.push(t[e+2]/this.resolution),l.push(t[e],t[e+1]);if(l.length===0)return;u=2}let i=this.appendFlatPointCoordinates(l,u);if(i===s)return;if(r&&(i-s)/2!==l.length/u){let e=s/2;r=r.filter((t,n)=>{let r=o[(e+n)*2]===l[n*u]&&o[(e+n)*2+1]===l[n*u+1];return r||--e,r})}this.saveTextStates_();let d=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,f=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,n);let p=a.padding;if(p!=QO&&(a.scale[0]<0||a.scale[1]<0)){let e=a.padding[0],t=a.padding[1],n=a.padding[2],r=a.padding[3];a.scale[0]<0&&(t=-t,r=-r),a.scale[1]<0&&(e=-e,n=-n),p=[e,t,n,r]}let m=this.pixelRatio;this.instructions.push([X.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==QO?QO:p.map(function(e){return e*m}),d,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);let h=1/m,g=d?d.slice(0):null;g&&(g[1]=KO),this.hitDetectionInstructions.push([X.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[h,h],NaN,this.declutterMode_,this.declutterImageWithText_,p,g,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?KO:this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||`center`,justify:t.justify,textBaseline:t.textBaseline||`middle`,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=BA[r.textBaseline],l=this.textOffsetX_*s,u=this.textOffsetY_*s,d=this.text_,f=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([X.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,u,i,f*s,d,a,1,this.declutterMode_,this.textKeepUpright_,l]),this.hitDetectionInstructions.push([X.DRAW_CHARS,e,t,c,r.overflow,o&&KO,r.maxAngle,s,u,i,f*s,d,a,1/s,this.declutterMode_,this.textKeepUpright_,l])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=NO(t.getColor()||`#000`)):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||`round`,i.lineDash=e?e.slice():JO,i.lineDashOffset=t===void 0?0:t,i.lineJoin=a.getLineJoin()||`round`,i.lineWidth=n===void 0?1:n,i.miterLimit=r===void 0?10:r,i.strokeStyle=NO(a.getColor()||`#000`)}n=this.textState_;let o=e.getFont()||`10px sans-serif`;ak(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||`middle`,n.backgroundFill=e.getBackgroundFill(),n.backgroundStroke=e.getBackgroundStroke(),n.padding=e.getPadding()||QO,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u!==void 0&&u,this.textKeepUpright_=d===void 0||d,this.textRotation_=f===void 0?0:f,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:J(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle==`string`?r.fillStyle:`|`+J(r.fillStyle):``}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}};var HA=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];if(i===void 0){let e=VA[t];i=new e(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i}return i}};let UA;function WA(){return UA||=new Intl.Segmenter(void 0,{granularity:`grapheme`}),UA}function GA(e,t,n,r,i,a,o,s,c,l,u,d,f=!0){let p=e[t],m=e[t+1],h=0,g=0,_=0,v=0;function y(){h=p,g=m,t+=r,p=e[t],m=e[t+1],v+=_,_=Math.sqrt((p-h)*(p-h)+(m-g)*(m-g))}do y();while(t<n-r&&v+_<a);let b=_===0?0:(a-v)/_,x=iw(h,p,b),S=iw(g,m,b),C=t-r,w=v,T=a+s*c(l,i,u);for(;t<n-r&&v+_<T;)y();b=_===0?0:(T-v)/_;let E=iw(h,p,b),D=iw(g,m,b),O=!1;if(f){if(d){let e=[x,S,E,D];mE(e,0,4,2,d,e,e),O=e[0]>e[2]}else O=x>E}let k=Math.PI,A=[],j=C+r===t;t=C,_=0,v=w,p=e[t],m=e[t+1];let M;if(j)return y(),M=Math.atan2(m-g,p-h),O&&(M+=M>0?-k:k),A[0]=[(E+x)/2,(D+S)/2,(T-a)/2,M,i],A;i=i.replace(/\n/g,` `);let N=Array.from(WA().segment(i),e=>e.segment);for(let e=0,i=N.length;e<i;){y();let d=Math.atan2(m-g,p-h);if(O&&(d+=d>0?-k:k),M!==void 0){let e=d-M;if(e+=e>k?-2*k:e<-k?2*k:0,Math.abs(e)>o)return null}M=d;let f=e,x=0;for(;e<i;++e){let o=s*c(l,N[O?i-e-1:e],u);if(t+r<n&&v+_<a+x+o/2)break;x+=o}if(e===f)continue;let S=(O?N.slice(i-e,i-f):N.slice(f,e)).join(``);b=_===0?0:(a+x/2-v)/_;let C=iw(h,p,b),w=iw(g,m,b);A.push([C,w,x/2,d,S]),a+=x}return A}var KA=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.pendingMethod_,this.context_=new Proxy(RD(),{get:(e,t)=>{if(typeof e[t]==`function`)return this.pendingMethod_=t,this.pushMethodArgs_},set:(e,t,n)=>(this.push_(t,n),!0)})}push_(...e){let t=this.instructions_,n=this.zIndex+this.offset_;t[n]||(t[n]=[]),t[n].push(...e)}pushMethodArgs_=(...e)=>{this.push_(this.pendingMethod_,e)};pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let n=0,r=t.length;n<r;++n){let r=t[n];if(typeof r==`function`){r(e);continue}let i=t[++n];typeof e[r]==`function`?e[r](...i):e[r]=typeof i==`function`?i(e):i}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}};const qA=_C(),JA=[],YA=[],XA=[],ZA=[];function QA(e){return e[3].declutterBox}const $A=RegExp(`[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]`);function ej(e,t){return t===`start`?t=$A.test(e)?`right`:`left`:t===`end`&&(t=$A.test(e)?`left`:`right`),BA[t]}function tj(e,t,n){return n>0&&e.push(`
|
|
34
34
|
`,``),e.push(t,``),e}function nj(e,t,n){return n%2==0&&(e+=t),e}var rj=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=ZT(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=i?new KA:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?BA[s.justify]:ej(Array.isArray(e)?e[0]:e,s.textAlign||`center`),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(`
|