@gamecrafters/base-ui 0.0.31 → 0.0.32

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.esm.js CHANGED
@@ -799,4 +799,4 @@ ${this.fragmentDiscardExpression_?` if (${this.fragmentDiscardExpression_}) { d
799
799
  gl_FragColor = color;
800
800
  gl_FragColor.rgb *= gl_FragColor.a;
801
801
  gl_FragColor *= ${EH.TRANSITION_ALPHA};
802
- }`,uniforms:o,paletteTextures:i.paletteTextures}}var mW=class extends OB{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(AR.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&&!BA(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,pW(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 kH(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()}};mW.prototype.dispose;function hW({name:e,...t}){return EV(()=>new mW(t),e),null}hW.displayName=`MapWebGLTileLayer`;const gW=t=>{let n=oV(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addControl(i),()=>{n.removeControl(i)}},[n,i]),i},_W=(t,n,r)=>{let i=e.useRef(null);if(!i.current){let e=document.createElement(`div`);e.setAttribute(`data-component`,t),i.current=e}let a=i.current;return gW(()=>new ZR({element:a,target:r})),e.useEffect(()=>{a.className=G(`ol-unselectable ol-control`,n)},[a,n]),a};function vW(e){return gW(()=>new QR(e)),null}vW.displayName=`MapAttributionControl`;const yW=[`fullscreenchange`,`webkitfullscreenchange`],bW={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var xW=class extends ZR{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(FD.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(SW(t)){if(CW(t))EW(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?TW(n):wW(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=CW(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(GM(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(bW.ENTERFULLSCREEN)):(GM(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(bW.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(qR.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(qR.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)PD(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();SW(n)?this.element.classList.remove(UN):this.element.classList.add(UN);for(let t=0,r=yW.length;t<r;++t)e.push(MD(n,yW[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function SW(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function CW(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function wW(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function TW(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():wW(e)}function EW(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function DW(e){return gW(()=>new xW(e)),null}DW.displayName=`MapFullScreenControl`;const OW=`units`,kW=[1,2,5],AW=25.4/.28;var jW=class extends ZR{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(OW,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(OW)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(OW,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=NA(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||AW)/AW,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||AW)/AW,c=o*a,l=``;if(r==`degrees`){let e=Pk.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=kW[(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=NA(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||AW;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function MW(e){return gW(()=>new jW(e)),null}MW.displayName=`MapScaleLineControl`;const NW=`projection`,PW=`coordinateFormat`;var FW=class extends ZR{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(NW,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:`&#160;`,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(PW)}getProjection(){return this.get(NW)}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(MD(t,WR.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(MD(t,WR.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(PW,e)}setProjection(e){this.set(NW,MA(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?VA(this.mapProjection_,e):kA}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=GA();e&&(this.transform_=VA(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&jk(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 IW(e){return gW(()=>new FW(e)),null}IW.displayName=`MapMousePositionControl`;const LW=.75,RW=.1;var zW=class extends ZR{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(FD.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new qz({view:e.view,controls:new oO,interactions:new oO});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 Xz({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(MD(e,kD.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===qR.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===qR.TARGET||e.key===qR.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new CR({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(dR.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(dR.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_&&TO(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(HO(r)),s=t.getPixelFromCoordinateInternal(PO(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*RW||l<d*RW||c>u*LW||l>d*LW?this.resetExtent_():_O(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();JO(r,1/(2**(Math.log(LW/RW)/Math.LN2/2)*RW)),i.fitInternal(yM(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_||=ND(this.ovmap_,KR.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(WN),this.collapsed_?GM(this.collapseLabel_,this.label_):GM(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 BW(e){return gW(()=>new zW(e)),null}BW.displayName=`MapOverviewMapControl`;var VW=class e extends Cj{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 xO(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(GO(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||jO(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=Lj(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(_j(n,0,n.length,r,e,t,n)),this.changed()}};VW.prototype.transform;var HW=class e extends Sj{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(PD),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(MD(e[t],FD.CHANGE,this.changed,this))}clone(){let t=new e(UW(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<hO(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){SO(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)DO(e,t[n].getExtent());return e}getGeometries(){return UW(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||=FO(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(UW(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 UW(e){return e.map(e=>e.clone())}function WW(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function GW(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 KW={index:-1,endIndex:NaN,closestTargetDistance:1/0};function qW(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=eG(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=GW(l.coordinates,c);kk(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=QW(e,n,r);QW(e,n,r-t)<i&&(c-=t)}else{let i=QW(e,n,r);QW(e,n,r+t)<i&&(c+=t)}}return KW.index=s,KW.endIndex=c,KW.closestTargetDistance=o,KW}function JW(e,t){let n=[];for(let r=0;r<t.length;++r)YW(e,t[r].getGeometry(),n);return n}function YW(e,t,n){if(t instanceof rN){XW(e,t.getCoordinates(),!1,n);return}if(t instanceof LP){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)XW(e,r[t],!1,n);return}if(t instanceof vM){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)XW(e,r[t],!0,n);return}if(t instanceof BP){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)XW(e,i[t],!0,n)}return}if(t instanceof HW){let r=t.getGeometries();for(let t=0;t<r.length;++t)YW(e,r[t],n);return}}function XW(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=eG(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 ZW(e,t){return nk(e[0],e[1],t[0],t[1])}function QW(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 ZW(GW(e,r),GW(e,i));let s=0;if(r<a){let t=GW(e,r),n=WW(e,a);s+=ZW(t,n)}if(o<i){let t=WW(e,o),n=GW(e,i);s+=ZW(t,n)}for(let t=a;t<o-1;++t){let n=WW(e,t),r=WW(e,t+1);s+=ZW(n,r)}return s}const $W={along:0,squaredDistance:0};function eG(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=ek(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),$W.along=u,$W.squaredDistance=ck(nk(e,t,d,f),10),$W}const tG={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var nG=class extends XD{constructor(e,t){super(e),this.feature=t}},rG=class extends Sz{constructor(e){let t=e;t.stopDown||=KD,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_=aG(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:GD,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 VW([NaN,NaN]),i=qA(e[0],n),a=Ok(i,qA(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=GA();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=cM:e===`LineString`?t=rN:e===`Polygon`&&(t=vM),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 LR({source:new fF({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:iG(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:gz,this.freehandCondition_,this.freehandCondition_=e.freehand?fz:e.freehandCondition?e.freehandCondition:vz,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(nz.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?fz:e:mz,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?fz:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:vz}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===FD.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===UR.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===UR.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===UR.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===UR.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===UR.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===UR.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===UR.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 HR(UR.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=dO([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=JW(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(WW(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(WW(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&kk(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=qW(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=GW(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 cO(new cM(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new cO;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new rN(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=Tj(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 cO(new rN(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new cO,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new nG(tG.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=Tj(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 RP([t])):this.type_===`MultiLineString`?e.setGeometry(new LP([t])):this.type_===`MultiPolygon`&&e.setGeometry(new BP([t])),this.dispatchEvent(new nG(tG.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 nG(tG.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 cO(new cM(n)),this.updateSketchFeatures_(),this.dispatchEvent(new nG(tG.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 iG(){let e=TF();return function(t,n){return e[t.getGeometry().getType()]}}function aG(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 oG=[0,0,0,0],sG=[],cG={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function lG(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 uG=class extends XD{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},dG=class extends Sz{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:xz,this.defaultDeleteCondition_=function(e){return cz(e)&&hz(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:fz,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new sF,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new LR({source:new fF({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:hG(),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:Tk,!(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(OD.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(OD.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(uF.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(uF.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(kD.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?fz:e:mz,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 oO;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 uG(cG.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(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(kD.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(kD.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(dO(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(dO(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(dO(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(dO(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(CO(n),r);let o=t,s=GA();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=bM(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 cO(new cM(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==UR.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=UR.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==UR.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=dO([r]),a=this.rBush_.getInExtent(i),o={};a.sort(fG);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=mG(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&&kk(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=qW(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=GW(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=dO([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=JW(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||UD(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();lG(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(WW(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(WW(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();lG(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=kk(qA(t.getCenter(),n),qA(e,n)),i=GA();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];kk(Ck(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(CO(n),a);let s=t,c=GA();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=bM(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(dO(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 uG(cG.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 pG(e,t,r)-pG(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 cM(KA(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof cO&&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=JA(pO(YA(CO(e,oG),r),t.getView().getResolution()*this.pixelTolerance_,oG),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=mG(e,s,r),u=t.getPixelFromCoordinate(l),d=kk(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=Ok(u,e),o=Ok(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(dO(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(dO(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?KA(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(dO([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=qA(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=UR.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new uG(cG.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(dO(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(dO([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?qA(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||UD(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(OD.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(OD.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(kD.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(uF.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(uF.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(kD.PROPERTYCHANGE,this.handleFeatureChange_)}}};function fG(e,t){return e.index-t.index}function pG(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=GA();t&&(i=i.clone().transform(t,n));let r=Ok(i.getCenter(),qA(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=qA(e,n);return sG[0]=qA(t.segment[0],n),sG[1]=qA(t.segment[1],n),Ak(i,sG)}function mG(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=GA();return i&&(t=t.clone().transform(i,n)),KA(t.getClosestPoint(qA(e,n)),n)}let i=qA(e,n);return sG[0]=qA(t.segment[0],n),sG[1]=qA(t.segment[1],n),KA(Ck(i,sG),n)}function hG(){let e=TF();return function(t,n){return e.Point}}const gG={SNAP:`snap`,UNSNAP:`unsnap`};var _G=class extends XD{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const vG={Circle(e,t){let n=e,r=GA();r&&(n=n.clone().transform(r,t));let i=bM(n);return r&&i.transform(t,r),vG.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 yG(e){return e.feature?e.feature:e.element?e.element:null}const bG=[],xG=[],SG=[];var CG=class extends Sz{constructor(e){e||={},super({handleDownEvent:GD,stopDown:KD}),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 sF,this.snapped_=null,this.segmenters_=Object.assign({},vG,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(bO());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];xG[t]=dO(n),SG[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=xG[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!GO(r,xG[o]))continue;let s=Yj(n,t);if(!s)continue;let c=[s];xG[a]=dO(c),SG[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(xG[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=Yj(n,r);if(!i)continue;let s=[i];xG[a]=dO(s),SG[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(xG[0],SG[0]):(xG.length=a,SG.length=a,this.rBush_.load(xG,SG))}}t&&(this.featureChangeListenerKeys_[n]&&PD(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=MD(e,FD.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 _G(gG.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new _G(gG.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new _G(gG.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=yG(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=yG(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);AD(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&&(PD(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(PD),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(PD),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(MD(this.features_,OD.ADD,this.handleFeatureAdd_,this),MD(this.features_,OD.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(MD(this.source_,uF.ADDFEATURE,this.handleFeatureAdd_,this),MD(this.source_,uF.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=qA(t,r),a=JA(pO(dO([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 Ok(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=Ok(i,qA(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=GA();a&&(e=e.clone().transform(a,r)),t=Sk(i,e)}else{let[e,a]=n.segment;a&&(bG[0]=qA(e,r),bG[1]=qA(a,r),t=Ck(i,bG))}if(t){let e=Ok(i,t);e<l&&(c=KA(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)}},wG=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=cO,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?MA(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=MA(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 eO()}readFeature(e,t){return eO()}readFeatures(e,t){return eO()}readGeometry(e,t){return eO()}readProjection(e){return eO()}writeFeature(e,t){return eO()}writeFeatures(e,t){return eO()}writeGeometry(e,t){return eO()}};function TG(e,t,n){let r=n?MA(n.featureProjection):null,i=n?MA(n.dataProjection):null,a=e;if(r&&i&&!BA(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(UA(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 EG={Point:cM,LineString:rN,Polygon:vM,MultiPoint:RP,MultiLineString:LP,MultiPolygon:BP};function DG(e,t,n){return Array.isArray(t[0])?(mM(e,0,t,n)||(e=e.slice(),gM(e,0,t,n)),e):(pM(e,0,t,n)||(e=e.slice(),hM(e,0,t,n)),e)}function OG(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>OG({...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 TG(new HP(r,r===`Polygon`?DG(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function kG(e,t){if(!e)return null;if(Array.isArray(e))return new HW(e.map(e=>kG(e,t)));let n=EG[e.type];return TG(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var AG=class extends wG{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(jG(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(jG(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return eO()}readFeaturesFromObject(e,t){return eO()}readGeometry(e,t){return this.readGeometryFromObject(jG(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return eO()}readProjection(e){return this.readProjectionFromObject(jG(e))}readProjectionFromObject(e){return eO()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return eO()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return eO()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return eO()}};function jG(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var MG=class extends AG{constructor(e){e||={},super(),this.dataProjection=MA(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=MA(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=NG(n.geometry,t);if(this.featureClass===HP)return OG({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(kG(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 PG(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=MA(t.properties.name);else if(t.type===`EPSG`)n=MA(`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=HG(a,t),delete i[e.getGeometryName()]),jD(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 HG(e,this.adaptOptions(t))}};function NG(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=IG(e);break;case`LineString`:n=LG(e);break;case`Polygon`:n=VG(e);break;case`MultiPoint`:n=zG(e);break;case`MultiLineString`:n=RG(e);break;case`MultiPolygon`:n=BG(e);break;case`GeometryCollection`:n=FG(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function PG(e,t){return kG(NG(e,t),t)}function FG(e,t){return e.geometries.map(function(e){return NG(e,t)})}function IG(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:wj(t.length)}}function LG(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:wj(t[0]?.length||2)}}function RG(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:zj(r,0,t,n),layout:wj(n)}}function zG(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:wj(t[0]?.length||2)}}function BG(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:Bj(n,0,t,r),layout:wj(r)}}function VG(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:zj(n,0,t,r),layout:wj(r)}}function HG(e,t){e=TG(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=JG(e,t);break;case`LineString`:r=WG(e,t);break;case`Polygon`:r=YG(e,t);break;case`MultiPoint`:r=KG(e,t);break;case`MultiLineString`:r=GG(e,t);break;case`MultiPolygon`:r=qG(e,t);break;case`GeometryCollection`:r=UG(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function UG(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return HG(e,t)})}}function WG(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function GG(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function KG(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function qG(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function JG(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function YG(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const XG={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},ZG={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},QG={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},$G=[{shape:`Point`,label:`Draw a point`,Icon:Gn},{shape:`LineString`,label:`Draw a line`,Icon:or},{shape:`Circle`,label:`Draw a circle`,Icon:Wn}];function eK({target:t,className:n,fileName:r=`react-openlayers-geojson.json`}){let i=oV(),a=_W(`MapDrawControl`,G(XG.root,n),t),[o,s]=e.useState(!1),[c,l]=e.useState(null),u=e.useRef(null),d=e.useRef(null);if(!u.current){let e=new fF;u.current={source:e,layer:new LR({source:e,style:ZG,properties:{key:`drawLayer`}}),modify:new dG({source:e})}}let f=u.current,p=e.useCallback(()=>{let e=f.source.getFeatures(),t=new MG().writeFeaturesObject(e,QG),n=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,a.click(),URL.revokeObjectURL(i)},[f,r]);e.useEffect(()=>{if(!(!i||!o))return i.addLayer(f.layer),i.addInteraction(f.modify),()=>{i.removeInteraction(f.modify),i.removeLayer(f.layer)}},[i,o,f]),e.useEffect(()=>{if(!i||!o||!c)return;let e=c===`LineString`?new rG({source:f.source,type:c,maxPoints:2}):new rG({source:f.source,type:c}),t=new CG({source:f.source});return d.current=e,i.addInteraction(e),i.addInteraction(t),()=>{i.removeInteraction(t),i.removeInteraction(e),d.current=null}},[i,o,c,f]),e.useEffect(()=>{if(!i||!o)return;let e=i.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?d.current?.abortDrawing():e.shiftKey&&e.key===`S`&&p()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,o,p]);let h=()=>{s(e=>!e),l(null)},g=e=>{l(t=>t===e?null:e)};return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:XG.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":o,onClick:h,children:(0,q.jsx)(hr,{size:12})}),o?(0,q.jsxs)(`div`,{className:XG.shapes,children:[$G.map(({shape:e,label:t,Icon:n})=>(0,q.jsx)(`button`,{type:`button`,className:XG.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":c===e,onClick:()=>g(e),children:(0,q.jsx)(n,{size:12})},e)),(0,q.jsx)(`button`,{type:`button`,className:XG.shape,title:`Move and reshape what has been drawn`,"aria-pressed":c===null,onClick:()=>g(null),children:(0,q.jsx)(On,{size:12})})]}):null]}),a)}eK.displayName=`MapDrawControl`;const tK={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},nK=(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 Vz?nK(e.getLayers().getArray(),`${r}.`):[]}});function rK({target:t,className:n}){let r=oV(),i=_W(`MapLayersControl`,G(tK.root,n),t),[a,o]=e.useState(!1),[s,c]=e.useState(0),l=e.useMemo(()=>r&&a?nK(r.getLayers().getArray(),``):[],[r,a,s]),u=(e,t)=>{e.setVisible(t),c(e=>e+1)},d=e=>(0,q.jsx)(`ul`,{className:tK.list,children:e.map(e=>(0,q.jsxs)(`li`,{className:tK.item,children:[(0,q.jsxs)(`label`,{className:tK.label,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.layer.getVisible(),onChange:t=>u(e.layer,t.target.checked)}),e.name]}),e.children.length>0?d(e.children):null]},e.key))});return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:tK.toggle,title:`Click here to switch layers`,"aria-expanded":a,onClick:()=>o(e=>!e),children:(0,q.jsx)(ar,{size:24})}),a?(0,q.jsx)(`div`,{className:tK.layers,children:d(l)}):null]}),i)}rK.displayName=`MapLayersControl`;const iK={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function aK({target:t,className:n,zoom:r=18,color:i=mV,placeholder:a=`Search for a place`}){let o=oV(),s=_W(`MapSearchControl`,G(iK.root,n),t),[c,l]=e.useState(!1),[u,d]=e.useState(``);return m((0,q.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!o||!u)return;let[t]=await fV(u,1);if(!t)return;let n=[Number(t.lon),Number(t.lat)];_V(o,n,i).set(`address`,t.display_name),o.getView().setCenter(RA(n)),o.getView().setZoom(r)},children:[(0,q.jsx)(`button`,{type:`button`,className:iK.toggle,title:a,"aria-expanded":c,onClick:()=>l(e=>!e),children:(0,q.jsx)(mr,{size:24})}),c?(0,q.jsx)(`input`,{type:`search`,className:iK.input,value:u,placeholder:a,"aria-label":a,autoComplete:`off`,onChange:e=>d(e.target.value)}):null]}),s)}aK.displayName=`MapSearchControl`;const oK=t=>{let n=oV(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addInteraction(i),()=>{n.removeInteraction(i)}},[n,i]),i};var sK=class extends Sz{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:vz,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!bz(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(!bz(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 bz(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function cK(e){return oK(()=>new sK(e)),null}cK.displayName=`MapDragRotateAndZoomInteraction`;const lK={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var uK=class extends XD{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},dK=class extends Sz{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=GD;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:GD,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:fz,this.lastFeature_=null,this.addChangeListener(nz.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 oO([this.lastFeature_]);return this.dispatchEvent(new uK(lK.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 oO([this.lastFeature_]);return this.dispatchEvent(new uK(lK.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=qA(t,n),i=qA(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new oO([this.lastFeature_]),c=GA();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 uK(lK.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 cO)||!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 fK(e){return oK(()=>new dK(e)),null}fK.displayName=`MapTranslateInteraction`;function pK(t){let n=e.useRef(null),r=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return t instanceof cO&&(n.current={feature:t,coordinate:e.coordinate},!0)},i=e=>{let t=n.current;if(!t)return;let r=t.feature.getGeometry();r&&(r.translate(e.coordinate[0]-t.coordinate[0],e.coordinate[1]-t.coordinate[1]),t.coordinate=e.coordinate)},a=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},o=()=>(n.current=null,!1);return oK(()=>new Sz({handleDownEvent:r,handleDragEvent:i,handleMoveEvent:a,handleUpEvent:o,...t})),null}pK.displayName=`MapPointerInteraction`;const mK={SELECT:`select`};var hK=class extends XD{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const gK={};var _K=class e extends rz{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:hz,this.addCondition_=e.addCondition?e.addCondition:mz,this.removeCondition_=e.removeCondition?e.removeCondition:mz,this.toggleCondition_=e.toggleCondition?e.toggleCondition:vz,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:GD,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?vK():e.style,this.features_=e.features||new oO;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=GD;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(OD.ADD,this.boundAddFeature_),this.features_.addEventListener(OD.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(OD.ADD,this.boundAddFeature_),this.features_.removeEventListener(OD.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 LR&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in gK||(gK[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(gK[r]),delete gK[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 hK(mK.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 hK(mK.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 hK(mK.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 cO)||!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 cO)||!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 hK(mK.SELECT,c,s,e)),!0}};function vK(){let e=TF();return HD(e.Polygon,e.LineString),HD(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const yK=`#ff0000`,bK=`rgba(255, 0, 0, 0.4)`,xK=e=>new DF({text:e,font:`12px Calibri,sans-serif`,fill:new pF({color:`#000`}),stroke:new mF({color:`#fff`,width:3}),offsetY:-10}),SK=e=>{let t=e.getGeometry();if(!(t instanceof Sj))return;let n=t.getType();if(n===`Point`)return new xF({image:new bF({radius:6,fill:new pF({color:bK}),stroke:new mF({color:yK,width:2})})});if(n===`LineString`){let e=new xF({stroke:new mF({color:yK,width:3})}),n=mk(t)/1e3;return n>0&&e.setText(xK(`Length: ${n.toFixed(2)} km`)),e}let r=new xF({fill:new pF({color:bK}),stroke:new mF({color:yK,width:2})});try{let e=gk(t)/1e6;e>0&&r.setText(xK(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function CK({onSelect:t,style:n=SK,...r}){let i=oV(),a=oK(()=>new _K({...r,style:n})),o=e.useRef(t);return e.useEffect(()=>{o.current=t},[t]),e.useEffect(()=>{let e=a.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&o.current?.(e)});return()=>$D(e)},[a]),e.useEffect(()=>{if(!i)return;let e=i.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=a.getFeatures();t.forEach(e=>{a.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,a]),null}CK.displayName=`MapSelectInteraction`;function wK(e){return ck(e,5)}function TK(e){return parseFloat(e)}function EK(e){return wK(e).toString()}function DK(e,t){return!isNaN(e)&&e!==TK(EK(t))}function OK(e,t){return DK(e[0],t[0])||DK(e[1],t[1])}var kK=class extends rz{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(MD(e,KR.MOVEEND,this.updateUrl_,this),MD(e.getLayerGroup(),FD.CHANGE,this.updateUrl_,this),MD(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)PD(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=TK(this.get_(e,`z`));`z`in this.params_&&DK(a,n.getZoom())&&(r=!0,i.zoom=a);let o=TK(this.get_(e,`r`));`r`in this.params_&&DK(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[TK(this.get_(e,`x`)),TK(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&OK(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`,EK(n[0])),this.set_(c,`y`,EK(n[1])),this.set_(c,`z`,EK(r)),this.set_(c,`r`,EK(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 AK(e){return oK(()=>new kK(e)),null}AK.displayName=`MapLinkInteraction`;const jK={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},MK=37.7649804,NK=-122.4323829,PK=16,FK=[];function IK({latitude:t,longitude:n,zoom:r,marker:i,markerColor:a,markerLabel:o}){let s=oV(),c=e.useRef(!1);return e.useEffect(()=>{if(!s)return;let e=s.getView(),i=RA([n,t]);if(c.current){e.animate({center:i,zoom:r,duration:500});return}c.current=!0,e.setCenter(i),e.setZoom(r)},[s,t,n,r]),e.useEffect(()=>{if(!s||!i)return;let e=_V(s,[n,t],a,o);return()=>vV(s,e)},[s,t,n,i,a,o]),null}IK.displayName=`MapLocation`;function LK(t,n){let{latitude:r=MK,longitude:i=NK,zoom:a=16,width:o,height:s,controls:c=FK,marker:l=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=t,y=Y(f),b=e.useRef(null),x=Gr(n,b),S=e.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=jK.toolbar,S.current=e}let C=S.current;e.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,q.jsx)(MW,{},e);case`fullScreen`:return(0,q.jsx)(DW,{target:C,source:y},e);case`search`:return(0,q.jsx)(aK,{target:C},e);case`layers`:return(0,q.jsx)(rK,{target:C},e);case`draw`:return(0,q.jsx)(eK,{target:C},e)}};return(0,q.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:G(jK.root,p),style:{...m,"--map-width":typeof o==`number`?`${o}px`:o,"--map-height":typeof s==`number`?`${s}px`:s},"data-component":`Map`,...v,children:(0,q.jsxs)(aV,{className:jK.surface,keyboardEventTarget:y,children:[(0,q.jsx)(IK,{latitude:r,longitude:i,zoom:a,marker:l,markerColor:u,markerLabel:d}),c.map(T),h]})})}LK.displayName=`Map`;var RK=K(LK);const zK=Object.assign(RK,{View:sV,Marker:xV,Overlay:CV,LayerGroup:DV,TileLayer:OV,ImageLayer:MV,VectorLayer:NV,GraticuleLayer:PV,HeatmapLayer:fW,WebGLTileLayer:hW,AttributionControl:vW,DrawControl:eK,FullScreenControl:DW,LayersControl:rK,MousePositionControl:IW,OverviewMapControl:BW,ScaleLineControl:MW,SearchControl:aK,DragRotateAndZoomInteraction:cK,LinkInteraction:AK,PointerInteraction:pK,SelectInteraction:CK,TranslateInteraction:fK}),BK={root:`markdown`};function VK(t,n){let{className:r,source:i,transformers:a,preserveNewLines:o=!1,...s}=t,[c]=E(),l=e.useCallback(e=>{c.setRootElement(e)},[c]),u=Gr(n,l);return Ur(()=>{c.update(()=>{C(i,a,void 0,o)},{discrete:!0})},[c,i,a,o]),(0,q.jsx)(`div`,{ref:u,className:G(BK.root,r),"data-component":`Markdown`,...s})}VK.displayName=`MarkdownProse`;var HK=K(VK);const UK=`Markdown`,WK=[B,re,L,I,j,O,D],GK=[w,...T],KK={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 qK(e,t){let{className:n,children:r=``,transformers:i=GK,preserveNewLines:a=!1,namespace:o=UK,onError:s,...c}=e;return(0,q.jsx)(S,{initialConfig:{namespace:o,theme:KK,nodes:WK,editable:!1,onError:s??(e=>{throw e})},children:(0,q.jsx)(HK,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}qK.displayName=`Markdown`;var JK=K(qK);const YK=n({}),XK=()=>o(YK),ZK=(t={})=>{let{paused:n,defaultPaused:r,onPauseChange:i}=t,a=n!==void 0,[o,s]=e.useState(r??!1),c=a?n:o,l=e=>{e!==c&&(a||s(e),i?.(e))};return{paused:c,pause:()=>l(!0),resume:()=>l(!1),toggle:()=>l(!c),setPaused:l}},QK={root:`marquee`},$K=50,eq=e=>e===`top`||e===`bottom`;function tq(t,n){let{as:r=`div`,className:i,side:a=`start`,speed:o=50,delay:s=0,loopCount:c=0,autoFill:l=!1,spacing:u,reverse:d=!1,paused:f,defaultPaused:p,pauseOnInteraction:m=!0,onPauseChange:h,onLoopComplete:g,onComplete:_,children:v,...y}=t,b=ZK({paused:f,defaultPaused:p,onPauseChange:h}),x=eq(a),S=e.useRef(null),C=e.useRef(null),[w,T]=e.useState(0),[E,D]=e.useState(0);Ur(()=>{let e=S.current,t=C.current;if(e===null||t===null)return;let n=()=>{let n=x?e.clientHeight:e.clientWidth,r=x?t.offsetHeight:t.offsetWidth;T(e=>e===n?e:n),D(e=>e===r?e:r)};n();let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[x]);let O=l&&E>0?Math.max(Math.ceil(w/E)+1,2):2,k=E>0&&o>0?E/o:0,{style:A,onMouseEnter:j,onMouseLeave:M,onFocus:N,onBlur:P,...F}=y,[I,L]=e.useState(!1),ee=e=>{j?.(e),m&&L(!0)},R=e=>{M?.(e),L(!1)},te=e=>{N?.(e),m&&L(!0)},z=e=>{P?.(e),e.currentTarget.contains(e.relatedTarget)||L(!1)},ne=b.paused||I,B={...b,side:a,orientation:x?`vertical`:`horizontal`,copyCount:O,viewportRef:S,copyRef:C,onLoopComplete:g,onComplete:_};return(0,q.jsx)(YK.Provider,{value:B,children:(0,q.jsx)(r,{ref:n,className:G(QK.root,i),style:{...A,"--marquee-duration":`${k}s`,"--marquee-delay":`${s}ms`,"--marquee-loop-count":c>0?`${c}`:`infinite`,...u===void 0?null:{"--marquee-spacing":u}},onMouseEnter:ee,onMouseLeave:R,onFocus:te,onBlur:z,"data-component":`Marquee`,"data-orientation":x?`vertical`:`horizontal`,"data-side":a,"data-reverse":d||void 0,"data-paused":ne||void 0,"data-running":E>0||void 0,...F,children:v})})}tq.displayName=`Marquee`;var nq=K(tq);const rq={root:`marquee-content`};function iq(t,n){let{as:r=`div`,className:i,children:a,...o}=t,{copyCount:s=1,copyRef:c,onLoopComplete:l,onComplete:u}=e.useContext(YK),d=Gr(n,c),f=e.useRef(0),p=e=>e.target===e.currentTarget,m=e=>{p(e)&&(f.current+=1,l?.(f.current))},h=e=>{p(e)&&(f.current+=1,l?.(f.current),u?.())};return(0,q.jsx)(q.Fragment,{children:Array.from({length:s},(e,t)=>{let n=t===0;return(0,q.jsx)(r,{ref:n?d:void 0,className:G(rq.root,i),"aria-hidden":!n||void 0,inert:!n,onAnimationIteration:n?m:void 0,onAnimationEnd:n?h:void 0,"data-component":`Marquee.Content`,...o,children:a},t)})})}iq.displayName=`Marquee.Content`;var aq=K(iq);const oq={root:`marquee-edge`};function sq(e,t){let{as:n=`div`,className:r,side:i,...a}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(oq.root,r),"data-component":`Marquee.Edge`,"data-side":i,...a})}sq.displayName=`Marquee.Edge`;var cq=K(sq);const lq={root:`marquee-item`};function uq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(lq.root,r),"data-component":`Marquee.Item`,...i})}uq.displayName=`Marquee.Item`;var dq=K(uq);const fq={root:`marquee-viewport`};function pq(t,n){let{as:r=`div`,className:i,...a}=t,{viewportRef:o}=e.useContext(YK),s=Gr(n,o);return(0,q.jsx)(r,{ref:s,className:G(fq.root,i),"data-component":`Marquee.Viewport`,...a})}pq.displayName=`Marquee.Viewport`;var mq=K(pq);const hq=Object.assign(nq,{Root:nq,Viewport:mq,Content:aq,Item:dq,Edge:cq}),gq=n({}),_q=W(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function vq(t,n){let{as:r=`div`,className:i,align:a,...o}=t,{align:s}=e.useContext(gq),c=a??s??`start`,l={align:c};return(0,q.jsx)(pu.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G(_q({align:c}),i),"data-component":`Message`,"data-align":c,...o})})}vq.displayName=`Message`;var yq=K(vq);const bq={root:`message-avatar`};function xq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(bq.root,r),"data-component":`Message.Avatar`,...i})}xq.displayName=`Message.Avatar`;var Sq=K(xq);const Cq={root:`message-content`};function wq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Cq.root,r),"data-component":`Message.Content`,...i})}wq.displayName=`Message.Content`;var Tq=K(wq);const Eq={root:`message-footer`};function Dq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Eq.root,r),"data-component":`Message.Footer`,...i})}Dq.displayName=`Message.Footer`;var Oq=K(Dq);const kq={root:`message-group`};function Aq(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,q.jsx)(gq.Provider,{value:{align:i},children:(0,q.jsx)(n,{ref:t,className:G(kq.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}Aq.displayName=`Message.Group`;var jq=K(Aq);const Mq={root:`message-header`};function Nq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Mq.root,r),"data-component":`Message.Header`,...i})}Nq.displayName=`Message.Header`;var Pq=K(Nq);const Fq=Object.assign(yq,{Group:jq,Avatar:Sq,Content:Tq,Header:Pq,Footer:Oq}),Iq=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},Lq=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,Rq=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return Lq(r??0,r,i);let a=e+t*n,o=Math.max(Iq(n),Iq(e)),s=o===0?a:Number(a.toFixed(o));return Lq(s,r,i)},zq=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},Bq=n({}),Vq={root:`meter-indicator`};function Hq(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Vq.root,r),"data-component":`Meter.Indicator`,...i})}Hq.displayName=`Meter.Indicator`;var Uq=K(Hq);const Wq={root:`meter-label`};function Gq(t,n){let{as:r=`span`,className:i,id:a,...o}=t,{labelId:s}=e.useContext(Bq);return(0,q.jsx)(r,{ref:n,id:a??s,className:G(Wq.root,i),"data-component":`Meter.Label`,...o})}Gq.displayName=`Meter.Label`;var Kq=K(Gq);const qq={root:`meter-track`};function Jq(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(qq.root,r),"data-component":`Meter.Track`,...i})}Jq.displayName=`Meter.Track`;var Yq=K(Jq);const Xq={root:`meter-value`};function Zq(t,n){let{className:r,children:i,...a}=t,{formattedValue:o=``,value:s=0}=e.useContext(Bq);return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(Xq.root,r),"data-component":`Meter.Value`,...a,children:typeof i==`function`?i({formattedValue:o,value:s}):i??o})}Zq.displayName=`Meter.Value`;var Qq=K(Zq);const $q=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,eJ=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),tJ={header:`meter-header`,hidden:`sr-only`},nJ=W(`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 rJ(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,_=`${Y(p)}-label`,[v,y]=si(f,{label:Kq,value:Qq,track:Yq}),b=Lq(Number.isNaN(a)?o:a,o,s),x=Lq($q(b,o,s),0,100),S=eJ(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,q.jsx)(Bq.Provider,{value:T,children:(0,q.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:G(nJ({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,q.jsxs)(`span`,{className:tJ.header,children:[v.label,v.value]}):null,v.track??(0,q.jsx)(Yq,{children:(0,q.jsx)(Uq,{})}),y,(0,q.jsx)(`span`,{role:`presentation`,className:tJ.hidden,children:`x`})]})})}rJ.displayName=`Meter`;var iJ=K(rJ);const aJ=Object.assign(iJ,{Label:Kq,Value:Qq,Track:Yq,Indicator:Uq});function oJ(e,t){return(0,q.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}oJ.displayName=`NativeSelect.OptGroup`;var sJ=K(oJ);function cJ(e,t){return(0,q.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}cJ.displayName=`NativeSelect.Option`;var lJ=K(cJ);const uJ=Object.assign(PS,{Option:lJ,OptGroup:sJ}),dJ={root:`navigation-list-heading`,hidden:`sr-only`};function fJ(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?dJ.hidden:dJ.root,r),"data-component":`NavigationList.Heading`,...i})}fJ.displayName=`NavigationList.Heading`;const pJ=e.createContext(null),mJ=e.createContext({depth:0}),hJ=e.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),gJ=e=>Number.parseInt(e.slice(1),10),_J=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},vJ={heading:fJ},yJ={container:`NavigationList`};function bJ(t,n){let{children:r,className:i,"aria-label":a,"aria-labelledby":o,...s}=t,[c,l]=si(r,vJ),u=Y(),d=c.heading,f=d?d.props.id??u:void 0,p=d?gJ(d.props.as??`h2`):null;return(0,q.jsx)(`nav`,{ref:n,"aria-label":a,"aria-labelledby":o??(a?void 0:f),className:G(i),"data-component":`NavigationList`,...s,children:(0,q.jsxs)(pJ.Provider,{value:p,children:[d?e.cloneElement(d,{id:f}):null,(0,q.jsx)(gi.Provider,{value:yJ,children:(0,q.jsx)(_a,{children:l})})]})})}bJ.displayName=`NavigationList`;var xJ=e.forwardRef(bJ);function SJ(t){let{title:n,children:r,hideDivider:i=!1,...a}=t,o=e.useContext(pJ);return(0,q.jsxs)(q.Fragment,{children:[i?null:(0,q.jsx)(_a.Divider,{}),(0,q.jsxs)(_a.Group,{"data-component":`NavigationList.Group`,...a,children:[n?(0,q.jsx)(_a.GroupHeading,{as:_J(o),children:n}):null,r]})]})}SJ.displayName=`NavigationList.Group`;const CJ={chevron:`navigation-list-chevron`},wJ={trailingVisual:_a.TrailingVisual},TJ=t=>{if(!e.isValidElement(t))return!1;let n=t.props[`aria-current`];return n&&n!==`false`?!0:e.Children.toArray(t.props.children).some(TJ)};function EJ(t){let{children:n,subNavigation:r,defaultOpen:i,className:a}=t,o=Y(),s=Y(),c=e.useRef(null),l=e.useMemo(()=>TJ(r),[r]),[u,d]=e.useState(i??l),[f,p]=e.useState(l);Ur(()=>{let e=l||!!c.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[l,r]);let m=e.useMemo(()=>({buttonId:o,subNavigationId:s,isOpen:u}),[o,s,u]),[h,g]=si(n,wJ);return(0,q.jsx)(hJ.Provider,{value:m,children:(0,q.jsxs)(_a.Item,{id:o,active:!u&&f,"aria-expanded":u,"aria-controls":s,onSelect:()=>d(e=>!e),className:a,"data-component":`NavigationList.Item`,children:[g,(0,q.jsxs)(_a.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,q.jsx)(zn,{className:CJ.chevron})]}),(0,q.jsx)(_a.SubItem,{children:e.cloneElement(r,{ref:c})})]})})}EJ.displayName=`NavigationList.ItemWithSubNavigation`;const DJ={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function OJ(t,n){let{className:r,children:i,...a}=t,{buttonId:o,subNavigationId:s,isOpen:c}=e.useContext(hJ),{depth:l}=e.useContext(mJ),u=e.useMemo(()=>({depth:l+1}),[l]);return!o||!s||l>=4?null:(0,q.jsx)(mJ.Provider,{value:u,children:(0,q.jsx)(`ul`,{ref:n,id:s,hidden:!c,"aria-labelledby":o,className:G(DJ.root,DJ.items,r),"data-component":`NavigationList.SubNavigation`,"data-depth":l+1,...a,children:i})})}OJ.displayName=`NavigationList.SubNavigation`;var kJ=K(OJ);const AJ={subNavigation:kJ},jJ=_a.LinkItem;function MJ(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=si(r,AJ);return c.subNavigation?(0,q.jsx)(EJ,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,q.jsx)(jJ,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}MJ.displayName=`NavigationList.Item`;var NJ=K(MJ);const PJ=e=>typeof e==`string`||!g(e)?e:(0,q.jsx)(e,{});function FJ(t,n){let{label:r=`Show more`,pages:i=0,items:a,renderItem:o,...s}=t,[c,l]=e.useState(0),u=Y(),d=a.length/i,f=i===0?a.length:Math.ceil(d*c),p=c===1?0:f-Math.floor(d);return Ur(()=>{c!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[c,u]),(0,q.jsxs)(q.Fragment,{children:[c>0?a.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:a,...s}=e,c=t===p?u:void 0;return o?o({...e,"data-expand-focus-target":c}):(0,q.jsxs)(NJ,{"data-expand-focus-target":c,...s,children:[r?(0,q.jsx)(_a.LeadingVisual,{children:(0,q.jsx)(r,{})}):null,n,i?(0,q.jsx)(_a.TrailingVisual,{children:PJ(i)}):null,a?(0,q.jsx)(_a.TrailingAction,{...a}):null]},e.id??t)}):null,c<i||c===0?(0,q.jsxs)(_a.Item,{ref:n,as:`button`,"aria-expanded":!1,onSelect:()=>l(e=>e+1),"data-component":`NavigationList.GroupExpand`,...s,children:[r,(0,q.jsx)(_a.TrailingVisual,{children:(0,q.jsx)(xn,{})})]}):null]})}FJ.displayName=`NavigationList.GroupExpand`;var IJ=e.forwardRef(FJ);const LJ={root:`navigation-list-group-heading`};function RJ(t){let{as:n,className:r,...i}=t,a=e.useContext(pJ);return(0,q.jsx)(_a.GroupHeading,{as:n??_J(a),className:G(LJ.root,r),"data-component":`NavigationList.GroupHeading`,...i})}RJ.displayName=`NavigationList.GroupHeading`;const zJ=ai(RJ,Oi),BJ=Object.assign(xJ,{Heading:fJ,Item:NJ,SubNavigation:kJ,Group:SJ,GroupHeading:zJ,GroupExpand:IJ,Description:wi,LeadingVisual:Hi,TrailingVisual:oa,TrailingAction:aa,Divider:Ei}),VJ={root:`navigation-menu-heading`,hidden:`sr-only`};function HJ(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?VJ.hidden:VJ.root,r),"data-component":`NavigationMenu.Heading`,...i})}HJ.displayName=`NavigationMenu.Heading`;const UJ=n({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),WJ=n({value:``,triggerId:``,contentId:``,isOpen:!1}),GJ=n({linkId:``,descriptionId:``}),KJ=n(null),qJ=n({depth:0}),JJ=e=>Number.parseInt(e.slice(1),10),YJ=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},XJ={root:`navigation-menu`},ZJ={heading:HJ};function QJ(t,n){let{children:r,className:i,value:a,defaultValue:o=null,onValueChange:s,orientation:c=`horizontal`,openOn:l=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=t,g=e.useRef(null),_=Gr(n,g),[v,y]=si(r,ZJ),b=Y(),x=v.heading,S=x?x.props.id??b:void 0,C=x?JJ(x.props.as??`h2`):null,w=m??(p?void 0:S),T=a!==void 0,[E,D]=e.useState(o),O=T?a:E,k=e.useRef(s);Ur(()=>{k.current=s},[s]);let A=e.useRef(null),j=e.useRef(null),M=e.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);e.useEffect(()=>M,[M]);let N=e.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=e.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=e.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);Oa(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),e.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=e.useMemo(()=>({openValue:O,setOpenValue:N,orientation:c,openOn:l,openAfterDelay:P,closeAfterDelay:F}),[O,N,c,l,P,F]);return(0,q.jsx)(UJ.Provider,{value:L,children:(0,q.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:G(XJ.root,i),"data-component":`NavigationMenu`,"data-orientation":c,...h,onBlur:I,children:(0,q.jsxs)(KJ.Provider,{value:C,children:[x?e.cloneElement(x,{id:S}):null,y]})})})}QJ.displayName=`NavigationMenu`;var $J=e.forwardRef(QJ);const eY=W(`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 tY(t,n){let{as:r=`div`,className:i,align:a=`start`,...o}=t,{orientation:s}=e.useContext(UJ),{triggerId:c,contentId:l,isOpen:u}=e.useContext(WJ);if(!l)return null;let d=s===`vertical`?void 0:a;return(0,q.jsx)(r,{ref:n,id:l,hidden:!u,"aria-labelledby":c,className:G(eY({open:u,align:d}),i),"data-component":`NavigationMenu.Content`,"data-orientation":s,"data-align":d,"data-open":u?``:void 0,...o})}tY.displayName=`NavigationMenu.Content`;var nY=K(tY);const rY={root:`navigation-menu-description`};function iY(t){let{className:n,...r}=t,{descriptionId:i}=e.useContext(GJ);return(0,q.jsx)(`span`,{id:i,className:G(rY.root,n),"data-component":`NavigationMenu.Description`,...r})}iY.displayName=`NavigationMenu.Description`;const aY={root:`navigation-menu-divider`};function oY(e){let{className:t,...n}=e;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:G(aY.root,t),"data-component":`NavigationMenu.Divider`,...n})}oY.displayName=`NavigationMenu.Divider`;const sY={root:`navigation-menu-group-heading`};function cY(t){let{as:n,className:r,...i}=t,a=e.useContext(KJ),o=n??YJ(a);return(0,q.jsx)(o,{className:G(sY.root,r),"data-component":`NavigationMenu.GroupHeading`,...i})}cY.displayName=`NavigationMenu.GroupHeading`;const lY={root:`navigation-menu-group`},uY={groupHeading:cY};function dY(t){let{title:n,children:r,className:i,hideDivider:a=!1,...o}=t,s=Y(),[c,l]=si(r,uY),u=c.groupHeading??(n?(0,q.jsx)(cY,{children:n}):null),d=u?u.props.id??s:void 0;return(0,q.jsxs)(q.Fragment,{children:[a?null:(0,q.jsx)(oY,{}),(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:G(lY.root,i),"data-component":`NavigationMenu.Group`,...o,children:[u?e.cloneElement(u,{id:d}):null,l]})]})}dY.displayName=`NavigationMenu.Group`;const fY={root:`navigation-menu-item`};function pY(t,n){let{children:r,className:i,value:a,onPointerEnter:o,onPointerLeave:s,...c}=t,l=Y(),u=a??l,d=Y(),f=Y(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=e.useContext(UJ),_=p===u,v=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{s?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=e.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,q.jsx)(WJ.Provider,{value:b,children:(0,q.jsx)(`li`,{ref:n,className:G(fY.root,i),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...c,onPointerEnter:v,onPointerLeave:y,children:r})})}pY.displayName=`NavigationMenu.Item`;var mY=e.forwardRef(pY);const hY={root:`navigation-menu-visual`},gY=({className:e,...t})=>(0,q.jsx)(`span`,{className:G(hY.root,e),...t});function _Y(e){return(0,q.jsx)(gY,{"data-component":`NavigationMenu.LeadingVisual`,...e})}_Y.displayName=`NavigationMenu.LeadingVisual`;const vY={root:`navigation-menu-sub-navigation`};function yY(t,n){let{className:r,children:i,...a}=t,{linkId:o}=e.useContext(GJ),{depth:s}=e.useContext(qJ),c=e.useMemo(()=>({depth:s+1}),[s]);return!o||s>=4?null:(0,q.jsx)(qJ.Provider,{value:c,children:(0,q.jsx)(`ul`,{ref:n,"aria-labelledby":o,className:G(vY.root,r),"data-component":`NavigationMenu.SubNavigation`,"data-depth":s+1,...a,children:i})})}yY.displayName=`NavigationMenu.SubNavigation`;var bY=K(yY);const xY={root:`navigation-menu-visual-trailing`};function SY(e){let{className:t,...n}=e;return(0,q.jsx)(gY,{className:G(xY.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}SY.displayName=`NavigationMenu.TrailingVisual`;const CY={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},wY={leadingVisual:_Y,trailingVisual:SY,description:iY,subNavigation:bY};function TY(t,n){let{as:r=`a`,id:i,className:a,active:o,children:s,onClick:c,...l}=t,{setOpenValue:u}=e.useContext(UJ),{depth:d}=e.useContext(qJ),f=Y(i),p=Y(),[m,h]=si(s,wY),g=e.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{c?.(e),!e.defaultPrevented&&u(null)},v=(0,q.jsxs)(r,{ref:n,id:f,"aria-current":o?`page`:void 0,"aria-describedby":m.description?p:void 0,className:G(CY.root,o&&CY.active,a),"data-component":`NavigationMenu.Link`,"data-active":o?``:void 0,"data-has-description":m.description?``:void 0,...l,onClick:_,children:[m.leadingVisual,(0,q.jsxs)(`span`,{className:CY.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,q.jsxs)(GJ.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,q.jsx)(`li`,{className:CY.item,children:y})}TY.displayName=`NavigationMenu.Link`;var EY=K(TY);const DY={root:`navigation-menu-list`},OY=(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 kY(t,n){let{children:r,className:i,onKeyDown:a,...o}=t,{orientation:s,openValue:c,setOpenValue:l}=e.useContext(UJ),u=e.useRef(null),d=Gr(n,u),f=e=>{a?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(c===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(),l(null);return}let o=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===i?-1:0;if(d===0&&!o)return;let f=OY(t,s),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&c!==null&&l(null),o){f[e.key===`Home`?0:f.length-1].focus();return}f[(p+d+f.length)%f.length].focus()}};return(0,q.jsx)(`ul`,{ref:d,className:G(DY.root,i),"data-component":`NavigationMenu.List`,"data-orientation":s,...o,onKeyDown:f,children:r})}kY.displayName=`NavigationMenu.List`;var AY=e.forwardRef(kY);const jY={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function MY(t,n){let{children:r,className:i,onClick:a,onKeyDown:o,...s}=t,{setOpenValue:c,orientation:l}=e.useContext(UJ),{value:u,triggerId:d,contentId:f,isOpen:p}=e.useContext(WJ),m=e.useRef(!1);if(Ur(()=>{!p||!m.current||(m.current=!1,ei(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{a?.(e),!e.defaultPrevented&&c(p?null:u)},g=e=>{if(o?.(e),e.defaultPrevented)return;let t=l===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,c(u);return}ei(document.getElementById(f))[0]?.focus()}};return(0,q.jsxs)(`button`,{ref:n,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:G(jY.root,i),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...s,onClick:h,onKeyDown:g,children:[r,(0,q.jsx)(zn,{className:jY.chevron})]})}MY.displayName=`NavigationMenu.Trigger`;var NY=e.forwardRef(MY);const PY=Object.assign($J,{Heading:HJ,List:AY,Item:mY,Trigger:NY,Content:nY,Link:EY,SubNavigation:bY,Group:dY,GroupHeading:cY,Description:iY,LeadingVisual:_Y,TrailingVisual:SY,Divider:oY}),FY={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},IY=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,q.jsxs)(`span`,{className:FY.stepper,"data-component":`NumberInput.Stepper`,children:[(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:Hn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:FY.step,"data-component":`NumberInput.Increment`}),(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:zn,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:FY.step,"data-component":`NumberInput.Decrement`})]});function LY(t,n){let{className:r,value:i,defaultValue:a,min:o,max:s,step:c=1,disabled:l,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=t,g=e.useRef(null),_=Gr(n,g),v=i!==void 0,[y,b]=e.useState(a??null),x=v?i:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(zq(e.target),e)},w=e=>{let t=Rq(x,e,{step:c,min:o,max:s});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&s!==void 0&&x>=s,E=x!=null&&o!==void 0&&x<=o,D=!!l||!!u;return(0,q.jsx)(Ps,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:a,min:o,max:s,step:c,disabled:l,readOnly:u,onChange:C,className:G(FY.root,r),trailingAction:d?void 0:(0,q.jsx)(IY,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}LY.displayName=`NumberInput`;var RY=K(LY);const zY={current:null},BY=n({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:zY,contentWrapperRef:zY,sidebarRef:zY,sidebarContentWrapperRef:zY}),VY={root:`page-layout-horizontal-divider`};function HY(t,n){let{className:r,style:i,variant:a=`none`,position:o,...s}=t,{padding:c}=e.useContext(BY);return(0,q.jsx)(`div`,{ref:n,className:G(VY.root,r),style:{"--spacing-divider":`var(--page-layout-spacing-${c})`,...i},"data-component":`PageLayout.HorizontalDivider`,...ka(`variant`,a),...ka(`position`,o),...s})}HY.displayName=`PageLayout.HorizontalDivider`;var UY=K(HY);const WY={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function GY(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(BY);return(0,q.jsxs)(`footer`,{ref:n,className:G(WY.root,WY.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Footer`,...ka(`hidden`,c),...l,children:[(0,q.jsx)(UY,{variant:s,className:WY.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,q.jsx)(`div`,{className:WY.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a})]})}GY.displayName=`PageLayout.Footer`;var KY=K(GY);const qY={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function JY(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(BY);return(0,q.jsxs)(`header`,{ref:n,className:G(qY.root,qY.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Header`,...ka(`hidden`,c),...l,children:[(0,q.jsx)(`div`,{className:qY.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a}),(0,q.jsx)(UY,{variant:s,className:qY.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}JY.displayName=`PageLayout.Header`;var YY=K(JY);const XY=1280,ZY=3,QY={small:256,medium:296,large:320},$Y=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,eX=e=>e===`small`||e===`medium`||e===`large`,tX=e=>eX(e)?QY[e]:$Y(e)?parseInt(e.default,10):0,nX=()=>zr&&window.innerWidth>=1280?959:511,rX=e=>`Pane width ${e} pixels`,iX=(e,t,n=rX)=>{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))))},aX=({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`)},oX=({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`)},sX={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}},cX={root:`page-layout-drag-handle`},lX=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,uX=e=>e===`ArrowLeft`||e===`ArrowDown`;function dX(t){let{className:n,handleRef:r,onDragStart:i,onDrag:a,onDragEnd:o,onDoubleClick:s,"aria-label":c,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=rX}=t,g=e.useRef({onDragStart:i,onDrag:a,onDragEnd:o});e.useEffect(()=>{g.current={onDragStart:i,onDrag:a,onDragEnd:o}});let _=e.useRef(!1),v=e.useRef(null),y=e.useRef(null),b=e.useCallback(()=>{_.current||=(aX({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[r,p,m]),x=e.useCallback(()=>{_.current&&=(oX({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[r,p,m]);return e.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,q.jsx)(`div`,{ref:r,role:`slider`,tabIndex:0,"aria-label":l?void 0:c??`Draggable pane splitter`,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:G(cX.root,n),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=>{lX(e.key)&&(e.preventDefault(),b(),g.current.onDrag(uX(e.key)?-3:3,!0))},onKeyUp:e=>{lX(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:s,"data-component":`PageLayout.DragHandle`})}dX.displayName=`PageLayout.DragHandle`;const fX={root:`page-layout-vertical-divider`};function pX(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,q.jsx)(`div`,{ref:t,className:G(fX.root,n),"data-component":`PageLayout.VerticalDivider`,...ka(`variant`,r),...ka(`position`,i),...a})}pX.displayName=`PageLayout.VerticalDivider`;var mX=K(pX);const hX=({width:t,minWidth:n,resizable:r,widthStorageKey:i,paneRef:a,handleRef:o,contentWrapperRef:s,constrainToViewport:c=!1,onResizeEnd:l,currentWidth:u,formatValueText:d})=>{let f=$Y(t),p=f?parseInt(t.min,10):n,m=f?parseInt(t.max,10):null,h=e.useMemo(()=>tX(t),[t]),g=e.useRef(i),_=e.useRef(l),v=e.useRef(d);Ur(()=>{g.current=i,_.current=l,v.current=d});let y=e.useRef(c?256:511),b=e.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:c?Math.min(m,t):m},[m,p,c]),[x,S]=e.useState(()=>typeof u==`number`?u:l===void 0&&r===!0&&i!==void 0?sX.get(i)??h:h),[C,w]=e.useState(h),[T,E]=e.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=e.useRef(O),[A,j]=e.useState(()=>m??600),M=e.useRef(A);Ur(()=>{k.current=O},[O]);let N=e.useCallback(()=>tX(t),[t]),P=e.useCallback(t=>{let n=Math.round(t);if(k.current=n,e.startTransition(()=>{S(n)}),_.current){try{_.current(n)}catch{}return}r&&g.current&&sX.save(g.current,n)},[r]),F=e.useRef(b);return Ur(()=>{F.current=b}),Ur(()=>{if(!r)return;let t=window.innerWidth,n=()=>{let n=window.innerWidth,r=t<XY!=n<XY;t=n,r&&(y.current=nX());let i=F.current();a.current?.style.setProperty(`--pane-max-width`,`${i}px`);let s=k.current>i;s&&(k.current=i,a.current?.style.setProperty(`--pane-width`,`${i}px`)),iX(o.current,{max:i,current:k.current},v.current),(i!==M.current||s)&&(M.current=i,e.startTransition(()=>{j(i),s&&S(i)}))};y.current=nX();let i=F.current();if(M.current=i,a.current?.style.setProperty(`--pane-max-width`,`${i}px`),iX(o.current,{min:p,max:i,current:k.current},v.current),e.startTransition(()=>{j(i)}),m!==null&&!c)return;let l=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,a.current?.setAttribute(`data-dragging`,`true`),s?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,a.current?.removeAttribute(`data-dragging`),s?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-l>=16?(l=e,n()):u===null&&(u=requestAnimationFrame(()=>{u=null,l=performance.now(),n()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[r,m,c,p,a,o,s]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},gX={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 _X(t,n){let{className:r,style:i,children:a,id:o,position:s=`start`,width:c=`medium`,minWidth:l=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}=t,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=e.useContext(BY),T=e.useRef(null),E=e.useRef(0),D=e.useRef(0),O=e.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=hX({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=Gr(n,C),L=gm(C),ee=Y(o),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},te=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},z=(0,q.jsx)(mX,{variant:h?`line`:m,position:s,className:gX.divider,children:h?(0,q.jsx)(dX,{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=s===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(te(r),iX(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+(s===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(te(i),iX(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();te(e),iX(T.current,{current:e}),F(e)}}):null});return(0,q.jsxs)(`div`,{className:G(gX.wrapper,gX.hidden,gX.position,gX.sticky,gX.fullscreen,r),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...i},"data-position":s,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...ka(`is-hidden`,v),children:[s===`end`?z:null,(0,q.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:G(gX.sidebar,gX.sidebarResizable,gX.sidebarFullscreen,gX.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":$Y(c)?c.min:`${l}px`,"--pane-max-width":$Y(c)?c.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":$Y(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${eX(c)?c:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...o?{id:ee}:{},...x,children:a}),s===`start`?z:null]})}_X.displayName=`PageLayout.Sidebar`;var vX=K(_X);const yX={content:`page-layout-content-row`},bX=W(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),xX=W(`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 SX(t,n){let{className:r,style:i,children:a,containerWidth:o=`xlarge`,padding:s=`normal`,rowGap:c=`normal`,columnGap:l=`normal`,...u}=t,d=e.useRef(null),f=e.useRef(null),p=e.useRef(null),m=e.useRef(null),[h,g]=si(a,{header:YY,footer:KY,sidebar:vX}),_=e.useMemo(()=>({padding:s,rowGap:c,columnGap:l,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[s,c,l]);return(0,q.jsx)(BY.Provider,{value:_,children:(0,q.jsxs)(`div`,{ref:n,className:G(bX({hasSidebar:!!h.sidebar}),r),style:{"--spacing":`var(--page-layout-spacing-${s})`,...i},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,q.jsxs)(`div`,{ref:m,className:G(xX({width:o})),"data-page-layout-wrapper":``,"data-width":o,children:[h.header,(0,q.jsx)(`div`,{className:yX.content,children:g}),h.footer]})]})})}SX.displayName=`PageLayout`;var CX=K(SX);const wX={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},TX=W(`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 EX(t,n){let{as:r=`main`,className:i,children:a,width:o=`full`,padding:s=`none`,hidden:c=!1,...l}=t,{contentWrapperRef:u}=e.useContext(BY),d=Gr(n,u);return(0,q.jsx)(r,{ref:d,className:G(wX.wrapper,wX.hidden,wX.dragging,i),"data-component":`PageLayout.Content`,...ka(`is-hidden`,c),...l,children:(0,q.jsx)(`div`,{className:G(TX({width:o})),"data-width":o,style:{"--spacing":`var(--page-layout-spacing-${s})`},children:a})})}EX.displayName=`PageLayout.Content`;var DX=K(EX);const OX={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 kX(t,n){let{className:r,style:i,children:a,id:o,position:s=`end`,width:c=`medium`,minWidth:l=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}=t,S=Xs(s)?`end`:s,C=Xs(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=e.useContext(BY),O=e.useRef(null),k=e.useRef(0),A=e.useRef(0),j=e.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=hX({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=Gr(n,E),te=gm(E),z=Y(o),ne=te?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},B=e=>{E.current?.style.setProperty(`--pane-width`,`${e}px`),N.current=e};return(0,q.jsxs)(`div`,{className:G(OX.wrapper,OX.hidden,OX.position,OX.sticky,r),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...i},"data-sticky":g||void 0,...ka(`is-hidden`,v),...ka(`position`,s),children:[(0,q.jsx)(UY,{variant:Xs(m)?m:{narrow:C,regular:`none`},position:s,className:OX.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,q.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:G(OX.pane,OX.paneResizable,OX.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":$Y(c)?c.min:`${l}px`,"--pane-max-width":$Y(c)?c.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":$Y(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${eX(c)?c:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...o?{id:z}:{},...x,children:a}),(0,q.jsx)(mX,{variant:Xs(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:s,className:OX.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,q.jsx)(dX,{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&&(B(t),iX(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)&&(B(i),iX(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();B(e),iX(O.current,{current:e}),ee(e)}}):null})]})}kX.displayName=`PageLayout.Pane`;var AX=K(kX);const jX=Object.assign(CX,{Header:YY,Content:DX,Pane:AX,Sidebar:vX,Footer:KY}),MX=[`narrow`,`regular`,`wide`],NX={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},PX=W(`pagination-step`,{variants:{step:{previous:`pagination-step-previous`,next:`pagination-step-next`},current:{true:`pagination-step-current`,false:``},inert:{true:`pagination-step-inert`,false:``}}}),FX=e=>typeof e==`object`?MX.filter(t=>e[t]===!1):e?[]:[...MX],IX=({page:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[e.type===`previous`?(0,q.jsx)(Bn,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,q.jsx)(Vn,{"data-component":`Pagination.NextPageIcon`}):null]}),LX=e=>`#${e}`;function RX(t,n){let{as:r=`nav`,className:i,pageCount:a,currentPage:o,onPageChange:s,hrefBuilder:c=LX,marginPageCount:l=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=t,m=e.useMemo(()=>G_(a,o,!!d,l,u),[a,o,d,l,u]),h=FX(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=K_(e,c,t=>s?.(t,e.num)),a=e.type===`previous`||e.type===`next`,o=!!r||!!i[`aria-hidden`],l=G(PX({step:a?e.type:void 0,current:e.selected,inert:o}));if(f&&!r)return f({key:t,children:(0,q.jsx)(IX,{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,q.jsx)(u,{role:r?`presentation`:void 0,className:l,"data-component":d,...i,children:(0,q.jsx)(IX,{page:e,children:n})},t)});return(0,q.jsx)(r,{ref:n,"aria-label":`Pagination`,className:G(NX.root,i),"data-component":`Pagination`,...p,children:(0,q.jsx)(`div`,{className:G(NX.steps,h.map(e=>NX.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}RX.displayName=`Pagination`;var zX=K(RX);const BX={root:`password-input`,toggle:`password-input-toggle`};function VX(t,n){let{className:r,visible:i,defaultVisible:a=!1,onVisibilityChange:o,hideToggle:s=!1,showLabel:c=`Show password`,hideLabel:l=`Hide password`,disabled:u,...d}=t,f=i!==void 0,[p,m]=e.useState(a),h=f?i:p;return(0,q.jsx)(Ps,{ref:n,type:h?`text`:`password`,disabled:u,className:G(BX.root,r),trailingAction:s?void 0:(0,q.jsx)(Ps.Action,{icon:h?$n:er,"aria-label":h?l:c,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),o?.(t)},className:BX.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}VX.displayName=`PasswordInput`;var HX=K(VX);const UX={root:`pin-input`},WX=W(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),GX={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},KX=(e,t)=>Array.from(e).filter(e=>GX[t].test(e)).join(``);function qX(t,n){let{className:r,length:i=6,value:a,defaultValue:o=``,type:s=`numeric`,mask:c=!1,size:l=`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}=t,S=e.useRef([]),C=a!==void 0,[w,T]=e.useState(()=>KX(o,s).slice(0,i)),E=C?a:w,D=Array.from({length:i},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=e.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===i&&v?.(e)},M=(e,t)=>{let n=KX(t,s);if(n.length===0)return;let r=O===-1?e:Math.min(e,O),a=[...D],o=r;Array.from(n).forEach(e=>{o<i&&(a[o]=e,o+=1)}),j(a.join(``)),A(Math.min(o,i-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<i-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(i-1))}};return(0,q.jsx)(`div`,{ref:n,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:G(UX.root,r),"data-component":`PINInput`,"data-size":l,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,q.jsx)(Ps,{ref:e=>{S.current[t]=e},type:c?`password`:`text`,inputMode:s===`numeric`?`numeric`:`text`,size:l,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 ${i}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:G(WX({size:l})),"data-component":`PINInput.Box`},t))})}qX.displayName=`PINInput`;var JX=K(qX);const YX={root:`placeholder`};function XX(e,t){let{as:n=`div`,className:r,width:i,height:a,label:o,style:s,children:c,...l}=e;return(0,q.jsx)(n,{ref:t,className:G(YX.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}XX.displayName=`Placeholder`;var ZX=K(XX);const QX=n({}),$X=W(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function eZ(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,q.jsx)(QX.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G($X({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}eZ.displayName=`Popover`;var tZ=K(eZ);const nZ=W(`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`}}}),rZ=[];function iZ(t,n){let{as:r=`div`,className:i,width:a=`small`,height:o=`fit-content`,overflow:s=`visible`,onClickOutside:c,onEscape:l,ignoreClickRefs:u=rZ,...d}=t,{open:f=!1,caret:p=`top`}=e.useContext(QX),m=e.useRef(null),h=Gr(n,m);return e.useEffect(()=>{if(!f||!c)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))||c(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,c,u]),Oa(e=>{!f||!l||(l(e),e.preventDefault())}),(0,q.jsx)(r,{ref:h,className:G(nZ({caret:p,width:a,height:o,overflow:s}),i),"data-component":`Popover.Content`,"data-caret":p,"data-width":a,"data-height":o,"data-overflow":s,...d})}iZ.displayName=`Popover.Content`;var aZ=K(iZ);const oZ=Object.assign(tZ,{Content:aZ}),sZ={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},cZ=W(`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 lZ(t,n){let{as:r=`span`,className:i,progress:a=0,size:o=`medium`,variant:s=`success`,style:c,children:l,"aria-valuenow":u,...d}=t,f=Math.min(Math.max(a,0),100),p=e.Children.toArray(l).length>0;return(0,q.jsxs)(r,{ref:n,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:G(cZ({size:o,variant:s}),i),style:{...c,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":o,"data-variant":s,...d,children:[(0,q.jsxs)(`svg`,{className:sZ.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:sZ.track,cx:16,cy:16,r:14,pathLength:100}),(0,q.jsx)(`circle`,{className:sZ.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,q.jsx)(`span`,{className:sZ.label,children:l}):null]})}lZ.displayName=`ProgressCircle`;var uZ=K(lZ);const dZ={L:1,M:0,Q:3,H:2},fZ={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},pZ={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function mZ(e,t){let n=pZ[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const hZ={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 gZ(e,t){return hZ[t][e]}const _Z=[[],[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]],vZ=[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 yZ(e){return/^\d+$/.test(e)}function bZ(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function xZ(e){return yZ(e)?`numeric`:bZ(e)?`alphanumeric`:`byte`}function SZ(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function CZ(e){let t=[],n=0;for(;n+2<e.length;)OZ(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(OZ(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&OZ(t,Number.parseInt(e[n],10),4),t}function wZ(e){let t=[],n=0;for(;n+1<e.length;)OZ(t,SZ(e[n])*45+SZ(e[n+1]),11),n+=2;return n<e.length&&OZ(t,SZ(e[n]),6),t}function TZ(e){let t=[];for(let n of e)OZ(t,n,8);return t}function EZ(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;OZ(t,r*192+i,13)}return t}function DZ(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 OZ(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function kZ(e,t){return gZ(e,t).totalDataCodewords*8}function AZ(e,t,n,r){let i=n===`auto`||!n?xZ(e):n,a=new TextEncoder().encode(e);if(r){let n=kZ(r,t);if(jZ(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=kZ(n,t);if(jZ(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function jZ(e,t,n,r){let i=mZ(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 MZ(e,t){return t&&t!==`auto`?t:yZ(e)?`numeric`:bZ(e)?`alphanumeric`:`byte`}const NZ=new Uint8Array(512),PZ=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)NZ[t]=e,PZ[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)NZ[e]=NZ[e-255]})();function FZ(e,t){return e===0||t===0?0:NZ[(PZ[e]+PZ[t])%255]}function IZ(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,NZ[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]^=FZ(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]^FZ(e,n[i+1]);r[t-1]=FZ(e,n[t])}return r}function LZ(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(IZ(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(IZ(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 RZ(e,t={}){let n=t.ecLevel??`M`,r=MZ(e,t.mode),i=AZ(e,n,r,t.version),a=gZ(i,n),o=LZ(BZ(zZ(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)OZ(s,e,8);return{version:i,ecLevel:n,bits:s}}function zZ(e,t,n,r){let i=[],a=mZ(n,t),o=new TextEncoder().encode(e);switch(OZ(i,fZ[t],4),OZ(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...CZ(e));break;case`alphanumeric`:i.push(...wZ(e));break;case`byte`:i.push(...TZ(o));break;case`kanji`:{let t=DZ(e);i.push(...EZ(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&OZ(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)OZ(i,l?236:17,8),l=!l;return i}function BZ(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 VZ(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function HZ(e,t){let n=e.length;UZ(e,0,0),UZ(e,n-7,0),UZ(e,0,n-7),GZ(e,n),KZ(e,t),e[4*t+9][8]=!0,JZ(e,n),t>=7&&YZ(e,n)}function UZ(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++)WZ(e,t-1,n+i,!1,r),WZ(e,t+7,n+i,!1,r),WZ(e,t+i,n-1,!1,r),WZ(e,t+i,n+7,!1,r)}function WZ(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function GZ(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 KZ(e,t){if(t<2)return;let n=_Z[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)&&qZ(e,n[t],n[i])}function qZ(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 JZ(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 YZ(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 XZ(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 ZZ(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=_Z[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 QZ(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 $Z(e,t,n,r){let i=QZ(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)ZZ(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function eQ(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]);$Z(o,r,t,n);let s=tQ(o,t);s<a&&(a=s,i=r)}return i}function tQ(e,t){return nQ(e,t)+rQ(e,t)+iQ(e,t)+aQ(e,t)}function nQ(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 rQ(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 iQ(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 aQ(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 oQ(e,t){let n=dZ[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 sQ(e,t,n){let r=e.length,i=oQ(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 cQ(e,t){if(t<7)return;let n=e.length,r=vZ[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 lQ=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},uQ=class extends lQ{constructor(...e){super(...e),this.name=`InvalidInputError`}};function dQ(e,t={}){let{version:n,ecLevel:r,bits:i}=RZ(e,t),a=n*4+17,o=VZ(a);HZ(o,n),XZ(o,i,n);let s=eQ(o,a,n,t.mask);return $Z(o,s,a,n),sQ(o,r,s),n>=7&&cQ(o,n),o.map(e=>e.map(e=>e===!0))}function fQ(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}const pQ=(()=>{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 mQ(e){let t=4294967295;for(let n=0;n<e.length;n++)t=pQ[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function hQ(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 gQ(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 _Q(e){let t=gQ(e),n=hQ(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 vQ=new Uint8Array([137,80,78,71,13,10,26,10]);function yQ(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,mQ(a)),r}function bQ(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=_Q(s),u=yQ(`IHDR`,r),d=yQ(`IDAT`,l),f=yQ(`IEND`,new Uint8Array),p=vQ.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(vQ,h),h+=vQ.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function xQ(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,${kQ(s)}`:SQ(s,o.width,o.height)}function SQ(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)CQ(e,i,a,o,l);else if(s===24)wQ(e,i,a,o,l);else if(s<=8)TQ(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=DQ(a,o,s),n=i+EQ(e,i,s)+t;n<e.length&&OQ(e,n,a,o,l)}return`data:image/png;base64,${kQ(bQ(a,o,l))}`}function CQ(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 wQ(e,t,n,r,i){let a=t+EQ(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 TQ(e,t,n,r,i,a){let o=EQ(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 EQ(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 DQ(e,t,n){return Math.ceil(e*n/32)*4*t}function OQ(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 kQ(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const AQ=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function jQ(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="${fQ(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(AQ.test(e.svg))throw new uQ(`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=fQ(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 uQ(`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=xQ(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${fQ(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function MQ(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return NQ(e+o,t+o,a);case`rounded`:return PQ(e+o,t+o,a,a*.25);case`dots`:return FQ(e+n/2,t+n/2,a/2);case`diamond`:return IQ(e+n/2,t+n/2,a);case`classy`:return LQ(e+o,t+o,a);case`classy-rounded`:return RQ(e+o,t+o,a);case`extra-rounded`:return PQ(e+o,t+o,a,a*.5);case`vertical-line`:return zQ(e+o,t,n,a);case`horizontal-line`:return BQ(e,t+o,n,a);case`small-square`:return NQ(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return NQ(e+n*.25,t+n*.25,n*.5);default:return NQ(e+o,t+o,a)}}function NQ(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function PQ(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 FQ(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 IQ(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function LQ(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 RQ(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 zQ(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function BQ(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function VQ(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return UQ(e,t,i,i,r)+WQ(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return FQ(e+r,t+r,r)+FQ(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return UQ(e,t,i,i,r)+WQ(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return UQ(e,t,i,i,r)+WQ(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 HQ(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return FQ(a,o,i/2);case`rounded`:return PQ(e+n*2,t+n*2,i,n*.75);default:return NQ(e+n*2,t+n*2,i)}}function UQ(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 WQ(e,t,n,r,i){return UQ(e,t,n,r,i)}const GQ={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`},KQ=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function qQ(t,n){let{value:r,size:i=200,margin:a=4,ecLevel:o,version:s,mode:c,mask:l,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}=t,S=o??(h?`H`:void 0),C=e.useMemo(()=>{if(!r)return null;try{return dQ(r,{ecLevel:S,version:s,mode:c,mask:l})}catch{return null}},[r,S,s,c,l]);if(!C)return(0,q.jsx)(`div`,{ref:n,className:G(GQ.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,q.jsx)(`span`,{className:GQ.fallback,children:v}):null});let w=C.length,T=w+a*2,E=i/T,D=h?jQ({size:g},w,E,a).hiddenModules:void 0,O=KQ(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(MQ((t+a)*E,(e+a)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+a)*E,i=(t+a)*E;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{className:GQ.corner,d:VQ(r,i,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,q.jsx)(`path`,{className:GQ.corner,d:HQ(r,i,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,q.jsxs)(`div`,{ref:n,role:`img`,"aria-label":_??r,className:G(GQ.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,q.jsxs)(`svg`,{className:GQ.canvas,width:i,height:i,viewBox:`0 0 ${i} ${i}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,q.jsx)(`rect`,{className:GQ.background,width:`100%`,height:`100%`}),f?O.map(t=>(0,q.jsx)(e.Fragment,{children:j(f[t.key],t.row,t.col)},t.key)):null,A.length>0?(0,q.jsx)(`path`,{className:GQ.modules,d:A.join(``)}):null]}),h?(0,q.jsx)(`span`,{className:GQ.logo,"aria-hidden":`true`,children:h}):null]})}qQ.displayName=`QRCode`;var JQ=K(qQ);const YQ=n({}),XQ={root:`radio-card-description`};function ZQ(t,n){let{className:r,id:i,...a}=t,{descriptionId:o}=e.useContext(YQ);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(XQ.root,r),"data-component":`RadioCard.Description`,...a})}ZQ.displayName=`RadioCard.Description`;var QQ=K(ZQ);const $Q={root:`radio-card-label`};function e$(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(YQ);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G($Q.root,r),"data-component":`RadioCard.Label`,...a})}e$.displayName=`RadioCard.Label`;var t$=K(e$);const n$={root:`radio-card-leading-visual`};function r$(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(n$.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}r$.displayName=`RadioCard.LeadingVisual`;var i$=K(r$);const a$={body:`radio-card-body`,control:`radio-card-control`},o$=W(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function s$(t,n){let{className:r,children:i,value:a,name:o,checked:s,defaultChecked:c,disabled:l,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=t,v=e.useContext(FS).disabled||l,y=Y(p),b=`${y}-label`,x=`${y}-description`,[S,C]=si(i,{leadingVisual:i$,label:t$,description:QQ}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,q.jsx)(YQ.Provider,{value:{labelId:b,descriptionId:x},children:(0,q.jsxs)(`label`,{ref:n,className:G(o$({disabled:!!v,validation:d}),r),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,q.jsxs)(`div`,{className:a$.body,children:[S.label,S.description,C]}),(0,q.jsx)(RS,{id:y,value:a,name:o,checked:s,defaultChecked:c,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:a$.control})]})})}s$.displayName=`RadioCard`;var c$=K(s$);const l$=Object.assign(c$,{LeadingVisual:i$,Label:t$,Description:QQ}),u$={root:`radio-group-caption`};function d$(t,n){let{className:r,...i}=t,{captionId:a}=e.useContext(FS);return(0,q.jsx)(`span`,{ref:n,id:a,className:G(u$.root,r),"data-component":`RadioGroup.Caption`,...i})}d$.displayName=`RadioGroup.Caption`;var f$=K(d$);const p$={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function m$(t,n){let{className:r,children:i,visuallyHidden:a,...o}=t,{disabled:s,required:c}=e.useContext(FS);return(0,q.jsxs)(`span`,{ref:n,title:c?`required field`:void 0,className:G(p$.root,s&&p$.disabled,a&&p$.hidden,r),"data-component":`RadioGroup.Label`,"data-label-disabled":s,...o,children:[i,c?(0,q.jsx)(`span`,{className:p$.required,children:`*`}):null]})}m$.displayName=`RadioGroup.Label`;var h$=K(m$);const g$={success:Ln,error:Qn},_$={icon:`radio-group-validation-icon`},v$=W(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function y$(t,n){let{className:r,children:i,variant:a,...o}=t,{validationMessageId:s}=e.useContext(FS),c=g$[a];return(0,q.jsxs)(`span`,{ref:n,className:G(v$({variant:a}),r),"data-component":`RadioGroup.Validation`,"data-validation-status":a,...o,children:[(0,q.jsx)(c,{className:_$.icon,"aria-hidden":`true`}),(0,q.jsx)(`span`,{id:s,children:i})]})}y$.displayName=`RadioGroup.Validation`;var b$=K(y$);const x$={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 S$(t,n){let{as:r=`fieldset`,className:i,children:a,name:o,disabled:s,required:c,onChange:l,id:u,"aria-labelledby":d,...f}=t,[p,m]=si(a,{label:h$,caption:f$,validation:b$}),h=Y(u),g=p.caption?`${h}-caption`:void 0,_=p.validation?`${h}-validation`:void 0,v=e=>{let{value:t,checked:n}=e.currentTarget;n&&l?.(t,e)},y=e.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:o,disabled:s,required:c,captionId:g,validationMessageId:_,onChange:v};return(0,q.jsx)(FS.Provider,{value:b,children:(0,q.jsxs)(r,{ref:n,id:h,disabled:s,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:G(x$.root,i),"data-component":`RadioGroup`,"data-disabled":s,"data-required":c,...f,children:[p.label?(0,q.jsxs)(`legend`,{className:G(x$.legend,y&&x$.legendVisible),children:[p.label,c?(0,q.jsx)(`span`,{className:x$.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,q.jsx)(`div`,{className:x$.body,children:m}),p.validation?(0,q.jsx)(`div`,{className:x$.validation,children:p.validation}):null]})})}S$.displayName=`RadioGroup`;var C$=K(S$);const w$=Object.assign(C$,{Label:h$,Caption:f$,Validation:b$}),T$=5,E$={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`},D$=W(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),O$=e=>e===1?`1 star`:`${e} stars`,k$=(e,t)=>`${e} out of ${t} stars`,A$=({className:e})=>(0,q.jsx)(`svg`,{className:e,"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.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 j$(t,n){let{className:r,style:i,count:a=5,value:o,defaultValue:s,size:c=`medium`,readOnly:l,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=O$,valueLabel:h=k$,"aria-label":g,..._}=t,v=o!==void 0,[y,b]=e.useState(()=>s??0),x=v?o:y,S=Math.max(Math.trunc(a),0),C=Math.min(Math.max(x,0),S),w=Y(f),T=!l&&!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=l?`span`:`label`;return(0,q.jsx)(`span`,{ref:n,role:l?`img`:`radiogroup`,"aria-label":l?g??h(C,S):g,className:G(D$({size:c,interactive:T,disabled:!!u}),r),style:{...i,"--rating-value":C},"data-component":`Rating`,"data-size":c,"data-value":C,"data-count":S,"data-readonly":l,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,q.jsxs)(k,{className:E$.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[l?null:(0,q.jsx)(`input`,{type:`radio`,className:G(E$.input,E$.srOnly),name:w,value:n,checked:n===C,disabled:u,"aria-label":m(n,S),onChange:D,onClick:O,"data-component":`Rating.Input`}),(0,q.jsxs)(`span`,{className:E$.star,"aria-hidden":`true`,children:[(0,q.jsx)(A$,{className:E$.starTrack}),(0,q.jsx)(`span`,{className:E$.starFill,children:(0,q.jsx)(A$,{className:E$.starFillIcon})})]})]},n)})})}j$.displayName=`Rating`;var M$=K(j$);const N$=1e3,P$=60*N$,F$=60*P$,I$=24*F$,L$=7*I$,R$=30*I$,z$=12*R$,B$=`P30D`,V$=`on`,H$=[{unit:`year`,length:z$},{unit:`month`,length:R$},{unit:`week`,length:L$},{unit:`day`,length:I$},{unit:`hour`,length:F$},{unit:`minute`,length:P$},{unit:`second`,length:N$}],U$=[`year`,`month`,`day`,`hour`,`minute`,`second`],W$={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},G$=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),K$=e=>{let t=G$.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)*z$+Number(r??0)*R$+Number(i??0)*L$+Number(a??0)*I$+Number(o??0)*F$+Number(s??0)*P$+Number(c??0)*N$},q$=e=>{let t=Math.abs(e),{unit:n,length:r}=H$.find(({length:e})=>t>=e)??H$[H$.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},J$=(e,t)=>{let n=Math.floor(Math.abs(e)/N$),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 U$.slice(0,U$.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},Y$=e=>{let{value:t,unit:n}=q$(e);return n===`second`?`1m`:`${Math.abs(t)}${W$[n]}`},X$=(e,t)=>{let n=J$(e,t).filter(({count:e})=>e>0);return n.length===0?`0${W$[t]}`:n.map(({unit:e,count:t})=>`${t}${W$[e]}`).join(` `)},Z$=(e,t)=>{let{value:n,unit:r}=q$(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},Q$=(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}},$$=(e,t,n,r)=>new Intl.DateTimeFormat(r,Q$(e,t,n)).format(e),e1=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),t1=(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:X$(u,a),updateDelay:H$.find(({unit:e})=>e===a)?.length??N$};let d=K$(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=q$(u);return{text:r===`micro`?Y$(u):Z$(u,l),updateDelay:e}}let f=$$(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},n1=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function r1(t,n){let{as:r=`time`,children:i,date:a,datetime:o,format:s=`auto`,tense:c=`auto`,precision:l=`second`,threshold:u=B$,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=t,S=n1(a,o),[C,w]=e.useState(()=>Date.now()),{text:T,updateDelay:E}=S?t1(S,C,{format:s,tense:c,precision:l,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return e.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,q.jsx)(r,{ref:n,dateTime:S?.toISOString(),title:f||!S?void 0:e1(S),"data-component":`RelativeTime`,"data-format":s,"data-tense":c,...x,children:i??T})}r1.displayName=`RelativeTime`;var i1=K(r1);const a1={root:`resizable`};function o1(e,t){let{className:n,orientation:r=`horizontal`,resizableRef:i,...a}=e;return(0,q.jsx)(V,{elementRef:t,groupRef:i,orientation:r,className:G(a1.root,n),"data-component":`Resizable`,"data-orientation":r,...a})}o1.displayName=`Resizable`;var s1=K(o1);const c1={root:`resizable-panel`};function l1(e,t){let{className:n,...r}=e;return(0,q.jsx)(ie,{elementRef:t,className:G(c1.root,n),"data-component":`Resizable.Panel`,...r})}l1.displayName=`Resizable.Panel`;var u1=K(l1);const d1={root:`resizable-resize-trigger`};function f1(e,t){let{className:n,...r}=e;return(0,q.jsx)(ae,{elementRef:t,className:G(d1.root,n),"data-component":`Resizable.ResizeTrigger`,...r})}f1.displayName=`Resizable.ResizeTrigger`;var p1=K(f1);const m1={root:`resizable-resize-trigger-indicator`};function h1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(m1.root,n),"data-component":`Resizable.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}h1.displayName=`Resizable.ResizeTriggerIndicator`;var g1=K(h1);const _1={root:`resizable-resize-trigger-separator`};function v1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(_1.root,n),"data-component":`Resizable.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}v1.displayName=`Resizable.ResizeTriggerSeparator`;var y1=K(v1);const b1=Object.assign(s1,{Panel:u1,ResizeTrigger:p1,ResizeTriggerSeparator:y1,ResizeTriggerIndicator:g1}),x1=n({}),S1=`RichTextEditor`,C1=[B,re,L,I,j,A],w1={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`},T1={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},E1=({readOnly:t})=>{let[n]=E();return e.useEffect(()=>{n.setEditable(!t)},[n,t]),null};function D1(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=S1,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,...g}=e,_={namespace:l,theme:w1,nodes:c?[...C1,...c]:C1,editable:!s,editorState:i,onError:u??(e=>{throw e})},v={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,q.jsx)(`div`,{ref:t,className:G(T1.root,s&&T1.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,...g,children:(0,q.jsx)(S,{initialConfig:_,children:(0,q.jsxs)(x1.Provider,{value:v,children:[(0,q.jsx)(oe,{}),(0,q.jsx)(ce,{}),(0,q.jsx)(se,{}),(0,q.jsx)(ue,{}),(0,q.jsx)(E1,{readOnly:s}),a?(0,q.jsx)(le,{onChange:(e,t)=>a(e,t)}):null,r]})})})}D1.displayName=`RichTextEditor`;var O1=K(D1);const k1={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function A1(t,n){let{className:r,style:i,...a}=t,{placeholder:o,minHeight:s,maxHeight:c,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d}=e.useContext(x1),f=(0,q.jsx)(`div`,{className:k1.scroll,style:{minHeight:s===void 0?void 0:`${s}px`,maxHeight:c===void 0?void 0:`${c}px`},"data-component":`RichTextEditor.Scroll`,children:o?(0,q.jsx)(de,{ref:n,className:G(k1.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":o,placeholder:(0,q.jsx)(`div`,{className:k1.placeholder,children:o}),"data-component":`RichTextEditor.Content`,...a}):(0,q.jsx)(de,{ref:n,className:G(k1.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...a})});return(0,q.jsx)(pe,{contentEditable:f,ErrorBoundary:fe})}A1.displayName=`RichTextEditor.Content`;var j1=K(A1);const M1=[`history`,`inline`,`block`,`list`,`link`],N1={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`},P1=[{format:`bold`,icon:xr,label:`Bold`},{format:`italic`,icon:Er,label:`Italic`},{format:`underline`,icon:Ar,label:`Underline`},{format:`strikethrough`,icon:kr,label:`Strikethrough`},{format:`code`,icon:qn,label:`Code`}],F1=[{tag:`h1`,icon:Cr,label:`Heading 1`},{tag:`h2`,icon:wr,label:`Heading 2`},{tag:`h3`,icon:Tr,label:`Heading 3`}],I1={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function L1(t){let{className:n,children:r,controls:i=M1,"aria-label":a=`Formatting`,...o}=t,[s]=E(),{readOnly:c}=e.useContext(x1),l=e.useRef(null);ri({containerRef:l,direction:`horizontal`,wrap:!0});let[u,d]=e.useState(I1),[f,p]=e.useState(`paragraph`),[m,h]=e.useState(!1),[g,_]=e.useState(!1),[v,y]=e.useState(!1),[b,x]=e.useState(null),S=e.useCallback(()=>{let e=_e();if(!ve(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(N(n))p(n.getListType()===`number`?`number`:`bullet`);else if(z(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else ne(n)?p(`quote`):p(`paragraph`);h(k(t)||k(t.getParent()))},[]);e.useEffect(()=>he(s.registerUpdateListener(({editorState:e})=>{e.read(S)}),s.registerCommand(we,()=>(S(),!1),xe),s.registerCommand(be,e=>(_(e),!1),xe),s.registerCommand(ye,e=>(y(e),!1),xe)),[s,S]);let C=e=>{s.update(()=>{let t=_e();if(ve(t)){if(f===e){me(t,()=>ge());return}me(t,()=>e===`quote`?te():R(e))}})},w=e=>{if(f===e){s.dispatchCommand(ee,void 0);return}s.dispatchCommand(e===`bullet`?F:P,void 0)},T=()=>{if(m){s.dispatchCommand(M,null);return}x(e=>e===null?``:null)},D=()=>{b&&s.dispatchCommand(M,b),x(null),s.focus()},O=(e,t,n,r,i,a)=>(0,q.jsx)(na,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:c||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),A={history:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(na,{icon:Mn,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:c||!g,onClick:()=>s.dispatchCommand(Te,void 0),"data-component":`RichTextEditor.Undo`}),(0,q.jsx)(na,{icon:kn,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:c||!v,onClick:()=>s.dispatchCommand(Ce,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,q.jsx)(q.Fragment,{children:P1.map(({format:e,icon:t,label:n})=>O(n,n,t,u[e],()=>s.dispatchCommand(Se,e)))}),block:(0,q.jsxs)(q.Fragment,{children:[F1.map(({tag:e,icon:t,label:n})=>O(n,n,t,f===e,()=>C(e))),O(`Quote`,`Quote`,Or,f===`quote`,()=>C(`quote`))]}),list:(0,q.jsxs)(q.Fragment,{children:[O(`Bulleted list`,`Bulleted list`,Sr,f===`bullet`,()=>w(`bullet`)),O(`Numbered list`,`Numbered list`,Dr,f===`number`,()=>w(`number`))]}),link:O(`Link`,m?`Remove link`:`Link`,sr,m||b!==null,T)};return(0,q.jsxs)(`div`,{className:G(N1.root,n),"data-component":`RichTextEditor.Toolbar`,children:[(0,q.jsxs)(`div`,{ref:l,role:`toolbar`,"aria-label":a,"aria-orientation":`horizontal`,className:N1.controls,...o,children:[i.map((t,n)=>(0,q.jsxs)(e.Fragment,{children:[n>0?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:N1.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,q.jsx)(`div`,{className:N1.group,"data-control":t,children:A[t]})]},t)),r]}),b===null?null:(0,q.jsxs)(`div`,{className:N1.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,q.jsx)(Ps,{autoFocus:!0,size:`small`,type:`url`,value:b,placeholder:`https://example.com`,"aria-label":`Link address`,className:N1.linkInput,onChange:e=>x(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),D()),e.key===`Escape`&&(x(null),s.focus())}}),(0,q.jsx)($i,{size:`small`,onClick:D,children:`Apply`})]})]})}L1.displayName=`RichTextEditor.Toolbar`;const R1=Object.assign(O1,{Toolbar:L1,Content:j1}),z1={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`},B1=t=>{let n=t;return e.isValidElement(t)?t:(0,q.jsx)(n,{})};function V1(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,q.jsx)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":d||void 0,className:G(z1.button,i&&z1.buttonSelected,d&&!i&&z1.buttonDisabled,n),...u,children:(0,q.jsx)(`span`,{className:G(z1.content,i&&z1.contentSelected,!i&&!d&&z1.contentInteractive),children:r})});return(0,q.jsx)(`li`,{className:G(z1.item,z1.separator,z1.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,q.jsx)(sE,{text:o,type:s,direction:c,children:f}):f})}V1.displayName=`SegmentedControlSegment`;const H1={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function U1(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,q.jsxs)(V1,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,q.jsx)(`span`,{className:G(H1.visual,o&&H1.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:B1(i)}):null,(0,q.jsx)(`span`,{className:G(H1.text,H1.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,q.jsx)(`span`,{className:H1.counter,children:(0,q.jsx)(qi,{children:r})})]})}U1.displayName=`SegmentedControl.Button`;const W1={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function G1(e){let{"aria-label":t,className:n,description:r,icon:i,selected:a,disabled:o,tooltipDirection:s,defaultSelected:c,...l}=e;return(0,q.jsx)(V1,{component:`SegmentedControl.IconButton`,className:G(W1.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,q.jsx)(`span`,{className:G(W1.visual,o&&W1.visualDisabled),"data-component":`SegmentedControl.Icon`,children:B1(i)})})}G1.displayName=`SegmentedControl.IconButton`;const K1={dropdown:`segmented-control-dropdown`},q1=W(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),J1=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),Y1=e=>e.type===U1,X1=e=>e.type===G1,Z1=e=>{if(e!==void 0)return Y1(e)?e.props.children:X1(e)?e.props[`aria-label`]:void 0},Q1=e=>e===void 0?null:Y1(e)?e.props.leadingVisual??null:X1(e)?e.props.icon:null,$1=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function e0(t){let{"aria-label":n,"aria-labelledby":r,className:i,children:a,fullWidth:o,onChange:s,size:c=`medium`,variant:l=`default`,...u}=t,d=J1(a),f=s===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]=e.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{$1(t)||(f&&g(e),s?.(e),t.props.onClick?.(n))},b=(0,q.jsx)(`ul`,{"aria-label":n,"aria-labelledby":r,className:G(q1({size:c}),i),"data-component":`SegmentedControl`,"data-size":c,...ka(`full-width`,o),...ka(`variant`,l),...u,children:d.map((t,n)=>e.cloneElement(t,{selected:n===_,onClick:e=>y(n,t,e)}))});return Xs(l)&&Object.values(l).includes(`dropdown`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:K1.dropdown,"data-component":`SegmentedControl.Dropdown`,...ka(`variant`,l),children:(0,q.jsxs)(eo,{children:[(0,q.jsx)(eo.Button,{"aria-label":n&&`${Z1(v)}, ${n}`,leadingVisual:Q1(v),children:Z1(v)}),(0,q.jsx)(eo.Overlay,{"aria-labelledby":r,children:(0,q.jsx)(_a,{selectionVariant:`single`,children:d.map((e,t)=>{let n=Q1(e);return(0,q.jsxs)(_a.Item,{selected:t===_,disabled:$1(e),onSelect:n=>y(t,e,n),children:[n?(0,q.jsx)(_a.LeadingVisual,{children:B1(n)}):null,Z1(e)]},t)})})})]})}),b]}):b}e0.displayName=`SegmentedControl`;const t0=Object.assign(e0,{Button:U1,IconButton:G1}),n0=Object.assign(aC,{Option:qS,OptGroup:US});function r0(t,n){let{className:r,children:i,...a}=t,{required:o,...s}=Vp(a),{labelId:c}=e.useContext(Bp),l=Y();return(0,q.jsx)($i,{ref:n,type:`button`,"aria-labelledby":c?`${l} ${c}`:void 0,className:G(r),"data-component":`SelectPanel.Button`,...s,children:c?(0,q.jsx)(`span`,{id:l,children:i}):i})}r0.displayName=`SelectPanel.Button`;var i0=K(r0);const a0=n({}),o0={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 s0(t,n){let{className:r,children:i,...a}=t,{selectionVariant:o,onCancel:s}=e.useContext(a0),c=o!==`instant`;return!c&&!i?null:(0,q.jsxs)(`div`,{ref:n,className:G(o0.root,!c&&o0.rootWithoutActions,r),"data-component":`SelectPanel.Footer`,"data-has-actions":c?``:void 0,...a,children:[(0,q.jsx)(`div`,{className:G(o0.content,!c&&o0.contentWithoutActions),children:i}),c?(0,q.jsxs)(`div`,{className:o0.actions,children:[(0,q.jsx)($i,{type:`button`,size:`small`,onClick:s,children:`Cancel`}),(0,q.jsx)($i,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}s0.displayName=`SelectPanel.Footer`;var c0=K(s0);const l0={root:`select-panel-search-input`};function u0(t,n){let{className:r,value:i,onChange:a,onKeyDown:o,...s}=t,{searchQuery:c,setSearchQuery:l,searchInputRef:u,moveFocusToList:d}=e.useContext(a0),f=e.useRef(null),p=Gr(u,f),m=Gr(n,p),h=i??c??``;return(0,q.jsx)(Ps,{ref:m,block:!0,leadingVisual:mr,placeholder:`Search`,value:h,onChange:e=>{l?.(e.currentTarget.value),a?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),o?.(e)},trailingAction:h?(0,q.jsx)(Ps.Action,{icon:Yn,"aria-label":`Clear`,onClick:()=>{l?.(``),a?.(``,null),f.current?.focus()}}):void 0,className:G(l0.root,r),"data-component":`SelectPanel.SearchInput`,...s})}u0.displayName=`SelectPanel.SearchInput`;var d0=K(u0);const f0={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`},p0={searchInput:d0};function m0(t,n){let{className:r,children:i,onBack:a,...o}=t,[s,c]=si(i,p0),{panelId:l,title:u,description:d,onCancel:f,onClearSelection:p}=e.useContext(a0);return(0,q.jsxs)(`div`,{ref:n,className:G(f0.root,r),"data-component":`SelectPanel.Header`,...o,children:[(0,q.jsxs)(`div`,{className:G(f0.content,s.searchInput&&f0.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":s.searchInput?``:void 0,children:[(0,q.jsxs)(`div`,{className:f0.titleRow,children:[a?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:Tn,"aria-label":`Back`,onClick:a,"data-component":`SelectPanel.BackButton`}):null,(0,q.jsxs)(`div`,{className:f0.title,"data-has-description":d?``:void 0,"data-has-back":a?``:void 0,children:[(0,q.jsx)(di,{as:`h1`,id:l?`${l}-title`:void 0,className:f0.heading,children:u}),d?(0,q.jsx)(`span`,{id:l?`${l}-description`:void 0,className:f0.description,children:d}):null]})]}),(0,q.jsxs)(`div`,{className:f0.actions,children:[p?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:tr,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:Xn,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),s.searchInput,c]})}m0.displayName=`SelectPanel.Header`;var h0=K(m0);const g0={form:`select-panel-form`,container:`select-panel-container`},_0=W(`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`}}}),v0=W(`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:``}}}),y0={regular:`anchored`,narrow:`full-screen`},b0=t=>e.isValidElement(t)&&t.type===i0,x0=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function S0(t,n){let{className:r,children:i,title:a,description:o,variant:s=y0,selectionVariant:c=`multiple`,id:l,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}=t,x=Y(l),S=e.useRef(null),C=f??S,w=e.useRef(null),T=Gr(n,w),E=e.useRef(null),D=d!==void 0,[O,k]=e.useState(u),A=D?d:O,j=e.useCallback(()=>{D||k(!1)},[D]),M=e.useCallback(()=>{j(),h?.()},[j,h]),N=e.useCallback(()=>g?.(),[g]),P=e.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=e.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=e.useCallback(()=>{c===`instant`&&P()},[c,P]),[L,ee]=e.useState(``),R=e.Children.toArray(i),te=R.find(b0),[z,ne]=si(R.filter(e=>e!==te),{header:h0,footer:c0}),B=te?.props.onClick,re=te?e.cloneElement(te,{ref:C,onClick:e=>{B?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,V={...y0,...typeof s==`string`?{regular:s}:s},ie=V.regular??`anchored`,ae=V.narrow,oe=ie===`anchored`||ae===`anchored`,se=e.useRef(null),[ce,le]=e.useState(null),ue=e.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=Ga(t,e,{side:p,align:m});se.current&&x0(se.current,n)||(se.current=n,le(n))},[C,p,m]);Ur(()=>{if(!A||!oe){se.current=null,le(null);return}ue();let e=new ResizeObserver(ue);return w.current&&e.observe(w.current),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[A,oe,ue]),Ta({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),e.useEffect(()=>{A&&!E.current&&F()},[A,F]),Oa(e=>{A&&(e.preventDefault(),M())});let de=e.useMemo(()=>({panelId:x,title:a,description:o,selectionVariant:c,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,a,o,c,L,M,g,N,F]),fe=e.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:c===`instant`?`single`:c,afterSelect:I,enableFocusZone:!0}),[x,c,I]);return(0,q.jsxs)(q.Fragment,{children:[re,A?(0,q.jsx)(Ba,{children:(0,q.jsx)(`div`,{className:G(_0({variant:ie,narrowVariant:ae})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...ka(`variant`,V),children:(0,q.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":o?`${x}-description`:void 0,className:G(v0({width:v,maxHeight:y,variant:ie,narrowVariant:ae,unplaced:oe&&!ce}),r),style:{"--select-panel-top":`${ce?.top??0}px`,"--select-panel-left":`${ce?.left??0}px`},"data-component":`SelectPanel`,"data-width":v,"data-max-height":y,"data-side":ce?.anchorSide??p,"data-align":ce?.anchorAlign??m,...ka(`variant`,V),...b,children:(0,q.jsx)(`form`,{className:g0.form,onSubmit:P,children:(0,q.jsxs)(a0.Provider,{value:de,children:[z.header??(0,q.jsx)(h0,{}),(0,q.jsx)(`div`,{className:g0.container,children:(0,q.jsx)(gi.Provider,{value:fe,children:ne})}),z.footer]})})})})}):null]})}S0.displayName=`SelectPanel`;var C0=K(S0);const w0={root:`select-panel-loading`,text:`select-panel-loading-text`};function T0(e,t){let{className:n,children:r=`Fetching items...`,...i}=e;return(0,q.jsxs)(`div`,{ref:t,role:`status`,"aria-live":`polite`,className:G(w0.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,q.jsx)(zi,{size:`medium`,srText:null,role:`presentation`}),(0,q.jsx)(`span`,{className:w0.text,children:r})]})}T0.displayName=`SelectPanel.Loading`;var E0=K(T0);const D0={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 O0(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,q.jsxs)(`div`,{ref:t,className:G(D0.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,q.jsx)(jr,{className:G(D0.fullIcon,D0.variant[i]),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:D0.fullTitle,children:o}),(0,q.jsx)(`span`,{className:D0.fullContent,children:r})]}):(0,q.jsxs)(`div`,{ref:t,className:G(D0.inline,D0.variant[i],D0.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,q.jsx)(jr,{className:D0.inlineIcon,"aria-hidden":`true`}),(0,q.jsx)(`div`,{children:r})]})}O0.displayName=`SelectPanel.Message`;var k0=K(O0);const A0={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},j0=e=>{let{id:t,children:n,className:r,...i}=e,a=Y(t);return(0,q.jsxs)(`span`,{className:A0.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,q.jsx)(Gf,{id:a,className:G(A0.box,r),...i}),(0,q.jsx)(`label`,{htmlFor:a,className:A0.small,children:n})]})};function M0(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,q.jsx)(j0,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,q.jsx)(Ul,{className:G(A0.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,q.jsx)($i,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}M0.displayName=`SelectPanel.SecondaryAction`;const N0=Object.assign(C0,{Button:i0,Header:h0,SearchInput:d0,Footer:c0,SecondaryAction:M0,Loading:E0,Message:k0}),P0=W(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function F0(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,variant:a=`default`,...o}=e;return(0,q.jsx)(n,{ref:t,role:`separator`,"aria-orientation":i,className:G(P0({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}F0.displayName=`Separator`;var I0=K(F0);const L0=W(`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`}]}),R0=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function z0(t,n){let{className:r,style:i,size:a=`medium`,orientation:o=`horizontal`,block:s,min:c=0,max:l=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=t,g=d!==void 0,[_,v]=e.useState(()=>f??c),y=g?d:_;return(0,q.jsx)(`input`,{ref:n,type:`range`,min:c,max:l,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:G(L0({size:a,orientation:o,block:s}),r),style:{...i,"--slider-fill":`${R0(y,c,l)}%`},"aria-orientation":o===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":a,"data-orientation":o,"data-block":s,"data-disabled":p,...h})}z0.displayName=`Slider`;var B0=K(z0);const V0={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`},H0={open:null,closed:null,draft:Un,archived:Sn,unavailable:jr,issueOpened:pr,issueClosed:Ln,issueClosedNotPlanned:fr,issueDraft:Un,pullOpened:Fn,pullClosed:Yn,pullMerged:cr,pullQueued:Kn,alertOpened:yr,alertClosed:vr,alertFixed:gr,alertDismissed:_r},U0={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`},W0=W(`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`}}}),G0=W(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function K0(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=H0[i],l=U0[i];return(0,q.jsxs)(n,{ref:t,className:G(W0({size:a,tone:V0[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,q.jsx)(c,{className:G(G0({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}K0.displayName=`StateLabel`;var q0=K(K0);const J0=n({}),Y0={root:`statistic-card-description`};function X0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(Y0.root,n),"data-component":`StatisticCard.Description`,...r})}X0.displayName=`StatisticCard.Description`;var Z0=K(X0);const Q0={root:`statistic-card-label`};function $0(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(J0);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(Q0.root,r),"data-component":`StatisticCard.Label`,...a})}$0.displayName=`StatisticCard.Label`;var e2=K($0);const t2={root:`statistic-card-trailing-visual`};function n2(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(t2.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}n2.displayName=`StatisticCard.TrailingVisual`;var r2=K(n2);const i2={hidden:`sr-only`},a2={increase:Nn,decrease:wn,neutral:br},o2={increase:`Up`,decrease:`Down`,neutral:`No change`},s2={increase:`positive`,decrease:`negative`,neutral:`neutral`},c2=W(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function l2(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=a2[i],c=a??s2[i];return(0,q.jsxs)(`span`,{ref:t,className:G(c2({sentiment:c}),n),"data-component":`StatisticCard.Trend`,"data-direction":i,"data-sentiment":c,...o,children:[(0,q.jsx)(s,{"aria-hidden":!0}),(0,q.jsx)(`span`,{className:i2.hidden,children:o2[i]}),r]})}l2.displayName=`StatisticCard.Trend`;var u2=K(l2);const d2={root:`statistic-card-value`};function f2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(d2.root,n),"data-component":`StatisticCard.Value`,...r})}f2.displayName=`StatisticCard.Value`;var p2=K(f2);const m2={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function h2(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${Y(i)}-label`,[l,u]=si(r,{trailingVisual:r2,label:e2,value:p2,trend:u2,description:Z0}),d=o??(l.label&&!a?c:void 0);return(0,q.jsx)(J0.Provider,{value:{labelId:c},children:(0,q.jsxs)(`div`,{ref:t,id:i,role:d||a?`group`:void 0,"aria-label":a,"aria-labelledby":d,className:G(m2.root,n),"data-component":`StatisticCard`,...s,children:[(0,q.jsxs)(`div`,{className:m2.body,children:[l.label,l.value||l.trend?(0,q.jsxs)(`div`,{className:m2.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}h2.displayName=`StatisticCard`;var g2=K(h2);const _2=Object.assign(g2,{Label:e2,Value:p2,Trend:u2,Description:Z0,TrailingVisual:r2}),v2=n({}),y2={srOnly:`sr-only`},b2=W(`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 x2(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,q.jsx)(v2.Provider,{value:{variant:i,size:a},children:(0,q.jsxs)(n,{ref:t,className:G(b2({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,q.jsx)(`span`,{className:y2.srOnly,children:o}):null,s]})})}x2.displayName=`Status`;var S2=K(x2);const C2=W(`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 w2(t,n){let{className:r,variant:i,size:a,...o}=t,s=e.useContext(v2),c=i??s.variant??`neutral`,l=a??s.size??`medium`;return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(C2({variant:c,size:l}),r),"data-component":`Status.Indicator`,"data-variant":c,"data-size":l,...o})}w2.displayName=`Status.Indicator`;var T2=K(w2);const E2=Object.assign(S2,{Indicator:T2}),D2=n(null),O2=1,k2=W(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),A2=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),j2=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function M2(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=A2(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(k2({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,q.jsx)(D2.Provider,{value:{index:t,status:j2(t,i)},children:e},e.key))})}M2.displayName=`Steps`;var N2=K(M2);const P2={root:`steps-body`};function F2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(P2.root,n),"data-component":`Steps.Body`,...r})}F2.displayName=`Steps.Body`;var I2=K(F2);const L2={root:`steps-description`};function R2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(L2.root,n),"data-component":`Steps.Description`,...r})}R2.displayName=`Steps.Description`;var z2=K(R2);const B2=()=>{let e=o(D2);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},V2={root:`steps-indicator`,icon:`steps-indicator-icon`};function H2(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=B2();return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(V2.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,q.jsx)(Rn,{className:V2.icon}):a+1)})}H2.displayName=`Steps.Indicator`;var U2=K(H2);const W2={root:`steps-item`,status:`sr-only`},G2={complete:`Completed`,current:``,incomplete:`Not completed`};function K2(t,n){let{className:r,children:i,status:a,statusLabel:o,...s}=t,{index:c,status:l}=B2(),u=a??l,d=o??G2[u],f=e.useMemo(()=>({index:c,status:u}),[c,u]);return(0,q.jsx)(D2.Provider,{value:f,children:(0,q.jsxs)(`li`,{ref:n,"aria-current":u===`current`?`step`:void 0,className:G(W2.root,r),"data-component":`Steps.Item`,"data-status":u,"data-index":c,...s,children:[i,d?(0,q.jsx)(`span`,{className:W2.status,children:d}):null]})})}K2.displayName=`Steps.Item`;var q2=K(K2);const J2={root:`steps-title`};function Y2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(J2.root,n),"data-component":`Steps.Title`,...r})}Y2.displayName=`Steps.Title`;var X2=K(Y2);const Z2=Object.assign(N2,{Item:q2,Indicator:U2,Body:I2,Title:X2,Description:z2}),Q2=n({}),$2=W(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function e4(t,n){let{as:r=`span`,className:i,swap:a=!1,transition:o=`fade`,children:s,...c}=t,l=e.useMemo(()=>({swap:a}),[a]);return(0,q.jsx)(Q2.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G($2({transition:o}),i),"data-component":`Swap`,"data-swap":a?`on`:`off`,"data-transition":o,...c,children:s})})}e4.displayName=`Swap`;var t4=K(e4);const n4={root:`swap-indicator`,active:`swap-indicator-active`};function r4(t,n){let{as:r=`span`,className:i,type:a,...o}=t,{swap:s}=e.useContext(Q2),c=a===(s?`on`:`off`);return(0,q.jsx)(r,{ref:n,"aria-hidden":c?void 0:`true`,className:G(n4.root,c&&n4.active,i),"data-component":`Swap.Indicator`,"data-type":a,"data-active":c,...o})}r4.displayName=`Swap.Indicator`;var i4=K(r4);const a4=Object.assign(t4,{Indicator:i4}),o4=n({}),s4=()=>o(o4),c4=n(null),l4=()=>o(c4),u4=e=>typeof document>`u`?null:document.getElementById(e),d4=(e,t={})=>{let{scrollElement:n,behavior:r}=t,i=u4(e);if(!i)return!1;if(!n)return i.scrollIntoView?.({behavior:r,block:`start`}),!0;if(!n.contains(i))return!1;let a=i.getBoundingClientRect(),o=n.getBoundingClientRect(),s=_4(getComputedStyle(n).scrollPaddingBlockStart||getComputedStyle(n).scrollPaddingTop),c=_4(getComputedStyle(i).scrollMarginBlockStart||getComputedStyle(i).scrollMarginTop),l=a.top-o.top+n.scrollTop-s-c;return n.scrollTo({top:l,...r&&{behavior:r}}),!0},f4=e=>{let t=e.getAttribute(`href`);if(!t)return null;let n=new URL(t,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname||n.search!==window.location.search)return null;try{return decodeURIComponent(n.hash.slice(1))||null}catch{return null}},p4=e=>{let t=window.location.href;window.history.pushState(null,``,`#${e}`),window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:t,newURL:window.location.href}))},m4=e=>{if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget;if(t.hasAttribute(`download`))return!1;let n=t.getAttribute(`target`);return n===null||n===``||n===`_self`},h4=e=>e===null||e.x===0&&e.y===0&&e.width===0&&e.height===0,g4=(e,t)=>e!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,_4=e=>{let t=Number.parseFloat(e);return Number.isNaN(t)?0:t},v4=`-20px 0% -40% 0%`,y4=[],b4=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),x4=(t={})=>{let{items:n=y4,activeIds:r,defaultActiveIds:i,onActiveChange:a,rootMargin:o=v4,threshold:s=0,scrollElement:c=null,scrollBehavior:l=`smooth`}=t,u=r!==void 0,[d,f]=e.useState(i??[]),p=u?r:d,m=n.filter(e=>p.includes(e.value)),h=e.useRef({items:n,currentActiveIds:p,onActiveChange:a,isControlled:u});e.useEffect(()=>{h.current={items:n,currentActiveIds:p,onActiveChange:a,isControlled:u}});let g=e.useCallback(e=>{let t=h.current;b4(t.currentActiveIds,e)||(t.isControlled||f(e),t.onActiveChange?.({activeIds:e,activeItems:t.items.filter(t=>e.includes(t.value))}))},[]),_=n.map(e=>e.value).join(),v=Array.isArray(s)?s.join():String(s);return e.useEffect(()=>{let e=h.current.items;if(e.length===0||typeof IntersectionObserver>`u`)return;let t=new Map,n=new IntersectionObserver(e=>{for(let n of e)t.set(n.target.id,n.isIntersecting);let n=h.current.items.filter(e=>t.get(e.value)).map(e=>e.value);n.length!==0&&g(n)},{rootMargin:o,threshold:s,root:c});for(let t of e){let e=u4(t.value);e&&n.observe(e)}return()=>{n.disconnect()}},[_,o,v,c,g]),{items:n,activeIds:p,activeItems:m,setActiveIds:g,scrollTo:(e,t)=>d4(e,{scrollElement:c,behavior:t?.behavior??l}),getItemState:e=>({active:p.includes(e.value),first:e.value===p[0],last:e.value===p[p.length-1],depth:e.depth})}},S4={root:`table-of-contents`};function C4(t,n){let{as:r=`div`,className:i,id:a,items:o,activeIds:s,defaultActiveIds:c,rootMargin:l,threshold:u,scrollElement:d,scrollBehavior:f=`smooth`,autoScroll:p=!0,onActiveChange:m,children:h,...g}=t,_=Y(a),v=e.useMemo(()=>({root:_,title:`${_}-title`,list:`${_}-list`,indicator:`${_}-indicator`,item:e=>`${_}-item-${e}`,link:e=>`${_}-link-${e}`}),[_]),[y,b]=e.useState(null),x=d===void 0?y:d,[S,C]=e.useState(!1),w=x4({items:o,activeIds:s,defaultActiveIds:c,onActiveChange:m,rootMargin:l,threshold:u,scrollElement:x,scrollBehavior:f}),T=w.activeIds[0];e.useEffect(()=>{!p||T===void 0||document.getElementById(v.item(T))?.scrollIntoView?.({behavior:f,block:`nearest`})},[p,T,v,f]);let E={...w,ids:v,scrollElement:x,setScrollElement:b,hasTitle:S,setHasTitle:C};return(0,q.jsx)(o4.Provider,{value:E,children:(0,q.jsx)(r,{ref:n,id:v.root,className:G(S4.root,i),"data-component":`TableOfContents`,...g,children:h})})}C4.displayName=`TableOfContents`;var w4=K(C4);const T4={root:`table-of-contents-content`};function E4(e,t){let{as:n=`article`,className:r,...i}=e,{setScrollElement:a}=s4(),o=Gr(t,a);return(0,q.jsx)(n,{ref:o,className:G(T4.root,r),"data-component":`TableOfContents.Content`,...i})}E4.displayName=`TableOfContents.Content`;var D4=K(E4);const O4={root:`table-of-contents-indicator`},k4=e=>e===void 0?void 0:`${e}px`;function A4(t,n){let{as:r=`div`,className:i,style:a,...o}=t,{ids:s,activeIds:c}=s4(),[l,u]=e.useState(null),d=c?.join()??``;return Ur(()=>{let e=c??[];if(!s||e.length===0){u(null);return}let t=document.getElementById(s.list),n=document.getElementById(s.item(e[0])),r=document.getElementById(s.item(e[e.length-1]));if(!n){u(null);return}let i=()=>{let e=n.getBoundingClientRect(),i=t?.getBoundingClientRect(),a=t&&i?e.left-i.left+t.scrollLeft:0,o=t&&i?e.top-i.top+t.scrollTop:0,s=r&&r!==n?r.getBoundingClientRect().bottom-e.top:e.height,c={x:a,y:o,width:e.width,height:s};u(e=>g4(e,c)?e:c)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),r&&r!==n&&a.observe(r),t&&a.observe(t),()=>{a.disconnect()}},[d,s]),(0,q.jsx)(r,{ref:n,id:s?.indicator,"aria-hidden":`true`,hidden:h4(l),className:G(O4.root,i),style:{...a,"--table-of-contents-indicator-x":k4(l?.x),"--table-of-contents-indicator-y":k4(l?.y),"--table-of-contents-indicator-width":k4(l?.width),"--table-of-contents-indicator-height":k4(l?.height)},"data-component":`TableOfContents.Indicator`,...o})}A4.displayName=`TableOfContents.Indicator`;var j4=K(A4);const M4={root:`table-of-contents-item`};function N4(e,t){let{as:n=`li`,className:r,item:i,style:a,...o}=e,{ids:s,getItemState:c}=s4(),l=c?.(i);return(0,q.jsx)(c4.Provider,{value:i,children:(0,q.jsx)(n,{ref:t,id:s?.item(i.value),className:G(M4.root,r),style:{...a,"--table-of-contents-item-depth":i.depth},"data-component":`TableOfContents.Item`,"data-value":i.value,"data-depth":i.depth,"data-active":l?.active?``:void 0,"data-first":l?.first?``:void 0,"data-last":l?.last?``:void 0,...o})})}N4.displayName=`TableOfContents.Item`;var P4=K(N4);const F4={root:`table-of-contents-link`};function I4(e,t){let{as:n=`a`,className:r,onClick:i,...a}=e,{ids:o,scrollElement:s,scrollTo:c,getItemState:l}=s4(),u=l4(),d=u&&l?.(u);return(0,q.jsx)(n,{ref:t,id:u?o?.link(u.value):void 0,className:G(F4.root,r),"aria-current":d?.active?`location`:void 0,"data-component":`TableOfContents.Link`,"data-value":u?.value,"data-active":d?.active?``:void 0,onClick:e=>{if(i?.(e),e.defaultPrevented||!s||!m4(e))return;let t=f4(e.currentTarget);!t||!c?.(t)||(e.preventDefault(),p4(t))},...a})}I4.displayName=`TableOfContents.Link`;var L4=K(I4);const R4={root:`table-of-contents-list`};function z4(e,t){let{as:n=`ul`,className:r,...i}=e,{ids:a}=s4();return(0,q.jsx)(n,{ref:t,id:a?.list,className:G(R4.root,r),"data-component":`TableOfContents.List`,...i})}z4.displayName=`TableOfContents.List`;var B4=K(z4);const V4={root:`table-of-contents-nav`};function H4(e,t){let{as:n=`nav`,className:r,placement:i,...a}=e,{ids:o,hasTitle:s}=s4();return(0,q.jsx)(n,{ref:t,"aria-labelledby":s?o?.title:void 0,className:G(V4.root,r),"data-component":`TableOfContents.Nav`,"data-placement":i,...a})}H4.displayName=`TableOfContents.Nav`;var U4=K(H4);const W4={root:`table-of-contents-title`};function G4(e,t){let{as:n=`h2`,className:r,...i}=e,{ids:a,setHasTitle:o}=s4();return Ur(()=>(o?.(!0),()=>o?.(!1)),[o]),(0,q.jsx)(n,{ref:t,id:a?.title,className:G(W4.root,r),"data-component":`TableOfContents.Title`,...i})}G4.displayName=`TableOfContents.Title`;var K4=K(G4);const q4=Object.assign(w4,{Root:w4,Content:D4,Nav:U4,Title:K4,List:B4,Item:P4,Link:L4,Indicator:j4}),J4=n(null);function Y4(t){let{children:n,id:r,value:i,defaultValue:a,onChange:o}=t,s=Y(r),c=i!==void 0,[l,u]=e.useState(a),d=c?i:l,f=e.useRef(o);Ur(()=>{f.current=o},[o]);let p=e.useMemo(()=>({groupId:s,selectedValue:d,selectTab:e=>{c||u(e),f.current?.(e)}}),[s,d,c]);return(0,q.jsx)(J4.Provider,{value:p,children:n})}Y4.displayName=`Tabs`;const X4=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},Z4=()=>{let e=o(J4);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},Q4=e=>{let{value:t,disabled:n}=e,r=Z4(),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)}}}},$4={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function e3(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=Q4({value:r,disabled:i});return(0,q.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:X4(a,u.onKeyDown),onMouseDown:X4(o,u.onMouseDown),onFocus:X4(s,u.onFocus),className:G($4.root,$4.vertical,$4.hover,l&&$4.selected,i&&$4.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}e3.displayName=`Tabs.Tab`;var t3=K(e3);const n3=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),r3=t=>{let{"aria-label":n,"aria-labelledby":r,"aria-orientation":i,ref:a}=t,o=e.useRef(null),s=Gr(a,o),c=i??`horizontal`;return{tabListProps:{ref:s,role:`tablist`,"aria-label":n,"aria-labelledby":r,"aria-orientation":c,onKeyDown:e=>{let t=o.current;if(!t)return;let n=c===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,a=e.key===`Home`||e.key===`End`,s=e.key===r?1:e.key===i?-1:0;if(s===0&&!a)return;e.preventDefault(),e.stopPropagation();let l=n3(t);if(l.length===0)return;if(a){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+s+l.length)%l.length].focus()}}}},i3={root:`tab-list`,vertical:`tab-list-vertical`};function a3(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=r3({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,q.jsx)(`div`,{...s,...c,onKeyDown:X4(r,c.onKeyDown),className:G(i3.root,l&&i3.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}a3.displayName=`Tabs.List`;var o3=K(a3);const s3=e=>{let{value:t}=e,n=Z4(),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 c3(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=s3({value:r});return(0,q.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}c3.displayName=`Tabs.Panel`;var l3=K(c3);const u3=Object.assign(Y4,{List:o3,Tab:t3,Panel:l3}),d3={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},f3=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function p3(e,t){let{className:n,clipSidebar:r,...i}=e,a=f3(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(d3.root,(a===`start`||a===`both`)&&d3.clipStart,(a===`end`||a===`both`)&&d3.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}p3.displayName=`Timeline`;var m3=K(p3);const h3={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function g3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(h3.root,h3.narrow,n),"data-component":`Timeline.Actions`,...r})}g3.displayName=`Timeline.Actions`;var _3=K(g3);const v3={root:`timeline-avatar`};function y3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(v3.root,n),"data-component":`Timeline.Avatar`,...r})}y3.displayName=`Timeline.Avatar`;var b3=K(y3);const x3={wrapper:`timeline-badge-wrapper`},S3=W(`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 C3(e,t){let{className:n,variant:r,...i}=e;return(0,q.jsx)(`div`,{className:x3.wrapper,children:(0,q.jsx)(`div`,{ref:t,className:G(S3({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}C3.displayName=`Timeline.Badge`;var w3=K(C3);const T3={root:`timeline-body`};function E3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(T3.root,n),"data-component":`Timeline.Body`,...r})}E3.displayName=`Timeline.Body`;var D3=K(E3);const O3={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function k3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`li`,{ref:t,role:`presentation`,className:G(O3.root,O3.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}k3.displayName=`Timeline.Break`;var A3=K(k3);const j3={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 M3(e,t){let{className:n,condensed:r,...i}=e;return(0,q.jsx)(`li`,{ref:t,className:G(j3.root,j3.rail,j3.narrow,r&&j3.condensed,r&&j3.condensedBadge,r&&j3.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}M3.displayName=`Timeline.Item`;var N3=K(M3);const P3=Object.assign(m3,{Item:N3,Avatar:b3,Badge:w3,Body:D3,Break:A3,Actions:_3}),F3=n({}),I3=()=>o(F3);var L3=Pe(Me(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))}))());Wu.default.extend(L3.default);const R3=e=>{let t=Wu.default.duration(Math.max(e,0));return{days:Math.floor(t.asDays()),hours:Math.floor(t.asHours())%24,minutes:Math.floor(t.asMinutes())%60,seconds:Math.floor(t.asSeconds())%60,milliseconds:Math.floor(t.asMilliseconds())%1e3}},z3=e=>{let t=Wu.default.duration(e);return{days:t.format(`DD`),hours:t.format(`HH`),minutes:t.format(`mm`),seconds:t.format(`ss`),milliseconds:t.format(`SSS`)}},B3=()=>(0,Wu.default)(),V3=1e3,H3=(e,t)=>t>0?Math.floor(e/t)*t:e,U3=(e,t,n,r)=>r?Math.max(t-e,n??0):n===void 0?t+e:Math.min(t+e,n),W3=(t={})=>{let{countdown:n=!1,startMs:r=0,targetMs:i,interval:a=V3,autoStart:o=!1,onTick:s,onComplete:c}=t,[l,u]=e.useState(o?`running`:`idle`),[d,f]=e.useState(0),[p,m]=e.useState(B3),h=n?i??0:i,g=U3(H3(d,a),r,h,n),_=R3(g),v=z3(_),y=h!==void 0&&(n?g<=h:g>=h),b=e.useRef(s),x=e.useRef(c);return e.useEffect(()=>{b.current=s,x.current=c},[s,c]),e.useEffect(()=>{if(l!==`running`)return;let e=window.setInterval(()=>{let e=B3().diff(p),t=U3(H3(e,a),r,h,n),i=R3(t);f(e),b.current?.({value:t,time:i,formattedTime:z3(i)})},a);return()=>{window.clearInterval(e)}},[l,a,p,r,h,n]),e.useEffect(()=>{l!==`running`||!y||(u(`completed`),x.current?.())},[l,y]),{value:g,time:_,formattedTime:v,status:l,running:l===`running`,paused:l===`paused`,completed:l===`completed`,start:()=>{m(B3()),f(0),u(`running`)},pause:()=>{l===`running`&&(f(B3().diff(p)),u(`paused`))},resume:()=>{l===`paused`&&(m(B3().subtract(d,`millisecond`)),u(`running`))},reset:()=>{m(B3()),f(0),u(`idle`)}}},G3={root:`timer`};function K3(e,t){let{as:n=`div`,className:r,countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u,children:d,...f}=e,p=W3({countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u});return(0,q.jsx)(F3.Provider,{value:p,children:(0,q.jsx)(n,{ref:t,className:G(G3.root,r),"data-component":`Timer`,"data-status":p.status,...f,children:d})})}K3.displayName=`Timer`;var q3=K(K3);const J3={root:`timer-action-trigger`},Y3={start:e=>e!==`running`,pause:e=>e===`running`,resume:e=>e===`paused`,reset:e=>e!==`idle`};function X3(t,n){let{className:r,action:i,disabled:a,onClick:o,children:s,...c}=t,l=e.useContext(F3),u=l.status??`idle`,d={start:l.start,pause:l.pause,resume:l.resume,reset:l.reset}[i];return(0,q.jsx)($i,{ref:n,disabled:a??!Y3[i](u),onClick:e=>{o?.(e),!e.defaultPrevented&&d?.()},className:G(J3.root,r),"data-component":`Timer.ActionTrigger`,"data-action":i,...c,children:s})}X3.displayName=`Timer.ActionTrigger`;var Z3=K(X3);const Q3={root:`timer-area`};function $3(t,n){let{as:r=`div`,className:i,...a}=t,{status:o}=e.useContext(F3);return(0,q.jsx)(r,{ref:n,role:`timer`,className:G(Q3.root,i),"data-component":`Timer.Area`,"data-status":o,...a})}$3.displayName=`Timer.Area`;var e6=K($3);const t6={root:`timer-control`};function n6(t,n){let{as:r=`div`,className:i,...a}=t,{status:o}=e.useContext(F3);return(0,q.jsx)(r,{ref:n,className:G(t6.root,i),"data-component":`Timer.Control`,"data-status":o,...a})}n6.displayName=`Timer.Control`;var r6=K(n6);const i6={root:`timer-item`};function a6(t,n){let{as:r=`div`,className:i,type:a,children:o,...s}=t,{formattedTime:c}=e.useContext(F3);return(0,q.jsx)(r,{ref:n,className:G(i6.root,i),"data-component":`Timer.Item`,"data-unit":a,...s,children:o??c?.[a]})}a6.displayName=`Timer.Item`;var o6=K(a6);const s6={root:`timer-separator`};function c6(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(s6.root,r),"data-component":`Timer.Separator`,...i})}c6.displayName=`Timer.Separator`;var l6=K(c6);const u6=Object.assign(q3,{Root:q3,Area:e6,Item:o6,Separator:l6,Control:r6,ActionTrigger:Z3});let d6=[],f6=0;const p6=new Set,m6=()=>{for(let e of p6)e()},h6=e=>(p6.add(e),()=>{p6.delete(e)}),g6=()=>d6,_6=[],v6=()=>_6,y6=e=>(d6=d6.some(t=>t.id===e.id)?d6.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...d6],m6(),e.id),b6=e=>(d6=d6.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),m6(),e),x6=e=>{d6=d6.filter(t=>t.id!==e),m6()},S6=()=>`toast-${++f6}`,C6=(e,t,n={})=>y6({...n,id:n.id??S6(),title:t,variant:e}),w6=(e,t)=>typeof e==`function`?e(t):e,T6=(e,t,n={})=>{let r=n.id??S6();C6(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){b6(r);return}C6(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,w6(t.success,e)),e=>i(`error`,w6(t.error,e))),r},E6=(e,t)=>C6(`default`,e,t),D6=Object.assign(E6,{message:E6,success:(e,t)=>C6(`success`,e,t),error:(e,t)=>C6(`error`,e,t),warning:(e,t)=>C6(`warning`,e,t),info:(e,t)=>C6(`info`,e,t),loading:(e,t)=>C6(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>y6({...t,id:t.id??S6(),variant:`default`,render:e}),promise:T6,dismiss:b6,getToasts:g6}),O6={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`},k6={default:null,success:Ln,error:Qn,warning:jr,info:ir,loading:null},A6=t=>typeof t==`object`&&!!t&&`label`in t&&!e.isValidElement(t);function j6(t){let{toast:n,place:r,position:i,height:a,frontHeight:o,stackSize:s,expanded:c,visible:l,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=t,{id:h,variant:g,title:_,description:v,render:y}=n,b=n.duration??p.duration,x=n.dismissible??p.dismissible,S=n.closeButton??p.closeButton,C=n.richColors??p.richColors,w=n.important??p.important??!1,T=e.useRef(null),[E,D]=e.useState(!1),[O,k]=e.useState({x:0,y:0}),[A,j]=e.useState(!1),[M,N]=e.useState(!1),P=e.useRef(null),F=!!n.dismissed,I=r.index===0,L=E&&!c&&!I,ee=!!y,R=i.startsWith(`top`)?`top`:`bottom`,te=e=>{n.dismissed||(b6(h),e===`timeout`?n.onAutoClose?.(n):n.onDismiss?.(n))};e.useEffect(()=>{D(!0)},[]);let z=e.useRef({revision:-1,time:b});e.useEffect(()=>{if(z.current.revision!==n.revision&&(z.current={revision:n.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),t=window.setTimeout(()=>te(`timeout`),Math.max(z.current.time,0));return()=>{window.clearTimeout(t),z.current.time-=Date.now()-e}},[n,b,u,F]),e.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>x6(h),200);return()=>{window.clearTimeout(e)}},[F,h]),Ur(()=>{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,n.revision,_,v,c]);let ne=e=>d.includes(e),B=(e,t,n)=>e<0?ne(t)?e:0:ne(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))},V=e=>{let t=P.current;!t||t.pointerId!==e.pointerId||k({x:B(e.clientX-t.x,`left`,`right`),y:B(e.clientY-t.y,`top`,`bottom`)})},ie=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),te(`swipe`)},ae=()=>{P.current=null,j(!1),k({x:0,y:0})},oe=c?`calc(var(--toast-lift) * var(--toast-offset))`:`calc(var(--toast-lift) * var(--toaster-gap) * var(--toast-index))`,se=`calc(var(--toast-lift) * -100%)`,ce={"--toast-index":r.index,"--toast-offset":`${r.offset}px`,"--toast-z-index":s-r.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?o:a),"--toast-shift":E?!F||M?oe:I?se:c?`calc(${oe} + ${se})`:oe:se,"--toast-scale":L?Math.max(1-r.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},le=k6[g],ue=n.icon===void 0?f?.[g]:n.icon,de=ue===void 0?g===`loading`?(0,q.jsx)(zi,{size:`small`,srText:null}):le?(0,q.jsx)(le,{}):null:ue,fe=(e,t,n)=>A6(e)?(0,q.jsx)($i,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||te(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,pe=n.action!==void 0||n.cancel!==void 0;return(0,q.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:G(O6.root,O6.lift[R],O6.bridge,R===`top`?O6.bridgeTop:O6.bridgeBottom,x&&O6.grabbable,!ee&&O6.card,!ee&&O6.iconColor[g],!ee&&C&&O6.richColors[g],(!E||F||!l)&&O6.hidden,!l&&O6.waiting,A?O6.dragging:O6.animated,p.className,n.className),style:ce,"data-component":`Toast`,"data-variant":g,"data-position":i,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":c,"data-stacked":L,"data-visible":l,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:V,onPointerUp:ie,onPointerCancel:ae,children:ee?y?.(n):(0,q.jsxs)(`div`,{className:G(O6.body,L&&O6.bodyStacked),"data-component":`Toast.Body`,children:[de===null?null:(0,q.jsx)(`span`,{className:O6.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:de}),(0,q.jsxs)(`div`,{className:O6.content,"data-component":`Toast.Content`,children:[(0,q.jsx)(`div`,{className:O6.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,q.jsx)(`div`,{className:O6.description,"data-component":`Toast.Description`,children:v})]}),pe?(0,q.jsxs)(`div`,{className:O6.actions,"data-component":`Toast.Actions`,children:[fe(n.cancel,`cancel`,`invisible`),fe(n.action,`action`,`default`)]}):null,S&&x?(0,q.jsx)(na,{icon:Xn,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>te(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}j6.displayName=`Toast`;const M6=W(`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`}}}),N6=[`altKey`,`KeyT`],P6=e=>typeof e==`number`?`${e}px`:e,F6=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},I6=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),L6=()=>document.visibilityState===`hidden`,R6=()=>!1;function z6(t,n){let{position:r=`bottom-right`,expand:i=!1,visibleToasts:a=3,toastOptions:o,duration:s=4e3,closeButton:c=!1,richColors:l=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=N6,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=t,x=e.useSyncExternalStore(h6,g6,v6),S=e.useSyncExternalStore(I6,L6,R6),C=e.useRef(null),w=Gr(n,C),[T,E]=e.useState({}),[D,O]=e.useState(!1),k=i||D,A=e.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);e.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=e.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;e.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:s,closeButton:c,richColors:l,dismissible:!0,...o},L=h??F6(r);return(0,q.jsx)(Ba,{children:(0,q.jsx)(`section`,{"aria-label":_,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,tabIndex:-1,"data-component":`Toaster.Region`,children:(0,q.jsx)(`ol`,{ref:w,tabIndex:-1,className:G(M6({position:r}),v),style:{...y,"--toaster-width":P6(p),"--toaster-viewport-offset":P6(d),"--toaster-mobile-offset":P6(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":r,"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,q.jsx)(j6,{toast:e,place:t,position:r,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<a,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}z6.displayName=`Toaster`;var B6=K(z6);const V6=2e3,H6={content:`toggle-switch-content`,srOnly:`sr-only`},U6=`toggle-switch-icon`,W6=W(`toggle-switch`,{variants:{statusLabelPosition:{start:`toggle-switch-label-start`,end:`toggle-switch-label-end`}}}),G6=W(`toggle-switch-status`,{variants:{statusLabelPosition:{start:``,end:`toggle-switch-status-end`}}}),K6=W(`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:``}}}),q6=W(`toggle-switch-status-text`,{variants:{hidden:{true:`toggle-switch-status-text-hidden`,false:``}}}),J6=W(`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`}}}),Y6=W(U6,{variants:{disabled:{true:`toggle-switch-circle-icon-disabled`,false:`toggle-switch-circle-icon`},checked:{true:`translate-x-0`,false:`-translate-x-full`}}}),X6=W(U6,{variants:{disabled:{true:`toggle-switch-line-icon-disabled`,false:`toggle-switch-line-icon`},checked:{true:`translate-x-full`,false:`translate-x-0`}}}),Z6=W(`toggle-switch-knob`,{variants:{checked:{true:`toggle-switch-knob-checked`,false:`translate-x-0`},disabled:{true:`toggle-switch-knob-disabled`,false:``}}}),Q6={small:12,medium:16},$6=({size:e})=>(0,q.jsx)(`svg`,{"aria-hidden":`true`,width:Q6[e],height:Q6[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.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`})}),e8=({size:e})=>(0,q.jsx)(`svg`,{"aria-hidden":`true`,width:Q6[e],height:Q6[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.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 t8(t,n){let{className:r,checked:i,defaultChecked:a,disabled:o,loading:s,onChange:c,onClick:l,size:u=`medium`,statusLabelPosition:d=`start`,buttonType:f=`button`,loadingLabel:p=`Loading`,loadingLabelDelay:m=V6,buttonLabelOn:h=`On`,buttonLabelOff:g=`Off`,"aria-labelledby":_,"aria-describedby":v,...y}=t,b=i!==void 0,[x,S]=e.useState(!!a),C=b?i:x,w=!o&&!s,T=`${Y()}-loading-label`,[E,D]=e.useState(!1);e.useEffect(()=>{if(!s){D(!1);return}let e=window.setTimeout(()=>{D(!0)},m);return()=>{window.clearTimeout(e)}},[s,m]);let O=e=>{w&&(b||S(!C),c?.(!C),l?.(e))},k=[E?T:void 0,v].filter(Boolean).join(` `);return(0,q.jsxs)(`div`,{className:G(W6({statusLabelPosition:d}),r),"data-component":`ToggleSwitch`,"data-size":u,"data-status-label-position":d,"data-checked":C,"data-disabled":!w,"data-loading":s?`true`:void 0,...y,children:[(0,q.jsx)(`span`,{id:T,role:`status`,className:H6.srOnly,children:E?p:``}),s?(0,q.jsx)(`span`,{className:G(G6({statusLabelPosition:d})),"data-component":`ToggleSwitch.LoadingSpinner`,children:(0,q.jsx)(zi,{size:`small`,srText:null,role:`presentation`})}):null,(0,q.jsxs)(`span`,{className:G(K6({size:u,disabled:!w})),"aria-hidden":`true`,onClick:O,"data-component":`ToggleSwitch.StatusText`,children:[(0,q.jsx)(`span`,{className:G(q6({hidden:!C})),children:h}),(0,q.jsx)(`span`,{className:G(q6({hidden:C})),children:g})]}),(0,q.jsxs)(`button`,{ref:n,type:f,className:G(J6({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,q.jsxs)(`span`,{className:H6.content,"aria-hidden":`true`,children:[(0,q.jsx)(`span`,{className:G(Y6({disabled:!w,checked:C})),"data-component":`ToggleSwitch.LineIcon`,children:(0,q.jsx)(e8,{size:u})}),(0,q.jsx)(`span`,{className:G(X6({disabled:!w,checked:C})),"data-component":`ToggleSwitch.CircleIcon`,children:(0,q.jsx)($6,{size:u})})]}),(0,q.jsx)(`span`,{className:G(Z6({checked:C,disabled:!w})),"aria-hidden":`true`,"data-component":`ToggleSwitch.ToggleKnob`})]})]})}t8.displayName=`ToggleSwitch`;var n8=K(t8);const r8=W(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),i8=`medium`,a8=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function o8(e,t){let{as:n=`span`,className:r,size:i=i8,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=a8({as:n,onClick:c.onClick,onFocus:c.onFocus,tabIndex:c.tabIndex,disabled:c.disabled});return(0,q.jsx)(n,{ref:t,onKeyDown:e=>{s?.(e),(e.key===`Backspace`||e.key===`Delete`)&&o?.()},className:G(r8({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})}o8.displayName=`TokenBase`;var s8=K(o8);const c8=W(`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 l8(e){let{className:t,size:n=i8,isParentInteractive:r,...i}=e,a=G(c8({size:n,raised:r}),t);return r?(0,q.jsx)(`span`,{"aria-hidden":`true`,tabIndex:-1,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(Xn,{})}):(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(Xn,{})})}l8.displayName=`Token.RemoveButton`;const u8={root:`token-text`,interactive:`token-text-interactive`};function d8(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(u8.root,i&&u8.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}d8.displayName=`Token.Text`;var f8=K(d8);const p8={srOnly:`sr-only`},m8=W(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),h8=W(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),g8=t=>e.isValidElement(t)?t:(0,q.jsx)(t,{});function _8(e,t){let{as:n,className:r,text:i,size:a=i8,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=a8({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,q.jsxs)(s8,{ref:t,size:a,isSelected:l,onRemove:s,className:G(m8({interactive:p,selected:l,withRemoveButton:m}),r),"data-has-remove-button":m?``:void 0,...h?{}:g,...f,children:[o&&a!==`small`?(0,q.jsx)(`span`,{className:G(h8({size:a})),"data-component":`Token.LeadingVisual`,children:g8(o)}):null,(0,q.jsxs)(f8,{interactive:h,...h?g:{},children:[i,s?(0,q.jsx)(`span`,{className:p8.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,q.jsx)(l8,{size:a,isParentInteractive:p,onClick:_}):null]})}_8.displayName=`Token`;var v8=K(_8);const y8=`#999999`,b8=.6,x8=(e,t,n)=>Math.max(t,Math.min(e,n)),S8=e=>x8(Math.round(e),0,100),C8=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}},w8=({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)}},T8=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,E8=e=>{let t=C8(e)??C8(`#999999`),{h:n,s:r,l:i}=w8(t),a=T8(t),{r:o,g:s,b:c}=t,l=x8(1/(.453-a),0,1),u=x8((a-.96)*100,0,1),d=(b8-a)*100*x8(1/(b8-a),0,1),f=S8(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${S8(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${S8(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}%, ${S8(i+10)}%, 0.3)`}}},D8={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function O8(t,n){let{as:r,className:i,style:a,text:o,size:s=i8,fillColor:c=y8,onRemove:l,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=t,h=e.useMemo(()=>E8(c),[c]),g=a8({as:r,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!l&&!u,v=g&&_,y={as:r,href:f,onClick:p},b=e=>{e.stopPropagation(),l?.()};return(0,q.jsxs)(s8,{ref:n,size:s,isSelected:d,onRemove:l,className:G(D8.root,g&&D8.interactive,d&&D8.selected,_&&D8.withRemoveButton,i),style:{...a,"--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,q.jsxs)(f8,{interactive:v,...v?y:{},children:[o,l?(0,q.jsx)(`span`,{className:D8.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,q.jsx)(l8,{size:s,isParentInteractive:g,onClick:b}):null]})}O8.displayName=`IssueLabelToken`;var k8=K(O8);const A8={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function j8(e,t){let{as:n=`a`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(A8.root,A8.interactive,A8.hover,r),"data-component":`TopicTag`,...i})}j8.displayName=`TopicTag`;var M8=K(j8);const N8={root:`topic-tag-group`};function P8(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(N8.root,r),"data-component":`TopicTag.Group`,...i})}P8.displayName=`TopicTag.Group`;var F8=K(P8);const I8=Object.assign(M8,{Group:F8}),L8=n(null),R8=n(null),z8=4,B8=8,V8=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,H8=e=>e!==null&&e.effect===void 0,U8=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function W8(t){let{steps:n,step:r,defaultStep:i=null,onStepChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,onStatusChange:l,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=t,_=Y(h),v=`${_}-title`,y=`${_}-description`,b=e.useRef(null),x=o!==void 0,[S,C]=e.useState(s),w=x?o:S,T=r!==void 0,[E,D]=e.useState(i),O=T?r:E,k=n.length,A=n.findIndex(e=>e.id===O),j=A===-1?null:n[A],M=e.useCallback(e=>{T||D(e),a?.({stepId:e,stepIndex:n.findIndex(t=>t.id===e),count:n.length})},[T,a,n]),N=e.useCallback(e=>{x||C(e),c?.(e)},[x,c]),P=e.useCallback(e=>{let t=e??n[0]?.id??null;M(t),N(!0),l?.({status:`started`})},[N,M,l,n]),F=e.useCallback(e=>{n.some(t=>t.id===e)&&M(e)},[M,n]),I=e.useCallback(()=>{M(null),N(!1)},[N,M]),L=e.useCallback(()=>{I(),l?.({status:`dismissed`})},[I,l]),ee=e.useCallback(()=>{let e=n[A+1];if(!e){I(),l?.({status:`completed`});return}M(e.id)},[M,I,l,A,n]),R=e.useCallback(()=>{let e=A>0?n[A-1]:void 0;e&&M(e.id)},[M,A,n]),[te,z]=e.useState(()=>({stepId:O,ready:H8(j),patch:null}));te.stepId!==O&&z({stepId:O,ready:H8(j),patch:null});let ne=te.stepId===O?te:null,B=ne?.ready??H8(j),re=ne?.patch??null,V=e.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ie=V8(V),ae=e.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});Ur(()=>{ae.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let oe=e.useMemo(()=>({next:()=>ae.current.next(),prev:()=>ae.current.prev(),goto:e=>ae.current.goto(e),dismiss:()=>ae.current.dismiss(),show:()=>z(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>z(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>ae.current.step?.target?.()??null}),[O]);e.useEffect(()=>{if(w)return ae.current.step?.effect?.(oe)??void 0},[oe,w]);let se=e.useCallback(()=>ae.current.step?.target?.()??null,[]),[ce,le]=e.useState(null),ue=e.useCallback(()=>{let e=se();if(!e){le(null);return}let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),a={top:t,left:n,width:r,height:i};le(e=>e&&U8(e,a)?e:a)},[se]);Ur(()=>{if(!w||!B){le(null);return}ue();let e=se();e?.scrollIntoView?.({block:`center`,inline:`nearest`});let t=new ResizeObserver(ue);return e&&t.observe(e),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[se,ue,w,B,O]),Oa(e=>{!w||!d||(e.preventDefault(),L())}),e.useEffect(()=>{if(!w||!B||!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,B]),e.useEffect(()=>{if(!w||!B||!f)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(b.current?.contains(t)||se()?.contains(t)||L())};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,L,se,w,B]),e.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let de=e.useMemo(()=>({open:w,step:V,stepIndex:A,steps:n,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,V,A,n]),fe=e.useMemo(()=>({...de,titleId:v,descriptionId:y,stepType:ie,ready:B,targetRect:ce,getTarget:se,spotlightOffset:p,spotlightRadius:m,contentRef:b}),[de,y,se,B,p,m,ie,ce,v]);return(0,q.jsx)(L8.Provider,{value:fe,children:g})}W8.displayName=`Tour`;const G8=[];function K8(t){let n=e.useContext(L8);return(0,q.jsx)(q.Fragment,{children:t.children(n?.step?.actions??G8)})}K8.displayName=`Tour.Actions`;const q8={root:`tour-action-trigger`};function J8(t,n){let{action:r,className:i,children:a,onClick:o,variant:s=`default`,...c}=t,l=e.useContext(L8);return l?(0,q.jsx)($i,{ref:n,variant:s,className:G(q8.root,i),onClick:e=>{if(o?.(e),!e.defaultPrevented){if(typeof r.action==`function`){r.action(l);return}r.action===`next`?l.next():r.action===`prev`?l.prev():l.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof r.action==`string`?r.action:`custom`,...c,children:a??r.label}):null}J8.displayName=`Tour.ActionTrigger`;var Y8=K(J8);const X8={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},Z8={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 Q8(t,n){let r=e.useContext(L8),i=e.useContext(R8);if(!r||!i||r.stepType!==`tooltip`||r.step?.arrow===!1)return null;let a=X8[i.side],o=`${a}${Z8[a][i.align]}`;return(0,q.jsx)(qd,{ref:n,location:o,"data-component":`Tour.Arrow`,...t})}Q8.displayName=`Tour.Arrow`;var $8=K(Q8);const e5=W([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function t5(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(L8);if(!s||!s.open||!s.ready||s.step?.backdrop===!1)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Ba,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(e5({spotlit:c!==null}),r),style:{...i,"--tour-target-top":`${(c?.top??0)-l}px`,"--tour-target-left":`${(c?.left??0)-l}px`,"--tour-target-width":`${(c?.width??0)+l*2}px`,"--tour-target-height":`${(c?.height??0)+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":c?``:void 0,...o})})}t5.displayName=`Tour.Backdrop`;var n5=K(t5);const r5={root:`tour-close-trigger`};function i5(t,n){let{className:r,icon:i=Xn,onClick:a,"aria-label":o=`Close tour`,...s}=t,c=e.useContext(L8);return c?(0,q.jsx)(na,{ref:n,icon:i,variant:`invisible`,size:`small`,"aria-label":o,className:G(r5.root,r),onClick:e=>{a?.(e),!e.defaultPrevented&&c.dismiss()},"data-component":`Tour.CloseTrigger`,...s}):null}i5.displayName=`Tour.CloseTrigger`;var a5=K(i5);const o5={root:`tour-content`};function s5(t,n){let{className:r,...i}=t,a=e.useContext(L8),o=Gr(n,a?.contentRef??null),s=a?.step?.id??null,c=a?.ready??!1,l=a?.contentRef;return e.useEffect(()=>{!c||!s||l?.current?.focus()},[l,c,s]),!a||!a.open||!a.ready||!a.step?null:(0,q.jsx)(`div`,{ref:o,role:`dialog`,"aria-labelledby":a.step.title?a.titleId:void 0,"aria-describedby":a.step.description?a.descriptionId:void 0,tabIndex:-1,className:G(o5.root,r),"data-component":`Tour.Content`,"data-type":a.stepType,"data-step":a.step.id,...i})}s5.displayName=`Tour.Content`;var c5=K(s5);const l5={root:`tour-control`};function u5(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(l5.root,n),"data-component":`Tour.Control`,...r})}u5.displayName=`Tour.Control`;var d5=K(u5);const f5={root:`tour-description`};function p5(t,n){let{className:r,children:i,...a}=t,o=e.useContext(L8);return o?(0,q.jsx)(`div`,{ref:n,id:o.descriptionId,className:G(f5.root,r),"data-component":`Tour.Description`,...a,children:i??o.step?.description}):null}p5.displayName=`Tour.Description`;var m5=K(p5);const h5=W([`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:``}}}),g5=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function _5(t,n){let{side:r=`outside-bottom`,align:i=`center`,placement:a=`bottom-end`,portalContainerName:o,className:s,style:c,children:l,...u}=t,d=e.useContext(L8),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??r,g=f?.align??i,_=f?.placement??a,v=!!(d?.open&&d.ready&&f),y=e.useRef(null),b=Gr(n,y),x=e.useRef(null),[S,C]=e.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=e.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=Ga(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&g5(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return Ur(()=>{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,q.jsx)(Ba,{containerName:o,children:(0,q.jsx)(`div`,{ref:b,className:G(h5({type:p,unplaced:m&&!S}),s),style:{...c,"--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,q.jsx)(R8.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:l})})})}_5.displayName=`Tour.Positioner`;var v5=K(_5);const y5={root:`tour-progress-text`};function b5(t,n){let{className:r,children:i,...a}=t,o=e.useContext(L8);return o?(0,q.jsx)(`div`,{ref:n,className:G(y5.root,r),"data-component":`Tour.ProgressText`,...a,children:i??o.progressText}):null}b5.displayName=`Tour.ProgressText`;var x5=K(b5);const S5={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function C5(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(L8);if(!s||!s.open||!s.ready||!s.targetRect)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Ba,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(S5.root,r),style:{...i,"--tour-target-top":`${c.top-l}px`,"--tour-target-left":`${c.left-l}px`,"--tour-target-width":`${c.width+l*2}px`,"--tour-target-height":`${c.height+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...o})})}C5.displayName=`Tour.Spotlight`;var w5=K(C5);const T5={root:`tour-title`};function E5(t,n){let{className:r,children:i,...a}=t,o=e.useContext(L8);return o?(0,q.jsx)(`h2`,{ref:n,id:o.titleId,className:G(T5.root,r),"data-component":`Tour.Title`,...a,children:i??o.step?.title}):null}E5.displayName=`Tour.Title`;var D5=K(E5);const O5=()=>{let e=o(L8);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},k5=(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]},A5=(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()]},j5=(e,t)=>k5(e,t),M5=(e,t,n)=>k5(()=>{let n=e();return n&&n.value===t?n:null},n),N5=Object.assign(W8,{Backdrop:n5,Spotlight:w5,Positioner:v5,Content:c5,Arrow:$8,CloseTrigger:a5,ProgressText:x5,Title:D5,Description:m5,Control:d5,Actions:K8,ActionTrigger:Y8}),P5=125,F5={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function I5(e,t){let{as:n=`div`,className:r,title:i,maxWidth:a=125,inline:o,expandable:s,style:c,...l}=e;return(0,q.jsx)(n,{ref:t,title:i,className:G(F5.root,o?F5.inline:F5.block,s&&F5.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}I5.displayName=`Truncate`;var L5=K(I5);const R5=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=d(e),[a,o]=d(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},z5=n({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),B5=()=>o(z5),V5=(e,t)=>{let{colorScheme:n}=B5();return(n?e[n]:void 0)??t},H5=`day`,U5=`(prefers-color-scheme: dark)`,W5=e=>{let t=window?.matchMedia?.(U5);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},G5=()=>window?.matchMedia?.(U5)?.matches?`night`:`day`,K5=()=>`day`,q5=()=>e.useSyncExternalStore(W5,G5,K5),J5=(e,t)=>e===`auto`?t:e,Y5=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function X5({children:t,className:n,contextOnly:r,...i}){let{colorMode:a,dayScheme:o,nightScheme:s}=B5(),[c,l]=R5(i.colorMode??a??`day`),[u,d]=R5(i.dayScheme??o??`light`),[f,p]=R5(i.nightScheme??s??`dark`),m=q5(),h=J5(c,m),g=Y5(h,u,f),_=e.useMemo(()=>({colorScheme:g,colorMode:c,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:l,setDayScheme:d,setNightScheme:p}),[g,c,h,u,f,l,d,p]);return r?(0,q.jsx)(z5.Provider,{value:_,children:t}):(0,q.jsx)(z5.Provider,{value:_,children:(0,q.jsx)(`div`,{className:n,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":c,children:t})})}X5.displayName=`ThemeProvider`;export{ZY as ARROW_KEY_STEP,Oc as AUTO_LOCALE,Xr as Accordion,hn as AccordionContext,Fr as AccordionHeader,Rr as AccordionItem,Mr as AccordionItemContext,Yr as AccordionPanel,Po as ActionBar,No as ActionBarButton,ao as ActionBarContext,uo as ActionBarDivider,mo as ActionBarGroup,_o as ActionBarIconButton,oo as ActionBarItemContext,So as ActionBarMenu,_a as ActionList,gi as ActionListContainerContext,fi as ActionListContext,wi as ActionListDescription,Ei as ActionListDivider,Fi as ActionListGroup,Di as ActionListGroupContext,Mi as ActionListGroupHeading,hi as ActionListHeading,ma as ActionListItem,Si as ActionListItemContext,Hi as ActionListLeadingVisual,ga as ActionListLinkItem,Ui as ActionListSubItem,aa as ActionListTrailingAction,oa as ActionListTrailingVisual,eo as ActionMenu,ya as ActionMenuAnchor,ba as ActionMenuButton,va as ActionMenuContext,$a as ActionMenuOverlay,Lo as Alert,Za as AnchoredOverlay,Bo as AspectRatio,hs as Attachment,qo as AttachmentAction,Xo as AttachmentActions,$o as AttachmentContent,Vo as AttachmentContext,ns as AttachmentDescription,as as AttachmentGroup,cs as AttachmentMedia,ds as AttachmentTitle,ms as AttachmentTrigger,Ys as Autocomplete,gs as AutocompleteContext,vs as AutocompleteDeferredInputContext,Rs as AutocompleteInput,_s as AutocompleteInputContext,Ws as AutocompleteMenu,Js as AutocompleteOverlay,Wc as Avatar,Zs as AvatarContext,Bc as AvatarFallback,Uc as AvatarImage,$c as AvatarStack,il as Badge,El as Banner,al as BannerContext,sl as BannerDescription,Cl as BannerPrimaryAction,Tl as BannerSecondaryAction,ul as BannerTitle,Yl as Blankslate,Ml as BlankslateDescription,Fl as BlankslateHeading,Bl as BlankslatePrimaryAction,Gl as BlankslateSecondaryAction,Jl as BlankslateVisual,Ql as Blockquote,tu as Box,fu as Breadcrumbs,ru as BreadcrumbsContext,du as BreadcrumbsItem,Ou as Bubble,xu as BubbleContent,mu as BubbleContext,wu as BubbleGroup,hu as BubbleGroupContext,Du as BubbleReactions,$i as Button,Fu as ButtonGroup,Ef as CHART_COLORS,Tf as CHART_OVERFLOW_COLOR,wf as CHART_SERIES_COLORS,gd as Calendar,Ru as CalendarDay,Hd as Card,yd as CardAction,Cd as CardDescription,Ed as CardHeading,kd as CardIcon,Md as CardImage,Fd as CardMetadata,qd as Caret,_f as Carousel,Yd as CarouselContext,lf as CarouselControls,$d as CarouselIndicators,tf as CarouselNextButton,rf as CarouselPlayButton,of as CarouselPreviousButton,ff as CarouselSlide,Xd as CarouselSlideContext,Bf as Chart,vf as ChartContext,Cf as ChartGradient,Pf as ChartLegend,Lf as ChartRadialText,zf as ChartTooltip,Gf as Checkbox,op as CheckboxCard,Kf as CheckboxCardContext,Yf as CheckboxCardDescription,Qf as CheckboxCardLabel,tp as CheckboxCardLeadingVisual,Sp as CheckboxGroup,lp as CheckboxGroupCaption,Vf as CheckboxGroupContext,fp as CheckboxGroupLabel,_p as CheckboxGroupValidation,em as Clipboard,Cp as ClipboardContext,Np as ClipboardControl,Ip as ClipboardCopyText,zp as ClipboardIndicator,Wp as ClipboardInput,qp as ClipboardLabel,Xp as ClipboardTrigger,$p as ClipboardValueText,rm as Code,Em as CodeBlock,hm as CodeBlockCode,ym as CodeBlockContent,im as CodeBlockContext,Sm as CodeBlockHeader,Tm as CodeBlockTitle,Lm as Collapsible,Nm as CollapsibleContent,Nm as CollapsiblePanel,Dm as CollapsibleContext,Im as CollapsibleTrigger,Ih as Combobox,Km as ComboboxClearTrigger,Ym as ComboboxContent,Rm as ComboboxContext,Qm as ComboboxControl,th as ComboboxEmpty,oh as ComboboxInput,uh as ComboboxItem,Bm as ComboboxItemContext,ph as ComboboxItemGroup,zm as ComboboxItemGroupContext,gh as ComboboxItemGroupLabel,yh as ComboboxItemIndicator,Sh as ComboboxItemText,Th as ComboboxLabel,Oh as ComboboxList,Mh as ComboboxPositioner,Fh as ComboboxTrigger,bg as CommandPalette,Bh as CommandPaletteContext,Qh as CommandPaletteDialog,tg as CommandPaletteEmpty,ig as CommandPaletteGroup,Vh as CommandPaletteGroupContext,sg as CommandPaletteInput,ug as CommandPaletteItem,pg as CommandPaletteList,gg as CommandPaletteLoading,yg as CommandPaletteSeparator,r_ as ConfirmationDialog,p_ as ContextMenu,o_ as ContextMenuContext,u_ as ContextMenuOverlay,f_ as ContextMenuTrigger,qi as CounterLabel,Yu as DAYS_IN_WEEK,Xu as DAY_KEY_FORMAT,Qs as DEFAULT_AVATAR_SIZE,H5 as DEFAULT_COLOR_MODE,O2 as DEFAULT_CURRENT_STEP,wc as DEFAULT_DIRECTION,ox as DEFAULT_FLOATING_PANEL_MIN_SIZE,ax as DEFAULT_FLOATING_PANEL_POSITION,ix as DEFAULT_FLOATING_PANEL_SIZE,y8 as DEFAULT_ISSUE_LABEL_FILL_COLOR,nc as DEFAULT_LOCALE,MK as DEFAULT_MAP_LATITUDE,NK as DEFAULT_MAP_LONGITUDE,PK as DEFAULT_MAP_ZOOM,UK as DEFAULT_MARKDOWN_NAMESPACE,mV as DEFAULT_MARKER_COLOR,$K as DEFAULT_MARQUEE_SPEED,xE as DEFAULT_MAX_PREVIEW_ITEMS,T$ as DEFAULT_RATING_COUNT,V$ as DEFAULT_RELATIVE_TIME_PREFIX,B$ as DEFAULT_RELATIVE_TIME_THRESHOLD,M1 as DEFAULT_RICH_TEXT_EDITOR_CONTROLS,S1 as DEFAULT_RICH_TEXT_EDITOR_NAMESPACE,Tv as DEFAULT_SORT_DIRECTION,z8 as DEFAULT_SPOTLIGHT_OFFSET,B8 as DEFAULT_SPOTLIGHT_RADIUS,v4 as DEFAULT_TABLE_OF_CONTENTS_ROOT_MARGIN,J_ as DEFAULT_TABLE_PAGE_SIZE,pv as DEFAULT_TABLE_SKELETON_ROWS,sC as DEFAULT_TEXTAREA_COLS,cC as DEFAULT_TEXTAREA_RESIZE,oC as DEFAULT_TEXTAREA_ROWS,V3 as DEFAULT_TIMER_INTERVAL,V6 as DEFAULT_TOGGLE_SWITCH_LOADING_LABEL_DELAY,i8 as DEFAULT_TOKEN_SIZE,P5 as DEFAULT_TRUNCATE_MAX_WIDTH,zv as DataTable,Wv as DatePicker,Zv as Details,Xv as DetailsSummary,Qv as Dialog,Eg as DialogBody,Og as DialogButtons,Ag as DialogCloseButton,Dg as DialogContext,Ng as DialogFooter,Ig as DialogHeader,zg as DialogSubtitle,Hg as DialogTitle,Tc as DirectionContext,$E as DirectionProvider,dX as DragHandle,Cy as Drawer,ty as DrawerBody,ay as DrawerCloseButton,ny as DrawerContext,cy as DrawerFooter,dy as DrawerHeader,my as DrawerSubtitle,_y as DrawerTitle,Ey as Em,jy as EmptyState,cx as FLOATING_PANEL_LARGE_STEP,sx as FLOATING_PANEL_STEP,BC as FRAME_ROOT_CLASS,pb as FileUpload,Ly as FileUploadContext,By as FileUploadDescription,Uy as FileUploadIcon,fb as FileUploadItem,Ky as FileUploadLabel,Yy as FileUploadList,rx as FilteredActionList,Qb as FilteredActionListBodyLoader,zb as FilteredActionListInput,Hb as FilteredActionListItem,tS as FloatingPanel,Sx as FloatingPanelBody,wx as FloatingPanelCloseTrigger,Ox as FloatingPanelContent,_x as FloatingPanelContext,jx as FloatingPanelControl,Px as FloatingPanelDragTrigger,Lx as FloatingPanelHeader,Bx as FloatingPanelPositioner,Gx as FloatingPanelResizeTrigger,Jx as FloatingPanelStageTrigger,Zx as FloatingPanelTitle,eS as FloatingPanelTrigger,AS as Flow,sS as FlowContext,uS as FlowList,pS as FlowNode,gS as FlowParallel,NC as FormControl,gC as FormControlCaption,Bp as FormControlContext,yC as FormControlLabel,SC as FormControlLeadingVisual,DC as FormControlValidation,FC as FormatByte,LC as FormatNumber,WC as Frame,ew as Header,XC as HeaderItem,$C as HeaderLink,di as Heading,rw as Hidden,uw as Highlight,yw as HoverCard,mw as HoverCardContent,dw as HoverCardContext,hw as HoverCardTrigger,na as IconButton,Sw as Image,Ow as InlineMessage,k8 as IssueLabelToken,qE as JSONTreeView,_E as JSONTreeViewContext,MT as KeybindingHint,XE as Label,sD as LabelGroup,vD as LayerCard,uD as LayerCardPrimary,pD as LayerCardSecondary,Ul as Link,bD as LinkButton,DD as List,ED as ListItem,Ec as LocaleContext,Mc as LocaleProvider,WK as MARKDOWN_NODES,GK as MARKDOWN_TRANSFORMERS,zK as Map,vW as MapAttributionControl,cK as MapDragRotateAndZoomInteraction,eK as MapDrawControl,DW as MapFullScreenControl,PV as MapGraticuleLayer,fW as MapHeatmapLayer,MV as MapImageLayer,DV as MapLayerGroup,rK as MapLayersControl,AK as MapLinkInteraction,xV as MapMarker,IW as MapMousePositionControl,CV as MapOverlay,BW as MapOverviewMapControl,pK as MapPointerInteraction,MW as MapScaleLineControl,aK as MapSearchControl,CK as MapSelectInteraction,OV as MapTileLayer,fK as MapTranslateInteraction,NV as MapVectorLayer,sV as MapView,hW as MapWebGLTileLayer,ow as Mark,JK as Markdown,hq as Marquee,aq as MarqueeContent,YK as MarqueeContext,cq as MarqueeEdge,dq as MarqueeItem,mq as MarqueeViewport,Fq as Message,Sq as MessageAvatar,Tq as MessageContent,pu as MessageContext,Oq as MessageFooter,jq as MessageGroup,gq as MessageGroupContext,Pq as MessageHeader,aJ as Meter,Bq as MeterContext,Uq as MeterIndicator,Kq as MeterLabel,Yq as MeterTrack,Qq as MeterValue,uJ as NativeSelect,sJ as NativeSelectOptGroup,lJ as NativeSelectOption,BJ as NavigationList,SJ as NavigationListGroup,IJ as NavigationListGroupExpand,zJ as NavigationListGroupHeading,fJ as NavigationListHeading,NJ as NavigationListItem,kJ as NavigationListSubNavigation,PY as NavigationMenu,nY as NavigationMenuContent,UJ as NavigationMenuContext,qJ as NavigationMenuDepthContext,iY as NavigationMenuDescription,oY as NavigationMenuDivider,dY as NavigationMenuGroup,cY as NavigationMenuGroupHeading,HJ as NavigationMenuHeading,KJ as NavigationMenuHeadingLevelContext,mY as NavigationMenuItem,WJ as NavigationMenuItemContext,_Y as NavigationMenuLeadingVisual,EY as NavigationMenuLink,GJ as NavigationMenuLinkContext,AY as NavigationMenuList,bY as NavigationMenuSubNavigation,SY as NavigationMenuTrailingVisual,NY as NavigationMenuTrigger,RY as NumberInput,to as OverflowObserverContext,no as OverflowObserverProvider,JX as PINInput,jX as PageLayout,DX as PageLayoutContent,BY as PageLayoutContext,KY as PageLayoutFooter,YY as PageLayoutHeader,AX as PageLayoutPane,vX as PageLayoutSidebar,zX as Pagination,HX as PasswordInput,ZX as Placeholder,bT as PlatformContext,oZ as Popover,aZ as PopoverContent,QX as PopoverContext,Ba as Portal,ja as PortalContext,cb as ProgressBar,ib as ProgressBarItem,uZ as ProgressCircle,JQ as QRCode,C1 as RICH_TEXT_EDITOR_NODES,RS as Radio,l$ as RadioCard,YQ as RadioCardContext,QQ as RadioCardDescription,t$ as RadioCardLabel,i$ as RadioCardLeadingVisual,w$ as RadioGroup,f$ as RadioGroupCaption,FS as RadioGroupContext,h$ as RadioGroupLabel,b$ as RadioGroupValidation,M$ as Rating,i1 as RelativeTime,b1 as Resizable,u1 as ResizablePanel,p1 as ResizableResizeTrigger,g1 as ResizableResizeTriggerIndicator,y1 as ResizableResizeTriggerSeparator,R1 as RichTextEditor,j1 as RichTextEditorContent,L1 as RichTextEditorToolbar,Cs as SCREEN_READER_DELAY,Cg as ScrollableRegion,t0 as SegmentedControl,U1 as SegmentedControlButton,G1 as SegmentedControlIconButton,n0 as Select,zS as SelectContext,US as SelectOptGroup,BS as SelectOptGroupContext,qS as SelectOption,N0 as SelectPanel,i0 as SelectPanelButton,a0 as SelectPanelContext,c0 as SelectPanelFooter,h0 as SelectPanelHeader,E0 as SelectPanelLoading,k0 as SelectPanelMessage,d0 as SelectPanelSearchInput,M0 as SelectPanelSecondaryAction,I0 as Separator,WT as SkeletonAvatar,cv as SkeletonBox,dv as SkeletonText,B0 as Slider,zi as Spinner,Yb as Stack,Jb as StackItem,q0 as StateLabel,_2 as StatisticCard,J0 as StatisticCardContext,Z0 as StatisticCardDescription,e2 as StatisticCardLabel,r2 as StatisticCardTrailingVisual,u2 as StatisticCardTrend,p2 as StatisticCardValue,E2 as Status,T2 as StatusIndicator,Z2 as Steps,I2 as StepsBody,z2 as StepsDescription,U2 as StepsIndicator,q2 as StepsItem,D2 as StepsItemContext,X2 as StepsTitle,a4 as Swap,Q2 as SwapContext,i4 as SwapIndicator,t3 as Tab,o3 as TabList,l3 as TabPanel,Vv as Table,b_ as TableActions,T_ as TableBody,O_ as TableCell,j_ as TableCellPlaceholder,P_ as TableContainer,L_ as TableDivider,z_ as TableErrorDialog,V_ as TableHead,W_ as TableHeader,q4 as TableOfContents,D4 as TableOfContentsContent,o4 as TableOfContentsContext,j4 as TableOfContentsIndicator,P4 as TableOfContentsItem,c4 as TableOfContentsItemContext,L4 as TableOfContentsLink,B4 as TableOfContentsList,U4 as TableOfContentsNav,K4 as TableOfContentsTitle,rv as TablePagination,av as TableRow,hv as TableSkeleton,vv as TableSortHeader,xv as TableSubtitle,wv as TableTitle,u3 as Tabs,J4 as TabsContext,Ss as Text,Ps as TextInput,Ns as TextInputAction,pC as Textarea,z5 as ThemeContext,X5 as ThemeProvider,P3 as Timeline,_3 as TimelineActions,b3 as TimelineAvatar,w3 as TimelineBadge,D3 as TimelineBody,A3 as TimelineBreak,N3 as TimelineItem,u6 as Timer,Z3 as TimerActionTrigger,e6 as TimerArea,F3 as TimerContext,r6 as TimerControl,o6 as TimerItem,l6 as TimerSeparator,B6 as Toaster,n8 as ToggleSwitch,v8 as Token,s8 as TokenBase,l8 as TokenRemoveButton,f8 as TokenText,sE as Tooltip,QT as TooltipContext,I8 as TopicTag,F8 as TopicTagGroup,N5 as Tour,Y8 as TourActionTrigger,K8 as TourActions,$8 as TourArrow,n5 as TourBackdrop,a5 as TourCloseTrigger,c5 as TourContent,L8 as TourContext,d5 as TourControl,m5 as TourDescription,v5 as TourPositioner,R8 as TourPositionerContext,x5 as TourProgressText,w5 as TourSpotlight,D5 as TourTitle,gE as TreeView,rT as TreeViewDirectoryIcon,aT as TreeViewErrorDialog,hE as TreeViewItem,Aw as TreeViewItemContext,VT as TreeViewLeadingAction,HT as TreeViewLeadingVisual,kw as TreeViewRootContext,ZT as TreeViewSubTree,uE as TreeViewTrailingVisual,L5 as Truncate,G_ as buildPaginationModel,K_ as buildPaginationPageData,Lq as clampToRange,zh as commandScore,wS as computeEdges,TS as computeFlowRect,yS as computePositions,rS as connectorPath,Ep as copyText,Bv as createColumnHelper,QY as defaultPaneWidth,bS as entryIds,xS as exitIds,ud as extendRange,Py as formatFileSize,eJ as formatMeterValue,t1 as formatRelativeTime,z3 as formatTime,e1 as formatTitle,yT as getAccessibleKeybindingHintString,dV as getAddress,Ga as getAnchoredPosition,ws as getCharacterCount,nd as getFirstDayOfWeek,E8 as getIssueLabelColors,fV as getLonLat,ad as getMonthWeeks,CT as getPlatform,kf as getProp,ld as getRangePosition,Df as getSeriesColor,rd as getWeekdays,od as isDateSelectable,cd as isDateWithinRange,Fy as isFileAccepted,a8 as isTokenInteractive,KK as markdownTheme,SS as nodeIds,dd as parseDate,Ia as registerPortalRoot,w1 as richTextEditorTheme,d4 as scrollToHeading,jv as sortStrategies,cw as splitHighlightChunks,R3 as splitTime,id as startOfWeek,Rq as stepValue,$u as toDayKey,ME as toJSONNodes,zE as toValueTokens,D6 as toast,Ev as transitionSortDirection,Iy as triageFiles,iX as updateAriaValues,$b as useAnnouncements,Mf as useChart,yf as useChartContext,Dp as useClipboard,wp as useClipboardContext,nD as useClippedChildren,Nc as useCollator,V5 as useColorSchemeVar,a_ as useConfirm,Pc as useDateFormatter,ZE as useDirection,Fc as useFilter,vx as useFloatingPanelContext,Vp as useFormControlForwardedProps,QE as useIsRtl,vE as useJSONTreeViewContext,Dc as useLocaleContext,oV as useMap,ZK as useMarquee,XK as useMarqueeContext,Ic as useNumberFormatter,ro as useOverflowObserver,hX as usePaneWidth,TT as usePlatform,B2 as useStepsItem,Q4 as useTab,r3 as useTabList,s3 as useTabPanel,x4 as useTableOfContents,s4 as useTableOfContentsContext,l4 as useTableOfContentsItemContext,Z4 as useTabs,B5 as useTheme,W3 as useTimer,I3 as useTimerContext,O5 as useTour,$q as valueToPercent,j5 as waitForElement,M5 as waitForElementValue,A5 as waitForEvent};
802
+ }`,uniforms:o,paletteTextures:i.paletteTextures}}var mW=class extends OB{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(AR.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&&!BA(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,pW(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 kH(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()}};mW.prototype.dispose;function hW({name:e,...t}){return EV(()=>new mW(t),e),null}hW.displayName=`MapWebGLTileLayer`;const gW=t=>{let n=oV(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addControl(i),()=>{n.removeControl(i)}},[n,i]),i},_W=(t,n,r)=>{let i=e.useRef(null);if(!i.current){let e=document.createElement(`div`);e.setAttribute(`data-component`,t),i.current=e}let a=i.current;return gW(()=>new ZR({element:a,target:r})),e.useEffect(()=>{a.className=G(`ol-unselectable ol-control`,n)},[a,n]),a};function vW(e){return gW(()=>new QR(e)),null}vW.displayName=`MapAttributionControl`;const yW=[`fullscreenchange`,`webkitfullscreenchange`],bW={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var xW=class extends ZR{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(FD.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(SW(t)){if(CW(t))EW(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?TW(n):wW(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=CW(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(GM(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(bW.ENTERFULLSCREEN)):(GM(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(bW.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(qR.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(qR.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)PD(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();SW(n)?this.element.classList.remove(UN):this.element.classList.add(UN);for(let t=0,r=yW.length;t<r;++t)e.push(MD(n,yW[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function SW(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function CW(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function wW(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function TW(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():wW(e)}function EW(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function DW(e){return gW(()=>new xW(e)),null}DW.displayName=`MapFullScreenControl`;const OW=`units`,kW=[1,2,5],AW=25.4/.28;var jW=class extends ZR{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(OW,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(OW)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(OW,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=NA(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||AW)/AW,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||AW)/AW,c=o*a,l=``;if(r==`degrees`){let e=Pk.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=kW[(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=NA(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||AW;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function MW(e){return gW(()=>new jW(e)),null}MW.displayName=`MapScaleLineControl`;const NW=`projection`,PW=`coordinateFormat`;var FW=class extends ZR{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(NW,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:`&#160;`,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(PW)}getProjection(){return this.get(NW)}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(MD(t,WR.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(MD(t,WR.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(PW,e)}setProjection(e){this.set(NW,MA(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?VA(this.mapProjection_,e):kA}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=GA();e&&(this.transform_=VA(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&jk(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 IW(e){return gW(()=>new FW(e)),null}IW.displayName=`MapMousePositionControl`;const LW=.75,RW=.1;var zW=class extends ZR{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(FD.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new qz({view:e.view,controls:new oO,interactions:new oO});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 Xz({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(MD(e,kD.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===qR.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===qR.TARGET||e.key===qR.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new CR({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(dR.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(dR.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_&&TO(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(HO(r)),s=t.getPixelFromCoordinateInternal(PO(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*RW||l<d*RW||c>u*LW||l>d*LW?this.resetExtent_():_O(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();JO(r,1/(2**(Math.log(LW/RW)/Math.LN2/2)*RW)),i.fitInternal(yM(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_||=ND(this.ovmap_,KR.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(WN),this.collapsed_?GM(this.collapseLabel_,this.label_):GM(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 BW(e){return gW(()=>new zW(e)),null}BW.displayName=`MapOverviewMapControl`;var VW=class e extends Cj{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 xO(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(GO(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||jO(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=Lj(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(_j(n,0,n.length,r,e,t,n)),this.changed()}};VW.prototype.transform;var HW=class e extends Sj{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(PD),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(MD(e[t],FD.CHANGE,this.changed,this))}clone(){let t=new e(UW(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<hO(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){SO(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)DO(e,t[n].getExtent());return e}getGeometries(){return UW(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||=FO(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(UW(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 UW(e){return e.map(e=>e.clone())}function WW(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function GW(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 KW={index:-1,endIndex:NaN,closestTargetDistance:1/0};function qW(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=eG(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=GW(l.coordinates,c);kk(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=QW(e,n,r);QW(e,n,r-t)<i&&(c-=t)}else{let i=QW(e,n,r);QW(e,n,r+t)<i&&(c+=t)}}return KW.index=s,KW.endIndex=c,KW.closestTargetDistance=o,KW}function JW(e,t){let n=[];for(let r=0;r<t.length;++r)YW(e,t[r].getGeometry(),n);return n}function YW(e,t,n){if(t instanceof rN){XW(e,t.getCoordinates(),!1,n);return}if(t instanceof LP){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)XW(e,r[t],!1,n);return}if(t instanceof vM){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)XW(e,r[t],!0,n);return}if(t instanceof BP){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)XW(e,i[t],!0,n)}return}if(t instanceof HW){let r=t.getGeometries();for(let t=0;t<r.length;++t)YW(e,r[t],n);return}}function XW(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=eG(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 ZW(e,t){return nk(e[0],e[1],t[0],t[1])}function QW(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 ZW(GW(e,r),GW(e,i));let s=0;if(r<a){let t=GW(e,r),n=WW(e,a);s+=ZW(t,n)}if(o<i){let t=WW(e,o),n=GW(e,i);s+=ZW(t,n)}for(let t=a;t<o-1;++t){let n=WW(e,t),r=WW(e,t+1);s+=ZW(n,r)}return s}const $W={along:0,squaredDistance:0};function eG(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=ek(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),$W.along=u,$W.squaredDistance=ck(nk(e,t,d,f),10),$W}const tG={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var nG=class extends XD{constructor(e,t){super(e),this.feature=t}},rG=class extends Sz{constructor(e){let t=e;t.stopDown||=KD,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_=aG(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:GD,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 VW([NaN,NaN]),i=qA(e[0],n),a=Ok(i,qA(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=GA();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=cM:e===`LineString`?t=rN:e===`Polygon`&&(t=vM),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 LR({source:new fF({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:iG(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:gz,this.freehandCondition_,this.freehandCondition_=e.freehand?fz:e.freehandCondition?e.freehandCondition:vz,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(nz.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?fz:e:mz,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?fz:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:vz}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===FD.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===UR.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===UR.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===UR.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===UR.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===UR.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===UR.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===UR.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 HR(UR.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=dO([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=JW(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(WW(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(WW(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&kk(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=qW(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=GW(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 cO(new cM(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new cO;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new rN(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=Tj(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 cO(new rN(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new cO,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new nG(tG.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=Tj(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 RP([t])):this.type_===`MultiLineString`?e.setGeometry(new LP([t])):this.type_===`MultiPolygon`&&e.setGeometry(new BP([t])),this.dispatchEvent(new nG(tG.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 nG(tG.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 cO(new cM(n)),this.updateSketchFeatures_(),this.dispatchEvent(new nG(tG.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 iG(){let e=TF();return function(t,n){return e[t.getGeometry().getType()]}}function aG(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 oG=[0,0,0,0],sG=[],cG={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function lG(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 uG=class extends XD{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},dG=class extends Sz{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:xz,this.defaultDeleteCondition_=function(e){return cz(e)&&hz(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:fz,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new sF,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new LR({source:new fF({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:hG(),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:Tk,!(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(OD.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(OD.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(uF.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(uF.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(kD.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?fz:e:mz,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 oO;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 uG(cG.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(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(kD.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(kD.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(dO(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(dO(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(dO(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(dO(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(CO(n),r);let o=t,s=GA();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=bM(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 cO(new cM(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==UR.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=UR.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==UR.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=dO([r]),a=this.rBush_.getInExtent(i),o={};a.sort(fG);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=mG(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&&kk(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=qW(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=GW(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=dO([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=JW(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||UD(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();lG(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(WW(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(WW(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();lG(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=kk(qA(t.getCenter(),n),qA(e,n)),i=GA();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];kk(Ck(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(CO(n),a);let s=t,c=GA();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=bM(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(dO(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 uG(cG.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 pG(e,t,r)-pG(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 cM(KA(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof cO&&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=JA(pO(YA(CO(e,oG),r),t.getView().getResolution()*this.pixelTolerance_,oG),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=mG(e,s,r),u=t.getPixelFromCoordinate(l),d=kk(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=Ok(u,e),o=Ok(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(dO(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(dO(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?KA(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(dO([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=qA(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=UR.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new uG(cG.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(dO(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(dO([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?qA(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||UD(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(OD.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(OD.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(kD.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(uF.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(uF.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(FD.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(kD.PROPERTYCHANGE,this.handleFeatureChange_)}}};function fG(e,t){return e.index-t.index}function pG(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=GA();t&&(i=i.clone().transform(t,n));let r=Ok(i.getCenter(),qA(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=qA(e,n);return sG[0]=qA(t.segment[0],n),sG[1]=qA(t.segment[1],n),Ak(i,sG)}function mG(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=GA();return i&&(t=t.clone().transform(i,n)),KA(t.getClosestPoint(qA(e,n)),n)}let i=qA(e,n);return sG[0]=qA(t.segment[0],n),sG[1]=qA(t.segment[1],n),KA(Ck(i,sG),n)}function hG(){let e=TF();return function(t,n){return e.Point}}const gG={SNAP:`snap`,UNSNAP:`unsnap`};var _G=class extends XD{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const vG={Circle(e,t){let n=e,r=GA();r&&(n=n.clone().transform(r,t));let i=bM(n);return r&&i.transform(t,r),vG.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 yG(e){return e.feature?e.feature:e.element?e.element:null}const bG=[],xG=[],SG=[];var CG=class extends Sz{constructor(e){e||={},super({handleDownEvent:GD,stopDown:KD}),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 sF,this.snapped_=null,this.segmenters_=Object.assign({},vG,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(bO());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];xG[t]=dO(n),SG[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=xG[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!GO(r,xG[o]))continue;let s=Yj(n,t);if(!s)continue;let c=[s];xG[a]=dO(c),SG[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(xG[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=Yj(n,r);if(!i)continue;let s=[i];xG[a]=dO(s),SG[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(xG[0],SG[0]):(xG.length=a,SG.length=a,this.rBush_.load(xG,SG))}}t&&(this.featureChangeListenerKeys_[n]&&PD(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=MD(e,FD.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 _G(gG.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new _G(gG.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new _G(gG.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=yG(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=yG(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);AD(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&&(PD(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(PD),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(PD),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(MD(this.features_,OD.ADD,this.handleFeatureAdd_,this),MD(this.features_,OD.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(MD(this.source_,uF.ADDFEATURE,this.handleFeatureAdd_,this),MD(this.source_,uF.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=qA(t,r),a=JA(pO(dO([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 Ok(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=Ok(i,qA(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=GA();a&&(e=e.clone().transform(a,r)),t=Sk(i,e)}else{let[e,a]=n.segment;a&&(bG[0]=qA(e,r),bG[1]=qA(a,r),t=Ck(i,bG))}if(t){let e=Ok(i,t);e<l&&(c=KA(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)}},wG=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=cO,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?MA(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=MA(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 eO()}readFeature(e,t){return eO()}readFeatures(e,t){return eO()}readGeometry(e,t){return eO()}readProjection(e){return eO()}writeFeature(e,t){return eO()}writeFeatures(e,t){return eO()}writeGeometry(e,t){return eO()}};function TG(e,t,n){let r=n?MA(n.featureProjection):null,i=n?MA(n.dataProjection):null,a=e;if(r&&i&&!BA(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(UA(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 EG={Point:cM,LineString:rN,Polygon:vM,MultiPoint:RP,MultiLineString:LP,MultiPolygon:BP};function DG(e,t,n){return Array.isArray(t[0])?(mM(e,0,t,n)||(e=e.slice(),gM(e,0,t,n)),e):(pM(e,0,t,n)||(e=e.slice(),hM(e,0,t,n)),e)}function OG(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>OG({...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 TG(new HP(r,r===`Polygon`?DG(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function kG(e,t){if(!e)return null;if(Array.isArray(e))return new HW(e.map(e=>kG(e,t)));let n=EG[e.type];return TG(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var AG=class extends wG{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(jG(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(jG(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return eO()}readFeaturesFromObject(e,t){return eO()}readGeometry(e,t){return this.readGeometryFromObject(jG(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return eO()}readProjection(e){return this.readProjectionFromObject(jG(e))}readProjectionFromObject(e){return eO()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return eO()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return eO()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return eO()}};function jG(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var MG=class extends AG{constructor(e){e||={},super(),this.dataProjection=MA(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=MA(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=NG(n.geometry,t);if(this.featureClass===HP)return OG({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(kG(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 PG(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=MA(t.properties.name);else if(t.type===`EPSG`)n=MA(`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=HG(a,t),delete i[e.getGeometryName()]),jD(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 HG(e,this.adaptOptions(t))}};function NG(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=IG(e);break;case`LineString`:n=LG(e);break;case`Polygon`:n=VG(e);break;case`MultiPoint`:n=zG(e);break;case`MultiLineString`:n=RG(e);break;case`MultiPolygon`:n=BG(e);break;case`GeometryCollection`:n=FG(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function PG(e,t){return kG(NG(e,t),t)}function FG(e,t){return e.geometries.map(function(e){return NG(e,t)})}function IG(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:wj(t.length)}}function LG(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:wj(t[0]?.length||2)}}function RG(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:zj(r,0,t,n),layout:wj(n)}}function zG(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:wj(t[0]?.length||2)}}function BG(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:Bj(n,0,t,r),layout:wj(r)}}function VG(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:zj(n,0,t,r),layout:wj(r)}}function HG(e,t){e=TG(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=JG(e,t);break;case`LineString`:r=WG(e,t);break;case`Polygon`:r=YG(e,t);break;case`MultiPoint`:r=KG(e,t);break;case`MultiLineString`:r=GG(e,t);break;case`MultiPolygon`:r=qG(e,t);break;case`GeometryCollection`:r=UG(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function UG(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return HG(e,t)})}}function WG(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function GG(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function KG(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function qG(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function JG(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function YG(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const XG={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},ZG={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},QG={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},$G=[{shape:`Point`,label:`Draw a point`,Icon:Gn},{shape:`LineString`,label:`Draw a line`,Icon:or},{shape:`Circle`,label:`Draw a circle`,Icon:Wn}];function eK({target:t,className:n,fileName:r=`react-openlayers-geojson.json`}){let i=oV(),a=_W(`MapDrawControl`,G(XG.root,n),t),[o,s]=e.useState(!1),[c,l]=e.useState(null),u=e.useRef(null),d=e.useRef(null);if(!u.current){let e=new fF;u.current={source:e,layer:new LR({source:e,style:ZG,properties:{key:`drawLayer`}}),modify:new dG({source:e})}}let f=u.current,p=e.useCallback(()=>{let e=f.source.getFeatures(),t=new MG().writeFeaturesObject(e,QG),n=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,a.click(),URL.revokeObjectURL(i)},[f,r]);e.useEffect(()=>{if(!(!i||!o))return i.addLayer(f.layer),i.addInteraction(f.modify),()=>{i.removeInteraction(f.modify),i.removeLayer(f.layer)}},[i,o,f]),e.useEffect(()=>{if(!i||!o||!c)return;let e=c===`LineString`?new rG({source:f.source,type:c,maxPoints:2}):new rG({source:f.source,type:c}),t=new CG({source:f.source});return d.current=e,i.addInteraction(e),i.addInteraction(t),()=>{i.removeInteraction(t),i.removeInteraction(e),d.current=null}},[i,o,c,f]),e.useEffect(()=>{if(!i||!o)return;let e=i.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?d.current?.abortDrawing():e.shiftKey&&e.key===`S`&&p()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,o,p]);let h=()=>{s(e=>!e),l(null)},g=e=>{l(t=>t===e?null:e)};return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:XG.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":o,onClick:h,children:(0,q.jsx)(hr,{size:12})}),o?(0,q.jsxs)(`div`,{className:XG.shapes,children:[$G.map(({shape:e,label:t,Icon:n})=>(0,q.jsx)(`button`,{type:`button`,className:XG.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":c===e,onClick:()=>g(e),children:(0,q.jsx)(n,{size:12})},e)),(0,q.jsx)(`button`,{type:`button`,className:XG.shape,title:`Move and reshape what has been drawn`,"aria-pressed":c===null,onClick:()=>g(null),children:(0,q.jsx)(On,{size:12})})]}):null]}),a)}eK.displayName=`MapDrawControl`;const tK={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},nK=(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 Vz?nK(e.getLayers().getArray(),`${r}.`):[]}});function rK({target:t,className:n}){let r=oV(),i=_W(`MapLayersControl`,G(tK.root,n),t),[a,o]=e.useState(!1),[s,c]=e.useState(0),l=e.useMemo(()=>r&&a?nK(r.getLayers().getArray(),``):[],[r,a,s]),u=(e,t)=>{e.setVisible(t),c(e=>e+1)},d=e=>(0,q.jsx)(`ul`,{className:tK.list,children:e.map(e=>(0,q.jsxs)(`li`,{className:tK.item,children:[(0,q.jsxs)(`label`,{className:tK.label,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.layer.getVisible(),onChange:t=>u(e.layer,t.target.checked)}),e.name]}),e.children.length>0?d(e.children):null]},e.key))});return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:tK.toggle,title:`Click here to switch layers`,"aria-expanded":a,onClick:()=>o(e=>!e),children:(0,q.jsx)(ar,{size:24})}),a?(0,q.jsx)(`div`,{className:tK.layers,children:d(l)}):null]}),i)}rK.displayName=`MapLayersControl`;const iK={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function aK({target:t,className:n,zoom:r=18,color:i=mV,placeholder:a=`Search for a place`}){let o=oV(),s=_W(`MapSearchControl`,G(iK.root,n),t),[c,l]=e.useState(!1),[u,d]=e.useState(``);return m((0,q.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!o||!u)return;let[t]=await fV(u,1);if(!t)return;let n=[Number(t.lon),Number(t.lat)];_V(o,n,i).set(`address`,t.display_name),o.getView().setCenter(RA(n)),o.getView().setZoom(r)},children:[(0,q.jsx)(`button`,{type:`button`,className:iK.toggle,title:a,"aria-expanded":c,onClick:()=>l(e=>!e),children:(0,q.jsx)(mr,{size:24})}),c?(0,q.jsx)(`input`,{type:`search`,className:iK.input,value:u,placeholder:a,"aria-label":a,autoComplete:`off`,onChange:e=>d(e.target.value)}):null]}),s)}aK.displayName=`MapSearchControl`;const oK=t=>{let n=oV(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addInteraction(i),()=>{n.removeInteraction(i)}},[n,i]),i};var sK=class extends Sz{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:vz,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!bz(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(!bz(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 bz(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function cK(e){return oK(()=>new sK(e)),null}cK.displayName=`MapDragRotateAndZoomInteraction`;const lK={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var uK=class extends XD{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},dK=class extends Sz{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=GD;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:GD,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:fz,this.lastFeature_=null,this.addChangeListener(nz.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 oO([this.lastFeature_]);return this.dispatchEvent(new uK(lK.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 oO([this.lastFeature_]);return this.dispatchEvent(new uK(lK.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=qA(t,n),i=qA(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new oO([this.lastFeature_]),c=GA();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 uK(lK.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 cO)||!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 fK(e){return oK(()=>new dK(e)),null}fK.displayName=`MapTranslateInteraction`;function pK(t){let n=e.useRef(null),r=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return t instanceof cO&&(n.current={feature:t,coordinate:e.coordinate},!0)},i=e=>{let t=n.current;if(!t)return;let r=t.feature.getGeometry();r&&(r.translate(e.coordinate[0]-t.coordinate[0],e.coordinate[1]-t.coordinate[1]),t.coordinate=e.coordinate)},a=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},o=()=>(n.current=null,!1);return oK(()=>new Sz({handleDownEvent:r,handleDragEvent:i,handleMoveEvent:a,handleUpEvent:o,...t})),null}pK.displayName=`MapPointerInteraction`;const mK={SELECT:`select`};var hK=class extends XD{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const gK={};var _K=class e extends rz{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:hz,this.addCondition_=e.addCondition?e.addCondition:mz,this.removeCondition_=e.removeCondition?e.removeCondition:mz,this.toggleCondition_=e.toggleCondition?e.toggleCondition:vz,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:GD,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?vK():e.style,this.features_=e.features||new oO;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=GD;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(OD.ADD,this.boundAddFeature_),this.features_.addEventListener(OD.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(OD.ADD,this.boundAddFeature_),this.features_.removeEventListener(OD.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 LR&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in gK||(gK[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(gK[r]),delete gK[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 hK(mK.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 hK(mK.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 hK(mK.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 cO)||!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 cO)||!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 hK(mK.SELECT,c,s,e)),!0}};function vK(){let e=TF();return HD(e.Polygon,e.LineString),HD(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const yK=`#ff0000`,bK=`rgba(255, 0, 0, 0.4)`,xK=e=>new DF({text:e,font:`12px Calibri,sans-serif`,fill:new pF({color:`#000`}),stroke:new mF({color:`#fff`,width:3}),offsetY:-10}),SK=e=>{let t=e.getGeometry();if(!(t instanceof Sj))return;let n=t.getType();if(n===`Point`)return new xF({image:new bF({radius:6,fill:new pF({color:bK}),stroke:new mF({color:yK,width:2})})});if(n===`LineString`){let e=new xF({stroke:new mF({color:yK,width:3})}),n=mk(t)/1e3;return n>0&&e.setText(xK(`Length: ${n.toFixed(2)} km`)),e}let r=new xF({fill:new pF({color:bK}),stroke:new mF({color:yK,width:2})});try{let e=gk(t)/1e6;e>0&&r.setText(xK(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function CK({onSelect:t,style:n=SK,...r}){let i=oV(),a=oK(()=>new _K({...r,style:n})),o=e.useRef(t);return e.useEffect(()=>{o.current=t},[t]),e.useEffect(()=>{let e=a.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&o.current?.(e)});return()=>$D(e)},[a]),e.useEffect(()=>{if(!i)return;let e=i.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=a.getFeatures();t.forEach(e=>{a.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,a]),null}CK.displayName=`MapSelectInteraction`;function wK(e){return ck(e,5)}function TK(e){return parseFloat(e)}function EK(e){return wK(e).toString()}function DK(e,t){return!isNaN(e)&&e!==TK(EK(t))}function OK(e,t){return DK(e[0],t[0])||DK(e[1],t[1])}var kK=class extends rz{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(MD(e,KR.MOVEEND,this.updateUrl_,this),MD(e.getLayerGroup(),FD.CHANGE,this.updateUrl_,this),MD(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)PD(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=TK(this.get_(e,`z`));`z`in this.params_&&DK(a,n.getZoom())&&(r=!0,i.zoom=a);let o=TK(this.get_(e,`r`));`r`in this.params_&&DK(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[TK(this.get_(e,`x`)),TK(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&OK(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`,EK(n[0])),this.set_(c,`y`,EK(n[1])),this.set_(c,`z`,EK(r)),this.set_(c,`r`,EK(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 AK(e){return oK(()=>new kK(e)),null}AK.displayName=`MapLinkInteraction`;const jK={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},MK=37.7649804,NK=-122.4323829,PK=16,FK=[];function IK({latitude:t,longitude:n,zoom:r,marker:i,markerColor:a,markerLabel:o}){let s=oV(),c=e.useRef(!1);return e.useEffect(()=>{if(!s)return;let e=s.getView(),i=RA([n,t]);if(c.current){e.animate({center:i,zoom:r,duration:500});return}c.current=!0,e.setCenter(i),e.setZoom(r)},[s,t,n,r]),e.useEffect(()=>{if(!s||!i)return;let e=_V(s,[n,t],a,o);return()=>vV(s,e)},[s,t,n,i,a,o]),null}IK.displayName=`MapLocation`;function LK(t,n){let{latitude:r=MK,longitude:i=NK,zoom:a=16,width:o,height:s,controls:c=FK,marker:l=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=t,y=Y(f),b=e.useRef(null),x=Gr(n,b),S=e.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=jK.toolbar,S.current=e}let C=S.current;e.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,q.jsx)(MW,{},e);case`fullScreen`:return(0,q.jsx)(DW,{target:C,source:y},e);case`search`:return(0,q.jsx)(aK,{target:C},e);case`layers`:return(0,q.jsx)(rK,{target:C},e);case`draw`:return(0,q.jsx)(eK,{target:C},e)}};return(0,q.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:G(jK.root,p),style:{...m,"--map-width":typeof o==`number`?`${o}px`:o,"--map-height":typeof s==`number`?`${s}px`:s},"data-component":`Map`,...v,children:(0,q.jsxs)(aV,{className:jK.surface,keyboardEventTarget:y,children:[(0,q.jsx)(IK,{latitude:r,longitude:i,zoom:a,marker:l,markerColor:u,markerLabel:d}),c.map(T),h]})})}LK.displayName=`Map`;var RK=K(LK);const zK=Object.assign(RK,{View:sV,Marker:xV,Overlay:CV,LayerGroup:DV,TileLayer:OV,ImageLayer:MV,VectorLayer:NV,GraticuleLayer:PV,HeatmapLayer:fW,WebGLTileLayer:hW,AttributionControl:vW,DrawControl:eK,FullScreenControl:DW,LayersControl:rK,MousePositionControl:IW,OverviewMapControl:BW,ScaleLineControl:MW,SearchControl:aK,DragRotateAndZoomInteraction:cK,LinkInteraction:AK,PointerInteraction:pK,SelectInteraction:CK,TranslateInteraction:fK}),BK={root:`markdown`};function VK(t,n){let{className:r,source:i,transformers:a,preserveNewLines:o=!1,...s}=t,[c]=E(),l=e.useCallback(e=>{c.setRootElement(e)},[c]),u=Gr(n,l);return Ur(()=>{c.update(()=>{C(i,a,void 0,o)},{discrete:!0})},[c,i,a,o]),(0,q.jsx)(`div`,{ref:u,className:G(BK.root,r),"data-component":`Markdown`,...s})}VK.displayName=`MarkdownProse`;var HK=K(VK);const UK=`Markdown`,WK=[B,re,L,I,j,O,D],GK=[w,...T],KK={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 qK(e,t){let{className:n,children:r=``,transformers:i=GK,preserveNewLines:a=!1,namespace:o=UK,onError:s,...c}=e;return(0,q.jsx)(S,{initialConfig:{namespace:o,theme:KK,nodes:WK,editable:!1,onError:s??(e=>{throw e})},children:(0,q.jsx)(HK,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}qK.displayName=`Markdown`;var JK=K(qK);const YK=n({}),XK=()=>o(YK),ZK=(t={})=>{let{paused:n,defaultPaused:r,onPauseChange:i}=t,a=n!==void 0,[o,s]=e.useState(r??!1),c=a?n:o,l=e=>{e!==c&&(a||s(e),i?.(e))};return{paused:c,pause:()=>l(!0),resume:()=>l(!1),toggle:()=>l(!c),setPaused:l}},QK={root:`marquee`},$K=50,eq=e=>e===`top`||e===`bottom`;function tq(t,n){let{as:r=`div`,className:i,side:a=`start`,speed:o=50,delay:s=0,loopCount:c=0,autoFill:l=!1,spacing:u,reverse:d=!1,paused:f,defaultPaused:p,pauseOnInteraction:m=!0,onPauseChange:h,onLoopComplete:g,onComplete:_,children:v,...y}=t,b=ZK({paused:f,defaultPaused:p,onPauseChange:h}),x=eq(a),S=e.useRef(null),C=e.useRef(null),[w,T]=e.useState(0),[E,D]=e.useState(0);Ur(()=>{let e=S.current,t=C.current;if(e===null||t===null)return;let n=()=>{let n=x?e.clientHeight:e.clientWidth,r=x?t.offsetHeight:t.offsetWidth;T(e=>e===n?e:n),D(e=>e===r?e:r)};n();let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[x]);let O=l&&E>0?Math.max(Math.ceil(w/E)+1,2):2,k=E>0&&o>0?E/o:0,{style:A,onMouseEnter:j,onMouseLeave:M,onFocus:N,onBlur:P,...F}=y,[I,L]=e.useState(!1),ee=e=>{j?.(e),m&&L(!0)},R=e=>{M?.(e),L(!1)},te=e=>{N?.(e),m&&L(!0)},z=e=>{P?.(e),e.currentTarget.contains(e.relatedTarget)||L(!1)},ne=b.paused||I,B={...b,side:a,orientation:x?`vertical`:`horizontal`,copyCount:O,viewportRef:S,copyRef:C,onLoopComplete:g,onComplete:_};return(0,q.jsx)(YK.Provider,{value:B,children:(0,q.jsx)(r,{ref:n,className:G(QK.root,i),style:{...A,"--marquee-duration":`${k}s`,"--marquee-delay":`${s}ms`,"--marquee-loop-count":c>0?`${c}`:`infinite`,...u===void 0?null:{"--marquee-spacing":u}},onMouseEnter:ee,onMouseLeave:R,onFocus:te,onBlur:z,"data-component":`Marquee`,"data-orientation":x?`vertical`:`horizontal`,"data-side":a,"data-reverse":d||void 0,"data-paused":ne||void 0,"data-running":E>0||void 0,...F,children:v})})}tq.displayName=`Marquee`;var nq=K(tq);const rq={root:`marquee-content`};function iq(t,n){let{as:r=`div`,className:i,children:a,...o}=t,{copyCount:s=1,copyRef:c,onLoopComplete:l,onComplete:u}=e.useContext(YK),d=Gr(n,c),f=e.useRef(0),p=e=>e.target===e.currentTarget,m=e=>{p(e)&&(f.current+=1,l?.(f.current))},h=e=>{p(e)&&(f.current+=1,l?.(f.current),u?.())};return(0,q.jsx)(q.Fragment,{children:Array.from({length:s},(e,t)=>{let n=t===0;return(0,q.jsx)(r,{ref:n?d:void 0,className:G(rq.root,i),"aria-hidden":!n||void 0,inert:!n,onAnimationIteration:n?m:void 0,onAnimationEnd:n?h:void 0,"data-component":`Marquee.Content`,...o,children:a},t)})})}iq.displayName=`Marquee.Content`;var aq=K(iq);const oq={root:`marquee-edge`};function sq(e,t){let{as:n=`div`,className:r,side:i,...a}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(oq.root,r),"data-component":`Marquee.Edge`,"data-side":i,...a})}sq.displayName=`Marquee.Edge`;var cq=K(sq);const lq={root:`marquee-item`};function uq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(lq.root,r),"data-component":`Marquee.Item`,...i})}uq.displayName=`Marquee.Item`;var dq=K(uq);const fq={root:`marquee-viewport`};function pq(t,n){let{as:r=`div`,className:i,...a}=t,{viewportRef:o}=e.useContext(YK),s=Gr(n,o);return(0,q.jsx)(r,{ref:s,className:G(fq.root,i),"data-component":`Marquee.Viewport`,...a})}pq.displayName=`Marquee.Viewport`;var mq=K(pq);const hq=Object.assign(nq,{Root:nq,Viewport:mq,Content:aq,Item:dq,Edge:cq}),gq=n({}),_q=W(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function vq(t,n){let{as:r=`div`,className:i,align:a,...o}=t,{align:s}=e.useContext(gq),c=a??s??`start`,l={align:c};return(0,q.jsx)(pu.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G(_q({align:c}),i),"data-component":`Message`,"data-align":c,...o})})}vq.displayName=`Message`;var yq=K(vq);const bq={root:`message-avatar`};function xq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(bq.root,r),"data-component":`Message.Avatar`,...i})}xq.displayName=`Message.Avatar`;var Sq=K(xq);const Cq={root:`message-content`};function wq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Cq.root,r),"data-component":`Message.Content`,...i})}wq.displayName=`Message.Content`;var Tq=K(wq);const Eq={root:`message-footer`};function Dq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Eq.root,r),"data-component":`Message.Footer`,...i})}Dq.displayName=`Message.Footer`;var Oq=K(Dq);const kq={root:`message-group`};function Aq(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,q.jsx)(gq.Provider,{value:{align:i},children:(0,q.jsx)(n,{ref:t,className:G(kq.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}Aq.displayName=`Message.Group`;var jq=K(Aq);const Mq={root:`message-header`};function Nq(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Mq.root,r),"data-component":`Message.Header`,...i})}Nq.displayName=`Message.Header`;var Pq=K(Nq);const Fq=Object.assign(yq,{Group:jq,Avatar:Sq,Content:Tq,Header:Pq,Footer:Oq}),Iq=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},Lq=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,Rq=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return Lq(r??0,r,i);let a=e+t*n,o=Math.max(Iq(n),Iq(e)),s=o===0?a:Number(a.toFixed(o));return Lq(s,r,i)},zq=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},Bq=n({}),Vq={root:`meter-indicator`};function Hq(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(Vq.root,r),"data-component":`Meter.Indicator`,...i})}Hq.displayName=`Meter.Indicator`;var Uq=K(Hq);const Wq={root:`meter-label`};function Gq(t,n){let{as:r=`span`,className:i,id:a,...o}=t,{labelId:s}=e.useContext(Bq);return(0,q.jsx)(r,{ref:n,id:a??s,className:G(Wq.root,i),"data-component":`Meter.Label`,...o})}Gq.displayName=`Meter.Label`;var Kq=K(Gq);const qq={root:`meter-track`};function Jq(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(qq.root,r),"data-component":`Meter.Track`,...i})}Jq.displayName=`Meter.Track`;var Yq=K(Jq);const Xq={root:`meter-value`};function Zq(t,n){let{className:r,children:i,...a}=t,{formattedValue:o=``,value:s=0}=e.useContext(Bq);return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(Xq.root,r),"data-component":`Meter.Value`,...a,children:typeof i==`function`?i({formattedValue:o,value:s}):i??o})}Zq.displayName=`Meter.Value`;var Qq=K(Zq);const $q=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,eJ=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),tJ={header:`meter-header`,hidden:`sr-only`},nJ=W(`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 rJ(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,_=`${Y(p)}-label`,[v,y]=si(f,{label:Kq,value:Qq,track:Yq}),b=Lq(Number.isNaN(a)?o:a,o,s),x=Lq($q(b,o,s),0,100),S=eJ(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,q.jsx)(Bq.Provider,{value:T,children:(0,q.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:G(nJ({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,q.jsxs)(`span`,{className:tJ.header,children:[v.label,v.value]}):null,v.track??(0,q.jsx)(Yq,{children:(0,q.jsx)(Uq,{})}),y,(0,q.jsx)(`span`,{role:`presentation`,className:tJ.hidden,children:`x`})]})})}rJ.displayName=`Meter`;var iJ=K(rJ);const aJ=Object.assign(iJ,{Label:Kq,Value:Qq,Track:Yq,Indicator:Uq});function oJ(e,t){return(0,q.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}oJ.displayName=`NativeSelect.OptGroup`;var sJ=K(oJ);function cJ(e,t){return(0,q.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}cJ.displayName=`NativeSelect.Option`;var lJ=K(cJ);const uJ=Object.assign(PS,{Option:lJ,OptGroup:sJ}),dJ={root:`navigation-list-heading`,hidden:`sr-only`};function fJ(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?dJ.hidden:dJ.root,r),"data-component":`NavigationList.Heading`,...i})}fJ.displayName=`NavigationList.Heading`;const pJ=e.createContext(null),mJ=e.createContext({depth:0}),hJ=e.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),gJ=e=>Number.parseInt(e.slice(1),10),_J=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},vJ={heading:fJ},yJ={container:`NavigationList`};function bJ(t,n){let{children:r,className:i,"aria-label":a,"aria-labelledby":o,...s}=t,[c,l]=si(r,vJ),u=Y(),d=c.heading,f=d?d.props.id??u:void 0,p=d?gJ(d.props.as??`h2`):null;return(0,q.jsx)(`nav`,{ref:n,"aria-label":a,"aria-labelledby":o??(a?void 0:f),className:G(i),"data-component":`NavigationList`,...s,children:(0,q.jsxs)(pJ.Provider,{value:p,children:[d?e.cloneElement(d,{id:f}):null,(0,q.jsx)(gi.Provider,{value:yJ,children:(0,q.jsx)(_a,{children:l})})]})})}bJ.displayName=`NavigationList`;var xJ=e.forwardRef(bJ);function SJ(t){let{title:n,children:r,hideDivider:i=!1,...a}=t,o=e.useContext(pJ);return(0,q.jsxs)(q.Fragment,{children:[i?null:(0,q.jsx)(_a.Divider,{}),(0,q.jsxs)(_a.Group,{"data-component":`NavigationList.Group`,...a,children:[n?(0,q.jsx)(_a.GroupHeading,{as:_J(o),children:n}):null,r]})]})}SJ.displayName=`NavigationList.Group`;const CJ={chevron:`navigation-list-chevron`},wJ={trailingVisual:_a.TrailingVisual},TJ=t=>{if(!e.isValidElement(t))return!1;let n=t.props[`aria-current`];return n&&n!==`false`?!0:e.Children.toArray(t.props.children).some(TJ)};function EJ(t){let{children:n,subNavigation:r,defaultOpen:i,className:a}=t,o=Y(),s=Y(),c=e.useRef(null),l=e.useMemo(()=>TJ(r),[r]),[u,d]=e.useState(i??l),[f,p]=e.useState(l);Ur(()=>{let e=l||!!c.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[l,r]);let m=e.useMemo(()=>({buttonId:o,subNavigationId:s,isOpen:u}),[o,s,u]),[h,g]=si(n,wJ);return(0,q.jsx)(hJ.Provider,{value:m,children:(0,q.jsxs)(_a.Item,{id:o,active:!u&&f,"aria-expanded":u,"aria-controls":s,onSelect:()=>d(e=>!e),className:a,"data-component":`NavigationList.Item`,children:[g,(0,q.jsxs)(_a.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,q.jsx)(zn,{className:CJ.chevron})]}),(0,q.jsx)(_a.SubItem,{children:e.cloneElement(r,{ref:c})})]})})}EJ.displayName=`NavigationList.ItemWithSubNavigation`;const DJ={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function OJ(t,n){let{className:r,children:i,...a}=t,{buttonId:o,subNavigationId:s,isOpen:c}=e.useContext(hJ),{depth:l}=e.useContext(mJ),u=e.useMemo(()=>({depth:l+1}),[l]);return!o||!s||l>=4?null:(0,q.jsx)(mJ.Provider,{value:u,children:(0,q.jsx)(`ul`,{ref:n,id:s,hidden:!c,"aria-labelledby":o,className:G(DJ.root,DJ.items,r),"data-component":`NavigationList.SubNavigation`,"data-depth":l+1,...a,children:i})})}OJ.displayName=`NavigationList.SubNavigation`;var kJ=K(OJ);const AJ={subNavigation:kJ},jJ=_a.LinkItem;function MJ(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=si(r,AJ);return c.subNavigation?(0,q.jsx)(EJ,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,q.jsx)(jJ,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}MJ.displayName=`NavigationList.Item`;var NJ=K(MJ);const PJ=e=>typeof e==`string`||!g(e)?e:(0,q.jsx)(e,{});function FJ(t,n){let{label:r=`Show more`,pages:i=0,items:a,renderItem:o,...s}=t,[c,l]=e.useState(0),u=Y(),d=a.length/i,f=i===0?a.length:Math.ceil(d*c),p=c===1?0:f-Math.floor(d);return Ur(()=>{c!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[c,u]),(0,q.jsxs)(q.Fragment,{children:[c>0?a.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:a,...s}=e,c=t===p?u:void 0;return o?o({...e,"data-expand-focus-target":c}):(0,q.jsxs)(NJ,{"data-expand-focus-target":c,...s,children:[r?(0,q.jsx)(_a.LeadingVisual,{children:(0,q.jsx)(r,{})}):null,n,i?(0,q.jsx)(_a.TrailingVisual,{children:PJ(i)}):null,a?(0,q.jsx)(_a.TrailingAction,{...a}):null]},e.id??t)}):null,c<i||c===0?(0,q.jsxs)(_a.Item,{ref:n,as:`button`,"aria-expanded":!1,onSelect:()=>l(e=>e+1),"data-component":`NavigationList.GroupExpand`,...s,children:[r,(0,q.jsx)(_a.TrailingVisual,{children:(0,q.jsx)(xn,{})})]}):null]})}FJ.displayName=`NavigationList.GroupExpand`;var IJ=e.forwardRef(FJ);const LJ={root:`navigation-list-group-heading`};function RJ(t){let{as:n,className:r,...i}=t,a=e.useContext(pJ);return(0,q.jsx)(_a.GroupHeading,{as:n??_J(a),className:G(LJ.root,r),"data-component":`NavigationList.GroupHeading`,...i})}RJ.displayName=`NavigationList.GroupHeading`;const zJ=ai(RJ,Oi),BJ=Object.assign(xJ,{Heading:fJ,Item:NJ,SubNavigation:kJ,Group:SJ,GroupHeading:zJ,GroupExpand:IJ,Description:wi,LeadingVisual:Hi,TrailingVisual:oa,TrailingAction:aa,Divider:Ei}),VJ={root:`navigation-menu-heading`,hidden:`sr-only`};function HJ(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?VJ.hidden:VJ.root,r),"data-component":`NavigationMenu.Heading`,...i})}HJ.displayName=`NavigationMenu.Heading`;const UJ=n({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),WJ=n({value:``,triggerId:``,contentId:``,isOpen:!1}),GJ=n({linkId:``,descriptionId:``}),KJ=n(null),qJ=n({depth:0}),JJ=e=>Number.parseInt(e.slice(1),10),YJ=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},XJ={root:`navigation-menu`},ZJ={heading:HJ};function QJ(t,n){let{children:r,className:i,value:a,defaultValue:o=null,onValueChange:s,orientation:c=`horizontal`,openOn:l=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=t,g=e.useRef(null),_=Gr(n,g),[v,y]=si(r,ZJ),b=Y(),x=v.heading,S=x?x.props.id??b:void 0,C=x?JJ(x.props.as??`h2`):null,w=m??(p?void 0:S),T=a!==void 0,[E,D]=e.useState(o),O=T?a:E,k=e.useRef(s);Ur(()=>{k.current=s},[s]);let A=e.useRef(null),j=e.useRef(null),M=e.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);e.useEffect(()=>M,[M]);let N=e.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=e.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=e.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);Oa(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),e.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=e.useMemo(()=>({openValue:O,setOpenValue:N,orientation:c,openOn:l,openAfterDelay:P,closeAfterDelay:F}),[O,N,c,l,P,F]);return(0,q.jsx)(UJ.Provider,{value:L,children:(0,q.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:G(XJ.root,i),"data-component":`NavigationMenu`,"data-orientation":c,...h,onBlur:I,children:(0,q.jsxs)(KJ.Provider,{value:C,children:[x?e.cloneElement(x,{id:S}):null,y]})})})}QJ.displayName=`NavigationMenu`;var $J=e.forwardRef(QJ);const eY=W(`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 tY(t,n){let{as:r=`div`,className:i,align:a=`start`,...o}=t,{orientation:s}=e.useContext(UJ),{triggerId:c,contentId:l,isOpen:u}=e.useContext(WJ);if(!l)return null;let d=s===`vertical`?void 0:a;return(0,q.jsx)(r,{ref:n,id:l,hidden:!u,"aria-labelledby":c,className:G(eY({open:u,align:d}),i),"data-component":`NavigationMenu.Content`,"data-orientation":s,"data-align":d,"data-open":u?``:void 0,...o})}tY.displayName=`NavigationMenu.Content`;var nY=K(tY);const rY={root:`navigation-menu-description`};function iY(t){let{className:n,...r}=t,{descriptionId:i}=e.useContext(GJ);return(0,q.jsx)(`span`,{id:i,className:G(rY.root,n),"data-component":`NavigationMenu.Description`,...r})}iY.displayName=`NavigationMenu.Description`;const aY={root:`navigation-menu-divider`};function oY(e){let{className:t,...n}=e;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:G(aY.root,t),"data-component":`NavigationMenu.Divider`,...n})}oY.displayName=`NavigationMenu.Divider`;const sY={root:`navigation-menu-group-heading`};function cY(t){let{as:n,className:r,...i}=t,a=e.useContext(KJ),o=n??YJ(a);return(0,q.jsx)(o,{className:G(sY.root,r),"data-component":`NavigationMenu.GroupHeading`,...i})}cY.displayName=`NavigationMenu.GroupHeading`;const lY={root:`navigation-menu-group`},uY={groupHeading:cY};function dY(t){let{title:n,children:r,className:i,hideDivider:a=!1,...o}=t,s=Y(),[c,l]=si(r,uY),u=c.groupHeading??(n?(0,q.jsx)(cY,{children:n}):null),d=u?u.props.id??s:void 0;return(0,q.jsxs)(q.Fragment,{children:[a?null:(0,q.jsx)(oY,{}),(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:G(lY.root,i),"data-component":`NavigationMenu.Group`,...o,children:[u?e.cloneElement(u,{id:d}):null,l]})]})}dY.displayName=`NavigationMenu.Group`;const fY={root:`navigation-menu-item`};function pY(t,n){let{children:r,className:i,value:a,onPointerEnter:o,onPointerLeave:s,...c}=t,l=Y(),u=a??l,d=Y(),f=Y(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=e.useContext(UJ),_=p===u,v=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{s?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=e.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,q.jsx)(WJ.Provider,{value:b,children:(0,q.jsx)(`li`,{ref:n,className:G(fY.root,i),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...c,onPointerEnter:v,onPointerLeave:y,children:r})})}pY.displayName=`NavigationMenu.Item`;var mY=e.forwardRef(pY);const hY={root:`navigation-menu-visual`},gY=({className:e,...t})=>(0,q.jsx)(`span`,{className:G(hY.root,e),...t});function _Y(e){return(0,q.jsx)(gY,{"data-component":`NavigationMenu.LeadingVisual`,...e})}_Y.displayName=`NavigationMenu.LeadingVisual`;const vY={root:`navigation-menu-sub-navigation`};function yY(t,n){let{className:r,children:i,...a}=t,{linkId:o}=e.useContext(GJ),{depth:s}=e.useContext(qJ),c=e.useMemo(()=>({depth:s+1}),[s]);return!o||s>=4?null:(0,q.jsx)(qJ.Provider,{value:c,children:(0,q.jsx)(`ul`,{ref:n,"aria-labelledby":o,className:G(vY.root,r),"data-component":`NavigationMenu.SubNavigation`,"data-depth":s+1,...a,children:i})})}yY.displayName=`NavigationMenu.SubNavigation`;var bY=K(yY);const xY={root:`navigation-menu-visual-trailing`};function SY(e){let{className:t,...n}=e;return(0,q.jsx)(gY,{className:G(xY.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}SY.displayName=`NavigationMenu.TrailingVisual`;const CY={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},wY={leadingVisual:_Y,trailingVisual:SY,description:iY,subNavigation:bY};function TY(t,n){let{as:r=`a`,id:i,className:a,active:o,children:s,onClick:c,...l}=t,{setOpenValue:u}=e.useContext(UJ),{depth:d}=e.useContext(qJ),f=Y(i),p=Y(),[m,h]=si(s,wY),g=e.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{c?.(e),!e.defaultPrevented&&u(null)},v=(0,q.jsxs)(r,{ref:n,id:f,"aria-current":o?`page`:void 0,"aria-describedby":m.description?p:void 0,className:G(CY.root,o&&CY.active,a),"data-component":`NavigationMenu.Link`,"data-active":o?``:void 0,"data-has-description":m.description?``:void 0,...l,onClick:_,children:[m.leadingVisual,(0,q.jsxs)(`span`,{className:CY.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,q.jsxs)(GJ.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,q.jsx)(`li`,{className:CY.item,children:y})}TY.displayName=`NavigationMenu.Link`;var EY=K(TY);const DY={root:`navigation-menu-list`},OY=(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 kY(t,n){let{children:r,className:i,onKeyDown:a,...o}=t,{orientation:s,openValue:c,setOpenValue:l}=e.useContext(UJ),u=e.useRef(null),d=Gr(n,u),f=e=>{a?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(c===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(),l(null);return}let o=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===i?-1:0;if(d===0&&!o)return;let f=OY(t,s),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&c!==null&&l(null),o){f[e.key===`Home`?0:f.length-1].focus();return}f[(p+d+f.length)%f.length].focus()}};return(0,q.jsx)(`ul`,{ref:d,className:G(DY.root,i),"data-component":`NavigationMenu.List`,"data-orientation":s,...o,onKeyDown:f,children:r})}kY.displayName=`NavigationMenu.List`;var AY=e.forwardRef(kY);const jY={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function MY(t,n){let{children:r,className:i,onClick:a,onKeyDown:o,...s}=t,{setOpenValue:c,orientation:l}=e.useContext(UJ),{value:u,triggerId:d,contentId:f,isOpen:p}=e.useContext(WJ),m=e.useRef(!1);if(Ur(()=>{!p||!m.current||(m.current=!1,ei(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{a?.(e),!e.defaultPrevented&&c(p?null:u)},g=e=>{if(o?.(e),e.defaultPrevented)return;let t=l===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,c(u);return}ei(document.getElementById(f))[0]?.focus()}};return(0,q.jsxs)(`button`,{ref:n,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:G(jY.root,i),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...s,onClick:h,onKeyDown:g,children:[r,(0,q.jsx)(zn,{className:jY.chevron})]})}MY.displayName=`NavigationMenu.Trigger`;var NY=e.forwardRef(MY);const PY=Object.assign($J,{Heading:HJ,List:AY,Item:mY,Trigger:NY,Content:nY,Link:EY,SubNavigation:bY,Group:dY,GroupHeading:cY,Description:iY,LeadingVisual:_Y,TrailingVisual:SY,Divider:oY}),FY={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},IY=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,q.jsxs)(`span`,{className:FY.stepper,"data-component":`NumberInput.Stepper`,children:[(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:Hn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:FY.step,"data-component":`NumberInput.Increment`}),(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:zn,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:FY.step,"data-component":`NumberInput.Decrement`})]});function LY(t,n){let{className:r,value:i,defaultValue:a,min:o,max:s,step:c=1,disabled:l,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=t,g=e.useRef(null),_=Gr(n,g),v=i!==void 0,[y,b]=e.useState(a??null),x=v?i:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(zq(e.target),e)},w=e=>{let t=Rq(x,e,{step:c,min:o,max:s});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&s!==void 0&&x>=s,E=x!=null&&o!==void 0&&x<=o,D=!!l||!!u;return(0,q.jsx)(Ps,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:a,min:o,max:s,step:c,disabled:l,readOnly:u,onChange:C,className:G(FY.root,r),trailingAction:d?void 0:(0,q.jsx)(IY,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}LY.displayName=`NumberInput`;var RY=K(LY);const zY={current:null},BY=n({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:zY,contentWrapperRef:zY,sidebarRef:zY,sidebarContentWrapperRef:zY}),VY={root:`page-layout-horizontal-divider`};function HY(t,n){let{className:r,style:i,variant:a=`none`,position:o,...s}=t,{padding:c}=e.useContext(BY);return(0,q.jsx)(`div`,{ref:n,className:G(VY.root,r),style:{"--spacing-divider":`var(--page-layout-spacing-${c})`,...i},"data-component":`PageLayout.HorizontalDivider`,...ka(`variant`,a),...ka(`position`,o),...s})}HY.displayName=`PageLayout.HorizontalDivider`;var UY=K(HY);const WY={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function GY(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(BY);return(0,q.jsxs)(`footer`,{ref:n,className:G(WY.root,WY.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Footer`,...ka(`hidden`,c),...l,children:[(0,q.jsx)(UY,{variant:s,className:WY.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,q.jsx)(`div`,{className:WY.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a})]})}GY.displayName=`PageLayout.Footer`;var KY=K(GY);const qY={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function JY(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(BY);return(0,q.jsxs)(`header`,{ref:n,className:G(qY.root,qY.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Header`,...ka(`hidden`,c),...l,children:[(0,q.jsx)(`div`,{className:qY.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a}),(0,q.jsx)(UY,{variant:s,className:qY.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}JY.displayName=`PageLayout.Header`;var YY=K(JY);const XY=1280,ZY=3,QY={small:256,medium:296,large:320},$Y=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,eX=e=>e===`small`||e===`medium`||e===`large`,tX=e=>eX(e)?QY[e]:$Y(e)?parseInt(e.default,10):0,nX=()=>zr&&window.innerWidth>=1280?959:511,rX=e=>`Pane width ${e} pixels`,iX=(e,t,n=rX)=>{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))))},aX=({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`)},oX=({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`)},sX={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}},cX={root:`page-layout-drag-handle`},lX=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,uX=e=>e===`ArrowLeft`||e===`ArrowDown`;function dX(t){let{className:n,handleRef:r,onDragStart:i,onDrag:a,onDragEnd:o,onDoubleClick:s,"aria-label":c,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=rX}=t,g=e.useRef({onDragStart:i,onDrag:a,onDragEnd:o});e.useEffect(()=>{g.current={onDragStart:i,onDrag:a,onDragEnd:o}});let _=e.useRef(!1),v=e.useRef(null),y=e.useRef(null),b=e.useCallback(()=>{_.current||=(aX({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[r,p,m]),x=e.useCallback(()=>{_.current&&=(oX({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[r,p,m]);return e.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,q.jsx)(`div`,{ref:r,role:`slider`,tabIndex:0,"aria-label":l?void 0:c??`Draggable pane splitter`,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:G(cX.root,n),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=>{lX(e.key)&&(e.preventDefault(),b(),g.current.onDrag(uX(e.key)?-3:3,!0))},onKeyUp:e=>{lX(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:s,"data-component":`PageLayout.DragHandle`})}dX.displayName=`PageLayout.DragHandle`;const fX={root:`page-layout-vertical-divider`};function pX(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,q.jsx)(`div`,{ref:t,className:G(fX.root,n),"data-component":`PageLayout.VerticalDivider`,...ka(`variant`,r),...ka(`position`,i),...a})}pX.displayName=`PageLayout.VerticalDivider`;var mX=K(pX);const hX=({width:t,minWidth:n,resizable:r,widthStorageKey:i,paneRef:a,handleRef:o,contentWrapperRef:s,constrainToViewport:c=!1,onResizeEnd:l,currentWidth:u,formatValueText:d})=>{let f=$Y(t),p=f?parseInt(t.min,10):n,m=f?parseInt(t.max,10):null,h=e.useMemo(()=>tX(t),[t]),g=e.useRef(i),_=e.useRef(l),v=e.useRef(d);Ur(()=>{g.current=i,_.current=l,v.current=d});let y=e.useRef(c?256:511),b=e.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:c?Math.min(m,t):m},[m,p,c]),[x,S]=e.useState(()=>typeof u==`number`?u:l===void 0&&r===!0&&i!==void 0?sX.get(i)??h:h),[C,w]=e.useState(h),[T,E]=e.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=e.useRef(O),[A,j]=e.useState(()=>m??600),M=e.useRef(A);Ur(()=>{k.current=O},[O]);let N=e.useCallback(()=>tX(t),[t]),P=e.useCallback(t=>{let n=Math.round(t);if(k.current=n,e.startTransition(()=>{S(n)}),_.current){try{_.current(n)}catch{}return}r&&g.current&&sX.save(g.current,n)},[r]),F=e.useRef(b);return Ur(()=>{F.current=b}),Ur(()=>{if(!r)return;let t=window.innerWidth,n=()=>{let n=window.innerWidth,r=t<XY!=n<XY;t=n,r&&(y.current=nX());let i=F.current();a.current?.style.setProperty(`--pane-max-width`,`${i}px`);let s=k.current>i;s&&(k.current=i,a.current?.style.setProperty(`--pane-width`,`${i}px`)),iX(o.current,{max:i,current:k.current},v.current),(i!==M.current||s)&&(M.current=i,e.startTransition(()=>{j(i),s&&S(i)}))};y.current=nX();let i=F.current();if(M.current=i,a.current?.style.setProperty(`--pane-max-width`,`${i}px`),iX(o.current,{min:p,max:i,current:k.current},v.current),e.startTransition(()=>{j(i)}),m!==null&&!c)return;let l=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,a.current?.setAttribute(`data-dragging`,`true`),s?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,a.current?.removeAttribute(`data-dragging`),s?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-l>=16?(l=e,n()):u===null&&(u=requestAnimationFrame(()=>{u=null,l=performance.now(),n()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[r,m,c,p,a,o,s]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},gX={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 _X(t,n){let{className:r,style:i,children:a,id:o,position:s=`start`,width:c=`medium`,minWidth:l=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}=t,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=e.useContext(BY),T=e.useRef(null),E=e.useRef(0),D=e.useRef(0),O=e.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=hX({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=Gr(n,C),L=gm(C),ee=Y(o),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},te=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},z=(0,q.jsx)(mX,{variant:h?`line`:m,position:s,className:gX.divider,children:h?(0,q.jsx)(dX,{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=s===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(te(r),iX(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+(s===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(te(i),iX(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();te(e),iX(T.current,{current:e}),F(e)}}):null});return(0,q.jsxs)(`div`,{className:G(gX.wrapper,gX.hidden,gX.position,gX.sticky,gX.fullscreen,r),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...i},"data-position":s,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...ka(`is-hidden`,v),children:[s===`end`?z:null,(0,q.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:G(gX.sidebar,gX.sidebarResizable,gX.sidebarFullscreen,gX.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":$Y(c)?c.min:`${l}px`,"--pane-max-width":$Y(c)?c.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":$Y(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${eX(c)?c:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...o?{id:ee}:{},...x,children:a}),s===`start`?z:null]})}_X.displayName=`PageLayout.Sidebar`;var vX=K(_X);const yX={content:`page-layout-content-row`},bX=W(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),xX=W(`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 SX(t,n){let{className:r,style:i,children:a,containerWidth:o=`xlarge`,padding:s=`normal`,rowGap:c=`normal`,columnGap:l=`normal`,...u}=t,d=e.useRef(null),f=e.useRef(null),p=e.useRef(null),m=e.useRef(null),[h,g]=si(a,{header:YY,footer:KY,sidebar:vX}),_=e.useMemo(()=>({padding:s,rowGap:c,columnGap:l,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[s,c,l]);return(0,q.jsx)(BY.Provider,{value:_,children:(0,q.jsxs)(`div`,{ref:n,className:G(bX({hasSidebar:!!h.sidebar}),r),style:{"--spacing":`var(--page-layout-spacing-${s})`,...i},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,q.jsxs)(`div`,{ref:m,className:G(xX({width:o})),"data-page-layout-wrapper":``,"data-width":o,children:[h.header,(0,q.jsx)(`div`,{className:yX.content,children:g}),h.footer]})]})})}SX.displayName=`PageLayout`;var CX=K(SX);const wX={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},TX=W(`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 EX(t,n){let{as:r=`main`,className:i,children:a,width:o=`full`,padding:s=`none`,hidden:c=!1,...l}=t,{contentWrapperRef:u}=e.useContext(BY),d=Gr(n,u);return(0,q.jsx)(r,{ref:d,className:G(wX.wrapper,wX.hidden,wX.dragging,i),"data-component":`PageLayout.Content`,...ka(`is-hidden`,c),...l,children:(0,q.jsx)(`div`,{className:G(TX({width:o})),"data-width":o,style:{"--spacing":`var(--page-layout-spacing-${s})`},children:a})})}EX.displayName=`PageLayout.Content`;var DX=K(EX);const OX={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 kX(t,n){let{className:r,style:i,children:a,id:o,position:s=`end`,width:c=`medium`,minWidth:l=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}=t,S=Xs(s)?`end`:s,C=Xs(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=e.useContext(BY),O=e.useRef(null),k=e.useRef(0),A=e.useRef(0),j=e.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=hX({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=Gr(n,E),te=gm(E),z=Y(o),ne=te?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},B=e=>{E.current?.style.setProperty(`--pane-width`,`${e}px`),N.current=e};return(0,q.jsxs)(`div`,{className:G(OX.wrapper,OX.hidden,OX.position,OX.sticky,r),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...i},"data-sticky":g||void 0,...ka(`is-hidden`,v),...ka(`position`,s),children:[(0,q.jsx)(UY,{variant:Xs(m)?m:{narrow:C,regular:`none`},position:s,className:OX.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,q.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:G(OX.pane,OX.paneResizable,OX.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":$Y(c)?c.min:`${l}px`,"--pane-max-width":$Y(c)?c.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":$Y(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${eX(c)?c:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...o?{id:z}:{},...x,children:a}),(0,q.jsx)(mX,{variant:Xs(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:s,className:OX.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,q.jsx)(dX,{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&&(B(t),iX(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)&&(B(i),iX(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();B(e),iX(O.current,{current:e}),ee(e)}}):null})]})}kX.displayName=`PageLayout.Pane`;var AX=K(kX);const jX=Object.assign(CX,{Header:YY,Content:DX,Pane:AX,Sidebar:vX,Footer:KY}),MX=[`narrow`,`regular`,`wide`],NX={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},PX=W(`pagination-step`,{variants:{step:{previous:`pagination-step-previous`,next:`pagination-step-next`},current:{true:`pagination-step-current`,false:``},inert:{true:`pagination-step-inert`,false:``}}}),FX=e=>typeof e==`object`?MX.filter(t=>e[t]===!1):e?[]:[...MX],IX=({page:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[e.type===`previous`?(0,q.jsx)(Bn,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,q.jsx)(Vn,{"data-component":`Pagination.NextPageIcon`}):null]}),LX=e=>`#${e}`;function RX(t,n){let{as:r=`nav`,className:i,pageCount:a,currentPage:o,onPageChange:s,hrefBuilder:c=LX,marginPageCount:l=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=t,m=e.useMemo(()=>G_(a,o,!!d,l,u),[a,o,d,l,u]),h=FX(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=K_(e,c,t=>s?.(t,e.num)),a=e.type===`previous`||e.type===`next`,o=!!r||!!i[`aria-hidden`],l=G(PX({step:a?e.type:void 0,current:e.selected,inert:o}));if(f&&!r)return f({key:t,children:(0,q.jsx)(IX,{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,q.jsx)(u,{role:r?`presentation`:void 0,className:l,"data-component":d,...i,children:(0,q.jsx)(IX,{page:e,children:n})},t)});return(0,q.jsx)(r,{ref:n,"aria-label":`Pagination`,className:G(NX.root,i),"data-component":`Pagination`,...p,children:(0,q.jsx)(`div`,{className:G(NX.steps,h.map(e=>NX.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}RX.displayName=`Pagination`;var zX=K(RX);const BX={root:`password-input`,toggle:`password-input-toggle`};function VX(t,n){let{className:r,visible:i,defaultVisible:a=!1,onVisibilityChange:o,hideToggle:s=!1,showLabel:c=`Show password`,hideLabel:l=`Hide password`,disabled:u,...d}=t,f=i!==void 0,[p,m]=e.useState(a),h=f?i:p;return(0,q.jsx)(Ps,{ref:n,type:h?`text`:`password`,disabled:u,className:G(BX.root,r),trailingAction:s?void 0:(0,q.jsx)(Ps.Action,{icon:h?$n:er,"aria-label":h?l:c,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),o?.(t)},className:BX.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}VX.displayName=`PasswordInput`;var HX=K(VX);const UX={root:`pin-input`},WX=W(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),GX={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},KX=(e,t)=>Array.from(e).filter(e=>GX[t].test(e)).join(``);function qX(t,n){let{className:r,length:i=6,value:a,defaultValue:o=``,type:s=`numeric`,mask:c=!1,size:l=`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}=t,S=e.useRef([]),C=a!==void 0,[w,T]=e.useState(()=>KX(o,s).slice(0,i)),E=C?a:w,D=Array.from({length:i},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=e.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===i&&v?.(e)},M=(e,t)=>{let n=KX(t,s);if(n.length===0)return;let r=O===-1?e:Math.min(e,O),a=[...D],o=r;Array.from(n).forEach(e=>{o<i&&(a[o]=e,o+=1)}),j(a.join(``)),A(Math.min(o,i-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<i-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(i-1))}};return(0,q.jsx)(`div`,{ref:n,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:G(UX.root,r),"data-component":`PINInput`,"data-size":l,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,q.jsx)(Ps,{ref:e=>{S.current[t]=e},type:c?`password`:`text`,inputMode:s===`numeric`?`numeric`:`text`,size:l,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 ${i}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:G(WX({size:l})),"data-component":`PINInput.Box`},t))})}qX.displayName=`PINInput`;var JX=K(qX);const YX={root:`placeholder`};function XX(e,t){let{as:n=`div`,className:r,width:i,height:a,label:o,style:s,children:c,...l}=e;return(0,q.jsx)(n,{ref:t,className:G(YX.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}XX.displayName=`Placeholder`;var ZX=K(XX);const QX=n({}),$X=W(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function eZ(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,q.jsx)(QX.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G($X({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}eZ.displayName=`Popover`;var tZ=K(eZ);const nZ=W(`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`}}}),rZ=[];function iZ(t,n){let{as:r=`div`,className:i,width:a=`small`,height:o=`fit-content`,overflow:s=`visible`,onClickOutside:c,onEscape:l,ignoreClickRefs:u=rZ,...d}=t,{open:f=!1,caret:p=`top`}=e.useContext(QX),m=e.useRef(null),h=Gr(n,m);return e.useEffect(()=>{if(!f||!c)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))||c(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,c,u]),Oa(e=>{!f||!l||(l(e),e.preventDefault())}),(0,q.jsx)(r,{ref:h,className:G(nZ({caret:p,width:a,height:o,overflow:s}),i),"data-component":`Popover.Content`,"data-caret":p,"data-width":a,"data-height":o,"data-overflow":s,...d})}iZ.displayName=`Popover.Content`;var aZ=K(iZ);const oZ=Object.assign(tZ,{Content:aZ}),sZ={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},cZ=W(`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 lZ(t,n){let{as:r=`span`,className:i,progress:a=0,size:o=`medium`,variant:s=`success`,style:c,children:l,"aria-valuenow":u,...d}=t,f=Math.min(Math.max(a,0),100),p=e.Children.toArray(l).length>0;return(0,q.jsxs)(r,{ref:n,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:G(cZ({size:o,variant:s}),i),style:{...c,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":o,"data-variant":s,...d,children:[(0,q.jsxs)(`svg`,{className:sZ.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:sZ.track,cx:16,cy:16,r:14,pathLength:100}),(0,q.jsx)(`circle`,{className:sZ.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,q.jsx)(`span`,{className:sZ.label,children:l}):null]})}lZ.displayName=`ProgressCircle`;var uZ=K(lZ);const dZ={L:1,M:0,Q:3,H:2},fZ={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},pZ={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function mZ(e,t){let n=pZ[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const hZ={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 gZ(e,t){return hZ[t][e]}const _Z=[[],[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]],vZ=[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 yZ(e){return/^\d+$/.test(e)}function bZ(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function xZ(e){return yZ(e)?`numeric`:bZ(e)?`alphanumeric`:`byte`}function SZ(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function CZ(e){let t=[],n=0;for(;n+2<e.length;)OZ(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(OZ(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&OZ(t,Number.parseInt(e[n],10),4),t}function wZ(e){let t=[],n=0;for(;n+1<e.length;)OZ(t,SZ(e[n])*45+SZ(e[n+1]),11),n+=2;return n<e.length&&OZ(t,SZ(e[n]),6),t}function TZ(e){let t=[];for(let n of e)OZ(t,n,8);return t}function EZ(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;OZ(t,r*192+i,13)}return t}function DZ(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 OZ(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function kZ(e,t){return gZ(e,t).totalDataCodewords*8}function AZ(e,t,n,r){let i=n===`auto`||!n?xZ(e):n,a=new TextEncoder().encode(e);if(r){let n=kZ(r,t);if(jZ(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=kZ(n,t);if(jZ(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function jZ(e,t,n,r){let i=mZ(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 MZ(e,t){return t&&t!==`auto`?t:yZ(e)?`numeric`:bZ(e)?`alphanumeric`:`byte`}const NZ=new Uint8Array(512),PZ=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)NZ[t]=e,PZ[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)NZ[e]=NZ[e-255]})();function FZ(e,t){return e===0||t===0?0:NZ[(PZ[e]+PZ[t])%255]}function IZ(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,NZ[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]^=FZ(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]^FZ(e,n[i+1]);r[t-1]=FZ(e,n[t])}return r}function LZ(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(IZ(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(IZ(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 RZ(e,t={}){let n=t.ecLevel??`M`,r=MZ(e,t.mode),i=AZ(e,n,r,t.version),a=gZ(i,n),o=LZ(BZ(zZ(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)OZ(s,e,8);return{version:i,ecLevel:n,bits:s}}function zZ(e,t,n,r){let i=[],a=mZ(n,t),o=new TextEncoder().encode(e);switch(OZ(i,fZ[t],4),OZ(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...CZ(e));break;case`alphanumeric`:i.push(...wZ(e));break;case`byte`:i.push(...TZ(o));break;case`kanji`:{let t=DZ(e);i.push(...EZ(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&OZ(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)OZ(i,l?236:17,8),l=!l;return i}function BZ(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 VZ(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function HZ(e,t){let n=e.length;UZ(e,0,0),UZ(e,n-7,0),UZ(e,0,n-7),GZ(e,n),KZ(e,t),e[4*t+9][8]=!0,JZ(e,n),t>=7&&YZ(e,n)}function UZ(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++)WZ(e,t-1,n+i,!1,r),WZ(e,t+7,n+i,!1,r),WZ(e,t+i,n-1,!1,r),WZ(e,t+i,n+7,!1,r)}function WZ(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function GZ(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 KZ(e,t){if(t<2)return;let n=_Z[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)&&qZ(e,n[t],n[i])}function qZ(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 JZ(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 YZ(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 XZ(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 ZZ(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=_Z[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 QZ(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 $Z(e,t,n,r){let i=QZ(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)ZZ(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function eQ(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]);$Z(o,r,t,n);let s=tQ(o,t);s<a&&(a=s,i=r)}return i}function tQ(e,t){return nQ(e,t)+rQ(e,t)+iQ(e,t)+aQ(e,t)}function nQ(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 rQ(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 iQ(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 aQ(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 oQ(e,t){let n=dZ[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 sQ(e,t,n){let r=e.length,i=oQ(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 cQ(e,t){if(t<7)return;let n=e.length,r=vZ[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 lQ=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},uQ=class extends lQ{constructor(...e){super(...e),this.name=`InvalidInputError`}};function dQ(e,t={}){let{version:n,ecLevel:r,bits:i}=RZ(e,t),a=n*4+17,o=VZ(a);HZ(o,n),XZ(o,i,n);let s=eQ(o,a,n,t.mask);return $Z(o,s,a,n),sQ(o,r,s),n>=7&&cQ(o,n),o.map(e=>e.map(e=>e===!0))}function fQ(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}const pQ=(()=>{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 mQ(e){let t=4294967295;for(let n=0;n<e.length;n++)t=pQ[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function hQ(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 gQ(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 _Q(e){let t=gQ(e),n=hQ(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 vQ=new Uint8Array([137,80,78,71,13,10,26,10]);function yQ(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,mQ(a)),r}function bQ(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=_Q(s),u=yQ(`IHDR`,r),d=yQ(`IDAT`,l),f=yQ(`IEND`,new Uint8Array),p=vQ.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(vQ,h),h+=vQ.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function xQ(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,${kQ(s)}`:SQ(s,o.width,o.height)}function SQ(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)CQ(e,i,a,o,l);else if(s===24)wQ(e,i,a,o,l);else if(s<=8)TQ(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=DQ(a,o,s),n=i+EQ(e,i,s)+t;n<e.length&&OQ(e,n,a,o,l)}return`data:image/png;base64,${kQ(bQ(a,o,l))}`}function CQ(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 wQ(e,t,n,r,i){let a=t+EQ(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 TQ(e,t,n,r,i,a){let o=EQ(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 EQ(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 DQ(e,t,n){return Math.ceil(e*n/32)*4*t}function OQ(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 kQ(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const AQ=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function jQ(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="${fQ(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(AQ.test(e.svg))throw new uQ(`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=fQ(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 uQ(`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=xQ(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${fQ(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function MQ(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return NQ(e+o,t+o,a);case`rounded`:return PQ(e+o,t+o,a,a*.25);case`dots`:return FQ(e+n/2,t+n/2,a/2);case`diamond`:return IQ(e+n/2,t+n/2,a);case`classy`:return LQ(e+o,t+o,a);case`classy-rounded`:return RQ(e+o,t+o,a);case`extra-rounded`:return PQ(e+o,t+o,a,a*.5);case`vertical-line`:return zQ(e+o,t,n,a);case`horizontal-line`:return BQ(e,t+o,n,a);case`small-square`:return NQ(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return NQ(e+n*.25,t+n*.25,n*.5);default:return NQ(e+o,t+o,a)}}function NQ(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function PQ(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 FQ(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 IQ(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function LQ(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 RQ(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 zQ(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function BQ(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function VQ(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return UQ(e,t,i,i,r)+WQ(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return FQ(e+r,t+r,r)+FQ(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return UQ(e,t,i,i,r)+WQ(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return UQ(e,t,i,i,r)+WQ(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 HQ(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return FQ(a,o,i/2);case`rounded`:return PQ(e+n*2,t+n*2,i,n*.75);default:return NQ(e+n*2,t+n*2,i)}}function UQ(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 WQ(e,t,n,r,i){return UQ(e,t,n,r,i)}const GQ={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`},KQ=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function qQ(t,n){let{value:r,size:i=200,margin:a=4,ecLevel:o,version:s,mode:c,mask:l,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}=t,S=o??(h?`H`:void 0),C=e.useMemo(()=>{if(!r)return null;try{return dQ(r,{ecLevel:S,version:s,mode:c,mask:l})}catch{return null}},[r,S,s,c,l]);if(!C)return(0,q.jsx)(`div`,{ref:n,className:G(GQ.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,q.jsx)(`span`,{className:GQ.fallback,children:v}):null});let w=C.length,T=w+a*2,E=i/T,D=h?jQ({size:g},w,E,a).hiddenModules:void 0,O=KQ(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(MQ((t+a)*E,(e+a)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+a)*E,i=(t+a)*E;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{className:GQ.corner,d:VQ(r,i,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,q.jsx)(`path`,{className:GQ.corner,d:HQ(r,i,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,q.jsxs)(`div`,{ref:n,role:`img`,"aria-label":_??r,className:G(GQ.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,q.jsxs)(`svg`,{className:GQ.canvas,width:i,height:i,viewBox:`0 0 ${i} ${i}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,q.jsx)(`rect`,{className:GQ.background,width:`100%`,height:`100%`}),f?O.map(t=>(0,q.jsx)(e.Fragment,{children:j(f[t.key],t.row,t.col)},t.key)):null,A.length>0?(0,q.jsx)(`path`,{className:GQ.modules,d:A.join(``)}):null]}),h?(0,q.jsx)(`span`,{className:GQ.logo,"aria-hidden":`true`,children:h}):null]})}qQ.displayName=`QRCode`;var JQ=K(qQ);const YQ=n({}),XQ={root:`radio-card-description`};function ZQ(t,n){let{className:r,id:i,...a}=t,{descriptionId:o}=e.useContext(YQ);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(XQ.root,r),"data-component":`RadioCard.Description`,...a})}ZQ.displayName=`RadioCard.Description`;var QQ=K(ZQ);const $Q={root:`radio-card-label`};function e$(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(YQ);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G($Q.root,r),"data-component":`RadioCard.Label`,...a})}e$.displayName=`RadioCard.Label`;var t$=K(e$);const n$={root:`radio-card-leading-visual`};function r$(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(n$.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}r$.displayName=`RadioCard.LeadingVisual`;var i$=K(r$);const a$={body:`radio-card-body`,control:`radio-card-control`},o$=W(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function s$(t,n){let{className:r,children:i,value:a,name:o,checked:s,defaultChecked:c,disabled:l,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=t,v=e.useContext(FS).disabled||l,y=Y(p),b=`${y}-label`,x=`${y}-description`,[S,C]=si(i,{leadingVisual:i$,label:t$,description:QQ}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,q.jsx)(YQ.Provider,{value:{labelId:b,descriptionId:x},children:(0,q.jsxs)(`label`,{ref:n,className:G(o$({disabled:!!v,validation:d}),r),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,q.jsxs)(`div`,{className:a$.body,children:[S.label,S.description,C]}),(0,q.jsx)(RS,{id:y,value:a,name:o,checked:s,defaultChecked:c,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:a$.control})]})})}s$.displayName=`RadioCard`;var c$=K(s$);const l$=Object.assign(c$,{LeadingVisual:i$,Label:t$,Description:QQ}),u$={root:`radio-group-caption`};function d$(t,n){let{className:r,...i}=t,{captionId:a}=e.useContext(FS);return(0,q.jsx)(`span`,{ref:n,id:a,className:G(u$.root,r),"data-component":`RadioGroup.Caption`,...i})}d$.displayName=`RadioGroup.Caption`;var f$=K(d$);const p$={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function m$(t,n){let{className:r,children:i,visuallyHidden:a,...o}=t,{disabled:s,required:c}=e.useContext(FS);return(0,q.jsxs)(`span`,{ref:n,title:c?`required field`:void 0,className:G(p$.root,s&&p$.disabled,a&&p$.hidden,r),"data-component":`RadioGroup.Label`,"data-label-disabled":s,...o,children:[i,c?(0,q.jsx)(`span`,{className:p$.required,children:`*`}):null]})}m$.displayName=`RadioGroup.Label`;var h$=K(m$);const g$={success:Ln,error:Qn},_$={icon:`radio-group-validation-icon`},v$=W(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function y$(t,n){let{className:r,children:i,variant:a,...o}=t,{validationMessageId:s}=e.useContext(FS),c=g$[a];return(0,q.jsxs)(`span`,{ref:n,className:G(v$({variant:a}),r),"data-component":`RadioGroup.Validation`,"data-validation-status":a,...o,children:[(0,q.jsx)(c,{className:_$.icon,"aria-hidden":`true`}),(0,q.jsx)(`span`,{id:s,children:i})]})}y$.displayName=`RadioGroup.Validation`;var b$=K(y$);const x$={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 S$(t,n){let{as:r=`fieldset`,className:i,children:a,name:o,disabled:s,required:c,onChange:l,id:u,"aria-labelledby":d,...f}=t,[p,m]=si(a,{label:h$,caption:f$,validation:b$}),h=Y(u),g=p.caption?`${h}-caption`:void 0,_=p.validation?`${h}-validation`:void 0,v=e=>{let{value:t,checked:n}=e.currentTarget;n&&l?.(t,e)},y=e.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:o,disabled:s,required:c,captionId:g,validationMessageId:_,onChange:v};return(0,q.jsx)(FS.Provider,{value:b,children:(0,q.jsxs)(r,{ref:n,id:h,disabled:s,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:G(x$.root,i),"data-component":`RadioGroup`,"data-disabled":s,"data-required":c,...f,children:[p.label?(0,q.jsxs)(`legend`,{className:G(x$.legend,y&&x$.legendVisible),children:[p.label,c?(0,q.jsx)(`span`,{className:x$.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,q.jsx)(`div`,{className:x$.body,children:m}),p.validation?(0,q.jsx)(`div`,{className:x$.validation,children:p.validation}):null]})})}S$.displayName=`RadioGroup`;var C$=K(S$);const w$=Object.assign(C$,{Label:h$,Caption:f$,Validation:b$}),T$=5,E$={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`},D$=W(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),O$=e=>e===1?`1 star`:`${e} stars`,k$=(e,t)=>`${e} out of ${t} stars`,A$=({className:e})=>(0,q.jsx)(`svg`,{className:e,"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.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 j$(t,n){let{className:r,style:i,count:a=5,value:o,defaultValue:s,size:c=`medium`,readOnly:l,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=O$,valueLabel:h=k$,"aria-label":g,..._}=t,v=o!==void 0,[y,b]=e.useState(()=>s??0),x=v?o:y,S=Math.max(Math.trunc(a),0),C=Math.min(Math.max(x,0),S),w=Y(f),T=!l&&!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=l?`span`:`label`;return(0,q.jsx)(`span`,{ref:n,role:l?`img`:`radiogroup`,"aria-label":l?g??h(C,S):g,className:G(D$({size:c,interactive:T,disabled:!!u}),r),style:{...i,"--rating-value":C},"data-component":`Rating`,"data-size":c,"data-value":C,"data-count":S,"data-readonly":l,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,q.jsxs)(k,{className:E$.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[l?null:(0,q.jsx)(`input`,{type:`radio`,className:G(E$.input,E$.srOnly),name:w,value:n,checked:n===C,disabled:u,"aria-label":m(n,S),onChange:D,onClick:O,"data-component":`Rating.Input`}),(0,q.jsxs)(`span`,{className:E$.star,"aria-hidden":`true`,children:[(0,q.jsx)(A$,{className:E$.starTrack}),(0,q.jsx)(`span`,{className:E$.starFill,children:(0,q.jsx)(A$,{className:E$.starFillIcon})})]})]},n)})})}j$.displayName=`Rating`;var M$=K(j$);const N$=1e3,P$=60*N$,F$=60*P$,I$=24*F$,L$=7*I$,R$=30*I$,z$=12*R$,B$=`P30D`,V$=`on`,H$=[{unit:`year`,length:z$},{unit:`month`,length:R$},{unit:`week`,length:L$},{unit:`day`,length:I$},{unit:`hour`,length:F$},{unit:`minute`,length:P$},{unit:`second`,length:N$}],U$=[`year`,`month`,`day`,`hour`,`minute`,`second`],W$={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},G$=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),K$=e=>{let t=G$.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)*z$+Number(r??0)*R$+Number(i??0)*L$+Number(a??0)*I$+Number(o??0)*F$+Number(s??0)*P$+Number(c??0)*N$},q$=e=>{let t=Math.abs(e),{unit:n,length:r}=H$.find(({length:e})=>t>=e)??H$[H$.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},J$=(e,t)=>{let n=Math.floor(Math.abs(e)/N$),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 U$.slice(0,U$.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},Y$=e=>{let{value:t,unit:n}=q$(e);return n===`second`?`1m`:`${Math.abs(t)}${W$[n]}`},X$=(e,t)=>{let n=J$(e,t).filter(({count:e})=>e>0);return n.length===0?`0${W$[t]}`:n.map(({unit:e,count:t})=>`${t}${W$[e]}`).join(` `)},Z$=(e,t)=>{let{value:n,unit:r}=q$(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},Q$=(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}},$$=(e,t,n,r)=>new Intl.DateTimeFormat(r,Q$(e,t,n)).format(e),e1=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),t1=(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:X$(u,a),updateDelay:H$.find(({unit:e})=>e===a)?.length??N$};let d=K$(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=q$(u);return{text:r===`micro`?Y$(u):Z$(u,l),updateDelay:e}}let f=$$(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},n1=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function r1(t,n){let{as:r=`time`,children:i,date:a,datetime:o,format:s=`auto`,tense:c=`auto`,precision:l=`second`,threshold:u=B$,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=t,S=n1(a,o),[C,w]=e.useState(()=>Date.now()),{text:T,updateDelay:E}=S?t1(S,C,{format:s,tense:c,precision:l,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return e.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,q.jsx)(r,{ref:n,dateTime:S?.toISOString(),title:f||!S?void 0:e1(S),"data-component":`RelativeTime`,"data-format":s,"data-tense":c,...x,children:i??T})}r1.displayName=`RelativeTime`;var i1=K(r1);const a1={root:`resizable`};function o1(e,t){let{className:n,orientation:r=`horizontal`,resizableRef:i,...a}=e;return(0,q.jsx)(V,{elementRef:t,groupRef:i,orientation:r,className:G(a1.root,n),"data-component":`Resizable`,"data-orientation":r,...a})}o1.displayName=`Resizable`;var s1=K(o1);const c1={root:`resizable-panel`};function l1(e,t){let{className:n,...r}=e;return(0,q.jsx)(ie,{elementRef:t,className:G(c1.root,n),"data-component":`Resizable.Panel`,...r})}l1.displayName=`Resizable.Panel`;var u1=K(l1);const d1={root:`resizable-resize-trigger`};function f1(e,t){let{className:n,...r}=e;return(0,q.jsx)(ae,{elementRef:t,className:G(d1.root,n),"data-component":`Resizable.ResizeTrigger`,...r})}f1.displayName=`Resizable.ResizeTrigger`;var p1=K(f1);const m1={root:`resizable-resize-trigger-indicator`};function h1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(m1.root,n),"data-component":`Resizable.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}h1.displayName=`Resizable.ResizeTriggerIndicator`;var g1=K(h1);const _1={root:`resizable-resize-trigger-separator`};function v1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(_1.root,n),"data-component":`Resizable.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}v1.displayName=`Resizable.ResizeTriggerSeparator`;var y1=K(v1);const b1=Object.assign(s1,{Panel:u1,ResizeTrigger:p1,ResizeTriggerSeparator:y1,ResizeTriggerIndicator:g1}),x1=n({}),S1=`RichTextEditor`,C1=[B,re,L,I,j,A],w1={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`},T1={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},E1=({readOnly:t})=>{let[n]=E();return e.useEffect(()=>{n.setEditable(!t)},[n,t]),null};function D1(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=S1,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,...g}=e,_={namespace:l,theme:w1,nodes:c?[...C1,...c]:C1,editable:!s,editorState:i,onError:u??(e=>{throw e})},v={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,q.jsx)(`div`,{ref:t,className:G(T1.root,s&&T1.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,...g,children:(0,q.jsx)(S,{initialConfig:_,children:(0,q.jsxs)(x1.Provider,{value:v,children:[(0,q.jsx)(oe,{}),(0,q.jsx)(ce,{}),(0,q.jsx)(se,{}),(0,q.jsx)(ue,{}),(0,q.jsx)(E1,{readOnly:s}),a?(0,q.jsx)(le,{onChange:(e,t)=>a(e,t)}):null,r]})})})}D1.displayName=`RichTextEditor`;var O1=K(D1);const k1={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function A1(t,n){let{className:r,style:i,...a}=t,{placeholder:o,minHeight:s,maxHeight:c,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d}=e.useContext(x1),f=(0,q.jsx)(`div`,{className:k1.scroll,style:{minHeight:s===void 0?void 0:`${s}px`,maxHeight:c===void 0?void 0:`${c}px`},"data-component":`RichTextEditor.Scroll`,children:o?(0,q.jsx)(de,{ref:n,className:G(k1.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":o,placeholder:(0,q.jsx)(`div`,{className:k1.placeholder,children:o}),"data-component":`RichTextEditor.Content`,...a}):(0,q.jsx)(de,{ref:n,className:G(k1.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...a})});return(0,q.jsx)(pe,{contentEditable:f,ErrorBoundary:fe})}A1.displayName=`RichTextEditor.Content`;var j1=K(A1);const M1=[`history`,`inline`,`block`,`list`,`link`],N1={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`},P1=[{format:`bold`,icon:xr,label:`Bold`},{format:`italic`,icon:Er,label:`Italic`},{format:`underline`,icon:Ar,label:`Underline`},{format:`strikethrough`,icon:kr,label:`Strikethrough`},{format:`code`,icon:qn,label:`Code`}],F1=[{tag:`h1`,icon:Cr,label:`Heading 1`},{tag:`h2`,icon:wr,label:`Heading 2`},{tag:`h3`,icon:Tr,label:`Heading 3`}],I1={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function L1(t){let{className:n,children:r,controls:i=M1,"aria-label":a=`Formatting`,...o}=t,[s]=E(),{readOnly:c}=e.useContext(x1),l=e.useRef(null);ri({containerRef:l,direction:`horizontal`,wrap:!0});let[u,d]=e.useState(I1),[f,p]=e.useState(`paragraph`),[m,h]=e.useState(!1),[g,_]=e.useState(!1),[v,y]=e.useState(!1),[b,x]=e.useState(null),S=e.useCallback(()=>{let e=_e();if(!ve(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(N(n))p(n.getListType()===`number`?`number`:`bullet`);else if(z(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else ne(n)?p(`quote`):p(`paragraph`);h(k(t)||k(t.getParent()))},[]);e.useEffect(()=>he(s.registerUpdateListener(({editorState:e})=>{e.read(S)}),s.registerCommand(we,()=>(S(),!1),xe),s.registerCommand(be,e=>(_(e),!1),xe),s.registerCommand(ye,e=>(y(e),!1),xe)),[s,S]);let C=e=>{s.update(()=>{let t=_e();if(ve(t)){if(f===e){me(t,()=>ge());return}me(t,()=>e===`quote`?te():R(e))}})},w=e=>{if(f===e){s.dispatchCommand(ee,void 0);return}s.dispatchCommand(e===`bullet`?F:P,void 0)},T=()=>{if(m){s.dispatchCommand(M,null);return}x(e=>e===null?``:null)},D=()=>{b&&s.dispatchCommand(M,b),x(null),s.focus()},O=(e,t,n,r,i,a)=>(0,q.jsx)(na,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:c||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),A={history:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(na,{icon:Mn,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:c||!g,onClick:()=>s.dispatchCommand(Te,void 0),"data-component":`RichTextEditor.Undo`}),(0,q.jsx)(na,{icon:kn,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:c||!v,onClick:()=>s.dispatchCommand(Ce,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,q.jsx)(q.Fragment,{children:P1.map(({format:e,icon:t,label:n})=>O(n,n,t,u[e],()=>s.dispatchCommand(Se,e)))}),block:(0,q.jsxs)(q.Fragment,{children:[F1.map(({tag:e,icon:t,label:n})=>O(n,n,t,f===e,()=>C(e))),O(`Quote`,`Quote`,Or,f===`quote`,()=>C(`quote`))]}),list:(0,q.jsxs)(q.Fragment,{children:[O(`Bulleted list`,`Bulleted list`,Sr,f===`bullet`,()=>w(`bullet`)),O(`Numbered list`,`Numbered list`,Dr,f===`number`,()=>w(`number`))]}),link:O(`Link`,m?`Remove link`:`Link`,sr,m||b!==null,T)};return(0,q.jsxs)(`div`,{className:G(N1.root,n),"data-component":`RichTextEditor.Toolbar`,children:[(0,q.jsxs)(`div`,{ref:l,role:`toolbar`,"aria-label":a,"aria-orientation":`horizontal`,className:N1.controls,...o,children:[i.map((t,n)=>(0,q.jsxs)(e.Fragment,{children:[n>0?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:N1.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,q.jsx)(`div`,{className:N1.group,"data-control":t,children:A[t]})]},t)),r]}),b===null?null:(0,q.jsxs)(`div`,{className:N1.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,q.jsx)(Ps,{autoFocus:!0,size:`small`,type:`url`,value:b,placeholder:`https://example.com`,"aria-label":`Link address`,className:N1.linkInput,onChange:e=>x(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),D()),e.key===`Escape`&&(x(null),s.focus())}}),(0,q.jsx)($i,{size:`small`,onClick:D,children:`Apply`})]})]})}L1.displayName=`RichTextEditor.Toolbar`;const R1=Object.assign(O1,{Toolbar:L1,Content:j1}),z1={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`},B1=t=>{let n=t;return e.isValidElement(t)?t:(0,q.jsx)(n,{})};function V1(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,q.jsx)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":d||void 0,className:G(z1.button,i&&z1.buttonSelected,d&&!i&&z1.buttonDisabled,n),...u,children:(0,q.jsx)(`span`,{className:G(z1.content,i&&z1.contentSelected,!i&&!d&&z1.contentInteractive),children:r})});return(0,q.jsx)(`li`,{className:G(z1.item,z1.separator,z1.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,q.jsx)(sE,{text:o,type:s,direction:c,children:f}):f})}V1.displayName=`SegmentedControlSegment`;const H1={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function U1(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,q.jsxs)(V1,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,q.jsx)(`span`,{className:G(H1.visual,o&&H1.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:B1(i)}):null,(0,q.jsx)(`span`,{className:G(H1.text,H1.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,q.jsx)(`span`,{className:H1.counter,children:(0,q.jsx)(qi,{children:r})})]})}U1.displayName=`SegmentedControl.Button`;const W1={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function G1(e){let{"aria-label":t,className:n,description:r,icon:i,selected:a,disabled:o,tooltipDirection:s,defaultSelected:c,...l}=e;return(0,q.jsx)(V1,{component:`SegmentedControl.IconButton`,className:G(W1.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,q.jsx)(`span`,{className:G(W1.visual,o&&W1.visualDisabled),"data-component":`SegmentedControl.Icon`,children:B1(i)})})}G1.displayName=`SegmentedControl.IconButton`;const K1={dropdown:`segmented-control-dropdown`},q1=W(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),J1=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),Y1=e=>e.type===U1,X1=e=>e.type===G1,Z1=e=>{if(e!==void 0)return Y1(e)?e.props.children:X1(e)?e.props[`aria-label`]:void 0},Q1=e=>e===void 0?null:Y1(e)?e.props.leadingVisual??null:X1(e)?e.props.icon:null,$1=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function e0(t){let{"aria-label":n,"aria-labelledby":r,className:i,children:a,fullWidth:o,onChange:s,size:c=`medium`,variant:l=`default`,...u}=t,d=J1(a),f=s===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]=e.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{$1(t)||(f&&g(e),s?.(e),t.props.onClick?.(n))},b=(0,q.jsx)(`ul`,{"aria-label":n,"aria-labelledby":r,className:G(q1({size:c}),i),"data-component":`SegmentedControl`,"data-size":c,...ka(`full-width`,o),...ka(`variant`,l),...u,children:d.map((t,n)=>e.cloneElement(t,{selected:n===_,onClick:e=>y(n,t,e)}))});return Xs(l)&&Object.values(l).includes(`dropdown`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:K1.dropdown,"data-component":`SegmentedControl.Dropdown`,...ka(`variant`,l),children:(0,q.jsxs)(eo,{children:[(0,q.jsx)(eo.Button,{"aria-label":n&&`${Z1(v)}, ${n}`,leadingVisual:Q1(v),children:Z1(v)}),(0,q.jsx)(eo.Overlay,{"aria-labelledby":r,children:(0,q.jsx)(_a,{selectionVariant:`single`,children:d.map((e,t)=>{let n=Q1(e);return(0,q.jsxs)(_a.Item,{selected:t===_,disabled:$1(e),onSelect:n=>y(t,e,n),children:[n?(0,q.jsx)(_a.LeadingVisual,{children:B1(n)}):null,Z1(e)]},t)})})})]})}),b]}):b}e0.displayName=`SegmentedControl`;const t0=Object.assign(e0,{Button:U1,IconButton:G1}),n0=Object.assign(aC,{Option:qS,OptGroup:US});function r0(t,n){let{className:r,children:i,...a}=t,{required:o,...s}=Vp(a),{labelId:c}=e.useContext(Bp),l=Y();return(0,q.jsx)($i,{ref:n,type:`button`,"aria-labelledby":c?`${l} ${c}`:void 0,className:G(r),"data-component":`SelectPanel.Button`,...s,children:c?(0,q.jsx)(`span`,{id:l,children:i}):i})}r0.displayName=`SelectPanel.Button`;var i0=K(r0);const a0=n({}),o0={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 s0(t,n){let{className:r,children:i,...a}=t,{selectionVariant:o,onCancel:s}=e.useContext(a0),c=o!==`instant`;return!c&&!i?null:(0,q.jsxs)(`div`,{ref:n,className:G(o0.root,!c&&o0.rootWithoutActions,r),"data-component":`SelectPanel.Footer`,"data-has-actions":c?``:void 0,...a,children:[(0,q.jsx)(`div`,{className:G(o0.content,!c&&o0.contentWithoutActions),children:i}),c?(0,q.jsxs)(`div`,{className:o0.actions,children:[(0,q.jsx)($i,{type:`button`,size:`small`,onClick:s,children:`Cancel`}),(0,q.jsx)($i,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}s0.displayName=`SelectPanel.Footer`;var c0=K(s0);const l0={root:`select-panel-search-input`};function u0(t,n){let{className:r,value:i,onChange:a,onKeyDown:o,...s}=t,{searchQuery:c,setSearchQuery:l,searchInputRef:u,moveFocusToList:d}=e.useContext(a0),f=e.useRef(null),p=Gr(u,f),m=Gr(n,p),h=i??c??``;return(0,q.jsx)(Ps,{ref:m,block:!0,leadingVisual:mr,placeholder:`Search`,value:h,onChange:e=>{l?.(e.currentTarget.value),a?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),o?.(e)},trailingAction:h?(0,q.jsx)(Ps.Action,{icon:Yn,"aria-label":`Clear`,onClick:()=>{l?.(``),a?.(``,null),f.current?.focus()}}):void 0,className:G(l0.root,r),"data-component":`SelectPanel.SearchInput`,...s})}u0.displayName=`SelectPanel.SearchInput`;var d0=K(u0);const f0={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`},p0={searchInput:d0};function m0(t,n){let{className:r,children:i,onBack:a,...o}=t,[s,c]=si(i,p0),{panelId:l,title:u,description:d,onCancel:f,onClearSelection:p}=e.useContext(a0);return(0,q.jsxs)(`div`,{ref:n,className:G(f0.root,r),"data-component":`SelectPanel.Header`,...o,children:[(0,q.jsxs)(`div`,{className:G(f0.content,s.searchInput&&f0.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":s.searchInput?``:void 0,children:[(0,q.jsxs)(`div`,{className:f0.titleRow,children:[a?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:Tn,"aria-label":`Back`,onClick:a,"data-component":`SelectPanel.BackButton`}):null,(0,q.jsxs)(`div`,{className:f0.title,"data-has-description":d?``:void 0,"data-has-back":a?``:void 0,children:[(0,q.jsx)(di,{as:`h1`,id:l?`${l}-title`:void 0,className:f0.heading,children:u}),d?(0,q.jsx)(`span`,{id:l?`${l}-description`:void 0,className:f0.description,children:d}):null]})]}),(0,q.jsxs)(`div`,{className:f0.actions,children:[p?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:tr,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:Xn,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),s.searchInput,c]})}m0.displayName=`SelectPanel.Header`;var h0=K(m0);const g0={form:`select-panel-form`,container:`select-panel-container`},_0=W(`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`}}}),v0=W(`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:``}}}),y0={regular:`anchored`,narrow:`full-screen`},b0=t=>e.isValidElement(t)&&t.type===i0,x0=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function S0(t,n){let{className:r,children:i,title:a,description:o,variant:s=y0,selectionVariant:c=`multiple`,id:l,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}=t,x=Y(l),S=e.useRef(null),C=f??S,w=e.useRef(null),T=Gr(n,w),E=e.useRef(null),D=d!==void 0,[O,k]=e.useState(u),A=D?d:O,j=e.useCallback(()=>{D||k(!1)},[D]),M=e.useCallback(()=>{j(),h?.()},[j,h]),N=e.useCallback(()=>g?.(),[g]),P=e.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=e.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=e.useCallback(()=>{c===`instant`&&P()},[c,P]),[L,ee]=e.useState(``),R=e.Children.toArray(i),te=R.find(b0),[z,ne]=si(R.filter(e=>e!==te),{header:h0,footer:c0}),B=te?.props.onClick,re=te?e.cloneElement(te,{ref:C,onClick:e=>{B?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,V={...y0,...typeof s==`string`?{regular:s}:s},ie=V.regular??`anchored`,ae=V.narrow,oe=ie===`anchored`||ae===`anchored`,se=e.useRef(null),[ce,le]=e.useState(null),ue=e.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=Ga(t,e,{side:p,align:m});se.current&&x0(se.current,n)||(se.current=n,le(n))},[C,p,m]);Ur(()=>{if(!A||!oe){se.current=null,le(null);return}ue();let e=new ResizeObserver(ue);return w.current&&e.observe(w.current),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[A,oe,ue]),Ta({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),e.useEffect(()=>{A&&!E.current&&F()},[A,F]),Oa(e=>{A&&(e.preventDefault(),M())});let de=e.useMemo(()=>({panelId:x,title:a,description:o,selectionVariant:c,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,a,o,c,L,M,g,N,F]),fe=e.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:c===`instant`?`single`:c,afterSelect:I,enableFocusZone:!0}),[x,c,I]);return(0,q.jsxs)(q.Fragment,{children:[re,A?(0,q.jsx)(Ba,{children:(0,q.jsx)(`div`,{className:G(_0({variant:ie,narrowVariant:ae})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...ka(`variant`,V),children:(0,q.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":o?`${x}-description`:void 0,className:G(v0({width:v,maxHeight:y,variant:ie,narrowVariant:ae,unplaced:oe&&!ce}),r),style:{"--select-panel-top":`${ce?.top??0}px`,"--select-panel-left":`${ce?.left??0}px`},"data-component":`SelectPanel`,"data-width":v,"data-max-height":y,"data-side":ce?.anchorSide??p,"data-align":ce?.anchorAlign??m,...ka(`variant`,V),...b,children:(0,q.jsx)(`form`,{className:g0.form,onSubmit:P,children:(0,q.jsxs)(a0.Provider,{value:de,children:[z.header??(0,q.jsx)(h0,{}),(0,q.jsx)(`div`,{className:g0.container,children:(0,q.jsx)(gi.Provider,{value:fe,children:ne})}),z.footer]})})})})}):null]})}S0.displayName=`SelectPanel`;var C0=K(S0);const w0={root:`select-panel-loading`,text:`select-panel-loading-text`};function T0(e,t){let{className:n,children:r=`Fetching items...`,...i}=e;return(0,q.jsxs)(`div`,{ref:t,role:`status`,"aria-live":`polite`,className:G(w0.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,q.jsx)(zi,{size:`medium`,srText:null,role:`presentation`}),(0,q.jsx)(`span`,{className:w0.text,children:r})]})}T0.displayName=`SelectPanel.Loading`;var E0=K(T0);const D0={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 O0(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,q.jsxs)(`div`,{ref:t,className:G(D0.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,q.jsx)(jr,{className:G(D0.fullIcon,D0.variant[i]),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:D0.fullTitle,children:o}),(0,q.jsx)(`span`,{className:D0.fullContent,children:r})]}):(0,q.jsxs)(`div`,{ref:t,className:G(D0.inline,D0.variant[i],D0.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,q.jsx)(jr,{className:D0.inlineIcon,"aria-hidden":`true`}),(0,q.jsx)(`div`,{children:r})]})}O0.displayName=`SelectPanel.Message`;var k0=K(O0);const A0={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},j0=e=>{let{id:t,children:n,className:r,...i}=e,a=Y(t);return(0,q.jsxs)(`span`,{className:A0.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,q.jsx)(Gf,{id:a,className:G(A0.box,r),...i}),(0,q.jsx)(`label`,{htmlFor:a,className:A0.small,children:n})]})};function M0(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,q.jsx)(j0,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,q.jsx)(Ul,{className:G(A0.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,q.jsx)($i,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}M0.displayName=`SelectPanel.SecondaryAction`;const N0=Object.assign(C0,{Button:i0,Header:h0,SearchInput:d0,Footer:c0,SecondaryAction:M0,Loading:E0,Message:k0}),P0=W(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function F0(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,variant:a=`default`,...o}=e;return(0,q.jsx)(n,{ref:t,role:`separator`,"aria-orientation":i,className:G(P0({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}F0.displayName=`Separator`;var I0=K(F0);const L0=W(`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`}]}),R0=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function z0(t,n){let{className:r,style:i,size:a=`medium`,orientation:o=`horizontal`,block:s,min:c=0,max:l=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=t,g=d!==void 0,[_,v]=e.useState(()=>f??c),y=g?d:_;return(0,q.jsx)(`input`,{ref:n,type:`range`,min:c,max:l,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:G(L0({size:a,orientation:o,block:s}),r),style:{...i,"--slider-fill":`${R0(y,c,l)}%`},"aria-orientation":o===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":a,"data-orientation":o,"data-block":s,"data-disabled":p,...h})}z0.displayName=`Slider`;var B0=K(z0);const V0={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`},H0={open:null,closed:null,draft:Un,archived:Sn,unavailable:jr,issueOpened:pr,issueClosed:Ln,issueClosedNotPlanned:fr,issueDraft:Un,pullOpened:Fn,pullClosed:Yn,pullMerged:cr,pullQueued:Kn,alertOpened:yr,alertClosed:vr,alertFixed:gr,alertDismissed:_r},U0={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`},W0=W(`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`}}}),G0=W(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function K0(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=H0[i],l=U0[i];return(0,q.jsxs)(n,{ref:t,className:G(W0({size:a,tone:V0[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,q.jsx)(c,{className:G(G0({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}K0.displayName=`StateLabel`;var q0=K(K0);const J0=n({}),Y0={root:`statistic-card-description`};function X0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(Y0.root,n),"data-component":`StatisticCard.Description`,...r})}X0.displayName=`StatisticCard.Description`;var Z0=K(X0);const Q0={root:`statistic-card-label`};function $0(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(J0);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(Q0.root,r),"data-component":`StatisticCard.Label`,...a})}$0.displayName=`StatisticCard.Label`;var e2=K($0);const t2={root:`statistic-card-trailing-visual`};function n2(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(t2.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}n2.displayName=`StatisticCard.TrailingVisual`;var r2=K(n2);const i2={hidden:`sr-only`},a2={increase:Nn,decrease:wn,neutral:br},o2={increase:`Up`,decrease:`Down`,neutral:`No change`},s2={increase:`positive`,decrease:`negative`,neutral:`neutral`},c2=W(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function l2(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=a2[i],c=a??s2[i];return(0,q.jsxs)(`span`,{ref:t,className:G(c2({sentiment:c}),n),"data-component":`StatisticCard.Trend`,"data-direction":i,"data-sentiment":c,...o,children:[(0,q.jsx)(s,{"aria-hidden":!0}),(0,q.jsx)(`span`,{className:i2.hidden,children:o2[i]}),r]})}l2.displayName=`StatisticCard.Trend`;var u2=K(l2);const d2={root:`statistic-card-value`};function f2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(d2.root,n),"data-component":`StatisticCard.Value`,...r})}f2.displayName=`StatisticCard.Value`;var p2=K(f2);const m2={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function h2(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${Y(i)}-label`,[l,u]=si(r,{trailingVisual:r2,label:e2,value:p2,trend:u2,description:Z0}),d=o??(l.label&&!a?c:void 0);return(0,q.jsx)(J0.Provider,{value:{labelId:c},children:(0,q.jsxs)(`div`,{ref:t,id:i,role:d||a?`group`:void 0,"aria-label":a,"aria-labelledby":d,className:G(m2.root,n),"data-component":`StatisticCard`,...s,children:[(0,q.jsxs)(`div`,{className:m2.body,children:[l.label,l.value||l.trend?(0,q.jsxs)(`div`,{className:m2.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}h2.displayName=`StatisticCard`;var g2=K(h2);const _2=Object.assign(g2,{Label:e2,Value:p2,Trend:u2,Description:Z0,TrailingVisual:r2}),v2=n({}),y2={srOnly:`sr-only`},b2=W(`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 x2(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,q.jsx)(v2.Provider,{value:{variant:i,size:a},children:(0,q.jsxs)(n,{ref:t,className:G(b2({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,q.jsx)(`span`,{className:y2.srOnly,children:o}):null,s]})})}x2.displayName=`Status`;var S2=K(x2);const C2=W(`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 w2(t,n){let{className:r,variant:i,size:a,...o}=t,s=e.useContext(v2),c=i??s.variant??`neutral`,l=a??s.size??`medium`;return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(C2({variant:c,size:l}),r),"data-component":`Status.Indicator`,"data-variant":c,"data-size":l,...o})}w2.displayName=`Status.Indicator`;var T2=K(w2);const E2=Object.assign(S2,{Indicator:T2}),D2=n(null),O2=1,k2=W(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),A2=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),j2=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function M2(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=A2(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(k2({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,q.jsx)(D2.Provider,{value:{index:t,status:j2(t,i)},children:e},e.key))})}M2.displayName=`Steps`;var N2=K(M2);const P2={root:`steps-body`};function F2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(P2.root,n),"data-component":`Steps.Body`,...r})}F2.displayName=`Steps.Body`;var I2=K(F2);const L2={root:`steps-description`};function R2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(L2.root,n),"data-component":`Steps.Description`,...r})}R2.displayName=`Steps.Description`;var z2=K(R2);const B2=()=>{let e=o(D2);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},V2={root:`steps-indicator`,icon:`steps-indicator-icon`};function H2(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=B2();return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(V2.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,q.jsx)(Rn,{className:V2.icon}):a+1)})}H2.displayName=`Steps.Indicator`;var U2=K(H2);const W2={root:`steps-item`,status:`sr-only`},G2={complete:`Completed`,current:``,incomplete:`Not completed`};function K2(t,n){let{className:r,children:i,status:a,statusLabel:o,...s}=t,{index:c,status:l}=B2(),u=a??l,d=o??G2[u],f=e.useMemo(()=>({index:c,status:u}),[c,u]);return(0,q.jsx)(D2.Provider,{value:f,children:(0,q.jsxs)(`li`,{ref:n,"aria-current":u===`current`?`step`:void 0,className:G(W2.root,r),"data-component":`Steps.Item`,"data-status":u,"data-index":c,...s,children:[i,d?(0,q.jsx)(`span`,{className:W2.status,children:d}):null]})})}K2.displayName=`Steps.Item`;var q2=K(K2);const J2={root:`steps-title`};function Y2(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(J2.root,n),"data-component":`Steps.Title`,...r})}Y2.displayName=`Steps.Title`;var X2=K(Y2);const Z2=Object.assign(N2,{Item:q2,Indicator:U2,Body:I2,Title:X2,Description:z2}),Q2=n({}),$2=W(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function e4(t,n){let{as:r=`span`,className:i,swap:a=!1,transition:o=`fade`,children:s,...c}=t,l=e.useMemo(()=>({swap:a}),[a]);return(0,q.jsx)(Q2.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G($2({transition:o}),i),"data-component":`Swap`,"data-swap":a?`on`:`off`,"data-transition":o,...c,children:s})})}e4.displayName=`Swap`;var t4=K(e4);const n4={root:`swap-indicator`,active:`swap-indicator-active`};function r4(t,n){let{as:r=`span`,className:i,type:a,...o}=t,{swap:s}=e.useContext(Q2),c=a===(s?`on`:`off`);return(0,q.jsx)(r,{ref:n,"aria-hidden":c?void 0:`true`,className:G(n4.root,c&&n4.active,i),"data-component":`Swap.Indicator`,"data-type":a,"data-active":c,...o})}r4.displayName=`Swap.Indicator`;var i4=K(r4);const a4=Object.assign(t4,{Indicator:i4}),o4=n({}),s4=()=>o(o4),c4=({checked:e,disabled:t,readOnly:n,required:r,invalid:i})=>({"data-state":e?`checked`:`unchecked`,"data-disabled":t||void 0,"data-readonly":n||void 0,"data-required":r||void 0,"data-invalid":i||void 0}),l4={root:`switch`};function u4(t,n){let{className:r,value:i,onClick:a,...o}=t,s=e.useRef(i.checked),c={...i,initialChecked:s.current};return(0,q.jsx)(o4.Provider,{value:c,children:(0,q.jsx)(`label`,{ref:n,id:i.ids.root,htmlFor:i.ids.hiddenInput,className:G(l4.root,r),onClick:e=>{a?.(e),e.target.id===i.ids.hiddenInput&&e.stopPropagation()},"data-component":`Switch`,...c4(i),...o})})}u4.displayName=`Switch.RootProvider`;var d4=K(u4);const f4=(t={})=>{let{checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p}=t,m=e.useContext(Bp),h=n!==void 0,[g,_]=e.useState(!!r),v=h?n:g,y=Y(d),b=e=>{h||_(e),p?.(e)};return{checked:v,disabled:!!(i??m.disabled),readOnly:!!a,required:!!(o??m.required),invalid:!!s,name:c,value:l,form:u,ids:{root:f?.root??y,label:f?.label??`${y}-label`,control:f?.control??`${y}-control`,thumb:f?.thumb??`${y}-thumb`,hiddenInput:f?.hiddenInput??m.id??`${y}-input`},describedBy:[m.validationMessageId,m.captionId].filter(Boolean).join(` `)||void 0,setChecked:b,toggleChecked:()=>b(!v)}};function p4(e,t){let{checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p,...m}=e,h=f4({checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p});return(0,q.jsx)(d4,{ref:t,value:h,...m})}p4.displayName=`Switch`;var m4=K(p4);const h4={root:`switch-control`};function g4(t,n){let{className:r,...i}=t,a=e.useContext(o4);return(0,q.jsx)(`span`,{ref:n,id:a.ids?.control,className:G(h4.root,r),"aria-hidden":`true`,"data-component":`Switch.Control`,...c4(a),...i})}g4.displayName=`Switch.Control`;var _4=K(g4);const v4={root:`switch-hidden-input`,hidden:`sr-only`};function y4(t,n){let{className:r,onChange:i,...a}=t,{checked:o=!1,disabled:s,readOnly:c,required:l,invalid:u,name:d,value:f,form:p,ids:m,describedBy:h,initialChecked:g,setChecked:_}=e.useContext(o4),v=e.useRef(null),y=Gr(n,v),b=e.useRef(()=>{});return e.useEffect(()=>{b.current=()=>_?.(!!g)},[g,_]),e.useEffect(()=>{let e=v.current?.form;if(!e)return;let t=()=>b.current();return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[p]),(0,q.jsx)(`input`,{ref:y,id:m?.hiddenInput,type:`checkbox`,role:`switch`,className:G(v4.root,v4.hidden,r),checked:o,disabled:s,required:l,name:d,value:f,form:p,"aria-labelledby":m?.label,"aria-describedby":h,"aria-invalid":u||void 0,onChange:e=>{i?.(e),!(c||e.nativeEvent.defaultPrevented)&&_?.(e.currentTarget.checked)},"data-component":`Switch.HiddenInput`,...a})}y4.displayName=`Switch.HiddenInput`;var b4=K(y4);const x4={root:`switch-label`};function S4(t,n){let{className:r,...i}=t,a=e.useContext(o4);return(0,q.jsx)(`span`,{ref:n,id:a.ids?.label,className:G(x4.root,r),"data-component":`Switch.Label`,...c4(a),...i})}S4.displayName=`Switch.Label`;var C4=K(S4);const w4={root:`switch-thumb`};function T4(t,n){let{className:r,...i}=t,a=e.useContext(o4);return(0,q.jsx)(`span`,{ref:n,id:a.ids?.thumb,className:G(w4.root,r),"aria-hidden":`true`,"data-component":`Switch.Thumb`,...c4(a),...i})}T4.displayName=`Switch.Thumb`;var E4=K(T4);const D4=Object.assign(m4,{Root:m4,RootProvider:d4,Control:_4,Thumb:E4,Label:C4,HiddenInput:b4}),O4=n({}),k4=()=>o(O4),A4=n(null),j4=()=>o(A4),M4=e=>typeof document>`u`?null:document.getElementById(e),N4=(e,t={})=>{let{scrollElement:n,behavior:r}=t,i=M4(e);if(!i)return!1;if(!n)return i.scrollIntoView?.({behavior:r,block:`start`}),!0;if(!n.contains(i))return!1;let a=i.getBoundingClientRect(),o=n.getBoundingClientRect(),s=z4(getComputedStyle(n).scrollPaddingBlockStart||getComputedStyle(n).scrollPaddingTop),c=z4(getComputedStyle(i).scrollMarginBlockStart||getComputedStyle(i).scrollMarginTop),l=a.top-o.top+n.scrollTop-s-c;return n.scrollTo({top:l,...r&&{behavior:r}}),!0},P4=e=>{let t=e.getAttribute(`href`);if(!t)return null;let n=new URL(t,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname||n.search!==window.location.search)return null;try{return decodeURIComponent(n.hash.slice(1))||null}catch{return null}},F4=e=>{let t=window.location.href;window.history.pushState(null,``,`#${e}`),window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:t,newURL:window.location.href}))},I4=e=>{if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget;if(t.hasAttribute(`download`))return!1;let n=t.getAttribute(`target`);return n===null||n===``||n===`_self`},L4=e=>e===null||e.x===0&&e.y===0&&e.width===0&&e.height===0,R4=(e,t)=>e!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,z4=e=>{let t=Number.parseFloat(e);return Number.isNaN(t)?0:t},B4=`-20px 0% -40% 0%`,V4=[],H4=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),U4=(t={})=>{let{items:n=V4,activeIds:r,defaultActiveIds:i,onActiveChange:a,rootMargin:o=B4,threshold:s=0,scrollElement:c=null,scrollBehavior:l=`smooth`}=t,u=r!==void 0,[d,f]=e.useState(i??[]),p=u?r:d,m=n.filter(e=>p.includes(e.value)),h=e.useRef({items:n,currentActiveIds:p,onActiveChange:a,isControlled:u});e.useEffect(()=>{h.current={items:n,currentActiveIds:p,onActiveChange:a,isControlled:u}});let g=e.useCallback(e=>{let t=h.current;H4(t.currentActiveIds,e)||(t.isControlled||f(e),t.onActiveChange?.({activeIds:e,activeItems:t.items.filter(t=>e.includes(t.value))}))},[]),_=n.map(e=>e.value).join(),v=Array.isArray(s)?s.join():String(s);return e.useEffect(()=>{let e=h.current.items;if(e.length===0||typeof IntersectionObserver>`u`)return;let t=new Map,n=new IntersectionObserver(e=>{for(let n of e)t.set(n.target.id,n.isIntersecting);let n=h.current.items.filter(e=>t.get(e.value)).map(e=>e.value);n.length!==0&&g(n)},{rootMargin:o,threshold:s,root:c});for(let t of e){let e=M4(t.value);e&&n.observe(e)}return()=>{n.disconnect()}},[_,o,v,c,g]),{items:n,activeIds:p,activeItems:m,setActiveIds:g,scrollTo:(e,t)=>N4(e,{scrollElement:c,behavior:t?.behavior??l}),getItemState:e=>({active:p.includes(e.value),first:e.value===p[0],last:e.value===p[p.length-1],depth:e.depth})}},W4={root:`table-of-contents`};function G4(t,n){let{as:r=`div`,className:i,id:a,items:o,activeIds:s,defaultActiveIds:c,rootMargin:l,threshold:u,scrollElement:d,scrollBehavior:f=`smooth`,autoScroll:p=!0,onActiveChange:m,children:h,...g}=t,_=Y(a),v=e.useMemo(()=>({root:_,title:`${_}-title`,list:`${_}-list`,indicator:`${_}-indicator`,item:e=>`${_}-item-${e}`,link:e=>`${_}-link-${e}`}),[_]),[y,b]=e.useState(null),x=d===void 0?y:d,[S,C]=e.useState(!1),w=U4({items:o,activeIds:s,defaultActiveIds:c,onActiveChange:m,rootMargin:l,threshold:u,scrollElement:x,scrollBehavior:f}),T=w.activeIds[0];e.useEffect(()=>{!p||T===void 0||document.getElementById(v.item(T))?.scrollIntoView?.({behavior:f,block:`nearest`})},[p,T,v,f]);let E={...w,ids:v,scrollElement:x,setScrollElement:b,hasTitle:S,setHasTitle:C};return(0,q.jsx)(O4.Provider,{value:E,children:(0,q.jsx)(r,{ref:n,id:v.root,className:G(W4.root,i),"data-component":`TableOfContents`,...g,children:h})})}G4.displayName=`TableOfContents`;var K4=K(G4);const q4={root:`table-of-contents-content`};function J4(e,t){let{as:n=`article`,className:r,...i}=e,{setScrollElement:a}=k4(),o=Gr(t,a);return(0,q.jsx)(n,{ref:o,className:G(q4.root,r),"data-component":`TableOfContents.Content`,...i})}J4.displayName=`TableOfContents.Content`;var Y4=K(J4);const X4={root:`table-of-contents-indicator`},Z4=e=>e===void 0?void 0:`${e}px`;function Q4(t,n){let{as:r=`div`,className:i,style:a,...o}=t,{ids:s,activeIds:c}=k4(),[l,u]=e.useState(null),d=c?.join()??``;return Ur(()=>{let e=c??[];if(!s||e.length===0){u(null);return}let t=document.getElementById(s.list),n=document.getElementById(s.item(e[0])),r=document.getElementById(s.item(e[e.length-1]));if(!n){u(null);return}let i=()=>{let e=n.getBoundingClientRect(),i=t?.getBoundingClientRect(),a=t&&i?e.left-i.left+t.scrollLeft:0,o=t&&i?e.top-i.top+t.scrollTop:0,s=r&&r!==n?r.getBoundingClientRect().bottom-e.top:e.height,c={x:a,y:o,width:e.width,height:s};u(e=>R4(e,c)?e:c)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),r&&r!==n&&a.observe(r),t&&a.observe(t),()=>{a.disconnect()}},[d,s]),(0,q.jsx)(r,{ref:n,id:s?.indicator,"aria-hidden":`true`,hidden:L4(l),className:G(X4.root,i),style:{...a,"--table-of-contents-indicator-x":Z4(l?.x),"--table-of-contents-indicator-y":Z4(l?.y),"--table-of-contents-indicator-width":Z4(l?.width),"--table-of-contents-indicator-height":Z4(l?.height)},"data-component":`TableOfContents.Indicator`,...o})}Q4.displayName=`TableOfContents.Indicator`;var $4=K(Q4);const e3={root:`table-of-contents-item`};function t3(e,t){let{as:n=`li`,className:r,item:i,style:a,...o}=e,{ids:s,getItemState:c}=k4(),l=c?.(i);return(0,q.jsx)(A4.Provider,{value:i,children:(0,q.jsx)(n,{ref:t,id:s?.item(i.value),className:G(e3.root,r),style:{...a,"--table-of-contents-item-depth":i.depth},"data-component":`TableOfContents.Item`,"data-value":i.value,"data-depth":i.depth,"data-active":l?.active?``:void 0,"data-first":l?.first?``:void 0,"data-last":l?.last?``:void 0,...o})})}t3.displayName=`TableOfContents.Item`;var n3=K(t3);const r3={root:`table-of-contents-link`};function i3(e,t){let{as:n=`a`,className:r,onClick:i,...a}=e,{ids:o,scrollElement:s,scrollTo:c,getItemState:l}=k4(),u=j4(),d=u&&l?.(u);return(0,q.jsx)(n,{ref:t,id:u?o?.link(u.value):void 0,className:G(r3.root,r),"aria-current":d?.active?`location`:void 0,"data-component":`TableOfContents.Link`,"data-value":u?.value,"data-active":d?.active?``:void 0,onClick:e=>{if(i?.(e),e.defaultPrevented||!s||!I4(e))return;let t=P4(e.currentTarget);!t||!c?.(t)||(e.preventDefault(),F4(t))},...a})}i3.displayName=`TableOfContents.Link`;var a3=K(i3);const o3={root:`table-of-contents-list`};function s3(e,t){let{as:n=`ul`,className:r,...i}=e,{ids:a}=k4();return(0,q.jsx)(n,{ref:t,id:a?.list,className:G(o3.root,r),"data-component":`TableOfContents.List`,...i})}s3.displayName=`TableOfContents.List`;var c3=K(s3);const l3={root:`table-of-contents-nav`};function u3(e,t){let{as:n=`nav`,className:r,placement:i,...a}=e,{ids:o,hasTitle:s}=k4();return(0,q.jsx)(n,{ref:t,"aria-labelledby":s?o?.title:void 0,className:G(l3.root,r),"data-component":`TableOfContents.Nav`,"data-placement":i,...a})}u3.displayName=`TableOfContents.Nav`;var d3=K(u3);const f3={root:`table-of-contents-title`};function p3(e,t){let{as:n=`h2`,className:r,...i}=e,{ids:a,setHasTitle:o}=k4();return Ur(()=>(o?.(!0),()=>o?.(!1)),[o]),(0,q.jsx)(n,{ref:t,id:a?.title,className:G(f3.root,r),"data-component":`TableOfContents.Title`,...i})}p3.displayName=`TableOfContents.Title`;var m3=K(p3);const h3=Object.assign(K4,{Root:K4,Content:Y4,Nav:d3,Title:m3,List:c3,Item:n3,Link:a3,Indicator:$4}),g3=n(null);function _3(t){let{children:n,id:r,value:i,defaultValue:a,onChange:o}=t,s=Y(r),c=i!==void 0,[l,u]=e.useState(a),d=c?i:l,f=e.useRef(o);Ur(()=>{f.current=o},[o]);let p=e.useMemo(()=>({groupId:s,selectedValue:d,selectTab:e=>{c||u(e),f.current?.(e)}}),[s,d,c]);return(0,q.jsx)(g3.Provider,{value:p,children:n})}_3.displayName=`Tabs`;const v3=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},y3=()=>{let e=o(g3);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},b3=e=>{let{value:t,disabled:n}=e,r=y3(),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)}}}},x3={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function S3(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=b3({value:r,disabled:i});return(0,q.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:v3(a,u.onKeyDown),onMouseDown:v3(o,u.onMouseDown),onFocus:v3(s,u.onFocus),className:G(x3.root,x3.vertical,x3.hover,l&&x3.selected,i&&x3.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}S3.displayName=`Tabs.Tab`;var C3=K(S3);const w3=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),T3=t=>{let{"aria-label":n,"aria-labelledby":r,"aria-orientation":i,ref:a}=t,o=e.useRef(null),s=Gr(a,o),c=i??`horizontal`;return{tabListProps:{ref:s,role:`tablist`,"aria-label":n,"aria-labelledby":r,"aria-orientation":c,onKeyDown:e=>{let t=o.current;if(!t)return;let n=c===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,a=e.key===`Home`||e.key===`End`,s=e.key===r?1:e.key===i?-1:0;if(s===0&&!a)return;e.preventDefault(),e.stopPropagation();let l=w3(t);if(l.length===0)return;if(a){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+s+l.length)%l.length].focus()}}}},E3={root:`tab-list`,vertical:`tab-list-vertical`};function D3(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=T3({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,q.jsx)(`div`,{...s,...c,onKeyDown:v3(r,c.onKeyDown),className:G(E3.root,l&&E3.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}D3.displayName=`Tabs.List`;var O3=K(D3);const k3=e=>{let{value:t}=e,n=y3(),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 A3(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=k3({value:r});return(0,q.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}A3.displayName=`Tabs.Panel`;var j3=K(A3);const M3=Object.assign(_3,{List:O3,Tab:C3,Panel:j3}),N3={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},P3=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function F3(e,t){let{className:n,clipSidebar:r,...i}=e,a=P3(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(N3.root,(a===`start`||a===`both`)&&N3.clipStart,(a===`end`||a===`both`)&&N3.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}F3.displayName=`Timeline`;var I3=K(F3);const L3={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function R3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(L3.root,L3.narrow,n),"data-component":`Timeline.Actions`,...r})}R3.displayName=`Timeline.Actions`;var z3=K(R3);const B3={root:`timeline-avatar`};function V3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(B3.root,n),"data-component":`Timeline.Avatar`,...r})}V3.displayName=`Timeline.Avatar`;var H3=K(V3);const U3={wrapper:`timeline-badge-wrapper`},W3=W(`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 G3(e,t){let{className:n,variant:r,...i}=e;return(0,q.jsx)(`div`,{className:U3.wrapper,children:(0,q.jsx)(`div`,{ref:t,className:G(W3({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}G3.displayName=`Timeline.Badge`;var K3=K(G3);const q3={root:`timeline-body`};function J3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(q3.root,n),"data-component":`Timeline.Body`,...r})}J3.displayName=`Timeline.Body`;var Y3=K(J3);const X3={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function Z3(e,t){let{className:n,...r}=e;return(0,q.jsx)(`li`,{ref:t,role:`presentation`,className:G(X3.root,X3.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}Z3.displayName=`Timeline.Break`;var Q3=K(Z3);const $3={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 e6(e,t){let{className:n,condensed:r,...i}=e;return(0,q.jsx)(`li`,{ref:t,className:G($3.root,$3.rail,$3.narrow,r&&$3.condensed,r&&$3.condensedBadge,r&&$3.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}e6.displayName=`Timeline.Item`;var t6=K(e6);const n6=Object.assign(I3,{Item:t6,Avatar:H3,Badge:K3,Body:Y3,Break:Q3,Actions:z3}),r6=n({}),i6=()=>o(r6);var a6=Pe(Me(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))}))());Wu.default.extend(a6.default);const o6=e=>{let t=Wu.default.duration(Math.max(e,0));return{days:Math.floor(t.asDays()),hours:Math.floor(t.asHours())%24,minutes:Math.floor(t.asMinutes())%60,seconds:Math.floor(t.asSeconds())%60,milliseconds:Math.floor(t.asMilliseconds())%1e3}},s6=e=>{let t=Wu.default.duration(e);return{days:t.format(`DD`),hours:t.format(`HH`),minutes:t.format(`mm`),seconds:t.format(`ss`),milliseconds:t.format(`SSS`)}},c6=()=>(0,Wu.default)(),l6=1e3,u6=(e,t)=>t>0?Math.floor(e/t)*t:e,d6=(e,t,n,r)=>r?Math.max(t-e,n??0):n===void 0?t+e:Math.min(t+e,n),f6=(t={})=>{let{countdown:n=!1,startMs:r=0,targetMs:i,interval:a=l6,autoStart:o=!1,onTick:s,onComplete:c}=t,[l,u]=e.useState(o?`running`:`idle`),[d,f]=e.useState(0),[p,m]=e.useState(c6),h=n?i??0:i,g=d6(u6(d,a),r,h,n),_=o6(g),v=s6(_),y=h!==void 0&&(n?g<=h:g>=h),b=e.useRef(s),x=e.useRef(c);return e.useEffect(()=>{b.current=s,x.current=c},[s,c]),e.useEffect(()=>{if(l!==`running`)return;let e=window.setInterval(()=>{let e=c6().diff(p),t=d6(u6(e,a),r,h,n),i=o6(t);f(e),b.current?.({value:t,time:i,formattedTime:s6(i)})},a);return()=>{window.clearInterval(e)}},[l,a,p,r,h,n]),e.useEffect(()=>{l!==`running`||!y||(u(`completed`),x.current?.())},[l,y]),{value:g,time:_,formattedTime:v,status:l,running:l===`running`,paused:l===`paused`,completed:l===`completed`,start:()=>{m(c6()),f(0),u(`running`)},pause:()=>{l===`running`&&(f(c6().diff(p)),u(`paused`))},resume:()=>{l===`paused`&&(m(c6().subtract(d,`millisecond`)),u(`running`))},reset:()=>{m(c6()),f(0),u(`idle`)}}},p6={root:`timer`};function m6(e,t){let{as:n=`div`,className:r,countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u,children:d,...f}=e,p=f6({countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u});return(0,q.jsx)(r6.Provider,{value:p,children:(0,q.jsx)(n,{ref:t,className:G(p6.root,r),"data-component":`Timer`,"data-status":p.status,...f,children:d})})}m6.displayName=`Timer`;var h6=K(m6);const g6={root:`timer-action-trigger`},_6={start:e=>e!==`running`,pause:e=>e===`running`,resume:e=>e===`paused`,reset:e=>e!==`idle`};function v6(t,n){let{className:r,action:i,disabled:a,onClick:o,children:s,...c}=t,l=e.useContext(r6),u=l.status??`idle`,d={start:l.start,pause:l.pause,resume:l.resume,reset:l.reset}[i];return(0,q.jsx)($i,{ref:n,disabled:a??!_6[i](u),onClick:e=>{o?.(e),!e.defaultPrevented&&d?.()},className:G(g6.root,r),"data-component":`Timer.ActionTrigger`,"data-action":i,...c,children:s})}v6.displayName=`Timer.ActionTrigger`;var y6=K(v6);const b6={root:`timer-area`};function x6(t,n){let{as:r=`div`,className:i,...a}=t,{status:o}=e.useContext(r6);return(0,q.jsx)(r,{ref:n,role:`timer`,className:G(b6.root,i),"data-component":`Timer.Area`,"data-status":o,...a})}x6.displayName=`Timer.Area`;var S6=K(x6);const C6={root:`timer-control`};function w6(t,n){let{as:r=`div`,className:i,...a}=t,{status:o}=e.useContext(r6);return(0,q.jsx)(r,{ref:n,className:G(C6.root,i),"data-component":`Timer.Control`,"data-status":o,...a})}w6.displayName=`Timer.Control`;var T6=K(w6);const E6={root:`timer-item`};function D6(t,n){let{as:r=`div`,className:i,type:a,children:o,...s}=t,{formattedTime:c}=e.useContext(r6);return(0,q.jsx)(r,{ref:n,className:G(E6.root,i),"data-component":`Timer.Item`,"data-unit":a,...s,children:o??c?.[a]})}D6.displayName=`Timer.Item`;var O6=K(D6);const k6={root:`timer-separator`};function A6(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(k6.root,r),"data-component":`Timer.Separator`,...i})}A6.displayName=`Timer.Separator`;var j6=K(A6);const M6=Object.assign(h6,{Root:h6,Area:S6,Item:O6,Separator:j6,Control:T6,ActionTrigger:y6});let N6=[],P6=0;const F6=new Set,I6=()=>{for(let e of F6)e()},L6=e=>(F6.add(e),()=>{F6.delete(e)}),R6=()=>N6,z6=[],B6=()=>z6,V6=e=>(N6=N6.some(t=>t.id===e.id)?N6.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...N6],I6(),e.id),H6=e=>(N6=N6.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),I6(),e),U6=e=>{N6=N6.filter(t=>t.id!==e),I6()},W6=()=>`toast-${++P6}`,G6=(e,t,n={})=>V6({...n,id:n.id??W6(),title:t,variant:e}),K6=(e,t)=>typeof e==`function`?e(t):e,q6=(e,t,n={})=>{let r=n.id??W6();G6(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){H6(r);return}G6(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,K6(t.success,e)),e=>i(`error`,K6(t.error,e))),r},J6=(e,t)=>G6(`default`,e,t),Y6=Object.assign(J6,{message:J6,success:(e,t)=>G6(`success`,e,t),error:(e,t)=>G6(`error`,e,t),warning:(e,t)=>G6(`warning`,e,t),info:(e,t)=>G6(`info`,e,t),loading:(e,t)=>G6(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>V6({...t,id:t.id??W6(),variant:`default`,render:e}),promise:q6,dismiss:H6,getToasts:R6}),X6={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`},Z6={default:null,success:Ln,error:Qn,warning:jr,info:ir,loading:null},Q6=t=>typeof t==`object`&&!!t&&`label`in t&&!e.isValidElement(t);function $6(t){let{toast:n,place:r,position:i,height:a,frontHeight:o,stackSize:s,expanded:c,visible:l,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=t,{id:h,variant:g,title:_,description:v,render:y}=n,b=n.duration??p.duration,x=n.dismissible??p.dismissible,S=n.closeButton??p.closeButton,C=n.richColors??p.richColors,w=n.important??p.important??!1,T=e.useRef(null),[E,D]=e.useState(!1),[O,k]=e.useState({x:0,y:0}),[A,j]=e.useState(!1),[M,N]=e.useState(!1),P=e.useRef(null),F=!!n.dismissed,I=r.index===0,L=E&&!c&&!I,ee=!!y,R=i.startsWith(`top`)?`top`:`bottom`,te=e=>{n.dismissed||(H6(h),e===`timeout`?n.onAutoClose?.(n):n.onDismiss?.(n))};e.useEffect(()=>{D(!0)},[]);let z=e.useRef({revision:-1,time:b});e.useEffect(()=>{if(z.current.revision!==n.revision&&(z.current={revision:n.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),t=window.setTimeout(()=>te(`timeout`),Math.max(z.current.time,0));return()=>{window.clearTimeout(t),z.current.time-=Date.now()-e}},[n,b,u,F]),e.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>U6(h),200);return()=>{window.clearTimeout(e)}},[F,h]),Ur(()=>{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,n.revision,_,v,c]);let ne=e=>d.includes(e),B=(e,t,n)=>e<0?ne(t)?e:0:ne(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))},V=e=>{let t=P.current;!t||t.pointerId!==e.pointerId||k({x:B(e.clientX-t.x,`left`,`right`),y:B(e.clientY-t.y,`top`,`bottom`)})},ie=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),te(`swipe`)},ae=()=>{P.current=null,j(!1),k({x:0,y:0})},oe=c?`calc(var(--toast-lift) * var(--toast-offset))`:`calc(var(--toast-lift) * var(--toaster-gap) * var(--toast-index))`,se=`calc(var(--toast-lift) * -100%)`,ce={"--toast-index":r.index,"--toast-offset":`${r.offset}px`,"--toast-z-index":s-r.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?o:a),"--toast-shift":E?!F||M?oe:I?se:c?`calc(${oe} + ${se})`:oe:se,"--toast-scale":L?Math.max(1-r.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},le=Z6[g],ue=n.icon===void 0?f?.[g]:n.icon,de=ue===void 0?g===`loading`?(0,q.jsx)(zi,{size:`small`,srText:null}):le?(0,q.jsx)(le,{}):null:ue,fe=(e,t,n)=>Q6(e)?(0,q.jsx)($i,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||te(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,pe=n.action!==void 0||n.cancel!==void 0;return(0,q.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:G(X6.root,X6.lift[R],X6.bridge,R===`top`?X6.bridgeTop:X6.bridgeBottom,x&&X6.grabbable,!ee&&X6.card,!ee&&X6.iconColor[g],!ee&&C&&X6.richColors[g],(!E||F||!l)&&X6.hidden,!l&&X6.waiting,A?X6.dragging:X6.animated,p.className,n.className),style:ce,"data-component":`Toast`,"data-variant":g,"data-position":i,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":c,"data-stacked":L,"data-visible":l,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:V,onPointerUp:ie,onPointerCancel:ae,children:ee?y?.(n):(0,q.jsxs)(`div`,{className:G(X6.body,L&&X6.bodyStacked),"data-component":`Toast.Body`,children:[de===null?null:(0,q.jsx)(`span`,{className:X6.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:de}),(0,q.jsxs)(`div`,{className:X6.content,"data-component":`Toast.Content`,children:[(0,q.jsx)(`div`,{className:X6.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,q.jsx)(`div`,{className:X6.description,"data-component":`Toast.Description`,children:v})]}),pe?(0,q.jsxs)(`div`,{className:X6.actions,"data-component":`Toast.Actions`,children:[fe(n.cancel,`cancel`,`invisible`),fe(n.action,`action`,`default`)]}):null,S&&x?(0,q.jsx)(na,{icon:Xn,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>te(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}$6.displayName=`Toast`;const e8=W(`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`}}}),t8=[`altKey`,`KeyT`],n8=e=>typeof e==`number`?`${e}px`:e,r8=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},i8=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),a8=()=>document.visibilityState===`hidden`,o8=()=>!1;function s8(t,n){let{position:r=`bottom-right`,expand:i=!1,visibleToasts:a=3,toastOptions:o,duration:s=4e3,closeButton:c=!1,richColors:l=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=t8,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=t,x=e.useSyncExternalStore(L6,R6,B6),S=e.useSyncExternalStore(i8,a8,o8),C=e.useRef(null),w=Gr(n,C),[T,E]=e.useState({}),[D,O]=e.useState(!1),k=i||D,A=e.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);e.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=e.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;e.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:s,closeButton:c,richColors:l,dismissible:!0,...o},L=h??r8(r);return(0,q.jsx)(Ba,{children:(0,q.jsx)(`section`,{"aria-label":_,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,tabIndex:-1,"data-component":`Toaster.Region`,children:(0,q.jsx)(`ol`,{ref:w,tabIndex:-1,className:G(e8({position:r}),v),style:{...y,"--toaster-width":n8(p),"--toaster-viewport-offset":n8(d),"--toaster-mobile-offset":n8(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":r,"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,q.jsx)($6,{toast:e,place:t,position:r,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<a,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}s8.displayName=`Toaster`;var c8=K(s8);const l8=W(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),u8=`medium`,d8=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function f8(e,t){let{as:n=`span`,className:r,size:i=u8,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=d8({as:n,onClick:c.onClick,onFocus:c.onFocus,tabIndex:c.tabIndex,disabled:c.disabled});return(0,q.jsx)(n,{ref:t,onKeyDown:e=>{s?.(e),(e.key===`Backspace`||e.key===`Delete`)&&o?.()},className:G(l8({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})}f8.displayName=`TokenBase`;var p8=K(f8);const m8=W(`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 h8(e){let{className:t,size:n=u8,isParentInteractive:r,...i}=e,a=G(m8({size:n,raised:r}),t);return r?(0,q.jsx)(`span`,{"aria-hidden":`true`,tabIndex:-1,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(Xn,{})}):(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(Xn,{})})}h8.displayName=`Token.RemoveButton`;const g8={root:`token-text`,interactive:`token-text-interactive`};function _8(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(g8.root,i&&g8.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}_8.displayName=`Token.Text`;var v8=K(_8);const y8={srOnly:`sr-only`},b8=W(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),x8=W(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),S8=t=>e.isValidElement(t)?t:(0,q.jsx)(t,{});function C8(e,t){let{as:n,className:r,text:i,size:a=u8,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=d8({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,q.jsxs)(p8,{ref:t,size:a,isSelected:l,onRemove:s,className:G(b8({interactive:p,selected:l,withRemoveButton:m}),r),"data-has-remove-button":m?``:void 0,...h?{}:g,...f,children:[o&&a!==`small`?(0,q.jsx)(`span`,{className:G(x8({size:a})),"data-component":`Token.LeadingVisual`,children:S8(o)}):null,(0,q.jsxs)(v8,{interactive:h,...h?g:{},children:[i,s?(0,q.jsx)(`span`,{className:y8.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,q.jsx)(h8,{size:a,isParentInteractive:p,onClick:_}):null]})}C8.displayName=`Token`;var w8=K(C8);const T8=`#999999`,E8=.6,D8=(e,t,n)=>Math.max(t,Math.min(e,n)),O8=e=>D8(Math.round(e),0,100),k8=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}},A8=({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)}},j8=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,M8=e=>{let t=k8(e)??k8(`#999999`),{h:n,s:r,l:i}=A8(t),a=j8(t),{r:o,g:s,b:c}=t,l=D8(1/(.453-a),0,1),u=D8((a-.96)*100,0,1),d=(E8-a)*100*D8(1/(E8-a),0,1),f=O8(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${O8(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${O8(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}%, ${O8(i+10)}%, 0.3)`}}},N8={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function P8(t,n){let{as:r,className:i,style:a,text:o,size:s=u8,fillColor:c=T8,onRemove:l,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=t,h=e.useMemo(()=>M8(c),[c]),g=d8({as:r,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!l&&!u,v=g&&_,y={as:r,href:f,onClick:p},b=e=>{e.stopPropagation(),l?.()};return(0,q.jsxs)(p8,{ref:n,size:s,isSelected:d,onRemove:l,className:G(N8.root,g&&N8.interactive,d&&N8.selected,_&&N8.withRemoveButton,i),style:{...a,"--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,q.jsxs)(v8,{interactive:v,...v?y:{},children:[o,l?(0,q.jsx)(`span`,{className:N8.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,q.jsx)(h8,{size:s,isParentInteractive:g,onClick:b}):null]})}P8.displayName=`IssueLabelToken`;var F8=K(P8);const I8={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function L8(e,t){let{as:n=`a`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(I8.root,I8.interactive,I8.hover,r),"data-component":`TopicTag`,...i})}L8.displayName=`TopicTag`;var R8=K(L8);const z8={root:`topic-tag-group`};function B8(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(z8.root,r),"data-component":`TopicTag.Group`,...i})}B8.displayName=`TopicTag.Group`;var V8=K(B8);const H8=Object.assign(R8,{Group:V8}),U8=n(null),W8=n(null),G8=4,K8=8,q8=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,J8=e=>e!==null&&e.effect===void 0,Y8=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function X8(t){let{steps:n,step:r,defaultStep:i=null,onStepChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,onStatusChange:l,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=t,_=Y(h),v=`${_}-title`,y=`${_}-description`,b=e.useRef(null),x=o!==void 0,[S,C]=e.useState(s),w=x?o:S,T=r!==void 0,[E,D]=e.useState(i),O=T?r:E,k=n.length,A=n.findIndex(e=>e.id===O),j=A===-1?null:n[A],M=e.useCallback(e=>{T||D(e),a?.({stepId:e,stepIndex:n.findIndex(t=>t.id===e),count:n.length})},[T,a,n]),N=e.useCallback(e=>{x||C(e),c?.(e)},[x,c]),P=e.useCallback(e=>{let t=e??n[0]?.id??null;M(t),N(!0),l?.({status:`started`})},[N,M,l,n]),F=e.useCallback(e=>{n.some(t=>t.id===e)&&M(e)},[M,n]),I=e.useCallback(()=>{M(null),N(!1)},[N,M]),L=e.useCallback(()=>{I(),l?.({status:`dismissed`})},[I,l]),ee=e.useCallback(()=>{let e=n[A+1];if(!e){I(),l?.({status:`completed`});return}M(e.id)},[M,I,l,A,n]),R=e.useCallback(()=>{let e=A>0?n[A-1]:void 0;e&&M(e.id)},[M,A,n]),[te,z]=e.useState(()=>({stepId:O,ready:J8(j),patch:null}));te.stepId!==O&&z({stepId:O,ready:J8(j),patch:null});let ne=te.stepId===O?te:null,B=ne?.ready??J8(j),re=ne?.patch??null,V=e.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ie=q8(V),ae=e.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});Ur(()=>{ae.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let oe=e.useMemo(()=>({next:()=>ae.current.next(),prev:()=>ae.current.prev(),goto:e=>ae.current.goto(e),dismiss:()=>ae.current.dismiss(),show:()=>z(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>z(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>ae.current.step?.target?.()??null}),[O]);e.useEffect(()=>{if(w)return ae.current.step?.effect?.(oe)??void 0},[oe,w]);let se=e.useCallback(()=>ae.current.step?.target?.()??null,[]),[ce,le]=e.useState(null),ue=e.useCallback(()=>{let e=se();if(!e){le(null);return}let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),a={top:t,left:n,width:r,height:i};le(e=>e&&Y8(e,a)?e:a)},[se]);Ur(()=>{if(!w||!B){le(null);return}ue();let e=se();e?.scrollIntoView?.({block:`center`,inline:`nearest`});let t=new ResizeObserver(ue);return e&&t.observe(e),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[se,ue,w,B,O]),Oa(e=>{!w||!d||(e.preventDefault(),L())}),e.useEffect(()=>{if(!w||!B||!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,B]),e.useEffect(()=>{if(!w||!B||!f)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(b.current?.contains(t)||se()?.contains(t)||L())};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,L,se,w,B]),e.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let de=e.useMemo(()=>({open:w,step:V,stepIndex:A,steps:n,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,V,A,n]),fe=e.useMemo(()=>({...de,titleId:v,descriptionId:y,stepType:ie,ready:B,targetRect:ce,getTarget:se,spotlightOffset:p,spotlightRadius:m,contentRef:b}),[de,y,se,B,p,m,ie,ce,v]);return(0,q.jsx)(U8.Provider,{value:fe,children:g})}X8.displayName=`Tour`;const Z8=[];function Q8(t){let n=e.useContext(U8);return(0,q.jsx)(q.Fragment,{children:t.children(n?.step?.actions??Z8)})}Q8.displayName=`Tour.Actions`;const $8={root:`tour-action-trigger`};function e5(t,n){let{action:r,className:i,children:a,onClick:o,variant:s=`default`,...c}=t,l=e.useContext(U8);return l?(0,q.jsx)($i,{ref:n,variant:s,className:G($8.root,i),onClick:e=>{if(o?.(e),!e.defaultPrevented){if(typeof r.action==`function`){r.action(l);return}r.action===`next`?l.next():r.action===`prev`?l.prev():l.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof r.action==`string`?r.action:`custom`,...c,children:a??r.label}):null}e5.displayName=`Tour.ActionTrigger`;var t5=K(e5);const n5={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},r5={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 i5(t,n){let r=e.useContext(U8),i=e.useContext(W8);if(!r||!i||r.stepType!==`tooltip`||r.step?.arrow===!1)return null;let a=n5[i.side],o=`${a}${r5[a][i.align]}`;return(0,q.jsx)(qd,{ref:n,location:o,"data-component":`Tour.Arrow`,...t})}i5.displayName=`Tour.Arrow`;var a5=K(i5);const o5=W([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function s5(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(U8);if(!s||!s.open||!s.ready||s.step?.backdrop===!1)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Ba,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(o5({spotlit:c!==null}),r),style:{...i,"--tour-target-top":`${(c?.top??0)-l}px`,"--tour-target-left":`${(c?.left??0)-l}px`,"--tour-target-width":`${(c?.width??0)+l*2}px`,"--tour-target-height":`${(c?.height??0)+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":c?``:void 0,...o})})}s5.displayName=`Tour.Backdrop`;var c5=K(s5);const l5={root:`tour-close-trigger`};function u5(t,n){let{className:r,icon:i=Xn,onClick:a,"aria-label":o=`Close tour`,...s}=t,c=e.useContext(U8);return c?(0,q.jsx)(na,{ref:n,icon:i,variant:`invisible`,size:`small`,"aria-label":o,className:G(l5.root,r),onClick:e=>{a?.(e),!e.defaultPrevented&&c.dismiss()},"data-component":`Tour.CloseTrigger`,...s}):null}u5.displayName=`Tour.CloseTrigger`;var d5=K(u5);const f5={root:`tour-content`};function p5(t,n){let{className:r,...i}=t,a=e.useContext(U8),o=Gr(n,a?.contentRef??null),s=a?.step?.id??null,c=a?.ready??!1,l=a?.contentRef;return e.useEffect(()=>{!c||!s||l?.current?.focus()},[l,c,s]),!a||!a.open||!a.ready||!a.step?null:(0,q.jsx)(`div`,{ref:o,role:`dialog`,"aria-labelledby":a.step.title?a.titleId:void 0,"aria-describedby":a.step.description?a.descriptionId:void 0,tabIndex:-1,className:G(f5.root,r),"data-component":`Tour.Content`,"data-type":a.stepType,"data-step":a.step.id,...i})}p5.displayName=`Tour.Content`;var m5=K(p5);const h5={root:`tour-control`};function g5(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(h5.root,n),"data-component":`Tour.Control`,...r})}g5.displayName=`Tour.Control`;var _5=K(g5);const v5={root:`tour-description`};function y5(t,n){let{className:r,children:i,...a}=t,o=e.useContext(U8);return o?(0,q.jsx)(`div`,{ref:n,id:o.descriptionId,className:G(v5.root,r),"data-component":`Tour.Description`,...a,children:i??o.step?.description}):null}y5.displayName=`Tour.Description`;var b5=K(y5);const x5=W([`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:``}}}),S5=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function C5(t,n){let{side:r=`outside-bottom`,align:i=`center`,placement:a=`bottom-end`,portalContainerName:o,className:s,style:c,children:l,...u}=t,d=e.useContext(U8),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??r,g=f?.align??i,_=f?.placement??a,v=!!(d?.open&&d.ready&&f),y=e.useRef(null),b=Gr(n,y),x=e.useRef(null),[S,C]=e.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=e.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=Ga(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&S5(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return Ur(()=>{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,q.jsx)(Ba,{containerName:o,children:(0,q.jsx)(`div`,{ref:b,className:G(x5({type:p,unplaced:m&&!S}),s),style:{...c,"--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,q.jsx)(W8.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:l})})})}C5.displayName=`Tour.Positioner`;var w5=K(C5);const T5={root:`tour-progress-text`};function E5(t,n){let{className:r,children:i,...a}=t,o=e.useContext(U8);return o?(0,q.jsx)(`div`,{ref:n,className:G(T5.root,r),"data-component":`Tour.ProgressText`,...a,children:i??o.progressText}):null}E5.displayName=`Tour.ProgressText`;var D5=K(E5);const O5={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function k5(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(U8);if(!s||!s.open||!s.ready||!s.targetRect)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Ba,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(O5.root,r),style:{...i,"--tour-target-top":`${c.top-l}px`,"--tour-target-left":`${c.left-l}px`,"--tour-target-width":`${c.width+l*2}px`,"--tour-target-height":`${c.height+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...o})})}k5.displayName=`Tour.Spotlight`;var A5=K(k5);const j5={root:`tour-title`};function M5(t,n){let{className:r,children:i,...a}=t,o=e.useContext(U8);return o?(0,q.jsx)(`h2`,{ref:n,id:o.titleId,className:G(j5.root,r),"data-component":`Tour.Title`,...a,children:i??o.step?.title}):null}M5.displayName=`Tour.Title`;var N5=K(M5);const P5=()=>{let e=o(U8);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},F5=(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]},I5=(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()]},L5=(e,t)=>F5(e,t),R5=(e,t,n)=>F5(()=>{let n=e();return n&&n.value===t?n:null},n),z5=Object.assign(X8,{Backdrop:c5,Spotlight:A5,Positioner:w5,Content:m5,Arrow:a5,CloseTrigger:d5,ProgressText:D5,Title:N5,Description:b5,Control:_5,Actions:Q8,ActionTrigger:t5}),B5=125,V5={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function H5(e,t){let{as:n=`div`,className:r,title:i,maxWidth:a=125,inline:o,expandable:s,style:c,...l}=e;return(0,q.jsx)(n,{ref:t,title:i,className:G(V5.root,o?V5.inline:V5.block,s&&V5.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}H5.displayName=`Truncate`;var U5=K(H5);const W5=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=d(e),[a,o]=d(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},G5=n({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),K5=()=>o(G5),q5=(e,t)=>{let{colorScheme:n}=K5();return(n?e[n]:void 0)??t},J5=`day`,Y5=`(prefers-color-scheme: dark)`,X5=e=>{let t=window?.matchMedia?.(Y5);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},Z5=()=>window?.matchMedia?.(Y5)?.matches?`night`:`day`,Q5=()=>`day`,$5=()=>e.useSyncExternalStore(X5,Z5,Q5),e7=(e,t)=>e===`auto`?t:e,t7=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function n7({children:t,className:n,contextOnly:r,...i}){let{colorMode:a,dayScheme:o,nightScheme:s}=K5(),[c,l]=W5(i.colorMode??a??`day`),[u,d]=W5(i.dayScheme??o??`light`),[f,p]=W5(i.nightScheme??s??`dark`),m=$5(),h=e7(c,m),g=t7(h,u,f),_=e.useMemo(()=>({colorScheme:g,colorMode:c,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:l,setDayScheme:d,setNightScheme:p}),[g,c,h,u,f,l,d,p]);return r?(0,q.jsx)(G5.Provider,{value:_,children:t}):(0,q.jsx)(G5.Provider,{value:_,children:(0,q.jsx)(`div`,{className:n,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":c,children:t})})}n7.displayName=`ThemeProvider`;export{ZY as ARROW_KEY_STEP,Oc as AUTO_LOCALE,Xr as Accordion,hn as AccordionContext,Fr as AccordionHeader,Rr as AccordionItem,Mr as AccordionItemContext,Yr as AccordionPanel,Po as ActionBar,No as ActionBarButton,ao as ActionBarContext,uo as ActionBarDivider,mo as ActionBarGroup,_o as ActionBarIconButton,oo as ActionBarItemContext,So as ActionBarMenu,_a as ActionList,gi as ActionListContainerContext,fi as ActionListContext,wi as ActionListDescription,Ei as ActionListDivider,Fi as ActionListGroup,Di as ActionListGroupContext,Mi as ActionListGroupHeading,hi as ActionListHeading,ma as ActionListItem,Si as ActionListItemContext,Hi as ActionListLeadingVisual,ga as ActionListLinkItem,Ui as ActionListSubItem,aa as ActionListTrailingAction,oa as ActionListTrailingVisual,eo as ActionMenu,ya as ActionMenuAnchor,ba as ActionMenuButton,va as ActionMenuContext,$a as ActionMenuOverlay,Lo as Alert,Za as AnchoredOverlay,Bo as AspectRatio,hs as Attachment,qo as AttachmentAction,Xo as AttachmentActions,$o as AttachmentContent,Vo as AttachmentContext,ns as AttachmentDescription,as as AttachmentGroup,cs as AttachmentMedia,ds as AttachmentTitle,ms as AttachmentTrigger,Ys as Autocomplete,gs as AutocompleteContext,vs as AutocompleteDeferredInputContext,Rs as AutocompleteInput,_s as AutocompleteInputContext,Ws as AutocompleteMenu,Js as AutocompleteOverlay,Wc as Avatar,Zs as AvatarContext,Bc as AvatarFallback,Uc as AvatarImage,$c as AvatarStack,il as Badge,El as Banner,al as BannerContext,sl as BannerDescription,Cl as BannerPrimaryAction,Tl as BannerSecondaryAction,ul as BannerTitle,Yl as Blankslate,Ml as BlankslateDescription,Fl as BlankslateHeading,Bl as BlankslatePrimaryAction,Gl as BlankslateSecondaryAction,Jl as BlankslateVisual,Ql as Blockquote,tu as Box,fu as Breadcrumbs,ru as BreadcrumbsContext,du as BreadcrumbsItem,Ou as Bubble,xu as BubbleContent,mu as BubbleContext,wu as BubbleGroup,hu as BubbleGroupContext,Du as BubbleReactions,$i as Button,Fu as ButtonGroup,Ef as CHART_COLORS,Tf as CHART_OVERFLOW_COLOR,wf as CHART_SERIES_COLORS,gd as Calendar,Ru as CalendarDay,Hd as Card,yd as CardAction,Cd as CardDescription,Ed as CardHeading,kd as CardIcon,Md as CardImage,Fd as CardMetadata,qd as Caret,_f as Carousel,Yd as CarouselContext,lf as CarouselControls,$d as CarouselIndicators,tf as CarouselNextButton,rf as CarouselPlayButton,of as CarouselPreviousButton,ff as CarouselSlide,Xd as CarouselSlideContext,Bf as Chart,vf as ChartContext,Cf as ChartGradient,Pf as ChartLegend,Lf as ChartRadialText,zf as ChartTooltip,Gf as Checkbox,op as CheckboxCard,Kf as CheckboxCardContext,Yf as CheckboxCardDescription,Qf as CheckboxCardLabel,tp as CheckboxCardLeadingVisual,Sp as CheckboxGroup,lp as CheckboxGroupCaption,Vf as CheckboxGroupContext,fp as CheckboxGroupLabel,_p as CheckboxGroupValidation,em as Clipboard,Cp as ClipboardContext,Np as ClipboardControl,Ip as ClipboardCopyText,zp as ClipboardIndicator,Wp as ClipboardInput,qp as ClipboardLabel,Xp as ClipboardTrigger,$p as ClipboardValueText,rm as Code,Em as CodeBlock,hm as CodeBlockCode,ym as CodeBlockContent,im as CodeBlockContext,Sm as CodeBlockHeader,Tm as CodeBlockTitle,Lm as Collapsible,Nm as CollapsibleContent,Nm as CollapsiblePanel,Dm as CollapsibleContext,Im as CollapsibleTrigger,Ih as Combobox,Km as ComboboxClearTrigger,Ym as ComboboxContent,Rm as ComboboxContext,Qm as ComboboxControl,th as ComboboxEmpty,oh as ComboboxInput,uh as ComboboxItem,Bm as ComboboxItemContext,ph as ComboboxItemGroup,zm as ComboboxItemGroupContext,gh as ComboboxItemGroupLabel,yh as ComboboxItemIndicator,Sh as ComboboxItemText,Th as ComboboxLabel,Oh as ComboboxList,Mh as ComboboxPositioner,Fh as ComboboxTrigger,bg as CommandPalette,Bh as CommandPaletteContext,Qh as CommandPaletteDialog,tg as CommandPaletteEmpty,ig as CommandPaletteGroup,Vh as CommandPaletteGroupContext,sg as CommandPaletteInput,ug as CommandPaletteItem,pg as CommandPaletteList,gg as CommandPaletteLoading,yg as CommandPaletteSeparator,r_ as ConfirmationDialog,p_ as ContextMenu,o_ as ContextMenuContext,u_ as ContextMenuOverlay,f_ as ContextMenuTrigger,qi as CounterLabel,Yu as DAYS_IN_WEEK,Xu as DAY_KEY_FORMAT,Qs as DEFAULT_AVATAR_SIZE,J5 as DEFAULT_COLOR_MODE,O2 as DEFAULT_CURRENT_STEP,wc as DEFAULT_DIRECTION,ox as DEFAULT_FLOATING_PANEL_MIN_SIZE,ax as DEFAULT_FLOATING_PANEL_POSITION,ix as DEFAULT_FLOATING_PANEL_SIZE,T8 as DEFAULT_ISSUE_LABEL_FILL_COLOR,nc as DEFAULT_LOCALE,MK as DEFAULT_MAP_LATITUDE,NK as DEFAULT_MAP_LONGITUDE,PK as DEFAULT_MAP_ZOOM,UK as DEFAULT_MARKDOWN_NAMESPACE,mV as DEFAULT_MARKER_COLOR,$K as DEFAULT_MARQUEE_SPEED,xE as DEFAULT_MAX_PREVIEW_ITEMS,T$ as DEFAULT_RATING_COUNT,V$ as DEFAULT_RELATIVE_TIME_PREFIX,B$ as DEFAULT_RELATIVE_TIME_THRESHOLD,M1 as DEFAULT_RICH_TEXT_EDITOR_CONTROLS,S1 as DEFAULT_RICH_TEXT_EDITOR_NAMESPACE,Tv as DEFAULT_SORT_DIRECTION,G8 as DEFAULT_SPOTLIGHT_OFFSET,K8 as DEFAULT_SPOTLIGHT_RADIUS,B4 as DEFAULT_TABLE_OF_CONTENTS_ROOT_MARGIN,J_ as DEFAULT_TABLE_PAGE_SIZE,pv as DEFAULT_TABLE_SKELETON_ROWS,sC as DEFAULT_TEXTAREA_COLS,cC as DEFAULT_TEXTAREA_RESIZE,oC as DEFAULT_TEXTAREA_ROWS,l6 as DEFAULT_TIMER_INTERVAL,u8 as DEFAULT_TOKEN_SIZE,B5 as DEFAULT_TRUNCATE_MAX_WIDTH,zv as DataTable,Wv as DatePicker,Zv as Details,Xv as DetailsSummary,Qv as Dialog,Eg as DialogBody,Og as DialogButtons,Ag as DialogCloseButton,Dg as DialogContext,Ng as DialogFooter,Ig as DialogHeader,zg as DialogSubtitle,Hg as DialogTitle,Tc as DirectionContext,$E as DirectionProvider,dX as DragHandle,Cy as Drawer,ty as DrawerBody,ay as DrawerCloseButton,ny as DrawerContext,cy as DrawerFooter,dy as DrawerHeader,my as DrawerSubtitle,_y as DrawerTitle,Ey as Em,jy as EmptyState,cx as FLOATING_PANEL_LARGE_STEP,sx as FLOATING_PANEL_STEP,BC as FRAME_ROOT_CLASS,pb as FileUpload,Ly as FileUploadContext,By as FileUploadDescription,Uy as FileUploadIcon,fb as FileUploadItem,Ky as FileUploadLabel,Yy as FileUploadList,rx as FilteredActionList,Qb as FilteredActionListBodyLoader,zb as FilteredActionListInput,Hb as FilteredActionListItem,tS as FloatingPanel,Sx as FloatingPanelBody,wx as FloatingPanelCloseTrigger,Ox as FloatingPanelContent,_x as FloatingPanelContext,jx as FloatingPanelControl,Px as FloatingPanelDragTrigger,Lx as FloatingPanelHeader,Bx as FloatingPanelPositioner,Gx as FloatingPanelResizeTrigger,Jx as FloatingPanelStageTrigger,Zx as FloatingPanelTitle,eS as FloatingPanelTrigger,AS as Flow,sS as FlowContext,uS as FlowList,pS as FlowNode,gS as FlowParallel,NC as FormControl,gC as FormControlCaption,Bp as FormControlContext,yC as FormControlLabel,SC as FormControlLeadingVisual,DC as FormControlValidation,FC as FormatByte,LC as FormatNumber,WC as Frame,ew as Header,XC as HeaderItem,$C as HeaderLink,di as Heading,rw as Hidden,uw as Highlight,yw as HoverCard,mw as HoverCardContent,dw as HoverCardContext,hw as HoverCardTrigger,na as IconButton,Sw as Image,Ow as InlineMessage,F8 as IssueLabelToken,qE as JSONTreeView,_E as JSONTreeViewContext,MT as KeybindingHint,XE as Label,sD as LabelGroup,vD as LayerCard,uD as LayerCardPrimary,pD as LayerCardSecondary,Ul as Link,bD as LinkButton,DD as List,ED as ListItem,Ec as LocaleContext,Mc as LocaleProvider,WK as MARKDOWN_NODES,GK as MARKDOWN_TRANSFORMERS,zK as Map,vW as MapAttributionControl,cK as MapDragRotateAndZoomInteraction,eK as MapDrawControl,DW as MapFullScreenControl,PV as MapGraticuleLayer,fW as MapHeatmapLayer,MV as MapImageLayer,DV as MapLayerGroup,rK as MapLayersControl,AK as MapLinkInteraction,xV as MapMarker,IW as MapMousePositionControl,CV as MapOverlay,BW as MapOverviewMapControl,pK as MapPointerInteraction,MW as MapScaleLineControl,aK as MapSearchControl,CK as MapSelectInteraction,OV as MapTileLayer,fK as MapTranslateInteraction,NV as MapVectorLayer,sV as MapView,hW as MapWebGLTileLayer,ow as Mark,JK as Markdown,hq as Marquee,aq as MarqueeContent,YK as MarqueeContext,cq as MarqueeEdge,dq as MarqueeItem,mq as MarqueeViewport,Fq as Message,Sq as MessageAvatar,Tq as MessageContent,pu as MessageContext,Oq as MessageFooter,jq as MessageGroup,gq as MessageGroupContext,Pq as MessageHeader,aJ as Meter,Bq as MeterContext,Uq as MeterIndicator,Kq as MeterLabel,Yq as MeterTrack,Qq as MeterValue,uJ as NativeSelect,sJ as NativeSelectOptGroup,lJ as NativeSelectOption,BJ as NavigationList,SJ as NavigationListGroup,IJ as NavigationListGroupExpand,zJ as NavigationListGroupHeading,fJ as NavigationListHeading,NJ as NavigationListItem,kJ as NavigationListSubNavigation,PY as NavigationMenu,nY as NavigationMenuContent,UJ as NavigationMenuContext,qJ as NavigationMenuDepthContext,iY as NavigationMenuDescription,oY as NavigationMenuDivider,dY as NavigationMenuGroup,cY as NavigationMenuGroupHeading,HJ as NavigationMenuHeading,KJ as NavigationMenuHeadingLevelContext,mY as NavigationMenuItem,WJ as NavigationMenuItemContext,_Y as NavigationMenuLeadingVisual,EY as NavigationMenuLink,GJ as NavigationMenuLinkContext,AY as NavigationMenuList,bY as NavigationMenuSubNavigation,SY as NavigationMenuTrailingVisual,NY as NavigationMenuTrigger,RY as NumberInput,to as OverflowObserverContext,no as OverflowObserverProvider,JX as PINInput,jX as PageLayout,DX as PageLayoutContent,BY as PageLayoutContext,KY as PageLayoutFooter,YY as PageLayoutHeader,AX as PageLayoutPane,vX as PageLayoutSidebar,zX as Pagination,HX as PasswordInput,ZX as Placeholder,bT as PlatformContext,oZ as Popover,aZ as PopoverContent,QX as PopoverContext,Ba as Portal,ja as PortalContext,cb as ProgressBar,ib as ProgressBarItem,uZ as ProgressCircle,JQ as QRCode,C1 as RICH_TEXT_EDITOR_NODES,RS as Radio,l$ as RadioCard,YQ as RadioCardContext,QQ as RadioCardDescription,t$ as RadioCardLabel,i$ as RadioCardLeadingVisual,w$ as RadioGroup,f$ as RadioGroupCaption,FS as RadioGroupContext,h$ as RadioGroupLabel,b$ as RadioGroupValidation,M$ as Rating,i1 as RelativeTime,b1 as Resizable,u1 as ResizablePanel,p1 as ResizableResizeTrigger,g1 as ResizableResizeTriggerIndicator,y1 as ResizableResizeTriggerSeparator,R1 as RichTextEditor,j1 as RichTextEditorContent,L1 as RichTextEditorToolbar,Cs as SCREEN_READER_DELAY,Cg as ScrollableRegion,t0 as SegmentedControl,U1 as SegmentedControlButton,G1 as SegmentedControlIconButton,n0 as Select,zS as SelectContext,US as SelectOptGroup,BS as SelectOptGroupContext,qS as SelectOption,N0 as SelectPanel,i0 as SelectPanelButton,a0 as SelectPanelContext,c0 as SelectPanelFooter,h0 as SelectPanelHeader,E0 as SelectPanelLoading,k0 as SelectPanelMessage,d0 as SelectPanelSearchInput,M0 as SelectPanelSecondaryAction,I0 as Separator,WT as SkeletonAvatar,cv as SkeletonBox,dv as SkeletonText,B0 as Slider,zi as Spinner,Yb as Stack,Jb as StackItem,q0 as StateLabel,_2 as StatisticCard,J0 as StatisticCardContext,Z0 as StatisticCardDescription,e2 as StatisticCardLabel,r2 as StatisticCardTrailingVisual,u2 as StatisticCardTrend,p2 as StatisticCardValue,E2 as Status,T2 as StatusIndicator,Z2 as Steps,I2 as StepsBody,z2 as StepsDescription,U2 as StepsIndicator,q2 as StepsItem,D2 as StepsItemContext,X2 as StepsTitle,a4 as Swap,Q2 as SwapContext,i4 as SwapIndicator,D4 as Switch,o4 as SwitchContext,_4 as SwitchControl,b4 as SwitchHiddenInput,C4 as SwitchLabel,d4 as SwitchRootProvider,E4 as SwitchThumb,C3 as Tab,O3 as TabList,j3 as TabPanel,Vv as Table,b_ as TableActions,T_ as TableBody,O_ as TableCell,j_ as TableCellPlaceholder,P_ as TableContainer,L_ as TableDivider,z_ as TableErrorDialog,V_ as TableHead,W_ as TableHeader,h3 as TableOfContents,Y4 as TableOfContentsContent,O4 as TableOfContentsContext,$4 as TableOfContentsIndicator,n3 as TableOfContentsItem,A4 as TableOfContentsItemContext,a3 as TableOfContentsLink,c3 as TableOfContentsList,d3 as TableOfContentsNav,m3 as TableOfContentsTitle,rv as TablePagination,av as TableRow,hv as TableSkeleton,vv as TableSortHeader,xv as TableSubtitle,wv as TableTitle,M3 as Tabs,g3 as TabsContext,Ss as Text,Ps as TextInput,Ns as TextInputAction,pC as Textarea,G5 as ThemeContext,n7 as ThemeProvider,n6 as Timeline,z3 as TimelineActions,H3 as TimelineAvatar,K3 as TimelineBadge,Y3 as TimelineBody,Q3 as TimelineBreak,t6 as TimelineItem,M6 as Timer,y6 as TimerActionTrigger,S6 as TimerArea,r6 as TimerContext,T6 as TimerControl,O6 as TimerItem,j6 as TimerSeparator,c8 as Toaster,w8 as Token,p8 as TokenBase,h8 as TokenRemoveButton,v8 as TokenText,sE as Tooltip,QT as TooltipContext,H8 as TopicTag,V8 as TopicTagGroup,z5 as Tour,t5 as TourActionTrigger,Q8 as TourActions,a5 as TourArrow,c5 as TourBackdrop,d5 as TourCloseTrigger,m5 as TourContent,U8 as TourContext,_5 as TourControl,b5 as TourDescription,w5 as TourPositioner,W8 as TourPositionerContext,D5 as TourProgressText,A5 as TourSpotlight,N5 as TourTitle,gE as TreeView,rT as TreeViewDirectoryIcon,aT as TreeViewErrorDialog,hE as TreeViewItem,Aw as TreeViewItemContext,VT as TreeViewLeadingAction,HT as TreeViewLeadingVisual,kw as TreeViewRootContext,ZT as TreeViewSubTree,uE as TreeViewTrailingVisual,U5 as Truncate,G_ as buildPaginationModel,K_ as buildPaginationPageData,Lq as clampToRange,zh as commandScore,wS as computeEdges,TS as computeFlowRect,yS as computePositions,rS as connectorPath,Ep as copyText,Bv as createColumnHelper,QY as defaultPaneWidth,bS as entryIds,xS as exitIds,ud as extendRange,Py as formatFileSize,eJ as formatMeterValue,t1 as formatRelativeTime,s6 as formatTime,e1 as formatTitle,yT as getAccessibleKeybindingHintString,dV as getAddress,Ga as getAnchoredPosition,ws as getCharacterCount,nd as getFirstDayOfWeek,M8 as getIssueLabelColors,fV as getLonLat,ad as getMonthWeeks,CT as getPlatform,kf as getProp,ld as getRangePosition,Df as getSeriesColor,rd as getWeekdays,od as isDateSelectable,cd as isDateWithinRange,Fy as isFileAccepted,d8 as isTokenInteractive,KK as markdownTheme,SS as nodeIds,dd as parseDate,Ia as registerPortalRoot,w1 as richTextEditorTheme,N4 as scrollToHeading,jv as sortStrategies,cw as splitHighlightChunks,o6 as splitTime,id as startOfWeek,Rq as stepValue,$u as toDayKey,ME as toJSONNodes,zE as toValueTokens,Y6 as toast,Ev as transitionSortDirection,Iy as triageFiles,iX as updateAriaValues,$b as useAnnouncements,Mf as useChart,yf as useChartContext,Dp as useClipboard,wp as useClipboardContext,nD as useClippedChildren,Nc as useCollator,q5 as useColorSchemeVar,a_ as useConfirm,Pc as useDateFormatter,ZE as useDirection,Fc as useFilter,vx as useFloatingPanelContext,Vp as useFormControlForwardedProps,QE as useIsRtl,vE as useJSONTreeViewContext,Dc as useLocaleContext,oV as useMap,ZK as useMarquee,XK as useMarqueeContext,Ic as useNumberFormatter,ro as useOverflowObserver,hX as usePaneWidth,TT as usePlatform,B2 as useStepsItem,f4 as useSwitch,s4 as useSwitchContext,b3 as useTab,T3 as useTabList,k3 as useTabPanel,U4 as useTableOfContents,k4 as useTableOfContentsContext,j4 as useTableOfContentsItemContext,y3 as useTabs,K5 as useTheme,f6 as useTimer,i6 as useTimerContext,P5 as useTour,$q as valueToPercent,L5 as waitForElement,R5 as waitForElementValue,I5 as waitForEvent};