@gamecrafters/base-ui 0.0.27 → 0.0.29
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 +1 -1
- package/build/main.esm.js +1 -1
- package/build/styles/main.css +1 -1
- package/package.json +1 -1
package/build/main.cjs.js
CHANGED
|
@@ -817,4 +817,4 @@ ${this.fragmentDiscardExpression_?` if (${this.fragmentDiscardExpression_}) { d
|
|
|
817
817
|
gl_FragColor = color;
|
|
818
818
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
819
819
|
gl_FragColor *= ${vz.TRANSITION_ALPHA};
|
|
820
|
-
}`,uniforms:o,paletteTextures:i.paletteTextures}}var oV=class extends bL{constructor(e){e=e?Object.assign({},e):{};let t=e.style||{};delete e.style,super(e),this.sources_=e.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=t,this.styleVariables_=this.style_.variables||{},this.styleBandCount_=NaN,this.styleNodataBandIndex_=void 0,this.handleSourceUpdate_(),this.addChangeListener(SF.SOURCE,this.handleSourceUpdate_)}getSources(e,t){let n=this.getSource();return this.sources_?typeof this.sources_==`function`?this.sources_(e,t):this.sources_:n?[n]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){let e=this.getRenderSource();return e?e.getState():`undefined`}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache();let e=this.getSource();if(e){if(e.getState()===`loading`){let t=()=>{e.getState()===`ready`&&(e.removeEventListener(`change`,t),this.setStyle(this.style_))};e.addEventListener(`change`,t)}else this.setStyle(this.style_)}}getFirstSource_(){let e=2**53-1,t=this.getSources([-e,-e,e,e],e);return t&&t.length?t[0]:null}usesCoverageBand_(e,t){if(!e||!t||e.hasAlpha!==!1)return!1;let n=e.getProjection();return!!n&&!MD(n,t)}getSourceBandCount_(e){let t=this.getFirstSource_(),n=t&&`bandCount`in t?t.bandCount:4;return this.usesCoverageBand_(t,e)?n+1:n}getSourceNodataBandIndex_(e){let t=this.getFirstSource_();if(t)return this.usesCoverageBand_(t,e)?t.bandCount+1:`nodataBandIndex`in t?t.nodataBandIndex:void 0}parseStyleForRender_(e){let t=this.getSourceBandCount_(e),n=this.getSourceNodataBandIndex_(e);return this.styleBandCount_=t,this.styleNodataBandIndex_=n,aV(this.style_,t,n)}applyShaders_(e){let t=this.parseStyleForRender_(e);this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures})}createRenderer(){let e=this.getMapInternal()?.getView()?.getProjection(),t=this.parseStyleForRender_(e);return new xz(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),paletteTextures:t.paletteTextures})}renderSources(e,t){let n=this.getRenderer(),r;for(let i=0,a=t.length;i<a;++i)this.renderedSource_=t[i],n.prepareFrame(e)&&(r=n.renderFrame(e));return r}render(e,t){this.rendered=!0;let n=e.viewState;if(this.hasRenderer()){let e=n.projection;(this.getSourceBandCount_(e)!==this.styleBandCount_||this.getSourceNodataBandIndex_(e)!==this.styleNodataBandIndex_)&&this.applyShaders_(e)}let r=this.getSources(e.extent,n.resolution),i=!0;for(let e=0,t=r.length;e<t;++e){let t=r[e],n=t.getState();if(n==`loading`){let e=()=>{t.getState()==`ready`&&(t.removeEventListener(`change`,e),this.changed())};t.addEventListener(`change`,e)}i&&=n==`ready`}let a=this.renderSources(e,r);if(this.getRenderer().renderComplete&&i)return this.renderedResolution_=n.resolution,a;if(this.renderedResolution_>.5*n.resolution){let t=this.getSources(e.extent,this.renderedResolution_).filter(e=>!r.includes(e));if(t.length>0)return this.renderSources(e,t)}return a}setStyle(e){if(this.styleVariables_=e.variables||{},this.style_=e,this.hasRenderer()){let e=this.getMapInternal()?.getView()?.getProjection();this.applyShaders_(e),this.changed()}}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}};oV.prototype.dispose;function sV({name:e,...t}){return vR(()=>new oV(t),e),null}sV.displayName=`MapWebGLTileLayer`;const cV=e=>{let t=QL(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addControl(r),()=>{t.removeControl(r)}},[t,r]),r},lV=(e,t,n)=>{let r=l.useRef(null);if(!r.current){let t=document.createElement(`div`);t.setAttribute(`data-component`,e),r.current=t}let i=r.current;return cV(()=>new UF({element:i,target:n})),l.useEffect(()=>{i.className=W(`ol-unselectable ol-control`,t)},[i,t]),i};function uV(e){return cV(()=>new WF(e)),null}uV.displayName=`MapAttributionControl`;const dV=[`fullscreenchange`,`webkitfullscreenchange`],fV={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var pV=class extends UF{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target}),this.on,this.once,this.un,this.keys_=e.keys!==void 0&&e.keys,this.source_=e.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=e.className===void 0?`ol-full-screen`:e.className,this.documentListeners_=[],this.activeClassName_=e.activeClassName===void 0?[this.cssClassName_+`-true`]:e.activeClassName.split(` `),this.inactiveClassName_=e.inactiveClassName===void 0?[this.cssClassName_+`-false`]:e.inactiveClassName.split(` `);let t=e.label===void 0?`⤢`:e.label;this.labelNode_=typeof t==`string`?document.createTextNode(t):t;let n=e.labelActive===void 0?`×`:e.labelActive;this.labelActiveNode_=typeof n==`string`?document.createTextNode(n):n;let r=e.tipLabel?e.tipLabel:`Toggle full-screen`;this.button_=document.createElement(`button`),this.button_.title=r,this.button_.setAttribute(`type`,`button`),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(Y.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ol-unselectable ol-control`,this.element.appendChild(this.button_)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){let e=this.getMap();if(!e)return;let t=e.getOwnerDocument();if(mV(t)){if(hV(t))vV(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?_V(n):gV(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=hV(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Lk(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(fV.ENTERFULLSCREEN)):(Lk(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(fV.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){t?(e.classList.remove(...this.inactiveClassName_),e.classList.add(...this.activeClassName_)):(e.classList.remove(...this.activeClassName_),e.classList.add(...this.inactiveClassName_))}setMap(e){let t=this.getMap();t&&t.removeChangeListener(zF.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(zF.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)Dw(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();mV(n)?this.element.classList.remove(FA):this.element.classList.add(FA);for(let t=0,r=dV.length;t<r;++t)e.push(Tw(n,dV[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function mV(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function hV(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function gV(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function _V(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():gV(e)}function vV(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function yV(e){return cV(()=>new pV(e)),null}yV.displayName=`MapFullScreenControl`;const bV=`units`,xV=[1,2,5],SV=25.4/.28;var CV=class extends UF{constructor(e){e||={};let t=document.createElement(`div`);t.style.pointerEvents=`none`,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let n=e.className===void 0?e.bar?`ol-scale-bar`:`ol-scale-line`:e.className;this.innerElement_=document.createElement(`div`),this.innerElement_.className=n+`-inner`,this.element.className=n+` ol-unselectable`,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth===void 0?64:e.minWidth,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_=``,this.addChangeListener(bV,this.handleUnitsChanged_),this.setUnits(e.units||`metric`),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(bV)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(bV,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=e.center,n=e.projection,r=this.getUnits(),i=r==`degrees`?`degrees`:`m`,a=TD(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||SV)/SV,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||SV)/SV,c=o*a,l=``;if(r==`degrees`){let e=EE.degrees;c*=e,c<e/60?(l=`″`,a*=3600):c<e?(l=`′`,a*=60):l=`°`}else if(r==`imperial`)c<.9144?(l=`in`,a/=.0254):c<1609.344?(l=`ft`,a/=.3048):(l=`mi`,a/=1609.344);else if(r==`nautical`)a/=1852,l=`NM`;else if(r==`metric`)c<1e-6?(l=`nm`,a*=1e9):c<.001?(l=`μm`,a*=1e6):c<1?(l=`mm`,a*=1e3):c<1e3?l=`m`:(l=`km`,a/=1e3);else if(r==`us`)c<.9144?(l=`in`,a*=39.37):c<1609.344?(l=`ft`,a/=.30480061):(l=`mi`,a/=1609.3472);else throw Error(`Invalid units`);let u=3*Math.floor(Math.log(o*a)/Math.log(10)),d,f,p,m=0,h,g;for(;;){p=Math.floor(u/3);let e=10**p;if(d=xV[(u%3+3)%3]*e,f=Math.round(d/a),isNaN(f)){this.element.style.display=`none`,this.renderedVisible_=!1;return}if(s!==void 0&&f>=s){d=m,f=h,p=g;break}if(f>=o)break;m=d,h=f,g=p,++u}let _=this.scaleBar_?this.createScaleBar(f,d,l):d.toFixed(p<0?-p:0)+` `+l;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+`px`,this.renderedWidth_=f),this.renderedVisible_||=(this.element.style.display=``,!0)}createScaleBar(e,t,n){let r=this.getScaleForResolution(),i=r<1?Math.round(1/r).toLocaleString()+` : 1`:`1 : `+Math.round(r).toLocaleString(),a=this.scaleBarSteps_,o=e/a,s=[this.createMarker(`absolute`)];for(let r=0;r<a;++r){let i=r%2==0?`ol-scale-singlebar-odd`:`ol-scale-singlebar-even`;s.push(`<div><div class="ol-scale-singlebar ${i}" style="width: ${o}px;"></div>`+this.createMarker(`relative`)+(r%2==0||a===2?this.createStepText(r,e,!1,t,n):``)+`</div>`)}return s.push(this.createStepText(a,e,!0,t,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+i+`</div>`:``)+s.join(``)}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e===`absolute`?3:-10}px;"></div>`}createStepText(e,t,n,r,i){let a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?``:` `+i),o=e===0?-3:t/this.scaleBarSteps_*-1,s=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${e===0?`left`:`center`};min-width: ${s}px;left: ${n?t+`px`:`unset`};">`+a+`</div>`}getScaleForResolution(){let e=TD(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||SV;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function wV(e){return cV(()=>new CV(e)),null}wV.displayName=`MapScaleLineControl`;const TV=`projection`,EV=`coordinateFormat`;var DV=class extends UF{constructor(e){e||={};let t=document.createElement(`div`);t.className=e.className===void 0?`ol-mouse-position`:e.className,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un,this.addChangeListener(TV,this.handleProjectionChanged_),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.renderOnMouseOut_=e.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?e.placeholder:` `,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(EV)}getProjection(){return this.get(TV)}handleMouseMove(e){let t=this.getMap();this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){let t=e.getViewport();this.listenerKeys.push(Tw(t,IF.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(Tw(t,IF.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(EV,e)}setProjection(e){this.set(TV,wD(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?ND(this.mapProjection_,e):xD}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=LD();e&&(this.transform_=ND(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&CE(n,e||this.getProjection()||this.mapProjection_);let r=this.getCoordinateFormat();t=r?r(n):n.toString()}}(!this.renderedHTML_||t!==this.renderedHTML_)&&(this.element.innerHTML=t,this.renderedHTML_=t)}render(e){let t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}};function OV(e){return cV(()=>new DV(e)),null}OV.displayName=`MapMousePositionControl`;const kV=.75,AV=.1;var jV=class extends UF{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed===void 0||e.collapsed,this.collapsible_=e.collapsible===void 0||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0&&e.rotateWithView,this.viewExtent_=void 0;let t=e.className===void 0?`ol-overviewmap`:e.className,n=e.tipLabel===void 0?`Overview map`:e.tipLabel,r=e.collapseLabel===void 0?`‹`:e.collapseLabel;typeof r==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=r):this.collapseLabel_=r;let i=e.label===void 0?`›`:e.label;typeof i==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=i):this.label_=i;let a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement(`button`);o.setAttribute(`type`,`button`),o.title=n,o.appendChild(a),o.addEventListener(Y.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new zI({view:e.view,controls:new Qw,interactions:new Qw});this.ovmap_=s,e.layers&&e.layers.forEach(function(e){s.addLayer(e)});let c=document.createElement(`div`);c.className=`ol-overviewmap-box`,c.style.boxSizing=`border-box`,this.boxOverlay_=new HI({position:[0,0],positioning:`center-center`,element:c}),this.ovmap_.addOverlay(this.boxOverlay_);let l=t+` ol-unselectable ol-control`+(this.collapsed_&&this.collapsible_?` ol-collapsed`:``)+(this.collapsible_?``:` ol-uncollapsible`),u=this.element;u.className=l,u.appendChild(this.ovmapDiv_),u.appendChild(o);let d=this.boxOverlay_,f=this.boxOverlay_.getElement(),p=e=>({clientX:e.clientX,clientY:e.clientY}),m=function(e){let t=p(e),n=s.getEventCoordinate(t);d.setPosition(n)},h=e=>{let t=s.getEventCoordinateInternal(e),n=this.getMap();n.getView().setCenterInternal(t);let r=n.getOwnerDocument();r.removeEventListener(`pointermove`,m),r.removeEventListener(`pointerup`,h)};this.ovmapDiv_.addEventListener(`pointerdown`,e=>{let t=this.getMap().getOwnerDocument();e.target===f&&t.addEventListener(`pointermove`,m),t.addEventListener(`pointerup`,h)})}setMap(e){let t=this.getMap();if(e!==t){if(t){let e=t.getView();e&&this.unbindView_(e),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(Tw(e,Sw.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===zF.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===zF.TARGET||e.key===zF.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new hF({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(rF.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(rF.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView().calculateExtentInternal(n);if(this.viewExtent_&&_T(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(PT(r)),s=t.getPixelFromCoordinateInternal(ET(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*AV||l<d*AV||c>u*kV||l>d*kV?this.resetExtent_():lT(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();BT(r,1/(2**(Math.log(kV/AV)/Math.LN2/2)*AV)),i.fitInternal(dk(r))}recenter_(){let e=this.getMap(),t=this.ovmap_,n=e.getView();t.getView().setCenterInternal(n.getCenterInternal())}updateBox_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView(),i=t.getView(),a=this.rotateWithView_?0:-r.getRotation(),o=this.boxOverlay_,s=this.boxOverlay_.getElement(),c=r.getCenter(),l=r.getResolution(),u=i.getResolution(),d=n[0]*l/u,f=n[1]*l/u;if(o.setPosition(c),s){s.style.width=d+`px`,s.style.height=f+`px`;let e=`rotate(`+a+`rad)`;s.style.transform=e}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||=Ew(this.ovmap_,RF.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(IA),this.collapsed_?Lk(this.collapseLabel_,this.label_):Lk(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;let e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};function MV(e){return cV(()=>new jV(e)),null}MV.displayName=`MapOverviewMapControl`;var NV=class e extends hO{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return pT(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return`Circle`}intersectsExtent(e){if(LT(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||CT(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=kO(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(lO(n,0,n.length,r,e,t,n)),this.changed()}};NV.prototype.transform;var PV=class e extends mO{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Dw),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(Tw(e[t],Y.CHANGE,this.changed,this))}clone(){let t=new e(FV(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<sT(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){mT(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)yT(e,t[n].getExtent());return e}getGeometries(){return FV(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=DT(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(FV(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function FV(e){return e.map(e=>e.clone())}function IV(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function LV(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}const RV={index:-1,endIndex:NaN,closestTargetDistance:1/0};function zV(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN;for(let e=0;e<t.targets.length;++e){let n=t.targets[e],r=n.coordinates,l=1/0,u;for(let e=0;e<r.length-1;++e){let t=r[e],n=r[e+1],o=KV(i,a,t,n);o.squaredDistance<l&&(l=o.squaredDistance,u=e+o.along)}l<o&&(o=l,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?u<n.startIndex&&(u+=r.length):n.endIndex<n.startIndex&&u>n.startIndex&&(u-=r.length)),c=u,s=e)}let l=t.targets[s],u=l.ring;if(t.targetIndex===s&&u){let e=LV(l.coordinates,c);xE(n.getPixelFromCoordinate(e),n.getPixelFromCoordinate(t.startCoord))>r&&(u=!1)}if(u){let e=l.coordinates,t=e.length,n=l.startIndex,r=c;if(n<r){let i=WV(e,n,r);WV(e,n,r-t)<i&&(c-=t)}else{let i=WV(e,n,r);WV(e,n,r+t)<i&&(c+=t)}}return RV.index=s,RV.endIndex=c,RV.closestTargetDistance=o,RV}function BV(e,t){let n=[];for(let r=0;r<t.length;++r)VV(e,t[r].getGeometry(),n);return n}function VV(e,t,n){if(t instanceof Yk){HV(e,t.getCoordinates(),!1,n);return}if(t instanceof kj){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)HV(e,r[t],!1,n);return}if(t instanceof uk){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)HV(e,r[t],!0,n);return}if(t instanceof Mj){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)HV(e,i[t],!0,n)}return}if(t instanceof PV){let r=t.getGeometries();for(let t=0;t<r.length;++t)VV(e,r[t],n);return}}function HV(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=t[e],s=t[e+1],c=KV(i,a,o,s);if(c.squaredDistance===0){let i=e+c.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function UV(e,t){return JT(e[0],e[1],t[0],t[1])}function WV(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return UV(LV(e,r),LV(e,i));let s=0;if(r<a){let t=LV(e,r),n=IV(e,a);s+=UV(t,n)}if(o<i){let t=IV(e,o),n=LV(e,i);s+=UV(t,n)}for(let t=a;t<o-1;++t){let n=IV(e,t),r=IV(e,t+1);s+=UV(n,r)}return s}const GV={along:0,squaredDistance:0};function KV(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=KT(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),GV.along=u,GV.squaredDistance=eE(JT(e,t,d,f),10),GV}const qV={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var JV=class extends Hw{constructor(e,t){super(e),this.feature=t}},YV=class extends mI{constructor(e){let t=e;t.stopDown||=Rw,super(t),this.on,this.once,this.un,this.options_=e,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=ZV(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,this.minPoints_=e.minPoints?e.minPoints:this.mode_===`Polygon`?3:2,this.maxPoints_=this.mode_===`Circle`?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Lw,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;if(e===`Circle`)n=(e,t,n)=>{let r=t||new NV([NaN,NaN]),i=zD(e[0],n),a=bE(i,zD(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=LD();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=ek:e===`LineString`?t=Yk:e===`Polygon`&&(t=uk),n=(n,r,i)=>(r?e===`Polygon`?n[0].length?r.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):r.setCoordinates([],this.geometryLayout_):r.setCoordinates(n,this.geometryLayout_):r=new t(n,this.geometryLayout_),r)}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new kF({source:new iM({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:XV(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:cI,this.freehandCondition_,this.freehandCondition_=e.freehand?iI:e.freehandCondition?e.freehandCondition:uI,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(JF.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?iI:e:oI,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?iI:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:uI}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===Y.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===FF.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===FF.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===FF.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===FF.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===FF.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===FF.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===FF.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new PF(FF.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}let t=this.getMap(),n=rT([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=BV(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(IV(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(IV(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&xE(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=zV(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex;let i=LV(r.coordinates,r.endIndex),a=this.getMap().getPixelFromCoordinate(i);e.coordinate=i,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_===`Point`)&&(this.atFinish_(e.pixel,n)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let n=!1;if(this.sketchFeature_){let r=!1,i=[this.finishCoordinate_],a=this.mode_;if(a===`Point`)n=!0;else if(a===`Circle`)n=this.sketchCoords_.length===2;else if(a===`LineString`)r=!t&&this.sketchCoords_.length>this.minPoints_;else if(a===`Polygon`){let e=this.sketchCoords_;r=e[0].length>this.minPoints_,i=[e[0][0],e[0][e[0].length-2]],i=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(r){let t=this.getMap();for(let r=0,a=i.length;r<a;r++){let a=i[r],o=t.getPixelFromCoordinate(a),s=e[0]-o[0],c=e[1]-o[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=a;break}}}}return n}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new eT(new ek(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new eT;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new Yk(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=_O(this.geometryLayout_);for(;e.length<n;)e.push(0);this.finishCoordinate_=e,this.mode_===`Point`?this.sketchCoords_=e.slice():this.mode_===`Polygon`?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new eT(new Yk(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new eT,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new JV(qV.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=_O(this.geometryLayout_),a,o;for(;e.length<i;)e.push(0);this.mode_===`Point`?o=this.sketchCoords_:this.mode_===`Polygon`?(a=this.sketchCoords_[0],o=a[a.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,o=a[a.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),n.getType()===`Polygon`&&this.mode_!==`Polygon`?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r,i,a=this.mode_;return a===`LineString`||a===`Circle`?(this.finishCoordinate_=e.slice(),i=this.sketchCoords_,i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),this.geometryFunction_(i,t,n)):a===`Polygon`&&(i=this.sketchCoords_[0],i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),r&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,t,n)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;for(let i=0;i<e;++i){let e;if(r===`LineString`||r===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,n),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r===`Polygon`){e=this.sketchCoords_[0],e.splice(-2,1);let r=this.sketchLine_.getGeometry();if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}r.setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,n)}if(e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,r)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,r),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new Aj([t])):this.type_===`MultiLineString`?e.setGeometry(new kj([t])):this.type_===`MultiPolygon`&&e.setGeometry(new Mj([t])),this.dispatchEvent(new JV(qV.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new JV(qV.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(e[0]);let r;if(t===`LineString`||t===`Circle`)r=this.sketchCoords_;else if(t===`Polygon`)r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();let n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new eT(new ek(n)),this.updateSketchFeatures_(),this.dispatchEvent(new JV(qV.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){let e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function XV(){let e=_M();return function(t,n){return e[t.getGeometry().getType()]}}function ZV(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}const QV=[0,0,0,0],$V=[],eH={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function tH(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]]}return r}var nH=class extends Hw{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},rH=class extends mI{constructor(e){if(super(e),this.handleSourceAdd_=this.handleSourceAdd_.bind(this),this.handleSourceRemove_=this.handleSourceRemove_.bind(this),this.handleExternalCollectionAdd_=this.handleExternalCollectionAdd_.bind(this),this.handleExternalCollectionRemove_=this.handleExternalCollectionRemove_.bind(this),this.handleFeatureChange_=this.handleFeatureChange_.bind(this),this.on,this.once,this.un,this.condition_=e.condition?e.condition:pI,this.defaultDeleteCondition_=function(e){return eI(e)&&sI(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:iI,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new $j,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new kF({source:new iM({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:sH(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null,this.filterFunctionWasSupplied_=e.filter!=null,this.filter_=e.filter?e.filter:()=>!0,this.coordinatesEqual_=e.sharedVerticesEqual?e.sharedVerticesEqual:_E,!(e.features||e.source))throw Error(`The modify interaction requires features collection or a source`);let t;e.features?(t=e.features.getArray(),e.features.addEventListener(xw.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(xw.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(nM.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(nM.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_)}),e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=[],t.filter(this.filter_).forEach(e=>this.addFeature_(e)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;t=e?e===!0?iI:e:oI,this.traceCondition_=t}addFeature_(e){this.features_.push(e);let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Qw;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new nH(eH.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){let t=this.features_.indexOf(e);this.features_.splice(t,1),this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.length===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){let t=e.feature;t&&this.externalAddFeatureHandler_(t)}handleSourceRemove_(e){let t=e.feature;t&&this.externalRemoveFeatureHandler_(t)}handleExternalCollectionAdd_(e){let t=e.element;t&&this.externalAddFeatureHandler_(t)}handleExternalCollectionRemove_(e){let t=e.element;t&&this.externalRemoveFeatureHandler_(t)}externalAddFeatureHandler_(e){e.addEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_),this.removeFeature_(e)}handleFeatureChange_(e){if(!this.changingFeature_){let t=e.target;this.removeFeature_(t),this.filter_(t)&&this.addFeature_(t)}}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(rT(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(rT(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(rT(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(rT(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:0,segment:[n,n]},i={feature:e,geometry:t,index:1,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(hT(n),r);let o=t,s=LD();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=fk(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t],i=this.SEGMENT_WRITERS_[r.getType()];i(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new eT(new ek(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==FF.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=FF.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==FF.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=rT([r]),a=this.rBush_.getInExtent(i),o={};a.sort(iH);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=X(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===1){let n=oH(e,s,t);this.coordinatesEqual_(n,r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s);continue}if(this.coordinatesEqual_(c[0],r)&&!o[l][0]){this.dragSegments_.push([s,0]),o[l][0]=s;continue}if(this.coordinatesEqual_(c[1],r)&&!o[l][1]){if(o[l][0]&&o[l][0].index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue}}this.dragSegments_.push([s,1]),o[l][1]=s;continue}X(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}tracePassesVertex_(e,t){if(e===t)return!1;if(e<t){let n=Math.ceil(e),r=Math.floor(t);return r===t&&--r,n<=r}let n=Math.floor(e),r=Math.ceil(t);return r===t&&(r+=1),n>=r}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&xE(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=zV(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;let r=!0;if(t.targetIndex===-1){let e=t.targets[n.index];r=this.tracePassesVertex_(e.startIndex,n.endIndex)}if(r){if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index,t.targets[t.targetIndex].endIndex=n.endIndex}let i=t.targets[n.index],a=LV(i.coordinates,n.endIndex);for(let e of this.dragSegments_)this.updateGeometry_(a.slice(),e);return a}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=rT([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=BV(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}shiftTracedSegmentIndices_(e,t,n){for(let r of this.dragSegments_){let i=r[0];i!==e&&i.geometry===e.geometry&&(i.depth===void 0||e.depth===void 0||Fw(i.depth,e.depth))&&i.index>=t&&(i.index+=n)}}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();tH(o,r.getType(),t.depth).splice(a,n),this.setGeometryCoordinates_(r,o),this.shiftTracedSegmentIndices_(t,a+n,-n),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(IV(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(IV(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();tH(o,n.getType(),t.depth).splice(a,0,...r),this.setGeometryCoordinates_(n,o),this.shiftTracedSegmentIndices_(t,a,r.length),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1],c=o.getStride();for(let t=2;t<c;++t)e[t]=a[s][t];switch(e.length=c,o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:{i=o.getCoordinates();let t=i[r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`MultiPolygon`:{i=o.getCoordinates();let t=i[r[1]][r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===0)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=xE(zD(t.getCenter(),n),zD(e,n)),i=LD();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_){let n=t[0];xE(hE(i,n.segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t)}this.traceSegments_.length>1&&(this.deactivateTrace_(),this.traceSegments_=null)}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}let a=this.updateTrace_(e);this.createOrUpdateVertexFeature_(a||t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){let t=this.traceState_.active?new Set:null;for(let n=this.dragSegments_.length-1;n>=0;--n){let r=this.dragSegments_[n][0];t&&t.add(r.feature);let i=r.geometry;if(i.getType()===`Circle`){let t=i,n=t.getCenter(),a=r.featureSegments[0],o=r.featureSegments[1];a.segment[0]=n,a.segment[1]=n,o.segment[0]=n,o.segment[1]=n,this.rBush_.update(hT(n),a);let s=t,c=LD();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=fk(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(rT(r.segment),r)}if(t)for(let e of t)this.removeFeature_(e),this.filter_(e)&&this.addFeature_(e);return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new nH(eH.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=function(t,n){return aH(e,t,r)-aH(e,n,r)},a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new ek(RD(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof eT&&this.features_.includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=BD(aT(VD(hT(e,QV),r),t.getView().getResolution()*this.pixelTolerance_,QV),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=oH(e,s,r),u=t.getPixelFromCoordinate(l),d=xE(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[X(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===1)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=bE(u,e),o=bE(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[X(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(this.coordinatesEqual_(c[0],t[0])&&this.coordinatesEqual_(c[1],t[1])||this.coordinatesEqual_(c[0],t[1])&&this.coordinatesEqual_(c[1],t[0])){let r=X(a[e].geometry);r in f||(f[r]=!0,n[X(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(rT(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(rT(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?RD(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(rT([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=zD(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=FF.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new nH(eH.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=X(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1))}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(rT(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(rT([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?zD(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||Fw(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(xw.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(xw.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(nM.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(nM.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_)}}};function iH(e,t){return e.index-t.index}function aH(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=LD();t&&(i=i.clone().transform(t,n));let r=bE(i.getCenter(),zD(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=zD(e,n);return $V[0]=zD(t.segment[0],n),$V[1]=zD(t.segment[1],n),SE(i,$V)}function oH(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=LD();return i&&(t=t.clone().transform(i,n)),RD(t.getClosestPoint(zD(e,n)),n)}let i=zD(e,n);return $V[0]=zD(t.segment[0],n),$V[1]=zD(t.segment[1],n),RD(hE(i,$V),n)}function sH(){let e=_M();return function(t,n){return e.Point}}const cH={SNAP:`snap`,UNSNAP:`unsnap`};var lH=class extends Hw{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const uH={Circle(e,t){let n=e,r=LD();r&&(n=n.clone().transform(r,t));let i=fk(n);return r&&i.transform(t,r),uH.Polygon(i)},GeometryCollection(e,t){let n=[],r=e.getGeometriesArray();for(let e=0;e<r.length;++e){let i=this[r[e].getType()];i&&n.push(i(r[e],t))}return n.flat()},LineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);return t},MultiLineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t},MultiPoint(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length;e<i;e+=r)t.push([n.slice(e,e+2)]);return t},MultiPolygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEndss(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=0,i=o.length;e<i;++e){let i=o[e];for(let e=a,o=i-r;e<o;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=i}}return t},Point(e){return[[e.getFlatCoordinates().slice(0,2)]]},Polygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t}};function dH(e){return e.feature?e.feature:e.element?e.element:null}const fH=[],pH=[],mH=[];var hH=class extends mI{constructor(e){e||={},super({handleDownEvent:Lw,stopDown:Rw}),this.on,this.once,this.un,this.source_=e.source?e.source:null,this.vertex_=e.vertex===void 0||e.vertex,this.edge_=e.edge===void 0||e.edge,this.intersection_=e.intersection!==void 0&&e.intersection,this.features_=e.features?e.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.rBush_=new $j,this.snapped_=null,this.segmenters_=Object.assign({},uH,e.segmenters)}addFeature(e,t){t=t===void 0||t;let n=X(e),r=e.getGeometry();if(r){let t=this.segmenters_[r.getType()];if(t){this.indexedFeaturesExtents_[n]=r.getExtent(fT());let i=t.call(this.segmenters_,r,this.getMap().getView().getProjection()),a=i.length;for(let t=0;t<a;++t){let n=i[t];pH[t]=rT(n),mH[t]={feature:e,segment:n}}if(this.intersection_)for(let t=0,n=i.length;t<n;++t){let n=i[t];if(n.length===1)continue;let r=pH[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!LT(r,pH[o]))continue;let s=VO(n,t);if(!s)continue;let c=[s];pH[a]=rT(c),mH[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(pH[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=VO(n,r);if(!i)continue;let s=[i];pH[a]=rT(s),mH[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(pH[0],mH[0]):(pH.length=a,mH.length=a,this.rBush_.load(pH,mH))}}t&&(this.featureChangeListenerKeys_[n]&&Dw(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=Tw(e,Y.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e}areSnapDataEqual_(e,t){return e.segment===t.segment&&e.feature===t.feature}handleEvent(e){let t=this.snapTo(e.pixel,e.coordinate,e.map);return t?(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,t)&&this.dispatchEvent(new lH(cH.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new lH(cH.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new lH(cH.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=dH(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=dH(e);t&&(this.removeFeature(t),delete this.pendingFeatures_[X(t)])}handleFeatureChange_(e){let t=e.target;this.handlingDownUpSequence?this.pendingFeatures_[X(t)]=t:this.updateFeature_(t)}handleUpEvent(e){let t=Object.values(this.pendingFeatures_);if(t.length){for(let e of t)this.updateFeature_(e);Cw(this.pendingFeatures_)}return!1}removeFeature(e,t){let n=t===void 0||t,r=X(e),i=this.indexedFeaturesExtents_[r];if(i){let t=this.rBush_;t.getInExtent(i).forEach(n=>{(e===n.feature||e===n.intersectionFeature)&&t.remove(n)})}n&&(Dw(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])}setMap(e){let t=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();if(Array.isArray(r)||(r=r.getArray()),t&&(n.forEach(Dw),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(Dw),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(Tw(this.features_,xw.ADD,this.handleFeatureAdd_,this),Tw(this.features_,xw.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(Tw(this.source_,nM.ADDFEATURE,this.handleFeatureAdd_,this),Tw(this.source_,nM.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=zD(t,r),a=BD(aT(rT([i]),n.getView().getResolution()*this.pixelTolerance_),r),o=this.rBush_.getInExtent(a),s=o.length;if(s===0)return null;let c,l=1/0,u,d=null,f=this.pixelTolerance_*this.pixelTolerance_,p=()=>{if(!c)return null;let t=n.getPixelFromCoordinate(c);return bE(e,t)>f?null:{vertex:c,vertexPixel:[Math.round(t[0]),Math.round(t[1])],feature:u,segment:d}};if(this.vertex_||this.intersection_){for(let e=0;e<s;++e){let t=o[e];if(t.feature.getGeometry().getType()!==`Circle`)for(let e of t.segment){let n=bE(i,zD(e,r));n<l&&(this.intersection_&&t.intersectionFeature||this.vertex_&&!t.intersectionFeature)&&(c=e,l=n,u=t.feature)}}let e=p();if(e)return e}if(this.edge_){for(let e=0;e<s;++e){let t=null,n=o[e];if(n.feature.getGeometry().getType()===`Circle`){let e=n.feature.getGeometry(),a=LD();a&&(e=e.clone().transform(a,r)),t=mE(i,e)}else{let[e,a]=n.segment;a&&(fH[0]=zD(e,r),fH[1]=zD(a,r),t=hE(i,fH))}if(t){let e=bE(i,t);e<l&&(c=RD(t,r),d=n.feature.getGeometry().getType()===`Circle`?null:n.segment,l=e,u=n.feature)}}let e=p();if(e)return e}return null}updateFeature_(e){this.removeFeature(e,!1),this.addFeature(e,!1)}},gH=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=eT,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?wD(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=wD(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return Kw()}readFeature(e,t){return Kw()}readFeatures(e,t){return Kw()}readGeometry(e,t){return Kw()}readProjection(e){return Kw()}writeFeature(e,t){return Kw()}writeFeatures(e,t){return Kw()}writeGeometry(e,t){return Kw()}};function _H(e,t,n){let r=n?wD(n.featureProjection):null,i=n?wD(n.dataProjection):null,a=e;if(r&&i&&!MD(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(FD(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}const vH={Point:ek,LineString:Yk,Polygon:uk,MultiPoint:Aj,MultiLineString:kj,MultiPolygon:Mj};function yH(e,t,n){return Array.isArray(t[0])?(ok(e,0,t,n)||(e=e.slice(),ck(e,0,t,n)),e):(ak(e,0,t,n)||(e=e.slice(),sk(e,0,t,n)),e)}function bH(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>bH({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return _H(new Pj(r,r===`Polygon`?yH(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function xH(e,t){if(!e)return null;if(Array.isArray(e))return new PV(e.map(e=>xH(e,t)));let n=vH[e.type];return _H(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var SH=class extends gH{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(CH(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(CH(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return Kw()}readFeaturesFromObject(e,t){return Kw()}readGeometry(e,t){return this.readGeometryFromObject(CH(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return Kw()}readProjection(e){return this.readProjectionFromObject(CH(e))}readProjectionFromObject(e){return Kw()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return Kw()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return Kw()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return Kw()}};function CH(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var wH=class extends SH{constructor(e){e||={},super(),this.dataProjection=wD(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=wD(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=TH(n.geometry,t);if(this.featureClass===Pj)return bH({geometry:r,id:n.id,properties:n.properties},t);let i=this.featureClass,a=new i;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&a.setGeometryName(n.geometry_name),a.setGeometry(xH(r,t)),`id`in n&&a.setId(n.id),n.properties&&a.setProperties(n.properties,!0),a}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return EH(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=wD(t.properties.name);else if(t.type===`EPSG`)n=wD(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`)}else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=PH(a,t),delete i[e.getGeometryName()]),ww(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return PH(e,this.adaptOptions(t))}};function TH(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=OH(e);break;case`LineString`:n=kH(e);break;case`Polygon`:n=NH(e);break;case`MultiPoint`:n=jH(e);break;case`MultiLineString`:n=AH(e);break;case`MultiPolygon`:n=MH(e);break;case`GeometryCollection`:n=DH(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function EH(e,t){return xH(TH(e,t),t)}function DH(e,t){return e.geometries.map(function(e){return TH(e,t)})}function OH(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:gO(t.length)}}function kH(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:gO(t[0]?.length||2)}}function AH(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:jO(r,0,t,n),layout:gO(n)}}function jH(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:gO(t[0]?.length||2)}}function MH(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:MO(n,0,t,r),layout:gO(r)}}function NH(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:jO(n,0,t,r),layout:gO(r)}}function PH(e,t){e=_H(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=BH(e,t);break;case`LineString`:r=IH(e,t);break;case`Polygon`:r=VH(e,t);break;case`MultiPoint`:r=RH(e,t);break;case`MultiLineString`:r=LH(e,t);break;case`MultiPolygon`:r=zH(e,t);break;case`GeometryCollection`:r=FH(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function FH(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return PH(e,t)})}}function IH(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function LH(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function RH(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function zH(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function BH(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function VH(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const HH={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},UH={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},WH={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},GH=[{shape:`Point`,label:`Draw a point`,Icon:mn},{shape:`LineString`,label:`Draw a line`,Icon:kn},{shape:`Circle`,label:`Draw a circle`,Icon:pn}];function KH({target:e,className:t,fileName:n=`react-openlayers-geojson.json`}){let r=QL(),i=lV(`MapDrawControl`,W(HH.root,t),e),[a,o]=l.useState(!1),[s,c]=l.useState(null),u=l.useRef(null),f=l.useRef(null);if(!u.current){let e=new iM;u.current={source:e,layer:new kF({source:e,style:UH,properties:{key:`drawLayer`}}),modify:new rH({source:e})}}let p=u.current,m=l.useCallback(()=>{let e=p.source.getFeatures(),t=new wH().writeFeaturesObject(e,WH),r=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=n,a.click(),URL.revokeObjectURL(i)},[p,n]);l.useEffect(()=>{if(!(!r||!a))return r.addLayer(p.layer),r.addInteraction(p.modify),()=>{r.removeInteraction(p.modify),r.removeLayer(p.layer)}},[r,a,p]),l.useEffect(()=>{if(!r||!a||!s)return;let e=s===`LineString`?new YV({source:p.source,type:s,maxPoints:2}):new YV({source:p.source,type:s}),t=new hH({source:p.source});return f.current=e,r.addInteraction(e),r.addInteraction(t),()=>{r.removeInteraction(t),r.removeInteraction(e),f.current=null}},[r,a,s,p]),l.useEffect(()=>{if(!r||!a)return;let e=r.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?f.current?.abortDrawing():e.shiftKey&&e.key===`S`&&m()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,a,m]);let h=()=>{o(e=>!e),c(null)},g=e=>{c(t=>t===e?null:e)};return(0,d.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:HH.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":a,onClick:h,children:(0,K.jsx)(Rn,{size:12})}),a?(0,K.jsxs)(`div`,{className:HH.shapes,children:[GH.map(({shape:e,label:t,Icon:n})=>(0,K.jsx)(`button`,{type:`button`,className:HH.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":s===e,onClick:()=>g(e),children:(0,K.jsx)(n,{size:12})},e)),(0,K.jsx)(`button`,{type:`button`,className:HH.shape,title:`Move and reshape what has been drawn`,"aria-pressed":s===null,onClick:()=>g(null),children:(0,K.jsx)(Xt,{size:12})})]}):null]}),i)}KH.displayName=`MapDrawControl`;const qH={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},JH=(e,t)=>e.map((e,n)=>{let r=`${t}${n}`;return{key:r,layer:e,name:e.get(`name`)??e.constructor.name,children:e instanceof NI?JH(e.getLayers().getArray(),`${r}.`):[]}});function YH({target:e,className:t}){let n=QL(),r=lV(`MapLayersControl`,W(qH.root,t),e),[i,a]=l.useState(!1),[o,s]=l.useState(0),c=l.useMemo(()=>n&&i?JH(n.getLayers().getArray(),``):[],[n,i,o]),u=(e,t)=>{e.setVisible(t),s(e=>e+1)},f=e=>(0,K.jsx)(`ul`,{className:qH.list,children:e.map(e=>(0,K.jsxs)(`li`,{className:qH.item,children:[(0,K.jsxs)(`label`,{className:qH.label,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.layer.getVisible(),onChange:t=>u(e.layer,t.target.checked)}),e.name]}),e.children.length>0?f(e.children):null]},e.key))});return(0,d.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:qH.toggle,title:`Click here to switch layers`,"aria-expanded":i,onClick:()=>a(e=>!e),children:(0,K.jsx)(On,{size:24})}),i?(0,K.jsx)(`div`,{className:qH.layers,children:f(c)}):null]}),r)}YH.displayName=`MapLayersControl`;const XH={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function ZH({target:e,className:t,zoom:n=18,color:r=oR,placeholder:i=`Search for a place`}){let a=QL(),o=lV(`MapSearchControl`,W(XH.root,t),e),[s,c]=l.useState(!1),[u,f]=l.useState(``);return(0,d.createPortal)((0,K.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!a||!u)return;let[t]=await iR(u,1);if(!t)return;let i=[Number(t.lon),Number(t.lat)];lR(a,i,r).set(`address`,t.display_name),a.getView().setCenter(AD(i)),a.getView().setZoom(n)},children:[(0,K.jsx)(`button`,{type:`button`,className:XH.toggle,title:i,"aria-expanded":s,onClick:()=>c(e=>!e),children:(0,K.jsx)(Ln,{size:24})}),s?(0,K.jsx)(`input`,{type:`search`,className:XH.input,value:u,placeholder:i,"aria-label":i,autoComplete:`off`,onChange:e=>f(e.target.value)}):null]}),o)}ZH.displayName=`MapSearchControl`;const QH=e=>{let t=QL(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addInteraction(r),()=>{t.removeInteraction(r)}},[t,r]),r};var $H=class extends mI{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:uI,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!fI(e))return;let t=e.map,n=t.getSize(),r=e.pixel,i=r[0]-n[0]/2,a=n[1]/2-r[1],o=Math.atan2(a,i),s=Math.sqrt(i*i+a*a),c=t.getView();if(this.lastAngle_!==void 0){let e=this.lastAngle_-o;c.adjustRotationInternal(e)}this.lastAngle_=o,this.lastMagnitude_!==void 0&&c.adjustResolutionInternal(this.lastMagnitude_/s),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}handleUpEvent(e){if(!fI(e))return!0;let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1}handleDownEvent(e){return fI(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function eU(e){return QH(()=>new $H(e)),null}eU.displayName=`MapDragRotateAndZoomInteraction`;const tU={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var nU=class extends Hw{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},rU=class extends mI{constructor(e){e||={},super(e),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=e.features===void 0?null:e.features;let t;if(e.layers&&!this.features_){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=Lw;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:Lw,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:iI,this.lastFeature_=null,this.addChangeListener(JF.ACTIVE,this.handleActiveChanged_)}handleDownEvent(e){if(!e.originalEvent||!this.condition_(e))return!1;if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);let t=this.features_||new Qw([this.lastFeature_]);return this.dispatchEvent(new nU(tU.TRANSLATESTART,t,e.coordinate,this.startCoordinate_,e)),!0}return!1}handleUpEvent(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);let t=this.features_||new Qw([this.lastFeature_]);return this.dispatchEvent(new nU(tU.TRANSLATEEND,t,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1}handleDragEvent(e){if(this.lastCoordinate_){let t=e.coordinate,n=e.map.getView().getProjection(),r=zD(t,n),i=zD(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new Qw([this.lastFeature_]),c=LD();s.forEach(function(e){let t=e.getGeometry();c?(t.transform(c,n),t.translate(a,o),t.transform(n,c)):t.translate(a,o),e.setGeometry(t)}),this.lastCoordinate_=t,this.dispatchEvent(new nU(tU.TRANSLATING,s,t,this.startCoordinate_,e))}}handleMoveEvent(e){let t=e.map.getViewport();this.featuresAtPixel_(e.pixel,e.map)?(t.classList.remove(this.lastCoordinate_?`ol-grab`:`ol-grabbing`),t.classList.add(this.lastCoordinate_?`ol-grabbing`:`ol-grab`)):t.classList.remove(`ol-grab`,`ol-grabbing`)}featuresAtPixel_(e,t){return t.forEachFeatureAtPixel(e,(e,t)=>{if(!(!(e instanceof eT)||!this.filter_(e,t))&&!(this.features_&&!this.features_.getArray().includes(e)))return e},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(e){this.hitTolerance_=e}setMap(e){let t=this.getMap();super.setMap(e),this.updateState_(t)}handleActiveChanged_(){this.updateState_(null)}updateState_(e){let t=this.getMap(),n=this.getActive();(!t||!n)&&(t||=e,t&&t.getViewport().classList.remove(`ol-grab`,`ol-grabbing`))}};function iU(e){return QH(()=>new rU(e)),null}iU.displayName=`MapTranslateInteraction`;function aU(e){let t=l.useRef(null),n=e=>{let n=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return n instanceof eT&&(t.current={feature:n,coordinate:e.coordinate},!0)},r=e=>{let n=t.current;if(!n)return;let r=n.feature.getGeometry();r&&(r.translate(e.coordinate[0]-n.coordinate[0],e.coordinate[1]-n.coordinate[1]),n.coordinate=e.coordinate)},i=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},a=()=>(t.current=null,!1);return QH(()=>new mI({handleDownEvent:n,handleDragEvent:r,handleMoveEvent:i,handleUpEvent:a,...e})),null}aU.displayName=`MapPointerInteraction`;const oU={SELECT:`select`};var sU=class extends Hw{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const cU={};var lU=class e extends YF{constructor(e){super(),this.on,this.once,this.un,e||={},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:sI,this.addCondition_=e.addCondition?e.addCondition:oI,this.removeCondition_=e.removeCondition?e.removeCondition:oI,this.toggleCondition_=e.toggleCondition?e.toggleCondition:uI,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:Lw,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?uU():e.style,this.features_=e.features||new Qw;let t;if(e.layers){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=Lw;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[X(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[X(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(xw.ADD,this.boundAddFeature_),this.features_.addEventListener(xw.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(xw.ADD,this.boundAddFeature_),this.features_.removeEventListener(xw.REMOVE,this.boundRemoveFeature_))}addFeature_(e){let t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){let e=this.findLayerOfFeature_(t);e&&this.addFeatureLayerAssociation_(t,e)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element),this.removeFeatureLayerAssociation_(e.element)}findLayerOfFeature_(e){return this.getMap().getAllLayers().find(function(t){if(t instanceof kF&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in cU||(cU[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(t){let n=this.getMap().getInteractions().getArray();for(let r=n.length-1;r>=0;--r){let i=n[r];if(i!==this&&i instanceof e&&i.getStyle()&&i.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(i.getStyle());return}}let r=X(t);t.setStyle(cU[r]),delete cU[r]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[X(e)]}selectFeature(e){let t=this.findLayerOfFeature_(e);if(!this.layerFilter_(t)||!this.filter_(e,t))return!1;let n=this.getFeatures();return!n.getArray().includes(e)&&(this.addFeatureLayerAssociation_(e,t),n.push(e),this.dispatchEvent(new sU(oU.SELECT,[e],[],void 0)),!0)}deselectFeature(e){let t=this.getFeatures(),n=t.getArray().indexOf(e);return n!==-1&&(t.removeAt(n),this.dispatchEvent(new sU(oU.SELECT,[],[e],void 0)),!0)}toggleFeature(e){this.deselectFeature(e)||this.selectFeature(e)}clearSelection(){let e=this.getFeatures();if(e.getLength()!==0){let t=e.getArray().slice();e.clear(),this.dispatchEvent(new sU(oU.SELECT,[],t,void 0))}}handleEvent(e){if(!this.condition_(e))return!0;let t=this.addCondition_(e),n=this.removeCondition_(e),r=this.toggleCondition_(e),i=!t&&!n&&!r,a=e.map,o=this.getFeatures(),s=[],c=[];if(i){a.forEachFeatureAtPixel(e.pixel,(e,t)=>{if(!(!(e instanceof eT)||!this.filter_(e,t)))return this.addFeatureLayerAssociation_(e,t),c.push(e),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=o.getLength()-1;e>=0;--e){let t=o.item(e),n=c.indexOf(t);n===-1?(o.removeAt(e),s.push(t)):c.splice(n,1)}c.length!==0&&o.extend(c)}else{a.forEachFeatureAtPixel(e.pixel,(e,i)=>{if(!(e instanceof eT)||!this.filter_(e,i))return;let a=o.getArray().includes(e);return a&&(n||r)?s.push(e):!a&&(t||r)&&(this.addFeatureLayerAssociation_(e,i),c.push(e)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=s.length-1;e>=0;--e)o.remove(s[e]);o.extend(c)}return(c.length>0||s.length>0)&&this.dispatchEvent(new sU(oU.SELECT,c,s,e)),!0}};function uU(){let e=_M();return Pw(e.Polygon,e.LineString),Pw(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const dU=`#ff0000`,fU=`rgba(255, 0, 0, 0.4)`,pU=e=>new yM({text:e,font:`12px Calibri,sans-serif`,fill:new aM({color:`#000`}),stroke:new oM({color:`#fff`,width:3}),offsetY:-10}),mU=e=>{let t=e.getGeometry();if(!(t instanceof mO))return;let n=t.getType();if(n===`Point`)return new pM({image:new fM({radius:6,fill:new aM({color:fU}),stroke:new oM({color:dU,width:2})})});if(n===`LineString`){let e=new pM({stroke:new oM({color:dU,width:3})}),n=oE(t)/1e3;return n>0&&e.setText(pU(`Length: ${n.toFixed(2)} km`)),e}let r=new pM({fill:new aM({color:fU}),stroke:new oM({color:dU,width:2})});try{let e=cE(t)/1e6;e>0&&r.setText(pU(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function hU({onSelect:e,style:t=mU,...n}){let r=QL(),i=QH(()=>new lU({...n,style:t})),a=l.useRef(e);return l.useEffect(()=>{a.current=e},[e]),l.useEffect(()=>{let e=i.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&a.current?.(e)});return()=>Gw(e)},[i]),l.useEffect(()=>{if(!r)return;let e=r.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=i.getFeatures();t.forEach(e=>{i.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,i]),null}hU.displayName=`MapSelectInteraction`;function gU(e){return eE(e,5)}function _U(e){return parseFloat(e)}function vU(e){return gU(e).toString()}function yU(e,t){return!isNaN(e)&&e!==_U(vU(t))}function bU(e,t){return yU(e[0],t[0])||yU(e[1],t[1])}var xU=class extends YF{constructor(e){super(),e=Object.assign({animate:!0,params:[`x`,`y`,`z`,`r`,`l`],replace:!1,prefix:``},e||{});let t;t=e.animate===!0?{duration:250}:e.animate?e.animate:null,this.animationOptions_=t,this.params_=e.params.reduce((e,t)=>(e[t]=!0,e),{}),this.replace_=e.replace,this.prefix_=e.prefix,this.listenerKeys_=[],this.initial_=!0,this.updateState_=this.updateState_.bind(this),this.trackedCallbacks_={},this.trackedValues_={}}getParamName_(e){return this.prefix_?this.prefix_+e:e}get_(e,t){return e.get(this.getParamName_(t))}set_(e,t,n){t in this.params_&&e.set(this.getParamName_(t),n)}delete_(e,t){t in this.params_&&e.delete(this.getParamName_(t))}setMap(e){let t=this.getMap();super.setMap(e),e!==t&&(t&&this.unregisterListeners_(t),e&&(this.initial_=!0,this.updateState_(),this.registerListeners_(e)))}registerListeners_(e){this.listenerKeys_.push(Tw(e,RF.MOVEEND,this.updateUrl_,this),Tw(e.getLayerGroup(),Y.CHANGE,this.updateUrl_,this),Tw(e,`change:layergroup`,this.handleChangeLayerGroup_,this)),this.replace_||addEventListener(`popstate`,this.updateState_)}unregisterListeners_(e){for(let e=0,t=this.listenerKeys_.length;e<t;++e)Dw(this.listenerKeys_[e]);this.listenerKeys_.length=0,this.replace_||removeEventListener(`popstate`,this.updateState_);let t=new URL(window.location.href),n=t.searchParams;this.delete_(n,`x`),this.delete_(n,`y`),this.delete_(n,`z`),this.delete_(n,`r`),this.delete_(n,`l`),window.history.replaceState(null,``,t)}handleChangeLayerGroup_(){let e=this.getMap();e&&(this.unregisterListeners_(e),this.registerListeners_(e),this.initial_=!0,this.updateUrl_())}updateState_(){let e=new URL(window.location.href).searchParams;for(let t in this.trackedCallbacks_){let n=e.get(t);t in this.trackedCallbacks_&&n!==this.trackedValues_[t]&&(this.trackedValues_[t]=n,this.trackedCallbacks_[t](n))}let t=this.getMap();if(!t)return;let n=t.getView();if(!n||!n.isDef())return;let r=!1,i={},a=_U(this.get_(e,`z`));`z`in this.params_&&yU(a,n.getZoom())&&(r=!0,i.zoom=a);let o=_U(this.get_(e,`r`));`r`in this.params_&&yU(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[_U(this.get_(e,`x`)),_U(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&bU(s,n.getCenter())&&(r=!0,i.center=s),r&&(!this.initial_&&this.animationOptions_?n.animate(Object.assign(i,this.animationOptions_)):(i.center&&n.setCenter(i.center),`zoom`in i&&n.setZoom(i.zoom),`rotation`in i&&n.setRotation(i.rotation)));let c=t.getAllLayers(),l=this.get_(e,`l`);if(`l`in this.params_&&l&&l.length===c.length)for(let e=0,t=c.length;e<t;++e){let t=parseInt(l[e]);if(!isNaN(t)){let n=!!t,r=c[e];r.getVisible()!==n&&r.setVisible(n)}}}track(e,t){this.trackedCallbacks_[e]=t;let n=new URL(window.location.href).searchParams.get(e);return this.trackedValues_[e]=n,n}update(e,t){let n=new URL(window.location.href),r=n.searchParams;t===null?r.delete(e):r.set(e,t),e in this.trackedValues_&&(this.trackedValues_[e]=t),this.updateHistory_(n)}updateUrl_(){let e=this.getMap();if(!e)return;let t=e.getView();if(!t||!t.isDef())return;let n=t.getCenter(),r=t.getZoom(),i=t.getRotation(),a=e.getAllLayers(),o=Array(a.length);for(let e=0,t=a.length;e<t;++e)o[e]=a[e].getVisible()?`1`:`0`;let s=new URL(window.location.href),c=s.searchParams;this.set_(c,`x`,vU(n[0])),this.set_(c,`y`,vU(n[1])),this.set_(c,`z`,vU(r)),this.set_(c,`r`,vU(i)),this.set_(c,`l`,o.join(``)),this.updateHistory_(s),this.initial_=!1}updateHistory_(e){e.href!==window.location.href&&(this.initial_||this.replace_?window.history.replaceState(history.state,``,e):window.history.pushState(null,``,e))}};function SU(e){return QH(()=>new xU(e)),null}SU.displayName=`MapLinkInteraction`;const CU={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},wU=37.7649804,TU=-122.4323829,EU=[];function DU({latitude:e,longitude:t,zoom:n,marker:r,markerColor:i,markerLabel:a}){let o=QL(),s=l.useRef(!1);return l.useEffect(()=>{if(!o)return;let r=o.getView(),i=AD([t,e]);if(s.current){r.animate({center:i,zoom:n,duration:500});return}s.current=!0,r.setCenter(i),r.setZoom(n)},[o,e,t,n]),l.useEffect(()=>{if(!o||!r)return;let n=lR(o,[t,e],i,a);return()=>uR(o,n)},[o,e,t,r,i,a]),null}DU.displayName=`MapLocation`;function OU(e,t){let{latitude:n=wU,longitude:r=TU,zoom:i=16,width:a,height:o,controls:s=EU,marker:c=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=e,y=J(f),b=l.useRef(null),x=B(t,b),S=l.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=CU.toolbar,S.current=e}let C=S.current;l.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,K.jsx)(wV,{},e);case`fullScreen`:return(0,K.jsx)(yV,{target:C,source:y},e);case`search`:return(0,K.jsx)(ZH,{target:C},e);case`layers`:return(0,K.jsx)(YH,{target:C},e);case`draw`:return(0,K.jsx)(KH,{target:C},e)}};return(0,K.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:W(CU.root,p),style:{...m,"--map-width":typeof a==`number`?`${a}px`:a,"--map-height":typeof o==`number`?`${o}px`:o},"data-component":`Map`,...v,children:(0,K.jsxs)(ZL,{className:CU.surface,keyboardEventTarget:y,children:[(0,K.jsx)(DU,{latitude:n,longitude:r,zoom:i,marker:c,markerColor:u,markerLabel:d}),s.map(T),h]})})}OU.displayName=`Map`;var kU=G(OU);const AU=Object.assign(kU,{View:$L,Marker:pR,Overlay:hR,LayerGroup:yR,TileLayer:bR,ImageLayer:wR,VectorLayer:TR,GraticuleLayer:ER,HeatmapLayer:iV,WebGLTileLayer:sV,AttributionControl:uV,DrawControl:KH,FullScreenControl:yV,LayersControl:YH,MousePositionControl:OV,OverviewMapControl:MV,ScaleLineControl:wV,SearchControl:ZH,DragRotateAndZoomInteraction:eU,LinkInteraction:SU,PointerInteraction:aU,SelectInteraction:hU,TranslateInteraction:iU}),jU={root:`markdown`};function MU(e,t){let{className:n,source:r,transformers:i,preserveNewLines:a=!1,...o}=e,[s]=(0,v.useLexicalComposerContext)(),c=l.useCallback(e=>{s.setRootElement(e)},[s]),u=B(t,c);return Vi(()=>{s.update(()=>{(0,_.$convertFromMarkdownString)(r,i,void 0,a)},{discrete:!0})},[s,r,i,a]),(0,K.jsx)(`div`,{ref:u,className:W(jU.root,n),"data-component":`Markdown`,...o})}MU.displayName=`MarkdownProse`;var NU=G(MU);const PU=`Markdown`,FU=[S.HeadingNode,S.QuoteNode,x.ListNode,x.ListItemNode,b.LinkNode,y.CodeNode,y.CodeHighlightNode],IU=[_.CHECK_LIST,..._.TRANSFORMERS],LU={paragraph:`markdown-paragraph`,heading:{h1:`markdown-heading-1`,h2:`markdown-heading-2`,h3:`markdown-heading-3`,h4:`markdown-heading-4`,h5:`markdown-heading-5`,h6:`markdown-heading-6`},quote:`markdown-quote`,link:`markdown-link`,code:`markdown-code-block`,list:{ul:`markdown-list-bullet`,ol:`markdown-list-number`,listitem:`markdown-list-item`,checklist:`markdown-list-check`,listitemChecked:`markdown-list-item-checked`,listitemUnchecked:`markdown-list-item-unchecked`,nested:{listitem:`markdown-list-item-nested`}},text:{bold:`markdown-bold`,italic:`markdown-italic`,strikethrough:`markdown-strikethrough`,highlight:`markdown-highlight`,code:`markdown-code-inline`},ltr:`markdown-ltr`,rtl:`markdown-rtl`};function RU(e,t){let{className:n,children:r=``,transformers:i=IU,preserveNewLines:a=!1,namespace:o=PU,onError:s,...c}=e;return(0,K.jsx)(g.LexicalComposer,{initialConfig:{namespace:o,theme:LU,nodes:FU,editable:!1,onError:s??(e=>{throw e})},children:(0,K.jsx)(NU,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}RU.displayName=`Markdown`;var zU=G(RU);const BU={slow:30,medium:60,fast:120},VU={start:`inline`,end:`inline`,top:`block`,bottom:`block`},HU=({side:e=`start`,speed:t=`medium`}={})=>{let n=l.useRef(null),r=l.useRef(null),[i,a]=l.useState(0),[o,s]=l.useState(2),c=VU[e];Vi(()=>{let e=n.current,t=r.current;if(!e||!t)return;let i=()=>{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=c===`inline`?n.width:n.height,o=c===`inline`?r.width:r.height;a(i),s(i>0?Math.max(2,Math.ceil(o/i)+1):2)};if(i(),typeof ResizeObserver>`u`)return;let o=new ResizeObserver(i);return o.observe(e),o.observe(t),()=>{o.disconnect()}},[c]);let u=i>0?i/BU[t]:0;return{rootRef:n,groupRef:r,axis:c,copies:o,distance:i,duration:u,style:{"--marquee-distance":`${i}px`,"--marquee-duration":`${u}s`}}},UU={track:`marquee-track`,group:`marquee-group`},WU=U(`marquee`,{variants:{side:{start:`marquee-inline`,end:`marquee-inline marquee-reversed`,top:`marquee-block`,bottom:`marquee-block marquee-reversed`},spacing:{none:`marquee-spacing-none`,tight:`marquee-spacing-tight`,condensed:`marquee-spacing-condensed`,cozy:`marquee-spacing-cozy`,normal:`marquee-spacing-normal`,spacious:`marquee-spacing-spacious`},pauseOnHover:{true:`marquee-pause-on-hover`,false:``},paused:{true:`marquee-paused`,false:``}}});function GU(e,t){let{className:n,children:r,style:i,side:a=`start`,speed:o=`medium`,spacing:s,pauseOnHover:c=!0,paused:l=!1,...u}=e,{rootRef:d,groupRef:f,axis:p,copies:m,style:h}=HU({side:a,speed:o}),g=B(t,d);return(0,K.jsx)(`div`,{ref:g,className:W(WU({side:a,spacing:s,pauseOnHover:c,paused:l}),n),style:{...i,...h},"data-component":`Marquee`,"data-side":a,"data-axis":p,"data-speed":o,"data-spacing":s,"data-paused":l,...u,children:(0,K.jsx)(`div`,{className:UU.track,children:Array.from({length:m},(e,t)=>(0,K.jsx)(`div`,{ref:t===0?f:void 0,"aria-hidden":t!==0||void 0,className:UU.group,"data-component":`Marquee.Group`,children:r},t))})})}GU.displayName=`Marquee`;var KU=G(GU);const qU=(0,l.createContext)({}),JU=U(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function YU(e,t){let{as:n=`div`,className:r,align:i,...a}=e,{align:o}=l.useContext(qU),s=i??o??`start`,c={align:s};return(0,K.jsx)(bl.Provider,{value:c,children:(0,K.jsx)(n,{ref:t,className:W(JU({align:s}),r),"data-component":`Message`,"data-align":s,...a})})}YU.displayName=`Message`;var XU=G(YU);const ZU={root:`message-avatar`};function QU(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(ZU.root,r),"data-component":`Message.Avatar`,...i})}QU.displayName=`Message.Avatar`;var $U=G(QU);const eW={root:`message-content`};function tW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(eW.root,r),"data-component":`Message.Content`,...i})}tW.displayName=`Message.Content`;var nW=G(tW);const rW={root:`message-footer`};function iW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(rW.root,r),"data-component":`Message.Footer`,...i})}iW.displayName=`Message.Footer`;var aW=G(iW);const oW={root:`message-group`};function sW(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,K.jsx)(qU.Provider,{value:{align:i},children:(0,K.jsx)(n,{ref:t,className:W(oW.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}sW.displayName=`Message.Group`;var cW=G(sW);const lW={root:`message-header`};function uW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(lW.root,r),"data-component":`Message.Header`,...i})}uW.displayName=`Message.Header`;var dW=G(uW);const fW=Object.assign(XU,{Group:cW,Avatar:$U,Content:nW,Header:dW,Footer:aW}),pW=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},mW=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,hW=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return mW(r??0,r,i);let a=e+t*n,o=Math.max(pW(n),pW(e)),s=o===0?a:Number(a.toFixed(o));return mW(s,r,i)},gW=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},_W=(0,l.createContext)({}),vW={root:`meter-indicator`};function yW(e,t){let{as:n=`span`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(vW.root,r),"data-component":`Meter.Indicator`,...i})}yW.displayName=`Meter.Indicator`;var bW=G(yW);const xW={root:`meter-label`};function SW(e,t){let{as:n=`span`,className:r,id:i,...a}=e,{labelId:o}=l.useContext(_W);return(0,K.jsx)(n,{ref:t,id:i??o,className:W(xW.root,r),"data-component":`Meter.Label`,...a})}SW.displayName=`Meter.Label`;var CW=G(SW);const wW={root:`meter-track`};function TW(e,t){let{as:n=`span`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(wW.root,r),"data-component":`Meter.Track`,...i})}TW.displayName=`Meter.Track`;var EW=G(TW);const DW={root:`meter-value`};function OW(e,t){let{className:n,children:r,...i}=e,{formattedValue:a=``,value:o=0}=l.useContext(_W);return(0,K.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:W(DW.root,n),"data-component":`Meter.Value`,...i,children:typeof r==`function`?r({formattedValue:a,value:o}):r??a})}OW.displayName=`Meter.Value`;var kW=G(OW);const AW=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,jW=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),MW={header:`meter-header`,hidden:`sr-only`},NW=U(`meter`,{variants:{size:{small:`meter-small`,medium:`meter-medium`,large:`meter-large`},variant:{accent:`meter-accent`,attention:`meter-attention`,danger:`meter-danger`,done:`meter-done`,neutral:`meter-neutral`,severe:`meter-severe`,sponsors:`meter-sponsors`,success:`meter-success`}}});function PW(e,t){let{as:n=`div`,className:r,style:i,value:a,min:o=0,max:s=100,format:c,getAriaValueText:l,size:u=`medium`,variant:d=`success`,children:f,id:p,"aria-label":m,"aria-labelledby":h,...g}=e,_=`${J(p)}-label`,[v,y]=Sr(f,{label:CW,value:kW,track:EW}),b=mW(Number.isNaN(a)?o:a,o,s),x=mW(AW(b,o,s),0,100),S=jW(b,x,c),C=l?l(S,a):S,w=h??(v.label&&!m?_:void 0),T={value:b,percentage:x,formattedValue:S,labelId:_};return(0,K.jsx)(_W.Provider,{value:T,children:(0,K.jsxs)(n,{ref:t,id:p,role:`meter`,"aria-valuenow":b,"aria-valuemin":o,"aria-valuemax":s,"aria-valuetext":C,"aria-label":m,"aria-labelledby":w,className:W(NW({size:u,variant:d}),r),style:{...i,"--meter-percentage":`${x}%`},"data-component":`Meter`,"data-size":u,"data-variant":d,"data-value":b,...g,children:[v.label||v.value?(0,K.jsxs)(`span`,{className:MW.header,children:[v.label,v.value]}):null,v.track??(0,K.jsx)(EW,{children:(0,K.jsx)(bW,{})}),y,(0,K.jsx)(`span`,{role:`presentation`,className:MW.hidden,children:`x`})]})})}PW.displayName=`Meter`;var FW=G(PW);const IW=Object.assign(FW,{Label:CW,Value:kW,Track:EW,Indicator:bW});function LW(e,t){return(0,K.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}LW.displayName=`NativeSelect.OptGroup`;var RW=G(LW);function zW(e,t){return(0,K.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}zW.displayName=`NativeSelect.Option`;var BW=G(zW);const VW=Object.assign(xx,{Option:BW,OptGroup:RW}),HW={root:`navigation-list-heading`,hidden:`sr-only`};function UW(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,K.jsx)(Er,{as:t,size:`small`,className:W(n?HW.hidden:HW.root,r),"data-component":`NavigationList.Heading`,...i})}UW.displayName=`NavigationList.Heading`;const WW=l.createContext(null),GW=l.createContext({depth:0}),KW=l.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),qW=e=>Number.parseInt(e.slice(1),10),JW=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},YW={heading:UW},XW={container:`NavigationList`};function ZW(e,t){let{children:n,className:r,"aria-label":i,"aria-labelledby":a,...o}=e,[s,c]=Sr(n,YW),u=J(),d=s.heading,f=d?d.props.id??u:void 0,p=d?qW(d.props.as??`h2`):null;return(0,K.jsx)(`nav`,{ref:t,"aria-label":i,"aria-labelledby":a??(i?void 0:f),className:W(r),"data-component":`NavigationList`,...o,children:(0,K.jsxs)(WW.Provider,{value:p,children:[d?l.cloneElement(d,{id:f}):null,(0,K.jsx)(jr.Provider,{value:XW,children:(0,K.jsx)(Mi,{children:c})})]})})}ZW.displayName=`NavigationList`;var QW=l.forwardRef(ZW);function $W(e){let{title:t,children:n,hideDivider:r=!1,...i}=e,a=l.useContext(WW);return(0,K.jsxs)(K.Fragment,{children:[r?null:(0,K.jsx)(Mi.Divider,{}),(0,K.jsxs)(Mi.Group,{"data-component":`NavigationList.Group`,...i,children:[t?(0,K.jsx)(Mi.GroupHeading,{as:JW(a),children:t}):null,n]})]})}$W.displayName=`NavigationList.Group`;const eG={chevron:`navigation-list-chevron`},tG={trailingVisual:Mi.TrailingVisual},nG=e=>{if(!l.isValidElement(e))return!1;let t=e.props[`aria-current`];return t&&t!==`false`?!0:l.Children.toArray(e.props.children).some(nG)};function rG(e){let{children:t,subNavigation:n,defaultOpen:r,className:i}=e,a=J(),o=J(),s=l.useRef(null),c=l.useMemo(()=>nG(n),[n]),[u,d]=l.useState(r??c),[f,p]=l.useState(c);Vi(()=>{let e=c||!!s.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[c,n]);let m=l.useMemo(()=>({buttonId:a,subNavigationId:o,isOpen:u}),[a,o,u]),[h,g]=Sr(t,tG);return(0,K.jsx)(KW.Provider,{value:m,children:(0,K.jsxs)(Mi.Item,{id:a,active:!u&&f,"aria-expanded":u,"aria-controls":o,onSelect:()=>d(e=>!e),className:i,"data-component":`NavigationList.Item`,children:[g,(0,K.jsxs)(Mi.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,K.jsx)(cn,{className:eG.chevron})]}),(0,K.jsx)(Mi.SubItem,{children:l.cloneElement(n,{ref:s})})]})})}rG.displayName=`NavigationList.ItemWithSubNavigation`;const iG={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function aG(e,t){let{className:n,children:r,...i}=e,{buttonId:a,subNavigationId:o,isOpen:s}=l.useContext(KW),{depth:c}=l.useContext(GW),u=l.useMemo(()=>({depth:c+1}),[c]);return!a||!o||c>=4?null:(0,K.jsx)(GW.Provider,{value:u,children:(0,K.jsx)(`ul`,{ref:t,id:o,hidden:!s,"aria-labelledby":a,className:W(iG.root,iG.items,n),"data-component":`NavigationList.SubNavigation`,"data-depth":c+1,...i,children:r})})}aG.displayName=`NavigationList.SubNavigation`;var oG=G(aG);const sG={subNavigation:oG},cG=Mi.LinkItem;function lG(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=Sr(r,sG);return c.subNavigation?(0,K.jsx)(rG,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,K.jsx)(cG,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}lG.displayName=`NavigationList.Item`;var uG=G(lG);const dG=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,K.jsx)(e,{});function fG(e,t){let{label:n=`Show more`,pages:r=0,items:i,renderItem:a,...o}=e,[s,c]=l.useState(0),u=J(),d=i.length/r,f=r===0?i.length:Math.ceil(d*s),p=s===1?0:f-Math.floor(d);return Vi(()=>{s!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[s,u]),(0,K.jsxs)(K.Fragment,{children:[s>0?i.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:o,...s}=e,c=t===p?u:void 0;return a?a({...e,"data-expand-focus-target":c}):(0,K.jsxs)(uG,{"data-expand-focus-target":c,...s,children:[r?(0,K.jsx)(Mi.LeadingVisual,{children:(0,K.jsx)(r,{})}):null,n,i?(0,K.jsx)(Mi.TrailingVisual,{children:dG(i)}):null,o?(0,K.jsx)(Mi.TrailingAction,{...o}):null]},e.id??t)}):null,s<r||s===0?(0,K.jsxs)(Mi.Item,{ref:t,as:`button`,"aria-expanded":!1,onSelect:()=>c(e=>e+1),"data-component":`NavigationList.GroupExpand`,...o,children:[n,(0,K.jsx)(Mi.TrailingVisual,{children:(0,K.jsx)(Ut,{})})]}):null]})}fG.displayName=`NavigationList.GroupExpand`;var pG=l.forwardRef(fG);const mG={root:`navigation-list-group-heading`};function hG(e){let{as:t,className:n,...r}=e,i=l.useContext(WW);return(0,K.jsx)(Mi.GroupHeading,{as:t??JW(i),className:W(mG.root,n),"data-component":`NavigationList.GroupHeading`,...r})}hG.displayName=`NavigationList.GroupHeading`;const gG=br(hG,Ur),_G=Object.assign(QW,{Heading:UW,Item:uG,SubNavigation:oG,Group:$W,GroupHeading:gG,GroupExpand:pG,Description:zr,LeadingVisual:ri,TrailingVisual:xi,TrailingAction:bi,Divider:Vr}),vG={root:`navigation-menu-heading`,hidden:`sr-only`};function yG(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,K.jsx)(Er,{as:t,size:`small`,className:W(n?vG.hidden:vG.root,r),"data-component":`NavigationMenu.Heading`,...i})}yG.displayName=`NavigationMenu.Heading`;const bG=(0,l.createContext)({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),xG=(0,l.createContext)({value:``,triggerId:``,contentId:``,isOpen:!1}),SG=(0,l.createContext)({linkId:``,descriptionId:``}),CG=(0,l.createContext)(null),wG=(0,l.createContext)({depth:0}),TG=e=>Number.parseInt(e.slice(1),10),EG=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},DG={root:`navigation-menu`},OG={heading:yG};function kG(e,t){let{children:n,className:r,value:i,defaultValue:a=null,onValueChange:o,orientation:s=`horizontal`,openOn:c=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=e,g=l.useRef(null),_=B(t,g),[v,y]=Sr(n,OG),b=J(),x=v.heading,S=x?x.props.id??b:void 0,C=x?TG(x.props.as??`h2`):null,w=m??(p?void 0:S),T=i!==void 0,[E,D]=l.useState(a),O=T?i:E,k=l.useRef(o);Vi(()=>{k.current=o},[o]);let A=l.useRef(null),j=l.useRef(null),M=l.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);l.useEffect(()=>M,[M]);let N=l.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=l.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=l.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);Wi(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),l.useEffect(()=>{if(O===null)return;let e=e=>{let{target:t}=e;!(t instanceof Node)||g.current?.contains(t)||N(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[O,N]);let I=e=>{f?.(e),O!==null&&(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget)||N(null))},L=l.useMemo(()=>({openValue:O,setOpenValue:N,orientation:s,openOn:c,openAfterDelay:P,closeAfterDelay:F}),[O,N,s,c,P,F]);return(0,K.jsx)(bG.Provider,{value:L,children:(0,K.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:W(DG.root,r),"data-component":`NavigationMenu`,"data-orientation":s,...h,onBlur:I,children:(0,K.jsxs)(CG.Provider,{value:C,children:[x?l.cloneElement(x,{id:S}):null,y]})})})}kG.displayName=`NavigationMenu`;var AG=l.forwardRef(kG);const jG=U(`navigation-menu-content`,{variants:{open:{true:`motion-safe:data-[orientation=horizontal]:animate-in motion-safe:data-[orientation=horizontal]:fade-in motion-safe:data-[orientation=horizontal]:duration-short motion-safe:data-[orientation=horizontal]:slide-in-from-top-1`,false:``},align:{start:`navigation-menu-content-align-start`,center:`navigation-menu-content-align-center`,end:`navigation-menu-content-align-end`}}});function MG(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e,{orientation:o}=l.useContext(bG),{triggerId:s,contentId:c,isOpen:u}=l.useContext(xG);if(!c)return null;let d=o===`vertical`?void 0:i;return(0,K.jsx)(n,{ref:t,id:c,hidden:!u,"aria-labelledby":s,className:W(jG({open:u,align:d}),r),"data-component":`NavigationMenu.Content`,"data-orientation":o,"data-align":d,"data-open":u?``:void 0,...a})}MG.displayName=`NavigationMenu.Content`;var NG=G(MG);const PG={root:`navigation-menu-description`};function FG(e){let{className:t,...n}=e,{descriptionId:r}=l.useContext(SG);return(0,K.jsx)(`span`,{id:r,className:W(PG.root,t),"data-component":`NavigationMenu.Description`,...n})}FG.displayName=`NavigationMenu.Description`;const IG={root:`navigation-menu-divider`};function LG(e){let{className:t,...n}=e;return(0,K.jsx)(`div`,{"aria-hidden":`true`,className:W(IG.root,t),"data-component":`NavigationMenu.Divider`,...n})}LG.displayName=`NavigationMenu.Divider`;const RG={root:`navigation-menu-group-heading`};function zG(e){let{as:t,className:n,...r}=e,i=l.useContext(CG),a=t??EG(i);return(0,K.jsx)(a,{className:W(RG.root,n),"data-component":`NavigationMenu.GroupHeading`,...r})}zG.displayName=`NavigationMenu.GroupHeading`;const BG={root:`navigation-menu-group`},VG={groupHeading:zG};function HG(e){let{title:t,children:n,className:r,hideDivider:i=!1,...a}=e,o=J(),[s,c]=Sr(n,VG),u=s.groupHeading??(t?(0,K.jsx)(zG,{children:t}):null),d=u?u.props.id??o:void 0;return(0,K.jsxs)(K.Fragment,{children:[i?null:(0,K.jsx)(LG,{}),(0,K.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:W(BG.root,r),"data-component":`NavigationMenu.Group`,...a,children:[u?l.cloneElement(u,{id:d}):null,c]})]})}HG.displayName=`NavigationMenu.Group`;const UG={root:`navigation-menu-item`};function WG(e,t){let{children:n,className:r,value:i,onPointerEnter:a,onPointerLeave:o,...s}=e,c=J(),u=i??c,d=J(),f=J(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=l.useContext(bG),_=p===u,v=e=>{a?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=l.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,K.jsx)(xG.Provider,{value:b,children:(0,K.jsx)(`li`,{ref:t,className:W(UG.root,r),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...s,onPointerEnter:v,onPointerLeave:y,children:n})})}WG.displayName=`NavigationMenu.Item`;var GG=l.forwardRef(WG);const KG={root:`navigation-menu-visual`},qG=({className:e,...t})=>(0,K.jsx)(`span`,{className:W(KG.root,e),...t});function JG(e){return(0,K.jsx)(qG,{"data-component":`NavigationMenu.LeadingVisual`,...e})}JG.displayName=`NavigationMenu.LeadingVisual`;const YG={root:`navigation-menu-sub-navigation`};function XG(e,t){let{className:n,children:r,...i}=e,{linkId:a}=l.useContext(SG),{depth:o}=l.useContext(wG),s=l.useMemo(()=>({depth:o+1}),[o]);return!a||o>=4?null:(0,K.jsx)(wG.Provider,{value:s,children:(0,K.jsx)(`ul`,{ref:t,"aria-labelledby":a,className:W(YG.root,n),"data-component":`NavigationMenu.SubNavigation`,"data-depth":o+1,...i,children:r})})}XG.displayName=`NavigationMenu.SubNavigation`;var ZG=G(XG);const QG={root:`navigation-menu-visual-trailing`};function $G(e){let{className:t,...n}=e;return(0,K.jsx)(qG,{className:W(QG.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}$G.displayName=`NavigationMenu.TrailingVisual`;const eK={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},tK={leadingVisual:JG,trailingVisual:$G,description:FG,subNavigation:ZG};function nK(e,t){let{as:n=`a`,id:r,className:i,active:a,children:o,onClick:s,...c}=e,{setOpenValue:u}=l.useContext(bG),{depth:d}=l.useContext(wG),f=J(r),p=J(),[m,h]=Sr(o,tK),g=l.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{s?.(e),!e.defaultPrevented&&u(null)},v=(0,K.jsxs)(n,{ref:t,id:f,"aria-current":a?`page`:void 0,"aria-describedby":m.description?p:void 0,className:W(eK.root,a&&eK.active,i),"data-component":`NavigationMenu.Link`,"data-active":a?``:void 0,"data-has-description":m.description?``:void 0,...c,onClick:_,children:[m.leadingVisual,(0,K.jsxs)(`span`,{className:eK.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,K.jsxs)(SG.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,K.jsx)(`li`,{className:eK.item,children:y})}nK.displayName=`NavigationMenu.Link`;var rK=G(nK);const iK={root:`navigation-menu-list`},aK=(e,t)=>Array.from(e.querySelectorAll(`[data-component='NavigationMenu.Trigger'], [data-component='NavigationMenu.Link']`)).filter(e=>{let n=e.closest(`[data-component='NavigationMenu.Content']`);return n&&(t===`horizontal`||n.hasAttribute(`hidden`))?!1:!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`});function oK(e,t){let{children:n,className:r,onKeyDown:i,...a}=e,{orientation:o,openValue:s,setOpenValue:c}=l.useContext(bG),u=l.useRef(null),d=B(t,u),f=e=>{i?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=o===`vertical`,r=n?`ArrowDown`:`ArrowRight`,a=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(s===null||!(n instanceof HTMLElement)||!t.contains(n))return;e.preventDefault(),e.stopPropagation(),n.closest(`[data-component='NavigationMenu.Content']`)?.closest(`li`)?.querySelector(`[data-component='NavigationMenu.Trigger']`)?.focus(),c(null);return}let l=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===a?-1:0;if(d===0&&!l)return;let f=aK(t,o),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&s!==null&&c(null),l){f[e.key===`Home`?0:f.length-1].focus();return}f[(p+d+f.length)%f.length].focus()}};return(0,K.jsx)(`ul`,{ref:d,className:W(iK.root,r),"data-component":`NavigationMenu.List`,"data-orientation":o,...a,onKeyDown:f,children:n})}oK.displayName=`NavigationMenu.List`;var sK=l.forwardRef(oK);const cK={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function lK(e,t){let{children:n,className:r,onClick:i,onKeyDown:a,...o}=e,{setOpenValue:s,orientation:c}=l.useContext(bG),{value:u,triggerId:d,contentId:f,isOpen:p}=l.useContext(xG),m=l.useRef(!1);if(Vi(()=>{!p||!m.current||(m.current=!1,hr(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{i?.(e),!e.defaultPrevented&&s(p?null:u)},g=e=>{if(a?.(e),e.defaultPrevented)return;let t=c===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,s(u);return}hr(document.getElementById(f))[0]?.focus()}};return(0,K.jsxs)(`button`,{ref:t,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:W(cK.root,r),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...o,onClick:h,onKeyDown:g,children:[n,(0,K.jsx)(cn,{className:cK.chevron})]})}lK.displayName=`NavigationMenu.Trigger`;var uK=l.forwardRef(lK);const dK=Object.assign(AG,{Heading:yG,List:sK,Item:GG,Trigger:uK,Content:NG,Link:rK,SubNavigation:ZG,Group:HG,GroupHeading:zG,Description:FG,LeadingVisual:JG,TrailingVisual:$G,Divider:LG}),fK={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},pK=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,K.jsxs)(`span`,{className:fK.stepper,"data-component":`NumberInput.Stepper`,children:[(0,K.jsx)(_i,{type:`button`,variant:`invisible`,size:`small`,icon:dn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:fK.step,"data-component":`NumberInput.Increment`}),(0,K.jsx)(_i,{type:`button`,variant:`invisible`,size:`small`,icon:cn,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:fK.step,"data-component":`NumberInput.Decrement`})]});function mK(e,t){let{className:n,value:r,defaultValue:i,min:a,max:o,step:s=1,disabled:c,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=e,g=l.useRef(null),_=B(t,g),v=r!==void 0,[y,b]=l.useState(i??null),x=v?r:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(gW(e.target),e)},w=e=>{let t=hW(x,e,{step:s,min:a,max:o});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&o!==void 0&&x>=o,E=x!=null&&a!==void 0&&x<=a,D=!!c||!!u;return(0,K.jsx)(Yo,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:i,min:a,max:o,step:s,disabled:c,readOnly:u,onChange:C,className:W(fK.root,n),trailingAction:d?void 0:(0,K.jsx)(pK,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}mK.displayName=`NumberInput`;var hK=G(mK);const gK={current:null},_K=(0,l.createContext)({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:gK,contentWrapperRef:gK,sidebarRef:gK,sidebarContentWrapperRef:gK}),vK={root:`page-layout-horizontal-divider`};function yK(e,t){let{className:n,style:r,variant:i=`none`,position:a,...o}=e,{padding:s}=l.useContext(_K);return(0,K.jsx)(`div`,{ref:t,className:W(vK.root,n),style:{"--spacing-divider":`var(--page-layout-spacing-${s})`,...r},"data-component":`PageLayout.HorizontalDivider`,...Gi(`variant`,i),...Gi(`position`,a),...o})}yK.displayName=`PageLayout.HorizontalDivider`;var bK=G(yK);const xK={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function SK(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(_K);return(0,K.jsxs)(`footer`,{ref:t,className:W(xK.root,xK.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Footer`,...Gi(`hidden`,s),...c,children:[(0,K.jsx)(bK,{variant:o,className:xK.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,K.jsx)(`div`,{className:xK.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i})]})}SK.displayName=`PageLayout.Footer`;var CK=G(SK);const wK={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function TK(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(_K);return(0,K.jsxs)(`header`,{ref:t,className:W(wK.root,wK.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Header`,...Gi(`hidden`,s),...c,children:[(0,K.jsx)(`div`,{className:wK.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i}),(0,K.jsx)(bK,{variant:o,className:wK.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}TK.displayName=`PageLayout.Header`;var EK=G(TK);const DK=1280,OK={small:256,medium:296,large:320},kK=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,AK=e=>e===`small`||e===`medium`||e===`large`,jK=e=>AK(e)?OK[e]:kK(e)?parseInt(e.default,10):0,MK=()=>I&&window.innerWidth>=1280?959:511,NK=e=>`Pane width ${e} pixels`,PK=(e,t,n=NK)=>{e&&(t.min!==void 0&&e.setAttribute(`aria-valuemin`,String(t.min)),t.max!==void 0&&e.setAttribute(`aria-valuemax`,String(t.max)),t.current!==void 0&&(e.setAttribute(`aria-valuenow`,String(t.current)),e.setAttribute(`aria-valuetext`,n(t.current))))},FK=({handle:e,pane:t,contentWrapper:n})=>{e?.style.setProperty(`--drag-handle-background-color`,`var(--background-color-accent-emphasis)`),e?.style.setProperty(`--drag-handle-opacity`,`1`),e?.style.setProperty(`--drag-handle-transition`,`none`),t?.setAttribute(`data-dragging`,`true`),n?.setAttribute(`data-dragging`,`true`)},IK=({handle:e,pane:t,contentWrapper:n})=>{e?.style.removeProperty(`--drag-handle-background-color`),e?.style.removeProperty(`--drag-handle-opacity`),e?.style.removeProperty(`--drag-handle-transition`),t?.removeAttribute(`data-dragging`),n?.removeAttribute(`data-dragging`)},LK={save:(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},get:e=>{try{let t=localStorage.getItem(e);if(t!==null){let e=Number(t);if(!Number.isNaN(e)&&e>0)return Math.round(e)}}catch{}return null}},RK={root:`page-layout-drag-handle`},zK=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,BK=e=>e===`ArrowLeft`||e===`ArrowDown`;function VK(e){let{className:t,handleRef:n,onDragStart:r,onDrag:i,onDragEnd:a,onDoubleClick:o,"aria-label":s,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=NK}=e,g=l.useRef({onDragStart:r,onDrag:i,onDragEnd:a});l.useEffect(()=>{g.current={onDragStart:r,onDrag:i,onDragEnd:a}});let _=l.useRef(!1),v=l.useRef(null),y=l.useRef(null),b=l.useCallback(()=>{_.current||=(FK({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[n,p,m]),x=l.useCallback(()=>{_.current&&=(IK({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[n,p,m]);return l.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,K.jsx)(`div`,{ref:n,role:`slider`,tabIndex:0,"aria-label":c?void 0:s??`Draggable pane splitter`,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:W(RK.root,t),onPointerDown:e=>{if(e.button===0){e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}g.current.onDragStart(e.clientX),b()}},onPointerMove:e=>{_.current&&(e.preventDefault(),y.current=e.clientX,v.current===null&&(v.current=requestAnimationFrame(()=>{v.current=null,y.current!==null&&(g.current.onDrag(y.current,!1),y.current=null)})))},onPointerUp:e=>{_.current&&e.preventDefault()},onLostPointerCapture:()=>{_.current&&(v.current!==null&&(cancelAnimationFrame(v.current),v.current=null,y.current=null),x(),g.current.onDragEnd())},onKeyDown:e=>{zK(e.key)&&(e.preventDefault(),b(),g.current.onDrag(BK(e.key)?-3:3,!0))},onKeyUp:e=>{zK(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:o,"data-component":`PageLayout.DragHandle`})}VK.displayName=`PageLayout.DragHandle`;const HK={root:`page-layout-vertical-divider`};function UK(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,K.jsx)(`div`,{ref:t,className:W(HK.root,n),"data-component":`PageLayout.VerticalDivider`,...Gi(`variant`,r),...Gi(`position`,i),...a})}UK.displayName=`PageLayout.VerticalDivider`;var WK=G(UK);const GK=({width:e,minWidth:t,resizable:n,widthStorageKey:r,paneRef:i,handleRef:a,contentWrapperRef:o,constrainToViewport:s=!1,onResizeEnd:c,currentWidth:u,formatValueText:d})=>{let f=kK(e),p=f?parseInt(e.min,10):t,m=f?parseInt(e.max,10):null,h=l.useMemo(()=>jK(e),[e]),g=l.useRef(r),_=l.useRef(c),v=l.useRef(d);Vi(()=>{g.current=r,_.current=c,v.current=d});let y=l.useRef(s?256:511),b=l.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:s?Math.min(m,t):m},[m,p,s]),[x,S]=l.useState(()=>typeof u==`number`?u:c===void 0&&n===!0&&r!==void 0?LK.get(r)??h:h),[C,w]=l.useState(h),[T,E]=l.useState(u),D=u!==T;D&&(E(u),typeof u==`number`?S(u):T!==void 0&&S(h)),h!==C&&(w(h),u===void 0&&!D&&S(h));let O=u??x,k=l.useRef(O),[A,j]=l.useState(()=>m??600),M=l.useRef(A);Vi(()=>{k.current=O},[O]);let N=l.useCallback(()=>jK(e),[e]),P=l.useCallback(e=>{let t=Math.round(e);if(k.current=t,l.startTransition(()=>{S(t)}),_.current){try{_.current(t)}catch{}return}n&&g.current&&LK.save(g.current,t)},[n]),F=l.useRef(b);return Vi(()=>{F.current=b}),Vi(()=>{if(!n)return;let e=window.innerWidth,t=()=>{let t=window.innerWidth,n=e<DK!=t<DK;e=t,n&&(y.current=MK());let r=F.current();i.current?.style.setProperty(`--pane-max-width`,`${r}px`);let o=k.current>r;o&&(k.current=r,i.current?.style.setProperty(`--pane-width`,`${r}px`)),PK(a.current,{max:r,current:k.current},v.current),(r!==M.current||o)&&(M.current=r,l.startTransition(()=>{j(r),o&&S(r)}))};y.current=MK();let r=F.current();if(M.current=r,i.current?.style.setProperty(`--pane-max-width`,`${r}px`),PK(a.current,{min:p,max:r,current:k.current},v.current),l.startTransition(()=>{j(r)}),m!==null&&!s)return;let c=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,i.current?.setAttribute(`data-dragging`,`true`),o?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,i.current?.removeAttribute(`data-dragging`),o?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-c>=16?(c=e,t()):u===null&&(u=requestAnimationFrame(()=>{u=null,c=performance.now(),t()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[n,m,s,p,i,a,o]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},KK={wrapper:`page-layout-sidebar-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-sidebar-position`,sticky:`page-layout-sidebar-sticky`,fullscreen:`page-layout-sidebar-fullscreen`,sidebar:`page-layout-sidebar`,sidebarResizable:`page-layout-sidebar-resizable`,dragging:`page-layout-dragging`,sidebarFullscreen:`page-layout-sidebar-fullscreen-inner`,divider:`page-layout-sidebar-divider`};function qK(e,t){let{className:n,style:r,children:i,id:a,position:o=`start`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,responsiveVariant:_=`default`,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=l.useContext(_K),T=l.useRef(null),E=l.useRef(0),D=l.useRef(0),O=l.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=GK({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=B(t,C),L=cp(C),ee=J(a),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},z=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},te=(0,K.jsx)(WK,{variant:h?`line`:m,position:o,className:KK.divider,style:{"--spacing-column":`var(--page-layout-spacing-${S})`},children:h?(0,K.jsx)(VK,{handleRef:T,dragTargetRef:C,contentWrapperRef:w,"aria-valuemin":j,"aria-valuemax":M,"aria-valuenow":k,onDragStart:e=>{E.current=e,D.current=C.current?.getBoundingClientRect().width??A.current,O.current=N()},onDrag:(e,t)=>{let n=t?N():O.current;if(t){let t=o===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(z(r),PK(T.current,{current:r,max:n}));return}if(!C.current)return;let r=e-E.current,i=Math.max(j,Math.min(n,D.current+(o===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(z(i),PK(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();z(e),PK(T.current,{current:e}),F(e)}}):null});return(0,K.jsxs)(`div`,{className:W(KK.wrapper,KK.hidden,KK.position,KK.sticky,KK.fullscreen,n),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...r},"data-position":o,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...Gi(`is-hidden`,v),children:[o===`end`?te:null,(0,K.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:W(KK.sidebar,KK.sidebarResizable,KK.sidebarFullscreen,KK.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":kK(s)?s.min:`${c}px`,"--pane-max-width":kK(s)?s.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":kK(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${AK(s)?s:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...a?{id:ee}:{},...x,children:i}),o===`start`?te:null]})}qK.displayName=`PageLayout.Sidebar`;var JK=G(qK);const YK={content:`page-layout-content-row`},XK=U(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),ZK=U(`page-layout-wrapper`,{variants:{width:{full:`page-layout-width-full`,medium:`page-layout-width-medium`,large:`page-layout-width-large`,xlarge:`page-layout-width-xlarge`}}});function QK(e,t){let{className:n,style:r,children:i,containerWidth:a=`xlarge`,padding:o=`normal`,rowGap:s=`normal`,columnGap:c=`normal`,...u}=e,d=l.useRef(null),f=l.useRef(null),p=l.useRef(null),m=l.useRef(null),[h,g]=Sr(i,{header:EK,footer:CK,sidebar:JK}),_=l.useMemo(()=>({padding:o,rowGap:s,columnGap:c,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[o,s,c]);return(0,K.jsx)(_K.Provider,{value:_,children:(0,K.jsxs)(`div`,{ref:t,className:W(XK({hasSidebar:!!h.sidebar}),n),style:{"--spacing":`var(--page-layout-spacing-${o})`,...r},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,K.jsxs)(`div`,{ref:m,className:W(ZK({width:a})),"data-page-layout-wrapper":``,"data-width":a,children:[h.header,(0,K.jsx)(`div`,{className:YK.content,children:g}),h.footer]})]})})}QK.displayName=`PageLayout`;var $K=G(QK);const eq={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},tq=U(`page-layout-content`,{variants:{width:{full:`page-layout-content-width-full`,medium:`page-layout-content-width-medium`,large:`page-layout-content-width-large`,xlarge:`page-layout-content-width-xlarge`}}});function nq(e,t){let{as:n=`main`,className:r,children:i,width:a=`full`,padding:o=`none`,hidden:s=!1,...c}=e,{contentWrapperRef:u}=l.useContext(_K),d=B(t,u);return(0,K.jsx)(n,{ref:d,className:W(eq.wrapper,eq.hidden,eq.dragging,r),"data-component":`PageLayout.Content`,...Gi(`is-hidden`,s),...c,children:(0,K.jsx)(`div`,{className:W(tq({width:a})),"data-width":a,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:i})})}nq.displayName=`PageLayout.Content`;var rq=G(nq);const iq={wrapper:`page-layout-pane-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-pane-position`,sticky:`page-layout-pane-sticky`,pane:`page-layout-pane`,paneResizable:`page-layout-pane-resizable`,dragging:`page-layout-dragging`,horizontalDivider:`page-layout-pane-horizontal-divider`,verticalDivider:`page-layout-pane-vertical-divider`};function aq(e,t){let{className:n,style:r,children:i,id:a,position:o=`end`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f=`paneWidth`,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,offsetHeader:_=0,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,S=ds(o)?`end`:o,C=ds(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=l.useContext(_K),O=l.useRef(null),k=l.useRef(0),A=l.useRef(0),j=l.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=GK({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=B(t,E),z=cp(E),te=J(a),ne=z?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},re=e=>{E.current?.style.setProperty(`--pane-width`,`${e}px`),N.current=e};return(0,K.jsxs)(`div`,{className:W(iq.wrapper,iq.hidden,iq.position,iq.sticky,n),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...r},"data-sticky":g||void 0,...Gi(`is-hidden`,v),...Gi(`position`,o),children:[(0,K.jsx)(bK,{variant:ds(m)?m:{narrow:C,regular:`none`},position:o,className:iq.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,K.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:W(iq.pane,iq.paneResizable,iq.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":kK(s)?s.min:`${c}px`,"--pane-max-width":kK(s)?s.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":kK(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${AK(s)?s:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...a?{id:te}:{},...x,children:i}),(0,K.jsx)(WK,{variant:ds(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:o,className:iq.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,K.jsx)(VK,{handleRef:O,dragTargetRef:E,contentWrapperRef:D,"aria-valuemin":P,"aria-valuemax":F,"aria-valuenow":M,onDragStart:e=>{k.current=e,A.current=E.current?.getBoundingClientRect().width??N.current,j.current=I()},onDrag:(e,t)=>{let n=t?I():j.current;if(t){let t=Math.max(P,Math.min(n,N.current+e));t!==N.current&&(re(t),PK(O.current,{current:t,max:n}));return}if(!E.current)return;let r=e-k.current,i=Math.max(P,Math.min(n,A.current+(S===`end`?-r:r)));Math.round(i)!==Math.round(N.current)&&(re(i),PK(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();re(e),PK(O.current,{current:e}),ee(e)}}):null})]})}aq.displayName=`PageLayout.Pane`;var oq=G(aq);const sq=Object.assign($K,{Header:EK,Content:rq,Pane:oq,Sidebar:JK,Footer:CK}),cq=[`narrow`,`regular`,`wide`],lq={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},uq=U(`pagination-step`,{variants:{step:{previous:`pagination-step-previous`,next:`pagination-step-next`},current:{true:`pagination-step-current`,false:``},inert:{true:`pagination-step-inert`,false:``}}}),dq=e=>typeof e==`object`?cq.filter(t=>e[t]===!1):e?[]:[...cq],fq=({page:e,children:t})=>(0,K.jsxs)(K.Fragment,{children:[e.type===`previous`?(0,K.jsx)(ln,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,K.jsx)(un,{"data-component":`Pagination.NextPageIcon`}):null]}),pq=e=>`#${e}`;function mq(e,t){let{as:n=`nav`,className:r,pageCount:i,currentPage:a,onPageChange:o,hrefBuilder:s=pq,marginPageCount:c=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=e,m=l.useMemo(()=>Lg(i,a,!!d,c,u),[i,a,d,c,u]),h=dq(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=Rg(e,s,t=>o?.(t,e.num)),a=e.type===`previous`||e.type===`next`,c=!!r||!!i[`aria-hidden`],l=W(uq({step:a?e.type:void 0,current:e.selected,inert:c}));if(f&&!r)return f({key:t,children:(0,K.jsx)(fq,{page:e,children:n}),number:e.num,className:l,"data-component":`Pagination.Page`,...i});let u=r?`span`:`a`,d=a?e.type===`previous`?`Pagination.PreviousPage`:`Pagination.NextPage`:`Pagination.Page`;return(0,K.jsx)(u,{role:r?`presentation`:void 0,className:l,"data-component":d,...i,children:(0,K.jsx)(fq,{page:e,children:n})},t)});return(0,K.jsx)(n,{ref:t,"aria-label":`Pagination`,className:W(lq.root,r),"data-component":`Pagination`,...p,children:(0,K.jsx)(`div`,{className:W(lq.steps,h.map(e=>lq.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}mq.displayName=`Pagination`;var hq=G(mq);const gq={root:`password-input`,toggle:`password-input-toggle`};function _q(e,t){let{className:n,visible:r,defaultVisible:i=!1,onVisibilityChange:a,hideToggle:o=!1,showLabel:s=`Show password`,hideLabel:c=`Hide password`,disabled:u,...d}=e,f=r!==void 0,[p,m]=l.useState(i),h=f?r:p;return(0,K.jsx)(Yo,{ref:t,type:h?`text`:`password`,disabled:u,className:W(gq.root,n),trailingAction:o?void 0:(0,K.jsx)(Yo.Action,{icon:h?Sn:Cn,"aria-label":h?c:s,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),a?.(t)},className:gq.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}_q.displayName=`PasswordInput`;var vq=G(_q);const yq={root:`pin-input`},bq=U(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),xq={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},Sq=(e,t)=>Array.from(e).filter(e=>xq[t].test(e)).join(``);function Cq(e,t){let{className:n,length:r=6,value:i,defaultValue:a=``,type:o=`numeric`,mask:s=!1,size:c=`medium`,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m,autoComplete:h,boxLabel:g=`Digit`,onChange:_,onComplete:v,"aria-label":y,"aria-labelledby":b,...x}=e,S=l.useRef([]),C=i!==void 0,[w,T]=l.useState(()=>Sq(a,o).slice(0,r)),E=C?i:w,D=Array.from({length:r},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=l.useRef(!1),A=e=>{let t=S.current[e];k.current=!0,t?.focus(),t?.select(),k.current=!1},j=e=>{C||T(e),_?.(e),e.length===r&&v?.(e)},M=(e,t)=>{let n=Sq(t,o);if(n.length===0)return;let i=O===-1?e:Math.min(e,O),a=[...D],s=i;Array.from(n).forEach(e=>{s<r&&(a[s]=e,s+=1)}),j(a.join(``)),A(Math.min(s,r-1))},N=e=>{let t=[...D];t[e]=``,j(t.join(``))},P=e=>{if(k.current)return;let t=O===-1?e:Math.min(e,O);t!==e&&A(t)},F=(e,t)=>{if(t.target.value===``){N(e);return}M(e,t.target.value)},I=(e,t)=>{u||d||(t.preventDefault(),M(e,t.clipboardData.getData(`text`)))},L=(e,t)=>{if(!(u||d)){if(t.key===`Backspace`){if(t.preventDefault(),D[e]!==``){N(e);return}e>0&&(N(e-1),A(e-1));return}if(t.key===`Delete`){t.preventDefault(),N(e);return}if(t.key===`ArrowLeft`&&e>0){t.preventDefault(),A(e-1);return}if(t.key===`ArrowRight`&&e<r-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(r-1))}};return(0,K.jsx)(`div`,{ref:t,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:W(yq.root,n),"data-component":`PINInput`,"data-size":c,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,K.jsx)(Yo,{ref:e=>{S.current[t]=e},type:s?`password`:`text`,inputMode:o===`numeric`?`numeric`:`text`,size:c,value:e,maxLength:1,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m&&t===0,autoComplete:t===0?h:`off`,"aria-label":`${g} ${t+1} of ${r}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:W(bq({size:c})),"data-component":`PINInput.Box`},t))})}Cq.displayName=`PINInput`;var wq=G(Cq);const Tq={root:`placeholder`};function Eq(e,t){let{as:n=`div`,className:r,width:i,height:a,label:o,style:s,children:c,...l}=e;return(0,K.jsx)(n,{ref:t,className:W(Tq.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}Eq.displayName=`Placeholder`;var Dq=G(Eq);const Oq=(0,l.createContext)({}),kq=U(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function Aq(e,t){let{as:n=`div`,className:r,caret:i=`top`,open:a=!1,relative:o=!1,...s}=e,c={open:a,caret:i};return(0,K.jsx)(Oq.Provider,{value:c,children:(0,K.jsx)(n,{ref:t,className:W(kq({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}Aq.displayName=`Popover`;var jq=G(Aq);const Mq=U(`popover-content`,{variants:{caret:{top:`popover-content-caret-top`,bottom:`popover-content-caret-bottom`,left:`popover-content-caret-left`,right:`popover-content-caret-right`,"top-left":`popover-content-caret-top-left`,"top-right":`popover-content-caret-top-right`,"bottom-left":`popover-content-caret-bottom-left`,"bottom-right":`popover-content-caret-bottom-right`,"left-top":`popover-content-caret-left-top`,"left-bottom":`popover-content-caret-left-bottom`,"right-top":`popover-content-caret-right-top`,"right-bottom":`popover-content-caret-right-bottom`},width:{xsmall:`popover-content-width-xsmall`,small:`popover-content-width-small`,medium:`popover-content-width-medium`,large:`popover-content-width-large`,xlarge:`popover-content-width-xlarge`,auto:`popover-content-width-auto`},height:{small:`popover-content-height-small`,medium:`popover-content-height-medium`,large:`popover-content-height-large`,xlarge:`popover-content-height-xlarge`,auto:`popover-content-height-auto`,"fit-content":`popover-content-height-fit-content`},overflow:{auto:`popover-content-overflow-auto`,hidden:`popover-content-overflow-hidden`,scroll:`popover-content-overflow-scroll`,visible:`popover-content-overflow-visible`}}}),Nq=[];function Pq(e,t){let{as:n=`div`,className:r,width:i=`small`,height:a=`fit-content`,overflow:o=`visible`,onClickOutside:s,onEscape:c,ignoreClickRefs:u=Nq,...d}=e,{open:f=!1,caret:p=`top`}=l.useContext(Oq),m=l.useRef(null),h=B(t,m);return l.useEffect(()=>{if(!f||!s)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(m.current?.contains(t)||u.some(({current:e})=>e?.contains(t))||s(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,s,u]),Wi(e=>{!f||!c||(c(e),e.preventDefault())}),(0,K.jsx)(n,{ref:h,className:W(Mq({caret:p,width:i,height:a,overflow:o}),r),"data-component":`Popover.Content`,"data-caret":p,"data-width":i,"data-height":a,"data-overflow":o,...d})}Pq.displayName=`Popover.Content`;var Fq=G(Pq);const Iq=Object.assign(jq,{Content:Fq}),Lq={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},Rq=U(`progress-circle`,{variants:{size:{small:`progress-circle-small`,medium:`progress-circle-medium`,large:`progress-circle-large`},variant:{accent:`progress-circle-accent`,attention:`progress-circle-attention`,danger:`progress-circle-danger`,done:`progress-circle-done`,neutral:`progress-circle-neutral`,severe:`progress-circle-severe`,sponsors:`progress-circle-sponsors`,success:`progress-circle-success`}}});function zq(e,t){let{as:n=`span`,className:r,progress:i=0,size:a=`medium`,variant:o=`success`,style:s,children:c,"aria-valuenow":u,...d}=e,f=Math.min(Math.max(i,0),100),p=l.Children.toArray(c).length>0;return(0,K.jsxs)(n,{ref:t,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:W(Rq({size:a,variant:o}),r),style:{...s,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":a,"data-variant":o,...d,children:[(0,K.jsxs)(`svg`,{className:Lq.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,K.jsx)(`circle`,{className:Lq.track,cx:16,cy:16,r:14,pathLength:100}),(0,K.jsx)(`circle`,{className:Lq.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,K.jsx)(`span`,{className:Lq.label,children:c}):null]})}zq.displayName=`ProgressCircle`;var Bq=G(zq);const Vq={L:1,M:0,Q:3,H:2},Hq={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},Uq={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function Wq(e,t){let n=Uq[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const Gq={L:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:19,ecCodewordsPerBlock:7,group1Blocks:1,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:34,group2Blocks:0,group2DataCW:0},{totalDataCodewords:55,ecCodewordsPerBlock:15,group1Blocks:1,group1DataCW:55,group2Blocks:0,group2DataCW:0},{totalDataCodewords:80,ecCodewordsPerBlock:20,group1Blocks:1,group1DataCW:80,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:108,group2Blocks:0,group2DataCW:0},{totalDataCodewords:136,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:0,group2DataCW:0},{totalDataCodewords:156,ecCodewordsPerBlock:20,group1Blocks:2,group1DataCW:78,group2Blocks:0,group2DataCW:0},{totalDataCodewords:194,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:97,group2Blocks:0,group2DataCW:0},{totalDataCodewords:232,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:116,group2Blocks:0,group2DataCW:0},{totalDataCodewords:274,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:2,group2DataCW:69},{totalDataCodewords:324,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:81,group2Blocks:0,group2DataCW:0},{totalDataCodewords:370,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:92,group2Blocks:2,group2DataCW:93},{totalDataCodewords:428,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:107,group2Blocks:0,group2DataCW:0},{totalDataCodewords:461,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:523,ecCodewordsPerBlock:22,group1Blocks:5,group1DataCW:87,group2Blocks:1,group2DataCW:88},{totalDataCodewords:589,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:98,group2Blocks:1,group2DataCW:99},{totalDataCodewords:647,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:721,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:120,group2Blocks:1,group2DataCW:121},{totalDataCodewords:795,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:113,group2Blocks:4,group2DataCW:114},{totalDataCodewords:861,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:932,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:116,group2Blocks:4,group2DataCW:117},{totalDataCodewords:1006,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:111,group2Blocks:7,group2DataCW:112},{totalDataCodewords:1094,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:121,group2Blocks:5,group2DataCW:122},{totalDataCodewords:1174,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:1276,ecCodewordsPerBlock:26,group1Blocks:8,group1DataCW:106,group2Blocks:4,group2DataCW:107},{totalDataCodewords:1370,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:114,group2Blocks:2,group2DataCW:115},{totalDataCodewords:1468,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:1531,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:117,group2Blocks:10,group2DataCW:118},{totalDataCodewords:1631,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:116,group2Blocks:7,group2DataCW:117},{totalDataCodewords:1735,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:115,group2Blocks:10,group2DataCW:116},{totalDataCodewords:1843,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:3,group2DataCW:116},{totalDataCodewords:1955,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:0,group2DataCW:0},{totalDataCodewords:2071,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:2191,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:6,group2DataCW:116},{totalDataCodewords:2306,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:121,group2Blocks:7,group2DataCW:122},{totalDataCodewords:2434,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:121,group2Blocks:14,group2DataCW:122},{totalDataCodewords:2566,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:2702,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:122,group2Blocks:18,group2DataCW:123},{totalDataCodewords:2812,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:2956,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:118,group2Blocks:6,group2DataCW:119}],M:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:28,ecCodewordsPerBlock:16,group1Blocks:1,group1DataCW:28,group2Blocks:0,group2DataCW:0},{totalDataCodewords:44,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:44,group2Blocks:0,group2DataCW:0},{totalDataCodewords:64,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:32,group2Blocks:0,group2DataCW:0},{totalDataCodewords:86,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:43,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:27,group2Blocks:0,group2DataCW:0},{totalDataCodewords:124,ecCodewordsPerBlock:18,group1Blocks:4,group1DataCW:31,group2Blocks:0,group2DataCW:0},{totalDataCodewords:154,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:38,group2Blocks:2,group2DataCW:39},{totalDataCodewords:182,ecCodewordsPerBlock:22,group1Blocks:3,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:216,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:43,group2Blocks:1,group2DataCW:44},{totalDataCodewords:254,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:50,group2Blocks:4,group2DataCW:51},{totalDataCodewords:290,ecCodewordsPerBlock:22,group1Blocks:6,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:334,ecCodewordsPerBlock:22,group1Blocks:8,group1DataCW:37,group2Blocks:1,group2DataCW:38},{totalDataCodewords:365,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:40,group2Blocks:5,group2DataCW:41},{totalDataCodewords:415,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:41,group2Blocks:5,group2DataCW:42},{totalDataCodewords:453,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:507,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:1,group2DataCW:47},{totalDataCodewords:563,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:43,group2Blocks:4,group2DataCW:44},{totalDataCodewords:627,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:44,group2Blocks:11,group2DataCW:45},{totalDataCodewords:669,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:41,group2Blocks:13,group2DataCW:42},{totalDataCodewords:714,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:42,group2Blocks:0,group2DataCW:0},{totalDataCodewords:782,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:46,group2Blocks:0,group2DataCW:0},{totalDataCodewords:860,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:47,group2Blocks:14,group2DataCW:48},{totalDataCodewords:914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:45,group2Blocks:14,group2DataCW:46},{totalDataCodewords:1e3,ecCodewordsPerBlock:28,group1Blocks:8,group1DataCW:47,group2Blocks:13,group2DataCW:48},{totalDataCodewords:1062,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:46,group2Blocks:4,group2DataCW:47},{totalDataCodewords:1128,ecCodewordsPerBlock:28,group1Blocks:22,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:1193,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:45,group2Blocks:23,group2DataCW:46},{totalDataCodewords:1267,ecCodewordsPerBlock:28,group1Blocks:21,group1DataCW:45,group2Blocks:7,group2DataCW:46},{totalDataCodewords:1373,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:47,group2Blocks:10,group2DataCW:48},{totalDataCodewords:1455,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:46,group2Blocks:29,group2DataCW:47},{totalDataCodewords:1541,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1631,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:21,group2DataCW:47},{totalDataCodewords:1725,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1812,ecCodewordsPerBlock:28,group1Blocks:12,group1DataCW:47,group2Blocks:26,group2DataCW:48},{totalDataCodewords:1914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:47,group2Blocks:34,group2DataCW:48},{totalDataCodewords:1992,ecCodewordsPerBlock:28,group1Blocks:29,group1DataCW:46,group2Blocks:14,group2DataCW:47},{totalDataCodewords:2102,ecCodewordsPerBlock:28,group1Blocks:13,group1DataCW:46,group2Blocks:32,group2DataCW:47},{totalDataCodewords:2216,ecCodewordsPerBlock:28,group1Blocks:40,group1DataCW:47,group2Blocks:7,group2DataCW:48},{totalDataCodewords:2334,ecCodewordsPerBlock:28,group1Blocks:18,group1DataCW:47,group2Blocks:31,group2DataCW:48}],Q:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:13,ecCodewordsPerBlock:13,group1Blocks:1,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:22,ecCodewordsPerBlock:22,group1Blocks:1,group1DataCW:22,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:17,group2Blocks:0,group2DataCW:0},{totalDataCodewords:48,ecCodewordsPerBlock:26,group1Blocks:2,group1DataCW:24,group2Blocks:0,group2DataCW:0},{totalDataCodewords:62,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:76,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:88,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:110,ecCodewordsPerBlock:22,group1Blocks:4,group1DataCW:18,group2Blocks:2,group2DataCW:19},{totalDataCodewords:132,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:154,ecCodewordsPerBlock:24,group1Blocks:6,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:180,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:22,group2Blocks:4,group2DataCW:23},{totalDataCodewords:206,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:20,group2Blocks:6,group2DataCW:21},{totalDataCodewords:244,ecCodewordsPerBlock:24,group1Blocks:8,group1DataCW:20,group2Blocks:4,group2DataCW:21},{totalDataCodewords:261,ecCodewordsPerBlock:20,group1Blocks:11,group1DataCW:16,group2Blocks:5,group2DataCW:17},{totalDataCodewords:295,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:325,ecCodewordsPerBlock:24,group1Blocks:15,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:367,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:22,group2Blocks:15,group2DataCW:23},{totalDataCodewords:397,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:1,group2DataCW:23},{totalDataCodewords:445,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:21,group2Blocks:4,group2DataCW:22},{totalDataCodewords:485,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:5,group2DataCW:25},{totalDataCodewords:512,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:568,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:614,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:664,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:718,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:754,ecCodewordsPerBlock:28,group1Blocks:28,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:808,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:23,group2Blocks:26,group2DataCW:24},{totalDataCodewords:871,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:24,group2Blocks:31,group2DataCW:25},{totalDataCodewords:911,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:23,group2Blocks:37,group2DataCW:24},{totalDataCodewords:985,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:25,group2DataCW:25},{totalDataCodewords:1033,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:24,group2Blocks:1,group2DataCW:25},{totalDataCodewords:1115,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:24,group2Blocks:35,group2DataCW:25},{totalDataCodewords:1171,ecCodewordsPerBlock:30,group1Blocks:29,group1DataCW:24,group2Blocks:19,group2DataCW:25},{totalDataCodewords:1231,ecCodewordsPerBlock:30,group1Blocks:44,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:1286,ecCodewordsPerBlock:30,group1Blocks:39,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1354,ecCodewordsPerBlock:30,group1Blocks:46,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1426,ecCodewordsPerBlock:30,group1Blocks:49,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1502,ecCodewordsPerBlock:30,group1Blocks:48,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1582,ecCodewordsPerBlock:30,group1Blocks:43,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:1666,ecCodewordsPerBlock:30,group1Blocks:34,group1DataCW:24,group2Blocks:34,group2DataCW:25}],H:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:9,ecCodewordsPerBlock:17,group1Blocks:1,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:26,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:36,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:46,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:11,group2Blocks:2,group2DataCW:12},{totalDataCodewords:60,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:15,group2Blocks:0,group2DataCW:0},{totalDataCodewords:66,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:13,group2Blocks:1,group2DataCW:14},{totalDataCodewords:86,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:14,group2Blocks:2,group2DataCW:15},{totalDataCodewords:100,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:12,group2Blocks:4,group2DataCW:13},{totalDataCodewords:122,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:140,ecCodewordsPerBlock:24,group1Blocks:3,group1DataCW:12,group2Blocks:8,group2DataCW:13},{totalDataCodewords:158,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:180,ecCodewordsPerBlock:22,group1Blocks:12,group1DataCW:11,group2Blocks:4,group2DataCW:12},{totalDataCodewords:197,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:5,group2DataCW:13},{totalDataCodewords:223,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:7,group2DataCW:13},{totalDataCodewords:253,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:283,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:17,group2DataCW:15},{totalDataCodewords:313,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:19,group2DataCW:15},{totalDataCodewords:341,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:13,group2Blocks:16,group2DataCW:14},{totalDataCodewords:385,ecCodewordsPerBlock:28,group1Blocks:15,group1DataCW:15,group2Blocks:10,group2DataCW:16},{totalDataCodewords:406,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:16,group2Blocks:6,group2DataCW:17},{totalDataCodewords:442,ecCodewordsPerBlock:24,group1Blocks:34,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:464,ecCodewordsPerBlock:30,group1Blocks:16,group1DataCW:15,group2Blocks:14,group2DataCW:16},{totalDataCodewords:514,ecCodewordsPerBlock:30,group1Blocks:30,group1DataCW:16,group2Blocks:2,group2DataCW:17},{totalDataCodewords:538,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:596,ecCodewordsPerBlock:30,group1Blocks:33,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:628,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:661,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:31,group2DataCW:16},{totalDataCodewords:701,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:26,group2DataCW:16},{totalDataCodewords:745,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:25,group2DataCW:16},{totalDataCodewords:793,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:845,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:35,group2DataCW:16},{totalDataCodewords:901,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:961,ecCodewordsPerBlock:30,group1Blocks:59,group1DataCW:16,group2Blocks:1,group2DataCW:17},{totalDataCodewords:986,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:41,group2DataCW:16},{totalDataCodewords:1054,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:15,group2Blocks:64,group2DataCW:16},{totalDataCodewords:1096,ecCodewordsPerBlock:30,group1Blocks:24,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:1142,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:15,group2Blocks:32,group2DataCW:16},{totalDataCodewords:1222,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:15,group2Blocks:67,group2DataCW:16},{totalDataCodewords:1276,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:15,group2Blocks:61,group2DataCW:16}]};function Kq(e,t){return Gq[t][e]}const qq=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],Jq=[0,0,0,0,0,0,0,31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017];function Yq(e){return/^\d+$/.test(e)}function Xq(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function Zq(e){return Yq(e)?`numeric`:Xq(e)?`alphanumeric`:`byte`}function Qq(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function $q(e){let t=[],n=0;for(;n+2<e.length;)iJ(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(iJ(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&iJ(t,Number.parseInt(e[n],10),4),t}function eJ(e){let t=[],n=0;for(;n+1<e.length;)iJ(t,Qq(e[n])*45+Qq(e[n+1]),11),n+=2;return n<e.length&&iJ(t,Qq(e[n]),6),t}function tJ(e){let t=[];for(let n of e)iJ(t,n,8);return t}function nJ(e){let t=[];for(let n of e){let e;if(n>=33088&&n<=40956)e=n-33088;else if(n>=57408&&n<=60351)e=n-49472;else throw Error(`Invalid Shift JIS kanji value: 0x${n.toString(16)}`);let r=e>>8&255,i=e&255;iJ(t,r*192+i,13)}return t}function rJ(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=12288&&r<=40959){let e=33088+(r-12288);e<=40956?t.push(e):t.push(57408+(r-12288-7868))}else throw Error(`Character U+${r.toString(16)} cannot be encoded as Kanji`)}return t}function iJ(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function aJ(e,t){return Kq(e,t).totalDataCodewords*8}function oJ(e,t,n,r){let i=n===`auto`||!n?Zq(e):n,a=new TextEncoder().encode(e);if(r){let n=aJ(r,t);if(sJ(e,a,i,r)>n)throw Error(`Data too long for QR version ${r} with EC level ${t}`);return r}for(let n=1;n<=40;n++){let r=aJ(n,t);if(sJ(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function sJ(e,t,n,r){let i=Wq(r,n),a;switch(n){case`numeric`:return a=Math.floor(e.length/3)*10+(e.length%3==2?7:e.length%3==1?4:0),4+i+a;case`alphanumeric`:return a=Math.floor(e.length/2)*11+(e.length%2==1?6:0),4+i+a;case`byte`:return 4+i+t.length*8;case`kanji`:return 4+i+e.length*13;default:return 4+i+t.length*8}}function cJ(e,t){return t&&t!==`auto`?t:Yq(e)?`numeric`:Xq(e)?`alphanumeric`:`byte`}const lJ=new Uint8Array(512),uJ=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)lJ[t]=e,uJ[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)lJ[e]=lJ[e-255]})();function dJ(e,t){return e===0||t===0?0:lJ[(uJ[e]+uJ[t])%255]}function fJ(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,lJ[e]]),r=new Uint8Array(n.length+1);for(let e=0;e<n.length;e++)for(let i=0;i<t.length;i++)r[e+i]^=dJ(n[e],t[i]);n=r}let r=Array.from({length:t},()=>0);for(let i of e){let e=i^r[0];for(let i=0;i<t-1;i++)r[i]=r[i+1]^dJ(e,n[i+1]);r[t-1]=dJ(e,n[t])}return r}function pJ(e,t,n,r,i,a){let o=[],s=[],c=0;for(let i=0;i<n;i++){let n=e.slice(c,c+r);o.push(n),s.push(fJ(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(fJ(n,t)),c+=a}let l=[],u=Math.max(r,a);for(let e=0;e<u;e++)for(let t of o)e<t.length&&l.push(t[e]);for(let e=0;e<t;e++)for(let t of s)e<t.length&&l.push(t[e]);return l}function mJ(e,t={}){let n=t.ecLevel??`M`,r=cJ(e,t.mode),i=oJ(e,n,r,t.version),a=Kq(i,n),o=pJ(gJ(hJ(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)iJ(s,e,8);return{version:i,ecLevel:n,bits:s}}function hJ(e,t,n,r){let i=[],a=Wq(n,t),o=new TextEncoder().encode(e);switch(iJ(i,Hq[t],4),iJ(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...$q(e));break;case`alphanumeric`:i.push(...eJ(e));break;case`byte`:i.push(...tJ(o));break;case`kanji`:{let t=rJ(e);i.push(...nJ(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&iJ(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)iJ(i,l?236:17,8),l=!l;return i}function gJ(e){let t=[];for(let n=0;n<e.length;n+=8){let r=0;for(let t=0;t<8&&n+t<e.length;t++)r=r<<1|e[n+t];t.push(r)}return t}function _J(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function vJ(e,t){let n=e.length;yJ(e,0,0),yJ(e,n-7,0),yJ(e,0,n-7),xJ(e,n),SJ(e,t),e[4*t+9][8]=!0,wJ(e,n),t>=7&&TJ(e,n)}function yJ(e,t,n){let r=e.length;for(let r=0;r<7;r++)for(let i=0;i<7;i++){let a=r===0||r===6||i===0||i===6,o=r>=2&&r<=4&&i>=2&&i<=4;e[t+r][n+i]=a||o}for(let i=-1;i<=7;i++)bJ(e,t-1,n+i,!1,r),bJ(e,t+7,n+i,!1,r),bJ(e,t+i,n-1,!1,r),bJ(e,t+i,n+7,!1,r)}function bJ(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function xJ(e,t){for(let n=8;n<t-8;n++)e[6][n]===null&&(e[6][n]=n%2==0),e[n][6]===null&&(e[n][6]=n%2==0)}function SJ(e,t){if(t<2)return;let n=qq[t-1],r=n.length-1;for(let t=0;t<n.length;t++)for(let i=0;i<n.length;i++)(t!==0||i!==0)&&(t!==0||i!==r)&&(t!==r||i!==0)&&CJ(e,n[t],n[i])}function CJ(e,t,n){for(let r=-2;r<=2;r++)for(let i=-2;i<=2;i++){let a=Math.abs(r)===2||Math.abs(i)===2,o=r===0&&i===0;e[t+r][n+i]=a||o}}function wJ(e,t){for(let n=0;n<=8;n++)n<t&&e[8][n]===null&&(e[8][n]=!1),n<t&&e[n][8]===null&&(e[n][8]=!1);for(let n=0;n<7;n++)e[t-1-n][8]===null&&(e[t-1-n][8]=!1);for(let n=0;n<8;n++)e[8][t-1-n]===null&&(e[8][t-1-n]=!1)}function TJ(e,t){for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[t-11+r][n]===null&&(e[t-11+r][n]=!1);for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[n][t-11+r]===null&&(e[n][t-11+r]=!1)}function EJ(e,t,n){let r=e.length,i=0,a=!0;for(let n=r-1;n>=1;n-=2){n===6&&(n=5);let o=a?Array.from({length:r},(e,t)=>r-1-t):Array.from({length:r},(e,t)=>t);for(let r of o)for(let a of[n,n-1])e[r][a]===null&&(e[r][a]=i<t.length&&t[i]===1,i++);a=!a}}function DJ(e,t,n,r){if(e<9&&t<9||e<9&&t>=n-8||e>=n-8&&t<9||e===6||t===6)return!1;if(r>=2){let i=qq[r-1];for(let r of i)for(let a of i)if(!(r<9&&a<9)&&!(r<9&&a>=n-8)&&!(r>=n-8&&a<9)&&e>=r-2&&e<=r+2&&t>=a-2&&t<=a+2)return!1}return!(r>=7&&(e<6&&t>=n-11&&t<=n-9||t<6&&e>=n-11&&e<=n-9)||e===8||t===8||e>=n-8&&t===8||e===8&&t>=n-8)}function OJ(e){switch(e){case 0:return(e,t)=>(e+t)%2==0;case 1:return e=>e%2==0;case 2:return(e,t)=>t%3==0;case 3:return(e,t)=>(e+t)%3==0;case 4:return(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0;case 5:return(e,t)=>e*t%2+e*t%3==0;case 6:return(e,t)=>(e*t%2+e*t%3)%2==0;case 7:return(e,t)=>((e+t)%2+e*t%3)%2==0;default:return()=>!1}}function kJ(e,t,n,r){let i=OJ(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)DJ(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function AJ(e,t,n,r){if(r!==void 0&&r>=0&&r<=7)return r;let i=0,a=1/0;for(let r=0;r<8;r++){let o=e.map(e=>[...e]);kJ(o,r,t,n);let s=jJ(o,t);s<a&&(a=s,i=r)}return i}function jJ(e,t){return MJ(e,t)+NJ(e,t)+PJ(e,t)+FJ(e,t)}function MJ(e,t){let n=0;for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[r][a]==!!e[r][a-1]?(i++,i===5?n+=3:i>5&&n++):i=1}for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[a][r]==!!e[a-1][r]?(i++,i===5?n+=3:i>5&&n++):i=1}return n}function NJ(e,t){let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=!!e[r][i];t===!!e[r][i+1]&&t===!!e[r+1][i]&&t===!!e[r+1][i+1]&&(n+=3)}return n}function PJ(e,t){let n=0,r=[!0,!1,!0,!0,!0,!1,!0,!1,!1,!1,!1],i=[!1,!1,!1,!1,!0,!1,!0,!0,!0,!1,!0];for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[a][o+n]!==r[n]&&(t=!1),!!e[a][o+n]!==i[n]&&(s=!1);(t||s)&&(n+=40)}for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[o+n][a]!==r[n]&&(t=!1),!!e[o+n][a]!==i[n]&&(s=!1);(t||s)&&(n+=40)}return n}function FJ(e,t){let n=0,r=t*t;for(let r=0;r<t;r++)for(let i=0;i<t;i++)e[r][i]&&n++;let i=n/r,a=Math.floor(i*20)*5,o=Math.ceil(i*20)*5;return Math.min(Math.abs(a-50),Math.abs(o-50))*2}function IJ(e,t){let n=Vq[e]<<3|t,r=n<<10;for(let e=4;e>=0;e--)r&1<<e+10&&(r^=1335<<e);return(n<<10|r)^21522}function LJ(e,t,n){let r=e.length,i=IJ(t,n),a=[[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,7],[8,8],[7,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8]];for(let t=0;t<15;t++){let n=(i>>14-t&1)==1,[r,o]=a[t];e[r][o]=n}for(let t=0;t<7;t++){let n=(i>>14-t&1)==1;e[r-1-t][8]=n}for(let t=0;t<8;t++){let n=(i>>7-t&1)==1;e[8][r-8+t]=n}}function RJ(e,t){if(t<7)return;let n=e.length,r=Jq[t];for(let t=0;t<18;t++){let i=(r>>t&1)==1,a=Math.floor(t/3),o=t%3;e[n-11+o][a]=i,e[a][n-11+o]=i}}var zJ=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},BJ=class extends zJ{constructor(...e){super(...e),this.name=`InvalidInputError`}};function VJ(e,t={}){let{version:n,ecLevel:r,bits:i}=mJ(e,t),a=n*4+17,o=_J(a);vJ(o,n),EJ(o,i,n);let s=AJ(o,a,n,t.mask);return kJ(o,s,a,n),LJ(o,r,s),n>=7&&RJ(o,n),o.map(e=>e.map(e=>e===!0))}function HJ(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}const UJ=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function WJ(e){let t=4294967295;for(let n=0;n<e.length;n++)t=UJ[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function GJ(e){let t=1,n=0;for(let r=0;r<e.length;r++)t=(t+e[r])%65521,n=(n+t)%65521;return(n<<16|t)>>>0}function KJ(e){let t=65535,n=Math.ceil(e.length/t)||1,r=new Uint8Array(n*5+e.length),i=0,a=0;for(;a<e.length||i===0;){let n=e.length-a,o=Math.min(n,t),s=a+o>=e.length;r[i++]=+!!s,r[i++]=o&255,r[i++]=o>>8&255,r[i++]=~o&255,r[i++]=~o>>8&255,r.set(e.subarray(a,a+o),i),i+=o,a+=o}return r.subarray(0,i)}function qJ(e){let t=KJ(e),n=GJ(e),r=new Uint8Array(2+t.length+4);r[0]=120,r[1]=1,r.set(t,2);let i=2+t.length;return r[i]=n>>24&255,r[i+1]=n>>16&255,r[i+2]=n>>8&255,r[i+3]=n&255,r}const JJ=new Uint8Array([137,80,78,71,13,10,26,10]);function YJ(e,t){let n=new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]),r=new Uint8Array(8+t.length+4),i=new DataView(r.buffer);i.setUint32(0,t.length),r.set(n,4),r.set(t,8);let a=new Uint8Array(4+t.length);return a.set(n,0),a.set(t,4),i.setUint32(8+t.length,WJ(a)),r}function XJ(e,t,n){let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,e),i.setUint32(4,t),r[8]=8,r[9]=6,r[10]=0,r[11]=0,r[12]=0;let a=e*4,o=t*(1+a),s=new Uint8Array(o),c=0;for(let e=0;e<t;e++)s[c++]=0,s.set(n.subarray(e*a,e*a+a),c),c+=a;let l=qJ(s),u=YJ(`IHDR`,r),d=YJ(`IDAT`,l),f=YJ(`IEND`,new Uint8Array),p=JJ.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(JJ,h),h+=JJ.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function ZJ(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint16(0,!0),r=t.getUint16(2,!0),i=t.getUint16(4,!0);if(n!==0||r!==1&&r!==2||i===0)throw Error(`Invalid ICO file`);let a;for(let e=0;e<i;e++){let n=6+e*16,r=t.getUint8(n)||256,i=t.getUint8(n+1)||256,o=t.getUint32(n+8,!0),s=t.getUint32(n+12,!0);(!a||r*i>a.width*a.height)&&(a={width:r,height:i,size:o,offset:s})}let o=a,s=e.subarray(o.offset,o.offset+o.size);return s.length>=4&&t.getUint32(o.offset)===2303741511?`data:image/png;base64,${aY(s)}`:QJ(s,o.width,o.height)}function QJ(e,t,n){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0),a=r.getInt32(4,!0)||t,o=n,s=r.getUint16(14,!0),c=r.getUint32(16,!0);if(c!==0&&c!==3)throw Error(`Unsupported BMP compression: ${c}`);let l=new Uint8Array(a*o*4);if(s===32)$J(e,i,a,o,l);else if(s===24)eY(e,i,a,o,l);else if(s<=8)tY(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=rY(a,o,s),n=i+nY(e,i,s)+t;n<e.length&&iY(e,n,a,o,l)}return`data:image/png;base64,${aY(XJ(a,o,l))}`}function $J(e,t,n,r,i){let a=t,o=n*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*4,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=e[n+3]}}}function eY(e,t,n,r,i){let a=t+nY(e,t,24),o=Math.ceil(n*3/4)*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*3,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=255}}}function tY(e,t,n,r,i,a){let o=nY(e,t,i),s=e.subarray(t,t+o),c=t+o,l=Math.ceil(n*i/32)*4;for(let t=0;t<r;t++){let o=c+(r-1-t)*l,u=t*n*4;for(let t=0;t<n;t++){let n;if(i===8)n=e[o+t];else if(i===4){let r=e[o+(t>>1)];n=t&1?r&15:r>>4&15}else n=e[o+(t>>3)]>>7-(t&7)&1;let r=n*4,c=u+t*4;a[c]=s[r+2],a[c+1]=s[r+1],a[c+2]=s[r],a[c+3]=255}}}function nY(e,t,n){if(n>=16)return 0;let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return((t>=36?r.getUint32(32,!0):0)||1<<n)*4}function rY(e,t,n){return Math.ceil(e*n/32)*4*t}function iY(e,t,n,r,i){let a=Math.ceil(n/32)*4;for(let o=0;o<r;o++){let s=t+(r-1-o)*a,c=o*n*4;for(let t=0;t<n;t++){let n=s+(t>>3);if(n>=e.length)return;(e[n]>>7-(t&7)&1)==1&&(i[c+t*4+3]=0)}}}function aY(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const oY=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function sY(e,t,n,r){let i=e.size??.3,a=e.margin??0,o=e.hideBackgroundDots??!0,s=t*n,c=s*i,l=r*n+(s-c)/2,u=r*n+(s-c)/2,d=new Set;if(o){let e=Math.floor((t-t*i)/2-a/n),r=Math.ceil((t+t*i)/2+a/n);for(let n=Math.max(0,e);n<Math.min(t,r);n++)for(let i=Math.max(0,e);i<Math.min(t,r);i++)d.add(`${n},${i}`)}let f=``;if(e.backgroundColor){let t=a,n=c+2*t,r=`x="${l-t}" y="${u-t}"`,i=`fill="${HJ(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(oY.test(e.svg))throw new BJ(`logo.svg contains potentially dangerous content (script, event handlers, or foreignObject)`);let t=`x="${l}" y="${u}"`,n=`width="${c}" height="${c}"`;f+=`<svg ${t} ${n} viewBox="0 0 1 1">`,f+=`<g transform="scale(1)">${e.svg}</g></svg>`}else if(e.path){let t=HJ(e.path),n=`translate(${l},${u}) scale(${c/100})`;f+=`<path d="${t}" transform="${n}" fill="currentColor"/>`}else if(e.imageUrl){if(!/^(https?:|data:image\/)/i.test(e.imageUrl))throw new BJ(`imageUrl must use https:, http:, or data:image/ scheme`);let t=e.imageUrl.match(/^data:image\/(x-icon|vnd\.microsoft\.icon);base64,(.+)$/i),n=e.imageUrl;if(t){let e=atob(t[2]),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);n=ZJ(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${HJ(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function cY(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return lY(e+o,t+o,a);case`rounded`:return uY(e+o,t+o,a,a*.25);case`dots`:return dY(e+n/2,t+n/2,a/2);case`diamond`:return fY(e+n/2,t+n/2,a);case`classy`:return pY(e+o,t+o,a);case`classy-rounded`:return mY(e+o,t+o,a);case`extra-rounded`:return uY(e+o,t+o,a,a*.5);case`vertical-line`:return hY(e+o,t,n,a);case`horizontal-line`:return gY(e,t+o,n,a);case`small-square`:return lY(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return lY(e+n*.25,t+n*.25,n*.5);default:return lY(e+o,t+o,a)}}function lY(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function uY(e,t,n,r){return r=Math.min(r,n/2),`M${e+r},${t}h${n-2*r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-2*r}a${r},${r},0,0,1,-${r},-${r}v-${n-2*r}a${r},${r},0,0,1,${r},-${r}z`}function dY(e,t,n){return`M${e-n},${t}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,-${2*n},0z`}function fY(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function pY(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-r}h-${n}v-${n}z`}function mY(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-r}v-${n}z`}function hY(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function gY(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function _Y(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return yY(e,t,i,i,r)+bY(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return dY(e+r,t+r,r)+dY(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return yY(e,t,i,i,r)+bY(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return yY(e,t,i,i,r)+bY(e+n,t+n,i-2*n,i-2*n,r*.5)}default:{let r=i-2*n;return`M${e},${t}h${i}v${i}h-${i}zM${e+n},${t+n}v${r}h${r}v-${r}z`}}}function vY(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return dY(a,o,i/2);case`rounded`:return uY(e+n*2,t+n*2,i,n*.75);default:return lY(e+n*2,t+n*2,i)}}function yY(e,t,n,r,i){return`M${e+i},${t}h${n-2*i}a${i},${i},0,0,1,${i},${i}v${r-2*i}a${i},${i},0,0,1,-${i},${i}h-${n-2*i}a${i},${i},0,0,1,-${i},-${i}v-${r-2*i}a${i},${i},0,0,1,${i},-${i}z`}function bY(e,t,n,r,i){return yY(e,t,n,r,i)}const xY={root:`qr-code`,canvas:`qr-code-canvas`,background:`qr-code-background`,modules:`qr-code-modules`,corner:`qr-code-corner`,logo:`qr-code-logo`,fallback:`qr-code-fallback`},SY=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function CY(e,t){let{value:n,size:r=200,margin:i=4,ecLevel:a,version:o,mode:s,mask:c,dotType:u=`square`,dotSize:d=1,corners:f,color:p,background:m,logo:h,logoSize:g=.3,label:_,fallback:v=null,className:y,style:b,...x}=e,S=a??(h?`H`:void 0),C=l.useMemo(()=>{if(!n)return null;try{return VJ(n,{ecLevel:S,version:o,mode:s,mask:c})}catch{return null}},[n,S,o,s,c]);if(!C)return(0,K.jsx)(`div`,{ref:t,className:W(xY.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,K.jsx)(`span`,{className:xY.fallback,children:v}):null});let w=C.length,T=w+i*2,E=r/T,D=h?sY({size:g},w,E,i).hiddenModules:void 0,O=SY(w),k=new Set;if(f)for(let e of O)for(let t=0;t<7;t++)for(let n=0;n<7;n++)k.add(`${e.row+t},${e.col+n}`);let A=[];for(let e=0;e<w;e++)for(let t=0;t<w;t++){if(!C[e][t])continue;let n=`${e},${t}`;D?.has(n)||k.has(n)||A.push(cY((t+i)*E,(e+i)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+i)*E,a=(t+i)*E;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`path`,{className:xY.corner,d:_Y(r,a,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,K.jsx)(`path`,{className:xY.corner,d:vY(r,a,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,K.jsxs)(`div`,{ref:t,role:`img`,"aria-label":_??n,className:W(xY.root,y),style:{...b,"--qr-code-color":p,"--qr-code-background":m,"--qr-code-logo-size":h?`${M*100}%`:void 0},"data-component":`QRCode`,"data-dot-type":u,...x,children:[(0,K.jsxs)(`svg`,{className:xY.canvas,width:r,height:r,viewBox:`0 0 ${r} ${r}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,K.jsx)(`rect`,{className:xY.background,width:`100%`,height:`100%`}),f?O.map(e=>(0,K.jsx)(l.Fragment,{children:j(f[e.key],e.row,e.col)},e.key)):null,A.length>0?(0,K.jsx)(`path`,{className:xY.modules,d:A.join(``)}):null]}),h?(0,K.jsx)(`span`,{className:xY.logo,"aria-hidden":`true`,children:h}):null]})}CY.displayName=`QRCode`;var wY=G(CY);const TY=(0,l.createContext)({}),EY={root:`radio-card-description`};function DY(e,t){let{className:n,id:r,...i}=e,{descriptionId:a}=l.useContext(TY);return(0,K.jsx)(`span`,{ref:t,id:r??a,className:W(EY.root,n),"data-component":`RadioCard.Description`,...i})}DY.displayName=`RadioCard.Description`;var OY=G(DY);const kY={root:`radio-card-label`};function AY(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(TY);return(0,K.jsx)(`span`,{ref:t,id:r??a,className:W(kY.root,n),"data-component":`RadioCard.Label`,...i})}AY.displayName=`RadioCard.Label`;var jY=G(AY);const MY={root:`radio-card-leading-visual`};function NY(e,t){let{className:n,"aria-label":r,...i}=e;return(0,K.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:W(MY.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}NY.displayName=`RadioCard.LeadingVisual`;var PY=G(NY);const FY={body:`radio-card-body`,control:`radio-card-control`},IY=U(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function LY(e,t){let{className:n,children:r,value:i,name:a,checked:o,defaultChecked:s,disabled:c,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=e,v=l.useContext(Sx).disabled||c,y=J(p),b=`${y}-label`,x=`${y}-description`,[S,C]=Sr(r,{leadingVisual:PY,label:jY,description:OY}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,K.jsx)(TY.Provider,{value:{labelId:b,descriptionId:x},children:(0,K.jsxs)(`label`,{ref:t,className:W(IY({disabled:!!v,validation:d}),n),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,K.jsxs)(`div`,{className:FY.body,children:[S.label,S.description,C]}),(0,K.jsx)(Tx,{id:y,value:i,name:a,checked:o,defaultChecked:s,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:FY.control})]})})}LY.displayName=`RadioCard`;var RY=G(LY);const zY=Object.assign(RY,{LeadingVisual:PY,Label:jY,Description:OY}),BY={root:`radio-group-caption`};function VY(e,t){let{className:n,...r}=e,{captionId:i}=l.useContext(Sx);return(0,K.jsx)(`span`,{ref:t,id:i,className:W(BY.root,n),"data-component":`RadioGroup.Caption`,...r})}VY.displayName=`RadioGroup.Caption`;var HY=G(VY);const UY={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function WY(e,t){let{className:n,children:r,visuallyHidden:i,...a}=e,{disabled:o,required:s}=l.useContext(Sx);return(0,K.jsxs)(`span`,{ref:t,title:s?`required field`:void 0,className:W(UY.root,o&&UY.disabled,i&&UY.hidden,n),"data-component":`RadioGroup.Label`,"data-label-disabled":o,...a,children:[r,s?(0,K.jsx)(`span`,{className:UY.required,children:`*`}):null]})}WY.displayName=`RadioGroup.Label`;var GY=G(WY);const KY={success:on,error:xn},qY={icon:`radio-group-validation-icon`},JY=U(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function YY(e,t){let{className:n,children:r,variant:i,...a}=e,{validationMessageId:o}=l.useContext(Sx),s=KY[i];return(0,K.jsxs)(`span`,{ref:t,className:W(JY({variant:i}),n),"data-component":`RadioGroup.Validation`,"data-validation-status":i,...a,children:[(0,K.jsx)(s,{className:qY.icon,"aria-hidden":`true`}),(0,K.jsx)(`span`,{id:o,children:r})]})}YY.displayName=`RadioGroup.Validation`;var XY=G(YY);const ZY={root:`radio-group`,legend:`radio-group-legend`,legendVisible:`radio-group-legend-visible`,body:`radio-group-body`,validation:`radio-group-validation-slot`,hidden:`sr-only`};function QY(e,t){let{as:n=`fieldset`,className:r,children:i,name:a,disabled:o,required:s,onChange:c,id:u,"aria-labelledby":d,...f}=e,[p,m]=Sr(i,{label:GY,caption:HY,validation:XY}),h=J(u),g=p.caption?`${h}-caption`:void 0,_=p.validation?`${h}-validation`:void 0,v=e=>{let{value:t,checked:n}=e.currentTarget;n&&c?.(t,e)},y=l.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:a,disabled:o,required:s,captionId:g,validationMessageId:_,onChange:v};return(0,K.jsx)(Sx.Provider,{value:b,children:(0,K.jsxs)(n,{ref:t,id:h,disabled:o,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:W(ZY.root,r),"data-component":`RadioGroup`,"data-disabled":o,"data-required":s,...f,children:[p.label?(0,K.jsxs)(`legend`,{className:W(ZY.legend,y&&ZY.legendVisible),children:[p.label,s?(0,K.jsx)(`span`,{className:ZY.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,K.jsx)(`div`,{className:ZY.body,children:m}),p.validation?(0,K.jsx)(`div`,{className:ZY.validation,children:p.validation}):null]})})}QY.displayName=`RadioGroup`;var $Y=G(QY);const eX=Object.assign($Y,{Label:GY,Caption:HY,Validation:XY}),tX={item:`rating-item`,input:`rating-input`,srOnly:`sr-only`,star:`rating-star`,starTrack:`rating-star-track`,starFill:`rating-star-fill`,starFillIcon:`rating-star-fill-icon`},nX=U(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),rX=e=>e===1?`1 star`:`${e} stars`,iX=(e,t)=>`${e} out of ${t} stars`,aX=({className:e})=>(0,K.jsx)(`svg`,{className:e,"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{d:`M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z`})});function oX(e,t){let{className:n,style:r,count:i=5,value:a,defaultValue:o,size:s=`medium`,readOnly:c,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=rX,valueLabel:h=iX,"aria-label":g,..._}=e,v=a!==void 0,[y,b]=l.useState(()=>o??0),x=v?a:y,S=Math.max(Math.trunc(i),0),C=Math.min(Math.max(x,0),S),w=J(f),T=!c&&!u,E=e=>{T&&(v||b(e),p?.(e))},D=e=>{E(Number(e.currentTarget.value))},O=e=>{d&&Number(e.currentTarget.value)===C&&E(0)},k=c?`span`:`label`;return(0,K.jsx)(`span`,{ref:t,role:c?`img`:`radiogroup`,"aria-label":c?g??h(C,S):g,className:W(nX({size:s,interactive:T,disabled:!!u}),n),style:{...r,"--rating-value":C},"data-component":`Rating`,"data-size":s,"data-value":C,"data-count":S,"data-readonly":c,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,K.jsxs)(k,{className:tX.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[c?null:(0,K.jsx)(`input`,{type:`radio`,className:W(tX.input,tX.srOnly),name:w,value:n,checked:n===C,disabled:u,"aria-label":m(n,S),onChange:D,onClick:O,"data-component":`Rating.Input`}),(0,K.jsxs)(`span`,{className:tX.star,"aria-hidden":`true`,children:[(0,K.jsx)(aX,{className:tX.starTrack}),(0,K.jsx)(`span`,{className:tX.starFill,children:(0,K.jsx)(aX,{className:tX.starFillIcon})})]})]},n)})})}oX.displayName=`Rating`;var sX=G(oX);const cX=1e3,lX=60*cX,uX=60*lX,dX=24*uX,fX=7*dX,pX=30*dX,mX=12*pX,hX=`P30D`,gX=[{unit:`year`,length:mX},{unit:`month`,length:pX},{unit:`week`,length:fX},{unit:`day`,length:dX},{unit:`hour`,length:uX},{unit:`minute`,length:lX},{unit:`second`,length:cX}],_X=[`year`,`month`,`day`,`hour`,`minute`,`second`],vX={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},yX=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),bX=e=>{let t=yX.exec(e);if(!t||t.slice(1).every(e=>e===void 0))return null;let[,n,r,i,a,o,s,c]=t;return Number(n??0)*mX+Number(r??0)*pX+Number(i??0)*fX+Number(a??0)*dX+Number(o??0)*uX+Number(s??0)*lX+Number(c??0)*cX},xX=e=>{let t=Math.abs(e),{unit:n,length:r}=gX.find(({length:e})=>t>=e)??gX[gX.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},SX=(e,t)=>{let n=Math.floor(Math.abs(e)/cX),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24),o=Math.floor(a/30),s=Math.floor(o/12),c={year:s,month:o-s*12,day:a-o*30,hour:i-a*24,minute:r-i*60,second:n-r*60};return _X.slice(0,_X.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},CX=e=>{let{value:t,unit:n}=xX(e);return n===`second`?`1m`:`${Math.abs(t)}${vX[n]}`},wX=(e,t)=>{let n=SX(e,t).filter(({count:e})=>e>0);return n.length===0?`0${vX[t]}`:n.map(({unit:e,count:t})=>`${t}${vX[e]}`).join(` `)},TX=(e,t)=>{let{value:n,unit:r}=xX(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},EX=(e,t,n)=>{let r=e.getFullYear()===new Date(t).getFullYear();return{weekday:n.weekday,year:n.year??(r?void 0:`numeric`),month:n.month??`short`,day:n.day??`numeric`,hour:n.hour,minute:n.minute,second:n.second,timeZoneName:n.timeZoneName}},DX=(e,t,n,r)=>new Intl.DateTimeFormat(r,EX(e,t,n)).format(e),OX=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),kX=(e,t,n)=>{let{format:r,tense:i,precision:a,threshold:o,prefix:s,dateOptions:c,locale:l}=n,u=e.getTime()-t;if(r===`elapsed`)return{text:wX(u,a),updateDelay:gX.find(({unit:e})=>e===a)?.length??cX};let d=bX(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=xX(u);return{text:r===`micro`?CX(u):TX(u,l),updateDelay:e}}let f=DX(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},AX=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function jX(e,t){let{as:n=`time`,children:r,date:i,datetime:a,format:o=`auto`,tense:s=`auto`,precision:c=`second`,threshold:u=hX,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=e,S=AX(i,a),[C,w]=l.useState(()=>Date.now()),{text:T,updateDelay:E}=S?kX(S,C,{format:o,tense:s,precision:c,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return l.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,K.jsx)(n,{ref:t,dateTime:S?.toISOString(),title:f||!S?void 0:OX(S),"data-component":`RelativeTime`,"data-format":o,"data-tense":s,...x,children:r??T})}jX.displayName=`RelativeTime`;var MX=G(jX);const NX=(0,l.createContext)({}),PX=`RichTextEditor`,FX=[S.HeadingNode,S.QuoteNode,x.ListNode,x.ListItemNode,b.LinkNode,b.AutoLinkNode],IX={paragraph:`rich-text-editor-paragraph`,heading:{h1:`rich-text-editor-heading-1`,h2:`rich-text-editor-heading-2`,h3:`rich-text-editor-heading-3`},quote:`rich-text-editor-quote`,link:`rich-text-editor-link`,list:{ul:`rich-text-editor-list-bullet`,ol:`rich-text-editor-list-number`,listitem:`rich-text-editor-list-item`,nested:{listitem:`rich-text-editor-list-item-nested`}},text:{bold:`rich-text-editor-bold`,italic:`rich-text-editor-italic`,underline:`rich-text-editor-underline`,strikethrough:`rich-text-editor-strikethrough`,underlineStrikethrough:`rich-text-editor-underline-strikethrough`,code:`rich-text-editor-inline-code`},ltr:`rich-text-editor-ltr`,rtl:`rich-text-editor-rtl`},LX={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},RX=({readOnly:e})=>{let[t]=(0,v.useLexicalComposerContext)();return l.useEffect(()=>{t.setEditable(!e)},[t,e]),null};function zX(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=PX,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,..._}=e,v={namespace:l,theme:IX,nodes:c?[...FX,...c]:FX,editable:!s,editorState:i,onError:u??(e=>{throw e})},y={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,K.jsx)(`div`,{ref:t,className:W(LX.root,s&&LX.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,..._,children:(0,K.jsx)(g.LexicalComposer,{initialConfig:v,children:(0,K.jsxs)(NX.Provider,{value:y,children:[(0,K.jsx)(C.HistoryPlugin,{}),(0,K.jsx)(T.ListPlugin,{}),(0,K.jsx)(w.LinkPlugin,{}),(0,K.jsx)(D.TabIndentationPlugin,{}),(0,K.jsx)(RX,{readOnly:s}),a?(0,K.jsx)(E.OnChangePlugin,{onChange:(e,t)=>a(e,t)}):null,r]})})})}zX.displayName=`RichTextEditor`;var BX=G(zX);const VX={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function HX(e,t){let{className:n,style:r,...i}=e,{placeholder:a,minHeight:o,maxHeight:s,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d}=l.useContext(NX),f=(0,K.jsx)(`div`,{className:VX.scroll,style:{minHeight:o===void 0?void 0:`${o}px`,maxHeight:s===void 0?void 0:`${s}px`},"data-component":`RichTextEditor.Scroll`,children:a?(0,K.jsx)(O.ContentEditable,{ref:t,className:W(VX.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":a,placeholder:(0,K.jsx)(`div`,{className:VX.placeholder,children:a}),"data-component":`RichTextEditor.Content`,...i}):(0,K.jsx)(O.ContentEditable,{ref:t,className:W(VX.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...i})});return(0,K.jsx)(A.RichTextPlugin,{contentEditable:f,ErrorBoundary:k.LexicalErrorBoundary})}HX.displayName=`RichTextEditor.Content`;var UX=G(HX);const WX=[`history`,`inline`,`block`,`list`,`link`],GX={root:`rich-text-editor-toolbar`,controls:`rich-text-editor-toolbar-controls`,group:`rich-text-editor-toolbar-group`,divider:`rich-text-editor-toolbar-divider`,linkField:`rich-text-editor-link-field`,linkInput:`rich-text-editor-link-input`},KX=[{format:`bold`,icon:Wn,label:`Bold`},{format:`italic`,icon:Yn,label:`Italic`},{format:`underline`,icon:$n,label:`Underline`},{format:`strikethrough`,icon:Qn,label:`Strikethrough`},{format:`code`,icon:gn,label:`Code`}],qX=[{tag:`h1`,icon:Kn,label:`Heading 1`},{tag:`h2`,icon:qn,label:`Heading 2`},{tag:`h3`,icon:Jn,label:`Heading 3`}],JX={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function YX(e){let{className:t,children:n,controls:r=WX,"aria-label":i=`Formatting`,...a}=e,[o]=(0,v.useLexicalComposerContext)(),{readOnly:s}=l.useContext(NX),c=l.useRef(null);vr({containerRef:c,direction:`horizontal`,wrap:!0});let[u,d]=l.useState(JX),[f,p]=l.useState(`paragraph`),[m,h]=l.useState(!1),[g,_]=l.useState(!1),[y,C]=l.useState(!1),[w,T]=l.useState(null),E=l.useCallback(()=>{let e=(0,N.$getSelection)();if(!(0,N.$isRangeSelection)(e))return;d({bold:e.hasFormat(`bold`),italic:e.hasFormat(`italic`),underline:e.hasFormat(`underline`),strikethrough:e.hasFormat(`strikethrough`),code:e.hasFormat(`code`)});let t=e.anchor.getNode(),n=t.getKey()===`root`?t:t.getTopLevelElement();if((0,x.$isListNode)(n))p(n.getListType()===`number`?`number`:`bullet`);else if((0,S.$isHeadingNode)(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else(0,S.$isQuoteNode)(n)?p(`quote`):p(`paragraph`);h((0,b.$isLinkNode)(t)||(0,b.$isLinkNode)(t.getParent()))},[]);l.useEffect(()=>(0,M.mergeRegister)(o.registerUpdateListener(({editorState:e})=>{e.read(E)}),o.registerCommand(N.SELECTION_CHANGE_COMMAND,()=>(E(),!1),N.COMMAND_PRIORITY_CRITICAL),o.registerCommand(N.CAN_UNDO_COMMAND,e=>(_(e),!1),N.COMMAND_PRIORITY_CRITICAL),o.registerCommand(N.CAN_REDO_COMMAND,e=>(C(e),!1),N.COMMAND_PRIORITY_CRITICAL)),[o,E]);let D=e=>{o.update(()=>{let t=(0,N.$getSelection)();if((0,N.$isRangeSelection)(t)){if(f===e){(0,j.$setBlocksType)(t,()=>(0,N.$createParagraphNode)());return}(0,j.$setBlocksType)(t,()=>e===`quote`?(0,S.$createQuoteNode)():(0,S.$createHeadingNode)(e))}})},O=e=>{if(f===e){o.dispatchCommand(x.REMOVE_LIST_COMMAND,void 0);return}o.dispatchCommand(e===`bullet`?x.INSERT_UNORDERED_LIST_COMMAND:x.INSERT_ORDERED_LIST_COMMAND,void 0)},k=()=>{if(m){o.dispatchCommand(b.TOGGLE_LINK_COMMAND,null);return}T(e=>e===null?``:null)},A=()=>{w&&o.dispatchCommand(b.TOGGLE_LINK_COMMAND,w),T(null),o.focus()},P=(e,t,n,r,i,a)=>(0,K.jsx)(_i,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:s||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),F={history:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_i,{icon:en,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:s||!g,onClick:()=>o.dispatchCommand(N.UNDO_COMMAND,void 0),"data-component":`RichTextEditor.Undo`}),(0,K.jsx)(_i,{icon:Zt,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:s||!y,onClick:()=>o.dispatchCommand(N.REDO_COMMAND,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,K.jsx)(K.Fragment,{children:KX.map(({format:e,icon:t,label:n})=>P(n,n,t,u[e],()=>o.dispatchCommand(N.FORMAT_TEXT_COMMAND,e)))}),block:(0,K.jsxs)(K.Fragment,{children:[qX.map(({tag:e,icon:t,label:n})=>P(n,n,t,f===e,()=>D(e))),P(`Quote`,`Quote`,Zn,f===`quote`,()=>D(`quote`))]}),list:(0,K.jsxs)(K.Fragment,{children:[P(`Bulleted list`,`Bulleted list`,Gn,f===`bullet`,()=>O(`bullet`)),P(`Numbered list`,`Numbered list`,Xn,f===`number`,()=>O(`number`))]}),link:P(`Link`,m?`Remove link`:`Link`,An,m||w!==null,k)};return(0,K.jsxs)(`div`,{className:W(GX.root,t),"data-component":`RichTextEditor.Toolbar`,children:[(0,K.jsxs)(`div`,{ref:c,role:`toolbar`,"aria-label":i,"aria-orientation":`horizontal`,className:GX.controls,...a,children:[r.map((e,t)=>(0,K.jsxs)(l.Fragment,{children:[t>0?(0,K.jsx)(`span`,{"aria-hidden":`true`,className:GX.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,K.jsx)(`div`,{className:GX.group,"data-control":e,children:F[e]})]},e)),n]}),w===null?null:(0,K.jsxs)(`div`,{className:GX.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,K.jsx)(Yo,{autoFocus:!0,size:`small`,type:`url`,value:w,placeholder:`https://example.com`,"aria-label":`Link address`,className:GX.linkInput,onChange:e=>T(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),A()),e.key===`Escape`&&(T(null),o.focus())}}),(0,K.jsx)(mi,{size:`small`,onClick:A,children:`Apply`})]})]})}YX.displayName=`RichTextEditor.Toolbar`;const XX=Object.assign(BX,{Toolbar:YX,Content:UX}),ZX=(0,l.createContext)({}),QX={root:`tooltip`,open:`tooltip-open motion-safe:[&:popover-open]:animate-in motion-safe:[&:popover-open]:fade-in motion-safe:[&:popover-open]:duration-100`,openPolyfilled:`tooltip-open-polyfilled motion-safe:[&[class~=':popover-open']]:animate-in motion-safe:[&[class~=':popover-open']]:fade-in motion-safe:[&[class~=':popover-open']]:duration-100`,bridge:`tooltip-bridge`,bridgeVertical:`tooltip-bridge-vertical`,bridgeHorizontal:`tooltip-bridge-horizontal`},$X={nw:{side:`outside-top`,align:`end`},n:{side:`outside-top`,align:`center`},ne:{side:`outside-top`,align:`start`},e:{side:`outside-right`,align:`center`},se:{side:`outside-bottom`,align:`start`},s:{side:`outside-bottom`,align:`center`},sw:{side:`outside-bottom`,align:`end`},w:{side:`outside-left`,align:`center`}},eZ={"outside-top-end":`nw`,"outside-top-center":`n`,"outside-top-start":`ne`,"outside-right-center":`e`,"outside-bottom-start":`se`,"outside-bottom-center":`s`,"outside-bottom-end":`sw`,"outside-left-center":`w`},tZ={short:50,medium:400,long:1200},nZ=[`a[href]`,`button:not([disabled])`,`summary`,`select`,`input:not([type=hidden])`,`textarea`],rZ=e=>nZ.some(t=>e.matches(t))||e.getAttribute(`role`)===`button`,iZ=e=>rZ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&rZ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&rZ(e)));function aZ(e,t){let{className:n,children:r,text:i,id:a,direction:o=`s`,type:s=`description`,delay:c=`short`,...u}=e,d=J(a),f=l.Children.only(r),p=l.useRef(null),m=B(t,p),h=l.useRef(null),g=l.useRef(null),_=l.useRef(null),[v,y]=l.useState(!1),[b,x]=l.useState(o),S=()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)};l.useEffect(()=>S,[]);let C=()=>{let e=h.current,t=p.current;if(!e||!t)return;try{e.showPopover()}catch{return}y(!0);let{side:n,align:r}=$X[o],{top:i,left:a,anchorSide:s,anchorAlign:c}=sa(e,t,{side:n,align:r});x(eZ[`${s}-${c}`]??o),e.style.top=`${i}px`,e.style.left=`${a}px`},w=()=>{S(),y(!1);try{h.current?.hidePopover()}catch{}};l.useEffect(()=>{let e=h.current,t=p.current;if(!(!e||!t)){if(!iZ(t))throw Error("The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or an equivalent element instead.");typeof window<`u`&&!(0,P.isSupported)()&&(0,P.apply)(),e.setAttribute(`popover`,`manual`)}},[]),Wi(e=>{v&&(e.preventDefault(),w())});let T=l.useMemo(()=>({tooltipId:d}),[d]);if(!l.isValidElement(f))return null;let E=f.props,D=l.cloneElement(f,{ref:m,"aria-describedby":s===`description`?[E[`aria-describedby`],d].filter(Boolean).join(` `):E[`aria-describedby`],"aria-labelledby":s===`label`?d:E[`aria-labelledby`],onFocus:e=>{try{if(!e.target.matches(`:focus-visible`))return}catch{}C(),E.onFocus?.(e)},onBlur:e=>{w(),E.onBlur?.(e)},onMouseOverCapture:e=>{g.current=window.setTimeout(()=>{g.current!==null&&(C(),E.onMouseEnter?.(e))},tZ[c])},onMouseLeave:e=>{w(),E.onMouseLeave?.(e)},onTouchEnd:e=>{E.onTouchEnd?.(e),_.current=window.setTimeout(w,10)}});return(0,K.jsxs)(ZX.Provider,{value:T,children:[D,(0,K.jsx)(`span`,{ref:h,id:d,role:s===`description`?`tooltip`:void 0,"aria-hidden":`true`,className:W(QX.root,QX.open,QX.openPolyfilled,QX.bridge,QX.bridgeVertical,QX.bridgeHorizontal,n),onMouseEnter:C,onMouseLeave:w,"data-component":`Tooltip`,"data-direction":b,...u,children:i})]})}aZ.displayName=`Tooltip`;var oZ=G(aZ);const sZ={item:`segmented-control-segment`,separator:`segmented-control-segment-separator`,separatorHidden:`segmented-control-segment-separator-hidden`,button:`segmented-control-button`,buttonSelected:`segmented-control-button-selected`,buttonDisabled:`segmented-control-button-disabled`,content:`segmented-control-content`,contentSelected:`segmented-control-content-selected`,contentInteractive:`segmented-control-content-interactive`},cZ=e=>{let t=e;return l.isValidElement(e)?e:(0,K.jsx)(t,{})};function lZ(e){let{component:t,className:n,children:r,selected:i,disabled:a,tooltip:o,tooltipType:s,tooltipDirection:c,"aria-disabled":l,...u}=e,d=!!a||l===!0||l===`true`,f=(0,K.jsx)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":d||void 0,className:W(sZ.button,i&&sZ.buttonSelected,d&&!i&&sZ.buttonDisabled,n),...u,children:(0,K.jsx)(`span`,{className:W(sZ.content,i&&sZ.contentSelected,!i&&!d&&sZ.contentInteractive),children:r})});return(0,K.jsx)(`li`,{className:W(sZ.item,sZ.separator,sZ.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,K.jsx)(oZ,{text:o,type:s,direction:c,children:f}):f})}lZ.displayName=`SegmentedControlSegment`;const uZ={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function dZ(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,K.jsxs)(lZ,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,K.jsx)(`span`,{className:W(uZ.visual,o&&uZ.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:cZ(i)}):null,(0,K.jsx)(`span`,{className:W(uZ.text,uZ.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,K.jsx)(`span`,{className:uZ.counter,children:(0,K.jsx)(ci,{children:r})})]})}dZ.displayName=`SegmentedControl.Button`;const fZ={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function pZ(e){let{"aria-label":t,className:n,description:r,icon:i,selected:a,disabled:o,tooltipDirection:s,defaultSelected:c,...l}=e;return(0,K.jsx)(lZ,{component:`SegmentedControl.IconButton`,className:W(fZ.button,n),selected:a,disabled:o,"aria-label":r?t:void 0,tooltip:r??t,tooltipType:r?void 0:`label`,tooltipDirection:s,...l,children:(0,K.jsx)(`span`,{className:W(fZ.visual,o&&fZ.visualDisabled),"data-component":`SegmentedControl.Icon`,children:cZ(i)})})}pZ.displayName=`SegmentedControl.IconButton`;const mZ={dropdown:`segmented-control-dropdown`},hZ=U(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),gZ=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),_Z=e=>e.type===dZ,vZ=e=>e.type===pZ,yZ=e=>{if(e!==void 0)return _Z(e)?e.props.children:vZ(e)?e.props[`aria-label`]:void 0},bZ=e=>e===void 0?null:_Z(e)?e.props.leadingVisual??null:vZ(e)?e.props.icon:null,xZ=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function SZ(e){let{"aria-label":t,"aria-labelledby":n,className:r,children:i,fullWidth:a,onChange:o,size:s=`medium`,variant:c=`default`,...u}=e,d=gZ(i),f=o===void 0||d.some(e=>e.props.defaultSelected!==void 0),p=d.findIndex(e=>e.props.defaultSelected||e.props.selected),m=p===-1?0:p,[h,g]=l.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{xZ(t)||(f&&g(e),o?.(e),t.props.onClick?.(n))},b=(0,K.jsx)(`ul`,{"aria-label":t,"aria-labelledby":n,className:W(hZ({size:s}),r),"data-component":`SegmentedControl`,"data-size":s,...Gi(`full-width`,a),...Gi(`variant`,c),...u,children:d.map((e,t)=>l.cloneElement(e,{selected:t===_,onClick:n=>y(t,e,n)}))});return ds(c)&&Object.values(c).includes(`dropdown`)?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:mZ.dropdown,"data-component":`SegmentedControl.Dropdown`,...Gi(`variant`,c),children:(0,K.jsxs)(ga,{children:[(0,K.jsx)(ga.Button,{"aria-label":t&&`${yZ(v)}, ${t}`,leadingVisual:bZ(v),children:yZ(v)}),(0,K.jsx)(ga.Overlay,{"aria-labelledby":n,children:(0,K.jsx)(Mi,{selectionVariant:`single`,children:d.map((e,t)=>{let n=bZ(e);return(0,K.jsxs)(Mi.Item,{selected:t===_,disabled:xZ(e),onSelect:n=>y(t,e,n),children:[n?(0,K.jsx)(Mi.LeadingVisual,{children:cZ(n)}):null,yZ(e)]},t)})})})]})}),b]}):b}SZ.displayName=`SegmentedControl`;const CZ=Object.assign(SZ,{Button:dZ,IconButton:pZ}),wZ=Object.assign(Kx,{Option:Px,OptGroup:Ax});function TZ(e,t){let{className:n,children:r,...i}=e,{required:a,...o}=zf(i),{labelId:s}=l.useContext(Rf),c=J();return(0,K.jsx)(mi,{ref:t,type:`button`,"aria-labelledby":s?`${c} ${s}`:void 0,className:W(n),"data-component":`SelectPanel.Button`,...o,children:s?(0,K.jsx)(`span`,{id:c,children:r}):r})}TZ.displayName=`SelectPanel.Button`;var EZ=G(TZ);const DZ=(0,l.createContext)({}),OZ={root:`select-panel-footer`,rootWithoutActions:`select-panel-footer-without-actions`,content:`select-panel-footer-content`,contentWithoutActions:`select-panel-footer-content-without-actions`,actions:`select-panel-footer-actions`};function kZ(e,t){let{className:n,children:r,...i}=e,{selectionVariant:a,onCancel:o}=l.useContext(DZ),s=a!==`instant`;return!s&&!r?null:(0,K.jsxs)(`div`,{ref:t,className:W(OZ.root,!s&&OZ.rootWithoutActions,n),"data-component":`SelectPanel.Footer`,"data-has-actions":s?``:void 0,...i,children:[(0,K.jsx)(`div`,{className:W(OZ.content,!s&&OZ.contentWithoutActions),children:r}),s?(0,K.jsxs)(`div`,{className:OZ.actions,children:[(0,K.jsx)(mi,{type:`button`,size:`small`,onClick:o,children:`Cancel`}),(0,K.jsx)(mi,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}kZ.displayName=`SelectPanel.Footer`;var AZ=G(kZ);const jZ={root:`select-panel-search-input`};function MZ(e,t){let{className:n,value:r,onChange:i,onKeyDown:a,...o}=e,{searchQuery:s,setSearchQuery:c,searchInputRef:u,moveFocusToList:d}=l.useContext(DZ),f=l.useRef(null),p=B(u,f),m=B(t,p),h=r??s??``;return(0,K.jsx)(Yo,{ref:m,block:!0,leadingVisual:Ln,placeholder:`Search`,value:h,onChange:e=>{c?.(e.currentTarget.value),i?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),a?.(e)},trailingAction:h?(0,K.jsx)(Yo.Action,{icon:vn,"aria-label":`Clear`,onClick:()=>{c?.(``),i?.(``,null),f.current?.focus()}}):void 0,className:W(jZ.root,n),"data-component":`SelectPanel.SearchInput`,...o})}MZ.displayName=`SelectPanel.SearchInput`;var NZ=G(MZ);const PZ={root:`select-panel-header`,content:`select-panel-header-content`,contentWithSearchInput:`select-panel-header-content-with-search`,titleRow:`select-panel-header-title-row`,title:`select-panel-header-title`,heading:`select-panel-header-heading`,description:`select-panel-header-description`,actions:`select-panel-header-actions`},FZ={searchInput:NZ};function IZ(e,t){let{className:n,children:r,onBack:i,...a}=e,[o,s]=Sr(r,FZ),{panelId:c,title:u,description:d,onCancel:f,onClearSelection:p}=l.useContext(DZ);return(0,K.jsxs)(`div`,{ref:t,className:W(PZ.root,n),"data-component":`SelectPanel.Header`,...a,children:[(0,K.jsxs)(`div`,{className:W(PZ.content,o.searchInput&&PZ.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":o.searchInput?``:void 0,children:[(0,K.jsxs)(`div`,{className:PZ.titleRow,children:[i?(0,K.jsx)(_i,{type:`button`,variant:`invisible`,icon:qt,"aria-label":`Back`,onClick:i,"data-component":`SelectPanel.BackButton`}):null,(0,K.jsxs)(`div`,{className:PZ.title,"data-has-description":d?``:void 0,"data-has-back":i?``:void 0,children:[(0,K.jsx)(Er,{as:`h1`,id:c?`${c}-title`:void 0,className:PZ.heading,children:u}),d?(0,K.jsx)(`span`,{id:c?`${c}-description`:void 0,className:PZ.description,children:d}):null]})]}),(0,K.jsxs)(`div`,{className:PZ.actions,children:[p?(0,K.jsx)(_i,{type:`button`,variant:`invisible`,icon:wn,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,K.jsx)(_i,{type:`button`,variant:`invisible`,icon:yn,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),o.searchInput,s]})}IZ.displayName=`SelectPanel.Header`;var LZ=G(IZ);const RZ={form:`select-panel-form`,container:`select-panel-container`},zZ=U(`select-panel-backdrop`,{variants:{variant:{anchored:``,modal:`select-panel-backdrop-modal motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`},narrowVariant:{anchored:``,modal:`select-panel-backdrop-narrow-modal`,"full-screen":``,"bottom-sheet":`select-panel-backdrop-narrow-bottom-sheet`}}}),BZ=U(`select-panel motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,{variants:{width:{small:`select-panel-width-small`,medium:`select-panel-width-medium`,large:`select-panel-width-large`,xlarge:`select-panel-width-xlarge`,auto:`select-panel-width-auto`},maxHeight:{small:`select-panel-max-height-small`,medium:`select-panel-max-height-medium`,large:`select-panel-max-height-large`,xlarge:`select-panel-max-height-xlarge`,"fit-content":`select-panel-max-height-fit-content`},variant:{anchored:`select-panel-anchored`,modal:``},narrowVariant:{anchored:`select-panel-narrow-anchored`,modal:`select-panel-narrow-modal`,"full-screen":`select-panel-narrow-full-screen`,"bottom-sheet":`select-panel-narrow-bottom-sheet`},unplaced:{true:`invisible`,false:``}}}),VZ={regular:`anchored`,narrow:`full-screen`},HZ=e=>l.isValidElement(e)&&e.type===EZ,UZ=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function WZ(e,t){let{className:n,children:r,title:i,description:a,variant:o=VZ,selectionVariant:s=`multiple`,id:c,defaultOpen:u=!1,open:d,anchorRef:f,side:p=`outside-bottom`,align:m=`start`,onCancel:h,onClearSelection:g,onSubmit:_,width:v=`medium`,maxHeight:y=`large`,...b}=e,x=J(c),S=l.useRef(null),C=f??S,w=l.useRef(null),T=B(t,w),E=l.useRef(null),D=d!==void 0,[O,k]=l.useState(u),A=D?d:O,j=l.useCallback(()=>{D||k(!1)},[D]),M=l.useCallback(()=>{j(),h?.()},[j,h]),N=l.useCallback(()=>g?.(),[g]),P=l.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=l.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=l.useCallback(()=>{s===`instant`&&P()},[s,P]),[L,ee]=l.useState(``),R=l.Children.toArray(r),z=R.find(HZ),[te,ne]=Sr(R.filter(e=>e!==z),{header:LZ,footer:AZ}),re=z?.props.onClick,ie=z?l.cloneElement(z,{ref:C,onClick:e=>{re?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,ae={...VZ,...typeof o==`string`?{regular:o}:o},oe=ae.regular??`anchored`,se=ae.narrow,ce=oe===`anchored`||se===`anchored`,le=l.useRef(null),[ue,de]=l.useState(null),fe=l.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=sa(t,e,{side:p,align:m});le.current&&UZ(le.current,n)||(le.current=n,de(n))},[C,p,m]);Vi(()=>{if(!A||!ce){le.current=null,de(null);return}fe();let e=new ResizeObserver(fe);return w.current&&e.observe(w.current),window.addEventListener(`resize`,fe),window.addEventListener(`scroll`,fe,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,fe),window.removeEventListener(`scroll`,fe,!0)}},[A,ce,fe]),Bi({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),l.useEffect(()=>{A&&!E.current&&F()},[A,F]),Wi(e=>{A&&(e.preventDefault(),M())});let pe=l.useMemo(()=>({panelId:x,title:i,description:a,selectionVariant:s,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,i,a,s,L,M,g,N,F]),me=l.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:s===`instant`?`single`:s,afterSelect:I,enableFocusZone:!0}),[x,s,I]);return(0,K.jsxs)(K.Fragment,{children:[ie,A?(0,K.jsx)(na,{children:(0,K.jsx)(`div`,{className:W(zZ({variant:oe,narrowVariant:se})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...Gi(`variant`,ae),children:(0,K.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":a?`${x}-description`:void 0,className:W(BZ({width:v,maxHeight:y,variant:oe,narrowVariant:se,unplaced:ce&&!ue}),n),style:{"--select-panel-top":`${ue?.top??0}px`,"--select-panel-left":`${ue?.left??0}px`},"data-component":`SelectPanel`,"data-width":v,"data-max-height":y,"data-side":ue?.anchorSide??p,"data-align":ue?.anchorAlign??m,...Gi(`variant`,ae),...b,children:(0,K.jsx)(`form`,{className:RZ.form,onSubmit:P,children:(0,K.jsxs)(DZ.Provider,{value:pe,children:[te.header??(0,K.jsx)(LZ,{}),(0,K.jsx)(`div`,{className:RZ.container,children:(0,K.jsx)(jr.Provider,{value:me,children:ne})}),te.footer]})})})})}):null]})}WZ.displayName=`SelectPanel`;var GZ=G(WZ);const KZ={root:`select-panel-loading`,text:`select-panel-loading-text`};function qZ(e,t){let{className:n,children:r=`Fetching items...`,...i}=e;return(0,K.jsxs)(`div`,{ref:t,role:`status`,"aria-live":`polite`,className:W(KZ.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,K.jsx)(ei,{size:`medium`,srText:null,role:`presentation`}),(0,K.jsx)(`span`,{className:KZ.text,children:r})]})}qZ.displayName=`SelectPanel.Loading`;var JZ=G(qZ);const YZ={full:`select-panel-message-full`,fullIcon:`select-panel-message-full-icon`,fullTitle:`select-panel-message-full-title`,fullContent:`select-panel-message-full-content`,inline:`select-panel-message-inline`,inlineIcon:`select-panel-message-inline-icon`,variant:{warning:`select-panel-message-warning`,error:`select-panel-message-error`,empty:``},inlineVariant:{warning:`select-panel-message-inline-warning`,error:`select-panel-message-inline-error`,empty:``}};function XZ(e,t){let{className:n,children:r,variant:i,size:a,title:o,...s}=e,c=a??(i===`empty`?`full`:`inline`),l=i===`empty`?void 0:{role:`status`,"aria-live":`polite`};return c===`full`?(0,K.jsxs)(`div`,{ref:t,className:W(YZ.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,K.jsx)(er,{className:W(YZ.fullIcon,YZ.variant[i]),"aria-hidden":`true`}),(0,K.jsx)(`span`,{className:YZ.fullTitle,children:o}),(0,K.jsx)(`span`,{className:YZ.fullContent,children:r})]}):(0,K.jsxs)(`div`,{ref:t,className:W(YZ.inline,YZ.variant[i],YZ.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,K.jsx)(er,{className:YZ.inlineIcon,"aria-hidden":`true`}),(0,K.jsx)(`div`,{children:r})]})}XZ.displayName=`SelectPanel.Message`;var ZZ=G(XZ);const QZ={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},$Z=e=>{let{id:t,children:n,className:r,...i}=e,a=J(t);return(0,K.jsxs)(`span`,{className:QZ.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,K.jsx)(Xd,{id:a,className:W(QZ.box,r),...i}),(0,K.jsx)(`label`,{htmlFor:a,className:QZ.small,children:n})]})};function eQ(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,K.jsx)($Z,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,K.jsx)(Xc,{className:W(QZ.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,K.jsx)(mi,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}eQ.displayName=`SelectPanel.SecondaryAction`;const tQ=Object.assign(GZ,{Button:EZ,Header:LZ,SearchInput:NZ,Footer:AZ,SecondaryAction:eQ,Loading:JZ,Message:ZZ}),nQ=U(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function rQ(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,variant:a=`default`,...o}=e;return(0,K.jsx)(n,{ref:t,role:`separator`,"aria-orientation":i,className:W(nQ({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}rQ.displayName=`Separator`;var iQ=G(rQ);const aQ=U(`skeleton-avatar`,{variants:{shape:{circle:`skeleton-avatar-circle`,square:`skeleton-avatar-square`},responsive:{true:`skeleton-avatar-responsive`,false:``}}});function oQ({size:e=20,shape:t=`circle`,className:n,style:r,...i}){let a=ds(e),o={"--avatar-size-regular":`20px`};if(a)for(let[t,n]of Object.entries(e))n!==void 0&&(o[`--avatar-size-${t}`]=`${n}px`);else o[`--avatar-size-regular`]=`${e}px`;return(0,K.jsx)($g,{width:`var(--avatar-size-regular)`,height:`var(--avatar-size-regular)`,className:W(aQ({shape:t,responsive:a}),n),style:{...r,...o},...i,"data-component":`SkeletonAvatar`,"data-responsive":a||void 0,"data-shape":t})}oQ.displayName=`SkeletonAvatar`;const sQ=U(`slider`,{variants:{size:{small:`slider-small`,medium:`slider-medium`,large:`slider-large`},orientation:{horizontal:`slider-horizontal`,vertical:`slider-vertical`},block:{true:``,false:``}},compoundVariants:[{block:!0,orientation:`horizontal`,class:`slider-block-horizontal`},{block:!0,orientation:`vertical`,class:`slider-block-vertical`}]}),cQ=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function lQ(e,t){let{className:n,style:r,size:i=`medium`,orientation:a=`horizontal`,block:o,min:s=0,max:c=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=e,g=d!==void 0,[_,v]=l.useState(()=>f??s),y=g?d:_;return(0,K.jsx)(`input`,{ref:t,type:`range`,min:s,max:c,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:W(sQ({size:i,orientation:a,block:o}),n),style:{...r,"--slider-fill":`${cQ(y,s,c)}%`},"aria-orientation":a===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":i,"data-orientation":a,"data-block":o,"data-disabled":p,...h})}lQ.displayName=`Slider`;var uQ=G(lQ);const dQ={root:`splitter`};function fQ(e,t){let{className:n,orientation:r=`horizontal`,splitterRef:i,...a}=e;return(0,K.jsx)(F.Group,{elementRef:t,groupRef:i,orientation:r,className:W(dQ.root,n),"data-component":`Splitter`,"data-orientation":r,...a})}fQ.displayName=`Splitter`;var pQ=G(fQ);const mQ={root:`splitter-panel`};function hQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(F.Panel,{elementRef:t,className:W(mQ.root,n),"data-component":`Splitter.Panel`,...r})}hQ.displayName=`Splitter.Panel`;var gQ=G(hQ);const _Q={root:`splitter-resize-trigger`};function vQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(F.Separator,{elementRef:t,className:W(_Q.root,n),"data-component":`Splitter.ResizeTrigger`,...r})}vQ.displayName=`Splitter.ResizeTrigger`;var yQ=G(vQ);const bQ={root:`splitter-resize-trigger-indicator`};function xQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(bQ.root,n),"data-component":`Splitter.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}xQ.displayName=`Splitter.ResizeTriggerIndicator`;var SQ=G(xQ);const CQ={root:`splitter-resize-trigger-separator`};function wQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(CQ.root,n),"data-component":`Splitter.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}wQ.displayName=`Splitter.ResizeTriggerSeparator`;var TQ=G(wQ);const EQ=Object.assign(pQ,{Panel:gQ,ResizeTrigger:yQ,ResizeTriggerSeparator:TQ,ResizeTriggerIndicator:SQ}),DQ={open:`open`,issueOpened:`open`,pullOpened:`open`,alertOpened:`open`,closed:`done`,issueClosed:`done`,pullMerged:`done`,alertFixed:`done`,pullClosed:`closed`,alertClosed:`closed`,issueClosedNotPlanned:`neutral`,unavailable:`neutral`,archived:`neutral`,pullQueued:`attention`,draft:`draft`,issueDraft:`draft`,alertDismissed:`draft`},OQ={open:null,closed:null,draft:fn,archived:Wt,unavailable:er,issueOpened:In,issueClosed:on,issueClosedNotPlanned:Fn,issueDraft:fn,pullOpened:rn,pullClosed:vn,pullMerged:jn,pullQueued:hn,alertOpened:Hn,alertClosed:Vn,alertFixed:zn,alertDismissed:Bn},kQ={open:``,closed:``,draft:`Pull request`,archived:`Archived`,unavailable:``,issueOpened:`Issue`,issueClosed:`Issue`,issueClosedNotPlanned:`Issue, not planned`,issueDraft:`Issue`,pullOpened:`Pull request`,pullClosed:`Pull request`,pullMerged:`Pull request`,pullQueued:`Pull request`,alertOpened:`Alert`,alertClosed:`Alert`,alertFixed:`Alert`,alertDismissed:`Alert`},AQ=U(`state-label`,{variants:{size:{small:`state-label-small`,medium:`state-label-medium`},tone:{open:`state-label-open`,closed:`state-label-closed`,done:`state-label-done`,draft:`state-label-draft`,attention:`state-label-attention`,neutral:`state-label-neutral`}}}),jQ=U(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function MQ(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=OQ[i],l=kQ[i];return(0,K.jsxs)(n,{ref:t,className:W(AQ({size:a,tone:DQ[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,K.jsx)(c,{className:W(jQ({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}MQ.displayName=`StateLabel`;var NQ=G(MQ);const PQ=(0,l.createContext)({}),FQ={root:`statistic-card-description`};function IQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(FQ.root,n),"data-component":`StatisticCard.Description`,...r})}IQ.displayName=`StatisticCard.Description`;var LQ=G(IQ);const RQ={root:`statistic-card-label`};function zQ(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(PQ);return(0,K.jsx)(`span`,{ref:t,id:r??a,className:W(RQ.root,n),"data-component":`StatisticCard.Label`,...i})}zQ.displayName=`StatisticCard.Label`;var BQ=G(zQ);const VQ={root:`statistic-card-trailing-visual`};function HQ(e,t){let{className:n,"aria-label":r,...i}=e;return(0,K.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:W(VQ.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}HQ.displayName=`StatisticCard.TrailingVisual`;var UQ=G(HQ);const WQ={hidden:`sr-only`},GQ={increase:tn,decrease:Kt,neutral:Un},KQ={increase:`Up`,decrease:`Down`,neutral:`No change`},qQ={increase:`positive`,decrease:`negative`,neutral:`neutral`},JQ=U(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function YQ(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=GQ[i],c=a??qQ[i];return(0,K.jsxs)(`span`,{ref:t,className:W(JQ({sentiment:c}),n),"data-component":`StatisticCard.Trend`,"data-direction":i,"data-sentiment":c,...o,children:[(0,K.jsx)(s,{"aria-hidden":!0}),(0,K.jsx)(`span`,{className:WQ.hidden,children:KQ[i]}),r]})}YQ.displayName=`StatisticCard.Trend`;var XQ=G(YQ);const ZQ={root:`statistic-card-value`};function QQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(ZQ.root,n),"data-component":`StatisticCard.Value`,...r})}QQ.displayName=`StatisticCard.Value`;var $Q=G(QQ);const e$={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function t$(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${J(i)}-label`,[l,u]=Sr(r,{trailingVisual:UQ,label:BQ,value:$Q,trend:XQ,description:LQ}),d=o??(l.label&&!a?c:void 0);return(0,K.jsx)(PQ.Provider,{value:{labelId:c},children:(0,K.jsxs)(`div`,{ref:t,id:i,role:d||a?`group`:void 0,"aria-label":a,"aria-labelledby":d,className:W(e$.root,n),"data-component":`StatisticCard`,...s,children:[(0,K.jsxs)(`div`,{className:e$.body,children:[l.label,l.value||l.trend?(0,K.jsxs)(`div`,{className:e$.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}t$.displayName=`StatisticCard`;var n$=G(t$);const r$=Object.assign(n$,{Label:BQ,Value:$Q,Trend:XQ,Description:LQ,TrailingVisual:UQ}),i$=(0,l.createContext)({}),a$={srOnly:`sr-only`},o$=U(`status`,{variants:{variant:{accent:`status-accent`,success:`status-success`,attention:`status-attention`,severe:`status-severe`,danger:`status-danger`,done:`status-done`,neutral:`status-neutral`},size:{small:`status-small`,medium:`status-medium`,large:`status-large`}}});function s$(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,K.jsx)(i$.Provider,{value:{variant:i,size:a},children:(0,K.jsxs)(n,{ref:t,className:W(o$({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,K.jsx)(`span`,{className:a$.srOnly,children:o}):null,s]})})}s$.displayName=`Status`;var c$=G(s$);const l$=U(`status-indicator`,{variants:{variant:{accent:`status-indicator-accent`,success:`status-indicator-success`,attention:`status-indicator-attention`,severe:`status-indicator-severe`,danger:`status-indicator-danger`,done:`status-indicator-done`,neutral:`status-indicator-neutral`},size:{small:`status-indicator-small`,medium:`status-indicator-medium`,large:`status-indicator-large`}}});function u$(e,t){let{className:n,variant:r,size:i,...a}=e,o=l.useContext(i$),s=r??o.variant??`neutral`,c=i??o.size??`medium`;return(0,K.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:W(l$({variant:s,size:c}),n),"data-component":`Status.Indicator`,"data-variant":s,"data-size":c,...a})}u$.displayName=`Status.Indicator`;var d$=G(u$);const f$=Object.assign(c$,{Indicator:d$}),p$=(0,l.createContext)(null),m$=U(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),h$=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),g$=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function _$(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=h$(r);return(0,K.jsx)(`ol`,{ref:t,role:`list`,className:W(m$({orientation:a,size:o}),n),"data-component":`Steps`,"data-orientation":a,"data-size":o,"data-count":c.length,...s,children:c.map((e,t)=>(0,K.jsx)(p$.Provider,{value:{index:t,status:g$(t,i)},children:e},e.key))})}_$.displayName=`Steps`;var v$=G(_$);const y$={root:`steps-body`};function b$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(y$.root,n),"data-component":`Steps.Body`,...r})}b$.displayName=`Steps.Body`;var x$=G(b$);const S$={root:`steps-description`};function C$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(S$.root,n),"data-component":`Steps.Description`,...r})}C$.displayName=`Steps.Description`;var w$=G(C$);const T$=()=>{let e=(0,l.useContext)(p$);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},E$={root:`steps-indicator`,icon:`steps-indicator-icon`};function D$(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=T$();return(0,K.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:W(E$.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,K.jsx)(sn,{className:E$.icon}):a+1)})}D$.displayName=`Steps.Indicator`;var O$=G(D$);const k$={root:`steps-item`,status:`sr-only`},A$={complete:`Completed`,current:``,incomplete:`Not completed`};function j$(e,t){let{className:n,children:r,status:i,statusLabel:a,...o}=e,{index:s,status:c}=T$(),u=i??c,d=a??A$[u],f=l.useMemo(()=>({index:s,status:u}),[s,u]);return(0,K.jsx)(p$.Provider,{value:f,children:(0,K.jsxs)(`li`,{ref:t,"aria-current":u===`current`?`step`:void 0,className:W(k$.root,n),"data-component":`Steps.Item`,"data-status":u,"data-index":s,...o,children:[r,d?(0,K.jsx)(`span`,{className:k$.status,children:d}):null]})})}j$.displayName=`Steps.Item`;var M$=G(j$);const N$={root:`steps-title`};function P$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(N$.root,n),"data-component":`Steps.Title`,...r})}P$.displayName=`Steps.Title`;var F$=G(P$);const I$=Object.assign(v$,{Item:M$,Indicator:O$,Body:x$,Title:F$,Description:w$}),L$=(0,l.createContext)({}),R$=U(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function z$(e,t){let{as:n=`span`,className:r,swap:i=!1,transition:a=`fade`,children:o,...s}=e,c=l.useMemo(()=>({swap:i}),[i]);return(0,K.jsx)(L$.Provider,{value:c,children:(0,K.jsx)(n,{ref:t,className:W(R$({transition:a}),r),"data-component":`Swap`,"data-swap":i?`on`:`off`,"data-transition":a,...s,children:o})})}z$.displayName=`Swap`;var B$=G(z$);const V$={root:`swap-indicator`,active:`swap-indicator-active`};function H$(e,t){let{as:n=`span`,className:r,type:i,...a}=e,{swap:o}=l.useContext(L$),s=i===(o?`on`:`off`);return(0,K.jsx)(n,{ref:t,"aria-hidden":s?void 0:`true`,className:W(V$.root,s&&V$.active,r),"data-component":`Swap.Indicator`,"data-type":i,"data-active":s,...a})}H$.displayName=`Swap.Indicator`;var U$=G(H$);const W$=Object.assign(B$,{Indicator:U$}),G$={root:`table-of-contents`};function K$(e,t){let{className:n,"aria-label":r,"aria-labelledby":i,...a}=e;return(0,K.jsx)(`nav`,{ref:t,"aria-label":r||i?r:`Table of contents`,"aria-labelledby":i,className:W(G$.root,n),"data-component":`TableOfContents`,...a})}K$.displayName=`TableOfContents`;var q$=G(K$);const J$={root:`table-of-contents-list`};function Y$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`ul`,{ref:t,role:`list`,className:W(J$.root,n),"data-component":`TableOfContents.List`,...r})}Y$.displayName=`TableOfContents.List`;var X$=G(Y$);const Z$={root:`table-of-contents-group`,label:`table-of-contents-group-label`,link:`table-of-contents-link`,active:`table-of-contents-link-active`,list:`table-of-contents-group-list`};function Q$(e,t){let{label:n,href:r,active:i=!1,className:a,children:o,onClick:s,...c}=e;return(0,K.jsxs)(`li`,{ref:t,className:W(Z$.root,a),"data-component":`TableOfContents.Group`,...c,children:[r?(0,K.jsx)(`a`,{href:r,onClick:s,"aria-current":i?`true`:void 0,className:W(Z$.link,i&&Z$.active),"data-component":`TableOfContents.Group.Label`,children:n}):(0,K.jsx)(`p`,{className:Z$.label,"data-component":`TableOfContents.Group.Label`,children:n}),(0,K.jsx)(X$,{className:Z$.list,children:o})]})}Q$.displayName=`TableOfContents.Group`;var $$=G(Q$);const e1={item:`table-of-contents-item`,link:`table-of-contents-link`,active:`table-of-contents-link-active`};function t1(e,t){let{as:n=`a`,active:r=!1,className:i,...a}=e;return(0,K.jsx)(`li`,{className:e1.item,children:(0,K.jsx)(n,{ref:t,"aria-current":r?`true`:void 0,className:W(e1.link,r&&e1.active,i),"data-component":`TableOfContents.Item`,...a})})}t1.displayName=`TableOfContents.Item`;var n1=G(t1);const r1={root:`table-of-contents-title`};function i1(e,t){let{as:n=`p`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(r1.root,r),"data-component":`TableOfContents.Title`,...i})}i1.displayName=`TableOfContents.Title`;var a1=G(i1);const o1=({ids:e,offset:t=0,root:n=null,trackHash:r=!0})=>{let[i,a]=l.useState(null),o=l.useRef(!1),s=e.join(`\0`);l.useEffect(()=>{if(typeof IntersectionObserver>`u`)return;let e=s.split(`\0`).map(e=>document.getElementById(e)).filter(e=>e!==null);if(e.length===0)return;let r=new Set,i=new IntersectionObserver(t=>{for(let e of t)e.isIntersecting?r.add(e.target):r.delete(e.target);let n=e.find(e=>r.has(e));n&&!o.current&&a(n.id)},{root:n,rootMargin:`-${t}px 0px 0px 0px`});for(let t of e)i.observe(t);return()=>{i.disconnect()}},[s,t,n]);let c=l.useRef(void 0),u=l.useRef(null),d=l.useCallback(e=>{u.current?.(),o.current=!0,a(e);let t=n??window,r=()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>{u.current?.(),o.current=!1},150)};t.addEventListener(`scroll`,r,{passive:!0}),u.current=()=>{window.clearTimeout(c.current),t.removeEventListener(`scroll`,r),u.current=null},r()},[n]);return l.useEffect(()=>()=>u.current?.(),[]),l.useEffect(()=>{if(!r)return;let e=new Set(s.split(`\0`)),t=()=>{let t=decodeURIComponent(window.location.hash.slice(1));t&&e.has(t)&&d(t)};return t(),window.addEventListener(`hashchange`,t),()=>{window.removeEventListener(`hashchange`,t)}},[r,s,d]),{activeId:i,selectSection:d}},s1=Object.assign(q$,{Title:a1,List:X$,Item:n1,Group:$$}),c1=(0,l.createContext)(null);function l1(e){let{children:t,id:n,value:r,defaultValue:i,onChange:a}=e,o=J(n),s=r!==void 0,[c,u]=l.useState(i),d=s?r:c,f=l.useRef(a);Vi(()=>{f.current=a},[a]);let p=l.useMemo(()=>({groupId:o,selectedValue:d,selectTab:e=>{s||u(e),f.current?.(e)}}),[o,d,s]);return(0,K.jsx)(c1.Provider,{value:p,children:t})}l1.displayName=`Tabs`;const u1=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},d1=()=>{let e=(0,l.useContext)(c1);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},f1=e=>{let{value:t,disabled:n}=e,r=d1(),i=r.selectedValue===t;return{selected:i,tabProps:{id:`${r.groupId}-tab-${t}`,role:`tab`,"aria-controls":`${r.groupId}-panel-${t}`,"aria-selected":i,"aria-disabled":n?!0:void 0,tabIndex:i?0:-1,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&r.selectTab(t)},onMouseDown:e=>{if(n||e.button!==0||e.ctrlKey){e.preventDefault();return}r.selectTab(t)},onFocus:()=>{!i&&!n&&r.selectTab(t)}}}},p1={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function m1(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=f1({value:r,disabled:i});return(0,K.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:u1(a,u.onKeyDown),onMouseDown:u1(o,u.onMouseDown),onFocus:u1(s,u.onFocus),className:W(p1.root,p1.vertical,p1.hover,l&&p1.selected,i&&p1.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}m1.displayName=`Tabs.Tab`;var h1=G(m1);const g1=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),_1=e=>{let{"aria-label":t,"aria-labelledby":n,"aria-orientation":r,ref:i}=e,a=l.useRef(null),o=B(i,a),s=r??`horizontal`;return{tabListProps:{ref:o,role:`tablist`,"aria-label":t,"aria-labelledby":n,"aria-orientation":s,onKeyDown:e=>{let t=a.current;if(!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,o=e.key===`Home`||e.key===`End`,c=e.key===r?1:e.key===i?-1:0;if(c===0&&!o)return;e.preventDefault(),e.stopPropagation();let l=g1(t);if(l.length===0)return;if(o){l[e.key===`Home`?0:l.length-1].focus();return}let u=l.findIndex(e=>e.getAttribute(`aria-selected`)===`true`);l[u===-1?0:(u+c+l.length)%l.length].focus()}}}},v1={root:`tab-list`,vertical:`tab-list-vertical`};function y1(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=_1({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,K.jsx)(`div`,{...s,...c,onKeyDown:u1(r,c.onKeyDown),className:W(v1.root,l&&v1.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}y1.displayName=`Tabs.List`;var b1=G(y1);const x1=e=>{let{value:t}=e,n=d1(),r=n.selectedValue===t;return{tabPanelProps:{id:`${n.groupId}-panel-${t}`,role:`tabpanel`,"aria-labelledby":`${n.groupId}-tab-${t}`,hidden:!r,"data-selected":r?``:void 0}}};function S1(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=x1({value:r});return(0,K.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}S1.displayName=`Tabs.Panel`;var C1=G(S1);const w1=Object.assign(l1,{List:b1,Tab:h1,Panel:C1}),T1={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},E1=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function D1(e,t){let{className:n,clipSidebar:r,...i}=e,a=E1(r);return(0,K.jsx)(`ol`,{ref:t,role:`list`,className:W(T1.root,(a===`start`||a===`both`)&&T1.clipStart,(a===`end`||a===`both`)&&T1.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}D1.displayName=`Timeline`;var O1=G(D1);const k1={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function A1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(k1.root,k1.narrow,n),"data-component":`Timeline.Actions`,...r})}A1.displayName=`Timeline.Actions`;var j1=G(A1);const M1={root:`timeline-avatar`};function N1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(M1.root,n),"data-component":`Timeline.Avatar`,...r})}N1.displayName=`Timeline.Avatar`;var P1=G(N1);const F1={wrapper:`timeline-badge-wrapper`},I1=U(`timeline-badge`,{variants:{variant:{accent:`timeline-badge-accent`,success:`timeline-badge-success`,attention:`timeline-badge-attention`,severe:`timeline-badge-severe`,danger:`timeline-badge-danger`,done:`timeline-badge-done`,open:`timeline-badge-open`,closed:`timeline-badge-closed`,sponsors:`timeline-badge-sponsors`}}});function L1(e,t){let{className:n,variant:r,...i}=e;return(0,K.jsx)(`div`,{className:F1.wrapper,children:(0,K.jsx)(`div`,{ref:t,className:W(I1({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}L1.displayName=`Timeline.Badge`;var R1=G(L1);const z1={root:`timeline-body`};function B1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(z1.root,n),"data-component":`Timeline.Body`,...r})}B1.displayName=`Timeline.Body`;var V1=G(B1);const H1={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function U1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`li`,{ref:t,role:`presentation`,className:W(H1.root,H1.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}U1.displayName=`Timeline.Break`;var W1=G(U1);const G1={root:`timeline-item`,rail:`timeline-item-rail`,condensed:`timeline-item-condensed`,condensedBadge:`timeline-item-condensed-badge`,condensedAvatar:`timeline-item-condensed-avatar`,narrow:`timeline-item-narrow`};function K1(e,t){let{className:n,condensed:r,...i}=e;return(0,K.jsx)(`li`,{ref:t,className:W(G1.root,G1.rail,G1.narrow,r&&G1.condensed,r&&G1.condensedBadge,r&&G1.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}K1.displayName=`Timeline.Item`;var q1=G(K1);const J1=Object.assign(O1,{Item:q1,Avatar:P1,Badge:R1,Body:V1,Break:W1,Actions:j1});let Y1=[],X1=0;const Z1=new Set,Q1=()=>{for(let e of Z1)e()},$1=e=>(Z1.add(e),()=>{Z1.delete(e)}),e0=()=>Y1,t0=[],n0=()=>t0,r0=e=>(Y1=Y1.some(t=>t.id===e.id)?Y1.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...Y1],Q1(),e.id),i0=e=>(Y1=Y1.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),Q1(),e),a0=e=>{Y1=Y1.filter(t=>t.id!==e),Q1()},o0=()=>`toast-${++X1}`,s0=(e,t,n={})=>r0({...n,id:n.id??o0(),title:t,variant:e}),c0=(e,t)=>typeof e==`function`?e(t):e,l0=(e,t,n={})=>{let r=n.id??o0();s0(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){i0(r);return}s0(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,c0(t.success,e)),e=>i(`error`,c0(t.error,e))),r},u0=(e,t)=>s0(`default`,e,t),d0=Object.assign(u0,{message:u0,success:(e,t)=>s0(`success`,e,t),error:(e,t)=>s0(`error`,e,t),warning:(e,t)=>s0(`warning`,e,t),info:(e,t)=>s0(`info`,e,t),loading:(e,t)=>s0(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>r0({...t,id:t.id??o0(),variant:`default`,render:e}),promise:l0,dismiss:i0,getToasts:e0}),f0={root:`toast`,animated:`motion-safe:[transition:transform_var(--motion-transition-state-change),opacity_var(--motion-transition-state-change),height_var(--motion-transition-state-change)]`,grabbable:`toast-grabbable`,lift:{top:`toast-lift-top`,bottom:`toast-lift-bottom`},bridge:`toast-bridge`,bridgeTop:`toast-bridge-top`,bridgeBottom:`toast-bridge-bottom`,card:`toast-card`,iconColor:{default:``,success:`toast-icon-success`,error:`toast-icon-error`,warning:`toast-icon-warning`,info:`toast-icon-info`,loading:``},richColors:{default:``,success:`toast-rich-success`,error:`toast-rich-error`,warning:`toast-rich-warning`,info:`toast-rich-info`,loading:``},hidden:`opacity-0`,waiting:`pointer-events-none`,dragging:`select-none`,body:`toast-body motion-safe:[transition:opacity_var(--motion-transition-state-change)]`,bodyStacked:`opacity-0`,icon:`toast-icon`,content:`toast-content`,title:`toast-title`,description:`toast-description`,actions:`toast-actions`},p0={default:null,success:on,error:xn,warning:er,info:Dn,loading:null},m0=e=>typeof e==`object`&&!!e&&`label`in e&&!l.isValidElement(e);function h0(e){let{toast:t,place:n,position:r,height:i,frontHeight:a,stackSize:o,expanded:s,visible:c,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=e,{id:h,variant:g,title:_,description:v,render:y}=t,b=t.duration??p.duration,x=t.dismissible??p.dismissible,S=t.closeButton??p.closeButton,C=t.richColors??p.richColors,w=t.important??p.important??!1,T=l.useRef(null),[E,D]=l.useState(!1),[O,k]=l.useState({x:0,y:0}),[A,j]=l.useState(!1),[M,N]=l.useState(!1),P=l.useRef(null),F=!!t.dismissed,I=n.index===0,L=E&&!s&&!I,ee=!!y,R=r.startsWith(`top`)?`top`:`bottom`,z=e=>{t.dismissed||(i0(h),e===`timeout`?t.onAutoClose?.(t):t.onDismiss?.(t))};l.useEffect(()=>{D(!0)},[]);let B=l.useRef({revision:-1,time:b});l.useEffect(()=>{if(B.current.revision!==t.revision&&(B.current={revision:t.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),n=window.setTimeout(()=>z(`timeout`),Math.max(B.current.time,0));return()=>{window.clearTimeout(n),B.current.time-=Date.now()-e}},[t,b,u,F]),l.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>a0(h),200);return()=>{window.clearTimeout(e)}},[F,h]),Vi(()=>{let e=T.current;if(!e)return;let t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,m(h,n)},[m,h,t.revision,_,v,s]);let te=e=>d.includes(e),ne=(e,t,n)=>e<0?te(t)?e:0:te(n)?e:0,re=e=>{!x||e.button!==0||e.target.closest(`button`)||(P.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture?.(e.pointerId),j(!0))},ie=e=>{let t=P.current;!t||t.pointerId!==e.pointerId||k({x:ne(e.clientX-t.x,`left`,`right`),y:ne(e.clientY-t.y,`top`,`bottom`)})},ae=e=>{let t=P.current;if(!t||t.pointerId!==e.pointerId)return;if(P.current=null,j(!1),Math.max(Math.abs(O.x),Math.abs(O.y))<45){k({x:0,y:0});return}let n=e.currentTarget.getBoundingClientRect(),r=(e,t)=>e===0?0:Math.sign(e)*(t+32);k({x:r(O.x,n.width),y:r(O.y,n.height)}),N(!0),z(`swipe`)},oe=()=>{P.current=null,j(!1),k({x:0,y:0})},se=s?`calc(var(--toast-lift) * var(--toast-offset))`:`calc(var(--toast-lift) * var(--toaster-gap) * var(--toast-index))`,ce=`calc(var(--toast-lift) * -100%)`,le={"--toast-index":n.index,"--toast-offset":`${n.offset}px`,"--toast-z-index":o-n.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?a:i),"--toast-shift":E?!F||M?se:I?ce:s?`calc(${se} + ${ce})`:se:ce,"--toast-scale":L?Math.max(1-n.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},ue=p0[g],de=t.icon===void 0?f?.[g]:t.icon,fe=de===void 0?g===`loading`?(0,K.jsx)(ei,{size:`small`,srText:null}):ue?(0,K.jsx)(ue,{}):null:de,pe=(e,t,n)=>m0(e)?(0,K.jsx)(mi,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||z(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,me=t.action!==void 0||t.cancel!==void 0;return(0,K.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:W(f0.root,f0.lift[R],f0.bridge,R===`top`?f0.bridgeTop:f0.bridgeBottom,x&&f0.grabbable,!ee&&f0.card,!ee&&f0.iconColor[g],!ee&&C&&f0.richColors[g],(!E||F||!c)&&f0.hidden,!c&&f0.waiting,A?f0.dragging:f0.animated,p.className,t.className),style:le,"data-component":`Toast`,"data-variant":g,"data-position":r,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":s,"data-stacked":L,"data-visible":c,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:ie,onPointerUp:ae,onPointerCancel:oe,children:ee?y?.(t):(0,K.jsxs)(`div`,{className:W(f0.body,L&&f0.bodyStacked),"data-component":`Toast.Body`,children:[fe===null?null:(0,K.jsx)(`span`,{className:f0.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:fe}),(0,K.jsxs)(`div`,{className:f0.content,"data-component":`Toast.Content`,children:[(0,K.jsx)(`div`,{className:f0.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,K.jsx)(`div`,{className:f0.description,"data-component":`Toast.Description`,children:v})]}),me?(0,K.jsxs)(`div`,{className:f0.actions,"data-component":`Toast.Actions`,children:[pe(t.cancel,`cancel`,`invisible`),pe(t.action,`action`,`default`)]}):null,S&&x?(0,K.jsx)(_i,{icon:yn,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>z(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}h0.displayName=`Toast`;const g0=U(`toaster z-popover`,{variants:{position:{"top-left":`toaster-top-left`,"top-center":`toaster-top-center`,"top-right":`toaster-top-right`,"bottom-left":`toaster-bottom-left`,"bottom-center":`toaster-bottom-center`,"bottom-right":`toaster-bottom-right`}}}),_0=[`altKey`,`KeyT`],v0=e=>typeof e==`number`?`${e}px`:e,y0=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},b0=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),x0=()=>document.visibilityState===`hidden`,S0=()=>!1;function C0(e,t){let{position:n=`bottom-right`,expand:r=!1,visibleToasts:i=3,toastOptions:a,duration:o=4e3,closeButton:s=!1,richColors:c=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=_0,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=e,x=l.useSyncExternalStore($1,e0,n0),S=l.useSyncExternalStore(b0,x0,S0),C=l.useRef(null),w=B(t,C),[T,E]=l.useState({}),[D,O]=l.useState(!1),k=r||D,A=l.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);l.useEffect(()=>{E(e=>{let t=Object.keys(e).filter(e=>x.some(t=>t.id===e));return t.length===Object.keys(e).length?e:Object.fromEntries(t.map(t=>[t,e[t]]))})},[x]);let j=x.filter(e=>!e.dismissed),M=new Map,N=0;j.forEach((e,t)=>{M.set(e.id,{index:t,offset:N}),N+=(T[e.id]??0)+u});let P=l.useRef(M);for(let e of x)if(!M.has(e.id)){let t=P.current.get(e.id);t&&M.set(e.id,t)}P.current=M;let F=j.length>0?T[j[0].id]??0:0;l.useEffect(()=>{let e=e=>{let t=C.current,n=t!==null&&(document.activeElement===t||t.contains(document.activeElement));if(e.code===`Escape`&&n){O(!1);return}m.every(t=>!!e[t]||e.code===t)&&(O(!0),C.current?.focus())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[m]);let I={duration:o,closeButton:s,richColors:c,dismissible:!0,...a},L=h??y0(n);return(0,K.jsx)(na,{children:(0,K.jsx)(`section`,{"aria-label":_,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,tabIndex:-1,"data-component":`Toaster.Region`,children:(0,K.jsx)(`ol`,{ref:w,tabIndex:-1,className:W(g0({position:n}),v),style:{...y,"--toaster-width":v0(p),"--toaster-viewport-offset":v0(d),"--toaster-mobile-offset":v0(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":n,"data-expanded":k,onPointerEnter:()=>O(!0),onPointerLeave:()=>O(!1),onFocus:()=>O(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||O(!1)},...b,children:x.map(e=>{let t=M.get(e.id)??{index:0,offset:0};return(0,K.jsx)(h0,{toast:e,place:t,position:n,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<i,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}C0.displayName=`Toaster`;var w0=G(C0);const T0=2e3,E0={content:`toggle-switch-content`,srOnly:`sr-only`},D0=`toggle-switch-icon`,O0=U(`toggle-switch`,{variants:{statusLabelPosition:{start:`toggle-switch-label-start`,end:`toggle-switch-label-end`}}}),k0=U(`toggle-switch-status`,{variants:{statusLabelPosition:{start:``,end:`toggle-switch-status-end`}}}),A0=U(`toggle-switch-status-label`,{variants:{size:{small:`toggle-switch-status-label-small`,medium:`toggle-switch-status-label-medium`},disabled:{true:`toggle-switch-status-label-disabled`,false:``}}}),j0=U(`toggle-switch-status-text`,{variants:{hidden:{true:`toggle-switch-status-text-hidden`,false:``}}}),M0=U(`toggle-switch-track`,{variants:{size:{small:`toggle-switch-track-small`,medium:`toggle-switch-track-medium`},track:{off:`toggle-switch-track-off`,on:`toggle-switch-track-on`,disabled:`toggle-switch-track-disabled`}}}),N0=U(D0,{variants:{disabled:{true:`toggle-switch-circle-icon-disabled`,false:`toggle-switch-circle-icon`},checked:{true:`translate-x-0`,false:`-translate-x-full`}}}),P0=U(D0,{variants:{disabled:{true:`toggle-switch-line-icon-disabled`,false:`toggle-switch-line-icon`},checked:{true:`translate-x-full`,false:`translate-x-0`}}}),F0=U(`toggle-switch-knob`,{variants:{checked:{true:`toggle-switch-knob-checked`,false:`translate-x-0`},disabled:{true:`toggle-switch-knob-disabled`,false:``}}}),I0={small:12,medium:16},L0=({size:e})=>(0,K.jsx)(`svg`,{"aria-hidden":`true`,width:I0[e],height:I0[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{fillRule:`evenodd`,d:`M8 12.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Z`})}),R0=({size:e})=>(0,K.jsx)(`svg`,{"aria-hidden":`true`,width:I0[e],height:I0[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{fillRule:`evenodd`,d:`M8 2a.75.75 0 0 1 .75.75v11.5a.75.75 0 0 1-1.5 0V2.75A.75.75 0 0 1 8 2Z`})});function z0(e,t){let{className:n,checked:r,defaultChecked:i,disabled:a,loading:o,onChange:s,onClick:c,size:u=`medium`,statusLabelPosition:d=`start`,buttonType:f=`button`,loadingLabel:p=`Loading`,loadingLabelDelay:m=T0,buttonLabelOn:h=`On`,buttonLabelOff:g=`Off`,"aria-labelledby":_,"aria-describedby":v,...y}=e,b=r!==void 0,[x,S]=l.useState(!!i),C=b?r:x,w=!a&&!o,T=`${J()}-loading-label`,[E,D]=l.useState(!1);l.useEffect(()=>{if(!o){D(!1);return}let e=window.setTimeout(()=>{D(!0)},m);return()=>{window.clearTimeout(e)}},[o,m]);let O=e=>{w&&(b||S(!C),s?.(!C),c?.(e))},k=[E?T:void 0,v].filter(Boolean).join(` `);return(0,K.jsxs)(`div`,{className:W(O0({statusLabelPosition:d}),n),"data-component":`ToggleSwitch`,"data-size":u,"data-status-label-position":d,"data-checked":C,"data-disabled":!w,"data-loading":o?`true`:void 0,...y,children:[(0,K.jsx)(`span`,{id:T,role:`status`,className:E0.srOnly,children:E?p:``}),o?(0,K.jsx)(`span`,{className:W(k0({statusLabelPosition:d})),"data-component":`ToggleSwitch.LoadingSpinner`,children:(0,K.jsx)(ei,{size:`small`,srText:null,role:`presentation`})}):null,(0,K.jsxs)(`span`,{className:W(A0({size:u,disabled:!w})),"aria-hidden":`true`,onClick:O,"data-component":`ToggleSwitch.StatusText`,children:[(0,K.jsx)(`span`,{className:W(j0({hidden:!C})),children:h}),(0,K.jsx)(`span`,{className:W(j0({hidden:C})),children:g})]}),(0,K.jsxs)(`button`,{ref:t,type:f,className:W(M0({size:u,track:w?C?`on`:`off`:`disabled`})),onClick:O,"aria-labelledby":_,"aria-describedby":k||void 0,"aria-pressed":C,"aria-disabled":!w,"data-component":`ToggleSwitch.SwitchButton`,children:[(0,K.jsxs)(`span`,{className:E0.content,"aria-hidden":`true`,children:[(0,K.jsx)(`span`,{className:W(N0({disabled:!w,checked:C})),"data-component":`ToggleSwitch.LineIcon`,children:(0,K.jsx)(R0,{size:u})}),(0,K.jsx)(`span`,{className:W(P0({disabled:!w,checked:C})),"data-component":`ToggleSwitch.CircleIcon`,children:(0,K.jsx)(L0,{size:u})})]}),(0,K.jsx)(`span`,{className:W(F0({checked:C,disabled:!w})),"aria-hidden":`true`,"data-component":`ToggleSwitch.ToggleKnob`})]})]})}z0.displayName=`ToggleSwitch`;var B0=G(z0);const V0=U(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),H0=`medium`,U0=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function W0(e,t){let{as:n=`span`,className:r,size:i=H0,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=U0({as:n,onClick:c.onClick,onFocus:c.onFocus,tabIndex:c.tabIndex,disabled:c.disabled});return(0,K.jsx)(n,{ref:t,onKeyDown:e=>{s?.(e),(e.key===`Backspace`||e.key===`Delete`)&&o?.()},className:W(V0({size:i,interactive:l}),r),"data-component":`Token`,"data-size":i,"data-interactive":l?``:void 0,"data-selected":a?``:void 0,...n===`button`?{type:`button`}:{},...c})}W0.displayName=`TokenBase`;var G0=G(W0);const K0=U(`token-remove-button`,{variants:{size:{small:`token-remove-button-small`,medium:`token-remove-button-medium`,large:`token-remove-button-large`,xlarge:`token-remove-button-xlarge`},raised:{true:`token-remove-button-raised`,false:``}}});function q0(e){let{className:t,size:n=H0,isParentInteractive:r,...i}=e,a=W(K0({size:n,raised:r}),t);return r?(0,K.jsx)(`span`,{"aria-hidden":`true`,tabIndex:-1,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,K.jsx)(yn,{})}):(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,K.jsx)(yn,{})})}q0.displayName=`Token.RemoveButton`;const J0={root:`token-text`,interactive:`token-text-interactive`};function Y0(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,K.jsx)(n,{ref:t,className:W(J0.root,i&&J0.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}Y0.displayName=`Token.Text`;var X0=G(Y0);const Z0={srOnly:`sr-only`},Q0=U(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),$0=U(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),e2=e=>l.isValidElement(e)?e:(0,K.jsx)(e,{});function t2(e,t){let{as:n,className:r,text:i,size:a=H0,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=U0({as:n,onClick:d,onFocus:f.onFocus,tabIndex:f.tabIndex,disabled:f.disabled}),m=!!s&&!c,h=p&&m,g={as:n,href:u,onClick:d},_=e=>{e.stopPropagation(),s?.()};return(0,K.jsxs)(G0,{ref:t,size:a,isSelected:l,onRemove:s,className:W(Q0({interactive:p,selected:l,withRemoveButton:m}),r),"data-has-remove-button":m?``:void 0,...h?{}:g,...f,children:[o&&a!==`small`?(0,K.jsx)(`span`,{className:W($0({size:a})),"data-component":`Token.LeadingVisual`,children:e2(o)}):null,(0,K.jsxs)(X0,{interactive:h,...h?g:{},children:[i,s?(0,K.jsx)(`span`,{className:Z0.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,K.jsx)(q0,{size:a,isParentInteractive:p,onClick:_}):null]})}t2.displayName=`Token`;var n2=G(t2);const r2=`#999999`,i2=.6,a2=(e,t,n)=>Math.max(t,Math.min(e,n)),o2=e=>a2(Math.round(e),0,100),s2=e=>{let t=e.trim();if(t.startsWith(`#`)){let e=t.slice(1);if(e.length===3){let[t,n,r]=[...e].map(e=>parseInt(e+e,16));return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}if(e.length===6){let t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16);return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}return null}let n=t.match(/^rgba?\(([^)]+)\)$/i);if(!n)return null;let r=n[1].split(/[\s,/]+/).filter(Boolean).map(Number);if(r.length<3||r.slice(0,3).some(Number.isNaN))return null;let[i,a,o]=r;return{r:i,g:a,b:o}},c2=({r:e,g:t,b:n})=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2;if(c===0)return{h:0,s:0,l:Math.round(l*100)};let u=c/(1-Math.abs(2*l-1)),d;return d=o===r?(i-a)/c%6:o===i?(a-r)/c+2:(r-i)/c+4,d=Math.round(d*60),{h:d<0?d+360:d,s:Math.round(u*100),l:Math.round(l*100)}},l2=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,u2=e=>{let t=s2(e)??s2(`#999999`),{h:n,s:r,l:i}=c2(t),a=l2(t),{r:o,g:s,b:c}=t,l=a2(1/(.453-a),0,1),u=a2((a-.96)*100,0,1),d=(i2-a)*100*a2(1/(i2-a),0,1),f=o2(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${o2(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${o2(i-5)}%)`},dark:{background:`rgba(${o}, ${s}, ${c}, 0.18)`,foreground:`hsl(${n}deg, ${r}%, ${f}%)`,border:`hsla(${n}deg, ${r}%, ${f}%, 0.3)`,ring:`hsl(${n}deg, ${r}%, ${f}%)`,backgroundHover:`hsla(${n}deg, ${r}%, ${o2(i+10)}%, 0.3)`}}},d2={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function f2(e,t){let{as:n,className:r,style:i,text:a,size:o=H0,fillColor:s=r2,onRemove:c,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=e,h=l.useMemo(()=>u2(s),[s]),g=U0({as:n,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!c&&!u,v=g&&_,y={as:n,href:f,onClick:p},b=e=>{e.stopPropagation(),c?.()};return(0,K.jsxs)(G0,{ref:t,size:o,isSelected:d,onRemove:c,className:W(d2.root,g&&d2.interactive,d&&d2.selected,_&&d2.withRemoveButton,r),style:{...i,"--issue-label-background":h.light.background,"--issue-label-foreground":h.light.foreground,"--issue-label-border":h.light.border,"--issue-label-ring":h.light.ring,"--issue-label-background-hover":h.light.backgroundHover,"--issue-label-dark-background":h.dark.background,"--issue-label-dark-foreground":h.dark.foreground,"--issue-label-dark-border":h.dark.border,"--issue-label-dark-ring":h.dark.ring,"--issue-label-dark-background-hover":h.dark.backgroundHover},"data-component":`IssueLabelToken`,"data-has-remove-button":_?``:void 0,...v?{}:y,...m,children:[(0,K.jsxs)(X0,{interactive:v,...v?y:{},children:[a,c?(0,K.jsx)(`span`,{className:d2.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,K.jsx)(q0,{size:o,isParentInteractive:g,onClick:b}):null]})}f2.displayName=`IssueLabelToken`;var p2=G(f2);const m2={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function h2(e,t){let{as:n=`a`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(m2.root,m2.interactive,m2.hover,r),"data-component":`TopicTag`,...i})}h2.displayName=`TopicTag`;var g2=G(h2);const _2={root:`topic-tag-group`};function v2(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(_2.root,r),"data-component":`TopicTag.Group`,...i})}v2.displayName=`TopicTag.Group`;var y2=G(v2);const b2=Object.assign(g2,{Group:y2}),x2=(0,l.createContext)(null),S2=(0,l.createContext)(null),C2=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,w2=e=>e!==null&&e.effect===void 0,T2=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function E2(e){let{steps:t,step:n,defaultStep:r=null,onStepChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,onStatusChange:c,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=e,_=J(h),v=`${_}-title`,y=`${_}-description`,b=l.useRef(null),x=a!==void 0,[S,C]=l.useState(o),w=x?a:S,T=n!==void 0,[E,D]=l.useState(r),O=T?n:E,k=t.length,A=t.findIndex(e=>e.id===O),j=A===-1?null:t[A],M=l.useCallback(e=>{T||D(e),i?.({stepId:e,stepIndex:t.findIndex(t=>t.id===e),count:t.length})},[T,i,t]),N=l.useCallback(e=>{x||C(e),s?.(e)},[x,s]),P=l.useCallback(e=>{let n=e??t[0]?.id??null;M(n),N(!0),c?.({status:`started`})},[N,M,c,t]),F=l.useCallback(e=>{t.some(t=>t.id===e)&&M(e)},[M,t]),I=l.useCallback(()=>{M(null),N(!1)},[N,M]),L=l.useCallback(()=>{I(),c?.({status:`dismissed`})},[I,c]),ee=l.useCallback(()=>{let e=t[A+1];if(!e){I(),c?.({status:`completed`});return}M(e.id)},[M,I,c,A,t]),R=l.useCallback(()=>{let e=A>0?t[A-1]:void 0;e&&M(e.id)},[M,A,t]),[z,B]=l.useState(()=>({stepId:O,ready:w2(j),patch:null}));z.stepId!==O&&B({stepId:O,ready:w2(j),patch:null});let te=z.stepId===O?z:null,ne=te?.ready??w2(j),re=te?.patch??null,ie=l.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ae=C2(ie),oe=l.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});Vi(()=>{oe.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let se=l.useMemo(()=>({next:()=>oe.current.next(),prev:()=>oe.current.prev(),goto:e=>oe.current.goto(e),dismiss:()=>oe.current.dismiss(),show:()=>B(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>B(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>oe.current.step?.target?.()??null}),[O]);l.useEffect(()=>{if(w)return oe.current.step?.effect?.(se)??void 0},[se,w]);let ce=l.useCallback(()=>oe.current.step?.target?.()??null,[]),[le,ue]=l.useState(null),de=l.useCallback(()=>{let e=ce();if(!e){ue(null);return}let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),a={top:t,left:n,width:r,height:i};ue(e=>e&&T2(e,a)?e:a)},[ce]);Vi(()=>{if(!w||!ne){ue(null);return}de();let e=ce();e?.scrollIntoView?.({block:`center`,inline:`nearest`});let t=new ResizeObserver(de);return e&&t.observe(e),window.addEventListener(`resize`,de),window.addEventListener(`scroll`,de,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,de),window.removeEventListener(`scroll`,de,!0)}},[ce,de,w,ne,O]),Wi(e=>{!w||!d||(e.preventDefault(),L())}),l.useEffect(()=>{if(!w||!ne||!u)return;let e=e=>{e.defaultPrevented||(e.key===`ArrowRight`?(e.preventDefault(),ee()):e.key===`ArrowLeft`&&(e.preventDefault(),R()))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,ee,w,R,ne]),l.useEffect(()=>{if(!w||!ne||!f)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(b.current?.contains(t)||ce()?.contains(t)||L())};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,L,ce,w,ne]),l.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let fe=l.useMemo(()=>({open:w,step:ie,stepIndex:A,steps:t,start:P,next:ee,prev:R,goto:F,dismiss:L,progressText:`${A+1} of ${k}`,progressPercent:k===0?0:(A+1)/k*100,hasNext:A>-1&&A<k-1,hasPrev:A>0}),[k,L,F,ee,w,R,P,ie,A,t]),pe=l.useMemo(()=>({...fe,titleId:v,descriptionId:y,stepType:ae,ready:ne,targetRect:le,getTarget:ce,spotlightOffset:p,spotlightRadius:m,contentRef:b}),[fe,y,ce,ne,p,m,ae,le,v]);return(0,K.jsx)(x2.Provider,{value:pe,children:g})}E2.displayName=`Tour`;const D2=[];function O2(e){let t=l.useContext(x2);return(0,K.jsx)(K.Fragment,{children:e.children(t?.step?.actions??D2)})}O2.displayName=`Tour.Actions`;const k2={root:`tour-action-trigger`};function A2(e,t){let{action:n,className:r,children:i,onClick:a,variant:o=`default`,...s}=e,c=l.useContext(x2);return c?(0,K.jsx)(mi,{ref:t,variant:o,className:W(k2.root,r),onClick:e=>{if(a?.(e),!e.defaultPrevented){if(typeof n.action==`function`){n.action(c);return}n.action===`next`?c.next():n.action===`prev`?c.prev():c.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof n.action==`string`?n.action:`custom`,...s,children:i??n.label}):null}A2.displayName=`Tour.ActionTrigger`;var j2=G(A2);const M2={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},N2={top:{start:`-left`,center:``,end:`-right`},bottom:{start:`-left`,center:``,end:`-right`},left:{start:`-top`,center:``,end:`-bottom`},right:{start:`-top`,center:``,end:`-bottom`}};function P2(e,t){let n=l.useContext(x2),r=l.useContext(S2);if(!n||!r||n.stepType!==`tooltip`||n.step?.arrow===!1)return null;let i=M2[r.side],a=`${i}${N2[i][r.align]}`;return(0,K.jsx)($u,{ref:t,location:a,"data-component":`Tour.Arrow`,...e})}P2.displayName=`Tour.Arrow`;var F2=G(P2);const I2=U([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function L2(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(x2);if(!o||!o.open||!o.ready||o.step?.backdrop===!1)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,K.jsx)(na,{containerName:i,children:(0,K.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:W(I2({spotlit:s!==null}),n),style:{...r,"--tour-target-top":`${(s?.top??0)-c}px`,"--tour-target-left":`${(s?.left??0)-c}px`,"--tour-target-width":`${(s?.width??0)+c*2}px`,"--tour-target-height":`${(s?.height??0)+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":s?``:void 0,...a})})}L2.displayName=`Tour.Backdrop`;var R2=G(L2);const z2={root:`tour-close-trigger`};function B2(e,t){let{className:n,icon:r=yn,onClick:i,"aria-label":a=`Close tour`,...o}=e,s=l.useContext(x2);return s?(0,K.jsx)(_i,{ref:t,icon:r,variant:`invisible`,size:`small`,"aria-label":a,className:W(z2.root,n),onClick:e=>{i?.(e),!e.defaultPrevented&&s.dismiss()},"data-component":`Tour.CloseTrigger`,...o}):null}B2.displayName=`Tour.CloseTrigger`;var V2=G(B2);const H2={root:`tour-content`};function U2(e,t){let{className:n,...r}=e,i=l.useContext(x2),a=B(t,i?.contentRef??null),o=i?.step?.id??null,s=i?.ready??!1,c=i?.contentRef;return l.useEffect(()=>{!s||!o||c?.current?.focus()},[c,s,o]),!i||!i.open||!i.ready||!i.step?null:(0,K.jsx)(`div`,{ref:a,role:`dialog`,"aria-labelledby":i.step.title?i.titleId:void 0,"aria-describedby":i.step.description?i.descriptionId:void 0,tabIndex:-1,className:W(H2.root,n),"data-component":`Tour.Content`,"data-type":i.stepType,"data-step":i.step.id,...r})}U2.displayName=`Tour.Content`;var W2=G(U2);const G2={root:`tour-control`};function K2(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(G2.root,n),"data-component":`Tour.Control`,...r})}K2.displayName=`Tour.Control`;var q2=G(K2);const J2={root:`tour-description`};function Y2(e,t){let{className:n,children:r,...i}=e,a=l.useContext(x2);return a?(0,K.jsx)(`div`,{ref:t,id:a.descriptionId,className:W(J2.root,n),"data-component":`Tour.Description`,...i,children:r??a.step?.description}):null}Y2.displayName=`Tour.Description`;var X2=G(Y2);const Z2=U([`tour-positioner`,`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`],{variants:{type:{dialog:`tour-positioner-dialog`,tooltip:`tour-positioner-tooltip`,floating:`tour-positioner-floating`},unplaced:{true:`invisible`,false:``}}}),Q2=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function $2(e,t){let{side:n=`outside-bottom`,align:r=`center`,placement:i=`bottom-end`,portalContainerName:a,className:o,style:s,children:c,...u}=e,d=l.useContext(x2),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??n,g=f?.align??r,_=f?.placement??i,v=!!(d?.open&&d.ready&&f),y=l.useRef(null),b=B(t,y),x=l.useRef(null),[S,C]=l.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=l.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=sa(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&Q2(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return Vi(()=>{if(!v||!m){x.current=null,C(null);return}E();let e=new ResizeObserver(E);return y.current&&e.observe(y.current),()=>{e.disconnect()}},[m,v,d?.targetRect,E]),!d||!v?null:(0,K.jsx)(na,{containerName:a,children:(0,K.jsx)(`div`,{ref:b,className:W(Z2({type:p,unplaced:m&&!S}),o),style:{...s,"--tour-positioner-top":`${S?.top??0}px`,"--tour-positioner-left":`${S?.left??0}px`},"data-component":`Tour.Positioner`,"data-type":p,"data-side":S?.anchorSide??h,"data-align":S?.anchorAlign??g,"data-placement":p===`floating`?_:void 0,...u,children:(0,K.jsx)(S2.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:c})})})}$2.displayName=`Tour.Positioner`;var e4=G($2);const t4={root:`tour-progress-text`};function n4(e,t){let{className:n,children:r,...i}=e,a=l.useContext(x2);return a?(0,K.jsx)(`div`,{ref:t,className:W(t4.root,n),"data-component":`Tour.ProgressText`,...i,children:r??a.progressText}):null}n4.displayName=`Tour.ProgressText`;var r4=G(n4);const i4={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function a4(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(x2);if(!o||!o.open||!o.ready||!o.targetRect)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,K.jsx)(na,{containerName:i,children:(0,K.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:W(i4.root,n),style:{...r,"--tour-target-top":`${s.top-c}px`,"--tour-target-left":`${s.left-c}px`,"--tour-target-width":`${s.width+c*2}px`,"--tour-target-height":`${s.height+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...a})})}a4.displayName=`Tour.Spotlight`;var o4=G(a4);const s4={root:`tour-title`};function c4(e,t){let{className:n,children:r,...i}=e,a=l.useContext(x2);return a?(0,K.jsx)(`h2`,{ref:t,id:a.titleId,className:W(s4.root,n),"data-component":`Tour.Title`,...i,children:r??a.step?.title}):null}c4.displayName=`Tour.Title`;var l4=G(c4);const u4=()=>{let e=(0,l.useContext)(x2);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},d4=(e,{timeout:t=1e4}={})=>{let n=null,r=!1,i=()=>{r=!0,n!==null&&(cancelAnimationFrame(n),n=null)};return[new Promise(a=>{let o=Date.now()+t,s=()=>{if(r)return;let t=e();if(t){i(),a(t);return}if(Date.now()>=o){i(),a(null);return}n=requestAnimationFrame(s)};s()}),i]},f4=(e,t,n={})=>{let{predicate:r,...i}=n,a=()=>{};return[new Promise(n=>{let o=e?.();if(!o){n(null);return}let s=e=>{r&&!r(o)||(a(),n(e))};o.addEventListener(t,s,i),a=()=>o.removeEventListener(t,s,i)}),()=>a()]},p4=(e,t)=>d4(e,t),m4=(e,t,n)=>d4(()=>{let n=e();return n&&n.value===t?n:null},n),h4=Object.assign(E2,{Backdrop:R2,Spotlight:o4,Positioner:e4,Content:W2,Arrow:F2,CloseTrigger:V2,ProgressText:r4,Title:l4,Description:X2,Control:q2,Actions:O2,ActionTrigger:j2}),g4=l.createContext({announceUpdate:()=>{},expandedStateCache:{current:new Map},scrollElementIntoView:()=>{}}),_4=l.createContext({itemId:``,level:1,isSubTreeEmpty:!1,setIsSubTreeEmpty:()=>{},isExpanded:!1,setIsExpanded:()=>{},leadingVisualId:``,trailingVisualId:``,trailingActionId:``}),v4=l.createContext(!1),y4=`[role=tree]`,b4=`[role=treeitem]`,x4=e=>{let t=e.getAttribute(`aria-label`);if(t)return t;let n=e.getAttribute(`aria-labelledby`);return n?document.getElementById(n)?.textContent??``:e.textContent??``},S4=e=>{let t=e.getAttribute(`aria-expanded`);return t===`true`?`open`:t===`false`?`closed`:`end`},C4=e=>!!e.parentElement?.closest(`[role=treeitem][aria-expanded=false]`),w4=e=>{let t=e.querySelector(b4);return t instanceof HTMLElement?t:void 0},T4=e=>{let t=e.closest(`[role=group]`)?.closest(b4);return t instanceof HTMLElement?t:void 0},E4=e=>{let t=e.closest(y4)?.querySelector(b4);return t instanceof HTMLElement?t:void 0},D4=e=>{let t=e.closest(y4);if(!t)return;let n=Array.from(t.querySelectorAll(b4));for(let e=n.length-1;e>=0;e--)if(!C4(n[e]))return n[e]},O4=(e,t)=>{let n=e.closest(y4);if(!n)return;let r=Array.from(n.querySelectorAll(b4)),i=t===`next`?1:-1;for(let t=r.indexOf(e)+i;t>=0&&t<r.length;t+=i)if(!C4(r[t]))return r[t]},k4=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`)return t;t=t.parentElement}},A4=(e,t)=>{let n=t?.getBoundingClientRect().height||32,r=k4(e)?.clientHeight??window.innerHeight;return Math.max(Math.floor(r/n),1)},j4=(e,t)=>{let n=e.closest(y4);if(!n)return;let r=Array.from(n.querySelectorAll(b4));if(r.length===0)return;let i=A4(n,r[0].firstElementChild),a=r.indexOf(e),o=Math.floor(a/i),s=a-i*o,c=(o+(t===`next`?1:-1))*i+s;return r[Math.min(Math.max(c,0),r.length-1)]},M4={"open ArrowRight":w4,"closed ArrowLeft":T4,"end ArrowLeft":T4},N4=new Set([`ArrowLeft`,`ArrowRight`]),P4={ArrowUp:e=>O4(e,`previous`),ArrowDown:e=>O4(e,`next`),Backspace:T4,Home:E4,End:D4,PageUp:e=>j4(e,`previous`),PageDown:e=>j4(e,`next`)},F4=(e,t)=>N4.has(t)?M4[`${S4(e)} ${t}`]?.(e):P4[t]?.(e),I4=`[role=treeitem]`,L4=({containerRef:e})=>{Vi(()=>{let t=e.current;if(!t)return;let n=e=>{let n=Array.from(t.querySelectorAll(I4));if(n.length===0)return;let r=(e instanceof HTMLElement&&t.contains(e)?e.closest(I4):null)??n.find(e=>e.tabIndex===0)??n.find(e=>e.getAttribute(`aria-current`)===`true`)??n[0];for(let e of n)e.tabIndex=e===r?0:-1};n();let r=e=>{n(e.target)},i=e=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let n=e.target?.closest(I4);if(!n||!t.contains(n))return;let r=F4(n,e.key);r&&(e.preventDefault(),r.focus())},a=new MutationObserver(()=>n(document.activeElement));return a.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`focusin`,r),t.addEventListener(`keydown`,i),()=>{a.disconnect(),t.removeEventListener(`focusin`,r),t.removeEventListener(`keydown`,i)}},[e])},R4=(e,t)=>e.map((n,r)=>e[(t+r)%e.length]),z4=({containerRef:e,onFocusChange:t})=>{let n=l.useRef(``),r=l.useRef(0),i=l.useRef(t);l.useEffect(()=>{i.current=t},[t]),l.useEffect(()=>{let t=e.current;if(!t)return;let a=null,o=()=>(a??=Array.from(t.querySelectorAll(`[role=treeitem]`)),a),s=new MutationObserver(()=>{a=null});s.observe(t,{childList:!0,subtree:!0});let c=e=>{if(!e.key||e.key.length>1||e.key===` `||e.ctrlKey||e.altKey||e.metaKey)return;n.current+=e.key;let t=o(),a=t.findIndex(e=>e===document.activeElement),s=R4(t,Math.max(a,0)),c=n.current.length===1?s.slice(1):s,l=n.current.toLowerCase(),u=c.find(e=>x4(e).trim().toLowerCase().startsWith(l));u&&i.current(u),window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n.current=``},300),e.preventDefault(),e.stopPropagation()};return t.addEventListener(`keydown`,c),()=>{s.disconnect(),t.removeEventListener(`keydown`,c),window.clearTimeout(r.current)}},[e])},B4={root:`tree-view`,hover:`tree-view-hover`,coarse:`tree-view-coarse`,hidden:`sr-only`};function V4(e,t){let{children:n,className:r,flat:i,truncate:a=!0,...o}=e,s=l.useRef(null),c=B(t,s),[u,d]=l.useState(``),f=l.useCallback(e=>d(e),[]);L4({containerRef:s}),z4({containerRef:s,onFocusChange:e=>e.focus()});let p=l.useRef(null),m=l.useCallback(e=>{e&&(p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,e.isConnected&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}))},[]);l.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current)},[]);let h=l.useRef(null);h.current??=new Map;let g=l.useMemo(()=>({announceUpdate:f,expandedStateCache:h,scrollElementIntoView:m}),[f,m]);return(0,K.jsxs)(g4.Provider,{value:g,children:[(0,K.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:B4.hidden,"data-component":`TreeView.Announcement`,children:u}),(0,K.jsx)(`ul`,{ref:c,role:`tree`,className:W(B4.root,B4.hover,B4.coarse,r),"data-component":`TreeView`,"data-omit-spacer":i?`true`:void 0,"data-truncate-text":a?`true`:`false`,...o,children:n})]})}V4.displayName=`TreeView`;var H4=l.forwardRef(V4);const U4={root:`tree-view-directory-icon`};function W4(){let{isExpanded:e}=l.useContext(_4),t=e?Tn:En;return(0,K.jsx)(`span`,{className:U4.root,"data-component":`TreeView.DirectoryIcon`,children:(0,K.jsx)(t,{})})}W4.displayName=`TreeView.DirectoryIcon`;const G4=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`];function K4(e){let{title:t=`Error`,children:n,onRetry:r,onDismiss:i}=e,{itemId:a,setIsExpanded:o}=l.useContext(_4);return(0,K.jsx)(`div`,{onKeyDown:e=>{G4.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ErrorDialog`,children:(0,K.jsx)(Yh,{title:t,confirmButtonContent:`Retry`,cancelButtonContent:`Dismiss`,onClose:e=>{if(window.setTimeout(()=>document.getElementById(a)?.focus()),e===`confirm`){r?.();return}o(!1),i?.()},children:n})})}K4.displayName=`TreeView.ErrorDialog`;const q4={hidden:`sr-only`},J4=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`],Y4=e=>(0,f.isValidElementType)(e)?(0,K.jsx)(e,{}):e;function X4(e){let{items:t,onClose:n}=e,{itemId:r}=l.useContext(_4);return(0,K.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>{J4.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ActionDialog`,children:(0,K.jsx)(V_,{title:`Supplemental actions`,onClose:()=>{n?.(),window.setTimeout(()=>document.getElementById(r)?.focus())},children:(0,K.jsx)(Mi,{children:t.map(({label:e,onClick:t,icon:n,count:r},i)=>(0,K.jsxs)(Mi.Item,{onSelect:t,children:[(0,K.jsx)(Mi.LeadingVisual,{children:Y4(n)}),e,r?(0,K.jsxs)(Mi.TrailingVisual,{children:[r,(0,K.jsx)(`span`,{className:q4.hidden,children:` items`})]}):null]},i))})})})}X4.displayName=`TreeView.ActionDialog`;const Z4={visual:`tree-view-visual`,hidden:`sr-only`},Q4=(e,t)=>typeof e==`function`?e({isExpanded:t}):e,$4=e=>{let{children:t,label:n,labelId:r,className:i,"data-component":a}=e,{isExpanded:o}=l.useContext(_4);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{id:r,className:Z4.hidden,"aria-hidden":`true`,children:n}),(0,K.jsx)(`span`,{className:i,"aria-hidden":`true`,"data-component":a,children:Q4(t,o)})]})},e3={root:`tree-view-leading-action`};function t3(e){return(0,K.jsx)($4,{label:e.label,className:e3.root,"data-component":`TreeView.LeadingAction`,children:e.children})}t3.displayName=`TreeView.LeadingAction`;function n3(e){let{leadingVisualId:t}=l.useContext(_4);return(0,K.jsx)($4,{label:e.label,labelId:t,className:Z4.visual,"data-component":`TreeView.LeadingVisual`,children:e.children})}n3.displayName=`TreeView.LeadingVisual`;const r3={root:`tree-view-sub-tree`,skeletonRow:`tree-view-skeleton-row`,skeletonText:`tree-view-skeleton-text`,muted:`tree-view-muted`,hidden:`sr-only`},i3=[`67%`,`47%`,`73%`,`64%`,`50%`],a3=e=>{let t=l.useRef(e);return l.useEffect(()=>{t.current=e},[e]),t.current},o3=({index:e})=>(0,K.jsxs)(`span`,{className:r3.skeletonRow,style:{"--tree-view-skeleton-width":i3[e%i3.length]},"aria-hidden":`true`,children:[(0,K.jsx)(oQ,{size:16,shape:`square`}),(0,K.jsx)(n_,{className:r3.skeletonText})]}),s3=l.forwardRef(({count:e},t)=>{let n=J();return(0,K.jsx)(v4.Provider,{value:!0,children:(0,K.jsx)(_3,{ref:t,id:n,children:e?(0,K.jsxs)(K.Fragment,{children:[Array.from({length:e},(e,t)=>(0,K.jsx)(o3,{index:t},t)),(0,K.jsxs)(`span`,{className:r3.hidden,children:[`Loading `,e,` items`]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(n3,{children:(0,K.jsx)(ei,{size:`small`,srText:null})}),(0,K.jsx)(Ro,{className:r3.muted,children:`Loading...`})]})})})});s3.displayName=`TreeView.LoadingItem`;const c3=()=>(0,K.jsx)(_3,{id:J(),expanded:null,children:(0,K.jsx)(Ro,{className:r3.muted,children:`No items found`})});function l3(e){let{count:t,state:n,children:r,"aria-label":i}=e,{announceUpdate:a}=l.useContext(g4),{itemId:o,isExpanded:s,isSubTreeEmpty:c,setIsSubTreeEmpty:u}=l.useContext(_4),d=l.useRef(null),f=l.useRef(null),[p,m]=l.useState(!1),[h,g]=l.useState(``),_=a3(n);return l.useEffect(()=>{(n===void 0||n===`done`)&&u(!r)},[n,r,u]),l.useEffect(()=>{let e=document.getElementById(o);if(!e)return;let t=x4(e);if(g(t),n===`loading`){a(`${t} content loading`);return}if(_!==`loading`||n!==`done`||(a(d.current?.childElementCount?`${t} content loaded`:`${t} is empty`),!p))return;let r=window.setTimeout(()=>{(w4(e)??e).focus()});return m(!1),()=>{window.clearTimeout(r)}},[o,n,_,p,a]),l.useEffect(()=>{let e=f.current;if(!e)return;let t=()=>m(!0),n=e=>{e.relatedTarget&&m(!1)};return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[n]),s?(0,K.jsxs)(`ul`,{ref:d,role:`group`,"aria-label":i||h,className:W(r3.root),"data-component":`TreeView.SubTree`,children:[n===`loading`?(0,K.jsx)(s3,{ref:f,count:t}):r,c&&n!==`loading`?(0,K.jsx)(c3,{}):null]}):null}l3.displayName=`TreeView.SubTree`;const u3={root:`tree-view-trailing-action`,button:`shrink`,hidden:`sr-only`};function d3(e){let{items:t,shortcutText:n}=e,{itemId:r,trailingActionId:i}=l.useContext(_4),a=()=>{document.getElementById(r)?.focus()};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{id:i,className:u3.hidden,children:n}),(0,K.jsx)(`span`,{className:u3.root,"aria-hidden":`true`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),"data-component":`TreeView.TrailingAction`,children:t.map(({label:e,onClick:t,icon:n,count:r,className:i},o)=>r?(0,K.jsx)(oZ,{text:e,children:(0,K.jsx)(mi,{variant:`invisible`,leadingVisual:n,count:r,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:a,className:W(u3.button,i)})},o):(0,K.jsx)(_i,{icon:n,variant:`invisible`,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:a,className:W(u3.button,i)},o))})]})}d3.displayName=`TreeView.TrailingAction`;function f3(e){let{trailingVisualId:t}=l.useContext(_4);return(0,K.jsx)($4,{label:e.label,labelId:t,className:Z4.visual,"data-component":`TreeView.TrailingVisual`,children:e.children})}f3.displayName=`TreeView.TrailingVisual`;const p3={root:`tree-view-item`,container:`tree-view-item-container`,flat:`tree-view-item-container-flat`,hasLeadingAction:`tree-view-item-container-has-leading-action`,current:`tree-view-item-container-current`,loading:`tree-view-item-container-loading`,spacer:`tree-view-item-spacer`,levelLines:`tree-view-item-level-lines`,levelLine:`tree-view-item-level-line`,toggle:`tree-view-item-toggle`,toggleHover:`tree-view-item-toggle-hover`,toggleEnd:`tree-view-item-toggle-end`,content:`tree-view-item-content`,label:`tree-view-item-label`},m3=e=>Sr(e,{leadingAction:t3,leadingVisual:n3,trailingVisual:f3,subTree:l3}),h3=({level:e})=>(0,K.jsx)(`span`,{className:p3.levelLines,children:Array.from({length:e-1},(e,t)=>(0,K.jsx)(`span`,{className:p3.levelLine},t))});function g3(e,t){let{as:n,id:r,children:i,className:a,current:o=!1,defaultExpanded:s,expanded:c,onExpandedChange:u,onSelect:d,containIntrinsicSize:f,secondaryActions:p,"aria-label":m,"aria-labelledby":h,...g}=e,{expandedStateCache:_,scrollElementIntoView:v}=l.useContext(g4),{level:y}=l.useContext(_4),b=l.useContext(v4),x=NC(),[S,C]=m3(i),w=!!S.subTree,T=J(),E=J(),D=J(),O=J(),k=c!==void 0,[A,j]=l.useState(()=>_.current?.get(r)??s??o),M=k?c===!0:A,[N,P]=l.useState(!w),[F,I]=l.useState(!1),[L,ee]=l.useState(!1),R=l.useCallback(e=>{j(e),_.current?.set(r,e),u?.(e)},[r,_,u]),z=l.useCallback(e=>{R(!M),e?.stopPropagation()},[M,R]),B=l.useCallback(()=>{if(p?.length){if(p.length===1){p[0].onClick();return}ee(!0)}},[p]),te=e=>{switch(e.key){case`Enter`:case` `:d?d(e):z(e),e.stopPropagation();break;case`ArrowRight`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!0);break;case`ArrowLeft`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!1);break;case`U`:case`u`:if(!(e.shiftKey&&(e.metaKey||e.ctrlKey)))return;B()}},ne=e=>{d?d(e):z(e),e.stopPropagation()},re=`Press (${DC(`Shift+${x===`apple`?`Meta`:`Control`}+U`,x)}) for more actions.`,ie=[S.leadingVisual?E:void 0,S.trailingVisual?D:void 0].filter(Boolean),ae=l.useMemo(()=>({itemId:r,level:y+1,isSubTreeEmpty:N,setIsSubTreeEmpty:P,isExpanded:M,setIsExpanded:R,leadingVisualId:E,trailingVisualId:D,trailingActionId:O}),[r,y,N,M,R,E,D,O]),oe=N&&(!M||!w)||c===null?void 0:M,se=n??`li`,ce=n!==void 0&&n!==`li`,le=(0,K.jsxs)(se,{ref:t,id:r,role:`treeitem`,tabIndex:-1,"aria-label":p&&m?`${m}. ${re}`:m,"aria-labelledby":m?void 0:`${h||T} ${p?O:``}`.trim(),"aria-describedby":ie.length>0?ie.join(` `):void 0,"aria-level":y,"aria-expanded":oe,"aria-current":o?`true`:void 0,"aria-selected":F?`true`:`false`,className:W(p3.root,a),"data-component":`TreeView.Item`,"data-has-leading-action":S.leadingAction?``:void 0,"data-loading":b?``:void 0,onKeyDown:te,onClick:ne,onAuxClick:e=>{d&&e.button===1&&d(e),e.stopPropagation()},onFocus:e=>{v(e.currentTarget.firstElementChild),I(!0),e.stopPropagation()},onBlur:()=>I(!1),...g,children:[(0,K.jsxs)(`span`,{className:W(p3.container,p3.flat,S.leadingAction&&p3.hasLeadingAction,o&&p3.current,b&&p3.loading),style:{"--tree-view-level":y,contentVisibility:f?`auto`:void 0,containIntrinsicSize:f},children:[(0,K.jsx)(`span`,{className:p3.spacer,children:(0,K.jsx)(h3,{level:y})}),S.leadingAction,w?(0,K.jsx)(`span`,{className:W(p3.toggle,d&&p3.toggleHover,y===1&&p3.toggleEnd),onClick:e=>{d&&z(e)},"data-component":`TreeView.Item.Toggle`,children:M?(0,K.jsx)(cn,{width:12,height:12}):(0,K.jsx)(un,{width:12,height:12})}):null,(0,K.jsxs)(`span`,{id:T,className:p3.content,children:[S.leadingVisual,(0,K.jsx)(`span`,{className:p3.label,"data-component":`TreeView.Item.Label`,children:C}),S.trailingVisual]}),p?.length?(0,K.jsx)(d3,{items:p,shortcutText:re}):null]}),S.subTree,L&&p?(0,K.jsx)(X4,{items:p,onClose:()=>ee(!1)}):null]});return(0,K.jsx)(_4.Provider,{value:ae,children:ce?(0,K.jsx)(`li`,{role:`none`,children:le}):le})}g3.displayName=`TreeView.Item`;var _3=G(g3);const v3=Object.assign(H4,{Item:_3,SubTree:l3,LeadingAction:t3,LeadingVisual:n3,TrailingVisual:f3,DirectoryIcon:W4,ErrorDialog:K4}),y3={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function b3(e,t){let{as:n=`div`,className:r,title:i,maxWidth:a=125,inline:o,expandable:s,style:c,...l}=e;return(0,K.jsx)(n,{ref:t,title:i,className:W(y3.root,o?y3.inline:y3.block,s&&y3.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}b3.displayName=`Truncate`;var x3=G(b3);const S3=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=(0,l.useState)(e),[a,o]=(0,l.useState)(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},C3=(0,l.createContext)({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),w3=()=>(0,l.useContext)(C3),T3=(e,t)=>{let{colorScheme:n}=w3();return(n?e[n]:void 0)??t},E3=`(prefers-color-scheme: dark)`,D3=e=>{let t=window?.matchMedia?.(E3);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},O3=()=>window?.matchMedia?.(E3)?.matches?`night`:`day`,k3=()=>`day`,A3=()=>l.useSyncExternalStore(D3,O3,k3),j3=(e,t)=>e===`auto`?t:e,M3=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function N3({children:e,className:t,contextOnly:n,...r}){let{colorMode:i,dayScheme:a,nightScheme:o}=w3(),[s,c]=S3(r.colorMode??i??`day`),[u,d]=S3(r.dayScheme??a??`light`),[f,p]=S3(r.nightScheme??o??`dark`),m=A3(),h=j3(s,m),g=M3(h,u,f),_=l.useMemo(()=>({colorScheme:g,colorMode:s,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:c,setDayScheme:d,setNightScheme:p}),[g,s,h,u,f,c,d,p]);return n?(0,K.jsx)(C3.Provider,{value:_,children:e}):(0,K.jsx)(C3.Provider,{value:_,children:(0,K.jsx)(`div`,{className:t,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":s,children:e})})}N3.displayName=`ThemeProvider`,exports.ARROW_KEY_STEP=3,exports.AUTO_LOCALE=`auto`,exports.Accordion=dr,exports.AccordionContext=Ft,exports.AccordionHeader=ir,exports.AccordionItem=sr,exports.AccordionItemContext=tr,exports.AccordionPanel=ur,exports.ActionBar=Ya,exports.ActionBarButton=Ja,exports.ActionBarContext=xa,exports.ActionBarDivider=Ea,exports.ActionBarGroup=ka,exports.ActionBarIconButton=Ma,exports.ActionBarItemContext=Sa,exports.ActionBarMenu=La,exports.ActionList=Mi,exports.ActionListContainerContext=jr,exports.ActionListContext=Dr,exports.ActionListDescription=zr,exports.ActionListDivider=Vr,exports.ActionListGroup=Xr,exports.ActionListGroupContext=Hr,exports.ActionListGroupHeading=qr,exports.ActionListHeading=Ar,exports.ActionListItem=ki,exports.ActionListItemContext=Lr,exports.ActionListLeadingVisual=ri,exports.ActionListLinkItem=ji,exports.ActionListSubItem=ii,exports.ActionListTrailingAction=bi,exports.ActionListTrailingVisual=xi,exports.ActionMenu=ga,exports.ActionMenuAnchor=Pi,exports.ActionMenuButton=Fi,exports.ActionMenuContext=Ni,exports.ActionMenuOverlay=ha,exports.Alert=Qa,exports.AnchoredOverlay=pa,exports.AspectRatio=to,exports.Attachment=jo,exports.AttachmentAction=co,exports.AttachmentActions=fo,exports.AttachmentContent=ho,exports.AttachmentContext=no,exports.AttachmentDescription=vo,exports.AttachmentGroup=xo,exports.AttachmentMedia=wo,exports.AttachmentTitle=Do,exports.AttachmentTrigger=Ao,exports.Autocomplete=us,exports.AutocompleteContext=Mo,exports.AutocompleteDeferredInputContext=Po,exports.AutocompleteInput=$o,exports.AutocompleteInputContext=No,exports.AutocompleteMenu=as,exports.AutocompleteOverlay=ls,exports.Avatar=nc,exports.AvatarContext=fs,exports.AvatarFallback=Qs,exports.AvatarImage=tc,exports.AvatarStack=dc,exports.Banner=Nc,exports.BannerContext=fc,exports.BannerDescription=mc,exports.BannerPrimaryAction=Ac,exports.BannerSecondaryAction=Mc,exports.BannerTitle=_c,exports.Blankslate=nl,exports.BlankslateDescription=zc,exports.BlankslateHeading=Hc,exports.BlankslatePrimaryAction=qc,exports.BlankslateSecondaryAction=Qc,exports.BlankslateVisual=tl,exports.Blockquote=al,exports.Box=cl,exports.Breadcrumbs=yl,exports.BreadcrumbsContext=ul,exports.BreadcrumbsItem=vl,exports.Bubble=Fl,exports.BubbleContent=Ol,exports.BubbleContext=xl,exports.BubbleGroup=jl,exports.BubbleGroupContext=Sl,exports.BubbleReactions=Pl,exports.Button=mi,exports.ButtonGroup=Hl,exports.CHART_COLORS=jd,exports.CHART_OVERFLOW_COLOR=Ad,exports.CHART_SERIES_COLORS=kd,exports.Calendar=Su,exports.CalendarDay=Gl,exports.Card=Ju,exports.CardAction=Tu,exports.CardDescription=ku,exports.CardHeading=Mu,exports.CardIcon=Fu,exports.CardImage=Ru,exports.CardMetadata=Vu,exports.Caret=$u,exports.Carousel=Sd,exports.CarouselContext=td,exports.CarouselControls=md,exports.CarouselIndicators=ad,exports.CarouselNextButton=sd,exports.CarouselPlayButton=ld,exports.CarouselPreviousButton=dd,exports.CarouselSlide=_d,exports.CarouselSlideContext=nd,exports.Chart=Gd,exports.ChartContext=Cd,exports.ChartGradient=Od,exports.ChartLegend=zd,exports.ChartRadialText=Hd,exports.ChartTooltip=Wd,exports.Checkbox=Xd,exports.CheckboxCard=ff,exports.CheckboxCardContext=Zd,exports.CheckboxCardDescription=ef,exports.CheckboxCardLabel=rf,exports.CheckboxCardLeadingVisual=sf,exports.CheckboxGroup=Of,exports.CheckboxGroupCaption=hf,exports.CheckboxGroupContext=Kd,exports.CheckboxGroupLabel=vf,exports.CheckboxGroupValidation=Cf,exports.Clipboard=Kf,exports.ClipboardContext=kf,exports.ClipboardIndicator=Lf,exports.ClipboardInput=Hf,exports.ClipboardTrigger=Gf,exports.Code=Yf,exports.CodeBlock=vp,exports.CodeBlockCode=sp,exports.CodeBlockContent=dp,exports.CodeBlockContext=Xf,exports.CodeBlockHeader=mp,exports.CodeBlockTitle=_p,exports.Collapsible=kp,exports.CollapsibleContent=Tp,exports.CollapsibleContext=yp,exports.CollapsibleTrigger=Op,exports.Combobox=Om,exports.ComboboxClearTrigger=Rp,exports.ComboboxContent=Vp,exports.ComboboxContext=Ap,exports.ComboboxControl=Wp,exports.ComboboxEmpty=qp,exports.ComboboxInput=Qp,exports.ComboboxItem=nm,exports.ComboboxItemContext=Mp,exports.ComboboxItemGroup=am,exports.ComboboxItemGroupContext=jp,exports.ComboboxItemGroupLabel=cm,exports.ComboboxItemIndicator=dm,exports.ComboboxItemText=mm,exports.ComboboxLabel=_m,exports.ComboboxList=bm,exports.ComboboxPositioner=wm,exports.ComboboxTrigger=Dm,exports.CommandPalette=fh,exports.CommandPaletteContext=Mm,exports.CommandPaletteDialog=Wm,exports.CommandPaletteEmpty=qm,exports.CommandPaletteGroup=Xm,exports.CommandPaletteGroupContext=Nm,exports.CommandPaletteInput=$m,exports.CommandPaletteItem=nh,exports.CommandPaletteList=ah,exports.CommandPaletteLoading=ch,exports.CommandPaletteSeparator=dh,exports.ConfirmationDialog=Yh,exports.ContextMenu=ag,exports.ContextMenuContext=Qh,exports.ContextMenuOverlay=ng,exports.ContextMenuTrigger=ig,exports.CounterLabel=ci,exports.DAYS_IN_WEEK=7,exports.DAY_KEY_FORMAT=nu,exports.DEFAULT_AVATAR_SIZE=20,exports.DEFAULT_COLOR_MODE=`day`,exports.DEFAULT_CURRENT_STEP=1,exports.DEFAULT_DIRECTION=`ltr`,exports.DEFAULT_FLOATING_PANEL_MIN_SIZE=Yy,exports.DEFAULT_FLOATING_PANEL_POSITION=Jy,exports.DEFAULT_FLOATING_PANEL_SIZE=qy,exports.DEFAULT_ISSUE_LABEL_FILL_COLOR=r2,exports.DEFAULT_LOCALE=gs,exports.DEFAULT_MAP_LATITUDE=wU,exports.DEFAULT_MAP_LONGITUDE=TU,exports.DEFAULT_MAP_ZOOM=16,exports.DEFAULT_MARKDOWN_NAMESPACE=PU,exports.DEFAULT_MARKER_COLOR=oR,exports.DEFAULT_RATING_COUNT=5,exports.DEFAULT_RELATIVE_TIME_PREFIX=`on`,exports.DEFAULT_RELATIVE_TIME_THRESHOLD=hX,exports.DEFAULT_RICH_TEXT_EDITOR_CONTROLS=WX,exports.DEFAULT_RICH_TEXT_EDITOR_NAMESPACE=PX,exports.DEFAULT_SORT_DIRECTION=`ASC`,exports.DEFAULT_SPOTLIGHT_OFFSET=4,exports.DEFAULT_SPOTLIGHT_RADIUS=8,exports.DEFAULT_TABLE_PAGE_SIZE=25,exports.DEFAULT_TABLE_SKELETON_ROWS=10,exports.DEFAULT_TEXTAREA_COLS=30,exports.DEFAULT_TEXTAREA_RESIZE=qx,exports.DEFAULT_TEXTAREA_ROWS=7,exports.DEFAULT_TOGGLE_SWITCH_LOADING_LABEL_DELAY=T0,exports.DEFAULT_TOKEN_SIZE=H0,exports.DEFAULT_TRUNCATE_MAX_WIDTH=125,exports.DataTable=O_,exports.DatePicker=N_,exports.Details=B_,exports.DetailsSummary=z_,exports.Dialog=V_,exports.DialogBody=vh,exports.DialogButtons=bh,exports.DialogCloseButton=Sh,exports.DialogContext=yh,exports.DialogFooter=Th,exports.DialogHeader=Oh,exports.DialogSubtitle=jh,exports.DialogTitle=Ph,exports.DirectionContext=Rs,exports.DirectionProvider=KC,exports.DragHandle=VK,exports.Drawer=fv,exports.DrawerBody=W_,exports.DrawerCloseButton=J_,exports.DrawerContext=G_,exports.DrawerFooter=Z_,exports.DrawerHeader=ev,exports.DrawerSubtitle=rv,exports.DrawerTitle=ov,exports.Em=hv,exports.EmptyState=bv,exports.FLOATING_PANEL_LARGE_STEP=40,exports.FLOATING_PANEL_STEP=8,exports.FRAME_ROOT_CLASS=TS,exports.FileUpload=ny,exports.FileUploadContext=Ev,exports.FileUploadDescription=kv,exports.FileUploadIcon=Mv,exports.FileUploadItem=ty,exports.FileUploadLabel=Fv,exports.FileUploadList=Rv,exports.FilteredActionList=Ky,exports.FilteredActionListBodyLoader=Vy,exports.FilteredActionListInput=Oy,exports.FilteredActionListItem=jy,exports.FloatingPanel=Hb,exports.FloatingPanelBody=lb,exports.FloatingPanelCloseTrigger=db,exports.FloatingPanelContent=hb,exports.FloatingPanelContext=ib,exports.FloatingPanelControl=vb,exports.FloatingPanelDragTrigger=xb,exports.FloatingPanelHeader=wb,exports.FloatingPanelPositioner=Db,exports.FloatingPanelResizeTrigger=Mb,exports.FloatingPanelStageTrigger=Fb,exports.FloatingPanelTitle=Rb,exports.FloatingPanelTrigger=Vb,exports.Flow=_x,exports.FlowContext=Jb,exports.FlowList=Zb,exports.FlowNode=ex,exports.FlowParallel=rx,exports.FormControl=vS,exports.FormControlCaption=tS,exports.FormControlContext=Rf,exports.FormControlLabel=iS,exports.FormControlLeadingVisual=sS,exports.FormControlValidation=fS,exports.FormatByte=bS,exports.FormatNumber=SS,exports.Frame=kS,exports.Header=zS,exports.HeaderItem=FS,exports.HeaderLink=RS,exports.Heading=Er,exports.Hidden=HS,exports.Highlight=YS,exports.HoverCard=iC,exports.HoverCardContent=$S,exports.HoverCardContext=XS,exports.HoverCardTrigger=eC,exports.IconButton=_i,exports.Image=sC,exports.InlineMessage=pC,exports.IssueLabelToken=p2,exports.KeybindingHint=BC,exports.Label=UC,exports.LabelGroup=ew,exports.LayerCard=dw,exports.LayerCardPrimary=rw,exports.LayerCardSecondary=ow,exports.Link=Xc,exports.LinkButton=pw,exports.List=bw,exports.ListItem=yw,exports.LocaleContext=zs,exports.LocaleProvider=Ws,exports.MARKDOWN_NODES=FU,exports.MARKDOWN_TRANSFORMERS=IU,exports.MARQUEE_MINIMUM_COPIES=2,exports.MARQUEE_SPEEDS=BU,exports.Map=AU,exports.MapAttributionControl=uV,exports.MapDragRotateAndZoomInteraction=eU,exports.MapDrawControl=KH,exports.MapFullScreenControl=yV,exports.MapGraticuleLayer=ER,exports.MapHeatmapLayer=iV,exports.MapImageLayer=wR,exports.MapLayerGroup=yR,exports.MapLayersControl=YH,exports.MapLinkInteraction=SU,exports.MapMarker=pR,exports.MapMousePositionControl=OV,exports.MapOverlay=hR,exports.MapOverviewMapControl=MV,exports.MapPointerInteraction=aU,exports.MapScaleLineControl=wV,exports.MapSearchControl=ZH,exports.MapSelectInteraction=hU,exports.MapTileLayer=bR,exports.MapTranslateInteraction=iU,exports.MapVectorLayer=TR,exports.MapView=$L,exports.MapWebGLTileLayer=sV,exports.Mark=GS,exports.Markdown=zU,exports.Marquee=KU,exports.Message=fW,exports.MessageAvatar=$U,exports.MessageContent=nW,exports.MessageContext=bl,exports.MessageFooter=aW,exports.MessageGroup=cW,exports.MessageGroupContext=qU,exports.MessageHeader=dW,exports.Meter=IW,exports.MeterContext=_W,exports.MeterIndicator=bW,exports.MeterLabel=CW,exports.MeterTrack=EW,exports.MeterValue=kW,exports.NativeSelect=VW,exports.NativeSelectOptGroup=RW,exports.NativeSelectOption=BW,exports.NavigationList=_G,exports.NavigationListGroup=$W,exports.NavigationListGroupExpand=pG,exports.NavigationListGroupHeading=gG,exports.NavigationListHeading=UW,exports.NavigationListItem=uG,exports.NavigationListSubNavigation=oG,exports.NavigationMenu=dK,exports.NavigationMenuContent=NG,exports.NavigationMenuContext=bG,exports.NavigationMenuDepthContext=wG,exports.NavigationMenuDescription=FG,exports.NavigationMenuDivider=LG,exports.NavigationMenuGroup=HG,exports.NavigationMenuGroupHeading=zG,exports.NavigationMenuHeading=yG,exports.NavigationMenuHeadingLevelContext=CG,exports.NavigationMenuItem=GG,exports.NavigationMenuItemContext=xG,exports.NavigationMenuLeadingVisual=JG,exports.NavigationMenuLink=rK,exports.NavigationMenuLinkContext=SG,exports.NavigationMenuList=sK,exports.NavigationMenuSubNavigation=ZG,exports.NavigationMenuTrailingVisual=$G,exports.NavigationMenuTrigger=uK,exports.NumberInput=hK,exports.OverflowObserverContext=_a,exports.OverflowObserverProvider=va,exports.PINInput=wq,exports.PageLayout=sq,exports.PageLayoutContent=rq,exports.PageLayoutContext=_K,exports.PageLayoutFooter=CK,exports.PageLayoutHeader=EK,exports.PageLayoutPane=oq,exports.PageLayoutSidebar=JK,exports.Pagination=hq,exports.PasswordInput=vq,exports.Placeholder=Dq,exports.PlatformContext=OC,exports.Popover=Iq,exports.PopoverContent=Fq,exports.PopoverContext=Oq,exports.Portal=na,exports.PortalContext=qi,exports.ProgressBar=Zv,exports.ProgressBarItem=qv,exports.ProgressCircle=Bq,exports.QRCode=wY,exports.RICH_TEXT_EDITOR_NODES=FX,exports.Radio=Tx,exports.RadioCard=zY,exports.RadioCardContext=TY,exports.RadioCardDescription=OY,exports.RadioCardLabel=jY,exports.RadioCardLeadingVisual=PY,exports.RadioGroup=eX,exports.RadioGroupCaption=HY,exports.RadioGroupContext=Sx,exports.RadioGroupLabel=GY,exports.RadioGroupValidation=XY,exports.Rating=sX,exports.RelativeTime=MX,exports.RichTextEditor=XX,exports.RichTextEditorContent=UX,exports.RichTextEditorToolbar=YX,exports.SCREEN_READER_DELAY=500,exports.ScrollableRegion=hh,exports.SegmentedControl=CZ,exports.SegmentedControlButton=dZ,exports.SegmentedControlIconButton=pZ,exports.Select=wZ,exports.SelectContext=Ex,exports.SelectOptGroup=Ax,exports.SelectOptGroupContext=Dx,exports.SelectOption=Px,exports.SelectPanel=tQ,exports.SelectPanelButton=EZ,exports.SelectPanelContext=DZ,exports.SelectPanelFooter=AZ,exports.SelectPanelHeader=LZ,exports.SelectPanelLoading=JZ,exports.SelectPanelMessage=ZZ,exports.SelectPanelSearchInput=NZ,exports.SelectPanelSecondaryAction=eQ,exports.Separator=iQ,exports.SkeletonAvatar=oQ,exports.SkeletonBox=$g,exports.SkeletonText=n_,exports.Slider=uQ,exports.Spinner=ei,exports.Splitter=EQ,exports.SplitterPanel=gQ,exports.SplitterResizeTrigger=yQ,exports.SplitterResizeTriggerIndicator=SQ,exports.SplitterResizeTriggerSeparator=TQ,exports.Stack=Ry,exports.StackItem=Ly,exports.StateLabel=NQ,exports.StatisticCard=r$,exports.StatisticCardContext=PQ,exports.StatisticCardDescription=LQ,exports.StatisticCardLabel=BQ,exports.StatisticCardTrailingVisual=UQ,exports.StatisticCardTrend=XQ,exports.StatisticCardValue=$Q,exports.Status=f$,exports.StatusIndicator=d$,exports.Steps=I$,exports.StepsBody=x$,exports.StepsDescription=w$,exports.StepsIndicator=O$,exports.StepsItem=M$,exports.StepsItemContext=p$,exports.StepsTitle=F$,exports.Swap=W$,exports.SwapContext=L$,exports.SwapIndicator=U$,exports.Tab=h1,exports.TabList=b1,exports.TabPanel=C1,exports.Table=A_,exports.TableActions=fg,exports.TableBody=_g,exports.TableCell=bg,exports.TableCellPlaceholder=Cg,exports.TableContainer=Eg,exports.TableDivider=kg,exports.TableErrorDialog=jg,exports.TableHead=Ng,exports.TableHeader=Ig,exports.TableOfContents=s1,exports.TableOfContentsGroup=$$,exports.TableOfContentsItem=n1,exports.TableOfContentsList=X$,exports.TableOfContentsTitle=a1,exports.TablePagination=Jg,exports.TableRow=Xg,exports.TableSkeleton=a_,exports.TableSortHeader=c_,exports.TableSubtitle=d_,exports.TableTitle=m_,exports.Tabs=w1,exports.TabsContext=c1,exports.Text=Ro,exports.TextInput=Yo,exports.TextInputAction=Jo,exports.Textarea=Qx,exports.ThemeContext=C3,exports.ThemeProvider=N3,exports.Timeline=J1,exports.TimelineActions=j1,exports.TimelineAvatar=P1,exports.TimelineBadge=R1,exports.TimelineBody=V1,exports.TimelineBreak=W1,exports.TimelineItem=q1,exports.Toaster=w0,exports.ToggleSwitch=B0,exports.Token=n2,exports.TokenBase=G0,exports.TokenRemoveButton=q0,exports.TokenText=X0,exports.Tooltip=oZ,exports.TooltipContext=ZX,exports.TopicTag=b2,exports.TopicTagGroup=y2,exports.Tour=h4,exports.TourActionTrigger=j2,exports.TourActions=O2,exports.TourArrow=F2,exports.TourBackdrop=R2,exports.TourCloseTrigger=V2,exports.TourContent=W2,exports.TourContext=x2,exports.TourControl=q2,exports.TourDescription=X2,exports.TourPositioner=e4,exports.TourPositionerContext=S2,exports.TourProgressText=r4,exports.TourSpotlight=o4,exports.TourTitle=l4,exports.TreeView=v3,exports.TreeViewDirectoryIcon=W4,exports.TreeViewErrorDialog=K4,exports.TreeViewItem=_3,exports.TreeViewItemContext=_4,exports.TreeViewLeadingAction=t3,exports.TreeViewLeadingVisual=n3,exports.TreeViewRootContext=g4,exports.TreeViewSubTree=l3,exports.TreeViewTrailingVisual=f3,exports.Truncate=x3,exports.buildPaginationModel=Lg,exports.buildPaginationPageData=Rg,exports.clampToRange=mW,exports.commandScore=jm,exports.computeEdges=dx,exports.computeFlowRect=fx,exports.computePositions=ox,exports.connectorPath=Wb,exports.copyText=jf,exports.createColumnHelper=k_,exports.defaultPaneWidth=OK,exports.entryIds=sx,exports.exitIds=cx,exports.extendRange=gu,exports.formatFileSize=Cv,exports.formatMeterValue=jW,exports.formatRelativeTime=kX,exports.formatTitle=OX,exports.getAccessibleKeybindingHintString=DC,exports.getAddress=rR,exports.getAnchoredPosition=sa,exports.getCharacterCount=zo,exports.getFirstDayOfWeek=cu,exports.getIssueLabelColors=u2,exports.getLonLat=iR,exports.getMonthWeeks=du,exports.getPlatform=jC,exports.getProp=Pd,exports.getRangePosition=hu,exports.getSeriesColor=Md,exports.getWeekdays=lu,exports.isDateSelectable=fu,exports.isDateWithinRange=mu,exports.isFileAccepted=wv,exports.isTokenInteractive=U0,exports.markdownTheme=LU,exports.nodeIds=lx,exports.parseDate=_u,exports.registerPortalRoot=Qi,exports.richTextEditorTheme=IX,exports.sortStrategies=b_,exports.splitHighlightChunks=qS,exports.startOfWeek=uu,exports.stepValue=hW,exports.toDayKey=au,exports.toast=d0,exports.transitionSortDirection=h_,exports.triageFiles=Tv,exports.updateAriaValues=PK,exports.useAnnouncements=Hy,exports.useChart=Ld,exports.useChartContext=wd,exports.useClippedChildren=YC,exports.useCollator=Gs,exports.useColorSchemeVar=T3,exports.useConfirm=Zh,exports.useDateFormatter=Ks,exports.useDirection=WC,exports.useFilter=qs,exports.useFloatingPanelContext=ab,exports.useFormControlForwardedProps=zf,exports.useIsRtl=GC,exports.useLocaleContext=Bs,exports.useMap=QL,exports.useMarquee=HU,exports.useNumberFormatter=Js,exports.useOverflowObserver=ya,exports.usePaneWidth=GK,exports.usePlatform=NC,exports.useStepsItem=T$,exports.useTab=f1,exports.useTabList=_1,exports.useTabPanel=x1,exports.useTableOfContentsActiveId=o1,exports.useTabs=d1,exports.useTheme=w3,exports.useTour=u4,exports.valueToPercent=AW,exports.waitForElement=p4,exports.waitForElementValue=m4,exports.waitForEvent=f4;
|
|
820
|
+
}`,uniforms:o,paletteTextures:i.paletteTextures}}var oV=class extends bL{constructor(e){e=e?Object.assign({},e):{};let t=e.style||{};delete e.style,super(e),this.sources_=e.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=t,this.styleVariables_=this.style_.variables||{},this.styleBandCount_=NaN,this.styleNodataBandIndex_=void 0,this.handleSourceUpdate_(),this.addChangeListener(SF.SOURCE,this.handleSourceUpdate_)}getSources(e,t){let n=this.getSource();return this.sources_?typeof this.sources_==`function`?this.sources_(e,t):this.sources_:n?[n]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){let e=this.getRenderSource();return e?e.getState():`undefined`}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache();let e=this.getSource();if(e){if(e.getState()===`loading`){let t=()=>{e.getState()===`ready`&&(e.removeEventListener(`change`,t),this.setStyle(this.style_))};e.addEventListener(`change`,t)}else this.setStyle(this.style_)}}getFirstSource_(){let e=2**53-1,t=this.getSources([-e,-e,e,e],e);return t&&t.length?t[0]:null}usesCoverageBand_(e,t){if(!e||!t||e.hasAlpha!==!1)return!1;let n=e.getProjection();return!!n&&!MD(n,t)}getSourceBandCount_(e){let t=this.getFirstSource_(),n=t&&`bandCount`in t?t.bandCount:4;return this.usesCoverageBand_(t,e)?n+1:n}getSourceNodataBandIndex_(e){let t=this.getFirstSource_();if(t)return this.usesCoverageBand_(t,e)?t.bandCount+1:`nodataBandIndex`in t?t.nodataBandIndex:void 0}parseStyleForRender_(e){let t=this.getSourceBandCount_(e),n=this.getSourceNodataBandIndex_(e);return this.styleBandCount_=t,this.styleNodataBandIndex_=n,aV(this.style_,t,n)}applyShaders_(e){let t=this.parseStyleForRender_(e);this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures})}createRenderer(){let e=this.getMapInternal()?.getView()?.getProjection(),t=this.parseStyleForRender_(e);return new xz(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),paletteTextures:t.paletteTextures})}renderSources(e,t){let n=this.getRenderer(),r;for(let i=0,a=t.length;i<a;++i)this.renderedSource_=t[i],n.prepareFrame(e)&&(r=n.renderFrame(e));return r}render(e,t){this.rendered=!0;let n=e.viewState;if(this.hasRenderer()){let e=n.projection;(this.getSourceBandCount_(e)!==this.styleBandCount_||this.getSourceNodataBandIndex_(e)!==this.styleNodataBandIndex_)&&this.applyShaders_(e)}let r=this.getSources(e.extent,n.resolution),i=!0;for(let e=0,t=r.length;e<t;++e){let t=r[e],n=t.getState();if(n==`loading`){let e=()=>{t.getState()==`ready`&&(t.removeEventListener(`change`,e),this.changed())};t.addEventListener(`change`,e)}i&&=n==`ready`}let a=this.renderSources(e,r);if(this.getRenderer().renderComplete&&i)return this.renderedResolution_=n.resolution,a;if(this.renderedResolution_>.5*n.resolution){let t=this.getSources(e.extent,this.renderedResolution_).filter(e=>!r.includes(e));if(t.length>0)return this.renderSources(e,t)}return a}setStyle(e){if(this.styleVariables_=e.variables||{},this.style_=e,this.hasRenderer()){let e=this.getMapInternal()?.getView()?.getProjection();this.applyShaders_(e),this.changed()}}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}};oV.prototype.dispose;function sV({name:e,...t}){return vR(()=>new oV(t),e),null}sV.displayName=`MapWebGLTileLayer`;const cV=e=>{let t=QL(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addControl(r),()=>{t.removeControl(r)}},[t,r]),r},lV=(e,t,n)=>{let r=l.useRef(null);if(!r.current){let t=document.createElement(`div`);t.setAttribute(`data-component`,e),r.current=t}let i=r.current;return cV(()=>new UF({element:i,target:n})),l.useEffect(()=>{i.className=W(`ol-unselectable ol-control`,t)},[i,t]),i};function uV(e){return cV(()=>new WF(e)),null}uV.displayName=`MapAttributionControl`;const dV=[`fullscreenchange`,`webkitfullscreenchange`],fV={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var pV=class extends UF{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target}),this.on,this.once,this.un,this.keys_=e.keys!==void 0&&e.keys,this.source_=e.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=e.className===void 0?`ol-full-screen`:e.className,this.documentListeners_=[],this.activeClassName_=e.activeClassName===void 0?[this.cssClassName_+`-true`]:e.activeClassName.split(` `),this.inactiveClassName_=e.inactiveClassName===void 0?[this.cssClassName_+`-false`]:e.inactiveClassName.split(` `);let t=e.label===void 0?`⤢`:e.label;this.labelNode_=typeof t==`string`?document.createTextNode(t):t;let n=e.labelActive===void 0?`×`:e.labelActive;this.labelActiveNode_=typeof n==`string`?document.createTextNode(n):n;let r=e.tipLabel?e.tipLabel:`Toggle full-screen`;this.button_=document.createElement(`button`),this.button_.title=r,this.button_.setAttribute(`type`,`button`),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(Y.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ol-unselectable ol-control`,this.element.appendChild(this.button_)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){let e=this.getMap();if(!e)return;let t=e.getOwnerDocument();if(mV(t)){if(hV(t))vV(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?_V(n):gV(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=hV(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Lk(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(fV.ENTERFULLSCREEN)):(Lk(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(fV.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){t?(e.classList.remove(...this.inactiveClassName_),e.classList.add(...this.activeClassName_)):(e.classList.remove(...this.activeClassName_),e.classList.add(...this.inactiveClassName_))}setMap(e){let t=this.getMap();t&&t.removeChangeListener(zF.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(zF.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)Dw(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();mV(n)?this.element.classList.remove(FA):this.element.classList.add(FA);for(let t=0,r=dV.length;t<r;++t)e.push(Tw(n,dV[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function mV(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function hV(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function gV(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function _V(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():gV(e)}function vV(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function yV(e){return cV(()=>new pV(e)),null}yV.displayName=`MapFullScreenControl`;const bV=`units`,xV=[1,2,5],SV=25.4/.28;var CV=class extends UF{constructor(e){e||={};let t=document.createElement(`div`);t.style.pointerEvents=`none`,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let n=e.className===void 0?e.bar?`ol-scale-bar`:`ol-scale-line`:e.className;this.innerElement_=document.createElement(`div`),this.innerElement_.className=n+`-inner`,this.element.className=n+` ol-unselectable`,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth===void 0?64:e.minWidth,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_=``,this.addChangeListener(bV,this.handleUnitsChanged_),this.setUnits(e.units||`metric`),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(bV)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(bV,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=e.center,n=e.projection,r=this.getUnits(),i=r==`degrees`?`degrees`:`m`,a=TD(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||SV)/SV,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||SV)/SV,c=o*a,l=``;if(r==`degrees`){let e=EE.degrees;c*=e,c<e/60?(l=`″`,a*=3600):c<e?(l=`′`,a*=60):l=`°`}else if(r==`imperial`)c<.9144?(l=`in`,a/=.0254):c<1609.344?(l=`ft`,a/=.3048):(l=`mi`,a/=1609.344);else if(r==`nautical`)a/=1852,l=`NM`;else if(r==`metric`)c<1e-6?(l=`nm`,a*=1e9):c<.001?(l=`μm`,a*=1e6):c<1?(l=`mm`,a*=1e3):c<1e3?l=`m`:(l=`km`,a/=1e3);else if(r==`us`)c<.9144?(l=`in`,a*=39.37):c<1609.344?(l=`ft`,a/=.30480061):(l=`mi`,a/=1609.3472);else throw Error(`Invalid units`);let u=3*Math.floor(Math.log(o*a)/Math.log(10)),d,f,p,m=0,h,g;for(;;){p=Math.floor(u/3);let e=10**p;if(d=xV[(u%3+3)%3]*e,f=Math.round(d/a),isNaN(f)){this.element.style.display=`none`,this.renderedVisible_=!1;return}if(s!==void 0&&f>=s){d=m,f=h,p=g;break}if(f>=o)break;m=d,h=f,g=p,++u}let _=this.scaleBar_?this.createScaleBar(f,d,l):d.toFixed(p<0?-p:0)+` `+l;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+`px`,this.renderedWidth_=f),this.renderedVisible_||=(this.element.style.display=``,!0)}createScaleBar(e,t,n){let r=this.getScaleForResolution(),i=r<1?Math.round(1/r).toLocaleString()+` : 1`:`1 : `+Math.round(r).toLocaleString(),a=this.scaleBarSteps_,o=e/a,s=[this.createMarker(`absolute`)];for(let r=0;r<a;++r){let i=r%2==0?`ol-scale-singlebar-odd`:`ol-scale-singlebar-even`;s.push(`<div><div class="ol-scale-singlebar ${i}" style="width: ${o}px;"></div>`+this.createMarker(`relative`)+(r%2==0||a===2?this.createStepText(r,e,!1,t,n):``)+`</div>`)}return s.push(this.createStepText(a,e,!0,t,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+i+`</div>`:``)+s.join(``)}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e===`absolute`?3:-10}px;"></div>`}createStepText(e,t,n,r,i){let a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?``:` `+i),o=e===0?-3:t/this.scaleBarSteps_*-1,s=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${e===0?`left`:`center`};min-width: ${s}px;left: ${n?t+`px`:`unset`};">`+a+`</div>`}getScaleForResolution(){let e=TD(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||SV;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function wV(e){return cV(()=>new CV(e)),null}wV.displayName=`MapScaleLineControl`;const TV=`projection`,EV=`coordinateFormat`;var DV=class extends UF{constructor(e){e||={};let t=document.createElement(`div`);t.className=e.className===void 0?`ol-mouse-position`:e.className,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un,this.addChangeListener(TV,this.handleProjectionChanged_),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.renderOnMouseOut_=e.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?e.placeholder:` `,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(EV)}getProjection(){return this.get(TV)}handleMouseMove(e){let t=this.getMap();this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){let t=e.getViewport();this.listenerKeys.push(Tw(t,IF.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(Tw(t,IF.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(EV,e)}setProjection(e){this.set(TV,wD(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?ND(this.mapProjection_,e):xD}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=LD();e&&(this.transform_=ND(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&CE(n,e||this.getProjection()||this.mapProjection_);let r=this.getCoordinateFormat();t=r?r(n):n.toString()}}(!this.renderedHTML_||t!==this.renderedHTML_)&&(this.element.innerHTML=t,this.renderedHTML_=t)}render(e){let t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}};function OV(e){return cV(()=>new DV(e)),null}OV.displayName=`MapMousePositionControl`;const kV=.75,AV=.1;var jV=class extends UF{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed===void 0||e.collapsed,this.collapsible_=e.collapsible===void 0||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0&&e.rotateWithView,this.viewExtent_=void 0;let t=e.className===void 0?`ol-overviewmap`:e.className,n=e.tipLabel===void 0?`Overview map`:e.tipLabel,r=e.collapseLabel===void 0?`‹`:e.collapseLabel;typeof r==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=r):this.collapseLabel_=r;let i=e.label===void 0?`›`:e.label;typeof i==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=i):this.label_=i;let a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement(`button`);o.setAttribute(`type`,`button`),o.title=n,o.appendChild(a),o.addEventListener(Y.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new zI({view:e.view,controls:new Qw,interactions:new Qw});this.ovmap_=s,e.layers&&e.layers.forEach(function(e){s.addLayer(e)});let c=document.createElement(`div`);c.className=`ol-overviewmap-box`,c.style.boxSizing=`border-box`,this.boxOverlay_=new HI({position:[0,0],positioning:`center-center`,element:c}),this.ovmap_.addOverlay(this.boxOverlay_);let l=t+` ol-unselectable ol-control`+(this.collapsed_&&this.collapsible_?` ol-collapsed`:``)+(this.collapsible_?``:` ol-uncollapsible`),u=this.element;u.className=l,u.appendChild(this.ovmapDiv_),u.appendChild(o);let d=this.boxOverlay_,f=this.boxOverlay_.getElement(),p=e=>({clientX:e.clientX,clientY:e.clientY}),m=function(e){let t=p(e),n=s.getEventCoordinate(t);d.setPosition(n)},h=e=>{let t=s.getEventCoordinateInternal(e),n=this.getMap();n.getView().setCenterInternal(t);let r=n.getOwnerDocument();r.removeEventListener(`pointermove`,m),r.removeEventListener(`pointerup`,h)};this.ovmapDiv_.addEventListener(`pointerdown`,e=>{let t=this.getMap().getOwnerDocument();e.target===f&&t.addEventListener(`pointermove`,m),t.addEventListener(`pointerup`,h)})}setMap(e){let t=this.getMap();if(e!==t){if(t){let e=t.getView();e&&this.unbindView_(e),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(Tw(e,Sw.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===zF.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===zF.TARGET||e.key===zF.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new hF({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(rF.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(rF.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView().calculateExtentInternal(n);if(this.viewExtent_&&_T(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(PT(r)),s=t.getPixelFromCoordinateInternal(ET(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*AV||l<d*AV||c>u*kV||l>d*kV?this.resetExtent_():lT(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();BT(r,1/(2**(Math.log(kV/AV)/Math.LN2/2)*AV)),i.fitInternal(dk(r))}recenter_(){let e=this.getMap(),t=this.ovmap_,n=e.getView();t.getView().setCenterInternal(n.getCenterInternal())}updateBox_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView(),i=t.getView(),a=this.rotateWithView_?0:-r.getRotation(),o=this.boxOverlay_,s=this.boxOverlay_.getElement(),c=r.getCenter(),l=r.getResolution(),u=i.getResolution(),d=n[0]*l/u,f=n[1]*l/u;if(o.setPosition(c),s){s.style.width=d+`px`,s.style.height=f+`px`;let e=`rotate(`+a+`rad)`;s.style.transform=e}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||=Ew(this.ovmap_,RF.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(IA),this.collapsed_?Lk(this.collapseLabel_,this.label_):Lk(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;let e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};function MV(e){return cV(()=>new jV(e)),null}MV.displayName=`MapOverviewMapControl`;var NV=class e extends hO{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return pT(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return`Circle`}intersectsExtent(e){if(LT(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||CT(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=kO(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(lO(n,0,n.length,r,e,t,n)),this.changed()}};NV.prototype.transform;var PV=class e extends mO{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Dw),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(Tw(e[t],Y.CHANGE,this.changed,this))}clone(){let t=new e(FV(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<sT(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){mT(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)yT(e,t[n].getExtent());return e}getGeometries(){return FV(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=DT(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(FV(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function FV(e){return e.map(e=>e.clone())}function IV(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function LV(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}const RV={index:-1,endIndex:NaN,closestTargetDistance:1/0};function zV(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN;for(let e=0;e<t.targets.length;++e){let n=t.targets[e],r=n.coordinates,l=1/0,u;for(let e=0;e<r.length-1;++e){let t=r[e],n=r[e+1],o=KV(i,a,t,n);o.squaredDistance<l&&(l=o.squaredDistance,u=e+o.along)}l<o&&(o=l,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?u<n.startIndex&&(u+=r.length):n.endIndex<n.startIndex&&u>n.startIndex&&(u-=r.length)),c=u,s=e)}let l=t.targets[s],u=l.ring;if(t.targetIndex===s&&u){let e=LV(l.coordinates,c);xE(n.getPixelFromCoordinate(e),n.getPixelFromCoordinate(t.startCoord))>r&&(u=!1)}if(u){let e=l.coordinates,t=e.length,n=l.startIndex,r=c;if(n<r){let i=WV(e,n,r);WV(e,n,r-t)<i&&(c-=t)}else{let i=WV(e,n,r);WV(e,n,r+t)<i&&(c+=t)}}return RV.index=s,RV.endIndex=c,RV.closestTargetDistance=o,RV}function BV(e,t){let n=[];for(let r=0;r<t.length;++r)VV(e,t[r].getGeometry(),n);return n}function VV(e,t,n){if(t instanceof Yk){HV(e,t.getCoordinates(),!1,n);return}if(t instanceof kj){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)HV(e,r[t],!1,n);return}if(t instanceof uk){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)HV(e,r[t],!0,n);return}if(t instanceof Mj){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)HV(e,i[t],!0,n)}return}if(t instanceof PV){let r=t.getGeometries();for(let t=0;t<r.length;++t)VV(e,r[t],n);return}}function HV(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=t[e],s=t[e+1],c=KV(i,a,o,s);if(c.squaredDistance===0){let i=e+c.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function UV(e,t){return JT(e[0],e[1],t[0],t[1])}function WV(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return UV(LV(e,r),LV(e,i));let s=0;if(r<a){let t=LV(e,r),n=IV(e,a);s+=UV(t,n)}if(o<i){let t=IV(e,o),n=LV(e,i);s+=UV(t,n)}for(let t=a;t<o-1;++t){let n=IV(e,t),r=IV(e,t+1);s+=UV(n,r)}return s}const GV={along:0,squaredDistance:0};function KV(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=KT(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),GV.along=u,GV.squaredDistance=eE(JT(e,t,d,f),10),GV}const qV={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var JV=class extends Hw{constructor(e,t){super(e),this.feature=t}},YV=class extends mI{constructor(e){let t=e;t.stopDown||=Rw,super(t),this.on,this.once,this.un,this.options_=e,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=ZV(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,this.minPoints_=e.minPoints?e.minPoints:this.mode_===`Polygon`?3:2,this.maxPoints_=this.mode_===`Circle`?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Lw,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;if(e===`Circle`)n=(e,t,n)=>{let r=t||new NV([NaN,NaN]),i=zD(e[0],n),a=bE(i,zD(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=LD();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=ek:e===`LineString`?t=Yk:e===`Polygon`&&(t=uk),n=(n,r,i)=>(r?e===`Polygon`?n[0].length?r.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):r.setCoordinates([],this.geometryLayout_):r.setCoordinates(n,this.geometryLayout_):r=new t(n,this.geometryLayout_),r)}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new kF({source:new iM({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:XV(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:cI,this.freehandCondition_,this.freehandCondition_=e.freehand?iI:e.freehandCondition?e.freehandCondition:uI,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(JF.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?iI:e:oI,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?iI:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:uI}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===Y.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===FF.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===FF.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===FF.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===FF.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===FF.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===FF.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===FF.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new PF(FF.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}let t=this.getMap(),n=rT([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=BV(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(IV(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(IV(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&xE(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=zV(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex;let i=LV(r.coordinates,r.endIndex),a=this.getMap().getPixelFromCoordinate(i);e.coordinate=i,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_===`Point`)&&(this.atFinish_(e.pixel,n)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let n=!1;if(this.sketchFeature_){let r=!1,i=[this.finishCoordinate_],a=this.mode_;if(a===`Point`)n=!0;else if(a===`Circle`)n=this.sketchCoords_.length===2;else if(a===`LineString`)r=!t&&this.sketchCoords_.length>this.minPoints_;else if(a===`Polygon`){let e=this.sketchCoords_;r=e[0].length>this.minPoints_,i=[e[0][0],e[0][e[0].length-2]],i=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(r){let t=this.getMap();for(let r=0,a=i.length;r<a;r++){let a=i[r],o=t.getPixelFromCoordinate(a),s=e[0]-o[0],c=e[1]-o[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=a;break}}}}return n}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new eT(new ek(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new eT;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new Yk(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=_O(this.geometryLayout_);for(;e.length<n;)e.push(0);this.finishCoordinate_=e,this.mode_===`Point`?this.sketchCoords_=e.slice():this.mode_===`Polygon`?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new eT(new Yk(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new eT,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new JV(qV.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=_O(this.geometryLayout_),a,o;for(;e.length<i;)e.push(0);this.mode_===`Point`?o=this.sketchCoords_:this.mode_===`Polygon`?(a=this.sketchCoords_[0],o=a[a.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,o=a[a.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),n.getType()===`Polygon`&&this.mode_!==`Polygon`?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r,i,a=this.mode_;return a===`LineString`||a===`Circle`?(this.finishCoordinate_=e.slice(),i=this.sketchCoords_,i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),this.geometryFunction_(i,t,n)):a===`Polygon`&&(i=this.sketchCoords_[0],i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),r&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,t,n)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;for(let i=0;i<e;++i){let e;if(r===`LineString`||r===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,n),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r===`Polygon`){e=this.sketchCoords_[0],e.splice(-2,1);let r=this.sketchLine_.getGeometry();if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}r.setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,n)}if(e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,r)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,r),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new Aj([t])):this.type_===`MultiLineString`?e.setGeometry(new kj([t])):this.type_===`MultiPolygon`&&e.setGeometry(new Mj([t])),this.dispatchEvent(new JV(qV.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new JV(qV.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(e[0]);let r;if(t===`LineString`||t===`Circle`)r=this.sketchCoords_;else if(t===`Polygon`)r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();let n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new eT(new ek(n)),this.updateSketchFeatures_(),this.dispatchEvent(new JV(qV.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){let e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function XV(){let e=_M();return function(t,n){return e[t.getGeometry().getType()]}}function ZV(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}const QV=[0,0,0,0],$V=[],eH={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function tH(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]]}return r}var nH=class extends Hw{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},rH=class extends mI{constructor(e){if(super(e),this.handleSourceAdd_=this.handleSourceAdd_.bind(this),this.handleSourceRemove_=this.handleSourceRemove_.bind(this),this.handleExternalCollectionAdd_=this.handleExternalCollectionAdd_.bind(this),this.handleExternalCollectionRemove_=this.handleExternalCollectionRemove_.bind(this),this.handleFeatureChange_=this.handleFeatureChange_.bind(this),this.on,this.once,this.un,this.condition_=e.condition?e.condition:pI,this.defaultDeleteCondition_=function(e){return eI(e)&&sI(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:iI,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new $j,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new kF({source:new iM({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:sH(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null,this.filterFunctionWasSupplied_=e.filter!=null,this.filter_=e.filter?e.filter:()=>!0,this.coordinatesEqual_=e.sharedVerticesEqual?e.sharedVerticesEqual:_E,!(e.features||e.source))throw Error(`The modify interaction requires features collection or a source`);let t;e.features?(t=e.features.getArray(),e.features.addEventListener(xw.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(xw.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(nM.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(nM.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_)}),e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=[],t.filter(this.filter_).forEach(e=>this.addFeature_(e)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;t=e?e===!0?iI:e:oI,this.traceCondition_=t}addFeature_(e){this.features_.push(e);let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Qw;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new nH(eH.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){let t=this.features_.indexOf(e);this.features_.splice(t,1),this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.length===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){let t=e.feature;t&&this.externalAddFeatureHandler_(t)}handleSourceRemove_(e){let t=e.feature;t&&this.externalRemoveFeatureHandler_(t)}handleExternalCollectionAdd_(e){let t=e.element;t&&this.externalAddFeatureHandler_(t)}handleExternalCollectionRemove_(e){let t=e.element;t&&this.externalRemoveFeatureHandler_(t)}externalAddFeatureHandler_(e){e.addEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_),this.removeFeature_(e)}handleFeatureChange_(e){if(!this.changingFeature_){let t=e.target;this.removeFeature_(t),this.filter_(t)&&this.addFeature_(t)}}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(rT(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(rT(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(rT(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(rT(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:0,segment:[n,n]},i={feature:e,geometry:t,index:1,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(hT(n),r);let o=t,s=LD();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=fk(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t],i=this.SEGMENT_WRITERS_[r.getType()];i(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new eT(new ek(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==FF.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=FF.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==FF.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=rT([r]),a=this.rBush_.getInExtent(i),o={};a.sort(iH);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=X(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===1){let n=oH(e,s,t);this.coordinatesEqual_(n,r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s);continue}if(this.coordinatesEqual_(c[0],r)&&!o[l][0]){this.dragSegments_.push([s,0]),o[l][0]=s;continue}if(this.coordinatesEqual_(c[1],r)&&!o[l][1]){if(o[l][0]&&o[l][0].index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue}}this.dragSegments_.push([s,1]),o[l][1]=s;continue}X(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}tracePassesVertex_(e,t){if(e===t)return!1;if(e<t){let n=Math.ceil(e),r=Math.floor(t);return r===t&&--r,n<=r}let n=Math.floor(e),r=Math.ceil(t);return r===t&&(r+=1),n>=r}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&xE(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=zV(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;let r=!0;if(t.targetIndex===-1){let e=t.targets[n.index];r=this.tracePassesVertex_(e.startIndex,n.endIndex)}if(r){if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index,t.targets[t.targetIndex].endIndex=n.endIndex}let i=t.targets[n.index],a=LV(i.coordinates,n.endIndex);for(let e of this.dragSegments_)this.updateGeometry_(a.slice(),e);return a}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=rT([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=BV(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}shiftTracedSegmentIndices_(e,t,n){for(let r of this.dragSegments_){let i=r[0];i!==e&&i.geometry===e.geometry&&(i.depth===void 0||e.depth===void 0||Fw(i.depth,e.depth))&&i.index>=t&&(i.index+=n)}}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();tH(o,r.getType(),t.depth).splice(a,n),this.setGeometryCoordinates_(r,o),this.shiftTracedSegmentIndices_(t,a+n,-n),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(IV(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(IV(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();tH(o,n.getType(),t.depth).splice(a,0,...r),this.setGeometryCoordinates_(n,o),this.shiftTracedSegmentIndices_(t,a,r.length),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1],c=o.getStride();for(let t=2;t<c;++t)e[t]=a[s][t];switch(e.length=c,o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:{i=o.getCoordinates();let t=i[r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`MultiPolygon`:{i=o.getCoordinates();let t=i[r[1]][r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===0)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=xE(zD(t.getCenter(),n),zD(e,n)),i=LD();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_){let n=t[0];xE(hE(i,n.segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t)}this.traceSegments_.length>1&&(this.deactivateTrace_(),this.traceSegments_=null)}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}let a=this.updateTrace_(e);this.createOrUpdateVertexFeature_(a||t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){let t=this.traceState_.active?new Set:null;for(let n=this.dragSegments_.length-1;n>=0;--n){let r=this.dragSegments_[n][0];t&&t.add(r.feature);let i=r.geometry;if(i.getType()===`Circle`){let t=i,n=t.getCenter(),a=r.featureSegments[0],o=r.featureSegments[1];a.segment[0]=n,a.segment[1]=n,o.segment[0]=n,o.segment[1]=n,this.rBush_.update(hT(n),a);let s=t,c=LD();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=fk(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(rT(r.segment),r)}if(t)for(let e of t)this.removeFeature_(e),this.filter_(e)&&this.addFeature_(e);return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new nH(eH.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=function(t,n){return aH(e,t,r)-aH(e,n,r)},a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new ek(RD(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof eT&&this.features_.includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=BD(aT(VD(hT(e,QV),r),t.getView().getResolution()*this.pixelTolerance_,QV),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=oH(e,s,r),u=t.getPixelFromCoordinate(l),d=xE(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[X(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===1)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=bE(u,e),o=bE(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[X(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(this.coordinatesEqual_(c[0],t[0])&&this.coordinatesEqual_(c[1],t[1])||this.coordinatesEqual_(c[0],t[1])&&this.coordinatesEqual_(c[1],t[0])){let r=X(a[e].geometry);r in f||(f[r]=!0,n[X(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(rT(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(rT(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?RD(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(rT([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=zD(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=FF.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new nH(eH.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=X(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1))}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(rT(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(rT([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?zD(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||Fw(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(xw.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(xw.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(nM.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(nM.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(Y.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(Sw.PROPERTYCHANGE,this.handleFeatureChange_)}}};function iH(e,t){return e.index-t.index}function aH(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=LD();t&&(i=i.clone().transform(t,n));let r=bE(i.getCenter(),zD(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=zD(e,n);return $V[0]=zD(t.segment[0],n),$V[1]=zD(t.segment[1],n),SE(i,$V)}function oH(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=LD();return i&&(t=t.clone().transform(i,n)),RD(t.getClosestPoint(zD(e,n)),n)}let i=zD(e,n);return $V[0]=zD(t.segment[0],n),$V[1]=zD(t.segment[1],n),RD(hE(i,$V),n)}function sH(){let e=_M();return function(t,n){return e.Point}}const cH={SNAP:`snap`,UNSNAP:`unsnap`};var lH=class extends Hw{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const uH={Circle(e,t){let n=e,r=LD();r&&(n=n.clone().transform(r,t));let i=fk(n);return r&&i.transform(t,r),uH.Polygon(i)},GeometryCollection(e,t){let n=[],r=e.getGeometriesArray();for(let e=0;e<r.length;++e){let i=this[r[e].getType()];i&&n.push(i(r[e],t))}return n.flat()},LineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);return t},MultiLineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t},MultiPoint(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length;e<i;e+=r)t.push([n.slice(e,e+2)]);return t},MultiPolygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEndss(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=0,i=o.length;e<i;++e){let i=o[e];for(let e=a,o=i-r;e<o;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=i}}return t},Point(e){return[[e.getFlatCoordinates().slice(0,2)]]},Polygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t}};function dH(e){return e.feature?e.feature:e.element?e.element:null}const fH=[],pH=[],mH=[];var hH=class extends mI{constructor(e){e||={},super({handleDownEvent:Lw,stopDown:Rw}),this.on,this.once,this.un,this.source_=e.source?e.source:null,this.vertex_=e.vertex===void 0||e.vertex,this.edge_=e.edge===void 0||e.edge,this.intersection_=e.intersection!==void 0&&e.intersection,this.features_=e.features?e.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.rBush_=new $j,this.snapped_=null,this.segmenters_=Object.assign({},uH,e.segmenters)}addFeature(e,t){t=t===void 0||t;let n=X(e),r=e.getGeometry();if(r){let t=this.segmenters_[r.getType()];if(t){this.indexedFeaturesExtents_[n]=r.getExtent(fT());let i=t.call(this.segmenters_,r,this.getMap().getView().getProjection()),a=i.length;for(let t=0;t<a;++t){let n=i[t];pH[t]=rT(n),mH[t]={feature:e,segment:n}}if(this.intersection_)for(let t=0,n=i.length;t<n;++t){let n=i[t];if(n.length===1)continue;let r=pH[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!LT(r,pH[o]))continue;let s=VO(n,t);if(!s)continue;let c=[s];pH[a]=rT(c),mH[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(pH[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=VO(n,r);if(!i)continue;let s=[i];pH[a]=rT(s),mH[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(pH[0],mH[0]):(pH.length=a,mH.length=a,this.rBush_.load(pH,mH))}}t&&(this.featureChangeListenerKeys_[n]&&Dw(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=Tw(e,Y.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e}areSnapDataEqual_(e,t){return e.segment===t.segment&&e.feature===t.feature}handleEvent(e){let t=this.snapTo(e.pixel,e.coordinate,e.map);return t?(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,t)&&this.dispatchEvent(new lH(cH.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new lH(cH.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new lH(cH.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=dH(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=dH(e);t&&(this.removeFeature(t),delete this.pendingFeatures_[X(t)])}handleFeatureChange_(e){let t=e.target;this.handlingDownUpSequence?this.pendingFeatures_[X(t)]=t:this.updateFeature_(t)}handleUpEvent(e){let t=Object.values(this.pendingFeatures_);if(t.length){for(let e of t)this.updateFeature_(e);Cw(this.pendingFeatures_)}return!1}removeFeature(e,t){let n=t===void 0||t,r=X(e),i=this.indexedFeaturesExtents_[r];if(i){let t=this.rBush_;t.getInExtent(i).forEach(n=>{(e===n.feature||e===n.intersectionFeature)&&t.remove(n)})}n&&(Dw(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])}setMap(e){let t=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();if(Array.isArray(r)||(r=r.getArray()),t&&(n.forEach(Dw),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(Dw),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(Tw(this.features_,xw.ADD,this.handleFeatureAdd_,this),Tw(this.features_,xw.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(Tw(this.source_,nM.ADDFEATURE,this.handleFeatureAdd_,this),Tw(this.source_,nM.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=zD(t,r),a=BD(aT(rT([i]),n.getView().getResolution()*this.pixelTolerance_),r),o=this.rBush_.getInExtent(a),s=o.length;if(s===0)return null;let c,l=1/0,u,d=null,f=this.pixelTolerance_*this.pixelTolerance_,p=()=>{if(!c)return null;let t=n.getPixelFromCoordinate(c);return bE(e,t)>f?null:{vertex:c,vertexPixel:[Math.round(t[0]),Math.round(t[1])],feature:u,segment:d}};if(this.vertex_||this.intersection_){for(let e=0;e<s;++e){let t=o[e];if(t.feature.getGeometry().getType()!==`Circle`)for(let e of t.segment){let n=bE(i,zD(e,r));n<l&&(this.intersection_&&t.intersectionFeature||this.vertex_&&!t.intersectionFeature)&&(c=e,l=n,u=t.feature)}}let e=p();if(e)return e}if(this.edge_){for(let e=0;e<s;++e){let t=null,n=o[e];if(n.feature.getGeometry().getType()===`Circle`){let e=n.feature.getGeometry(),a=LD();a&&(e=e.clone().transform(a,r)),t=mE(i,e)}else{let[e,a]=n.segment;a&&(fH[0]=zD(e,r),fH[1]=zD(a,r),t=hE(i,fH))}if(t){let e=bE(i,t);e<l&&(c=RD(t,r),d=n.feature.getGeometry().getType()===`Circle`?null:n.segment,l=e,u=n.feature)}}let e=p();if(e)return e}return null}updateFeature_(e){this.removeFeature(e,!1),this.addFeature(e,!1)}},gH=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=eT,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?wD(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=wD(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return Kw()}readFeature(e,t){return Kw()}readFeatures(e,t){return Kw()}readGeometry(e,t){return Kw()}readProjection(e){return Kw()}writeFeature(e,t){return Kw()}writeFeatures(e,t){return Kw()}writeGeometry(e,t){return Kw()}};function _H(e,t,n){let r=n?wD(n.featureProjection):null,i=n?wD(n.dataProjection):null,a=e;if(r&&i&&!MD(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(FD(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}const vH={Point:ek,LineString:Yk,Polygon:uk,MultiPoint:Aj,MultiLineString:kj,MultiPolygon:Mj};function yH(e,t,n){return Array.isArray(t[0])?(ok(e,0,t,n)||(e=e.slice(),ck(e,0,t,n)),e):(ak(e,0,t,n)||(e=e.slice(),sk(e,0,t,n)),e)}function bH(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>bH({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return _H(new Pj(r,r===`Polygon`?yH(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function xH(e,t){if(!e)return null;if(Array.isArray(e))return new PV(e.map(e=>xH(e,t)));let n=vH[e.type];return _H(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var SH=class extends gH{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(CH(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(CH(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return Kw()}readFeaturesFromObject(e,t){return Kw()}readGeometry(e,t){return this.readGeometryFromObject(CH(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return Kw()}readProjection(e){return this.readProjectionFromObject(CH(e))}readProjectionFromObject(e){return Kw()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return Kw()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return Kw()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return Kw()}};function CH(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var wH=class extends SH{constructor(e){e||={},super(),this.dataProjection=wD(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=wD(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=TH(n.geometry,t);if(this.featureClass===Pj)return bH({geometry:r,id:n.id,properties:n.properties},t);let i=this.featureClass,a=new i;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&a.setGeometryName(n.geometry_name),a.setGeometry(xH(r,t)),`id`in n&&a.setId(n.id),n.properties&&a.setProperties(n.properties,!0),a}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return EH(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=wD(t.properties.name);else if(t.type===`EPSG`)n=wD(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`)}else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=PH(a,t),delete i[e.getGeometryName()]),ww(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return PH(e,this.adaptOptions(t))}};function TH(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=OH(e);break;case`LineString`:n=kH(e);break;case`Polygon`:n=NH(e);break;case`MultiPoint`:n=jH(e);break;case`MultiLineString`:n=AH(e);break;case`MultiPolygon`:n=MH(e);break;case`GeometryCollection`:n=DH(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function EH(e,t){return xH(TH(e,t),t)}function DH(e,t){return e.geometries.map(function(e){return TH(e,t)})}function OH(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:gO(t.length)}}function kH(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:gO(t[0]?.length||2)}}function AH(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:jO(r,0,t,n),layout:gO(n)}}function jH(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:gO(t[0]?.length||2)}}function MH(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:MO(n,0,t,r),layout:gO(r)}}function NH(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:jO(n,0,t,r),layout:gO(r)}}function PH(e,t){e=_H(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=BH(e,t);break;case`LineString`:r=IH(e,t);break;case`Polygon`:r=VH(e,t);break;case`MultiPoint`:r=RH(e,t);break;case`MultiLineString`:r=LH(e,t);break;case`MultiPolygon`:r=zH(e,t);break;case`GeometryCollection`:r=FH(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function FH(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return PH(e,t)})}}function IH(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function LH(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function RH(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function zH(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function BH(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function VH(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const HH={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},UH={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},WH={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},GH=[{shape:`Point`,label:`Draw a point`,Icon:mn},{shape:`LineString`,label:`Draw a line`,Icon:kn},{shape:`Circle`,label:`Draw a circle`,Icon:pn}];function KH({target:e,className:t,fileName:n=`react-openlayers-geojson.json`}){let r=QL(),i=lV(`MapDrawControl`,W(HH.root,t),e),[a,o]=l.useState(!1),[s,c]=l.useState(null),u=l.useRef(null),f=l.useRef(null);if(!u.current){let e=new iM;u.current={source:e,layer:new kF({source:e,style:UH,properties:{key:`drawLayer`}}),modify:new rH({source:e})}}let p=u.current,m=l.useCallback(()=>{let e=p.source.getFeatures(),t=new wH().writeFeaturesObject(e,WH),r=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=n,a.click(),URL.revokeObjectURL(i)},[p,n]);l.useEffect(()=>{if(!(!r||!a))return r.addLayer(p.layer),r.addInteraction(p.modify),()=>{r.removeInteraction(p.modify),r.removeLayer(p.layer)}},[r,a,p]),l.useEffect(()=>{if(!r||!a||!s)return;let e=s===`LineString`?new YV({source:p.source,type:s,maxPoints:2}):new YV({source:p.source,type:s}),t=new hH({source:p.source});return f.current=e,r.addInteraction(e),r.addInteraction(t),()=>{r.removeInteraction(t),r.removeInteraction(e),f.current=null}},[r,a,s,p]),l.useEffect(()=>{if(!r||!a)return;let e=r.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?f.current?.abortDrawing():e.shiftKey&&e.key===`S`&&m()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,a,m]);let h=()=>{o(e=>!e),c(null)},g=e=>{c(t=>t===e?null:e)};return(0,d.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:HH.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":a,onClick:h,children:(0,K.jsx)(Rn,{size:12})}),a?(0,K.jsxs)(`div`,{className:HH.shapes,children:[GH.map(({shape:e,label:t,Icon:n})=>(0,K.jsx)(`button`,{type:`button`,className:HH.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":s===e,onClick:()=>g(e),children:(0,K.jsx)(n,{size:12})},e)),(0,K.jsx)(`button`,{type:`button`,className:HH.shape,title:`Move and reshape what has been drawn`,"aria-pressed":s===null,onClick:()=>g(null),children:(0,K.jsx)(Xt,{size:12})})]}):null]}),i)}KH.displayName=`MapDrawControl`;const qH={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},JH=(e,t)=>e.map((e,n)=>{let r=`${t}${n}`;return{key:r,layer:e,name:e.get(`name`)??e.constructor.name,children:e instanceof NI?JH(e.getLayers().getArray(),`${r}.`):[]}});function YH({target:e,className:t}){let n=QL(),r=lV(`MapLayersControl`,W(qH.root,t),e),[i,a]=l.useState(!1),[o,s]=l.useState(0),c=l.useMemo(()=>n&&i?JH(n.getLayers().getArray(),``):[],[n,i,o]),u=(e,t)=>{e.setVisible(t),s(e=>e+1)},f=e=>(0,K.jsx)(`ul`,{className:qH.list,children:e.map(e=>(0,K.jsxs)(`li`,{className:qH.item,children:[(0,K.jsxs)(`label`,{className:qH.label,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.layer.getVisible(),onChange:t=>u(e.layer,t.target.checked)}),e.name]}),e.children.length>0?f(e.children):null]},e.key))});return(0,d.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:qH.toggle,title:`Click here to switch layers`,"aria-expanded":i,onClick:()=>a(e=>!e),children:(0,K.jsx)(On,{size:24})}),i?(0,K.jsx)(`div`,{className:qH.layers,children:f(c)}):null]}),r)}YH.displayName=`MapLayersControl`;const XH={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function ZH({target:e,className:t,zoom:n=18,color:r=oR,placeholder:i=`Search for a place`}){let a=QL(),o=lV(`MapSearchControl`,W(XH.root,t),e),[s,c]=l.useState(!1),[u,f]=l.useState(``);return(0,d.createPortal)((0,K.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!a||!u)return;let[t]=await iR(u,1);if(!t)return;let i=[Number(t.lon),Number(t.lat)];lR(a,i,r).set(`address`,t.display_name),a.getView().setCenter(AD(i)),a.getView().setZoom(n)},children:[(0,K.jsx)(`button`,{type:`button`,className:XH.toggle,title:i,"aria-expanded":s,onClick:()=>c(e=>!e),children:(0,K.jsx)(Ln,{size:24})}),s?(0,K.jsx)(`input`,{type:`search`,className:XH.input,value:u,placeholder:i,"aria-label":i,autoComplete:`off`,onChange:e=>f(e.target.value)}):null]}),o)}ZH.displayName=`MapSearchControl`;const QH=e=>{let t=QL(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addInteraction(r),()=>{t.removeInteraction(r)}},[t,r]),r};var $H=class extends mI{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:uI,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!fI(e))return;let t=e.map,n=t.getSize(),r=e.pixel,i=r[0]-n[0]/2,a=n[1]/2-r[1],o=Math.atan2(a,i),s=Math.sqrt(i*i+a*a),c=t.getView();if(this.lastAngle_!==void 0){let e=this.lastAngle_-o;c.adjustRotationInternal(e)}this.lastAngle_=o,this.lastMagnitude_!==void 0&&c.adjustResolutionInternal(this.lastMagnitude_/s),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}handleUpEvent(e){if(!fI(e))return!0;let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1}handleDownEvent(e){return fI(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function eU(e){return QH(()=>new $H(e)),null}eU.displayName=`MapDragRotateAndZoomInteraction`;const tU={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var nU=class extends Hw{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},rU=class extends mI{constructor(e){e||={},super(e),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=e.features===void 0?null:e.features;let t;if(e.layers&&!this.features_){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=Lw;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:Lw,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:iI,this.lastFeature_=null,this.addChangeListener(JF.ACTIVE,this.handleActiveChanged_)}handleDownEvent(e){if(!e.originalEvent||!this.condition_(e))return!1;if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);let t=this.features_||new Qw([this.lastFeature_]);return this.dispatchEvent(new nU(tU.TRANSLATESTART,t,e.coordinate,this.startCoordinate_,e)),!0}return!1}handleUpEvent(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);let t=this.features_||new Qw([this.lastFeature_]);return this.dispatchEvent(new nU(tU.TRANSLATEEND,t,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1}handleDragEvent(e){if(this.lastCoordinate_){let t=e.coordinate,n=e.map.getView().getProjection(),r=zD(t,n),i=zD(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new Qw([this.lastFeature_]),c=LD();s.forEach(function(e){let t=e.getGeometry();c?(t.transform(c,n),t.translate(a,o),t.transform(n,c)):t.translate(a,o),e.setGeometry(t)}),this.lastCoordinate_=t,this.dispatchEvent(new nU(tU.TRANSLATING,s,t,this.startCoordinate_,e))}}handleMoveEvent(e){let t=e.map.getViewport();this.featuresAtPixel_(e.pixel,e.map)?(t.classList.remove(this.lastCoordinate_?`ol-grab`:`ol-grabbing`),t.classList.add(this.lastCoordinate_?`ol-grabbing`:`ol-grab`)):t.classList.remove(`ol-grab`,`ol-grabbing`)}featuresAtPixel_(e,t){return t.forEachFeatureAtPixel(e,(e,t)=>{if(!(!(e instanceof eT)||!this.filter_(e,t))&&!(this.features_&&!this.features_.getArray().includes(e)))return e},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(e){this.hitTolerance_=e}setMap(e){let t=this.getMap();super.setMap(e),this.updateState_(t)}handleActiveChanged_(){this.updateState_(null)}updateState_(e){let t=this.getMap(),n=this.getActive();(!t||!n)&&(t||=e,t&&t.getViewport().classList.remove(`ol-grab`,`ol-grabbing`))}};function iU(e){return QH(()=>new rU(e)),null}iU.displayName=`MapTranslateInteraction`;function aU(e){let t=l.useRef(null),n=e=>{let n=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return n instanceof eT&&(t.current={feature:n,coordinate:e.coordinate},!0)},r=e=>{let n=t.current;if(!n)return;let r=n.feature.getGeometry();r&&(r.translate(e.coordinate[0]-n.coordinate[0],e.coordinate[1]-n.coordinate[1]),n.coordinate=e.coordinate)},i=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},a=()=>(t.current=null,!1);return QH(()=>new mI({handleDownEvent:n,handleDragEvent:r,handleMoveEvent:i,handleUpEvent:a,...e})),null}aU.displayName=`MapPointerInteraction`;const oU={SELECT:`select`};var sU=class extends Hw{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const cU={};var lU=class e extends YF{constructor(e){super(),this.on,this.once,this.un,e||={},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:sI,this.addCondition_=e.addCondition?e.addCondition:oI,this.removeCondition_=e.removeCondition?e.removeCondition:oI,this.toggleCondition_=e.toggleCondition?e.toggleCondition:uI,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:Lw,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?uU():e.style,this.features_=e.features||new Qw;let t;if(e.layers){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=Lw;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[X(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[X(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(xw.ADD,this.boundAddFeature_),this.features_.addEventListener(xw.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(xw.ADD,this.boundAddFeature_),this.features_.removeEventListener(xw.REMOVE,this.boundRemoveFeature_))}addFeature_(e){let t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){let e=this.findLayerOfFeature_(t);e&&this.addFeatureLayerAssociation_(t,e)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element),this.removeFeatureLayerAssociation_(e.element)}findLayerOfFeature_(e){return this.getMap().getAllLayers().find(function(t){if(t instanceof kF&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in cU||(cU[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(t){let n=this.getMap().getInteractions().getArray();for(let r=n.length-1;r>=0;--r){let i=n[r];if(i!==this&&i instanceof e&&i.getStyle()&&i.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(i.getStyle());return}}let r=X(t);t.setStyle(cU[r]),delete cU[r]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[X(e)]}selectFeature(e){let t=this.findLayerOfFeature_(e);if(!this.layerFilter_(t)||!this.filter_(e,t))return!1;let n=this.getFeatures();return!n.getArray().includes(e)&&(this.addFeatureLayerAssociation_(e,t),n.push(e),this.dispatchEvent(new sU(oU.SELECT,[e],[],void 0)),!0)}deselectFeature(e){let t=this.getFeatures(),n=t.getArray().indexOf(e);return n!==-1&&(t.removeAt(n),this.dispatchEvent(new sU(oU.SELECT,[],[e],void 0)),!0)}toggleFeature(e){this.deselectFeature(e)||this.selectFeature(e)}clearSelection(){let e=this.getFeatures();if(e.getLength()!==0){let t=e.getArray().slice();e.clear(),this.dispatchEvent(new sU(oU.SELECT,[],t,void 0))}}handleEvent(e){if(!this.condition_(e))return!0;let t=this.addCondition_(e),n=this.removeCondition_(e),r=this.toggleCondition_(e),i=!t&&!n&&!r,a=e.map,o=this.getFeatures(),s=[],c=[];if(i){a.forEachFeatureAtPixel(e.pixel,(e,t)=>{if(!(!(e instanceof eT)||!this.filter_(e,t)))return this.addFeatureLayerAssociation_(e,t),c.push(e),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=o.getLength()-1;e>=0;--e){let t=o.item(e),n=c.indexOf(t);n===-1?(o.removeAt(e),s.push(t)):c.splice(n,1)}c.length!==0&&o.extend(c)}else{a.forEachFeatureAtPixel(e.pixel,(e,i)=>{if(!(e instanceof eT)||!this.filter_(e,i))return;let a=o.getArray().includes(e);return a&&(n||r)?s.push(e):!a&&(t||r)&&(this.addFeatureLayerAssociation_(e,i),c.push(e)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=s.length-1;e>=0;--e)o.remove(s[e]);o.extend(c)}return(c.length>0||s.length>0)&&this.dispatchEvent(new sU(oU.SELECT,c,s,e)),!0}};function uU(){let e=_M();return Pw(e.Polygon,e.LineString),Pw(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const dU=`#ff0000`,fU=`rgba(255, 0, 0, 0.4)`,pU=e=>new yM({text:e,font:`12px Calibri,sans-serif`,fill:new aM({color:`#000`}),stroke:new oM({color:`#fff`,width:3}),offsetY:-10}),mU=e=>{let t=e.getGeometry();if(!(t instanceof mO))return;let n=t.getType();if(n===`Point`)return new pM({image:new fM({radius:6,fill:new aM({color:fU}),stroke:new oM({color:dU,width:2})})});if(n===`LineString`){let e=new pM({stroke:new oM({color:dU,width:3})}),n=oE(t)/1e3;return n>0&&e.setText(pU(`Length: ${n.toFixed(2)} km`)),e}let r=new pM({fill:new aM({color:fU}),stroke:new oM({color:dU,width:2})});try{let e=cE(t)/1e6;e>0&&r.setText(pU(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function hU({onSelect:e,style:t=mU,...n}){let r=QL(),i=QH(()=>new lU({...n,style:t})),a=l.useRef(e);return l.useEffect(()=>{a.current=e},[e]),l.useEffect(()=>{let e=i.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&a.current?.(e)});return()=>Gw(e)},[i]),l.useEffect(()=>{if(!r)return;let e=r.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=i.getFeatures();t.forEach(e=>{i.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,i]),null}hU.displayName=`MapSelectInteraction`;function gU(e){return eE(e,5)}function _U(e){return parseFloat(e)}function vU(e){return gU(e).toString()}function yU(e,t){return!isNaN(e)&&e!==_U(vU(t))}function bU(e,t){return yU(e[0],t[0])||yU(e[1],t[1])}var xU=class extends YF{constructor(e){super(),e=Object.assign({animate:!0,params:[`x`,`y`,`z`,`r`,`l`],replace:!1,prefix:``},e||{});let t;t=e.animate===!0?{duration:250}:e.animate?e.animate:null,this.animationOptions_=t,this.params_=e.params.reduce((e,t)=>(e[t]=!0,e),{}),this.replace_=e.replace,this.prefix_=e.prefix,this.listenerKeys_=[],this.initial_=!0,this.updateState_=this.updateState_.bind(this),this.trackedCallbacks_={},this.trackedValues_={}}getParamName_(e){return this.prefix_?this.prefix_+e:e}get_(e,t){return e.get(this.getParamName_(t))}set_(e,t,n){t in this.params_&&e.set(this.getParamName_(t),n)}delete_(e,t){t in this.params_&&e.delete(this.getParamName_(t))}setMap(e){let t=this.getMap();super.setMap(e),e!==t&&(t&&this.unregisterListeners_(t),e&&(this.initial_=!0,this.updateState_(),this.registerListeners_(e)))}registerListeners_(e){this.listenerKeys_.push(Tw(e,RF.MOVEEND,this.updateUrl_,this),Tw(e.getLayerGroup(),Y.CHANGE,this.updateUrl_,this),Tw(e,`change:layergroup`,this.handleChangeLayerGroup_,this)),this.replace_||addEventListener(`popstate`,this.updateState_)}unregisterListeners_(e){for(let e=0,t=this.listenerKeys_.length;e<t;++e)Dw(this.listenerKeys_[e]);this.listenerKeys_.length=0,this.replace_||removeEventListener(`popstate`,this.updateState_);let t=new URL(window.location.href),n=t.searchParams;this.delete_(n,`x`),this.delete_(n,`y`),this.delete_(n,`z`),this.delete_(n,`r`),this.delete_(n,`l`),window.history.replaceState(null,``,t)}handleChangeLayerGroup_(){let e=this.getMap();e&&(this.unregisterListeners_(e),this.registerListeners_(e),this.initial_=!0,this.updateUrl_())}updateState_(){let e=new URL(window.location.href).searchParams;for(let t in this.trackedCallbacks_){let n=e.get(t);t in this.trackedCallbacks_&&n!==this.trackedValues_[t]&&(this.trackedValues_[t]=n,this.trackedCallbacks_[t](n))}let t=this.getMap();if(!t)return;let n=t.getView();if(!n||!n.isDef())return;let r=!1,i={},a=_U(this.get_(e,`z`));`z`in this.params_&&yU(a,n.getZoom())&&(r=!0,i.zoom=a);let o=_U(this.get_(e,`r`));`r`in this.params_&&yU(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[_U(this.get_(e,`x`)),_U(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&bU(s,n.getCenter())&&(r=!0,i.center=s),r&&(!this.initial_&&this.animationOptions_?n.animate(Object.assign(i,this.animationOptions_)):(i.center&&n.setCenter(i.center),`zoom`in i&&n.setZoom(i.zoom),`rotation`in i&&n.setRotation(i.rotation)));let c=t.getAllLayers(),l=this.get_(e,`l`);if(`l`in this.params_&&l&&l.length===c.length)for(let e=0,t=c.length;e<t;++e){let t=parseInt(l[e]);if(!isNaN(t)){let n=!!t,r=c[e];r.getVisible()!==n&&r.setVisible(n)}}}track(e,t){this.trackedCallbacks_[e]=t;let n=new URL(window.location.href).searchParams.get(e);return this.trackedValues_[e]=n,n}update(e,t){let n=new URL(window.location.href),r=n.searchParams;t===null?r.delete(e):r.set(e,t),e in this.trackedValues_&&(this.trackedValues_[e]=t),this.updateHistory_(n)}updateUrl_(){let e=this.getMap();if(!e)return;let t=e.getView();if(!t||!t.isDef())return;let n=t.getCenter(),r=t.getZoom(),i=t.getRotation(),a=e.getAllLayers(),o=Array(a.length);for(let e=0,t=a.length;e<t;++e)o[e]=a[e].getVisible()?`1`:`0`;let s=new URL(window.location.href),c=s.searchParams;this.set_(c,`x`,vU(n[0])),this.set_(c,`y`,vU(n[1])),this.set_(c,`z`,vU(r)),this.set_(c,`r`,vU(i)),this.set_(c,`l`,o.join(``)),this.updateHistory_(s),this.initial_=!1}updateHistory_(e){e.href!==window.location.href&&(this.initial_||this.replace_?window.history.replaceState(history.state,``,e):window.history.pushState(null,``,e))}};function SU(e){return QH(()=>new xU(e)),null}SU.displayName=`MapLinkInteraction`;const CU={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},wU=37.7649804,TU=-122.4323829,EU=[];function DU({latitude:e,longitude:t,zoom:n,marker:r,markerColor:i,markerLabel:a}){let o=QL(),s=l.useRef(!1);return l.useEffect(()=>{if(!o)return;let r=o.getView(),i=AD([t,e]);if(s.current){r.animate({center:i,zoom:n,duration:500});return}s.current=!0,r.setCenter(i),r.setZoom(n)},[o,e,t,n]),l.useEffect(()=>{if(!o||!r)return;let n=lR(o,[t,e],i,a);return()=>uR(o,n)},[o,e,t,r,i,a]),null}DU.displayName=`MapLocation`;function OU(e,t){let{latitude:n=wU,longitude:r=TU,zoom:i=16,width:a,height:o,controls:s=EU,marker:c=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=e,y=J(f),b=l.useRef(null),x=B(t,b),S=l.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=CU.toolbar,S.current=e}let C=S.current;l.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,K.jsx)(wV,{},e);case`fullScreen`:return(0,K.jsx)(yV,{target:C,source:y},e);case`search`:return(0,K.jsx)(ZH,{target:C},e);case`layers`:return(0,K.jsx)(YH,{target:C},e);case`draw`:return(0,K.jsx)(KH,{target:C},e)}};return(0,K.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:W(CU.root,p),style:{...m,"--map-width":typeof a==`number`?`${a}px`:a,"--map-height":typeof o==`number`?`${o}px`:o},"data-component":`Map`,...v,children:(0,K.jsxs)(ZL,{className:CU.surface,keyboardEventTarget:y,children:[(0,K.jsx)(DU,{latitude:n,longitude:r,zoom:i,marker:c,markerColor:u,markerLabel:d}),s.map(T),h]})})}OU.displayName=`Map`;var kU=G(OU);const AU=Object.assign(kU,{View:$L,Marker:pR,Overlay:hR,LayerGroup:yR,TileLayer:bR,ImageLayer:wR,VectorLayer:TR,GraticuleLayer:ER,HeatmapLayer:iV,WebGLTileLayer:sV,AttributionControl:uV,DrawControl:KH,FullScreenControl:yV,LayersControl:YH,MousePositionControl:OV,OverviewMapControl:MV,ScaleLineControl:wV,SearchControl:ZH,DragRotateAndZoomInteraction:eU,LinkInteraction:SU,PointerInteraction:aU,SelectInteraction:hU,TranslateInteraction:iU}),jU={root:`markdown`};function MU(e,t){let{className:n,source:r,transformers:i,preserveNewLines:a=!1,...o}=e,[s]=(0,v.useLexicalComposerContext)(),c=l.useCallback(e=>{s.setRootElement(e)},[s]),u=B(t,c);return Vi(()=>{s.update(()=>{(0,_.$convertFromMarkdownString)(r,i,void 0,a)},{discrete:!0})},[s,r,i,a]),(0,K.jsx)(`div`,{ref:u,className:W(jU.root,n),"data-component":`Markdown`,...o})}MU.displayName=`MarkdownProse`;var NU=G(MU);const PU=`Markdown`,FU=[S.HeadingNode,S.QuoteNode,x.ListNode,x.ListItemNode,b.LinkNode,y.CodeNode,y.CodeHighlightNode],IU=[_.CHECK_LIST,..._.TRANSFORMERS],LU={paragraph:`markdown-paragraph`,heading:{h1:`markdown-heading-1`,h2:`markdown-heading-2`,h3:`markdown-heading-3`,h4:`markdown-heading-4`,h5:`markdown-heading-5`,h6:`markdown-heading-6`},quote:`markdown-quote`,link:`markdown-link`,code:`markdown-code-block`,list:{ul:`markdown-list-bullet`,ol:`markdown-list-number`,listitem:`markdown-list-item`,checklist:`markdown-list-check`,listitemChecked:`markdown-list-item-checked`,listitemUnchecked:`markdown-list-item-unchecked`,nested:{listitem:`markdown-list-item-nested`}},text:{bold:`markdown-bold`,italic:`markdown-italic`,strikethrough:`markdown-strikethrough`,highlight:`markdown-highlight`,code:`markdown-code-inline`},ltr:`markdown-ltr`,rtl:`markdown-rtl`};function RU(e,t){let{className:n,children:r=``,transformers:i=IU,preserveNewLines:a=!1,namespace:o=PU,onError:s,...c}=e;return(0,K.jsx)(g.LexicalComposer,{initialConfig:{namespace:o,theme:LU,nodes:FU,editable:!1,onError:s??(e=>{throw e})},children:(0,K.jsx)(NU,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}RU.displayName=`Markdown`;var zU=G(RU);const BU={slow:30,medium:60,fast:120},VU={start:`inline`,end:`inline`,top:`block`,bottom:`block`},HU=({side:e=`start`,speed:t=`medium`}={})=>{let n=l.useRef(null),r=l.useRef(null),[i,a]=l.useState(0),[o,s]=l.useState(2),c=VU[e];Vi(()=>{let e=n.current,t=r.current;if(!e||!t)return;let i=()=>{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=c===`inline`?n.width:n.height,o=c===`inline`?r.width:r.height;a(i),s(i>0?Math.max(2,Math.ceil(o/i)+1):2)};if(i(),typeof ResizeObserver>`u`)return;let o=new ResizeObserver(i);return o.observe(e),o.observe(t),()=>{o.disconnect()}},[c]);let u=i>0?i/BU[t]:0;return{rootRef:n,groupRef:r,axis:c,copies:o,distance:i,duration:u,style:{"--marquee-distance":`${i}px`,"--marquee-duration":`${u}s`}}},UU={track:`marquee-track`,group:`marquee-group`},WU=U(`marquee`,{variants:{side:{start:`marquee-inline`,end:`marquee-inline marquee-reversed`,top:`marquee-block`,bottom:`marquee-block marquee-reversed`},spacing:{none:`marquee-spacing-none`,tight:`marquee-spacing-tight`,condensed:`marquee-spacing-condensed`,cozy:`marquee-spacing-cozy`,normal:`marquee-spacing-normal`,spacious:`marquee-spacing-spacious`},pauseOnHover:{true:`marquee-pause-on-hover`,false:``},paused:{true:`marquee-paused`,false:``}}});function GU(e,t){let{className:n,children:r,style:i,side:a=`start`,speed:o=`medium`,spacing:s,pauseOnHover:c=!0,paused:l=!1,...u}=e,{rootRef:d,groupRef:f,axis:p,copies:m,style:h}=HU({side:a,speed:o}),g=B(t,d);return(0,K.jsx)(`div`,{ref:g,className:W(WU({side:a,spacing:s,pauseOnHover:c,paused:l}),n),style:{...i,...h},"data-component":`Marquee`,"data-side":a,"data-axis":p,"data-speed":o,"data-spacing":s,"data-paused":l,...u,children:(0,K.jsx)(`div`,{className:UU.track,children:Array.from({length:m},(e,t)=>(0,K.jsx)(`div`,{ref:t===0?f:void 0,"aria-hidden":t!==0||void 0,className:UU.group,"data-component":`Marquee.Group`,children:r},t))})})}GU.displayName=`Marquee`;var KU=G(GU);const qU=(0,l.createContext)({}),JU=U(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function YU(e,t){let{as:n=`div`,className:r,align:i,...a}=e,{align:o}=l.useContext(qU),s=i??o??`start`,c={align:s};return(0,K.jsx)(bl.Provider,{value:c,children:(0,K.jsx)(n,{ref:t,className:W(JU({align:s}),r),"data-component":`Message`,"data-align":s,...a})})}YU.displayName=`Message`;var XU=G(YU);const ZU={root:`message-avatar`};function QU(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(ZU.root,r),"data-component":`Message.Avatar`,...i})}QU.displayName=`Message.Avatar`;var $U=G(QU);const eW={root:`message-content`};function tW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(eW.root,r),"data-component":`Message.Content`,...i})}tW.displayName=`Message.Content`;var nW=G(tW);const rW={root:`message-footer`};function iW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(rW.root,r),"data-component":`Message.Footer`,...i})}iW.displayName=`Message.Footer`;var aW=G(iW);const oW={root:`message-group`};function sW(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,K.jsx)(qU.Provider,{value:{align:i},children:(0,K.jsx)(n,{ref:t,className:W(oW.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}sW.displayName=`Message.Group`;var cW=G(sW);const lW={root:`message-header`};function uW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(lW.root,r),"data-component":`Message.Header`,...i})}uW.displayName=`Message.Header`;var dW=G(uW);const fW=Object.assign(XU,{Group:cW,Avatar:$U,Content:nW,Header:dW,Footer:aW}),pW=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},mW=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,hW=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return mW(r??0,r,i);let a=e+t*n,o=Math.max(pW(n),pW(e)),s=o===0?a:Number(a.toFixed(o));return mW(s,r,i)},gW=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},_W=(0,l.createContext)({}),vW={root:`meter-indicator`};function yW(e,t){let{as:n=`span`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(vW.root,r),"data-component":`Meter.Indicator`,...i})}yW.displayName=`Meter.Indicator`;var bW=G(yW);const xW={root:`meter-label`};function SW(e,t){let{as:n=`span`,className:r,id:i,...a}=e,{labelId:o}=l.useContext(_W);return(0,K.jsx)(n,{ref:t,id:i??o,className:W(xW.root,r),"data-component":`Meter.Label`,...a})}SW.displayName=`Meter.Label`;var CW=G(SW);const wW={root:`meter-track`};function TW(e,t){let{as:n=`span`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(wW.root,r),"data-component":`Meter.Track`,...i})}TW.displayName=`Meter.Track`;var EW=G(TW);const DW={root:`meter-value`};function OW(e,t){let{className:n,children:r,...i}=e,{formattedValue:a=``,value:o=0}=l.useContext(_W);return(0,K.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:W(DW.root,n),"data-component":`Meter.Value`,...i,children:typeof r==`function`?r({formattedValue:a,value:o}):r??a})}OW.displayName=`Meter.Value`;var kW=G(OW);const AW=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,jW=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),MW={header:`meter-header`,hidden:`sr-only`},NW=U(`meter`,{variants:{size:{small:`meter-small`,medium:`meter-medium`,large:`meter-large`},variant:{accent:`meter-accent`,attention:`meter-attention`,danger:`meter-danger`,done:`meter-done`,neutral:`meter-neutral`,severe:`meter-severe`,sponsors:`meter-sponsors`,success:`meter-success`}}});function PW(e,t){let{as:n=`div`,className:r,style:i,value:a,min:o=0,max:s=100,format:c,getAriaValueText:l,size:u=`medium`,variant:d=`success`,children:f,id:p,"aria-label":m,"aria-labelledby":h,...g}=e,_=`${J(p)}-label`,[v,y]=Sr(f,{label:CW,value:kW,track:EW}),b=mW(Number.isNaN(a)?o:a,o,s),x=mW(AW(b,o,s),0,100),S=jW(b,x,c),C=l?l(S,a):S,w=h??(v.label&&!m?_:void 0),T={value:b,percentage:x,formattedValue:S,labelId:_};return(0,K.jsx)(_W.Provider,{value:T,children:(0,K.jsxs)(n,{ref:t,id:p,role:`meter`,"aria-valuenow":b,"aria-valuemin":o,"aria-valuemax":s,"aria-valuetext":C,"aria-label":m,"aria-labelledby":w,className:W(NW({size:u,variant:d}),r),style:{...i,"--meter-percentage":`${x}%`},"data-component":`Meter`,"data-size":u,"data-variant":d,"data-value":b,...g,children:[v.label||v.value?(0,K.jsxs)(`span`,{className:MW.header,children:[v.label,v.value]}):null,v.track??(0,K.jsx)(EW,{children:(0,K.jsx)(bW,{})}),y,(0,K.jsx)(`span`,{role:`presentation`,className:MW.hidden,children:`x`})]})})}PW.displayName=`Meter`;var FW=G(PW);const IW=Object.assign(FW,{Label:CW,Value:kW,Track:EW,Indicator:bW});function LW(e,t){return(0,K.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}LW.displayName=`NativeSelect.OptGroup`;var RW=G(LW);function zW(e,t){return(0,K.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}zW.displayName=`NativeSelect.Option`;var BW=G(zW);const VW=Object.assign(xx,{Option:BW,OptGroup:RW}),HW={root:`navigation-list-heading`,hidden:`sr-only`};function UW(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,K.jsx)(Er,{as:t,size:`small`,className:W(n?HW.hidden:HW.root,r),"data-component":`NavigationList.Heading`,...i})}UW.displayName=`NavigationList.Heading`;const WW=l.createContext(null),GW=l.createContext({depth:0}),KW=l.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),qW=e=>Number.parseInt(e.slice(1),10),JW=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},YW={heading:UW},XW={container:`NavigationList`};function ZW(e,t){let{children:n,className:r,"aria-label":i,"aria-labelledby":a,...o}=e,[s,c]=Sr(n,YW),u=J(),d=s.heading,f=d?d.props.id??u:void 0,p=d?qW(d.props.as??`h2`):null;return(0,K.jsx)(`nav`,{ref:t,"aria-label":i,"aria-labelledby":a??(i?void 0:f),className:W(r),"data-component":`NavigationList`,...o,children:(0,K.jsxs)(WW.Provider,{value:p,children:[d?l.cloneElement(d,{id:f}):null,(0,K.jsx)(jr.Provider,{value:XW,children:(0,K.jsx)(Mi,{children:c})})]})})}ZW.displayName=`NavigationList`;var QW=l.forwardRef(ZW);function $W(e){let{title:t,children:n,hideDivider:r=!1,...i}=e,a=l.useContext(WW);return(0,K.jsxs)(K.Fragment,{children:[r?null:(0,K.jsx)(Mi.Divider,{}),(0,K.jsxs)(Mi.Group,{"data-component":`NavigationList.Group`,...i,children:[t?(0,K.jsx)(Mi.GroupHeading,{as:JW(a),children:t}):null,n]})]})}$W.displayName=`NavigationList.Group`;const eG={chevron:`navigation-list-chevron`},tG={trailingVisual:Mi.TrailingVisual},nG=e=>{if(!l.isValidElement(e))return!1;let t=e.props[`aria-current`];return t&&t!==`false`?!0:l.Children.toArray(e.props.children).some(nG)};function rG(e){let{children:t,subNavigation:n,defaultOpen:r,className:i}=e,a=J(),o=J(),s=l.useRef(null),c=l.useMemo(()=>nG(n),[n]),[u,d]=l.useState(r??c),[f,p]=l.useState(c);Vi(()=>{let e=c||!!s.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[c,n]);let m=l.useMemo(()=>({buttonId:a,subNavigationId:o,isOpen:u}),[a,o,u]),[h,g]=Sr(t,tG);return(0,K.jsx)(KW.Provider,{value:m,children:(0,K.jsxs)(Mi.Item,{id:a,active:!u&&f,"aria-expanded":u,"aria-controls":o,onSelect:()=>d(e=>!e),className:i,"data-component":`NavigationList.Item`,children:[g,(0,K.jsxs)(Mi.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,K.jsx)(cn,{className:eG.chevron})]}),(0,K.jsx)(Mi.SubItem,{children:l.cloneElement(n,{ref:s})})]})})}rG.displayName=`NavigationList.ItemWithSubNavigation`;const iG={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function aG(e,t){let{className:n,children:r,...i}=e,{buttonId:a,subNavigationId:o,isOpen:s}=l.useContext(KW),{depth:c}=l.useContext(GW),u=l.useMemo(()=>({depth:c+1}),[c]);return!a||!o||c>=4?null:(0,K.jsx)(GW.Provider,{value:u,children:(0,K.jsx)(`ul`,{ref:t,id:o,hidden:!s,"aria-labelledby":a,className:W(iG.root,iG.items,n),"data-component":`NavigationList.SubNavigation`,"data-depth":c+1,...i,children:r})})}aG.displayName=`NavigationList.SubNavigation`;var oG=G(aG);const sG={subNavigation:oG},cG=Mi.LinkItem;function lG(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=Sr(r,sG);return c.subNavigation?(0,K.jsx)(rG,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,K.jsx)(cG,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}lG.displayName=`NavigationList.Item`;var uG=G(lG);const dG=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,K.jsx)(e,{});function fG(e,t){let{label:n=`Show more`,pages:r=0,items:i,renderItem:a,...o}=e,[s,c]=l.useState(0),u=J(),d=i.length/r,f=r===0?i.length:Math.ceil(d*s),p=s===1?0:f-Math.floor(d);return Vi(()=>{s!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[s,u]),(0,K.jsxs)(K.Fragment,{children:[s>0?i.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:o,...s}=e,c=t===p?u:void 0;return a?a({...e,"data-expand-focus-target":c}):(0,K.jsxs)(uG,{"data-expand-focus-target":c,...s,children:[r?(0,K.jsx)(Mi.LeadingVisual,{children:(0,K.jsx)(r,{})}):null,n,i?(0,K.jsx)(Mi.TrailingVisual,{children:dG(i)}):null,o?(0,K.jsx)(Mi.TrailingAction,{...o}):null]},e.id??t)}):null,s<r||s===0?(0,K.jsxs)(Mi.Item,{ref:t,as:`button`,"aria-expanded":!1,onSelect:()=>c(e=>e+1),"data-component":`NavigationList.GroupExpand`,...o,children:[n,(0,K.jsx)(Mi.TrailingVisual,{children:(0,K.jsx)(Ut,{})})]}):null]})}fG.displayName=`NavigationList.GroupExpand`;var pG=l.forwardRef(fG);const mG={root:`navigation-list-group-heading`};function hG(e){let{as:t,className:n,...r}=e,i=l.useContext(WW);return(0,K.jsx)(Mi.GroupHeading,{as:t??JW(i),className:W(mG.root,n),"data-component":`NavigationList.GroupHeading`,...r})}hG.displayName=`NavigationList.GroupHeading`;const gG=br(hG,Ur),_G=Object.assign(QW,{Heading:UW,Item:uG,SubNavigation:oG,Group:$W,GroupHeading:gG,GroupExpand:pG,Description:zr,LeadingVisual:ri,TrailingVisual:xi,TrailingAction:bi,Divider:Vr}),vG={root:`navigation-menu-heading`,hidden:`sr-only`};function yG(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,K.jsx)(Er,{as:t,size:`small`,className:W(n?vG.hidden:vG.root,r),"data-component":`NavigationMenu.Heading`,...i})}yG.displayName=`NavigationMenu.Heading`;const bG=(0,l.createContext)({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),xG=(0,l.createContext)({value:``,triggerId:``,contentId:``,isOpen:!1}),SG=(0,l.createContext)({linkId:``,descriptionId:``}),CG=(0,l.createContext)(null),wG=(0,l.createContext)({depth:0}),TG=e=>Number.parseInt(e.slice(1),10),EG=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},DG={root:`navigation-menu`},OG={heading:yG};function kG(e,t){let{children:n,className:r,value:i,defaultValue:a=null,onValueChange:o,orientation:s=`horizontal`,openOn:c=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=e,g=l.useRef(null),_=B(t,g),[v,y]=Sr(n,OG),b=J(),x=v.heading,S=x?x.props.id??b:void 0,C=x?TG(x.props.as??`h2`):null,w=m??(p?void 0:S),T=i!==void 0,[E,D]=l.useState(a),O=T?i:E,k=l.useRef(o);Vi(()=>{k.current=o},[o]);let A=l.useRef(null),j=l.useRef(null),M=l.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);l.useEffect(()=>M,[M]);let N=l.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=l.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=l.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);Wi(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),l.useEffect(()=>{if(O===null)return;let e=e=>{let{target:t}=e;!(t instanceof Node)||g.current?.contains(t)||N(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[O,N]);let I=e=>{f?.(e),O!==null&&(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget)||N(null))},L=l.useMemo(()=>({openValue:O,setOpenValue:N,orientation:s,openOn:c,openAfterDelay:P,closeAfterDelay:F}),[O,N,s,c,P,F]);return(0,K.jsx)(bG.Provider,{value:L,children:(0,K.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:W(DG.root,r),"data-component":`NavigationMenu`,"data-orientation":s,...h,onBlur:I,children:(0,K.jsxs)(CG.Provider,{value:C,children:[x?l.cloneElement(x,{id:S}):null,y]})})})}kG.displayName=`NavigationMenu`;var AG=l.forwardRef(kG);const jG=U(`navigation-menu-content`,{variants:{open:{true:`motion-safe:data-[orientation=horizontal]:animate-in motion-safe:data-[orientation=horizontal]:fade-in motion-safe:data-[orientation=horizontal]:duration-short motion-safe:data-[orientation=horizontal]:slide-in-from-top-1`,false:``},align:{start:`navigation-menu-content-align-start`,center:`navigation-menu-content-align-center`,end:`navigation-menu-content-align-end`}}});function MG(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e,{orientation:o}=l.useContext(bG),{triggerId:s,contentId:c,isOpen:u}=l.useContext(xG);if(!c)return null;let d=o===`vertical`?void 0:i;return(0,K.jsx)(n,{ref:t,id:c,hidden:!u,"aria-labelledby":s,className:W(jG({open:u,align:d}),r),"data-component":`NavigationMenu.Content`,"data-orientation":o,"data-align":d,"data-open":u?``:void 0,...a})}MG.displayName=`NavigationMenu.Content`;var NG=G(MG);const PG={root:`navigation-menu-description`};function FG(e){let{className:t,...n}=e,{descriptionId:r}=l.useContext(SG);return(0,K.jsx)(`span`,{id:r,className:W(PG.root,t),"data-component":`NavigationMenu.Description`,...n})}FG.displayName=`NavigationMenu.Description`;const IG={root:`navigation-menu-divider`};function LG(e){let{className:t,...n}=e;return(0,K.jsx)(`div`,{"aria-hidden":`true`,className:W(IG.root,t),"data-component":`NavigationMenu.Divider`,...n})}LG.displayName=`NavigationMenu.Divider`;const RG={root:`navigation-menu-group-heading`};function zG(e){let{as:t,className:n,...r}=e,i=l.useContext(CG),a=t??EG(i);return(0,K.jsx)(a,{className:W(RG.root,n),"data-component":`NavigationMenu.GroupHeading`,...r})}zG.displayName=`NavigationMenu.GroupHeading`;const BG={root:`navigation-menu-group`},VG={groupHeading:zG};function HG(e){let{title:t,children:n,className:r,hideDivider:i=!1,...a}=e,o=J(),[s,c]=Sr(n,VG),u=s.groupHeading??(t?(0,K.jsx)(zG,{children:t}):null),d=u?u.props.id??o:void 0;return(0,K.jsxs)(K.Fragment,{children:[i?null:(0,K.jsx)(LG,{}),(0,K.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:W(BG.root,r),"data-component":`NavigationMenu.Group`,...a,children:[u?l.cloneElement(u,{id:d}):null,c]})]})}HG.displayName=`NavigationMenu.Group`;const UG={root:`navigation-menu-item`};function WG(e,t){let{children:n,className:r,value:i,onPointerEnter:a,onPointerLeave:o,...s}=e,c=J(),u=i??c,d=J(),f=J(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=l.useContext(bG),_=p===u,v=e=>{a?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=l.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,K.jsx)(xG.Provider,{value:b,children:(0,K.jsx)(`li`,{ref:t,className:W(UG.root,r),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...s,onPointerEnter:v,onPointerLeave:y,children:n})})}WG.displayName=`NavigationMenu.Item`;var GG=l.forwardRef(WG);const KG={root:`navigation-menu-visual`},qG=({className:e,...t})=>(0,K.jsx)(`span`,{className:W(KG.root,e),...t});function JG(e){return(0,K.jsx)(qG,{"data-component":`NavigationMenu.LeadingVisual`,...e})}JG.displayName=`NavigationMenu.LeadingVisual`;const YG={root:`navigation-menu-sub-navigation`};function XG(e,t){let{className:n,children:r,...i}=e,{linkId:a}=l.useContext(SG),{depth:o}=l.useContext(wG),s=l.useMemo(()=>({depth:o+1}),[o]);return!a||o>=4?null:(0,K.jsx)(wG.Provider,{value:s,children:(0,K.jsx)(`ul`,{ref:t,"aria-labelledby":a,className:W(YG.root,n),"data-component":`NavigationMenu.SubNavigation`,"data-depth":o+1,...i,children:r})})}XG.displayName=`NavigationMenu.SubNavigation`;var ZG=G(XG);const QG={root:`navigation-menu-visual-trailing`};function $G(e){let{className:t,...n}=e;return(0,K.jsx)(qG,{className:W(QG.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}$G.displayName=`NavigationMenu.TrailingVisual`;const eK={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},tK={leadingVisual:JG,trailingVisual:$G,description:FG,subNavigation:ZG};function nK(e,t){let{as:n=`a`,id:r,className:i,active:a,children:o,onClick:s,...c}=e,{setOpenValue:u}=l.useContext(bG),{depth:d}=l.useContext(wG),f=J(r),p=J(),[m,h]=Sr(o,tK),g=l.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{s?.(e),!e.defaultPrevented&&u(null)},v=(0,K.jsxs)(n,{ref:t,id:f,"aria-current":a?`page`:void 0,"aria-describedby":m.description?p:void 0,className:W(eK.root,a&&eK.active,i),"data-component":`NavigationMenu.Link`,"data-active":a?``:void 0,"data-has-description":m.description?``:void 0,...c,onClick:_,children:[m.leadingVisual,(0,K.jsxs)(`span`,{className:eK.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,K.jsxs)(SG.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,K.jsx)(`li`,{className:eK.item,children:y})}nK.displayName=`NavigationMenu.Link`;var rK=G(nK);const iK={root:`navigation-menu-list`},aK=(e,t)=>Array.from(e.querySelectorAll(`[data-component='NavigationMenu.Trigger'], [data-component='NavigationMenu.Link']`)).filter(e=>{let n=e.closest(`[data-component='NavigationMenu.Content']`);return n&&(t===`horizontal`||n.hasAttribute(`hidden`))?!1:!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`});function oK(e,t){let{children:n,className:r,onKeyDown:i,...a}=e,{orientation:o,openValue:s,setOpenValue:c}=l.useContext(bG),u=l.useRef(null),d=B(t,u),f=e=>{i?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=o===`vertical`,r=n?`ArrowDown`:`ArrowRight`,a=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(s===null||!(n instanceof HTMLElement)||!t.contains(n))return;e.preventDefault(),e.stopPropagation(),n.closest(`[data-component='NavigationMenu.Content']`)?.closest(`li`)?.querySelector(`[data-component='NavigationMenu.Trigger']`)?.focus(),c(null);return}let l=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===a?-1:0;if(d===0&&!l)return;let f=aK(t,o),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&s!==null&&c(null),l){f[e.key===`Home`?0:f.length-1].focus();return}f[(p+d+f.length)%f.length].focus()}};return(0,K.jsx)(`ul`,{ref:d,className:W(iK.root,r),"data-component":`NavigationMenu.List`,"data-orientation":o,...a,onKeyDown:f,children:n})}oK.displayName=`NavigationMenu.List`;var sK=l.forwardRef(oK);const cK={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function lK(e,t){let{children:n,className:r,onClick:i,onKeyDown:a,...o}=e,{setOpenValue:s,orientation:c}=l.useContext(bG),{value:u,triggerId:d,contentId:f,isOpen:p}=l.useContext(xG),m=l.useRef(!1);if(Vi(()=>{!p||!m.current||(m.current=!1,hr(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{i?.(e),!e.defaultPrevented&&s(p?null:u)},g=e=>{if(a?.(e),e.defaultPrevented)return;let t=c===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,s(u);return}hr(document.getElementById(f))[0]?.focus()}};return(0,K.jsxs)(`button`,{ref:t,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:W(cK.root,r),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...o,onClick:h,onKeyDown:g,children:[n,(0,K.jsx)(cn,{className:cK.chevron})]})}lK.displayName=`NavigationMenu.Trigger`;var uK=l.forwardRef(lK);const dK=Object.assign(AG,{Heading:yG,List:sK,Item:GG,Trigger:uK,Content:NG,Link:rK,SubNavigation:ZG,Group:HG,GroupHeading:zG,Description:FG,LeadingVisual:JG,TrailingVisual:$G,Divider:LG}),fK={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},pK=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,K.jsxs)(`span`,{className:fK.stepper,"data-component":`NumberInput.Stepper`,children:[(0,K.jsx)(_i,{type:`button`,variant:`invisible`,size:`small`,icon:dn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:fK.step,"data-component":`NumberInput.Increment`}),(0,K.jsx)(_i,{type:`button`,variant:`invisible`,size:`small`,icon:cn,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:fK.step,"data-component":`NumberInput.Decrement`})]});function mK(e,t){let{className:n,value:r,defaultValue:i,min:a,max:o,step:s=1,disabled:c,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=e,g=l.useRef(null),_=B(t,g),v=r!==void 0,[y,b]=l.useState(i??null),x=v?r:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(gW(e.target),e)},w=e=>{let t=hW(x,e,{step:s,min:a,max:o});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&o!==void 0&&x>=o,E=x!=null&&a!==void 0&&x<=a,D=!!c||!!u;return(0,K.jsx)(Yo,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:i,min:a,max:o,step:s,disabled:c,readOnly:u,onChange:C,className:W(fK.root,n),trailingAction:d?void 0:(0,K.jsx)(pK,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}mK.displayName=`NumberInput`;var hK=G(mK);const gK={current:null},_K=(0,l.createContext)({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:gK,contentWrapperRef:gK,sidebarRef:gK,sidebarContentWrapperRef:gK}),vK={root:`page-layout-horizontal-divider`};function yK(e,t){let{className:n,style:r,variant:i=`none`,position:a,...o}=e,{padding:s}=l.useContext(_K);return(0,K.jsx)(`div`,{ref:t,className:W(vK.root,n),style:{"--spacing-divider":`var(--page-layout-spacing-${s})`,...r},"data-component":`PageLayout.HorizontalDivider`,...Gi(`variant`,i),...Gi(`position`,a),...o})}yK.displayName=`PageLayout.HorizontalDivider`;var bK=G(yK);const xK={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function SK(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(_K);return(0,K.jsxs)(`footer`,{ref:t,className:W(xK.root,xK.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Footer`,...Gi(`hidden`,s),...c,children:[(0,K.jsx)(bK,{variant:o,className:xK.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,K.jsx)(`div`,{className:xK.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i})]})}SK.displayName=`PageLayout.Footer`;var CK=G(SK);const wK={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function TK(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(_K);return(0,K.jsxs)(`header`,{ref:t,className:W(wK.root,wK.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Header`,...Gi(`hidden`,s),...c,children:[(0,K.jsx)(`div`,{className:wK.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i}),(0,K.jsx)(bK,{variant:o,className:wK.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}TK.displayName=`PageLayout.Header`;var EK=G(TK);const DK=1280,OK={small:256,medium:296,large:320},kK=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,AK=e=>e===`small`||e===`medium`||e===`large`,jK=e=>AK(e)?OK[e]:kK(e)?parseInt(e.default,10):0,MK=()=>I&&window.innerWidth>=1280?959:511,NK=e=>`Pane width ${e} pixels`,PK=(e,t,n=NK)=>{e&&(t.min!==void 0&&e.setAttribute(`aria-valuemin`,String(t.min)),t.max!==void 0&&e.setAttribute(`aria-valuemax`,String(t.max)),t.current!==void 0&&(e.setAttribute(`aria-valuenow`,String(t.current)),e.setAttribute(`aria-valuetext`,n(t.current))))},FK=({handle:e,pane:t,contentWrapper:n})=>{e?.style.setProperty(`--drag-handle-background-color`,`var(--background-color-accent-emphasis)`),e?.style.setProperty(`--drag-handle-opacity`,`1`),e?.style.setProperty(`--drag-handle-transition`,`none`),t?.setAttribute(`data-dragging`,`true`),n?.setAttribute(`data-dragging`,`true`)},IK=({handle:e,pane:t,contentWrapper:n})=>{e?.style.removeProperty(`--drag-handle-background-color`),e?.style.removeProperty(`--drag-handle-opacity`),e?.style.removeProperty(`--drag-handle-transition`),t?.removeAttribute(`data-dragging`),n?.removeAttribute(`data-dragging`)},LK={save:(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},get:e=>{try{let t=localStorage.getItem(e);if(t!==null){let e=Number(t);if(!Number.isNaN(e)&&e>0)return Math.round(e)}}catch{}return null}},RK={root:`page-layout-drag-handle`},zK=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,BK=e=>e===`ArrowLeft`||e===`ArrowDown`;function VK(e){let{className:t,handleRef:n,onDragStart:r,onDrag:i,onDragEnd:a,onDoubleClick:o,"aria-label":s,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=NK}=e,g=l.useRef({onDragStart:r,onDrag:i,onDragEnd:a});l.useEffect(()=>{g.current={onDragStart:r,onDrag:i,onDragEnd:a}});let _=l.useRef(!1),v=l.useRef(null),y=l.useRef(null),b=l.useCallback(()=>{_.current||=(FK({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[n,p,m]),x=l.useCallback(()=>{_.current&&=(IK({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[n,p,m]);return l.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,K.jsx)(`div`,{ref:n,role:`slider`,tabIndex:0,"aria-label":c?void 0:s??`Draggable pane splitter`,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:W(RK.root,t),onPointerDown:e=>{if(e.button===0){e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}g.current.onDragStart(e.clientX),b()}},onPointerMove:e=>{_.current&&(e.preventDefault(),y.current=e.clientX,v.current===null&&(v.current=requestAnimationFrame(()=>{v.current=null,y.current!==null&&(g.current.onDrag(y.current,!1),y.current=null)})))},onPointerUp:e=>{_.current&&e.preventDefault()},onLostPointerCapture:()=>{_.current&&(v.current!==null&&(cancelAnimationFrame(v.current),v.current=null,y.current=null),x(),g.current.onDragEnd())},onKeyDown:e=>{zK(e.key)&&(e.preventDefault(),b(),g.current.onDrag(BK(e.key)?-3:3,!0))},onKeyUp:e=>{zK(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:o,"data-component":`PageLayout.DragHandle`})}VK.displayName=`PageLayout.DragHandle`;const HK={root:`page-layout-vertical-divider`};function UK(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,K.jsx)(`div`,{ref:t,className:W(HK.root,n),"data-component":`PageLayout.VerticalDivider`,...Gi(`variant`,r),...Gi(`position`,i),...a})}UK.displayName=`PageLayout.VerticalDivider`;var WK=G(UK);const GK=({width:e,minWidth:t,resizable:n,widthStorageKey:r,paneRef:i,handleRef:a,contentWrapperRef:o,constrainToViewport:s=!1,onResizeEnd:c,currentWidth:u,formatValueText:d})=>{let f=kK(e),p=f?parseInt(e.min,10):t,m=f?parseInt(e.max,10):null,h=l.useMemo(()=>jK(e),[e]),g=l.useRef(r),_=l.useRef(c),v=l.useRef(d);Vi(()=>{g.current=r,_.current=c,v.current=d});let y=l.useRef(s?256:511),b=l.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:s?Math.min(m,t):m},[m,p,s]),[x,S]=l.useState(()=>typeof u==`number`?u:c===void 0&&n===!0&&r!==void 0?LK.get(r)??h:h),[C,w]=l.useState(h),[T,E]=l.useState(u),D=u!==T;D&&(E(u),typeof u==`number`?S(u):T!==void 0&&S(h)),h!==C&&(w(h),u===void 0&&!D&&S(h));let O=u??x,k=l.useRef(O),[A,j]=l.useState(()=>m??600),M=l.useRef(A);Vi(()=>{k.current=O},[O]);let N=l.useCallback(()=>jK(e),[e]),P=l.useCallback(e=>{let t=Math.round(e);if(k.current=t,l.startTransition(()=>{S(t)}),_.current){try{_.current(t)}catch{}return}n&&g.current&&LK.save(g.current,t)},[n]),F=l.useRef(b);return Vi(()=>{F.current=b}),Vi(()=>{if(!n)return;let e=window.innerWidth,t=()=>{let t=window.innerWidth,n=e<DK!=t<DK;e=t,n&&(y.current=MK());let r=F.current();i.current?.style.setProperty(`--pane-max-width`,`${r}px`);let o=k.current>r;o&&(k.current=r,i.current?.style.setProperty(`--pane-width`,`${r}px`)),PK(a.current,{max:r,current:k.current},v.current),(r!==M.current||o)&&(M.current=r,l.startTransition(()=>{j(r),o&&S(r)}))};y.current=MK();let r=F.current();if(M.current=r,i.current?.style.setProperty(`--pane-max-width`,`${r}px`),PK(a.current,{min:p,max:r,current:k.current},v.current),l.startTransition(()=>{j(r)}),m!==null&&!s)return;let c=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,i.current?.setAttribute(`data-dragging`,`true`),o?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,i.current?.removeAttribute(`data-dragging`),o?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-c>=16?(c=e,t()):u===null&&(u=requestAnimationFrame(()=>{u=null,c=performance.now(),t()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[n,m,s,p,i,a,o]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},KK={wrapper:`page-layout-sidebar-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-sidebar-position`,sticky:`page-layout-sidebar-sticky`,fullscreen:`page-layout-sidebar-fullscreen`,sidebar:`page-layout-sidebar`,sidebarResizable:`page-layout-sidebar-resizable`,dragging:`page-layout-dragging`,sidebarFullscreen:`page-layout-sidebar-fullscreen-inner`,divider:`page-layout-sidebar-divider`};function qK(e,t){let{className:n,style:r,children:i,id:a,position:o=`start`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,responsiveVariant:_=`default`,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=l.useContext(_K),T=l.useRef(null),E=l.useRef(0),D=l.useRef(0),O=l.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=GK({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=B(t,C),L=cp(C),ee=J(a),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},z=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},te=(0,K.jsx)(WK,{variant:h?`line`:m,position:o,className:KK.divider,children:h?(0,K.jsx)(VK,{handleRef:T,dragTargetRef:C,contentWrapperRef:w,"aria-valuemin":j,"aria-valuemax":M,"aria-valuenow":k,onDragStart:e=>{E.current=e,D.current=C.current?.getBoundingClientRect().width??A.current,O.current=N()},onDrag:(e,t)=>{let n=t?N():O.current;if(t){let t=o===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(z(r),PK(T.current,{current:r,max:n}));return}if(!C.current)return;let r=e-E.current,i=Math.max(j,Math.min(n,D.current+(o===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(z(i),PK(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();z(e),PK(T.current,{current:e}),F(e)}}):null});return(0,K.jsxs)(`div`,{className:W(KK.wrapper,KK.hidden,KK.position,KK.sticky,KK.fullscreen,n),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...r},"data-position":o,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...Gi(`is-hidden`,v),children:[o===`end`?te:null,(0,K.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:W(KK.sidebar,KK.sidebarResizable,KK.sidebarFullscreen,KK.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":kK(s)?s.min:`${c}px`,"--pane-max-width":kK(s)?s.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":kK(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${AK(s)?s:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...a?{id:ee}:{},...x,children:i}),o===`start`?te:null]})}qK.displayName=`PageLayout.Sidebar`;var JK=G(qK);const YK={content:`page-layout-content-row`},XK=U(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),ZK=U(`page-layout-wrapper`,{variants:{width:{full:`page-layout-width-full`,medium:`page-layout-width-medium`,large:`page-layout-width-large`,xlarge:`page-layout-width-xlarge`}}});function QK(e,t){let{className:n,style:r,children:i,containerWidth:a=`xlarge`,padding:o=`normal`,rowGap:s=`normal`,columnGap:c=`normal`,...u}=e,d=l.useRef(null),f=l.useRef(null),p=l.useRef(null),m=l.useRef(null),[h,g]=Sr(i,{header:EK,footer:CK,sidebar:JK}),_=l.useMemo(()=>({padding:o,rowGap:s,columnGap:c,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[o,s,c]);return(0,K.jsx)(_K.Provider,{value:_,children:(0,K.jsxs)(`div`,{ref:t,className:W(XK({hasSidebar:!!h.sidebar}),n),style:{"--spacing":`var(--page-layout-spacing-${o})`,...r},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,K.jsxs)(`div`,{ref:m,className:W(ZK({width:a})),"data-page-layout-wrapper":``,"data-width":a,children:[h.header,(0,K.jsx)(`div`,{className:YK.content,children:g}),h.footer]})]})})}QK.displayName=`PageLayout`;var $K=G(QK);const eq={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},tq=U(`page-layout-content`,{variants:{width:{full:`page-layout-content-width-full`,medium:`page-layout-content-width-medium`,large:`page-layout-content-width-large`,xlarge:`page-layout-content-width-xlarge`}}});function nq(e,t){let{as:n=`main`,className:r,children:i,width:a=`full`,padding:o=`none`,hidden:s=!1,...c}=e,{contentWrapperRef:u}=l.useContext(_K),d=B(t,u);return(0,K.jsx)(n,{ref:d,className:W(eq.wrapper,eq.hidden,eq.dragging,r),"data-component":`PageLayout.Content`,...Gi(`is-hidden`,s),...c,children:(0,K.jsx)(`div`,{className:W(tq({width:a})),"data-width":a,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:i})})}nq.displayName=`PageLayout.Content`;var rq=G(nq);const iq={wrapper:`page-layout-pane-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-pane-position`,sticky:`page-layout-pane-sticky`,pane:`page-layout-pane`,paneResizable:`page-layout-pane-resizable`,dragging:`page-layout-dragging`,horizontalDivider:`page-layout-pane-horizontal-divider`,verticalDivider:`page-layout-pane-vertical-divider`};function aq(e,t){let{className:n,style:r,children:i,id:a,position:o=`end`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f=`paneWidth`,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,offsetHeader:_=0,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,S=ds(o)?`end`:o,C=ds(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=l.useContext(_K),O=l.useRef(null),k=l.useRef(0),A=l.useRef(0),j=l.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=GK({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=B(t,E),z=cp(E),te=J(a),ne=z?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},re=e=>{E.current?.style.setProperty(`--pane-width`,`${e}px`),N.current=e};return(0,K.jsxs)(`div`,{className:W(iq.wrapper,iq.hidden,iq.position,iq.sticky,n),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...r},"data-sticky":g||void 0,...Gi(`is-hidden`,v),...Gi(`position`,o),children:[(0,K.jsx)(bK,{variant:ds(m)?m:{narrow:C,regular:`none`},position:o,className:iq.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,K.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:W(iq.pane,iq.paneResizable,iq.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":kK(s)?s.min:`${c}px`,"--pane-max-width":kK(s)?s.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":kK(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${AK(s)?s:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...a?{id:te}:{},...x,children:i}),(0,K.jsx)(WK,{variant:ds(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:o,className:iq.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,K.jsx)(VK,{handleRef:O,dragTargetRef:E,contentWrapperRef:D,"aria-valuemin":P,"aria-valuemax":F,"aria-valuenow":M,onDragStart:e=>{k.current=e,A.current=E.current?.getBoundingClientRect().width??N.current,j.current=I()},onDrag:(e,t)=>{let n=t?I():j.current;if(t){let t=Math.max(P,Math.min(n,N.current+e));t!==N.current&&(re(t),PK(O.current,{current:t,max:n}));return}if(!E.current)return;let r=e-k.current,i=Math.max(P,Math.min(n,A.current+(S===`end`?-r:r)));Math.round(i)!==Math.round(N.current)&&(re(i),PK(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();re(e),PK(O.current,{current:e}),ee(e)}}):null})]})}aq.displayName=`PageLayout.Pane`;var oq=G(aq);const sq=Object.assign($K,{Header:EK,Content:rq,Pane:oq,Sidebar:JK,Footer:CK}),cq=[`narrow`,`regular`,`wide`],lq={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},uq=U(`pagination-step`,{variants:{step:{previous:`pagination-step-previous`,next:`pagination-step-next`},current:{true:`pagination-step-current`,false:``},inert:{true:`pagination-step-inert`,false:``}}}),dq=e=>typeof e==`object`?cq.filter(t=>e[t]===!1):e?[]:[...cq],fq=({page:e,children:t})=>(0,K.jsxs)(K.Fragment,{children:[e.type===`previous`?(0,K.jsx)(ln,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,K.jsx)(un,{"data-component":`Pagination.NextPageIcon`}):null]}),pq=e=>`#${e}`;function mq(e,t){let{as:n=`nav`,className:r,pageCount:i,currentPage:a,onPageChange:o,hrefBuilder:s=pq,marginPageCount:c=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=e,m=l.useMemo(()=>Lg(i,a,!!d,c,u),[i,a,d,c,u]),h=dq(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=Rg(e,s,t=>o?.(t,e.num)),a=e.type===`previous`||e.type===`next`,c=!!r||!!i[`aria-hidden`],l=W(uq({step:a?e.type:void 0,current:e.selected,inert:c}));if(f&&!r)return f({key:t,children:(0,K.jsx)(fq,{page:e,children:n}),number:e.num,className:l,"data-component":`Pagination.Page`,...i});let u=r?`span`:`a`,d=a?e.type===`previous`?`Pagination.PreviousPage`:`Pagination.NextPage`:`Pagination.Page`;return(0,K.jsx)(u,{role:r?`presentation`:void 0,className:l,"data-component":d,...i,children:(0,K.jsx)(fq,{page:e,children:n})},t)});return(0,K.jsx)(n,{ref:t,"aria-label":`Pagination`,className:W(lq.root,r),"data-component":`Pagination`,...p,children:(0,K.jsx)(`div`,{className:W(lq.steps,h.map(e=>lq.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}mq.displayName=`Pagination`;var hq=G(mq);const gq={root:`password-input`,toggle:`password-input-toggle`};function _q(e,t){let{className:n,visible:r,defaultVisible:i=!1,onVisibilityChange:a,hideToggle:o=!1,showLabel:s=`Show password`,hideLabel:c=`Hide password`,disabled:u,...d}=e,f=r!==void 0,[p,m]=l.useState(i),h=f?r:p;return(0,K.jsx)(Yo,{ref:t,type:h?`text`:`password`,disabled:u,className:W(gq.root,n),trailingAction:o?void 0:(0,K.jsx)(Yo.Action,{icon:h?Sn:Cn,"aria-label":h?c:s,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),a?.(t)},className:gq.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}_q.displayName=`PasswordInput`;var vq=G(_q);const yq={root:`pin-input`},bq=U(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),xq={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},Sq=(e,t)=>Array.from(e).filter(e=>xq[t].test(e)).join(``);function Cq(e,t){let{className:n,length:r=6,value:i,defaultValue:a=``,type:o=`numeric`,mask:s=!1,size:c=`medium`,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m,autoComplete:h,boxLabel:g=`Digit`,onChange:_,onComplete:v,"aria-label":y,"aria-labelledby":b,...x}=e,S=l.useRef([]),C=i!==void 0,[w,T]=l.useState(()=>Sq(a,o).slice(0,r)),E=C?i:w,D=Array.from({length:r},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=l.useRef(!1),A=e=>{let t=S.current[e];k.current=!0,t?.focus(),t?.select(),k.current=!1},j=e=>{C||T(e),_?.(e),e.length===r&&v?.(e)},M=(e,t)=>{let n=Sq(t,o);if(n.length===0)return;let i=O===-1?e:Math.min(e,O),a=[...D],s=i;Array.from(n).forEach(e=>{s<r&&(a[s]=e,s+=1)}),j(a.join(``)),A(Math.min(s,r-1))},N=e=>{let t=[...D];t[e]=``,j(t.join(``))},P=e=>{if(k.current)return;let t=O===-1?e:Math.min(e,O);t!==e&&A(t)},F=(e,t)=>{if(t.target.value===``){N(e);return}M(e,t.target.value)},I=(e,t)=>{u||d||(t.preventDefault(),M(e,t.clipboardData.getData(`text`)))},L=(e,t)=>{if(!(u||d)){if(t.key===`Backspace`){if(t.preventDefault(),D[e]!==``){N(e);return}e>0&&(N(e-1),A(e-1));return}if(t.key===`Delete`){t.preventDefault(),N(e);return}if(t.key===`ArrowLeft`&&e>0){t.preventDefault(),A(e-1);return}if(t.key===`ArrowRight`&&e<r-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(r-1))}};return(0,K.jsx)(`div`,{ref:t,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:W(yq.root,n),"data-component":`PINInput`,"data-size":c,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,K.jsx)(Yo,{ref:e=>{S.current[t]=e},type:s?`password`:`text`,inputMode:o===`numeric`?`numeric`:`text`,size:c,value:e,maxLength:1,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m&&t===0,autoComplete:t===0?h:`off`,"aria-label":`${g} ${t+1} of ${r}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:W(bq({size:c})),"data-component":`PINInput.Box`},t))})}Cq.displayName=`PINInput`;var wq=G(Cq);const Tq={root:`placeholder`};function Eq(e,t){let{as:n=`div`,className:r,width:i,height:a,label:o,style:s,children:c,...l}=e;return(0,K.jsx)(n,{ref:t,className:W(Tq.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}Eq.displayName=`Placeholder`;var Dq=G(Eq);const Oq=(0,l.createContext)({}),kq=U(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function Aq(e,t){let{as:n=`div`,className:r,caret:i=`top`,open:a=!1,relative:o=!1,...s}=e,c={open:a,caret:i};return(0,K.jsx)(Oq.Provider,{value:c,children:(0,K.jsx)(n,{ref:t,className:W(kq({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}Aq.displayName=`Popover`;var jq=G(Aq);const Mq=U(`popover-content`,{variants:{caret:{top:`popover-content-caret-top`,bottom:`popover-content-caret-bottom`,left:`popover-content-caret-left`,right:`popover-content-caret-right`,"top-left":`popover-content-caret-top-left`,"top-right":`popover-content-caret-top-right`,"bottom-left":`popover-content-caret-bottom-left`,"bottom-right":`popover-content-caret-bottom-right`,"left-top":`popover-content-caret-left-top`,"left-bottom":`popover-content-caret-left-bottom`,"right-top":`popover-content-caret-right-top`,"right-bottom":`popover-content-caret-right-bottom`},width:{xsmall:`popover-content-width-xsmall`,small:`popover-content-width-small`,medium:`popover-content-width-medium`,large:`popover-content-width-large`,xlarge:`popover-content-width-xlarge`,auto:`popover-content-width-auto`},height:{small:`popover-content-height-small`,medium:`popover-content-height-medium`,large:`popover-content-height-large`,xlarge:`popover-content-height-xlarge`,auto:`popover-content-height-auto`,"fit-content":`popover-content-height-fit-content`},overflow:{auto:`popover-content-overflow-auto`,hidden:`popover-content-overflow-hidden`,scroll:`popover-content-overflow-scroll`,visible:`popover-content-overflow-visible`}}}),Nq=[];function Pq(e,t){let{as:n=`div`,className:r,width:i=`small`,height:a=`fit-content`,overflow:o=`visible`,onClickOutside:s,onEscape:c,ignoreClickRefs:u=Nq,...d}=e,{open:f=!1,caret:p=`top`}=l.useContext(Oq),m=l.useRef(null),h=B(t,m);return l.useEffect(()=>{if(!f||!s)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(m.current?.contains(t)||u.some(({current:e})=>e?.contains(t))||s(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,s,u]),Wi(e=>{!f||!c||(c(e),e.preventDefault())}),(0,K.jsx)(n,{ref:h,className:W(Mq({caret:p,width:i,height:a,overflow:o}),r),"data-component":`Popover.Content`,"data-caret":p,"data-width":i,"data-height":a,"data-overflow":o,...d})}Pq.displayName=`Popover.Content`;var Fq=G(Pq);const Iq=Object.assign(jq,{Content:Fq}),Lq={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},Rq=U(`progress-circle`,{variants:{size:{small:`progress-circle-small`,medium:`progress-circle-medium`,large:`progress-circle-large`},variant:{accent:`progress-circle-accent`,attention:`progress-circle-attention`,danger:`progress-circle-danger`,done:`progress-circle-done`,neutral:`progress-circle-neutral`,severe:`progress-circle-severe`,sponsors:`progress-circle-sponsors`,success:`progress-circle-success`}}});function zq(e,t){let{as:n=`span`,className:r,progress:i=0,size:a=`medium`,variant:o=`success`,style:s,children:c,"aria-valuenow":u,...d}=e,f=Math.min(Math.max(i,0),100),p=l.Children.toArray(c).length>0;return(0,K.jsxs)(n,{ref:t,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:W(Rq({size:a,variant:o}),r),style:{...s,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":a,"data-variant":o,...d,children:[(0,K.jsxs)(`svg`,{className:Lq.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,K.jsx)(`circle`,{className:Lq.track,cx:16,cy:16,r:14,pathLength:100}),(0,K.jsx)(`circle`,{className:Lq.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,K.jsx)(`span`,{className:Lq.label,children:c}):null]})}zq.displayName=`ProgressCircle`;var Bq=G(zq);const Vq={L:1,M:0,Q:3,H:2},Hq={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},Uq={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function Wq(e,t){let n=Uq[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const Gq={L:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:19,ecCodewordsPerBlock:7,group1Blocks:1,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:34,group2Blocks:0,group2DataCW:0},{totalDataCodewords:55,ecCodewordsPerBlock:15,group1Blocks:1,group1DataCW:55,group2Blocks:0,group2DataCW:0},{totalDataCodewords:80,ecCodewordsPerBlock:20,group1Blocks:1,group1DataCW:80,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:108,group2Blocks:0,group2DataCW:0},{totalDataCodewords:136,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:0,group2DataCW:0},{totalDataCodewords:156,ecCodewordsPerBlock:20,group1Blocks:2,group1DataCW:78,group2Blocks:0,group2DataCW:0},{totalDataCodewords:194,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:97,group2Blocks:0,group2DataCW:0},{totalDataCodewords:232,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:116,group2Blocks:0,group2DataCW:0},{totalDataCodewords:274,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:2,group2DataCW:69},{totalDataCodewords:324,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:81,group2Blocks:0,group2DataCW:0},{totalDataCodewords:370,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:92,group2Blocks:2,group2DataCW:93},{totalDataCodewords:428,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:107,group2Blocks:0,group2DataCW:0},{totalDataCodewords:461,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:523,ecCodewordsPerBlock:22,group1Blocks:5,group1DataCW:87,group2Blocks:1,group2DataCW:88},{totalDataCodewords:589,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:98,group2Blocks:1,group2DataCW:99},{totalDataCodewords:647,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:721,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:120,group2Blocks:1,group2DataCW:121},{totalDataCodewords:795,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:113,group2Blocks:4,group2DataCW:114},{totalDataCodewords:861,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:932,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:116,group2Blocks:4,group2DataCW:117},{totalDataCodewords:1006,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:111,group2Blocks:7,group2DataCW:112},{totalDataCodewords:1094,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:121,group2Blocks:5,group2DataCW:122},{totalDataCodewords:1174,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:1276,ecCodewordsPerBlock:26,group1Blocks:8,group1DataCW:106,group2Blocks:4,group2DataCW:107},{totalDataCodewords:1370,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:114,group2Blocks:2,group2DataCW:115},{totalDataCodewords:1468,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:1531,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:117,group2Blocks:10,group2DataCW:118},{totalDataCodewords:1631,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:116,group2Blocks:7,group2DataCW:117},{totalDataCodewords:1735,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:115,group2Blocks:10,group2DataCW:116},{totalDataCodewords:1843,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:3,group2DataCW:116},{totalDataCodewords:1955,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:0,group2DataCW:0},{totalDataCodewords:2071,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:2191,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:6,group2DataCW:116},{totalDataCodewords:2306,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:121,group2Blocks:7,group2DataCW:122},{totalDataCodewords:2434,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:121,group2Blocks:14,group2DataCW:122},{totalDataCodewords:2566,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:2702,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:122,group2Blocks:18,group2DataCW:123},{totalDataCodewords:2812,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:2956,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:118,group2Blocks:6,group2DataCW:119}],M:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:28,ecCodewordsPerBlock:16,group1Blocks:1,group1DataCW:28,group2Blocks:0,group2DataCW:0},{totalDataCodewords:44,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:44,group2Blocks:0,group2DataCW:0},{totalDataCodewords:64,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:32,group2Blocks:0,group2DataCW:0},{totalDataCodewords:86,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:43,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:27,group2Blocks:0,group2DataCW:0},{totalDataCodewords:124,ecCodewordsPerBlock:18,group1Blocks:4,group1DataCW:31,group2Blocks:0,group2DataCW:0},{totalDataCodewords:154,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:38,group2Blocks:2,group2DataCW:39},{totalDataCodewords:182,ecCodewordsPerBlock:22,group1Blocks:3,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:216,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:43,group2Blocks:1,group2DataCW:44},{totalDataCodewords:254,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:50,group2Blocks:4,group2DataCW:51},{totalDataCodewords:290,ecCodewordsPerBlock:22,group1Blocks:6,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:334,ecCodewordsPerBlock:22,group1Blocks:8,group1DataCW:37,group2Blocks:1,group2DataCW:38},{totalDataCodewords:365,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:40,group2Blocks:5,group2DataCW:41},{totalDataCodewords:415,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:41,group2Blocks:5,group2DataCW:42},{totalDataCodewords:453,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:507,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:1,group2DataCW:47},{totalDataCodewords:563,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:43,group2Blocks:4,group2DataCW:44},{totalDataCodewords:627,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:44,group2Blocks:11,group2DataCW:45},{totalDataCodewords:669,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:41,group2Blocks:13,group2DataCW:42},{totalDataCodewords:714,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:42,group2Blocks:0,group2DataCW:0},{totalDataCodewords:782,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:46,group2Blocks:0,group2DataCW:0},{totalDataCodewords:860,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:47,group2Blocks:14,group2DataCW:48},{totalDataCodewords:914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:45,group2Blocks:14,group2DataCW:46},{totalDataCodewords:1e3,ecCodewordsPerBlock:28,group1Blocks:8,group1DataCW:47,group2Blocks:13,group2DataCW:48},{totalDataCodewords:1062,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:46,group2Blocks:4,group2DataCW:47},{totalDataCodewords:1128,ecCodewordsPerBlock:28,group1Blocks:22,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:1193,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:45,group2Blocks:23,group2DataCW:46},{totalDataCodewords:1267,ecCodewordsPerBlock:28,group1Blocks:21,group1DataCW:45,group2Blocks:7,group2DataCW:46},{totalDataCodewords:1373,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:47,group2Blocks:10,group2DataCW:48},{totalDataCodewords:1455,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:46,group2Blocks:29,group2DataCW:47},{totalDataCodewords:1541,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1631,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:21,group2DataCW:47},{totalDataCodewords:1725,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1812,ecCodewordsPerBlock:28,group1Blocks:12,group1DataCW:47,group2Blocks:26,group2DataCW:48},{totalDataCodewords:1914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:47,group2Blocks:34,group2DataCW:48},{totalDataCodewords:1992,ecCodewordsPerBlock:28,group1Blocks:29,group1DataCW:46,group2Blocks:14,group2DataCW:47},{totalDataCodewords:2102,ecCodewordsPerBlock:28,group1Blocks:13,group1DataCW:46,group2Blocks:32,group2DataCW:47},{totalDataCodewords:2216,ecCodewordsPerBlock:28,group1Blocks:40,group1DataCW:47,group2Blocks:7,group2DataCW:48},{totalDataCodewords:2334,ecCodewordsPerBlock:28,group1Blocks:18,group1DataCW:47,group2Blocks:31,group2DataCW:48}],Q:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:13,ecCodewordsPerBlock:13,group1Blocks:1,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:22,ecCodewordsPerBlock:22,group1Blocks:1,group1DataCW:22,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:17,group2Blocks:0,group2DataCW:0},{totalDataCodewords:48,ecCodewordsPerBlock:26,group1Blocks:2,group1DataCW:24,group2Blocks:0,group2DataCW:0},{totalDataCodewords:62,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:76,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:88,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:110,ecCodewordsPerBlock:22,group1Blocks:4,group1DataCW:18,group2Blocks:2,group2DataCW:19},{totalDataCodewords:132,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:154,ecCodewordsPerBlock:24,group1Blocks:6,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:180,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:22,group2Blocks:4,group2DataCW:23},{totalDataCodewords:206,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:20,group2Blocks:6,group2DataCW:21},{totalDataCodewords:244,ecCodewordsPerBlock:24,group1Blocks:8,group1DataCW:20,group2Blocks:4,group2DataCW:21},{totalDataCodewords:261,ecCodewordsPerBlock:20,group1Blocks:11,group1DataCW:16,group2Blocks:5,group2DataCW:17},{totalDataCodewords:295,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:325,ecCodewordsPerBlock:24,group1Blocks:15,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:367,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:22,group2Blocks:15,group2DataCW:23},{totalDataCodewords:397,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:1,group2DataCW:23},{totalDataCodewords:445,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:21,group2Blocks:4,group2DataCW:22},{totalDataCodewords:485,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:5,group2DataCW:25},{totalDataCodewords:512,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:568,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:614,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:664,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:718,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:754,ecCodewordsPerBlock:28,group1Blocks:28,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:808,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:23,group2Blocks:26,group2DataCW:24},{totalDataCodewords:871,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:24,group2Blocks:31,group2DataCW:25},{totalDataCodewords:911,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:23,group2Blocks:37,group2DataCW:24},{totalDataCodewords:985,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:25,group2DataCW:25},{totalDataCodewords:1033,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:24,group2Blocks:1,group2DataCW:25},{totalDataCodewords:1115,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:24,group2Blocks:35,group2DataCW:25},{totalDataCodewords:1171,ecCodewordsPerBlock:30,group1Blocks:29,group1DataCW:24,group2Blocks:19,group2DataCW:25},{totalDataCodewords:1231,ecCodewordsPerBlock:30,group1Blocks:44,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:1286,ecCodewordsPerBlock:30,group1Blocks:39,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1354,ecCodewordsPerBlock:30,group1Blocks:46,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1426,ecCodewordsPerBlock:30,group1Blocks:49,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1502,ecCodewordsPerBlock:30,group1Blocks:48,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1582,ecCodewordsPerBlock:30,group1Blocks:43,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:1666,ecCodewordsPerBlock:30,group1Blocks:34,group1DataCW:24,group2Blocks:34,group2DataCW:25}],H:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:9,ecCodewordsPerBlock:17,group1Blocks:1,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:26,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:36,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:46,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:11,group2Blocks:2,group2DataCW:12},{totalDataCodewords:60,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:15,group2Blocks:0,group2DataCW:0},{totalDataCodewords:66,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:13,group2Blocks:1,group2DataCW:14},{totalDataCodewords:86,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:14,group2Blocks:2,group2DataCW:15},{totalDataCodewords:100,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:12,group2Blocks:4,group2DataCW:13},{totalDataCodewords:122,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:140,ecCodewordsPerBlock:24,group1Blocks:3,group1DataCW:12,group2Blocks:8,group2DataCW:13},{totalDataCodewords:158,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:180,ecCodewordsPerBlock:22,group1Blocks:12,group1DataCW:11,group2Blocks:4,group2DataCW:12},{totalDataCodewords:197,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:5,group2DataCW:13},{totalDataCodewords:223,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:7,group2DataCW:13},{totalDataCodewords:253,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:283,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:17,group2DataCW:15},{totalDataCodewords:313,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:19,group2DataCW:15},{totalDataCodewords:341,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:13,group2Blocks:16,group2DataCW:14},{totalDataCodewords:385,ecCodewordsPerBlock:28,group1Blocks:15,group1DataCW:15,group2Blocks:10,group2DataCW:16},{totalDataCodewords:406,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:16,group2Blocks:6,group2DataCW:17},{totalDataCodewords:442,ecCodewordsPerBlock:24,group1Blocks:34,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:464,ecCodewordsPerBlock:30,group1Blocks:16,group1DataCW:15,group2Blocks:14,group2DataCW:16},{totalDataCodewords:514,ecCodewordsPerBlock:30,group1Blocks:30,group1DataCW:16,group2Blocks:2,group2DataCW:17},{totalDataCodewords:538,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:596,ecCodewordsPerBlock:30,group1Blocks:33,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:628,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:661,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:31,group2DataCW:16},{totalDataCodewords:701,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:26,group2DataCW:16},{totalDataCodewords:745,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:25,group2DataCW:16},{totalDataCodewords:793,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:845,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:35,group2DataCW:16},{totalDataCodewords:901,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:961,ecCodewordsPerBlock:30,group1Blocks:59,group1DataCW:16,group2Blocks:1,group2DataCW:17},{totalDataCodewords:986,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:41,group2DataCW:16},{totalDataCodewords:1054,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:15,group2Blocks:64,group2DataCW:16},{totalDataCodewords:1096,ecCodewordsPerBlock:30,group1Blocks:24,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:1142,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:15,group2Blocks:32,group2DataCW:16},{totalDataCodewords:1222,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:15,group2Blocks:67,group2DataCW:16},{totalDataCodewords:1276,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:15,group2Blocks:61,group2DataCW:16}]};function Kq(e,t){return Gq[t][e]}const qq=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],Jq=[0,0,0,0,0,0,0,31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017];function Yq(e){return/^\d+$/.test(e)}function Xq(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function Zq(e){return Yq(e)?`numeric`:Xq(e)?`alphanumeric`:`byte`}function Qq(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function $q(e){let t=[],n=0;for(;n+2<e.length;)iJ(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(iJ(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&iJ(t,Number.parseInt(e[n],10),4),t}function eJ(e){let t=[],n=0;for(;n+1<e.length;)iJ(t,Qq(e[n])*45+Qq(e[n+1]),11),n+=2;return n<e.length&&iJ(t,Qq(e[n]),6),t}function tJ(e){let t=[];for(let n of e)iJ(t,n,8);return t}function nJ(e){let t=[];for(let n of e){let e;if(n>=33088&&n<=40956)e=n-33088;else if(n>=57408&&n<=60351)e=n-49472;else throw Error(`Invalid Shift JIS kanji value: 0x${n.toString(16)}`);let r=e>>8&255,i=e&255;iJ(t,r*192+i,13)}return t}function rJ(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=12288&&r<=40959){let e=33088+(r-12288);e<=40956?t.push(e):t.push(57408+(r-12288-7868))}else throw Error(`Character U+${r.toString(16)} cannot be encoded as Kanji`)}return t}function iJ(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function aJ(e,t){return Kq(e,t).totalDataCodewords*8}function oJ(e,t,n,r){let i=n===`auto`||!n?Zq(e):n,a=new TextEncoder().encode(e);if(r){let n=aJ(r,t);if(sJ(e,a,i,r)>n)throw Error(`Data too long for QR version ${r} with EC level ${t}`);return r}for(let n=1;n<=40;n++){let r=aJ(n,t);if(sJ(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function sJ(e,t,n,r){let i=Wq(r,n),a;switch(n){case`numeric`:return a=Math.floor(e.length/3)*10+(e.length%3==2?7:e.length%3==1?4:0),4+i+a;case`alphanumeric`:return a=Math.floor(e.length/2)*11+(e.length%2==1?6:0),4+i+a;case`byte`:return 4+i+t.length*8;case`kanji`:return 4+i+e.length*13;default:return 4+i+t.length*8}}function cJ(e,t){return t&&t!==`auto`?t:Yq(e)?`numeric`:Xq(e)?`alphanumeric`:`byte`}const lJ=new Uint8Array(512),uJ=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)lJ[t]=e,uJ[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)lJ[e]=lJ[e-255]})();function dJ(e,t){return e===0||t===0?0:lJ[(uJ[e]+uJ[t])%255]}function fJ(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,lJ[e]]),r=new Uint8Array(n.length+1);for(let e=0;e<n.length;e++)for(let i=0;i<t.length;i++)r[e+i]^=dJ(n[e],t[i]);n=r}let r=Array.from({length:t},()=>0);for(let i of e){let e=i^r[0];for(let i=0;i<t-1;i++)r[i]=r[i+1]^dJ(e,n[i+1]);r[t-1]=dJ(e,n[t])}return r}function pJ(e,t,n,r,i,a){let o=[],s=[],c=0;for(let i=0;i<n;i++){let n=e.slice(c,c+r);o.push(n),s.push(fJ(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(fJ(n,t)),c+=a}let l=[],u=Math.max(r,a);for(let e=0;e<u;e++)for(let t of o)e<t.length&&l.push(t[e]);for(let e=0;e<t;e++)for(let t of s)e<t.length&&l.push(t[e]);return l}function mJ(e,t={}){let n=t.ecLevel??`M`,r=cJ(e,t.mode),i=oJ(e,n,r,t.version),a=Kq(i,n),o=pJ(gJ(hJ(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)iJ(s,e,8);return{version:i,ecLevel:n,bits:s}}function hJ(e,t,n,r){let i=[],a=Wq(n,t),o=new TextEncoder().encode(e);switch(iJ(i,Hq[t],4),iJ(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...$q(e));break;case`alphanumeric`:i.push(...eJ(e));break;case`byte`:i.push(...tJ(o));break;case`kanji`:{let t=rJ(e);i.push(...nJ(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&iJ(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)iJ(i,l?236:17,8),l=!l;return i}function gJ(e){let t=[];for(let n=0;n<e.length;n+=8){let r=0;for(let t=0;t<8&&n+t<e.length;t++)r=r<<1|e[n+t];t.push(r)}return t}function _J(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function vJ(e,t){let n=e.length;yJ(e,0,0),yJ(e,n-7,0),yJ(e,0,n-7),xJ(e,n),SJ(e,t),e[4*t+9][8]=!0,wJ(e,n),t>=7&&TJ(e,n)}function yJ(e,t,n){let r=e.length;for(let r=0;r<7;r++)for(let i=0;i<7;i++){let a=r===0||r===6||i===0||i===6,o=r>=2&&r<=4&&i>=2&&i<=4;e[t+r][n+i]=a||o}for(let i=-1;i<=7;i++)bJ(e,t-1,n+i,!1,r),bJ(e,t+7,n+i,!1,r),bJ(e,t+i,n-1,!1,r),bJ(e,t+i,n+7,!1,r)}function bJ(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function xJ(e,t){for(let n=8;n<t-8;n++)e[6][n]===null&&(e[6][n]=n%2==0),e[n][6]===null&&(e[n][6]=n%2==0)}function SJ(e,t){if(t<2)return;let n=qq[t-1],r=n.length-1;for(let t=0;t<n.length;t++)for(let i=0;i<n.length;i++)(t!==0||i!==0)&&(t!==0||i!==r)&&(t!==r||i!==0)&&CJ(e,n[t],n[i])}function CJ(e,t,n){for(let r=-2;r<=2;r++)for(let i=-2;i<=2;i++){let a=Math.abs(r)===2||Math.abs(i)===2,o=r===0&&i===0;e[t+r][n+i]=a||o}}function wJ(e,t){for(let n=0;n<=8;n++)n<t&&e[8][n]===null&&(e[8][n]=!1),n<t&&e[n][8]===null&&(e[n][8]=!1);for(let n=0;n<7;n++)e[t-1-n][8]===null&&(e[t-1-n][8]=!1);for(let n=0;n<8;n++)e[8][t-1-n]===null&&(e[8][t-1-n]=!1)}function TJ(e,t){for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[t-11+r][n]===null&&(e[t-11+r][n]=!1);for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[n][t-11+r]===null&&(e[n][t-11+r]=!1)}function EJ(e,t,n){let r=e.length,i=0,a=!0;for(let n=r-1;n>=1;n-=2){n===6&&(n=5);let o=a?Array.from({length:r},(e,t)=>r-1-t):Array.from({length:r},(e,t)=>t);for(let r of o)for(let a of[n,n-1])e[r][a]===null&&(e[r][a]=i<t.length&&t[i]===1,i++);a=!a}}function DJ(e,t,n,r){if(e<9&&t<9||e<9&&t>=n-8||e>=n-8&&t<9||e===6||t===6)return!1;if(r>=2){let i=qq[r-1];for(let r of i)for(let a of i)if(!(r<9&&a<9)&&!(r<9&&a>=n-8)&&!(r>=n-8&&a<9)&&e>=r-2&&e<=r+2&&t>=a-2&&t<=a+2)return!1}return!(r>=7&&(e<6&&t>=n-11&&t<=n-9||t<6&&e>=n-11&&e<=n-9)||e===8||t===8||e>=n-8&&t===8||e===8&&t>=n-8)}function OJ(e){switch(e){case 0:return(e,t)=>(e+t)%2==0;case 1:return e=>e%2==0;case 2:return(e,t)=>t%3==0;case 3:return(e,t)=>(e+t)%3==0;case 4:return(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0;case 5:return(e,t)=>e*t%2+e*t%3==0;case 6:return(e,t)=>(e*t%2+e*t%3)%2==0;case 7:return(e,t)=>((e+t)%2+e*t%3)%2==0;default:return()=>!1}}function kJ(e,t,n,r){let i=OJ(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)DJ(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function AJ(e,t,n,r){if(r!==void 0&&r>=0&&r<=7)return r;let i=0,a=1/0;for(let r=0;r<8;r++){let o=e.map(e=>[...e]);kJ(o,r,t,n);let s=jJ(o,t);s<a&&(a=s,i=r)}return i}function jJ(e,t){return MJ(e,t)+NJ(e,t)+PJ(e,t)+FJ(e,t)}function MJ(e,t){let n=0;for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[r][a]==!!e[r][a-1]?(i++,i===5?n+=3:i>5&&n++):i=1}for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[a][r]==!!e[a-1][r]?(i++,i===5?n+=3:i>5&&n++):i=1}return n}function NJ(e,t){let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=!!e[r][i];t===!!e[r][i+1]&&t===!!e[r+1][i]&&t===!!e[r+1][i+1]&&(n+=3)}return n}function PJ(e,t){let n=0,r=[!0,!1,!0,!0,!0,!1,!0,!1,!1,!1,!1],i=[!1,!1,!1,!1,!0,!1,!0,!0,!0,!1,!0];for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[a][o+n]!==r[n]&&(t=!1),!!e[a][o+n]!==i[n]&&(s=!1);(t||s)&&(n+=40)}for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[o+n][a]!==r[n]&&(t=!1),!!e[o+n][a]!==i[n]&&(s=!1);(t||s)&&(n+=40)}return n}function FJ(e,t){let n=0,r=t*t;for(let r=0;r<t;r++)for(let i=0;i<t;i++)e[r][i]&&n++;let i=n/r,a=Math.floor(i*20)*5,o=Math.ceil(i*20)*5;return Math.min(Math.abs(a-50),Math.abs(o-50))*2}function IJ(e,t){let n=Vq[e]<<3|t,r=n<<10;for(let e=4;e>=0;e--)r&1<<e+10&&(r^=1335<<e);return(n<<10|r)^21522}function LJ(e,t,n){let r=e.length,i=IJ(t,n),a=[[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,7],[8,8],[7,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8]];for(let t=0;t<15;t++){let n=(i>>14-t&1)==1,[r,o]=a[t];e[r][o]=n}for(let t=0;t<7;t++){let n=(i>>14-t&1)==1;e[r-1-t][8]=n}for(let t=0;t<8;t++){let n=(i>>7-t&1)==1;e[8][r-8+t]=n}}function RJ(e,t){if(t<7)return;let n=e.length,r=Jq[t];for(let t=0;t<18;t++){let i=(r>>t&1)==1,a=Math.floor(t/3),o=t%3;e[n-11+o][a]=i,e[a][n-11+o]=i}}var zJ=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},BJ=class extends zJ{constructor(...e){super(...e),this.name=`InvalidInputError`}};function VJ(e,t={}){let{version:n,ecLevel:r,bits:i}=mJ(e,t),a=n*4+17,o=_J(a);vJ(o,n),EJ(o,i,n);let s=AJ(o,a,n,t.mask);return kJ(o,s,a,n),LJ(o,r,s),n>=7&&RJ(o,n),o.map(e=>e.map(e=>e===!0))}function HJ(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}const UJ=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function WJ(e){let t=4294967295;for(let n=0;n<e.length;n++)t=UJ[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function GJ(e){let t=1,n=0;for(let r=0;r<e.length;r++)t=(t+e[r])%65521,n=(n+t)%65521;return(n<<16|t)>>>0}function KJ(e){let t=65535,n=Math.ceil(e.length/t)||1,r=new Uint8Array(n*5+e.length),i=0,a=0;for(;a<e.length||i===0;){let n=e.length-a,o=Math.min(n,t),s=a+o>=e.length;r[i++]=+!!s,r[i++]=o&255,r[i++]=o>>8&255,r[i++]=~o&255,r[i++]=~o>>8&255,r.set(e.subarray(a,a+o),i),i+=o,a+=o}return r.subarray(0,i)}function qJ(e){let t=KJ(e),n=GJ(e),r=new Uint8Array(2+t.length+4);r[0]=120,r[1]=1,r.set(t,2);let i=2+t.length;return r[i]=n>>24&255,r[i+1]=n>>16&255,r[i+2]=n>>8&255,r[i+3]=n&255,r}const JJ=new Uint8Array([137,80,78,71,13,10,26,10]);function YJ(e,t){let n=new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]),r=new Uint8Array(8+t.length+4),i=new DataView(r.buffer);i.setUint32(0,t.length),r.set(n,4),r.set(t,8);let a=new Uint8Array(4+t.length);return a.set(n,0),a.set(t,4),i.setUint32(8+t.length,WJ(a)),r}function XJ(e,t,n){let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,e),i.setUint32(4,t),r[8]=8,r[9]=6,r[10]=0,r[11]=0,r[12]=0;let a=e*4,o=t*(1+a),s=new Uint8Array(o),c=0;for(let e=0;e<t;e++)s[c++]=0,s.set(n.subarray(e*a,e*a+a),c),c+=a;let l=qJ(s),u=YJ(`IHDR`,r),d=YJ(`IDAT`,l),f=YJ(`IEND`,new Uint8Array),p=JJ.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(JJ,h),h+=JJ.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function ZJ(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint16(0,!0),r=t.getUint16(2,!0),i=t.getUint16(4,!0);if(n!==0||r!==1&&r!==2||i===0)throw Error(`Invalid ICO file`);let a;for(let e=0;e<i;e++){let n=6+e*16,r=t.getUint8(n)||256,i=t.getUint8(n+1)||256,o=t.getUint32(n+8,!0),s=t.getUint32(n+12,!0);(!a||r*i>a.width*a.height)&&(a={width:r,height:i,size:o,offset:s})}let o=a,s=e.subarray(o.offset,o.offset+o.size);return s.length>=4&&t.getUint32(o.offset)===2303741511?`data:image/png;base64,${aY(s)}`:QJ(s,o.width,o.height)}function QJ(e,t,n){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0),a=r.getInt32(4,!0)||t,o=n,s=r.getUint16(14,!0),c=r.getUint32(16,!0);if(c!==0&&c!==3)throw Error(`Unsupported BMP compression: ${c}`);let l=new Uint8Array(a*o*4);if(s===32)$J(e,i,a,o,l);else if(s===24)eY(e,i,a,o,l);else if(s<=8)tY(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=rY(a,o,s),n=i+nY(e,i,s)+t;n<e.length&&iY(e,n,a,o,l)}return`data:image/png;base64,${aY(XJ(a,o,l))}`}function $J(e,t,n,r,i){let a=t,o=n*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*4,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=e[n+3]}}}function eY(e,t,n,r,i){let a=t+nY(e,t,24),o=Math.ceil(n*3/4)*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*3,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=255}}}function tY(e,t,n,r,i,a){let o=nY(e,t,i),s=e.subarray(t,t+o),c=t+o,l=Math.ceil(n*i/32)*4;for(let t=0;t<r;t++){let o=c+(r-1-t)*l,u=t*n*4;for(let t=0;t<n;t++){let n;if(i===8)n=e[o+t];else if(i===4){let r=e[o+(t>>1)];n=t&1?r&15:r>>4&15}else n=e[o+(t>>3)]>>7-(t&7)&1;let r=n*4,c=u+t*4;a[c]=s[r+2],a[c+1]=s[r+1],a[c+2]=s[r],a[c+3]=255}}}function nY(e,t,n){if(n>=16)return 0;let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return((t>=36?r.getUint32(32,!0):0)||1<<n)*4}function rY(e,t,n){return Math.ceil(e*n/32)*4*t}function iY(e,t,n,r,i){let a=Math.ceil(n/32)*4;for(let o=0;o<r;o++){let s=t+(r-1-o)*a,c=o*n*4;for(let t=0;t<n;t++){let n=s+(t>>3);if(n>=e.length)return;(e[n]>>7-(t&7)&1)==1&&(i[c+t*4+3]=0)}}}function aY(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const oY=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function sY(e,t,n,r){let i=e.size??.3,a=e.margin??0,o=e.hideBackgroundDots??!0,s=t*n,c=s*i,l=r*n+(s-c)/2,u=r*n+(s-c)/2,d=new Set;if(o){let e=Math.floor((t-t*i)/2-a/n),r=Math.ceil((t+t*i)/2+a/n);for(let n=Math.max(0,e);n<Math.min(t,r);n++)for(let i=Math.max(0,e);i<Math.min(t,r);i++)d.add(`${n},${i}`)}let f=``;if(e.backgroundColor){let t=a,n=c+2*t,r=`x="${l-t}" y="${u-t}"`,i=`fill="${HJ(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(oY.test(e.svg))throw new BJ(`logo.svg contains potentially dangerous content (script, event handlers, or foreignObject)`);let t=`x="${l}" y="${u}"`,n=`width="${c}" height="${c}"`;f+=`<svg ${t} ${n} viewBox="0 0 1 1">`,f+=`<g transform="scale(1)">${e.svg}</g></svg>`}else if(e.path){let t=HJ(e.path),n=`translate(${l},${u}) scale(${c/100})`;f+=`<path d="${t}" transform="${n}" fill="currentColor"/>`}else if(e.imageUrl){if(!/^(https?:|data:image\/)/i.test(e.imageUrl))throw new BJ(`imageUrl must use https:, http:, or data:image/ scheme`);let t=e.imageUrl.match(/^data:image\/(x-icon|vnd\.microsoft\.icon);base64,(.+)$/i),n=e.imageUrl;if(t){let e=atob(t[2]),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);n=ZJ(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${HJ(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function cY(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return lY(e+o,t+o,a);case`rounded`:return uY(e+o,t+o,a,a*.25);case`dots`:return dY(e+n/2,t+n/2,a/2);case`diamond`:return fY(e+n/2,t+n/2,a);case`classy`:return pY(e+o,t+o,a);case`classy-rounded`:return mY(e+o,t+o,a);case`extra-rounded`:return uY(e+o,t+o,a,a*.5);case`vertical-line`:return hY(e+o,t,n,a);case`horizontal-line`:return gY(e,t+o,n,a);case`small-square`:return lY(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return lY(e+n*.25,t+n*.25,n*.5);default:return lY(e+o,t+o,a)}}function lY(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function uY(e,t,n,r){return r=Math.min(r,n/2),`M${e+r},${t}h${n-2*r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-2*r}a${r},${r},0,0,1,-${r},-${r}v-${n-2*r}a${r},${r},0,0,1,${r},-${r}z`}function dY(e,t,n){return`M${e-n},${t}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,-${2*n},0z`}function fY(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function pY(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-r}h-${n}v-${n}z`}function mY(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-r}v-${n}z`}function hY(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function gY(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function _Y(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return yY(e,t,i,i,r)+bY(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return dY(e+r,t+r,r)+dY(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return yY(e,t,i,i,r)+bY(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return yY(e,t,i,i,r)+bY(e+n,t+n,i-2*n,i-2*n,r*.5)}default:{let r=i-2*n;return`M${e},${t}h${i}v${i}h-${i}zM${e+n},${t+n}v${r}h${r}v-${r}z`}}}function vY(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return dY(a,o,i/2);case`rounded`:return uY(e+n*2,t+n*2,i,n*.75);default:return lY(e+n*2,t+n*2,i)}}function yY(e,t,n,r,i){return`M${e+i},${t}h${n-2*i}a${i},${i},0,0,1,${i},${i}v${r-2*i}a${i},${i},0,0,1,-${i},${i}h-${n-2*i}a${i},${i},0,0,1,-${i},-${i}v-${r-2*i}a${i},${i},0,0,1,${i},-${i}z`}function bY(e,t,n,r,i){return yY(e,t,n,r,i)}const xY={root:`qr-code`,canvas:`qr-code-canvas`,background:`qr-code-background`,modules:`qr-code-modules`,corner:`qr-code-corner`,logo:`qr-code-logo`,fallback:`qr-code-fallback`},SY=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function CY(e,t){let{value:n,size:r=200,margin:i=4,ecLevel:a,version:o,mode:s,mask:c,dotType:u=`square`,dotSize:d=1,corners:f,color:p,background:m,logo:h,logoSize:g=.3,label:_,fallback:v=null,className:y,style:b,...x}=e,S=a??(h?`H`:void 0),C=l.useMemo(()=>{if(!n)return null;try{return VJ(n,{ecLevel:S,version:o,mode:s,mask:c})}catch{return null}},[n,S,o,s,c]);if(!C)return(0,K.jsx)(`div`,{ref:t,className:W(xY.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,K.jsx)(`span`,{className:xY.fallback,children:v}):null});let w=C.length,T=w+i*2,E=r/T,D=h?sY({size:g},w,E,i).hiddenModules:void 0,O=SY(w),k=new Set;if(f)for(let e of O)for(let t=0;t<7;t++)for(let n=0;n<7;n++)k.add(`${e.row+t},${e.col+n}`);let A=[];for(let e=0;e<w;e++)for(let t=0;t<w;t++){if(!C[e][t])continue;let n=`${e},${t}`;D?.has(n)||k.has(n)||A.push(cY((t+i)*E,(e+i)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+i)*E,a=(t+i)*E;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`path`,{className:xY.corner,d:_Y(r,a,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,K.jsx)(`path`,{className:xY.corner,d:vY(r,a,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,K.jsxs)(`div`,{ref:t,role:`img`,"aria-label":_??n,className:W(xY.root,y),style:{...b,"--qr-code-color":p,"--qr-code-background":m,"--qr-code-logo-size":h?`${M*100}%`:void 0},"data-component":`QRCode`,"data-dot-type":u,...x,children:[(0,K.jsxs)(`svg`,{className:xY.canvas,width:r,height:r,viewBox:`0 0 ${r} ${r}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,K.jsx)(`rect`,{className:xY.background,width:`100%`,height:`100%`}),f?O.map(e=>(0,K.jsx)(l.Fragment,{children:j(f[e.key],e.row,e.col)},e.key)):null,A.length>0?(0,K.jsx)(`path`,{className:xY.modules,d:A.join(``)}):null]}),h?(0,K.jsx)(`span`,{className:xY.logo,"aria-hidden":`true`,children:h}):null]})}CY.displayName=`QRCode`;var wY=G(CY);const TY=(0,l.createContext)({}),EY={root:`radio-card-description`};function DY(e,t){let{className:n,id:r,...i}=e,{descriptionId:a}=l.useContext(TY);return(0,K.jsx)(`span`,{ref:t,id:r??a,className:W(EY.root,n),"data-component":`RadioCard.Description`,...i})}DY.displayName=`RadioCard.Description`;var OY=G(DY);const kY={root:`radio-card-label`};function AY(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(TY);return(0,K.jsx)(`span`,{ref:t,id:r??a,className:W(kY.root,n),"data-component":`RadioCard.Label`,...i})}AY.displayName=`RadioCard.Label`;var jY=G(AY);const MY={root:`radio-card-leading-visual`};function NY(e,t){let{className:n,"aria-label":r,...i}=e;return(0,K.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:W(MY.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}NY.displayName=`RadioCard.LeadingVisual`;var PY=G(NY);const FY={body:`radio-card-body`,control:`radio-card-control`},IY=U(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function LY(e,t){let{className:n,children:r,value:i,name:a,checked:o,defaultChecked:s,disabled:c,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=e,v=l.useContext(Sx).disabled||c,y=J(p),b=`${y}-label`,x=`${y}-description`,[S,C]=Sr(r,{leadingVisual:PY,label:jY,description:OY}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,K.jsx)(TY.Provider,{value:{labelId:b,descriptionId:x},children:(0,K.jsxs)(`label`,{ref:t,className:W(IY({disabled:!!v,validation:d}),n),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,K.jsxs)(`div`,{className:FY.body,children:[S.label,S.description,C]}),(0,K.jsx)(Tx,{id:y,value:i,name:a,checked:o,defaultChecked:s,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:FY.control})]})})}LY.displayName=`RadioCard`;var RY=G(LY);const zY=Object.assign(RY,{LeadingVisual:PY,Label:jY,Description:OY}),BY={root:`radio-group-caption`};function VY(e,t){let{className:n,...r}=e,{captionId:i}=l.useContext(Sx);return(0,K.jsx)(`span`,{ref:t,id:i,className:W(BY.root,n),"data-component":`RadioGroup.Caption`,...r})}VY.displayName=`RadioGroup.Caption`;var HY=G(VY);const UY={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function WY(e,t){let{className:n,children:r,visuallyHidden:i,...a}=e,{disabled:o,required:s}=l.useContext(Sx);return(0,K.jsxs)(`span`,{ref:t,title:s?`required field`:void 0,className:W(UY.root,o&&UY.disabled,i&&UY.hidden,n),"data-component":`RadioGroup.Label`,"data-label-disabled":o,...a,children:[r,s?(0,K.jsx)(`span`,{className:UY.required,children:`*`}):null]})}WY.displayName=`RadioGroup.Label`;var GY=G(WY);const KY={success:on,error:xn},qY={icon:`radio-group-validation-icon`},JY=U(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function YY(e,t){let{className:n,children:r,variant:i,...a}=e,{validationMessageId:o}=l.useContext(Sx),s=KY[i];return(0,K.jsxs)(`span`,{ref:t,className:W(JY({variant:i}),n),"data-component":`RadioGroup.Validation`,"data-validation-status":i,...a,children:[(0,K.jsx)(s,{className:qY.icon,"aria-hidden":`true`}),(0,K.jsx)(`span`,{id:o,children:r})]})}YY.displayName=`RadioGroup.Validation`;var XY=G(YY);const ZY={root:`radio-group`,legend:`radio-group-legend`,legendVisible:`radio-group-legend-visible`,body:`radio-group-body`,validation:`radio-group-validation-slot`,hidden:`sr-only`};function QY(e,t){let{as:n=`fieldset`,className:r,children:i,name:a,disabled:o,required:s,onChange:c,id:u,"aria-labelledby":d,...f}=e,[p,m]=Sr(i,{label:GY,caption:HY,validation:XY}),h=J(u),g=p.caption?`${h}-caption`:void 0,_=p.validation?`${h}-validation`:void 0,v=e=>{let{value:t,checked:n}=e.currentTarget;n&&c?.(t,e)},y=l.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:a,disabled:o,required:s,captionId:g,validationMessageId:_,onChange:v};return(0,K.jsx)(Sx.Provider,{value:b,children:(0,K.jsxs)(n,{ref:t,id:h,disabled:o,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:W(ZY.root,r),"data-component":`RadioGroup`,"data-disabled":o,"data-required":s,...f,children:[p.label?(0,K.jsxs)(`legend`,{className:W(ZY.legend,y&&ZY.legendVisible),children:[p.label,s?(0,K.jsx)(`span`,{className:ZY.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,K.jsx)(`div`,{className:ZY.body,children:m}),p.validation?(0,K.jsx)(`div`,{className:ZY.validation,children:p.validation}):null]})})}QY.displayName=`RadioGroup`;var $Y=G(QY);const eX=Object.assign($Y,{Label:GY,Caption:HY,Validation:XY}),tX={item:`rating-item`,input:`rating-input`,srOnly:`sr-only`,star:`rating-star`,starTrack:`rating-star-track`,starFill:`rating-star-fill`,starFillIcon:`rating-star-fill-icon`},nX=U(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),rX=e=>e===1?`1 star`:`${e} stars`,iX=(e,t)=>`${e} out of ${t} stars`,aX=({className:e})=>(0,K.jsx)(`svg`,{className:e,"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{d:`M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z`})});function oX(e,t){let{className:n,style:r,count:i=5,value:a,defaultValue:o,size:s=`medium`,readOnly:c,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=rX,valueLabel:h=iX,"aria-label":g,..._}=e,v=a!==void 0,[y,b]=l.useState(()=>o??0),x=v?a:y,S=Math.max(Math.trunc(i),0),C=Math.min(Math.max(x,0),S),w=J(f),T=!c&&!u,E=e=>{T&&(v||b(e),p?.(e))},D=e=>{E(Number(e.currentTarget.value))},O=e=>{d&&Number(e.currentTarget.value)===C&&E(0)},k=c?`span`:`label`;return(0,K.jsx)(`span`,{ref:t,role:c?`img`:`radiogroup`,"aria-label":c?g??h(C,S):g,className:W(nX({size:s,interactive:T,disabled:!!u}),n),style:{...r,"--rating-value":C},"data-component":`Rating`,"data-size":s,"data-value":C,"data-count":S,"data-readonly":c,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,K.jsxs)(k,{className:tX.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[c?null:(0,K.jsx)(`input`,{type:`radio`,className:W(tX.input,tX.srOnly),name:w,value:n,checked:n===C,disabled:u,"aria-label":m(n,S),onChange:D,onClick:O,"data-component":`Rating.Input`}),(0,K.jsxs)(`span`,{className:tX.star,"aria-hidden":`true`,children:[(0,K.jsx)(aX,{className:tX.starTrack}),(0,K.jsx)(`span`,{className:tX.starFill,children:(0,K.jsx)(aX,{className:tX.starFillIcon})})]})]},n)})})}oX.displayName=`Rating`;var sX=G(oX);const cX=1e3,lX=60*cX,uX=60*lX,dX=24*uX,fX=7*dX,pX=30*dX,mX=12*pX,hX=`P30D`,gX=[{unit:`year`,length:mX},{unit:`month`,length:pX},{unit:`week`,length:fX},{unit:`day`,length:dX},{unit:`hour`,length:uX},{unit:`minute`,length:lX},{unit:`second`,length:cX}],_X=[`year`,`month`,`day`,`hour`,`minute`,`second`],vX={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},yX=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),bX=e=>{let t=yX.exec(e);if(!t||t.slice(1).every(e=>e===void 0))return null;let[,n,r,i,a,o,s,c]=t;return Number(n??0)*mX+Number(r??0)*pX+Number(i??0)*fX+Number(a??0)*dX+Number(o??0)*uX+Number(s??0)*lX+Number(c??0)*cX},xX=e=>{let t=Math.abs(e),{unit:n,length:r}=gX.find(({length:e})=>t>=e)??gX[gX.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},SX=(e,t)=>{let n=Math.floor(Math.abs(e)/cX),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24),o=Math.floor(a/30),s=Math.floor(o/12),c={year:s,month:o-s*12,day:a-o*30,hour:i-a*24,minute:r-i*60,second:n-r*60};return _X.slice(0,_X.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},CX=e=>{let{value:t,unit:n}=xX(e);return n===`second`?`1m`:`${Math.abs(t)}${vX[n]}`},wX=(e,t)=>{let n=SX(e,t).filter(({count:e})=>e>0);return n.length===0?`0${vX[t]}`:n.map(({unit:e,count:t})=>`${t}${vX[e]}`).join(` `)},TX=(e,t)=>{let{value:n,unit:r}=xX(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},EX=(e,t,n)=>{let r=e.getFullYear()===new Date(t).getFullYear();return{weekday:n.weekday,year:n.year??(r?void 0:`numeric`),month:n.month??`short`,day:n.day??`numeric`,hour:n.hour,minute:n.minute,second:n.second,timeZoneName:n.timeZoneName}},DX=(e,t,n,r)=>new Intl.DateTimeFormat(r,EX(e,t,n)).format(e),OX=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),kX=(e,t,n)=>{let{format:r,tense:i,precision:a,threshold:o,prefix:s,dateOptions:c,locale:l}=n,u=e.getTime()-t;if(r===`elapsed`)return{text:wX(u,a),updateDelay:gX.find(({unit:e})=>e===a)?.length??cX};let d=bX(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=xX(u);return{text:r===`micro`?CX(u):TX(u,l),updateDelay:e}}let f=DX(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},AX=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function jX(e,t){let{as:n=`time`,children:r,date:i,datetime:a,format:o=`auto`,tense:s=`auto`,precision:c=`second`,threshold:u=hX,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=e,S=AX(i,a),[C,w]=l.useState(()=>Date.now()),{text:T,updateDelay:E}=S?kX(S,C,{format:o,tense:s,precision:c,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return l.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,K.jsx)(n,{ref:t,dateTime:S?.toISOString(),title:f||!S?void 0:OX(S),"data-component":`RelativeTime`,"data-format":o,"data-tense":s,...x,children:r??T})}jX.displayName=`RelativeTime`;var MX=G(jX);const NX=(0,l.createContext)({}),PX=`RichTextEditor`,FX=[S.HeadingNode,S.QuoteNode,x.ListNode,x.ListItemNode,b.LinkNode,b.AutoLinkNode],IX={paragraph:`rich-text-editor-paragraph`,heading:{h1:`rich-text-editor-heading-1`,h2:`rich-text-editor-heading-2`,h3:`rich-text-editor-heading-3`},quote:`rich-text-editor-quote`,link:`rich-text-editor-link`,list:{ul:`rich-text-editor-list-bullet`,ol:`rich-text-editor-list-number`,listitem:`rich-text-editor-list-item`,nested:{listitem:`rich-text-editor-list-item-nested`}},text:{bold:`rich-text-editor-bold`,italic:`rich-text-editor-italic`,underline:`rich-text-editor-underline`,strikethrough:`rich-text-editor-strikethrough`,underlineStrikethrough:`rich-text-editor-underline-strikethrough`,code:`rich-text-editor-inline-code`},ltr:`rich-text-editor-ltr`,rtl:`rich-text-editor-rtl`},LX={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},RX=({readOnly:e})=>{let[t]=(0,v.useLexicalComposerContext)();return l.useEffect(()=>{t.setEditable(!e)},[t,e]),null};function zX(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=PX,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,..._}=e,v={namespace:l,theme:IX,nodes:c?[...FX,...c]:FX,editable:!s,editorState:i,onError:u??(e=>{throw e})},y={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,K.jsx)(`div`,{ref:t,className:W(LX.root,s&&LX.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,..._,children:(0,K.jsx)(g.LexicalComposer,{initialConfig:v,children:(0,K.jsxs)(NX.Provider,{value:y,children:[(0,K.jsx)(C.HistoryPlugin,{}),(0,K.jsx)(T.ListPlugin,{}),(0,K.jsx)(w.LinkPlugin,{}),(0,K.jsx)(D.TabIndentationPlugin,{}),(0,K.jsx)(RX,{readOnly:s}),a?(0,K.jsx)(E.OnChangePlugin,{onChange:(e,t)=>a(e,t)}):null,r]})})})}zX.displayName=`RichTextEditor`;var BX=G(zX);const VX={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function HX(e,t){let{className:n,style:r,...i}=e,{placeholder:a,minHeight:o,maxHeight:s,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d}=l.useContext(NX),f=(0,K.jsx)(`div`,{className:VX.scroll,style:{minHeight:o===void 0?void 0:`${o}px`,maxHeight:s===void 0?void 0:`${s}px`},"data-component":`RichTextEditor.Scroll`,children:a?(0,K.jsx)(O.ContentEditable,{ref:t,className:W(VX.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":a,placeholder:(0,K.jsx)(`div`,{className:VX.placeholder,children:a}),"data-component":`RichTextEditor.Content`,...i}):(0,K.jsx)(O.ContentEditable,{ref:t,className:W(VX.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...i})});return(0,K.jsx)(A.RichTextPlugin,{contentEditable:f,ErrorBoundary:k.LexicalErrorBoundary})}HX.displayName=`RichTextEditor.Content`;var UX=G(HX);const WX=[`history`,`inline`,`block`,`list`,`link`],GX={root:`rich-text-editor-toolbar`,controls:`rich-text-editor-toolbar-controls`,group:`rich-text-editor-toolbar-group`,divider:`rich-text-editor-toolbar-divider`,linkField:`rich-text-editor-link-field`,linkInput:`rich-text-editor-link-input`},KX=[{format:`bold`,icon:Wn,label:`Bold`},{format:`italic`,icon:Yn,label:`Italic`},{format:`underline`,icon:$n,label:`Underline`},{format:`strikethrough`,icon:Qn,label:`Strikethrough`},{format:`code`,icon:gn,label:`Code`}],qX=[{tag:`h1`,icon:Kn,label:`Heading 1`},{tag:`h2`,icon:qn,label:`Heading 2`},{tag:`h3`,icon:Jn,label:`Heading 3`}],JX={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function YX(e){let{className:t,children:n,controls:r=WX,"aria-label":i=`Formatting`,...a}=e,[o]=(0,v.useLexicalComposerContext)(),{readOnly:s}=l.useContext(NX),c=l.useRef(null);vr({containerRef:c,direction:`horizontal`,wrap:!0});let[u,d]=l.useState(JX),[f,p]=l.useState(`paragraph`),[m,h]=l.useState(!1),[g,_]=l.useState(!1),[y,C]=l.useState(!1),[w,T]=l.useState(null),E=l.useCallback(()=>{let e=(0,N.$getSelection)();if(!(0,N.$isRangeSelection)(e))return;d({bold:e.hasFormat(`bold`),italic:e.hasFormat(`italic`),underline:e.hasFormat(`underline`),strikethrough:e.hasFormat(`strikethrough`),code:e.hasFormat(`code`)});let t=e.anchor.getNode(),n=t.getKey()===`root`?t:t.getTopLevelElement();if((0,x.$isListNode)(n))p(n.getListType()===`number`?`number`:`bullet`);else if((0,S.$isHeadingNode)(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else(0,S.$isQuoteNode)(n)?p(`quote`):p(`paragraph`);h((0,b.$isLinkNode)(t)||(0,b.$isLinkNode)(t.getParent()))},[]);l.useEffect(()=>(0,M.mergeRegister)(o.registerUpdateListener(({editorState:e})=>{e.read(E)}),o.registerCommand(N.SELECTION_CHANGE_COMMAND,()=>(E(),!1),N.COMMAND_PRIORITY_CRITICAL),o.registerCommand(N.CAN_UNDO_COMMAND,e=>(_(e),!1),N.COMMAND_PRIORITY_CRITICAL),o.registerCommand(N.CAN_REDO_COMMAND,e=>(C(e),!1),N.COMMAND_PRIORITY_CRITICAL)),[o,E]);let D=e=>{o.update(()=>{let t=(0,N.$getSelection)();if((0,N.$isRangeSelection)(t)){if(f===e){(0,j.$setBlocksType)(t,()=>(0,N.$createParagraphNode)());return}(0,j.$setBlocksType)(t,()=>e===`quote`?(0,S.$createQuoteNode)():(0,S.$createHeadingNode)(e))}})},O=e=>{if(f===e){o.dispatchCommand(x.REMOVE_LIST_COMMAND,void 0);return}o.dispatchCommand(e===`bullet`?x.INSERT_UNORDERED_LIST_COMMAND:x.INSERT_ORDERED_LIST_COMMAND,void 0)},k=()=>{if(m){o.dispatchCommand(b.TOGGLE_LINK_COMMAND,null);return}T(e=>e===null?``:null)},A=()=>{w&&o.dispatchCommand(b.TOGGLE_LINK_COMMAND,w),T(null),o.focus()},P=(e,t,n,r,i,a)=>(0,K.jsx)(_i,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:s||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),F={history:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_i,{icon:en,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:s||!g,onClick:()=>o.dispatchCommand(N.UNDO_COMMAND,void 0),"data-component":`RichTextEditor.Undo`}),(0,K.jsx)(_i,{icon:Zt,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:s||!y,onClick:()=>o.dispatchCommand(N.REDO_COMMAND,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,K.jsx)(K.Fragment,{children:KX.map(({format:e,icon:t,label:n})=>P(n,n,t,u[e],()=>o.dispatchCommand(N.FORMAT_TEXT_COMMAND,e)))}),block:(0,K.jsxs)(K.Fragment,{children:[qX.map(({tag:e,icon:t,label:n})=>P(n,n,t,f===e,()=>D(e))),P(`Quote`,`Quote`,Zn,f===`quote`,()=>D(`quote`))]}),list:(0,K.jsxs)(K.Fragment,{children:[P(`Bulleted list`,`Bulleted list`,Gn,f===`bullet`,()=>O(`bullet`)),P(`Numbered list`,`Numbered list`,Xn,f===`number`,()=>O(`number`))]}),link:P(`Link`,m?`Remove link`:`Link`,An,m||w!==null,k)};return(0,K.jsxs)(`div`,{className:W(GX.root,t),"data-component":`RichTextEditor.Toolbar`,children:[(0,K.jsxs)(`div`,{ref:c,role:`toolbar`,"aria-label":i,"aria-orientation":`horizontal`,className:GX.controls,...a,children:[r.map((e,t)=>(0,K.jsxs)(l.Fragment,{children:[t>0?(0,K.jsx)(`span`,{"aria-hidden":`true`,className:GX.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,K.jsx)(`div`,{className:GX.group,"data-control":e,children:F[e]})]},e)),n]}),w===null?null:(0,K.jsxs)(`div`,{className:GX.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,K.jsx)(Yo,{autoFocus:!0,size:`small`,type:`url`,value:w,placeholder:`https://example.com`,"aria-label":`Link address`,className:GX.linkInput,onChange:e=>T(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),A()),e.key===`Escape`&&(T(null),o.focus())}}),(0,K.jsx)(mi,{size:`small`,onClick:A,children:`Apply`})]})]})}YX.displayName=`RichTextEditor.Toolbar`;const XX=Object.assign(BX,{Toolbar:YX,Content:UX}),ZX=(0,l.createContext)({}),QX={root:`tooltip`,open:`tooltip-open motion-safe:[&:popover-open]:animate-in motion-safe:[&:popover-open]:fade-in motion-safe:[&:popover-open]:duration-100`,openPolyfilled:`tooltip-open-polyfilled motion-safe:[&[class~=':popover-open']]:animate-in motion-safe:[&[class~=':popover-open']]:fade-in motion-safe:[&[class~=':popover-open']]:duration-100`,bridge:`tooltip-bridge`,bridgeVertical:`tooltip-bridge-vertical`,bridgeHorizontal:`tooltip-bridge-horizontal`},$X={nw:{side:`outside-top`,align:`end`},n:{side:`outside-top`,align:`center`},ne:{side:`outside-top`,align:`start`},e:{side:`outside-right`,align:`center`},se:{side:`outside-bottom`,align:`start`},s:{side:`outside-bottom`,align:`center`},sw:{side:`outside-bottom`,align:`end`},w:{side:`outside-left`,align:`center`}},eZ={"outside-top-end":`nw`,"outside-top-center":`n`,"outside-top-start":`ne`,"outside-right-center":`e`,"outside-bottom-start":`se`,"outside-bottom-center":`s`,"outside-bottom-end":`sw`,"outside-left-center":`w`},tZ={short:50,medium:400,long:1200},nZ=[`a[href]`,`button:not([disabled])`,`summary`,`select`,`input:not([type=hidden])`,`textarea`],rZ=e=>nZ.some(t=>e.matches(t))||e.getAttribute(`role`)===`button`,iZ=e=>rZ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&rZ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&rZ(e)));function aZ(e,t){let{className:n,children:r,text:i,id:a,direction:o=`s`,type:s=`description`,delay:c=`short`,...u}=e,d=J(a),f=l.Children.only(r),p=l.useRef(null),m=B(t,p),h=l.useRef(null),g=l.useRef(null),_=l.useRef(null),[v,y]=l.useState(!1),[b,x]=l.useState(o),S=()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)};l.useEffect(()=>S,[]);let C=()=>{let e=h.current,t=p.current;if(!e||!t)return;try{e.showPopover()}catch{return}y(!0);let{side:n,align:r}=$X[o],{top:i,left:a,anchorSide:s,anchorAlign:c}=sa(e,t,{side:n,align:r});x(eZ[`${s}-${c}`]??o),e.style.top=`${i}px`,e.style.left=`${a}px`},w=()=>{S(),y(!1);try{h.current?.hidePopover()}catch{}};l.useEffect(()=>{let e=h.current,t=p.current;if(!(!e||!t)){if(!iZ(t))throw Error("The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or an equivalent element instead.");typeof window<`u`&&!(0,P.isSupported)()&&(0,P.apply)(),e.setAttribute(`popover`,`manual`)}},[]),Wi(e=>{v&&(e.preventDefault(),w())});let T=l.useMemo(()=>({tooltipId:d}),[d]);if(!l.isValidElement(f))return null;let E=f.props,D=l.cloneElement(f,{ref:m,"aria-describedby":s===`description`?[E[`aria-describedby`],d].filter(Boolean).join(` `):E[`aria-describedby`],"aria-labelledby":s===`label`?d:E[`aria-labelledby`],onFocus:e=>{try{if(!e.target.matches(`:focus-visible`))return}catch{}C(),E.onFocus?.(e)},onBlur:e=>{w(),E.onBlur?.(e)},onMouseOverCapture:e=>{g.current=window.setTimeout(()=>{g.current!==null&&(C(),E.onMouseEnter?.(e))},tZ[c])},onMouseLeave:e=>{w(),E.onMouseLeave?.(e)},onTouchEnd:e=>{E.onTouchEnd?.(e),_.current=window.setTimeout(w,10)}});return(0,K.jsxs)(ZX.Provider,{value:T,children:[D,(0,K.jsx)(`span`,{ref:h,id:d,role:s===`description`?`tooltip`:void 0,"aria-hidden":`true`,className:W(QX.root,QX.open,QX.openPolyfilled,QX.bridge,QX.bridgeVertical,QX.bridgeHorizontal,n),onMouseEnter:C,onMouseLeave:w,"data-component":`Tooltip`,"data-direction":b,...u,children:i})]})}aZ.displayName=`Tooltip`;var oZ=G(aZ);const sZ={item:`segmented-control-segment`,separator:`segmented-control-segment-separator`,separatorHidden:`segmented-control-segment-separator-hidden`,button:`segmented-control-button`,buttonSelected:`segmented-control-button-selected`,buttonDisabled:`segmented-control-button-disabled`,content:`segmented-control-content`,contentSelected:`segmented-control-content-selected`,contentInteractive:`segmented-control-content-interactive`},cZ=e=>{let t=e;return l.isValidElement(e)?e:(0,K.jsx)(t,{})};function lZ(e){let{component:t,className:n,children:r,selected:i,disabled:a,tooltip:o,tooltipType:s,tooltipDirection:c,"aria-disabled":l,...u}=e,d=!!a||l===!0||l===`true`,f=(0,K.jsx)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":d||void 0,className:W(sZ.button,i&&sZ.buttonSelected,d&&!i&&sZ.buttonDisabled,n),...u,children:(0,K.jsx)(`span`,{className:W(sZ.content,i&&sZ.contentSelected,!i&&!d&&sZ.contentInteractive),children:r})});return(0,K.jsx)(`li`,{className:W(sZ.item,sZ.separator,sZ.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,K.jsx)(oZ,{text:o,type:s,direction:c,children:f}):f})}lZ.displayName=`SegmentedControlSegment`;const uZ={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function dZ(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,K.jsxs)(lZ,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,K.jsx)(`span`,{className:W(uZ.visual,o&&uZ.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:cZ(i)}):null,(0,K.jsx)(`span`,{className:W(uZ.text,uZ.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,K.jsx)(`span`,{className:uZ.counter,children:(0,K.jsx)(ci,{children:r})})]})}dZ.displayName=`SegmentedControl.Button`;const fZ={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function pZ(e){let{"aria-label":t,className:n,description:r,icon:i,selected:a,disabled:o,tooltipDirection:s,defaultSelected:c,...l}=e;return(0,K.jsx)(lZ,{component:`SegmentedControl.IconButton`,className:W(fZ.button,n),selected:a,disabled:o,"aria-label":r?t:void 0,tooltip:r??t,tooltipType:r?void 0:`label`,tooltipDirection:s,...l,children:(0,K.jsx)(`span`,{className:W(fZ.visual,o&&fZ.visualDisabled),"data-component":`SegmentedControl.Icon`,children:cZ(i)})})}pZ.displayName=`SegmentedControl.IconButton`;const mZ={dropdown:`segmented-control-dropdown`},hZ=U(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),gZ=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),_Z=e=>e.type===dZ,vZ=e=>e.type===pZ,yZ=e=>{if(e!==void 0)return _Z(e)?e.props.children:vZ(e)?e.props[`aria-label`]:void 0},bZ=e=>e===void 0?null:_Z(e)?e.props.leadingVisual??null:vZ(e)?e.props.icon:null,xZ=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function SZ(e){let{"aria-label":t,"aria-labelledby":n,className:r,children:i,fullWidth:a,onChange:o,size:s=`medium`,variant:c=`default`,...u}=e,d=gZ(i),f=o===void 0||d.some(e=>e.props.defaultSelected!==void 0),p=d.findIndex(e=>e.props.defaultSelected||e.props.selected),m=p===-1?0:p,[h,g]=l.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{xZ(t)||(f&&g(e),o?.(e),t.props.onClick?.(n))},b=(0,K.jsx)(`ul`,{"aria-label":t,"aria-labelledby":n,className:W(hZ({size:s}),r),"data-component":`SegmentedControl`,"data-size":s,...Gi(`full-width`,a),...Gi(`variant`,c),...u,children:d.map((e,t)=>l.cloneElement(e,{selected:t===_,onClick:n=>y(t,e,n)}))});return ds(c)&&Object.values(c).includes(`dropdown`)?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:mZ.dropdown,"data-component":`SegmentedControl.Dropdown`,...Gi(`variant`,c),children:(0,K.jsxs)(ga,{children:[(0,K.jsx)(ga.Button,{"aria-label":t&&`${yZ(v)}, ${t}`,leadingVisual:bZ(v),children:yZ(v)}),(0,K.jsx)(ga.Overlay,{"aria-labelledby":n,children:(0,K.jsx)(Mi,{selectionVariant:`single`,children:d.map((e,t)=>{let n=bZ(e);return(0,K.jsxs)(Mi.Item,{selected:t===_,disabled:xZ(e),onSelect:n=>y(t,e,n),children:[n?(0,K.jsx)(Mi.LeadingVisual,{children:cZ(n)}):null,yZ(e)]},t)})})})]})}),b]}):b}SZ.displayName=`SegmentedControl`;const CZ=Object.assign(SZ,{Button:dZ,IconButton:pZ}),wZ=Object.assign(Kx,{Option:Px,OptGroup:Ax});function TZ(e,t){let{className:n,children:r,...i}=e,{required:a,...o}=zf(i),{labelId:s}=l.useContext(Rf),c=J();return(0,K.jsx)(mi,{ref:t,type:`button`,"aria-labelledby":s?`${c} ${s}`:void 0,className:W(n),"data-component":`SelectPanel.Button`,...o,children:s?(0,K.jsx)(`span`,{id:c,children:r}):r})}TZ.displayName=`SelectPanel.Button`;var EZ=G(TZ);const DZ=(0,l.createContext)({}),OZ={root:`select-panel-footer`,rootWithoutActions:`select-panel-footer-without-actions`,content:`select-panel-footer-content`,contentWithoutActions:`select-panel-footer-content-without-actions`,actions:`select-panel-footer-actions`};function kZ(e,t){let{className:n,children:r,...i}=e,{selectionVariant:a,onCancel:o}=l.useContext(DZ),s=a!==`instant`;return!s&&!r?null:(0,K.jsxs)(`div`,{ref:t,className:W(OZ.root,!s&&OZ.rootWithoutActions,n),"data-component":`SelectPanel.Footer`,"data-has-actions":s?``:void 0,...i,children:[(0,K.jsx)(`div`,{className:W(OZ.content,!s&&OZ.contentWithoutActions),children:r}),s?(0,K.jsxs)(`div`,{className:OZ.actions,children:[(0,K.jsx)(mi,{type:`button`,size:`small`,onClick:o,children:`Cancel`}),(0,K.jsx)(mi,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}kZ.displayName=`SelectPanel.Footer`;var AZ=G(kZ);const jZ={root:`select-panel-search-input`};function MZ(e,t){let{className:n,value:r,onChange:i,onKeyDown:a,...o}=e,{searchQuery:s,setSearchQuery:c,searchInputRef:u,moveFocusToList:d}=l.useContext(DZ),f=l.useRef(null),p=B(u,f),m=B(t,p),h=r??s??``;return(0,K.jsx)(Yo,{ref:m,block:!0,leadingVisual:Ln,placeholder:`Search`,value:h,onChange:e=>{c?.(e.currentTarget.value),i?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),a?.(e)},trailingAction:h?(0,K.jsx)(Yo.Action,{icon:vn,"aria-label":`Clear`,onClick:()=>{c?.(``),i?.(``,null),f.current?.focus()}}):void 0,className:W(jZ.root,n),"data-component":`SelectPanel.SearchInput`,...o})}MZ.displayName=`SelectPanel.SearchInput`;var NZ=G(MZ);const PZ={root:`select-panel-header`,content:`select-panel-header-content`,contentWithSearchInput:`select-panel-header-content-with-search`,titleRow:`select-panel-header-title-row`,title:`select-panel-header-title`,heading:`select-panel-header-heading`,description:`select-panel-header-description`,actions:`select-panel-header-actions`},FZ={searchInput:NZ};function IZ(e,t){let{className:n,children:r,onBack:i,...a}=e,[o,s]=Sr(r,FZ),{panelId:c,title:u,description:d,onCancel:f,onClearSelection:p}=l.useContext(DZ);return(0,K.jsxs)(`div`,{ref:t,className:W(PZ.root,n),"data-component":`SelectPanel.Header`,...a,children:[(0,K.jsxs)(`div`,{className:W(PZ.content,o.searchInput&&PZ.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":o.searchInput?``:void 0,children:[(0,K.jsxs)(`div`,{className:PZ.titleRow,children:[i?(0,K.jsx)(_i,{type:`button`,variant:`invisible`,icon:qt,"aria-label":`Back`,onClick:i,"data-component":`SelectPanel.BackButton`}):null,(0,K.jsxs)(`div`,{className:PZ.title,"data-has-description":d?``:void 0,"data-has-back":i?``:void 0,children:[(0,K.jsx)(Er,{as:`h1`,id:c?`${c}-title`:void 0,className:PZ.heading,children:u}),d?(0,K.jsx)(`span`,{id:c?`${c}-description`:void 0,className:PZ.description,children:d}):null]})]}),(0,K.jsxs)(`div`,{className:PZ.actions,children:[p?(0,K.jsx)(_i,{type:`button`,variant:`invisible`,icon:wn,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,K.jsx)(_i,{type:`button`,variant:`invisible`,icon:yn,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),o.searchInput,s]})}IZ.displayName=`SelectPanel.Header`;var LZ=G(IZ);const RZ={form:`select-panel-form`,container:`select-panel-container`},zZ=U(`select-panel-backdrop`,{variants:{variant:{anchored:``,modal:`select-panel-backdrop-modal motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`},narrowVariant:{anchored:``,modal:`select-panel-backdrop-narrow-modal`,"full-screen":``,"bottom-sheet":`select-panel-backdrop-narrow-bottom-sheet`}}}),BZ=U(`select-panel motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,{variants:{width:{small:`select-panel-width-small`,medium:`select-panel-width-medium`,large:`select-panel-width-large`,xlarge:`select-panel-width-xlarge`,auto:`select-panel-width-auto`},maxHeight:{small:`select-panel-max-height-small`,medium:`select-panel-max-height-medium`,large:`select-panel-max-height-large`,xlarge:`select-panel-max-height-xlarge`,"fit-content":`select-panel-max-height-fit-content`},variant:{anchored:`select-panel-anchored`,modal:``},narrowVariant:{anchored:`select-panel-narrow-anchored`,modal:`select-panel-narrow-modal`,"full-screen":`select-panel-narrow-full-screen`,"bottom-sheet":`select-panel-narrow-bottom-sheet`},unplaced:{true:`invisible`,false:``}}}),VZ={regular:`anchored`,narrow:`full-screen`},HZ=e=>l.isValidElement(e)&&e.type===EZ,UZ=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function WZ(e,t){let{className:n,children:r,title:i,description:a,variant:o=VZ,selectionVariant:s=`multiple`,id:c,defaultOpen:u=!1,open:d,anchorRef:f,side:p=`outside-bottom`,align:m=`start`,onCancel:h,onClearSelection:g,onSubmit:_,width:v=`medium`,maxHeight:y=`large`,...b}=e,x=J(c),S=l.useRef(null),C=f??S,w=l.useRef(null),T=B(t,w),E=l.useRef(null),D=d!==void 0,[O,k]=l.useState(u),A=D?d:O,j=l.useCallback(()=>{D||k(!1)},[D]),M=l.useCallback(()=>{j(),h?.()},[j,h]),N=l.useCallback(()=>g?.(),[g]),P=l.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=l.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=l.useCallback(()=>{s===`instant`&&P()},[s,P]),[L,ee]=l.useState(``),R=l.Children.toArray(r),z=R.find(HZ),[te,ne]=Sr(R.filter(e=>e!==z),{header:LZ,footer:AZ}),re=z?.props.onClick,ie=z?l.cloneElement(z,{ref:C,onClick:e=>{re?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,ae={...VZ,...typeof o==`string`?{regular:o}:o},oe=ae.regular??`anchored`,se=ae.narrow,ce=oe===`anchored`||se===`anchored`,le=l.useRef(null),[ue,de]=l.useState(null),fe=l.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=sa(t,e,{side:p,align:m});le.current&&UZ(le.current,n)||(le.current=n,de(n))},[C,p,m]);Vi(()=>{if(!A||!ce){le.current=null,de(null);return}fe();let e=new ResizeObserver(fe);return w.current&&e.observe(w.current),window.addEventListener(`resize`,fe),window.addEventListener(`scroll`,fe,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,fe),window.removeEventListener(`scroll`,fe,!0)}},[A,ce,fe]),Bi({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),l.useEffect(()=>{A&&!E.current&&F()},[A,F]),Wi(e=>{A&&(e.preventDefault(),M())});let pe=l.useMemo(()=>({panelId:x,title:i,description:a,selectionVariant:s,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,i,a,s,L,M,g,N,F]),me=l.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:s===`instant`?`single`:s,afterSelect:I,enableFocusZone:!0}),[x,s,I]);return(0,K.jsxs)(K.Fragment,{children:[ie,A?(0,K.jsx)(na,{children:(0,K.jsx)(`div`,{className:W(zZ({variant:oe,narrowVariant:se})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...Gi(`variant`,ae),children:(0,K.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":a?`${x}-description`:void 0,className:W(BZ({width:v,maxHeight:y,variant:oe,narrowVariant:se,unplaced:ce&&!ue}),n),style:{"--select-panel-top":`${ue?.top??0}px`,"--select-panel-left":`${ue?.left??0}px`},"data-component":`SelectPanel`,"data-width":v,"data-max-height":y,"data-side":ue?.anchorSide??p,"data-align":ue?.anchorAlign??m,...Gi(`variant`,ae),...b,children:(0,K.jsx)(`form`,{className:RZ.form,onSubmit:P,children:(0,K.jsxs)(DZ.Provider,{value:pe,children:[te.header??(0,K.jsx)(LZ,{}),(0,K.jsx)(`div`,{className:RZ.container,children:(0,K.jsx)(jr.Provider,{value:me,children:ne})}),te.footer]})})})})}):null]})}WZ.displayName=`SelectPanel`;var GZ=G(WZ);const KZ={root:`select-panel-loading`,text:`select-panel-loading-text`};function qZ(e,t){let{className:n,children:r=`Fetching items...`,...i}=e;return(0,K.jsxs)(`div`,{ref:t,role:`status`,"aria-live":`polite`,className:W(KZ.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,K.jsx)(ei,{size:`medium`,srText:null,role:`presentation`}),(0,K.jsx)(`span`,{className:KZ.text,children:r})]})}qZ.displayName=`SelectPanel.Loading`;var JZ=G(qZ);const YZ={full:`select-panel-message-full`,fullIcon:`select-panel-message-full-icon`,fullTitle:`select-panel-message-full-title`,fullContent:`select-panel-message-full-content`,inline:`select-panel-message-inline`,inlineIcon:`select-panel-message-inline-icon`,variant:{warning:`select-panel-message-warning`,error:`select-panel-message-error`,empty:``},inlineVariant:{warning:`select-panel-message-inline-warning`,error:`select-panel-message-inline-error`,empty:``}};function XZ(e,t){let{className:n,children:r,variant:i,size:a,title:o,...s}=e,c=a??(i===`empty`?`full`:`inline`),l=i===`empty`?void 0:{role:`status`,"aria-live":`polite`};return c===`full`?(0,K.jsxs)(`div`,{ref:t,className:W(YZ.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,K.jsx)(er,{className:W(YZ.fullIcon,YZ.variant[i]),"aria-hidden":`true`}),(0,K.jsx)(`span`,{className:YZ.fullTitle,children:o}),(0,K.jsx)(`span`,{className:YZ.fullContent,children:r})]}):(0,K.jsxs)(`div`,{ref:t,className:W(YZ.inline,YZ.variant[i],YZ.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,K.jsx)(er,{className:YZ.inlineIcon,"aria-hidden":`true`}),(0,K.jsx)(`div`,{children:r})]})}XZ.displayName=`SelectPanel.Message`;var ZZ=G(XZ);const QZ={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},$Z=e=>{let{id:t,children:n,className:r,...i}=e,a=J(t);return(0,K.jsxs)(`span`,{className:QZ.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,K.jsx)(Xd,{id:a,className:W(QZ.box,r),...i}),(0,K.jsx)(`label`,{htmlFor:a,className:QZ.small,children:n})]})};function eQ(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,K.jsx)($Z,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,K.jsx)(Xc,{className:W(QZ.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,K.jsx)(mi,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}eQ.displayName=`SelectPanel.SecondaryAction`;const tQ=Object.assign(GZ,{Button:EZ,Header:LZ,SearchInput:NZ,Footer:AZ,SecondaryAction:eQ,Loading:JZ,Message:ZZ}),nQ=U(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function rQ(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,variant:a=`default`,...o}=e;return(0,K.jsx)(n,{ref:t,role:`separator`,"aria-orientation":i,className:W(nQ({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}rQ.displayName=`Separator`;var iQ=G(rQ);const aQ=U(`skeleton-avatar`,{variants:{shape:{circle:`skeleton-avatar-circle`,square:`skeleton-avatar-square`},responsive:{true:`skeleton-avatar-responsive`,false:``}}});function oQ({size:e=20,shape:t=`circle`,className:n,style:r,...i}){let a=ds(e),o={"--avatar-size-regular":`20px`};if(a)for(let[t,n]of Object.entries(e))n!==void 0&&(o[`--avatar-size-${t}`]=`${n}px`);else o[`--avatar-size-regular`]=`${e}px`;return(0,K.jsx)($g,{width:`var(--avatar-size-regular)`,height:`var(--avatar-size-regular)`,className:W(aQ({shape:t,responsive:a}),n),style:{...r,...o},...i,"data-component":`SkeletonAvatar`,"data-responsive":a||void 0,"data-shape":t})}oQ.displayName=`SkeletonAvatar`;const sQ=U(`slider`,{variants:{size:{small:`slider-small`,medium:`slider-medium`,large:`slider-large`},orientation:{horizontal:`slider-horizontal`,vertical:`slider-vertical`},block:{true:``,false:``}},compoundVariants:[{block:!0,orientation:`horizontal`,class:`slider-block-horizontal`},{block:!0,orientation:`vertical`,class:`slider-block-vertical`}]}),cQ=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function lQ(e,t){let{className:n,style:r,size:i=`medium`,orientation:a=`horizontal`,block:o,min:s=0,max:c=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=e,g=d!==void 0,[_,v]=l.useState(()=>f??s),y=g?d:_;return(0,K.jsx)(`input`,{ref:t,type:`range`,min:s,max:c,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:W(sQ({size:i,orientation:a,block:o}),n),style:{...r,"--slider-fill":`${cQ(y,s,c)}%`},"aria-orientation":a===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":i,"data-orientation":a,"data-block":o,"data-disabled":p,...h})}lQ.displayName=`Slider`;var uQ=G(lQ);const dQ={root:`splitter`};function fQ(e,t){let{className:n,orientation:r=`horizontal`,splitterRef:i,...a}=e;return(0,K.jsx)(F.Group,{elementRef:t,groupRef:i,orientation:r,className:W(dQ.root,n),"data-component":`Splitter`,"data-orientation":r,...a})}fQ.displayName=`Splitter`;var pQ=G(fQ);const mQ={root:`splitter-panel`};function hQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(F.Panel,{elementRef:t,className:W(mQ.root,n),"data-component":`Splitter.Panel`,...r})}hQ.displayName=`Splitter.Panel`;var gQ=G(hQ);const _Q={root:`splitter-resize-trigger`};function vQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(F.Separator,{elementRef:t,className:W(_Q.root,n),"data-component":`Splitter.ResizeTrigger`,...r})}vQ.displayName=`Splitter.ResizeTrigger`;var yQ=G(vQ);const bQ={root:`splitter-resize-trigger-indicator`};function xQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(bQ.root,n),"data-component":`Splitter.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}xQ.displayName=`Splitter.ResizeTriggerIndicator`;var SQ=G(xQ);const CQ={root:`splitter-resize-trigger-separator`};function wQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(CQ.root,n),"data-component":`Splitter.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}wQ.displayName=`Splitter.ResizeTriggerSeparator`;var TQ=G(wQ);const EQ=Object.assign(pQ,{Panel:gQ,ResizeTrigger:yQ,ResizeTriggerSeparator:TQ,ResizeTriggerIndicator:SQ}),DQ={open:`open`,issueOpened:`open`,pullOpened:`open`,alertOpened:`open`,closed:`done`,issueClosed:`done`,pullMerged:`done`,alertFixed:`done`,pullClosed:`closed`,alertClosed:`closed`,issueClosedNotPlanned:`neutral`,unavailable:`neutral`,archived:`neutral`,pullQueued:`attention`,draft:`draft`,issueDraft:`draft`,alertDismissed:`draft`},OQ={open:null,closed:null,draft:fn,archived:Wt,unavailable:er,issueOpened:In,issueClosed:on,issueClosedNotPlanned:Fn,issueDraft:fn,pullOpened:rn,pullClosed:vn,pullMerged:jn,pullQueued:hn,alertOpened:Hn,alertClosed:Vn,alertFixed:zn,alertDismissed:Bn},kQ={open:``,closed:``,draft:`Pull request`,archived:`Archived`,unavailable:``,issueOpened:`Issue`,issueClosed:`Issue`,issueClosedNotPlanned:`Issue, not planned`,issueDraft:`Issue`,pullOpened:`Pull request`,pullClosed:`Pull request`,pullMerged:`Pull request`,pullQueued:`Pull request`,alertOpened:`Alert`,alertClosed:`Alert`,alertFixed:`Alert`,alertDismissed:`Alert`},AQ=U(`state-label`,{variants:{size:{small:`state-label-small`,medium:`state-label-medium`},tone:{open:`state-label-open`,closed:`state-label-closed`,done:`state-label-done`,draft:`state-label-draft`,attention:`state-label-attention`,neutral:`state-label-neutral`}}}),jQ=U(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function MQ(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=OQ[i],l=kQ[i];return(0,K.jsxs)(n,{ref:t,className:W(AQ({size:a,tone:DQ[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,K.jsx)(c,{className:W(jQ({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}MQ.displayName=`StateLabel`;var NQ=G(MQ);const PQ=(0,l.createContext)({}),FQ={root:`statistic-card-description`};function IQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(FQ.root,n),"data-component":`StatisticCard.Description`,...r})}IQ.displayName=`StatisticCard.Description`;var LQ=G(IQ);const RQ={root:`statistic-card-label`};function zQ(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(PQ);return(0,K.jsx)(`span`,{ref:t,id:r??a,className:W(RQ.root,n),"data-component":`StatisticCard.Label`,...i})}zQ.displayName=`StatisticCard.Label`;var BQ=G(zQ);const VQ={root:`statistic-card-trailing-visual`};function HQ(e,t){let{className:n,"aria-label":r,...i}=e;return(0,K.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:W(VQ.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}HQ.displayName=`StatisticCard.TrailingVisual`;var UQ=G(HQ);const WQ={hidden:`sr-only`},GQ={increase:tn,decrease:Kt,neutral:Un},KQ={increase:`Up`,decrease:`Down`,neutral:`No change`},qQ={increase:`positive`,decrease:`negative`,neutral:`neutral`},JQ=U(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function YQ(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=GQ[i],c=a??qQ[i];return(0,K.jsxs)(`span`,{ref:t,className:W(JQ({sentiment:c}),n),"data-component":`StatisticCard.Trend`,"data-direction":i,"data-sentiment":c,...o,children:[(0,K.jsx)(s,{"aria-hidden":!0}),(0,K.jsx)(`span`,{className:WQ.hidden,children:KQ[i]}),r]})}YQ.displayName=`StatisticCard.Trend`;var XQ=G(YQ);const ZQ={root:`statistic-card-value`};function QQ(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(ZQ.root,n),"data-component":`StatisticCard.Value`,...r})}QQ.displayName=`StatisticCard.Value`;var $Q=G(QQ);const e$={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function t$(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${J(i)}-label`,[l,u]=Sr(r,{trailingVisual:UQ,label:BQ,value:$Q,trend:XQ,description:LQ}),d=o??(l.label&&!a?c:void 0);return(0,K.jsx)(PQ.Provider,{value:{labelId:c},children:(0,K.jsxs)(`div`,{ref:t,id:i,role:d||a?`group`:void 0,"aria-label":a,"aria-labelledby":d,className:W(e$.root,n),"data-component":`StatisticCard`,...s,children:[(0,K.jsxs)(`div`,{className:e$.body,children:[l.label,l.value||l.trend?(0,K.jsxs)(`div`,{className:e$.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}t$.displayName=`StatisticCard`;var n$=G(t$);const r$=Object.assign(n$,{Label:BQ,Value:$Q,Trend:XQ,Description:LQ,TrailingVisual:UQ}),i$=(0,l.createContext)({}),a$={srOnly:`sr-only`},o$=U(`status`,{variants:{variant:{accent:`status-accent`,success:`status-success`,attention:`status-attention`,severe:`status-severe`,danger:`status-danger`,done:`status-done`,neutral:`status-neutral`},size:{small:`status-small`,medium:`status-medium`,large:`status-large`}}});function s$(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,K.jsx)(i$.Provider,{value:{variant:i,size:a},children:(0,K.jsxs)(n,{ref:t,className:W(o$({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,K.jsx)(`span`,{className:a$.srOnly,children:o}):null,s]})})}s$.displayName=`Status`;var c$=G(s$);const l$=U(`status-indicator`,{variants:{variant:{accent:`status-indicator-accent`,success:`status-indicator-success`,attention:`status-indicator-attention`,severe:`status-indicator-severe`,danger:`status-indicator-danger`,done:`status-indicator-done`,neutral:`status-indicator-neutral`},size:{small:`status-indicator-small`,medium:`status-indicator-medium`,large:`status-indicator-large`}}});function u$(e,t){let{className:n,variant:r,size:i,...a}=e,o=l.useContext(i$),s=r??o.variant??`neutral`,c=i??o.size??`medium`;return(0,K.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:W(l$({variant:s,size:c}),n),"data-component":`Status.Indicator`,"data-variant":s,"data-size":c,...a})}u$.displayName=`Status.Indicator`;var d$=G(u$);const f$=Object.assign(c$,{Indicator:d$}),p$=(0,l.createContext)(null),m$=U(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),h$=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),g$=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function _$(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=h$(r);return(0,K.jsx)(`ol`,{ref:t,role:`list`,className:W(m$({orientation:a,size:o}),n),"data-component":`Steps`,"data-orientation":a,"data-size":o,"data-count":c.length,...s,children:c.map((e,t)=>(0,K.jsx)(p$.Provider,{value:{index:t,status:g$(t,i)},children:e},e.key))})}_$.displayName=`Steps`;var v$=G(_$);const y$={root:`steps-body`};function b$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(y$.root,n),"data-component":`Steps.Body`,...r})}b$.displayName=`Steps.Body`;var x$=G(b$);const S$={root:`steps-description`};function C$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(S$.root,n),"data-component":`Steps.Description`,...r})}C$.displayName=`Steps.Description`;var w$=G(C$);const T$=()=>{let e=(0,l.useContext)(p$);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},E$={root:`steps-indicator`,icon:`steps-indicator-icon`};function D$(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=T$();return(0,K.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:W(E$.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,K.jsx)(sn,{className:E$.icon}):a+1)})}D$.displayName=`Steps.Indicator`;var O$=G(D$);const k$={root:`steps-item`,status:`sr-only`},A$={complete:`Completed`,current:``,incomplete:`Not completed`};function j$(e,t){let{className:n,children:r,status:i,statusLabel:a,...o}=e,{index:s,status:c}=T$(),u=i??c,d=a??A$[u],f=l.useMemo(()=>({index:s,status:u}),[s,u]);return(0,K.jsx)(p$.Provider,{value:f,children:(0,K.jsxs)(`li`,{ref:t,"aria-current":u===`current`?`step`:void 0,className:W(k$.root,n),"data-component":`Steps.Item`,"data-status":u,"data-index":s,...o,children:[r,d?(0,K.jsx)(`span`,{className:k$.status,children:d}):null]})})}j$.displayName=`Steps.Item`;var M$=G(j$);const N$={root:`steps-title`};function P$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`span`,{ref:t,className:W(N$.root,n),"data-component":`Steps.Title`,...r})}P$.displayName=`Steps.Title`;var F$=G(P$);const I$=Object.assign(v$,{Item:M$,Indicator:O$,Body:x$,Title:F$,Description:w$}),L$=(0,l.createContext)({}),R$=U(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function z$(e,t){let{as:n=`span`,className:r,swap:i=!1,transition:a=`fade`,children:o,...s}=e,c=l.useMemo(()=>({swap:i}),[i]);return(0,K.jsx)(L$.Provider,{value:c,children:(0,K.jsx)(n,{ref:t,className:W(R$({transition:a}),r),"data-component":`Swap`,"data-swap":i?`on`:`off`,"data-transition":a,...s,children:o})})}z$.displayName=`Swap`;var B$=G(z$);const V$={root:`swap-indicator`,active:`swap-indicator-active`};function H$(e,t){let{as:n=`span`,className:r,type:i,...a}=e,{swap:o}=l.useContext(L$),s=i===(o?`on`:`off`);return(0,K.jsx)(n,{ref:t,"aria-hidden":s?void 0:`true`,className:W(V$.root,s&&V$.active,r),"data-component":`Swap.Indicator`,"data-type":i,"data-active":s,...a})}H$.displayName=`Swap.Indicator`;var U$=G(H$);const W$=Object.assign(B$,{Indicator:U$}),G$={root:`table-of-contents`};function K$(e,t){let{className:n,"aria-label":r,"aria-labelledby":i,...a}=e;return(0,K.jsx)(`nav`,{ref:t,"aria-label":r||i?r:`Table of contents`,"aria-labelledby":i,className:W(G$.root,n),"data-component":`TableOfContents`,...a})}K$.displayName=`TableOfContents`;var q$=G(K$);const J$={root:`table-of-contents-list`};function Y$(e,t){let{className:n,...r}=e;return(0,K.jsx)(`ul`,{ref:t,role:`list`,className:W(J$.root,n),"data-component":`TableOfContents.List`,...r})}Y$.displayName=`TableOfContents.List`;var X$=G(Y$);const Z$={root:`table-of-contents-group`,label:`table-of-contents-group-label`,link:`table-of-contents-link`,active:`table-of-contents-link-active`,list:`table-of-contents-group-list`};function Q$(e,t){let{label:n,href:r,active:i=!1,className:a,children:o,onClick:s,...c}=e;return(0,K.jsxs)(`li`,{ref:t,className:W(Z$.root,a),"data-component":`TableOfContents.Group`,...c,children:[r?(0,K.jsx)(`a`,{href:r,onClick:s,"aria-current":i?`true`:void 0,className:W(Z$.link,i&&Z$.active),"data-component":`TableOfContents.Group.Label`,children:n}):(0,K.jsx)(`p`,{className:Z$.label,"data-component":`TableOfContents.Group.Label`,children:n}),(0,K.jsx)(X$,{className:Z$.list,children:o})]})}Q$.displayName=`TableOfContents.Group`;var $$=G(Q$);const e1={item:`table-of-contents-item`,link:`table-of-contents-link`,active:`table-of-contents-link-active`};function t1(e,t){let{as:n=`a`,active:r=!1,className:i,...a}=e;return(0,K.jsx)(`li`,{className:e1.item,children:(0,K.jsx)(n,{ref:t,"aria-current":r?`true`:void 0,className:W(e1.link,r&&e1.active,i),"data-component":`TableOfContents.Item`,...a})})}t1.displayName=`TableOfContents.Item`;var n1=G(t1);const r1={root:`table-of-contents-title`};function i1(e,t){let{as:n=`p`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(r1.root,r),"data-component":`TableOfContents.Title`,...i})}i1.displayName=`TableOfContents.Title`;var a1=G(i1);const o1=({ids:e,offset:t=0,root:n=null,trackHash:r=!0})=>{let[i,a]=l.useState(null),o=l.useRef(!1),s=e.join(`\0`);l.useEffect(()=>{if(typeof IntersectionObserver>`u`)return;let e=s.split(`\0`).map(e=>document.getElementById(e)).filter(e=>e!==null);if(e.length===0)return;let r=new Set,i=new IntersectionObserver(t=>{for(let e of t)e.isIntersecting?r.add(e.target):r.delete(e.target);let n=e.find(e=>r.has(e));n&&!o.current&&a(n.id)},{root:n,rootMargin:`-${t}px 0px 0px 0px`});for(let t of e)i.observe(t);return()=>{i.disconnect()}},[s,t,n]);let c=l.useRef(void 0),u=l.useRef(null),d=l.useCallback(e=>{u.current?.(),o.current=!0,a(e);let t=n??window,r=()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>{u.current?.(),o.current=!1},150)};t.addEventListener(`scroll`,r,{passive:!0}),u.current=()=>{window.clearTimeout(c.current),t.removeEventListener(`scroll`,r),u.current=null},r()},[n]);return l.useEffect(()=>()=>u.current?.(),[]),l.useEffect(()=>{if(!r)return;let e=new Set(s.split(`\0`)),t=()=>{let t=decodeURIComponent(window.location.hash.slice(1));t&&e.has(t)&&d(t)};return t(),window.addEventListener(`hashchange`,t),()=>{window.removeEventListener(`hashchange`,t)}},[r,s,d]),{activeId:i,selectSection:d}},s1=Object.assign(q$,{Title:a1,List:X$,Item:n1,Group:$$}),c1=(0,l.createContext)(null);function l1(e){let{children:t,id:n,value:r,defaultValue:i,onChange:a}=e,o=J(n),s=r!==void 0,[c,u]=l.useState(i),d=s?r:c,f=l.useRef(a);Vi(()=>{f.current=a},[a]);let p=l.useMemo(()=>({groupId:o,selectedValue:d,selectTab:e=>{s||u(e),f.current?.(e)}}),[o,d,s]);return(0,K.jsx)(c1.Provider,{value:p,children:t})}l1.displayName=`Tabs`;const u1=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},d1=()=>{let e=(0,l.useContext)(c1);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},f1=e=>{let{value:t,disabled:n}=e,r=d1(),i=r.selectedValue===t;return{selected:i,tabProps:{id:`${r.groupId}-tab-${t}`,role:`tab`,"aria-controls":`${r.groupId}-panel-${t}`,"aria-selected":i,"aria-disabled":n?!0:void 0,tabIndex:i?0:-1,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&r.selectTab(t)},onMouseDown:e=>{if(n||e.button!==0||e.ctrlKey){e.preventDefault();return}r.selectTab(t)},onFocus:()=>{!i&&!n&&r.selectTab(t)}}}},p1={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function m1(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=f1({value:r,disabled:i});return(0,K.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:u1(a,u.onKeyDown),onMouseDown:u1(o,u.onMouseDown),onFocus:u1(s,u.onFocus),className:W(p1.root,p1.vertical,p1.hover,l&&p1.selected,i&&p1.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}m1.displayName=`Tabs.Tab`;var h1=G(m1);const g1=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),_1=e=>{let{"aria-label":t,"aria-labelledby":n,"aria-orientation":r,ref:i}=e,a=l.useRef(null),o=B(i,a),s=r??`horizontal`;return{tabListProps:{ref:o,role:`tablist`,"aria-label":t,"aria-labelledby":n,"aria-orientation":s,onKeyDown:e=>{let t=a.current;if(!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,o=e.key===`Home`||e.key===`End`,c=e.key===r?1:e.key===i?-1:0;if(c===0&&!o)return;e.preventDefault(),e.stopPropagation();let l=g1(t);if(l.length===0)return;if(o){l[e.key===`Home`?0:l.length-1].focus();return}let u=l.findIndex(e=>e.getAttribute(`aria-selected`)===`true`);l[u===-1?0:(u+c+l.length)%l.length].focus()}}}},v1={root:`tab-list`,vertical:`tab-list-vertical`};function y1(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=_1({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,K.jsx)(`div`,{...s,...c,onKeyDown:u1(r,c.onKeyDown),className:W(v1.root,l&&v1.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}y1.displayName=`Tabs.List`;var b1=G(y1);const x1=e=>{let{value:t}=e,n=d1(),r=n.selectedValue===t;return{tabPanelProps:{id:`${n.groupId}-panel-${t}`,role:`tabpanel`,"aria-labelledby":`${n.groupId}-tab-${t}`,hidden:!r,"data-selected":r?``:void 0}}};function S1(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=x1({value:r});return(0,K.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}S1.displayName=`Tabs.Panel`;var C1=G(S1);const w1=Object.assign(l1,{List:b1,Tab:h1,Panel:C1}),T1={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},E1=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function D1(e,t){let{className:n,clipSidebar:r,...i}=e,a=E1(r);return(0,K.jsx)(`ol`,{ref:t,role:`list`,className:W(T1.root,(a===`start`||a===`both`)&&T1.clipStart,(a===`end`||a===`both`)&&T1.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}D1.displayName=`Timeline`;var O1=G(D1);const k1={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function A1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(k1.root,k1.narrow,n),"data-component":`Timeline.Actions`,...r})}A1.displayName=`Timeline.Actions`;var j1=G(A1);const M1={root:`timeline-avatar`};function N1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(M1.root,n),"data-component":`Timeline.Avatar`,...r})}N1.displayName=`Timeline.Avatar`;var P1=G(N1);const F1={wrapper:`timeline-badge-wrapper`},I1=U(`timeline-badge`,{variants:{variant:{accent:`timeline-badge-accent`,success:`timeline-badge-success`,attention:`timeline-badge-attention`,severe:`timeline-badge-severe`,danger:`timeline-badge-danger`,done:`timeline-badge-done`,open:`timeline-badge-open`,closed:`timeline-badge-closed`,sponsors:`timeline-badge-sponsors`}}});function L1(e,t){let{className:n,variant:r,...i}=e;return(0,K.jsx)(`div`,{className:F1.wrapper,children:(0,K.jsx)(`div`,{ref:t,className:W(I1({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}L1.displayName=`Timeline.Badge`;var R1=G(L1);const z1={root:`timeline-body`};function B1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(z1.root,n),"data-component":`Timeline.Body`,...r})}B1.displayName=`Timeline.Body`;var V1=G(B1);const H1={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function U1(e,t){let{className:n,...r}=e;return(0,K.jsx)(`li`,{ref:t,role:`presentation`,className:W(H1.root,H1.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}U1.displayName=`Timeline.Break`;var W1=G(U1);const G1={root:`timeline-item`,rail:`timeline-item-rail`,condensed:`timeline-item-condensed`,condensedBadge:`timeline-item-condensed-badge`,condensedAvatar:`timeline-item-condensed-avatar`,narrow:`timeline-item-narrow`};function K1(e,t){let{className:n,condensed:r,...i}=e;return(0,K.jsx)(`li`,{ref:t,className:W(G1.root,G1.rail,G1.narrow,r&&G1.condensed,r&&G1.condensedBadge,r&&G1.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}K1.displayName=`Timeline.Item`;var q1=G(K1);const J1=Object.assign(O1,{Item:q1,Avatar:P1,Badge:R1,Body:V1,Break:W1,Actions:j1});let Y1=[],X1=0;const Z1=new Set,Q1=()=>{for(let e of Z1)e()},$1=e=>(Z1.add(e),()=>{Z1.delete(e)}),e0=()=>Y1,t0=[],n0=()=>t0,r0=e=>(Y1=Y1.some(t=>t.id===e.id)?Y1.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...Y1],Q1(),e.id),i0=e=>(Y1=Y1.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),Q1(),e),a0=e=>{Y1=Y1.filter(t=>t.id!==e),Q1()},o0=()=>`toast-${++X1}`,s0=(e,t,n={})=>r0({...n,id:n.id??o0(),title:t,variant:e}),c0=(e,t)=>typeof e==`function`?e(t):e,l0=(e,t,n={})=>{let r=n.id??o0();s0(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){i0(r);return}s0(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,c0(t.success,e)),e=>i(`error`,c0(t.error,e))),r},u0=(e,t)=>s0(`default`,e,t),d0=Object.assign(u0,{message:u0,success:(e,t)=>s0(`success`,e,t),error:(e,t)=>s0(`error`,e,t),warning:(e,t)=>s0(`warning`,e,t),info:(e,t)=>s0(`info`,e,t),loading:(e,t)=>s0(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>r0({...t,id:t.id??o0(),variant:`default`,render:e}),promise:l0,dismiss:i0,getToasts:e0}),f0={root:`toast`,animated:`motion-safe:[transition:transform_var(--motion-transition-state-change),opacity_var(--motion-transition-state-change),height_var(--motion-transition-state-change)]`,grabbable:`toast-grabbable`,lift:{top:`toast-lift-top`,bottom:`toast-lift-bottom`},bridge:`toast-bridge`,bridgeTop:`toast-bridge-top`,bridgeBottom:`toast-bridge-bottom`,card:`toast-card`,iconColor:{default:``,success:`toast-icon-success`,error:`toast-icon-error`,warning:`toast-icon-warning`,info:`toast-icon-info`,loading:``},richColors:{default:``,success:`toast-rich-success`,error:`toast-rich-error`,warning:`toast-rich-warning`,info:`toast-rich-info`,loading:``},hidden:`opacity-0`,waiting:`pointer-events-none`,dragging:`select-none`,body:`toast-body motion-safe:[transition:opacity_var(--motion-transition-state-change)]`,bodyStacked:`opacity-0`,icon:`toast-icon`,content:`toast-content`,title:`toast-title`,description:`toast-description`,actions:`toast-actions`},p0={default:null,success:on,error:xn,warning:er,info:Dn,loading:null},m0=e=>typeof e==`object`&&!!e&&`label`in e&&!l.isValidElement(e);function h0(e){let{toast:t,place:n,position:r,height:i,frontHeight:a,stackSize:o,expanded:s,visible:c,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=e,{id:h,variant:g,title:_,description:v,render:y}=t,b=t.duration??p.duration,x=t.dismissible??p.dismissible,S=t.closeButton??p.closeButton,C=t.richColors??p.richColors,w=t.important??p.important??!1,T=l.useRef(null),[E,D]=l.useState(!1),[O,k]=l.useState({x:0,y:0}),[A,j]=l.useState(!1),[M,N]=l.useState(!1),P=l.useRef(null),F=!!t.dismissed,I=n.index===0,L=E&&!s&&!I,ee=!!y,R=r.startsWith(`top`)?`top`:`bottom`,z=e=>{t.dismissed||(i0(h),e===`timeout`?t.onAutoClose?.(t):t.onDismiss?.(t))};l.useEffect(()=>{D(!0)},[]);let B=l.useRef({revision:-1,time:b});l.useEffect(()=>{if(B.current.revision!==t.revision&&(B.current={revision:t.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),n=window.setTimeout(()=>z(`timeout`),Math.max(B.current.time,0));return()=>{window.clearTimeout(n),B.current.time-=Date.now()-e}},[t,b,u,F]),l.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>a0(h),200);return()=>{window.clearTimeout(e)}},[F,h]),Vi(()=>{let e=T.current;if(!e)return;let t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,m(h,n)},[m,h,t.revision,_,v,s]);let te=e=>d.includes(e),ne=(e,t,n)=>e<0?te(t)?e:0:te(n)?e:0,re=e=>{!x||e.button!==0||e.target.closest(`button`)||(P.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture?.(e.pointerId),j(!0))},ie=e=>{let t=P.current;!t||t.pointerId!==e.pointerId||k({x:ne(e.clientX-t.x,`left`,`right`),y:ne(e.clientY-t.y,`top`,`bottom`)})},ae=e=>{let t=P.current;if(!t||t.pointerId!==e.pointerId)return;if(P.current=null,j(!1),Math.max(Math.abs(O.x),Math.abs(O.y))<45){k({x:0,y:0});return}let n=e.currentTarget.getBoundingClientRect(),r=(e,t)=>e===0?0:Math.sign(e)*(t+32);k({x:r(O.x,n.width),y:r(O.y,n.height)}),N(!0),z(`swipe`)},oe=()=>{P.current=null,j(!1),k({x:0,y:0})},se=s?`calc(var(--toast-lift) * var(--toast-offset))`:`calc(var(--toast-lift) * var(--toaster-gap) * var(--toast-index))`,ce=`calc(var(--toast-lift) * -100%)`,le={"--toast-index":n.index,"--toast-offset":`${n.offset}px`,"--toast-z-index":o-n.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?a:i),"--toast-shift":E?!F||M?se:I?ce:s?`calc(${se} + ${ce})`:se:ce,"--toast-scale":L?Math.max(1-n.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},ue=p0[g],de=t.icon===void 0?f?.[g]:t.icon,fe=de===void 0?g===`loading`?(0,K.jsx)(ei,{size:`small`,srText:null}):ue?(0,K.jsx)(ue,{}):null:de,pe=(e,t,n)=>m0(e)?(0,K.jsx)(mi,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||z(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,me=t.action!==void 0||t.cancel!==void 0;return(0,K.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:W(f0.root,f0.lift[R],f0.bridge,R===`top`?f0.bridgeTop:f0.bridgeBottom,x&&f0.grabbable,!ee&&f0.card,!ee&&f0.iconColor[g],!ee&&C&&f0.richColors[g],(!E||F||!c)&&f0.hidden,!c&&f0.waiting,A?f0.dragging:f0.animated,p.className,t.className),style:le,"data-component":`Toast`,"data-variant":g,"data-position":r,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":s,"data-stacked":L,"data-visible":c,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:ie,onPointerUp:ae,onPointerCancel:oe,children:ee?y?.(t):(0,K.jsxs)(`div`,{className:W(f0.body,L&&f0.bodyStacked),"data-component":`Toast.Body`,children:[fe===null?null:(0,K.jsx)(`span`,{className:f0.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:fe}),(0,K.jsxs)(`div`,{className:f0.content,"data-component":`Toast.Content`,children:[(0,K.jsx)(`div`,{className:f0.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,K.jsx)(`div`,{className:f0.description,"data-component":`Toast.Description`,children:v})]}),me?(0,K.jsxs)(`div`,{className:f0.actions,"data-component":`Toast.Actions`,children:[pe(t.cancel,`cancel`,`invisible`),pe(t.action,`action`,`default`)]}):null,S&&x?(0,K.jsx)(_i,{icon:yn,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>z(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}h0.displayName=`Toast`;const g0=U(`toaster z-popover`,{variants:{position:{"top-left":`toaster-top-left`,"top-center":`toaster-top-center`,"top-right":`toaster-top-right`,"bottom-left":`toaster-bottom-left`,"bottom-center":`toaster-bottom-center`,"bottom-right":`toaster-bottom-right`}}}),_0=[`altKey`,`KeyT`],v0=e=>typeof e==`number`?`${e}px`:e,y0=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},b0=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),x0=()=>document.visibilityState===`hidden`,S0=()=>!1;function C0(e,t){let{position:n=`bottom-right`,expand:r=!1,visibleToasts:i=3,toastOptions:a,duration:o=4e3,closeButton:s=!1,richColors:c=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=_0,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=e,x=l.useSyncExternalStore($1,e0,n0),S=l.useSyncExternalStore(b0,x0,S0),C=l.useRef(null),w=B(t,C),[T,E]=l.useState({}),[D,O]=l.useState(!1),k=r||D,A=l.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);l.useEffect(()=>{E(e=>{let t=Object.keys(e).filter(e=>x.some(t=>t.id===e));return t.length===Object.keys(e).length?e:Object.fromEntries(t.map(t=>[t,e[t]]))})},[x]);let j=x.filter(e=>!e.dismissed),M=new Map,N=0;j.forEach((e,t)=>{M.set(e.id,{index:t,offset:N}),N+=(T[e.id]??0)+u});let P=l.useRef(M);for(let e of x)if(!M.has(e.id)){let t=P.current.get(e.id);t&&M.set(e.id,t)}P.current=M;let F=j.length>0?T[j[0].id]??0:0;l.useEffect(()=>{let e=e=>{let t=C.current,n=t!==null&&(document.activeElement===t||t.contains(document.activeElement));if(e.code===`Escape`&&n){O(!1);return}m.every(t=>!!e[t]||e.code===t)&&(O(!0),C.current?.focus())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[m]);let I={duration:o,closeButton:s,richColors:c,dismissible:!0,...a},L=h??y0(n);return(0,K.jsx)(na,{children:(0,K.jsx)(`section`,{"aria-label":_,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,tabIndex:-1,"data-component":`Toaster.Region`,children:(0,K.jsx)(`ol`,{ref:w,tabIndex:-1,className:W(g0({position:n}),v),style:{...y,"--toaster-width":v0(p),"--toaster-viewport-offset":v0(d),"--toaster-mobile-offset":v0(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":n,"data-expanded":k,onPointerEnter:()=>O(!0),onPointerLeave:()=>O(!1),onFocus:()=>O(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||O(!1)},...b,children:x.map(e=>{let t=M.get(e.id)??{index:0,offset:0};return(0,K.jsx)(h0,{toast:e,place:t,position:n,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<i,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}C0.displayName=`Toaster`;var w0=G(C0);const T0=2e3,E0={content:`toggle-switch-content`,srOnly:`sr-only`},D0=`toggle-switch-icon`,O0=U(`toggle-switch`,{variants:{statusLabelPosition:{start:`toggle-switch-label-start`,end:`toggle-switch-label-end`}}}),k0=U(`toggle-switch-status`,{variants:{statusLabelPosition:{start:``,end:`toggle-switch-status-end`}}}),A0=U(`toggle-switch-status-label`,{variants:{size:{small:`toggle-switch-status-label-small`,medium:`toggle-switch-status-label-medium`},disabled:{true:`toggle-switch-status-label-disabled`,false:``}}}),j0=U(`toggle-switch-status-text`,{variants:{hidden:{true:`toggle-switch-status-text-hidden`,false:``}}}),M0=U(`toggle-switch-track`,{variants:{size:{small:`toggle-switch-track-small`,medium:`toggle-switch-track-medium`},track:{off:`toggle-switch-track-off`,on:`toggle-switch-track-on`,disabled:`toggle-switch-track-disabled`}}}),N0=U(D0,{variants:{disabled:{true:`toggle-switch-circle-icon-disabled`,false:`toggle-switch-circle-icon`},checked:{true:`translate-x-0`,false:`-translate-x-full`}}}),P0=U(D0,{variants:{disabled:{true:`toggle-switch-line-icon-disabled`,false:`toggle-switch-line-icon`},checked:{true:`translate-x-full`,false:`translate-x-0`}}}),F0=U(`toggle-switch-knob`,{variants:{checked:{true:`toggle-switch-knob-checked`,false:`translate-x-0`},disabled:{true:`toggle-switch-knob-disabled`,false:``}}}),I0={small:12,medium:16},L0=({size:e})=>(0,K.jsx)(`svg`,{"aria-hidden":`true`,width:I0[e],height:I0[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{fillRule:`evenodd`,d:`M8 12.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Z`})}),R0=({size:e})=>(0,K.jsx)(`svg`,{"aria-hidden":`true`,width:I0[e],height:I0[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{fillRule:`evenodd`,d:`M8 2a.75.75 0 0 1 .75.75v11.5a.75.75 0 0 1-1.5 0V2.75A.75.75 0 0 1 8 2Z`})});function z0(e,t){let{className:n,checked:r,defaultChecked:i,disabled:a,loading:o,onChange:s,onClick:c,size:u=`medium`,statusLabelPosition:d=`start`,buttonType:f=`button`,loadingLabel:p=`Loading`,loadingLabelDelay:m=T0,buttonLabelOn:h=`On`,buttonLabelOff:g=`Off`,"aria-labelledby":_,"aria-describedby":v,...y}=e,b=r!==void 0,[x,S]=l.useState(!!i),C=b?r:x,w=!a&&!o,T=`${J()}-loading-label`,[E,D]=l.useState(!1);l.useEffect(()=>{if(!o){D(!1);return}let e=window.setTimeout(()=>{D(!0)},m);return()=>{window.clearTimeout(e)}},[o,m]);let O=e=>{w&&(b||S(!C),s?.(!C),c?.(e))},k=[E?T:void 0,v].filter(Boolean).join(` `);return(0,K.jsxs)(`div`,{className:W(O0({statusLabelPosition:d}),n),"data-component":`ToggleSwitch`,"data-size":u,"data-status-label-position":d,"data-checked":C,"data-disabled":!w,"data-loading":o?`true`:void 0,...y,children:[(0,K.jsx)(`span`,{id:T,role:`status`,className:E0.srOnly,children:E?p:``}),o?(0,K.jsx)(`span`,{className:W(k0({statusLabelPosition:d})),"data-component":`ToggleSwitch.LoadingSpinner`,children:(0,K.jsx)(ei,{size:`small`,srText:null,role:`presentation`})}):null,(0,K.jsxs)(`span`,{className:W(A0({size:u,disabled:!w})),"aria-hidden":`true`,onClick:O,"data-component":`ToggleSwitch.StatusText`,children:[(0,K.jsx)(`span`,{className:W(j0({hidden:!C})),children:h}),(0,K.jsx)(`span`,{className:W(j0({hidden:C})),children:g})]}),(0,K.jsxs)(`button`,{ref:t,type:f,className:W(M0({size:u,track:w?C?`on`:`off`:`disabled`})),onClick:O,"aria-labelledby":_,"aria-describedby":k||void 0,"aria-pressed":C,"aria-disabled":!w,"data-component":`ToggleSwitch.SwitchButton`,children:[(0,K.jsxs)(`span`,{className:E0.content,"aria-hidden":`true`,children:[(0,K.jsx)(`span`,{className:W(N0({disabled:!w,checked:C})),"data-component":`ToggleSwitch.LineIcon`,children:(0,K.jsx)(R0,{size:u})}),(0,K.jsx)(`span`,{className:W(P0({disabled:!w,checked:C})),"data-component":`ToggleSwitch.CircleIcon`,children:(0,K.jsx)(L0,{size:u})})]}),(0,K.jsx)(`span`,{className:W(F0({checked:C,disabled:!w})),"aria-hidden":`true`,"data-component":`ToggleSwitch.ToggleKnob`})]})]})}z0.displayName=`ToggleSwitch`;var B0=G(z0);const V0=U(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),H0=`medium`,U0=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function W0(e,t){let{as:n=`span`,className:r,size:i=H0,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=U0({as:n,onClick:c.onClick,onFocus:c.onFocus,tabIndex:c.tabIndex,disabled:c.disabled});return(0,K.jsx)(n,{ref:t,onKeyDown:e=>{s?.(e),(e.key===`Backspace`||e.key===`Delete`)&&o?.()},className:W(V0({size:i,interactive:l}),r),"data-component":`Token`,"data-size":i,"data-interactive":l?``:void 0,"data-selected":a?``:void 0,...n===`button`?{type:`button`}:{},...c})}W0.displayName=`TokenBase`;var G0=G(W0);const K0=U(`token-remove-button`,{variants:{size:{small:`token-remove-button-small`,medium:`token-remove-button-medium`,large:`token-remove-button-large`,xlarge:`token-remove-button-xlarge`},raised:{true:`token-remove-button-raised`,false:``}}});function q0(e){let{className:t,size:n=H0,isParentInteractive:r,...i}=e,a=W(K0({size:n,raised:r}),t);return r?(0,K.jsx)(`span`,{"aria-hidden":`true`,tabIndex:-1,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,K.jsx)(yn,{})}):(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,K.jsx)(yn,{})})}q0.displayName=`Token.RemoveButton`;const J0={root:`token-text`,interactive:`token-text-interactive`};function Y0(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,K.jsx)(n,{ref:t,className:W(J0.root,i&&J0.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}Y0.displayName=`Token.Text`;var X0=G(Y0);const Z0={srOnly:`sr-only`},Q0=U(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),$0=U(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),e2=e=>l.isValidElement(e)?e:(0,K.jsx)(e,{});function t2(e,t){let{as:n,className:r,text:i,size:a=H0,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=U0({as:n,onClick:d,onFocus:f.onFocus,tabIndex:f.tabIndex,disabled:f.disabled}),m=!!s&&!c,h=p&&m,g={as:n,href:u,onClick:d},_=e=>{e.stopPropagation(),s?.()};return(0,K.jsxs)(G0,{ref:t,size:a,isSelected:l,onRemove:s,className:W(Q0({interactive:p,selected:l,withRemoveButton:m}),r),"data-has-remove-button":m?``:void 0,...h?{}:g,...f,children:[o&&a!==`small`?(0,K.jsx)(`span`,{className:W($0({size:a})),"data-component":`Token.LeadingVisual`,children:e2(o)}):null,(0,K.jsxs)(X0,{interactive:h,...h?g:{},children:[i,s?(0,K.jsx)(`span`,{className:Z0.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,K.jsx)(q0,{size:a,isParentInteractive:p,onClick:_}):null]})}t2.displayName=`Token`;var n2=G(t2);const r2=`#999999`,i2=.6,a2=(e,t,n)=>Math.max(t,Math.min(e,n)),o2=e=>a2(Math.round(e),0,100),s2=e=>{let t=e.trim();if(t.startsWith(`#`)){let e=t.slice(1);if(e.length===3){let[t,n,r]=[...e].map(e=>parseInt(e+e,16));return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}if(e.length===6){let t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16);return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}return null}let n=t.match(/^rgba?\(([^)]+)\)$/i);if(!n)return null;let r=n[1].split(/[\s,/]+/).filter(Boolean).map(Number);if(r.length<3||r.slice(0,3).some(Number.isNaN))return null;let[i,a,o]=r;return{r:i,g:a,b:o}},c2=({r:e,g:t,b:n})=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2;if(c===0)return{h:0,s:0,l:Math.round(l*100)};let u=c/(1-Math.abs(2*l-1)),d;return d=o===r?(i-a)/c%6:o===i?(a-r)/c+2:(r-i)/c+4,d=Math.round(d*60),{h:d<0?d+360:d,s:Math.round(u*100),l:Math.round(l*100)}},l2=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,u2=e=>{let t=s2(e)??s2(`#999999`),{h:n,s:r,l:i}=c2(t),a=l2(t),{r:o,g:s,b:c}=t,l=a2(1/(.453-a),0,1),u=a2((a-.96)*100,0,1),d=(i2-a)*100*a2(1/(i2-a),0,1),f=o2(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${o2(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${o2(i-5)}%)`},dark:{background:`rgba(${o}, ${s}, ${c}, 0.18)`,foreground:`hsl(${n}deg, ${r}%, ${f}%)`,border:`hsla(${n}deg, ${r}%, ${f}%, 0.3)`,ring:`hsl(${n}deg, ${r}%, ${f}%)`,backgroundHover:`hsla(${n}deg, ${r}%, ${o2(i+10)}%, 0.3)`}}},d2={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function f2(e,t){let{as:n,className:r,style:i,text:a,size:o=H0,fillColor:s=r2,onRemove:c,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=e,h=l.useMemo(()=>u2(s),[s]),g=U0({as:n,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!c&&!u,v=g&&_,y={as:n,href:f,onClick:p},b=e=>{e.stopPropagation(),c?.()};return(0,K.jsxs)(G0,{ref:t,size:o,isSelected:d,onRemove:c,className:W(d2.root,g&&d2.interactive,d&&d2.selected,_&&d2.withRemoveButton,r),style:{...i,"--issue-label-background":h.light.background,"--issue-label-foreground":h.light.foreground,"--issue-label-border":h.light.border,"--issue-label-ring":h.light.ring,"--issue-label-background-hover":h.light.backgroundHover,"--issue-label-dark-background":h.dark.background,"--issue-label-dark-foreground":h.dark.foreground,"--issue-label-dark-border":h.dark.border,"--issue-label-dark-ring":h.dark.ring,"--issue-label-dark-background-hover":h.dark.backgroundHover},"data-component":`IssueLabelToken`,"data-has-remove-button":_?``:void 0,...v?{}:y,...m,children:[(0,K.jsxs)(X0,{interactive:v,...v?y:{},children:[a,c?(0,K.jsx)(`span`,{className:d2.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,K.jsx)(q0,{size:o,isParentInteractive:g,onClick:b}):null]})}f2.displayName=`IssueLabelToken`;var p2=G(f2);const m2={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function h2(e,t){let{as:n=`a`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(m2.root,m2.interactive,m2.hover,r),"data-component":`TopicTag`,...i})}h2.displayName=`TopicTag`;var g2=G(h2);const _2={root:`topic-tag-group`};function v2(e,t){let{as:n=`div`,className:r,...i}=e;return(0,K.jsx)(n,{ref:t,className:W(_2.root,r),"data-component":`TopicTag.Group`,...i})}v2.displayName=`TopicTag.Group`;var y2=G(v2);const b2=Object.assign(g2,{Group:y2}),x2=(0,l.createContext)(null),S2=(0,l.createContext)(null),C2=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,w2=e=>e!==null&&e.effect===void 0,T2=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function E2(e){let{steps:t,step:n,defaultStep:r=null,onStepChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,onStatusChange:c,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=e,_=J(h),v=`${_}-title`,y=`${_}-description`,b=l.useRef(null),x=a!==void 0,[S,C]=l.useState(o),w=x?a:S,T=n!==void 0,[E,D]=l.useState(r),O=T?n:E,k=t.length,A=t.findIndex(e=>e.id===O),j=A===-1?null:t[A],M=l.useCallback(e=>{T||D(e),i?.({stepId:e,stepIndex:t.findIndex(t=>t.id===e),count:t.length})},[T,i,t]),N=l.useCallback(e=>{x||C(e),s?.(e)},[x,s]),P=l.useCallback(e=>{let n=e??t[0]?.id??null;M(n),N(!0),c?.({status:`started`})},[N,M,c,t]),F=l.useCallback(e=>{t.some(t=>t.id===e)&&M(e)},[M,t]),I=l.useCallback(()=>{M(null),N(!1)},[N,M]),L=l.useCallback(()=>{I(),c?.({status:`dismissed`})},[I,c]),ee=l.useCallback(()=>{let e=t[A+1];if(!e){I(),c?.({status:`completed`});return}M(e.id)},[M,I,c,A,t]),R=l.useCallback(()=>{let e=A>0?t[A-1]:void 0;e&&M(e.id)},[M,A,t]),[z,B]=l.useState(()=>({stepId:O,ready:w2(j),patch:null}));z.stepId!==O&&B({stepId:O,ready:w2(j),patch:null});let te=z.stepId===O?z:null,ne=te?.ready??w2(j),re=te?.patch??null,ie=l.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ae=C2(ie),oe=l.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});Vi(()=>{oe.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let se=l.useMemo(()=>({next:()=>oe.current.next(),prev:()=>oe.current.prev(),goto:e=>oe.current.goto(e),dismiss:()=>oe.current.dismiss(),show:()=>B(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>B(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>oe.current.step?.target?.()??null}),[O]);l.useEffect(()=>{if(w)return oe.current.step?.effect?.(se)??void 0},[se,w]);let ce=l.useCallback(()=>oe.current.step?.target?.()??null,[]),[le,ue]=l.useState(null),de=l.useCallback(()=>{let e=ce();if(!e){ue(null);return}let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),a={top:t,left:n,width:r,height:i};ue(e=>e&&T2(e,a)?e:a)},[ce]);Vi(()=>{if(!w||!ne){ue(null);return}de();let e=ce();e?.scrollIntoView?.({block:`center`,inline:`nearest`});let t=new ResizeObserver(de);return e&&t.observe(e),window.addEventListener(`resize`,de),window.addEventListener(`scroll`,de,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,de),window.removeEventListener(`scroll`,de,!0)}},[ce,de,w,ne,O]),Wi(e=>{!w||!d||(e.preventDefault(),L())}),l.useEffect(()=>{if(!w||!ne||!u)return;let e=e=>{e.defaultPrevented||(e.key===`ArrowRight`?(e.preventDefault(),ee()):e.key===`ArrowLeft`&&(e.preventDefault(),R()))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,ee,w,R,ne]),l.useEffect(()=>{if(!w||!ne||!f)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(b.current?.contains(t)||ce()?.contains(t)||L())};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,L,ce,w,ne]),l.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let fe=l.useMemo(()=>({open:w,step:ie,stepIndex:A,steps:t,start:P,next:ee,prev:R,goto:F,dismiss:L,progressText:`${A+1} of ${k}`,progressPercent:k===0?0:(A+1)/k*100,hasNext:A>-1&&A<k-1,hasPrev:A>0}),[k,L,F,ee,w,R,P,ie,A,t]),pe=l.useMemo(()=>({...fe,titleId:v,descriptionId:y,stepType:ae,ready:ne,targetRect:le,getTarget:ce,spotlightOffset:p,spotlightRadius:m,contentRef:b}),[fe,y,ce,ne,p,m,ae,le,v]);return(0,K.jsx)(x2.Provider,{value:pe,children:g})}E2.displayName=`Tour`;const D2=[];function O2(e){let t=l.useContext(x2);return(0,K.jsx)(K.Fragment,{children:e.children(t?.step?.actions??D2)})}O2.displayName=`Tour.Actions`;const k2={root:`tour-action-trigger`};function A2(e,t){let{action:n,className:r,children:i,onClick:a,variant:o=`default`,...s}=e,c=l.useContext(x2);return c?(0,K.jsx)(mi,{ref:t,variant:o,className:W(k2.root,r),onClick:e=>{if(a?.(e),!e.defaultPrevented){if(typeof n.action==`function`){n.action(c);return}n.action===`next`?c.next():n.action===`prev`?c.prev():c.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof n.action==`string`?n.action:`custom`,...s,children:i??n.label}):null}A2.displayName=`Tour.ActionTrigger`;var j2=G(A2);const M2={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},N2={top:{start:`-left`,center:``,end:`-right`},bottom:{start:`-left`,center:``,end:`-right`},left:{start:`-top`,center:``,end:`-bottom`},right:{start:`-top`,center:``,end:`-bottom`}};function P2(e,t){let n=l.useContext(x2),r=l.useContext(S2);if(!n||!r||n.stepType!==`tooltip`||n.step?.arrow===!1)return null;let i=M2[r.side],a=`${i}${N2[i][r.align]}`;return(0,K.jsx)($u,{ref:t,location:a,"data-component":`Tour.Arrow`,...e})}P2.displayName=`Tour.Arrow`;var F2=G(P2);const I2=U([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function L2(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(x2);if(!o||!o.open||!o.ready||o.step?.backdrop===!1)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,K.jsx)(na,{containerName:i,children:(0,K.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:W(I2({spotlit:s!==null}),n),style:{...r,"--tour-target-top":`${(s?.top??0)-c}px`,"--tour-target-left":`${(s?.left??0)-c}px`,"--tour-target-width":`${(s?.width??0)+c*2}px`,"--tour-target-height":`${(s?.height??0)+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":s?``:void 0,...a})})}L2.displayName=`Tour.Backdrop`;var R2=G(L2);const z2={root:`tour-close-trigger`};function B2(e,t){let{className:n,icon:r=yn,onClick:i,"aria-label":a=`Close tour`,...o}=e,s=l.useContext(x2);return s?(0,K.jsx)(_i,{ref:t,icon:r,variant:`invisible`,size:`small`,"aria-label":a,className:W(z2.root,n),onClick:e=>{i?.(e),!e.defaultPrevented&&s.dismiss()},"data-component":`Tour.CloseTrigger`,...o}):null}B2.displayName=`Tour.CloseTrigger`;var V2=G(B2);const H2={root:`tour-content`};function U2(e,t){let{className:n,...r}=e,i=l.useContext(x2),a=B(t,i?.contentRef??null),o=i?.step?.id??null,s=i?.ready??!1,c=i?.contentRef;return l.useEffect(()=>{!s||!o||c?.current?.focus()},[c,s,o]),!i||!i.open||!i.ready||!i.step?null:(0,K.jsx)(`div`,{ref:a,role:`dialog`,"aria-labelledby":i.step.title?i.titleId:void 0,"aria-describedby":i.step.description?i.descriptionId:void 0,tabIndex:-1,className:W(H2.root,n),"data-component":`Tour.Content`,"data-type":i.stepType,"data-step":i.step.id,...r})}U2.displayName=`Tour.Content`;var W2=G(U2);const G2={root:`tour-control`};function K2(e,t){let{className:n,...r}=e;return(0,K.jsx)(`div`,{ref:t,className:W(G2.root,n),"data-component":`Tour.Control`,...r})}K2.displayName=`Tour.Control`;var q2=G(K2);const J2={root:`tour-description`};function Y2(e,t){let{className:n,children:r,...i}=e,a=l.useContext(x2);return a?(0,K.jsx)(`div`,{ref:t,id:a.descriptionId,className:W(J2.root,n),"data-component":`Tour.Description`,...i,children:r??a.step?.description}):null}Y2.displayName=`Tour.Description`;var X2=G(Y2);const Z2=U([`tour-positioner`,`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`],{variants:{type:{dialog:`tour-positioner-dialog`,tooltip:`tour-positioner-tooltip`,floating:`tour-positioner-floating`},unplaced:{true:`invisible`,false:``}}}),Q2=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function $2(e,t){let{side:n=`outside-bottom`,align:r=`center`,placement:i=`bottom-end`,portalContainerName:a,className:o,style:s,children:c,...u}=e,d=l.useContext(x2),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??n,g=f?.align??r,_=f?.placement??i,v=!!(d?.open&&d.ready&&f),y=l.useRef(null),b=B(t,y),x=l.useRef(null),[S,C]=l.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=l.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=sa(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&Q2(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return Vi(()=>{if(!v||!m){x.current=null,C(null);return}E();let e=new ResizeObserver(E);return y.current&&e.observe(y.current),()=>{e.disconnect()}},[m,v,d?.targetRect,E]),!d||!v?null:(0,K.jsx)(na,{containerName:a,children:(0,K.jsx)(`div`,{ref:b,className:W(Z2({type:p,unplaced:m&&!S}),o),style:{...s,"--tour-positioner-top":`${S?.top??0}px`,"--tour-positioner-left":`${S?.left??0}px`},"data-component":`Tour.Positioner`,"data-type":p,"data-side":S?.anchorSide??h,"data-align":S?.anchorAlign??g,"data-placement":p===`floating`?_:void 0,...u,children:(0,K.jsx)(S2.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:c})})})}$2.displayName=`Tour.Positioner`;var e4=G($2);const t4={root:`tour-progress-text`};function n4(e,t){let{className:n,children:r,...i}=e,a=l.useContext(x2);return a?(0,K.jsx)(`div`,{ref:t,className:W(t4.root,n),"data-component":`Tour.ProgressText`,...i,children:r??a.progressText}):null}n4.displayName=`Tour.ProgressText`;var r4=G(n4);const i4={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function a4(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(x2);if(!o||!o.open||!o.ready||!o.targetRect)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,K.jsx)(na,{containerName:i,children:(0,K.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:W(i4.root,n),style:{...r,"--tour-target-top":`${s.top-c}px`,"--tour-target-left":`${s.left-c}px`,"--tour-target-width":`${s.width+c*2}px`,"--tour-target-height":`${s.height+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...a})})}a4.displayName=`Tour.Spotlight`;var o4=G(a4);const s4={root:`tour-title`};function c4(e,t){let{className:n,children:r,...i}=e,a=l.useContext(x2);return a?(0,K.jsx)(`h2`,{ref:t,id:a.titleId,className:W(s4.root,n),"data-component":`Tour.Title`,...i,children:r??a.step?.title}):null}c4.displayName=`Tour.Title`;var l4=G(c4);const u4=()=>{let e=(0,l.useContext)(x2);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},d4=(e,{timeout:t=1e4}={})=>{let n=null,r=!1,i=()=>{r=!0,n!==null&&(cancelAnimationFrame(n),n=null)};return[new Promise(a=>{let o=Date.now()+t,s=()=>{if(r)return;let t=e();if(t){i(),a(t);return}if(Date.now()>=o){i(),a(null);return}n=requestAnimationFrame(s)};s()}),i]},f4=(e,t,n={})=>{let{predicate:r,...i}=n,a=()=>{};return[new Promise(n=>{let o=e?.();if(!o){n(null);return}let s=e=>{r&&!r(o)||(a(),n(e))};o.addEventListener(t,s,i),a=()=>o.removeEventListener(t,s,i)}),()=>a()]},p4=(e,t)=>d4(e,t),m4=(e,t,n)=>d4(()=>{let n=e();return n&&n.value===t?n:null},n),h4=Object.assign(E2,{Backdrop:R2,Spotlight:o4,Positioner:e4,Content:W2,Arrow:F2,CloseTrigger:V2,ProgressText:r4,Title:l4,Description:X2,Control:q2,Actions:O2,ActionTrigger:j2}),g4=l.createContext({announceUpdate:()=>{},expandedStateCache:{current:new Map},scrollElementIntoView:()=>{}}),_4=l.createContext({itemId:``,level:1,isSubTreeEmpty:!1,setIsSubTreeEmpty:()=>{},isExpanded:!1,setIsExpanded:()=>{},leadingVisualId:``,trailingVisualId:``,trailingActionId:``}),v4=l.createContext(!1),y4=`[role=tree]`,b4=`[role=treeitem]`,x4=e=>{let t=e.getAttribute(`aria-label`);if(t)return t;let n=e.getAttribute(`aria-labelledby`);return n?document.getElementById(n)?.textContent??``:e.textContent??``},S4=e=>{let t=e.getAttribute(`aria-expanded`);return t===`true`?`open`:t===`false`?`closed`:`end`},C4=e=>!!e.parentElement?.closest(`[role=treeitem][aria-expanded=false]`),w4=e=>{let t=e.querySelector(b4);return t instanceof HTMLElement?t:void 0},T4=e=>{let t=e.closest(`[role=group]`)?.closest(b4);return t instanceof HTMLElement?t:void 0},E4=e=>{let t=e.closest(y4)?.querySelector(b4);return t instanceof HTMLElement?t:void 0},D4=e=>{let t=e.closest(y4);if(!t)return;let n=Array.from(t.querySelectorAll(b4));for(let e=n.length-1;e>=0;e--)if(!C4(n[e]))return n[e]},O4=(e,t)=>{let n=e.closest(y4);if(!n)return;let r=Array.from(n.querySelectorAll(b4)),i=t===`next`?1:-1;for(let t=r.indexOf(e)+i;t>=0&&t<r.length;t+=i)if(!C4(r[t]))return r[t]},k4=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`)return t;t=t.parentElement}},A4=(e,t)=>{let n=t?.getBoundingClientRect().height||32,r=k4(e)?.clientHeight??window.innerHeight;return Math.max(Math.floor(r/n),1)},j4=(e,t)=>{let n=e.closest(y4);if(!n)return;let r=Array.from(n.querySelectorAll(b4));if(r.length===0)return;let i=A4(n,r[0].firstElementChild),a=r.indexOf(e),o=Math.floor(a/i),s=a-i*o,c=(o+(t===`next`?1:-1))*i+s;return r[Math.min(Math.max(c,0),r.length-1)]},M4={"open ArrowRight":w4,"closed ArrowLeft":T4,"end ArrowLeft":T4},N4=new Set([`ArrowLeft`,`ArrowRight`]),P4={ArrowUp:e=>O4(e,`previous`),ArrowDown:e=>O4(e,`next`),Backspace:T4,Home:E4,End:D4,PageUp:e=>j4(e,`previous`),PageDown:e=>j4(e,`next`)},F4=(e,t)=>N4.has(t)?M4[`${S4(e)} ${t}`]?.(e):P4[t]?.(e),I4=`[role=treeitem]`,L4=({containerRef:e})=>{Vi(()=>{let t=e.current;if(!t)return;let n=e=>{let n=Array.from(t.querySelectorAll(I4));if(n.length===0)return;let r=(e instanceof HTMLElement&&t.contains(e)?e.closest(I4):null)??n.find(e=>e.tabIndex===0)??n.find(e=>e.getAttribute(`aria-current`)===`true`)??n[0];for(let e of n)e.tabIndex=e===r?0:-1};n();let r=e=>{n(e.target)},i=e=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let n=e.target?.closest(I4);if(!n||!t.contains(n))return;let r=F4(n,e.key);r&&(e.preventDefault(),r.focus())},a=new MutationObserver(()=>n(document.activeElement));return a.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`focusin`,r),t.addEventListener(`keydown`,i),()=>{a.disconnect(),t.removeEventListener(`focusin`,r),t.removeEventListener(`keydown`,i)}},[e])},R4=(e,t)=>e.map((n,r)=>e[(t+r)%e.length]),z4=({containerRef:e,onFocusChange:t})=>{let n=l.useRef(``),r=l.useRef(0),i=l.useRef(t);l.useEffect(()=>{i.current=t},[t]),l.useEffect(()=>{let t=e.current;if(!t)return;let a=null,o=()=>(a??=Array.from(t.querySelectorAll(`[role=treeitem]`)),a),s=new MutationObserver(()=>{a=null});s.observe(t,{childList:!0,subtree:!0});let c=e=>{if(!e.key||e.key.length>1||e.key===` `||e.ctrlKey||e.altKey||e.metaKey)return;n.current+=e.key;let t=o(),a=t.findIndex(e=>e===document.activeElement),s=R4(t,Math.max(a,0)),c=n.current.length===1?s.slice(1):s,l=n.current.toLowerCase(),u=c.find(e=>x4(e).trim().toLowerCase().startsWith(l));u&&i.current(u),window.clearTimeout(r.current),r.current=window.setTimeout(()=>{n.current=``},300),e.preventDefault(),e.stopPropagation()};return t.addEventListener(`keydown`,c),()=>{s.disconnect(),t.removeEventListener(`keydown`,c),window.clearTimeout(r.current)}},[e])},B4={root:`tree-view`,hover:`tree-view-hover`,coarse:`tree-view-coarse`,hidden:`sr-only`};function V4(e,t){let{children:n,className:r,flat:i,truncate:a=!0,...o}=e,s=l.useRef(null),c=B(t,s),[u,d]=l.useState(``),f=l.useCallback(e=>d(e),[]);L4({containerRef:s}),z4({containerRef:s,onFocusChange:e=>e.focus()});let p=l.useRef(null),m=l.useCallback(e=>{e&&(p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,e.isConnected&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}))},[]);l.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current)},[]);let h=l.useRef(null);h.current??=new Map;let g=l.useMemo(()=>({announceUpdate:f,expandedStateCache:h,scrollElementIntoView:m}),[f,m]);return(0,K.jsxs)(g4.Provider,{value:g,children:[(0,K.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:B4.hidden,"data-component":`TreeView.Announcement`,children:u}),(0,K.jsx)(`ul`,{ref:c,role:`tree`,className:W(B4.root,B4.hover,B4.coarse,r),"data-component":`TreeView`,"data-omit-spacer":i?`true`:void 0,"data-truncate-text":a?`true`:`false`,...o,children:n})]})}V4.displayName=`TreeView`;var H4=l.forwardRef(V4);const U4={root:`tree-view-directory-icon`};function W4(){let{isExpanded:e}=l.useContext(_4),t=e?Tn:En;return(0,K.jsx)(`span`,{className:U4.root,"data-component":`TreeView.DirectoryIcon`,children:(0,K.jsx)(t,{})})}W4.displayName=`TreeView.DirectoryIcon`;const G4=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`];function K4(e){let{title:t=`Error`,children:n,onRetry:r,onDismiss:i}=e,{itemId:a,setIsExpanded:o}=l.useContext(_4);return(0,K.jsx)(`div`,{onKeyDown:e=>{G4.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ErrorDialog`,children:(0,K.jsx)(Yh,{title:t,confirmButtonContent:`Retry`,cancelButtonContent:`Dismiss`,onClose:e=>{if(window.setTimeout(()=>document.getElementById(a)?.focus()),e===`confirm`){r?.();return}o(!1),i?.()},children:n})})}K4.displayName=`TreeView.ErrorDialog`;const q4={hidden:`sr-only`},J4=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`],Y4=e=>(0,f.isValidElementType)(e)?(0,K.jsx)(e,{}):e;function X4(e){let{items:t,onClose:n}=e,{itemId:r}=l.useContext(_4);return(0,K.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>{J4.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ActionDialog`,children:(0,K.jsx)(V_,{title:`Supplemental actions`,onClose:()=>{n?.(),window.setTimeout(()=>document.getElementById(r)?.focus())},children:(0,K.jsx)(Mi,{children:t.map(({label:e,onClick:t,icon:n,count:r},i)=>(0,K.jsxs)(Mi.Item,{onSelect:t,children:[(0,K.jsx)(Mi.LeadingVisual,{children:Y4(n)}),e,r?(0,K.jsxs)(Mi.TrailingVisual,{children:[r,(0,K.jsx)(`span`,{className:q4.hidden,children:` items`})]}):null]},i))})})})}X4.displayName=`TreeView.ActionDialog`;const Z4={visual:`tree-view-visual`,hidden:`sr-only`},Q4=(e,t)=>typeof e==`function`?e({isExpanded:t}):e,$4=e=>{let{children:t,label:n,labelId:r,className:i,"data-component":a}=e,{isExpanded:o}=l.useContext(_4);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{id:r,className:Z4.hidden,"aria-hidden":`true`,children:n}),(0,K.jsx)(`span`,{className:i,"aria-hidden":`true`,"data-component":a,children:Q4(t,o)})]})},e3={root:`tree-view-leading-action`};function t3(e){return(0,K.jsx)($4,{label:e.label,className:e3.root,"data-component":`TreeView.LeadingAction`,children:e.children})}t3.displayName=`TreeView.LeadingAction`;function n3(e){let{leadingVisualId:t}=l.useContext(_4);return(0,K.jsx)($4,{label:e.label,labelId:t,className:Z4.visual,"data-component":`TreeView.LeadingVisual`,children:e.children})}n3.displayName=`TreeView.LeadingVisual`;const r3={root:`tree-view-sub-tree`,skeletonRow:`tree-view-skeleton-row`,skeletonText:`tree-view-skeleton-text`,muted:`tree-view-muted`,hidden:`sr-only`},i3=[`67%`,`47%`,`73%`,`64%`,`50%`],a3=e=>{let t=l.useRef(e);return l.useEffect(()=>{t.current=e},[e]),t.current},o3=({index:e})=>(0,K.jsxs)(`span`,{className:r3.skeletonRow,style:{"--tree-view-skeleton-width":i3[e%i3.length]},"aria-hidden":`true`,children:[(0,K.jsx)(oQ,{size:16,shape:`square`}),(0,K.jsx)(n_,{className:r3.skeletonText})]}),s3=l.forwardRef(({count:e},t)=>{let n=J();return(0,K.jsx)(v4.Provider,{value:!0,children:(0,K.jsx)(_3,{ref:t,id:n,children:e?(0,K.jsxs)(K.Fragment,{children:[Array.from({length:e},(e,t)=>(0,K.jsx)(o3,{index:t},t)),(0,K.jsxs)(`span`,{className:r3.hidden,children:[`Loading `,e,` items`]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(n3,{children:(0,K.jsx)(ei,{size:`small`,srText:null})}),(0,K.jsx)(Ro,{className:r3.muted,children:`Loading...`})]})})})});s3.displayName=`TreeView.LoadingItem`;const c3=()=>(0,K.jsx)(_3,{id:J(),expanded:null,children:(0,K.jsx)(Ro,{className:r3.muted,children:`No items found`})});function l3(e){let{count:t,state:n,children:r,"aria-label":i}=e,{announceUpdate:a}=l.useContext(g4),{itemId:o,isExpanded:s,isSubTreeEmpty:c,setIsSubTreeEmpty:u}=l.useContext(_4),d=l.useRef(null),f=l.useRef(null),[p,m]=l.useState(!1),[h,g]=l.useState(``),_=a3(n);return l.useEffect(()=>{(n===void 0||n===`done`)&&u(!r)},[n,r,u]),l.useEffect(()=>{let e=document.getElementById(o);if(!e)return;let t=x4(e);if(g(t),n===`loading`){a(`${t} content loading`);return}if(_!==`loading`||n!==`done`||(a(d.current?.childElementCount?`${t} content loaded`:`${t} is empty`),!p))return;let r=window.setTimeout(()=>{(w4(e)??e).focus()});return m(!1),()=>{window.clearTimeout(r)}},[o,n,_,p,a]),l.useEffect(()=>{let e=f.current;if(!e)return;let t=()=>m(!0),n=e=>{e.relatedTarget&&m(!1)};return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[n]),s?(0,K.jsxs)(`ul`,{ref:d,role:`group`,"aria-label":i||h,className:W(r3.root),"data-component":`TreeView.SubTree`,children:[n===`loading`?(0,K.jsx)(s3,{ref:f,count:t}):r,c&&n!==`loading`?(0,K.jsx)(c3,{}):null]}):null}l3.displayName=`TreeView.SubTree`;const u3={root:`tree-view-trailing-action`,button:`shrink`,hidden:`sr-only`};function d3(e){let{items:t,shortcutText:n}=e,{itemId:r,trailingActionId:i}=l.useContext(_4),a=()=>{document.getElementById(r)?.focus()};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{id:i,className:u3.hidden,children:n}),(0,K.jsx)(`span`,{className:u3.root,"aria-hidden":`true`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),"data-component":`TreeView.TrailingAction`,children:t.map(({label:e,onClick:t,icon:n,count:r,className:i},o)=>r?(0,K.jsx)(oZ,{text:e,children:(0,K.jsx)(mi,{variant:`invisible`,leadingVisual:n,count:r,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:a,className:W(u3.button,i)})},o):(0,K.jsx)(_i,{icon:n,variant:`invisible`,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:a,className:W(u3.button,i)},o))})]})}d3.displayName=`TreeView.TrailingAction`;function f3(e){let{trailingVisualId:t}=l.useContext(_4);return(0,K.jsx)($4,{label:e.label,labelId:t,className:Z4.visual,"data-component":`TreeView.TrailingVisual`,children:e.children})}f3.displayName=`TreeView.TrailingVisual`;const p3={root:`tree-view-item`,container:`tree-view-item-container`,flat:`tree-view-item-container-flat`,hasLeadingAction:`tree-view-item-container-has-leading-action`,current:`tree-view-item-container-current`,loading:`tree-view-item-container-loading`,spacer:`tree-view-item-spacer`,levelLines:`tree-view-item-level-lines`,levelLine:`tree-view-item-level-line`,toggle:`tree-view-item-toggle`,toggleHover:`tree-view-item-toggle-hover`,toggleEnd:`tree-view-item-toggle-end`,content:`tree-view-item-content`,label:`tree-view-item-label`},m3=e=>Sr(e,{leadingAction:t3,leadingVisual:n3,trailingVisual:f3,subTree:l3}),h3=({level:e})=>(0,K.jsx)(`span`,{className:p3.levelLines,children:Array.from({length:e-1},(e,t)=>(0,K.jsx)(`span`,{className:p3.levelLine},t))});function g3(e,t){let{as:n,id:r,children:i,className:a,current:o=!1,defaultExpanded:s,expanded:c,onExpandedChange:u,onSelect:d,containIntrinsicSize:f,secondaryActions:p,"aria-label":m,"aria-labelledby":h,...g}=e,{expandedStateCache:_,scrollElementIntoView:v}=l.useContext(g4),{level:y}=l.useContext(_4),b=l.useContext(v4),x=NC(),[S,C]=m3(i),w=!!S.subTree,T=J(),E=J(),D=J(),O=J(),k=c!==void 0,[A,j]=l.useState(()=>_.current?.get(r)??s??o),M=k?c===!0:A,[N,P]=l.useState(!w),[F,I]=l.useState(!1),[L,ee]=l.useState(!1),R=l.useCallback(e=>{j(e),_.current?.set(r,e),u?.(e)},[r,_,u]),z=l.useCallback(e=>{R(!M),e?.stopPropagation()},[M,R]),B=l.useCallback(()=>{if(p?.length){if(p.length===1){p[0].onClick();return}ee(!0)}},[p]),te=e=>{switch(e.key){case`Enter`:case` `:d?d(e):z(e),e.stopPropagation();break;case`ArrowRight`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!0);break;case`ArrowLeft`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!1);break;case`U`:case`u`:if(!(e.shiftKey&&(e.metaKey||e.ctrlKey)))return;B()}},ne=e=>{d?d(e):z(e),e.stopPropagation()},re=`Press (${DC(`Shift+${x===`apple`?`Meta`:`Control`}+U`,x)}) for more actions.`,ie=[S.leadingVisual?E:void 0,S.trailingVisual?D:void 0].filter(Boolean),ae=l.useMemo(()=>({itemId:r,level:y+1,isSubTreeEmpty:N,setIsSubTreeEmpty:P,isExpanded:M,setIsExpanded:R,leadingVisualId:E,trailingVisualId:D,trailingActionId:O}),[r,y,N,M,R,E,D,O]),oe=N&&(!M||!w)||c===null?void 0:M,se=n??`li`,ce=n!==void 0&&n!==`li`,le=(0,K.jsxs)(se,{ref:t,id:r,role:`treeitem`,tabIndex:-1,"aria-label":p&&m?`${m}. ${re}`:m,"aria-labelledby":m?void 0:`${h||T} ${p?O:``}`.trim(),"aria-describedby":ie.length>0?ie.join(` `):void 0,"aria-level":y,"aria-expanded":oe,"aria-current":o?`true`:void 0,"aria-selected":F?`true`:`false`,className:W(p3.root,a),"data-component":`TreeView.Item`,"data-has-leading-action":S.leadingAction?``:void 0,"data-loading":b?``:void 0,onKeyDown:te,onClick:ne,onAuxClick:e=>{d&&e.button===1&&d(e),e.stopPropagation()},onFocus:e=>{v(e.currentTarget.firstElementChild),I(!0),e.stopPropagation()},onBlur:()=>I(!1),...g,children:[(0,K.jsxs)(`span`,{className:W(p3.container,p3.flat,S.leadingAction&&p3.hasLeadingAction,o&&p3.current,b&&p3.loading),style:{"--tree-view-level":y,contentVisibility:f?`auto`:void 0,containIntrinsicSize:f},children:[(0,K.jsx)(`span`,{className:p3.spacer,children:(0,K.jsx)(h3,{level:y})}),S.leadingAction,w?(0,K.jsx)(`span`,{className:W(p3.toggle,d&&p3.toggleHover,y===1&&p3.toggleEnd),onClick:e=>{d&&z(e)},"data-component":`TreeView.Item.Toggle`,children:M?(0,K.jsx)(cn,{width:12,height:12}):(0,K.jsx)(un,{width:12,height:12})}):null,(0,K.jsxs)(`span`,{id:T,className:p3.content,children:[S.leadingVisual,(0,K.jsx)(`span`,{className:p3.label,"data-component":`TreeView.Item.Label`,children:C}),S.trailingVisual]}),p?.length?(0,K.jsx)(d3,{items:p,shortcutText:re}):null]}),S.subTree,L&&p?(0,K.jsx)(X4,{items:p,onClose:()=>ee(!1)}):null]});return(0,K.jsx)(_4.Provider,{value:ae,children:ce?(0,K.jsx)(`li`,{role:`none`,children:le}):le})}g3.displayName=`TreeView.Item`;var _3=G(g3);const v3=Object.assign(H4,{Item:_3,SubTree:l3,LeadingAction:t3,LeadingVisual:n3,TrailingVisual:f3,DirectoryIcon:W4,ErrorDialog:K4}),y3={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function b3(e,t){let{as:n=`div`,className:r,title:i,maxWidth:a=125,inline:o,expandable:s,style:c,...l}=e;return(0,K.jsx)(n,{ref:t,title:i,className:W(y3.root,o?y3.inline:y3.block,s&&y3.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}b3.displayName=`Truncate`;var x3=G(b3);const S3=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=(0,l.useState)(e),[a,o]=(0,l.useState)(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},C3=(0,l.createContext)({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),w3=()=>(0,l.useContext)(C3),T3=(e,t)=>{let{colorScheme:n}=w3();return(n?e[n]:void 0)??t},E3=`(prefers-color-scheme: dark)`,D3=e=>{let t=window?.matchMedia?.(E3);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},O3=()=>window?.matchMedia?.(E3)?.matches?`night`:`day`,k3=()=>`day`,A3=()=>l.useSyncExternalStore(D3,O3,k3),j3=(e,t)=>e===`auto`?t:e,M3=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function N3({children:e,className:t,contextOnly:n,...r}){let{colorMode:i,dayScheme:a,nightScheme:o}=w3(),[s,c]=S3(r.colorMode??i??`day`),[u,d]=S3(r.dayScheme??a??`light`),[f,p]=S3(r.nightScheme??o??`dark`),m=A3(),h=j3(s,m),g=M3(h,u,f),_=l.useMemo(()=>({colorScheme:g,colorMode:s,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:c,setDayScheme:d,setNightScheme:p}),[g,s,h,u,f,c,d,p]);return n?(0,K.jsx)(C3.Provider,{value:_,children:e}):(0,K.jsx)(C3.Provider,{value:_,children:(0,K.jsx)(`div`,{className:t,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":s,children:e})})}N3.displayName=`ThemeProvider`,exports.ARROW_KEY_STEP=3,exports.AUTO_LOCALE=`auto`,exports.Accordion=dr,exports.AccordionContext=Ft,exports.AccordionHeader=ir,exports.AccordionItem=sr,exports.AccordionItemContext=tr,exports.AccordionPanel=ur,exports.ActionBar=Ya,exports.ActionBarButton=Ja,exports.ActionBarContext=xa,exports.ActionBarDivider=Ea,exports.ActionBarGroup=ka,exports.ActionBarIconButton=Ma,exports.ActionBarItemContext=Sa,exports.ActionBarMenu=La,exports.ActionList=Mi,exports.ActionListContainerContext=jr,exports.ActionListContext=Dr,exports.ActionListDescription=zr,exports.ActionListDivider=Vr,exports.ActionListGroup=Xr,exports.ActionListGroupContext=Hr,exports.ActionListGroupHeading=qr,exports.ActionListHeading=Ar,exports.ActionListItem=ki,exports.ActionListItemContext=Lr,exports.ActionListLeadingVisual=ri,exports.ActionListLinkItem=ji,exports.ActionListSubItem=ii,exports.ActionListTrailingAction=bi,exports.ActionListTrailingVisual=xi,exports.ActionMenu=ga,exports.ActionMenuAnchor=Pi,exports.ActionMenuButton=Fi,exports.ActionMenuContext=Ni,exports.ActionMenuOverlay=ha,exports.Alert=Qa,exports.AnchoredOverlay=pa,exports.AspectRatio=to,exports.Attachment=jo,exports.AttachmentAction=co,exports.AttachmentActions=fo,exports.AttachmentContent=ho,exports.AttachmentContext=no,exports.AttachmentDescription=vo,exports.AttachmentGroup=xo,exports.AttachmentMedia=wo,exports.AttachmentTitle=Do,exports.AttachmentTrigger=Ao,exports.Autocomplete=us,exports.AutocompleteContext=Mo,exports.AutocompleteDeferredInputContext=Po,exports.AutocompleteInput=$o,exports.AutocompleteInputContext=No,exports.AutocompleteMenu=as,exports.AutocompleteOverlay=ls,exports.Avatar=nc,exports.AvatarContext=fs,exports.AvatarFallback=Qs,exports.AvatarImage=tc,exports.AvatarStack=dc,exports.Banner=Nc,exports.BannerContext=fc,exports.BannerDescription=mc,exports.BannerPrimaryAction=Ac,exports.BannerSecondaryAction=Mc,exports.BannerTitle=_c,exports.Blankslate=nl,exports.BlankslateDescription=zc,exports.BlankslateHeading=Hc,exports.BlankslatePrimaryAction=qc,exports.BlankslateSecondaryAction=Qc,exports.BlankslateVisual=tl,exports.Blockquote=al,exports.Box=cl,exports.Breadcrumbs=yl,exports.BreadcrumbsContext=ul,exports.BreadcrumbsItem=vl,exports.Bubble=Fl,exports.BubbleContent=Ol,exports.BubbleContext=xl,exports.BubbleGroup=jl,exports.BubbleGroupContext=Sl,exports.BubbleReactions=Pl,exports.Button=mi,exports.ButtonGroup=Hl,exports.CHART_COLORS=jd,exports.CHART_OVERFLOW_COLOR=Ad,exports.CHART_SERIES_COLORS=kd,exports.Calendar=Su,exports.CalendarDay=Gl,exports.Card=Ju,exports.CardAction=Tu,exports.CardDescription=ku,exports.CardHeading=Mu,exports.CardIcon=Fu,exports.CardImage=Ru,exports.CardMetadata=Vu,exports.Caret=$u,exports.Carousel=Sd,exports.CarouselContext=td,exports.CarouselControls=md,exports.CarouselIndicators=ad,exports.CarouselNextButton=sd,exports.CarouselPlayButton=ld,exports.CarouselPreviousButton=dd,exports.CarouselSlide=_d,exports.CarouselSlideContext=nd,exports.Chart=Gd,exports.ChartContext=Cd,exports.ChartGradient=Od,exports.ChartLegend=zd,exports.ChartRadialText=Hd,exports.ChartTooltip=Wd,exports.Checkbox=Xd,exports.CheckboxCard=ff,exports.CheckboxCardContext=Zd,exports.CheckboxCardDescription=ef,exports.CheckboxCardLabel=rf,exports.CheckboxCardLeadingVisual=sf,exports.CheckboxGroup=Of,exports.CheckboxGroupCaption=hf,exports.CheckboxGroupContext=Kd,exports.CheckboxGroupLabel=vf,exports.CheckboxGroupValidation=Cf,exports.Clipboard=Kf,exports.ClipboardContext=kf,exports.ClipboardIndicator=Lf,exports.ClipboardInput=Hf,exports.ClipboardTrigger=Gf,exports.Code=Yf,exports.CodeBlock=vp,exports.CodeBlockCode=sp,exports.CodeBlockContent=dp,exports.CodeBlockContext=Xf,exports.CodeBlockHeader=mp,exports.CodeBlockTitle=_p,exports.Collapsible=kp,exports.CollapsibleContent=Tp,exports.CollapsibleContext=yp,exports.CollapsibleTrigger=Op,exports.Combobox=Om,exports.ComboboxClearTrigger=Rp,exports.ComboboxContent=Vp,exports.ComboboxContext=Ap,exports.ComboboxControl=Wp,exports.ComboboxEmpty=qp,exports.ComboboxInput=Qp,exports.ComboboxItem=nm,exports.ComboboxItemContext=Mp,exports.ComboboxItemGroup=am,exports.ComboboxItemGroupContext=jp,exports.ComboboxItemGroupLabel=cm,exports.ComboboxItemIndicator=dm,exports.ComboboxItemText=mm,exports.ComboboxLabel=_m,exports.ComboboxList=bm,exports.ComboboxPositioner=wm,exports.ComboboxTrigger=Dm,exports.CommandPalette=fh,exports.CommandPaletteContext=Mm,exports.CommandPaletteDialog=Wm,exports.CommandPaletteEmpty=qm,exports.CommandPaletteGroup=Xm,exports.CommandPaletteGroupContext=Nm,exports.CommandPaletteInput=$m,exports.CommandPaletteItem=nh,exports.CommandPaletteList=ah,exports.CommandPaletteLoading=ch,exports.CommandPaletteSeparator=dh,exports.ConfirmationDialog=Yh,exports.ContextMenu=ag,exports.ContextMenuContext=Qh,exports.ContextMenuOverlay=ng,exports.ContextMenuTrigger=ig,exports.CounterLabel=ci,exports.DAYS_IN_WEEK=7,exports.DAY_KEY_FORMAT=nu,exports.DEFAULT_AVATAR_SIZE=20,exports.DEFAULT_COLOR_MODE=`day`,exports.DEFAULT_CURRENT_STEP=1,exports.DEFAULT_DIRECTION=`ltr`,exports.DEFAULT_FLOATING_PANEL_MIN_SIZE=Yy,exports.DEFAULT_FLOATING_PANEL_POSITION=Jy,exports.DEFAULT_FLOATING_PANEL_SIZE=qy,exports.DEFAULT_ISSUE_LABEL_FILL_COLOR=r2,exports.DEFAULT_LOCALE=gs,exports.DEFAULT_MAP_LATITUDE=wU,exports.DEFAULT_MAP_LONGITUDE=TU,exports.DEFAULT_MAP_ZOOM=16,exports.DEFAULT_MARKDOWN_NAMESPACE=PU,exports.DEFAULT_MARKER_COLOR=oR,exports.DEFAULT_RATING_COUNT=5,exports.DEFAULT_RELATIVE_TIME_PREFIX=`on`,exports.DEFAULT_RELATIVE_TIME_THRESHOLD=hX,exports.DEFAULT_RICH_TEXT_EDITOR_CONTROLS=WX,exports.DEFAULT_RICH_TEXT_EDITOR_NAMESPACE=PX,exports.DEFAULT_SORT_DIRECTION=`ASC`,exports.DEFAULT_SPOTLIGHT_OFFSET=4,exports.DEFAULT_SPOTLIGHT_RADIUS=8,exports.DEFAULT_TABLE_PAGE_SIZE=25,exports.DEFAULT_TABLE_SKELETON_ROWS=10,exports.DEFAULT_TEXTAREA_COLS=30,exports.DEFAULT_TEXTAREA_RESIZE=qx,exports.DEFAULT_TEXTAREA_ROWS=7,exports.DEFAULT_TOGGLE_SWITCH_LOADING_LABEL_DELAY=T0,exports.DEFAULT_TOKEN_SIZE=H0,exports.DEFAULT_TRUNCATE_MAX_WIDTH=125,exports.DataTable=O_,exports.DatePicker=N_,exports.Details=B_,exports.DetailsSummary=z_,exports.Dialog=V_,exports.DialogBody=vh,exports.DialogButtons=bh,exports.DialogCloseButton=Sh,exports.DialogContext=yh,exports.DialogFooter=Th,exports.DialogHeader=Oh,exports.DialogSubtitle=jh,exports.DialogTitle=Ph,exports.DirectionContext=Rs,exports.DirectionProvider=KC,exports.DragHandle=VK,exports.Drawer=fv,exports.DrawerBody=W_,exports.DrawerCloseButton=J_,exports.DrawerContext=G_,exports.DrawerFooter=Z_,exports.DrawerHeader=ev,exports.DrawerSubtitle=rv,exports.DrawerTitle=ov,exports.Em=hv,exports.EmptyState=bv,exports.FLOATING_PANEL_LARGE_STEP=40,exports.FLOATING_PANEL_STEP=8,exports.FRAME_ROOT_CLASS=TS,exports.FileUpload=ny,exports.FileUploadContext=Ev,exports.FileUploadDescription=kv,exports.FileUploadIcon=Mv,exports.FileUploadItem=ty,exports.FileUploadLabel=Fv,exports.FileUploadList=Rv,exports.FilteredActionList=Ky,exports.FilteredActionListBodyLoader=Vy,exports.FilteredActionListInput=Oy,exports.FilteredActionListItem=jy,exports.FloatingPanel=Hb,exports.FloatingPanelBody=lb,exports.FloatingPanelCloseTrigger=db,exports.FloatingPanelContent=hb,exports.FloatingPanelContext=ib,exports.FloatingPanelControl=vb,exports.FloatingPanelDragTrigger=xb,exports.FloatingPanelHeader=wb,exports.FloatingPanelPositioner=Db,exports.FloatingPanelResizeTrigger=Mb,exports.FloatingPanelStageTrigger=Fb,exports.FloatingPanelTitle=Rb,exports.FloatingPanelTrigger=Vb,exports.Flow=_x,exports.FlowContext=Jb,exports.FlowList=Zb,exports.FlowNode=ex,exports.FlowParallel=rx,exports.FormControl=vS,exports.FormControlCaption=tS,exports.FormControlContext=Rf,exports.FormControlLabel=iS,exports.FormControlLeadingVisual=sS,exports.FormControlValidation=fS,exports.FormatByte=bS,exports.FormatNumber=SS,exports.Frame=kS,exports.Header=zS,exports.HeaderItem=FS,exports.HeaderLink=RS,exports.Heading=Er,exports.Hidden=HS,exports.Highlight=YS,exports.HoverCard=iC,exports.HoverCardContent=$S,exports.HoverCardContext=XS,exports.HoverCardTrigger=eC,exports.IconButton=_i,exports.Image=sC,exports.InlineMessage=pC,exports.IssueLabelToken=p2,exports.KeybindingHint=BC,exports.Label=UC,exports.LabelGroup=ew,exports.LayerCard=dw,exports.LayerCardPrimary=rw,exports.LayerCardSecondary=ow,exports.Link=Xc,exports.LinkButton=pw,exports.List=bw,exports.ListItem=yw,exports.LocaleContext=zs,exports.LocaleProvider=Ws,exports.MARKDOWN_NODES=FU,exports.MARKDOWN_TRANSFORMERS=IU,exports.MARQUEE_MINIMUM_COPIES=2,exports.MARQUEE_SPEEDS=BU,exports.Map=AU,exports.MapAttributionControl=uV,exports.MapDragRotateAndZoomInteraction=eU,exports.MapDrawControl=KH,exports.MapFullScreenControl=yV,exports.MapGraticuleLayer=ER,exports.MapHeatmapLayer=iV,exports.MapImageLayer=wR,exports.MapLayerGroup=yR,exports.MapLayersControl=YH,exports.MapLinkInteraction=SU,exports.MapMarker=pR,exports.MapMousePositionControl=OV,exports.MapOverlay=hR,exports.MapOverviewMapControl=MV,exports.MapPointerInteraction=aU,exports.MapScaleLineControl=wV,exports.MapSearchControl=ZH,exports.MapSelectInteraction=hU,exports.MapTileLayer=bR,exports.MapTranslateInteraction=iU,exports.MapVectorLayer=TR,exports.MapView=$L,exports.MapWebGLTileLayer=sV,exports.Mark=GS,exports.Markdown=zU,exports.Marquee=KU,exports.Message=fW,exports.MessageAvatar=$U,exports.MessageContent=nW,exports.MessageContext=bl,exports.MessageFooter=aW,exports.MessageGroup=cW,exports.MessageGroupContext=qU,exports.MessageHeader=dW,exports.Meter=IW,exports.MeterContext=_W,exports.MeterIndicator=bW,exports.MeterLabel=CW,exports.MeterTrack=EW,exports.MeterValue=kW,exports.NativeSelect=VW,exports.NativeSelectOptGroup=RW,exports.NativeSelectOption=BW,exports.NavigationList=_G,exports.NavigationListGroup=$W,exports.NavigationListGroupExpand=pG,exports.NavigationListGroupHeading=gG,exports.NavigationListHeading=UW,exports.NavigationListItem=uG,exports.NavigationListSubNavigation=oG,exports.NavigationMenu=dK,exports.NavigationMenuContent=NG,exports.NavigationMenuContext=bG,exports.NavigationMenuDepthContext=wG,exports.NavigationMenuDescription=FG,exports.NavigationMenuDivider=LG,exports.NavigationMenuGroup=HG,exports.NavigationMenuGroupHeading=zG,exports.NavigationMenuHeading=yG,exports.NavigationMenuHeadingLevelContext=CG,exports.NavigationMenuItem=GG,exports.NavigationMenuItemContext=xG,exports.NavigationMenuLeadingVisual=JG,exports.NavigationMenuLink=rK,exports.NavigationMenuLinkContext=SG,exports.NavigationMenuList=sK,exports.NavigationMenuSubNavigation=ZG,exports.NavigationMenuTrailingVisual=$G,exports.NavigationMenuTrigger=uK,exports.NumberInput=hK,exports.OverflowObserverContext=_a,exports.OverflowObserverProvider=va,exports.PINInput=wq,exports.PageLayout=sq,exports.PageLayoutContent=rq,exports.PageLayoutContext=_K,exports.PageLayoutFooter=CK,exports.PageLayoutHeader=EK,exports.PageLayoutPane=oq,exports.PageLayoutSidebar=JK,exports.Pagination=hq,exports.PasswordInput=vq,exports.Placeholder=Dq,exports.PlatformContext=OC,exports.Popover=Iq,exports.PopoverContent=Fq,exports.PopoverContext=Oq,exports.Portal=na,exports.PortalContext=qi,exports.ProgressBar=Zv,exports.ProgressBarItem=qv,exports.ProgressCircle=Bq,exports.QRCode=wY,exports.RICH_TEXT_EDITOR_NODES=FX,exports.Radio=Tx,exports.RadioCard=zY,exports.RadioCardContext=TY,exports.RadioCardDescription=OY,exports.RadioCardLabel=jY,exports.RadioCardLeadingVisual=PY,exports.RadioGroup=eX,exports.RadioGroupCaption=HY,exports.RadioGroupContext=Sx,exports.RadioGroupLabel=GY,exports.RadioGroupValidation=XY,exports.Rating=sX,exports.RelativeTime=MX,exports.RichTextEditor=XX,exports.RichTextEditorContent=UX,exports.RichTextEditorToolbar=YX,exports.SCREEN_READER_DELAY=500,exports.ScrollableRegion=hh,exports.SegmentedControl=CZ,exports.SegmentedControlButton=dZ,exports.SegmentedControlIconButton=pZ,exports.Select=wZ,exports.SelectContext=Ex,exports.SelectOptGroup=Ax,exports.SelectOptGroupContext=Dx,exports.SelectOption=Px,exports.SelectPanel=tQ,exports.SelectPanelButton=EZ,exports.SelectPanelContext=DZ,exports.SelectPanelFooter=AZ,exports.SelectPanelHeader=LZ,exports.SelectPanelLoading=JZ,exports.SelectPanelMessage=ZZ,exports.SelectPanelSearchInput=NZ,exports.SelectPanelSecondaryAction=eQ,exports.Separator=iQ,exports.SkeletonAvatar=oQ,exports.SkeletonBox=$g,exports.SkeletonText=n_,exports.Slider=uQ,exports.Spinner=ei,exports.Splitter=EQ,exports.SplitterPanel=gQ,exports.SplitterResizeTrigger=yQ,exports.SplitterResizeTriggerIndicator=SQ,exports.SplitterResizeTriggerSeparator=TQ,exports.Stack=Ry,exports.StackItem=Ly,exports.StateLabel=NQ,exports.StatisticCard=r$,exports.StatisticCardContext=PQ,exports.StatisticCardDescription=LQ,exports.StatisticCardLabel=BQ,exports.StatisticCardTrailingVisual=UQ,exports.StatisticCardTrend=XQ,exports.StatisticCardValue=$Q,exports.Status=f$,exports.StatusIndicator=d$,exports.Steps=I$,exports.StepsBody=x$,exports.StepsDescription=w$,exports.StepsIndicator=O$,exports.StepsItem=M$,exports.StepsItemContext=p$,exports.StepsTitle=F$,exports.Swap=W$,exports.SwapContext=L$,exports.SwapIndicator=U$,exports.Tab=h1,exports.TabList=b1,exports.TabPanel=C1,exports.Table=A_,exports.TableActions=fg,exports.TableBody=_g,exports.TableCell=bg,exports.TableCellPlaceholder=Cg,exports.TableContainer=Eg,exports.TableDivider=kg,exports.TableErrorDialog=jg,exports.TableHead=Ng,exports.TableHeader=Ig,exports.TableOfContents=s1,exports.TableOfContentsGroup=$$,exports.TableOfContentsItem=n1,exports.TableOfContentsList=X$,exports.TableOfContentsTitle=a1,exports.TablePagination=Jg,exports.TableRow=Xg,exports.TableSkeleton=a_,exports.TableSortHeader=c_,exports.TableSubtitle=d_,exports.TableTitle=m_,exports.Tabs=w1,exports.TabsContext=c1,exports.Text=Ro,exports.TextInput=Yo,exports.TextInputAction=Jo,exports.Textarea=Qx,exports.ThemeContext=C3,exports.ThemeProvider=N3,exports.Timeline=J1,exports.TimelineActions=j1,exports.TimelineAvatar=P1,exports.TimelineBadge=R1,exports.TimelineBody=V1,exports.TimelineBreak=W1,exports.TimelineItem=q1,exports.Toaster=w0,exports.ToggleSwitch=B0,exports.Token=n2,exports.TokenBase=G0,exports.TokenRemoveButton=q0,exports.TokenText=X0,exports.Tooltip=oZ,exports.TooltipContext=ZX,exports.TopicTag=b2,exports.TopicTagGroup=y2,exports.Tour=h4,exports.TourActionTrigger=j2,exports.TourActions=O2,exports.TourArrow=F2,exports.TourBackdrop=R2,exports.TourCloseTrigger=V2,exports.TourContent=W2,exports.TourContext=x2,exports.TourControl=q2,exports.TourDescription=X2,exports.TourPositioner=e4,exports.TourPositionerContext=S2,exports.TourProgressText=r4,exports.TourSpotlight=o4,exports.TourTitle=l4,exports.TreeView=v3,exports.TreeViewDirectoryIcon=W4,exports.TreeViewErrorDialog=K4,exports.TreeViewItem=_3,exports.TreeViewItemContext=_4,exports.TreeViewLeadingAction=t3,exports.TreeViewLeadingVisual=n3,exports.TreeViewRootContext=g4,exports.TreeViewSubTree=l3,exports.TreeViewTrailingVisual=f3,exports.Truncate=x3,exports.buildPaginationModel=Lg,exports.buildPaginationPageData=Rg,exports.clampToRange=mW,exports.commandScore=jm,exports.computeEdges=dx,exports.computeFlowRect=fx,exports.computePositions=ox,exports.connectorPath=Wb,exports.copyText=jf,exports.createColumnHelper=k_,exports.defaultPaneWidth=OK,exports.entryIds=sx,exports.exitIds=cx,exports.extendRange=gu,exports.formatFileSize=Cv,exports.formatMeterValue=jW,exports.formatRelativeTime=kX,exports.formatTitle=OX,exports.getAccessibleKeybindingHintString=DC,exports.getAddress=rR,exports.getAnchoredPosition=sa,exports.getCharacterCount=zo,exports.getFirstDayOfWeek=cu,exports.getIssueLabelColors=u2,exports.getLonLat=iR,exports.getMonthWeeks=du,exports.getPlatform=jC,exports.getProp=Pd,exports.getRangePosition=hu,exports.getSeriesColor=Md,exports.getWeekdays=lu,exports.isDateSelectable=fu,exports.isDateWithinRange=mu,exports.isFileAccepted=wv,exports.isTokenInteractive=U0,exports.markdownTheme=LU,exports.nodeIds=lx,exports.parseDate=_u,exports.registerPortalRoot=Qi,exports.richTextEditorTheme=IX,exports.sortStrategies=b_,exports.splitHighlightChunks=qS,exports.startOfWeek=uu,exports.stepValue=hW,exports.toDayKey=au,exports.toast=d0,exports.transitionSortDirection=h_,exports.triageFiles=Tv,exports.updateAriaValues=PK,exports.useAnnouncements=Hy,exports.useChart=Ld,exports.useChartContext=wd,exports.useClippedChildren=YC,exports.useCollator=Gs,exports.useColorSchemeVar=T3,exports.useConfirm=Zh,exports.useDateFormatter=Ks,exports.useDirection=WC,exports.useFilter=qs,exports.useFloatingPanelContext=ab,exports.useFormControlForwardedProps=zf,exports.useIsRtl=GC,exports.useLocaleContext=Bs,exports.useMap=QL,exports.useMarquee=HU,exports.useNumberFormatter=Js,exports.useOverflowObserver=ya,exports.usePaneWidth=GK,exports.usePlatform=NC,exports.useStepsItem=T$,exports.useTab=f1,exports.useTabList=_1,exports.useTabPanel=x1,exports.useTableOfContentsActiveId=o1,exports.useTabs=d1,exports.useTheme=w3,exports.useTour=u4,exports.valueToPercent=AW,exports.waitForElement=p4,exports.waitForElementValue=m4,exports.waitForEvent=f4;
|