@bluepic/embed 0.1.50 → 0.1.51
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/lib/bluepic-embed.es.js +1 -1
- package/lib/bluepic-embed.umd.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/bluepic-embed.es.js
CHANGED
|
@@ -71690,7 +71690,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
71690
71690
|
], 6))), 256))
|
|
71691
71691
|
], 2));
|
|
71692
71692
|
}
|
|
71693
|
-
}),
|
|
71693
|
+
}), FieldsList_vue_vue_type_style_index_0_scoped_d180b0a4_lang = "", FieldsList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-d180b0a4"]]), _hoisted_1$i = { class: "bx-fields" }, _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
71694
71694
|
__name: "Fields",
|
|
71695
71695
|
props: {
|
|
71696
71696
|
fields: {}
|
package/lib/bluepic-embed.umd.js
CHANGED
|
@@ -2509,7 +2509,7 @@ ${He.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(Yi=Yi.replac
|
|
|
2509
2509
|
translate(${ke.x}px,${ke.y}px)
|
|
2510
2510
|
`}_calculateXYTransform(){const xe=this._pos,ke=this._map,He=this.getPitchAlignment();if(!ke||!xe||He!=="map")return"";if(!ke._showingGlobe()){const Li=ke.getPitch();return Li?`rotateX(${Li}deg)`:""}const ri=ie.c4(ie.dI(ke.transform,this._lngLat)),ai=xe.sub(ie.dJ(ke.transform)),vi=Math.abs(ai.x)+Math.abs(ai.y);if(vi===0)return"";const Si=ri/vi;return`rotateX(${-ai.y*Si}deg) rotateY(${ai.x*Si}deg)`}_calculateZTransform(){const xe=this._pos,ke=this._map;if(!ke||!xe)return"";let He=0;const ri=this.getRotationAlignment();if(ri==="map")if(ke._showingGlobe()){const ai=ke.project(new ie.bO(this._lngLat.lng,this._lngLat.lat+.001)),vi=ke.project(new ie.bO(this._lngLat.lng,this._lngLat.lat-.001)).sub(ai);He=ie.c4(Math.atan2(vi.y,vi.x))-90}else He=-ke.getBearing();else if(ri==="horizon"){const ai=ie.ac(4,6,ke.getZoom()),vi=ie.dJ(ke.transform);vi.y+=ai*ke.transform.height;const Si=xe.sub(vi),Li=ie.c4(Math.atan2(Si.y,Si.x));He=(Li>90?Li-270:Li+90)*(1-ai)}return He+=this._rotation,He?`rotateZ(${He}deg)`:""}_update(xe){cancelAnimationFrame(this._updateFrameId);const ke=this._map;ke&&(ke.transform.renderWorldCopies&&(this._lngLat=i0(this._lngLat,this._pos,ke.transform)),this._pos=ke.project(this._lngLat),xe===!0?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),ke._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(ke._showingGlobe()||ke.getTerrain()||ke.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(xe){return this._offset=ie.P.convert(xe),this._update(),this}addClassName(xe){return this._element.classList.add(xe),this}removeClassName(xe){return this._element.classList.remove(xe),this}toggleClassName(xe){return this._element.classList.toggle(xe)}_onMove(xe){const ke=this._map;if(!ke)return;const He=this._pointerdownPos,ri=this._positionDelta;if(He&&ri){if(!this._isDragging){const ai=this._clickTolerance||ke._clickTolerance;if(xe.point.dist(He)<ai)return;this._isDragging=!0}this._pos=xe.point.sub(ri),this._lngLat=ke.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new ie.z("dragstart"))),this.fire(new ie.z("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const xe=this._map;xe&&(xe.off("mousemove",this._onMove),xe.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new ie.z("dragend")),this._state="inactive"}_addDragHandler(xe){const ke=this._map,He=this._pos;ke&&He&&this._element.contains(xe.originalEvent.target)&&(xe.preventDefault(),this._positionDelta=xe.point.sub(He),this._pointerdownPos=xe.point,this._state="pending",ke.on("mousemove",this._onMove),ke.on("touchmove",this._onMove),ke.once("mouseup",this._onUp),ke.once("touchend",this._onUp))}setDraggable(xe){this._draggable=!!xe;const ke=this._map;return ke&&(xe?(ke.on("mousedown",this._addDragHandler),ke.on("touchstart",this._addDragHandler)):(ke.off("mousedown",this._addDragHandler),ke.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(xe){return this._rotation=xe||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(xe){return this._rotationAlignment=xe||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(xe){return this._pitchAlignment=xe||"auto",this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(xe){return this._occludedOpacity=xe||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const Fu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},vu={maxWidth:100,unit:"metric"},As={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},xs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Fs=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function em(qe=new ie.P(0,0),xe="bottom"){if(typeof qe=="number"){const ke=Math.round(Math.sqrt(.5*Math.pow(qe,2)));switch(xe){case"top":return new ie.P(0,qe);case"top-left":return new ie.P(ke,ke);case"top-right":return new ie.P(-ke,ke);case"bottom":return new ie.P(0,-qe);case"bottom-left":return new ie.P(ke,-ke);case"bottom-right":return new ie.P(-ke,-ke);case"left":return new ie.P(qe,0);case"right":return new ie.P(-qe,0)}return new ie.P(0,0)}return qe instanceof ie.P||Array.isArray(qe)?ie.P.convert(qe):ie.P.convert(qe[xe]||[0,0])}return{version:ii,supported:Ti.supported,setRTLTextPlugin:ie.dK,getRTLTextPluginStatus:ie.dL,Map:class extends ud{constructor(qe){li.mark(di.create);const xe=qe;if((qe=ie.l({},Qp,qe)).minZoom!=null&&qe.maxZoom!=null&&qe.minZoom>qe.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(qe.minPitch!=null&&qe.maxPitch!=null&&qe.minPitch>qe.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(qe.minPitch!=null&&qe.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(qe.maxPitch!=null&&qe.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(qe.antialias&&ie.dF(window)&&(qe.antialias=!1,ie.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Bf(qe.minZoom,qe.maxZoom,qe.minPitch,qe.maxPitch,qe.renderWorldCopies),qe),this._repaint=!!qe.repaint,this._interactive=qe.interactive,this._minTileCacheSize=qe.minTileCacheSize,this._maxTileCacheSize=qe.maxTileCacheSize,this._failIfMajorPerformanceCaveat=qe.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=qe.preserveDrawingBuffer,this._antialias=qe.antialias,this._trackResize=qe.trackResize,this._bearingSnap=qe.bearingSnap,this._refreshExpiredTiles=qe.refreshExpiredTiles,this._fadeDuration=qe.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=qe.crossSourceCollisions,this._collectResourceTiming=qe.collectResourceTiming,this._language=this._parseLanguage(qe.language),this._worldview=qe.worldview,this._renderTaskQueue=new Yc,this._domRenderTaskQueue=new Yc,this._controls=[],this._markers=[],this._popups=[],this._mapId=ie.aV(),this._locale=ie.l({},cl,qe.locale),this._clickTolerance=qe.clickTolerance,this._cooperativeGestures=qe.cooperativeGestures,this._performanceMetricsCollection=qe.performanceMetricsCollection,this._tessellationStep=qe.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=qe.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new cf(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=qe.scaleFactor,this._requestManager=new Ue(qe.transformRequest,qe.accessToken,qe.testMode),this._silenceAuthErrors=!!qe.testMode,this._contextCreateOptions=qe.contextCreateOptions?{...qe.contextCreateOptions}:{},typeof qe.container=="string"){const ke=document.getElementById(qe.container);if(!ke)throw new Error(`Container '${qe.container.toString()}' not found.`);this._container=ke}else{if(!(qe.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=qe.container}if(this._container.childNodes.length>0&&ie.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),qe.maxBounds&&this.setMaxBounds(qe.maxBounds),this._spriteFormat=qe.spriteFormat,ie.aP(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new jl),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},()=>{this.setScaleFactor(this._scaleFactor)}),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new cp(this,qe),this._localFontFamily=qe.localFontFamily,this._localIdeographFontFamily=qe.localIdeographFontFamily,(qe.style||!qe.testMode)&&this.setStyle(qe.style||ie.e.DEFAULT_STYLE,{config:qe.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),qe.projection&&this.setProjection(qe.projection),this.indoor=new Dm(this),qe.hash&&(this._hash=new Bc(typeof qe.hash=="string"&&qe.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){xe.center==null&&xe.zoom==null||(this.transform._unmodified=!1),this.jumpTo({center:qe.center,zoom:qe.zoom,bearing:qe.bearing,pitch:qe.pitch});const ke=qe.bounds;ke&&(this.resize(),this.fitBounds(ke,ie.l({},qe.fitBoundsOptions,{duration:0})))}this.resize(),qe.attributionControl&&this.addControl(new Ou({customAttribution:qe.customAttribution})),this._logoControl=new pa,this.addControl(this._logoControl,qe.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",ke=>{this._update(ke.dataType==="style"),this.fire(new ie.z(`${ke.dataType}data`,ke))}),this.on("dataloading",ke=>{this.fire(new ie.z(`${ke.dataType}dataloading`,ke))}),this._interactions=new zu(this)}_getMapId(){return this._mapId}addControl(qe,xe){if(xe===void 0&&(xe=qe.getDefaultPosition?qe.getDefaultPosition():"top-right"),!qe||!qe.onAdd)return this.fire(new ie.y(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const ke=qe.onAdd(this);this._controls.push(qe);const He=this._controlPositions[xe];return xe.indexOf("bottom")!==-1?He.insertBefore(ke,He.firstChild):He.appendChild(ke),this}removeControl(qe){if(!qe||!qe.onRemove)return this.fire(new ie.y(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const xe=this._controls.indexOf(qe);return xe>-1&&this._controls.splice(xe,1),qe.onRemove(this),this}hasControl(qe){return this._controls.indexOf(qe)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(qe){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const xe=!this._moving;return xe&&this.fire(new ie.z("movestart",qe)).fire(new ie.z("move",qe)),this.fire(new ie.z("resize",qe)),xe&&this.fire(new ie.z("moveend",qe)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(qe){return this.transform.setMaxBounds(ie.az.convert(qe)),this._update()}setMinZoom(qe){if((qe=qe??-2)>=-2&&qe<=this.transform.maxZoom)return this.transform.minZoom=qe,this._update(),this.getZoom()<qe?this.setZoom(qe):this.fire(new ie.z("zoomstart")).fire(new ie.z("zoom")).fire(new ie.z("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(qe){if((qe=qe??22)>=this.transform.minZoom)return this.transform.maxZoom=qe,this._update(),this.getZoom()>qe?this.setZoom(qe):this.fire(new ie.z("zoomstart")).fire(new ie.z("zoom")).fire(new ie.z("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(qe){if((qe=qe??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(qe>=0&&qe<=this.transform.maxPitch)return this.transform.minPitch=qe,this._update(),this.getPitch()<qe?this.setPitch(qe):this.fire(new ie.z("pitchstart")).fire(new ie.z("pitch")).fire(new ie.z("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(qe){if((qe=qe??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(qe>=this.transform.minPitch)return this.transform.maxPitch=qe,this._update(),this.getPitch()>qe?this.setPitch(qe):this.fire(new ie.z("pitchstart")).fire(new ie.z("pitch")).fire(new ie.z("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(qe){return this._scaleFactor=qe,this.painter.scaleFactor=qe,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers(xe=>xe.type==="symbol"),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(qe){return this.transform.renderWorldCopies=qe,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(qe){return qe==="auto"?navigator.language:Array.isArray(qe)?qe.length===0?void 0:qe.map(xe=>xe==="auto"?navigator.language:xe):qe}setLanguage(qe){const xe=this._parseLanguage(qe);if(!this.style||xe===this._language)return this;this._language=xe,this.style.reloadSources();for(const ke of this._controls)ke._setLanguage&&ke._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(qe){return this.style&&qe!==this._worldview?(this._worldview=qe,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(qe){return this._lazyInitEmptyStyle(),qe?typeof qe=="string"&&(qe={name:qe}):qe=null,this._useExplicitProjection=!!qe,this._prioritizeAndUpdateProjection(qe,this.style.projection)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const qe=this.transform,xe=qe.projection.name;let ke;xe==="globe"&&qe.zoom>=ie.bY?(qe.setMercatorFromTransition(),ke=!0):xe==="mercator"&&qe.zoom<ie.bY&&(qe.setProjection({name:"globe"}),ke=!0),ke&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(qe,xe){return this._updateProjection(qe||xe||{name:"mercator"})}_updateProjection(qe){let xe;return xe=qe.name==="globe"&&this.transform.zoom>=ie.bY?this.transform.setMercatorFromTransition():this.transform.setProjection(qe),this.style.applyProjectionUpdate(),xe&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(qe){return this.transform.locationPoint3D(ie.bO.convert(qe))}unproject(qe){return this.transform.pointLocation3D(ie.P.convert(qe))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(qe,xe,ke){const He=ri=>{let ai=[];if(Array.isArray(xe)){const vi=xe.filter(Si=>this.getLayer(Si));ai=vi.length?this.queryRenderedFeatures(ri,{layers:vi}):[]}else ai=this.queryRenderedFeatures(ri,{target:xe});return ai};if(qe==="mouseenter"||qe==="mouseover"){let ri=!1;return{listener:ke,targets:xe,delegates:{mousemove:vi=>{const Si=He(vi.point);Si.length?ri||(ri=!0,ke.call(this,new Il(qe,this,vi.originalEvent,{features:Si}))):ri=!1},mouseout:()=>{ri=!1}}}}if(qe==="mouseleave"||qe==="mouseout"){let ri=!1;return{listener:ke,targets:xe,delegates:{mousemove:Si=>{He(Si.point).length?ri=!0:ri&&(ri=!1,ke.call(this,new Il(qe,this,Si.originalEvent)))},mouseout:Si=>{ri&&(ri=!1,ke.call(this,new Il(qe,this,Si.originalEvent)))}}}}{const ri=ai=>{const vi=He(ai.point);vi.length&&(ai.features=vi,ke.call(this,ai),delete ai.features)};return{listener:ke,targets:xe,delegates:{[qe]:ri}}}}on(qe,xe,ke){if(typeof xe=="function"||ke===void 0)return super.on(qe,xe);if(typeof xe=="string"&&(xe=[xe]),!this._areTargetsValid(xe))return this;const He=this._createDelegatedListener(qe,xe,ke);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[qe]=this._delegatedListeners[qe]||[],this._delegatedListeners[qe].push(He);for(const ri in He.delegates)this.on(ri,He.delegates[ri]);return this}once(qe,xe,ke){if(typeof xe=="function"||ke===void 0)return super.once(qe,xe);if(typeof xe=="string"&&(xe=[xe]),!this._areTargetsValid(xe))return this;const He=this._createDelegatedListener(qe,xe,ke);for(const ri in He.delegates)this.once(ri,He.delegates[ri]);return this}off(qe,xe,ke){if(typeof xe=="function"||ke===void 0)return super.off(qe,xe);if(typeof xe=="string"&&(xe=[xe]),!this._areTargetsValid(xe))return this;const He=this._delegatedListeners?this._delegatedListeners[qe]:void 0;return He&&(ri=>{for(let ai=0;ai<ri.length;ai++){const vi=ri[ai];if(vi.listener===ke&&zs(vi.targets,xe)){for(const Si in vi.delegates)this.off(Si,vi.delegates[Si]);return ri.splice(ai,1),this}}})(He),this}queryRenderedFeatures(qe,xe){if(!this.style)return[];if(qe===void 0||qe instanceof ie.P||Array.isArray(qe)||xe!==void 0||(xe=qe,qe=void 0),qe=qe||[[0,0],[this.transform.width,this.transform.height]],!xe){const ai=this.style.queryRenderedFeatures(qe,void 0,this.transform),vi=this.style.queryRenderedFeatureset(qe,void 0,this.transform);return ai.concat(vi)}let ke=!0;if(xe.target&&(ke=this._isTargetValid(xe.target),ke&&!xe.layers))return this.style.queryRenderedFeatureset(qe,xe,this.transform);let He=!0;if(xe.layers&&Array.isArray(xe.layers)){for(const ai of xe.layers)if(!this._isValidId(ai)){He=!1;break}if(He&&!xe.target)return this.style.queryRenderedFeatures(qe,xe,this.transform)}let ri=[];return He&&(ri=ri.concat(this.style.queryRenderedFeatures(qe,xe,this.transform))),ke&&(ri=ri.concat(this.style.queryRenderedFeatureset(qe,xe,this.transform))),ri}querySourceFeatures(qe,xe){return!qe||typeof qe=="string"&&!this._isValidId(qe)?[]:this.style.querySourceFeatures(qe,xe)}isPointOnSurface(qe){const{name:xe}=this.transform.projection;return xe!=="globe"&&xe!=="mercator"&&ie.w(`${xe} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(ie.P.convert(qe))}addInteraction(qe,xe){return this._interactions.add(qe,xe),this}removeInteraction(qe){return this._interactions.remove(qe),this}setStyle(qe,xe){return xe=ie.l({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},xe),this.style&&qe&&xe.diff!==!1&&xe.localFontFamily===this._localFontFamily&&xe.localIdeographFontFamily===this._localIdeographFontFamily&&!xe.config?(this.style._diffStyle(qe,(ke,He)=>{ke?(ie.w(`Unable to perform style diff: ${String(ke.message||ke.error||ke)}. Rebuilding the style from scratch.`),this._updateStyle(qe,xe)):He&&this._update(!0)},()=>{this._postStyleLoadEvent()}),this):(this._localIdeographFontFamily=xe.localIdeographFontFamily,this._localFontFamily=xe.localFontFamily,this._updateStyle(qe,xe))}_getUIString(qe){const xe=this._locale[qe];if(xe==null)throw new Error(`Missing UI string '${qe}'`);return xe}_updateStyle(qe,xe){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),qe){const ke=ie.l({},xe);xe&&xe.config&&(ke.initialConfig=xe.config,delete ke.config),this.style=new za(this,ke).load(qe),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new za(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(ie.w("There is no style added to the map."),!1)}_isValidId(qe){return qe==null?(this.fire(new ie.y(new Error("IDs can't be empty."))),!1):!ie.cr(qe)||(this.fire(new ie.y(new Error(`IDs can't contain special symbols: "${qe}".`))),!1)}_isTargetValid(qe){return"featuresetId"in qe?this._isValidId("importId"in qe?qe.importId:qe.featuresetId):"layerId"in qe&&this._isValidId(qe.layerId)}_areTargetsValid(qe){if(Array.isArray(qe)){for(const xe of qe)if(!this._isValidId(xe))return!1;return!0}return this._isTargetValid(qe)}addSource(qe,xe){return this._isValidId(qe)?(this._lazyInitEmptyStyle(),this.style.addSource(qe,xe),this._update(!0)):this}isSourceLoaded(qe){return!!this._isValidId(qe)&&!!this.style&&this.style._isSourceCacheLoaded(qe)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(qe,xe,ke){this._lazyInitEmptyStyle(),this.style.addSourceType(qe,xe,ke)}removeSource(qe){return this._isValidId(qe)?(this.style.removeSource(qe),this._updateTerrain(),this._update(!0)):this}getSource(qe){return this._isValidId(qe)?this.style.getOwnSource(qe):null}addImage(qe,xe,{pixelRatio:ke=1,sdf:He=!1,stretchX:ri,stretchY:ai,content:vi}={}){if(this._lazyInitEmptyStyle(),xe instanceof HTMLImageElement||ImageBitmap&&xe instanceof ImageBitmap){const{width:Si,height:Li,data:Pi}=ie.q.getImageData(xe);this.style.addImage(qe,{data:new ie.r({width:Si,height:Li},Pi),pixelRatio:ke,stretchX:ri,stretchY:ai,content:vi,sdf:He,version:0,usvg:!1})}else if(xe.width===void 0||xe.height===void 0)this.fire(new ie.y(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:Si,height:Li}=xe,Pi=xe;this.style.addImage(qe,{data:new ie.r({width:Si,height:Li},new Uint8Array(Pi.data)),pixelRatio:ke,stretchX:ri,stretchY:ai,content:vi,sdf:He,usvg:!1,version:0,userImage:Pi}),Pi.onAdd&&Pi.onAdd(this,qe)}}updateImage(qe,xe){this._lazyInitEmptyStyle();const ke=this.style.getImage(qe);if(!ke)return void this.fire(new ie.y(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const He=xe instanceof HTMLImageElement||ImageBitmap&&xe instanceof ImageBitmap?ie.q.getImageData(xe):xe,{width:ri,height:ai,data:vi}=He;if(ri===void 0||ai===void 0)return void this.fire(new ie.y(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(ri!==(ke.usvg?ke.icon.usvg_tree.width:ke.data.width)||ai!==(ke.usvg?ke.icon.usvg_tree.height:ke.data.height))return void this.fire(new ie.y(new Error(`The width and height of the updated image (${ri}, ${ai})
|
|
2511
2511
|
must be that same as the previous version of the image
|
|
2512
|
-
(${ke.data.width}, ${ke.data.height})`)));const Si=!(xe instanceof HTMLImageElement||ImageBitmap&&xe instanceof ImageBitmap);let Li=!1;ke.usvg?(ke.data=new ie.r({width:ri,height:ai},new Uint8Array(vi)),ke.usvg=!1,ke.icon=void 0,Li=!0):ke.data.replace(vi,Si),this.style.updateImage(qe,ke,Li)}hasImage(qe){return qe?!!this.style&&!!this.style.getImage(qe):(this.fire(new ie.y(new Error("Missing required image id"))),!1)}removeImage(qe){this.style.removeImage(qe)}loadImage(qe,xe){ie.o(this._requestManager.transformRequest(qe,ie.R.Image),(ke,He)=>{xe(ke,He instanceof HTMLImageElement?ie.q.getImageData(He):He)})}listImages(){return this.style.listImages()}addModel(qe,xe){this._lazyInitEmptyStyle(),this.style.addModel(qe,xe)}hasModel(qe){return qe?this.style.hasModel(qe):(this.fire(new ie.y(new Error("Missing required model id"))),!1)}removeModel(qe){this.style.removeModel(qe)}listModels(){return this.style.listModels()}addLayer(qe,xe){return this._isValidId(qe.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(qe,xe),this._update(!0)):this}getSlot(qe){const xe=this.getLayer(qe);return xe&&xe.slot||null}setSlot(qe,xe){return this.style.setSlot(qe,xe),this.style.mergeLayers(),this._update(!0)}addImport(qe,xe){return this.style.addImport(qe,xe),this}updateImport(qe,xe){return typeof xe!="string"&&xe.id!==qe?(this.removeImport(qe),this.addImport(xe)):(this.style.updateImport(qe,xe),this._update(!0))}removeImport(qe){return this.style.removeImport(qe),this}moveImport(qe,xe){return this.style.moveImport(qe,xe),this._update(!0)}moveLayer(qe,xe){return this._isValidId(qe)?(this.style.moveLayer(qe,xe),this._update(!0)):this}removeLayer(qe){return this._isValidId(qe)?(this.style.removeLayer(qe),this._update(!0)):this}getLayer(qe){if(!this._isValidId(qe))return null;const xe=this.style.getOwnLayer(qe);return xe?xe.type==="custom"?xe.implementation:xe.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(qe,xe,ke){return this._isValidId(qe)?(this.style.setLayerZoomRange(qe,xe,ke),this._update(!0)):this}setFilter(qe,xe,ke={}){return this._isValidId(qe)?(this.style.setFilter(qe,xe,ke),this._update(!0)):this}getFilter(qe){return this._isValidId(qe)?this.style.getFilter(qe):null}setPaintProperty(qe,xe,ke,He={}){return this._isValidId(qe)?(this.style.setPaintProperty(qe,xe,ke,He),this._update(!0)):this}getPaintProperty(qe,xe){return this._isValidId(qe)?this.style.getPaintProperty(qe,xe):null}setLayoutProperty(qe,xe,ke,He={}){return this._isValidId(qe)?(this.style.setLayoutProperty(qe,xe,ke,He),this._update(!0)):this}getLayoutProperty(qe,xe){return this._isValidId(qe)?this.style.getLayoutProperty(qe,xe):null}getSchema(qe){return this.style.getSchema(qe)}setSchema(qe,xe){return this.style.setSchema(qe,xe),this._update(!0)}getConfig(qe){return this.style.getConfig(qe)}setConfig(qe,xe){return this.style.setConfig(qe,xe),this._update(!0)}getConfigProperty(qe,xe){return this.style.getConfigProperty(qe,xe)}setConfigProperty(qe,xe,ke){return this.style.setConfigProperty(qe,xe,ke),this._update(!0)}getFeaturesetDescriptors(qe){return this.style.getFeaturesetDescriptors(qe)}setLights(qe){if(this._lazyInitEmptyStyle(),qe&&qe.length===1&&qe[0].type==="flat"){const xe=qe[0];xe.properties?this.style.setFlatLight(xe.properties,xe.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(qe),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const qe=this.style.getLights()||[];return qe.length===0&&qe.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),qe}setLight(qe,xe={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:qe}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(qe){return this._lazyInitEmptyStyle(),!qe&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(qe),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(qe){return this._lazyInitEmptyStyle(),this.style.setFog(qe),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(qe){return this._lazyInitEmptyStyle(),this.style.setSnow(qe),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(qe){return this._lazyInitEmptyStyle(),this.style.setRain(qe),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(qe){return this._lazyInitEmptyStyle(),this.style.setColorTheme(qe),this._update(!0)}setImportColorTheme(qe,xe){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(qe,xe),this._update(!0)}setCamera(qe){return this.style.setCamera(qe),this._triggerCameraUpdate(qe)}_triggerCameraUpdate(qe){return this._update(this.transform.setOrthographicProjectionAtLowPitch(qe["camera-projection"]==="orthographic"))}getCamera(){return this.style.camera}_queryFogOpacity(qe){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(ie.bO.convert(qe),this.transform):0}setFeatureState(qe,xe){return qe.source&&!this._isValidId(qe.source)?this:(this.style.setFeatureState(qe,xe),this._update())}removeFeatureState(qe,xe){return qe.source&&!this._isValidId(qe.source)?this:(this.style.removeFeatureState(qe,xe),this._update())}getFeatureState(qe){return qe.source&&!this._isValidId(qe.source)?null:this.style.getFeatureState(qe)}_updateContainerDimensions(){if(!this._container)return;const qe=this._container.getBoundingClientRect().width||400,xe=this._container.getBoundingClientRect().height||300;let ke,He,ri,ai=this._container;for(;ai&&(!He||!ri);){const vi=window.getComputedStyle(ai).transform;vi&&vi!=="none"&&(ke=vi.match(/matrix.*\((.+)\)/)[1].split(", "),ke[0]&&ke[0]!=="0"&&ke[0]!=="1"&&(He=ke[0]),ke[3]&&ke[3]!=="0"&&ke[3]!=="1"&&(ri=ke[3])),ai=ai.parentElement}this._containerWidth=He?Math.abs(qe/He):qe,this._containerHeight=ri?Math.abs(xe/ri):xe}_detectMissingCSS(){window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&ie.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const qe=this._container;qe.classList.add("mapboxgl-map"),(this._missingCSSCanary=Ii("div","mapboxgl-canary",qe)).style.visibility="hidden",this._detectMissingCSS();const xe=this._canvasContainer=Ii("div","mapboxgl-canvas-container",qe);this._canvas=Ii("canvas","mapboxgl-canvas",xe),this._interactive&&(xe.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const ke=this._controlContainer=Ii("div","mapboxgl-control-container",qe),He=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(ri=>{He[ri]=Ii("div",`mapboxgl-ctrl-${ri}`,ke)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(qe,xe){const ke=ie.q.devicePixelRatio||1;this._canvas.width=ke*Math.ceil(qe),this._canvas.height=ke*Math.ceil(xe),this._canvas.style.width=`${qe}px`,this._canvas.style.height=`${xe}px`}_addMarker(qe){this._markers.push(qe)}_removeMarker(qe){const xe=this._markers.indexOf(qe);xe!==-1&&this._markers.splice(xe,1)}_addPopup(qe){this._popups.push(qe)}_removePopup(qe){const xe=this._popups.indexOf(qe);xe!==-1&&this._popups.splice(xe,1)}_setupPainter(){const qe=ie.l({},Ti.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),xe=this._canvas.getContext("webgl2",qe);xe?(vr(xe,!0),this.painter=new ef(xe,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",ke=>{ke.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),ie.m.testSupport(xe)):this.fire(new ie.y(new Error("Failed to initialize WebGL")))}_contextLost(qe){qe.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new ie.z("webglcontextlost",{originalEvent:qe}))}_contextRestored(qe){this._setupPainter(),this.resize(),this._update(),this.fire(new ie.z("webglcontextrestored",{originalEvent:qe}))}_onMapScroll(qe){if(qe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(qe){return this.style?(this._styleDirty=this._styleDirty||qe,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(qe){return this._update(),this._renderTaskQueue.add(qe)}_cancelRenderFrame(qe){this._renderTaskQueue.remove(qe)}_requestDomTask(qe){!this.loaded()||this.loaded()&&!this.isMoving()?qe():this._domRenderTaskQueue.add(qe)}_render(qe){let xe;this.fire(new ie.z("renderstart")),++this._frameId;const ke=this.painter.context.extTimerQuery,He=ie.q.now(),ri=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(xe=ri.createQuery(),ri.beginQuery(ke.TIME_ELAPSED_EXT,xe)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(qe),this._domRenderTaskQueue.run(qe),this._removed)return;this._updateProjectionTransition();const ai=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const Pi=this.transform.zoom,Oi=this.transform.pitch,Gi=ie.q.now(),qi=new ie.a8(Pi,{now:Gi,fadeDuration:ai,pitch:Oi,transition:this.style.transition});this.style.update(qi)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let vi=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),vi=this._updateAverageElevation(He),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):vi=this._updateAverageElevation(He);const Si=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,ai,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),Si&&(this._placementDirty=Si.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:ai,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new ie.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,li.mark(di.load),this.fire(new ie.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),xe){const Pi=ie.q.now()-He;ri.endQuery(ke.TIME_ELAPSED_EXT),setTimeout(()=>{const Oi=ri.getQueryParameter(xe,ri.QUERY_RESULT)/1e6;ri.deleteQuery(xe),this.fire(new ie.z("gpu-timing-frame",{cpuTime:Pi,gpuTime:Oi}))},50)}if(this.listens("gpu-timing-layer")){const Pi=this.painter.collectGpuTimers();setTimeout(()=>{const Oi=this.painter.queryGpuTimers(Pi);this.fire(new ie.z("gpu-timing-layer",{layerTimes:Oi}))},50)}if(this.listens("gpu-timing-deferred-render")){const Pi=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const Oi=this.painter.queryGpuTimeDeferredRender(Pi);this.fire(new ie.z("gpu-timing-deferred-render",{gpuTime:Oi}))},50)}const Li=this._sourcesDirty||this._styleDirty||this._placementDirty||vi;if(Li||this._repaint)this.triggerRepaint();else{const Pi=this.idle();if(Pi&&(vi=this._updateAverageElevation(He,!0)),vi)this.triggerRepaint();else if(this._triggerFrame(!1),Pi&&(this.fire(new ie.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const Oi=this._calculateSpeedIndex();this.fire(new ie.z("speedindexcompleted",{speedIndex:Oi})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||Li||(this._fullyLoaded=!0,li.mark(di.fullLoad),this._performanceMetricsCollection&&br(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(qe){for(const xe of this._markers)qe&&!this.getRenderWorldCopies()&&(xe._lngLat=xe._lngLat.wrap()),xe._update();for(const xe of this._popups)!qe||this.getRenderWorldCopies()||xe._trackPointer||(xe._lngLat=xe._lngLat.wrap()),xe._update()}_updateAverageElevation(qe,xe=!1){const ke=ri=>(this.transform.averageElevation=ri,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&ke(0);const He=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(He||(xe||qe-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(qe)){const ri=this.transform.averageElevation;let ai=this.transform.sampleAverageElevation();this.transform.elevation!=null&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(ai)?ai=0:this._averageElevationLastSampledAt=qe;const vi=Math.abs(ri-ai);if(vi>1){if(this._isInitialLoad||He)return this._averageElevation.jumpTo(ai),ke(ai);this._averageElevation.easeTo(ai,qe,300)}else if(vi>1e-4)return this._averageElevation.jumpTo(ai),ke(ai)}return!!this._averageElevation.isEasing(qe)&&ke(this._averageElevation.getValue(qe))}_authenticate(){Xi(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,qe=>{if(qe&&(qe.message===ze||qe.status===401)){const xe=this.painter.context.gl;vr(xe,!1),this._logoControl instanceof pa&&this._logoControl._updateLogo(),xe&&xe.clear(xe.DEPTH_BUFFER_BIT|xe.COLOR_BUFFER_BIT|xe.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new ie.y(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),fr(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&wr(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const qe=this._isDragging();this.painter.updateTerrain(this.style,qe)}_calculateSpeedIndex(){const qe=this.painter.canvasCopy(),xe=this.painter.getCanvasCopiesAndTimestamps();xe.timeStamps.push(performance.now());const ke=this.painter.context.gl,He=ke.createFramebuffer();function ri(ai){ke.framebufferTexture2D(ke.FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ke.TEXTURE_2D,ai,0);const vi=new Uint8Array(ke.drawingBufferWidth*ke.drawingBufferHeight*4);return ke.readPixels(0,0,ke.drawingBufferWidth,ke.drawingBufferHeight,ke.RGBA,ke.UNSIGNED_BYTE,vi),vi}return ke.bindFramebuffer(ke.FRAMEBUFFER,He),this._canvasPixelComparison(ri(qe),xe.canvasCopies.map(ri),xe.timeStamps)}_canvasPixelComparison(qe,xe,ke){let He=ke[1]-ke[0];const ri=qe.length/4;for(let ai=0;ai<xe.length;ai++){const vi=xe[ai];let Si=0;for(let Li=0;Li<vi.length;Li+=4)vi[Li]===qe[Li]&&vi[Li+1]===qe[Li+1]&&vi[Li+2]===qe[Li+2]&&vi[Li+3]===qe[Li+3]&&(Si+=1);He+=(ke[ai+2]-ke[ai+1])*(1-Si/ri)}return He}remove(){this._hash&&this._hash.remove();for(const xe of this._controls)xe.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.indoor.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const qe=this.painter.context.gl.getExtension("WEBGL_lose_context");qe&&qe.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),xr.delete(this.painter.context.gl),er.remove(),Hi.remove(),this._removed=!0,this.fire(new ie.z("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(qe){this._renderNextFrame=this._renderNextFrame||qe,this.style&&!this._frame&&(this._frame=ie.q.frame(xe=>{const ke=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,ke&&this._render(xe)}))}_preloadTiles(qe){const xe=this.style?this.style.getSourceCaches():[];return ie.bl(xe,(ke,He)=>ke._preloadTiles(qe,He),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(qe){this._trackResize&&this.resize({originalEvent:qe})._update()}_onVisibilityChange(){document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(qe){this._showTileBoundaries!==qe&&(this._showTileBoundaries=qe,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(qe){this._showParseStatus!==qe&&(this._showParseStatus=qe,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(qe){this._showTerrainWireframe!==qe&&(this._showTerrainWireframe=qe,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(qe){this._showLayers2DWireframe!==qe&&(this._showLayers2DWireframe=qe,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(qe){this._showLayers3DWireframe!==qe&&(this._showLayers3DWireframe=qe,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(qe){this._speedIndexTiming!==qe&&(this._speedIndexTiming=qe,this._update())}get showPadding(){return!!this._showPadding}set showPadding(qe){this._showPadding!==qe&&(this._showPadding=qe,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(qe){this._showCollisionBoxes!==qe&&(this._showCollisionBoxes=qe,this._tp.refreshUI(),qe?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(qe){this._showOverdrawInspector!==qe&&(this._showOverdrawInspector=qe,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(qe){this._repaint!==qe&&(this._repaint=qe,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(qe){this._vertices=qe,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(qe){this._showTileAABBs!==qe&&(this._showTileAABBs=qe,this._tp.refreshUI(),qe&&this._update())}_setCacheLimits(qe,xe){ie.dG(qe,xe)}get version(){return ii}},NavigationControl:class{constructor(qe={}){this.options=ie.l({},Ia,qe),this._container=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",xe=>xe.preventDefault()),this.options.showZoom&&(ie.aP(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",xe=>{this._map&&this._map.zoomIn({},{originalEvent:xe})}),Ii("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",xe=>{this._map&&this._map.zoomOut({},{originalEvent:xe})}),Ii("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(ie.aP(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",xe=>{const ke=this._map;ke&&(this.options.visualizePitch?ke.resetNorthPitch({},{originalEvent:xe}):ke.resetNorth({},{originalEvent:xe}))}),this._compassIcon=Ii("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const qe=this._map;if(!qe)return;const xe=qe.getZoom(),ke=xe===qe.getMaxZoom(),He=xe===qe.getMinZoom();this._zoomInButton.disabled=ke,this._zoomOutButton.disabled=He,this._zoomInButton.setAttribute("aria-disabled",ke.toString()),this._zoomOutButton.setAttribute("aria-disabled",He.toString())}_rotateCompassArrow(){const qe=this._map;if(!qe)return;const xe=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(qe.transform.pitch*(Math.PI/180)),.5)}) rotateX(${qe.transform.pitch}deg) rotateZ(${qe.transform.angle*(180/Math.PI)}deg)`:`rotate(${qe.transform.angle*(180/Math.PI)}deg)`;qe._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=xe)})}onAdd(qe){return this._map=qe,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),qe.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&qe.on("pitch",this._rotateCompassArrow),qe.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new mu(qe,this._compass,this.options.visualizePitch)),this._container}onRemove(){const qe=this._map;qe&&(this._container.remove(),this.options.showZoom&&qe.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&qe.off("pitch",this._rotateCompassArrow),qe.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(qe,xe){const ke=Ii("button",qe,this._container);return ke.type="button",ke.addEventListener("click",xe),ke}_setButtonTitle(qe,xe){if(!this._map)return;const ke=this._map._getUIString(`NavigationControl.${xe}`);qe.setAttribute("aria-label",ke),qe.firstElementChild&&qe.firstElementChild.setAttribute("title",ke)}},GeolocateControl:class extends ie.E{constructor(qe={}){super();const xe=navigator.geolocation;this.options=ie.l({geolocation:xe},Fu,qe),ie.aP(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=od(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(qe){return this._map=qe,this._container=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(qe){const xe=(ke=!!this.options.geolocation)=>{this._supportsGeolocation=ke,qe(ke)};this._supportsGeolocation!==void 0?qe(this._supportsGeolocation):navigator.permissions!==void 0?navigator.permissions.query({name:"geolocation"}).then(ke=>xe(ke.state!=="denied")).catch(()=>xe()):xe()}_isOutOfMapMaxBounds(qe){const xe=this._map.getMaxBounds(),ke=qe.coords;return!!xe&&(ke.longitude<xe.getWest()||ke.longitude>xe.getEast()||ke.latitude<xe.getSouth()||ke.latitude>xe.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(qe){if(this._map){if(this._isOutOfMapMaxBounds(qe))return this._setErrorState(),this.fire(new ie.z("outofmaxbounds",qe)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=qe,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(qe),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(qe),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new ie.z("geolocate",qe)),this._finish()}}_updateCamera(qe){const xe=new ie.bO(qe.coords.longitude,qe.coords.latitude),ke=qe.coords.accuracy,He=this._map.getBearing(),ri=ie.l({bearing:He},this.options.fitBoundsOptions);this._map.fitBounds(xe.toBounds(ke),ri,{geolocateSource:!0})}_updateMarker(qe){if(qe){const xe=new ie.bO(qe.coords.longitude,qe.coords.latitude);this._accuracyCircleMarker.setLngLat(xe).addTo(this._map),this._userLocationDotMarker.setLngLat(xe).addTo(this._map),this._accuracy=qe.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const qe=this._map.transform,xe=ie.bH(1,qe._center.lat)*qe.worldSize,ke=Math.ceil(2*this._accuracy*xe);this._circleElement.style.width=`${ke}px`,this._circleElement.style.height=`${ke}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(qe){if(this._map){if(this.options.trackUserLocation)if(qe.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const xe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",xe),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",xe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(qe.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new ie.z("error",qe)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(qe){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",xe=>xe.preventDefault()),this._geolocateButton=Ii("button","mapboxgl-ctrl-geolocate",this._container),Ii("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",qe===!1){ie.w("Geolocation support is not available so the GeolocateControl will be disabled.");const xe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",xe),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",xe)}else{const xe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",xe),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",xe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ii("div","mapboxgl-user-location"),this._dotElement.appendChild(Ii("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(Ii("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new uf({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=Ii("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new uf({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",xe=>{xe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||xe.originalEvent&&xe.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new ie.z("trackuserlocationend")))})}}_onDeviceOrientation(qe){this._userLocationDotMarker&&(qe.webkitCompassHeading?this._heading=qe.webkitCompassHeading:qe.absolute===!0&&(this._heading=-1*qe.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return ie.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new ie.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new ie.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new ie.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let qe;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(qe={maximumAge:6e5,timeout:0},this._noTimeout=!0):(qe=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,qe),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const qe=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};typeof DeviceMotionEvent<"u"&&typeof DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(xe=>{xe==="granted"&&qe()}).catch(console.error):qe()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ou,ScaleControl:class{constructor(qe={}){this.options=ie.l({},vu,qe),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),ie.aP(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const qe=this.options.maxWidth||100,xe=this._map,ke=xe._containerHeight/2,He=xe._containerWidth/2-qe/2,ri=xe.unproject([He,ke]),ai=xe.unproject([He+qe,ke]),vi=ri.distanceTo(ai);if(this.options.unit==="imperial"){const Si=3.2808*vi;Si>5280?this._setScale(qe,Si/5280,"mile"):this._setScale(qe,Si,"foot")}else this.options.unit==="nautical"?this._setScale(qe,vi/1852,"nautical-mile"):vi>=1e3?this._setScale(qe,vi/1e3,"kilometer"):this._setScale(qe,vi,"meter")}_setScale(qe,xe,ke){this._map._requestDomTask(()=>{const He=function(ai){const vi=Math.pow(10,`${Math.floor(ai)}`.length-1);let Si=ai/vi;return Si=Si>=10?10:Si>=5?5:Si>=3?3:Si>=2?2:Si>=1?1:function(Li){const Pi=Math.pow(10,Math.ceil(-Math.log(Li)/Math.LN10));return Math.round(Li*Pi)/Pi}(Si),vi*Si}(xe),ri=He/xe;this._container.innerHTML=this._isNumberFormatSupported&&ke!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:ke}).format(He):`${He} ${As[ke]}`,this._container.style.width=qe*ri+"px"})}onAdd(qe){return this._map=qe,this._language=qe.getLanguage(),this._container=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-scale",qe.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(qe){this._language=qe,this._update()}setUnit(qe){this.options.unit=qe,this._update()}},FullscreenControl:class{constructor(qe={}){this._fullscreen=!1,qe&&qe.container&&(qe.container instanceof HTMLElement?this._container=qe.container:ie.w("Full screen control 'container' must be a DOM element.")),ie.aP(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(qe){return this._map=qe,this._container||(this._container=this._map.getContainer()),this._controlContainer=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",ie.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const qe=this._fullscreenButton=Ii("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Ii("span","mapboxgl-ctrl-icon",qe).setAttribute("aria-hidden","true"),qe.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const qe=this._getTitle();this._fullscreenButton.setAttribute("aria-label",qe),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",qe)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends ie.E{constructor(qe){super(),this.options=ie.l(Object.create(xs),qe),ie.aP(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(qe&&qe.className?qe.className.trim().split(/\s+/):[])}addTo(qe){return this._map&&this.remove(),this._map=qe,this.options.closeOnClick&&qe.on("preclick",this._onClose),this.options.closeOnMove&&qe.on("move",this._onClose),qe.on("remove",this.remove),this._update(),qe._addPopup(this),this._focusFirstElement(),this._trackPointer?(qe.on("mousemove",this._onMouseEvent),qe.on("mouseup",this._onMouseEvent),qe._canvasContainer.classList.add("mapboxgl-track-pointer")):qe.on("move",this._update),this.fire(new ie.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const qe=this._map;return qe&&(qe.off("move",this._update),qe.off("move",this._onClose),qe.off("preclick",this._onClose),qe.off("click",this._onClose),qe.off("remove",this.remove),qe.off("mousemove",this._onMouseEvent),qe.off("mouseup",this._onMouseEvent),qe.off("drag",this._onMouseEvent),qe._canvasContainer&&qe._canvasContainer.classList.remove("mapboxgl-track-pointer"),qe._removePopup(this),this._map=void 0),this.fire(new ie.z("close")),this}getLngLat(){return this._lngLat}setLngLat(qe){this._lngLat=ie.bO.convert(qe),this._pos=null,this._trackPointer=!1,this._update();const xe=this._map;return xe&&(xe.on("move",this._update),xe.off("mousemove",this._onMouseEvent),xe._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const qe=this._map;return qe&&(qe.off("move",this._update),qe.on("mousemove",this._onMouseEvent),qe.on("drag",this._onMouseEvent),qe._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(qe){return this.setDOMContent(document.createTextNode(qe))}setHTML(qe){const xe=document.createDocumentFragment(),ke=document.createElement("body");let He;for(ke.innerHTML=qe;He=ke.firstChild,He;)xe.appendChild(He);return this.setDOMContent(xe)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(qe){return this.options.maxWidth=qe,this._update(),this}setDOMContent(qe){let xe=this._content;if(xe)for(;xe.hasChildNodes();)xe.firstChild&&xe.removeChild(xe.firstChild);else xe=this._content=Ii("div","mapboxgl-popup-content",this._container||void 0);if(xe.appendChild(qe),this.options.closeButton){const ke=this._closeButton=Ii("button","mapboxgl-popup-close-button",xe);ke.type="button",ke.setAttribute("aria-label","Close popup"),ke.setAttribute("aria-hidden","true"),ke.innerHTML="×",ke.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(qe){return this._classList.add(qe),this._updateClassList(),this}removeClassName(qe){return this._classList.delete(qe),this._updateClassList(),this}setOffset(qe){return this.options.offset=qe,this._update(),this}toggleClassName(qe){let xe;return this._classList.delete(qe)?xe=!1:(this._classList.add(qe),xe=!0),this._updateClassList(),xe}_onMouseEvent(qe){this._update(qe.point)}_getAnchor(qe){if(this.options.anchor)return this.options.anchor;const xe=this._map,ke=this._container,He=this._pos;if(!xe||!ke||!He)return"bottom";const ri=ke.offsetWidth,ai=ke.offsetHeight,vi=He.x<ri/2,Si=He.x>xe.transform.width-ri/2;if(He.y+qe<ai)return vi?"top-left":Si?"top-right":"top";if(He.y>xe.transform.height-ai){if(vi)return"bottom-left";if(Si)return"bottom-right"}return vi?"left":Si?"right":"bottom"}_updateClassList(){const qe=this._container;if(!qe)return;const xe=[...this._classList];xe.push("mapboxgl-popup"),this._anchor&&xe.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&xe.push("mapboxgl-popup-track-pointer"),qe.className=xe.join(" ")}_update(qe){const xe=this._map,ke=this._content;if(!xe||!this._lngLat&&!this._trackPointer||!ke)return;let He=this._container;if(He||(He=this._container=Ii("div","mapboxgl-popup",xe.getContainer()),this._tip=Ii("div","mapboxgl-popup-tip",He),He.appendChild(ke)),this.options.maxWidth&&He.style.maxWidth!==this.options.maxWidth&&(He.style.maxWidth=this.options.maxWidth),xe.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=i0(this._lngLat,this._pos,xe.transform)),!this._trackPointer||qe){const ri=this._pos=this._trackPointer&&qe instanceof ie.P?qe:xe.project(this._lngLat),ai=em(this.options.offset),vi=this._anchor=this._getAnchor(ai.y),Si=em(this.options.offset,vi),Li=ri.add(Si).round();xe._requestDomTask(()=>{this._container&&vi&&(this._container.style.transform=`${up[vi]} translate(${Li.x}px,${Li.y}px)`)})}if(!this._marker&&xe._showingGlobe()){const ri=ie.dH(xe.transform,this._lngLat)?0:1;this._setOpacity(ri)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const qe=this._container.querySelector(Fs);qe&&qe.focus()}_onClose(){this.remove()}_setOpacity(qe){this._container&&(this._container.style.opacity=`${qe}`),this._content&&(this._content.style.pointerEvents=qe?"auto":"none")}},Marker:uf,Style:za,LngLat:ie.bO,LngLatBounds:ie.az,Point:ie.P,MercatorCoordinate:ie.aa,FreeCameraOptions:Oh,Evented:ie.E,config:ie.e,prewarm:ie.dM,clearPrewarmedResources:ie.dN,get accessToken(){return ie.e.ACCESS_TOKEN},set accessToken(qe){ie.e.ACCESS_TOKEN=qe},get baseApiUrl(){return ie.e.API_URL},set baseApiUrl(qe){ie.e.API_URL=qe},get workerCount(){return ie.dO.workerCount},set workerCount(qe){ie.dO.workerCount=qe},get maxParallelImageRequests(){return ie.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(qe){ie.e.MAX_PARALLEL_IMAGE_REQUESTS=qe},clearStorage(qe){ie.dP(qe)},get workerUrl(){return ie.dQ.workerUrl},set workerUrl(qe){ie.dQ.workerUrl=qe},get workerClass(){return ie.dQ.workerClass},set workerClass(qe){ie.dQ.workerClass=qe},get workerParams(){return ie.dQ.workerParams},set workerParams(qe){ie.dQ.workerParams=qe},get dracoUrl(){return ie.dR()},set dracoUrl(qe){ie.dS(qe)},get meshoptUrl(){return ie.dT()},set meshoptUrl(qe){ie.dU(qe)},setNow:ie.q.setNow,restoreNow:ie.q.restoreNow}});var Ze=Pe;return Ze})})(mapboxGl);const mapboxgl=getDefaultExportFromCjs$1(mapboxGl.exports);function debounce(m,c){let ne=null;const we=this;return()=>{clearTimeout(ne);var Pe=arguments;ne=setTimeout(()=>{m.apply(we,Pe)},c)}}const _hoisted_1$r={class:"map"},_sfc_main$A=vue.defineComponent({__name:"MapboxMap",props:{bounds:{},padding:{},mapboxAccessToken:{},mapboxStyle:{},projection:{},bearing:{},pitch:{},synchronousPrecision:{},ratio:{}},emits:["update:bounds"],setup(m,{emit:c}){const ne=m,we=c;function Pe(Ti){return{left:Ti[0],top:Ti[1],right:Ti[2],bottom:Ti[3]}}const Me=vue.ref(),{width:Ze,height:ie}=useElementBounding(Me);let ii;const di=()=>{ii?.fitBounds(ne.bounds,{padding:Pe(ne.padding),pitch:ne.pitch,bearing:ne.bearing})},li=()=>{if(Ci.value&&ii){const{x:Ti,y:Ii,width:Di,height:Zi}=Ci.value,Fi=ii.unproject([Ti+Di,Ii]),Ui=ii.unproject([Ti,Ii+Zi]);Ai.value=[Ui.lng,Ui.lat,Fi.lng,Fi.lat].map(Wi=>Number(Wi.toFixed(ne.synchronousPrecision)))}};vue.onMounted(()=>{ii=new mapboxgl.Map({container:Me.value,style:ne.mapboxStyle,bounds:ne.bounds,accessToken:ne.mapboxAccessToken,projection:ne.projection,bearing:ne.bearing,pitch:ne.pitch}),ii.on("render",li),ii.on("load",()=>{di()})}),vue.watch(()=>ne.mapboxStyle,()=>{ii?.setStyle(ne.mapboxStyle)}),vue.watch(()=>ne.projection,()=>{ii?.setProjection(ne.projection)}),vue.watch(()=>ne.bearing,()=>{ii?.setBearing(ne.bearing)}),vue.watch(()=>ne.pitch,()=>{ii?.setPitch(ne.pitch)}),vue.watch([()=>ne.bounds,()=>ne.padding],di);const mi=vue.computed(()=>Ze.value&&ie.value?Ze.value/ie.value:1),Ci=vue.computed(()=>{const Ti=Ze.value-ne.padding[0]-ne.padding[2],Ii=ie.value-ne.padding[1]-ne.padding[3];if(mi.value>=ne.ratio){const Di=Ii*ne.ratio;return{x:ne.padding[0]+(Ti-Di)/2,y:ne.padding[1]+0,width:Di,height:Ii}}else{const Di=Ti/ne.ratio;return{x:ne.padding[0]+0,y:ne.padding[1]+(Ii-Di)/2,width:Ti,height:Di}}}),Ai=vue.ref();return vue.watch(Ai,debounce(()=>{!isEqual(Ai.value,ne.bounds)&&Ai.value&&we("update:bounds",Ai.value)},100)),(Ti,Ii)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$r,[vue.createElementVNode("div",{ref_key:"mapboxMapRef",ref:Me,class:"mapbox-map"},null,512),Ci.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layer",style:vue.normalizeStyle({"--x":`${Ci.value.x}px`,"--y":`${Ci.value.y}px`,"--width":`${Ci.value.width}px`,"--height":`${Ci.value.height}px`})},[vue.renderSlot(Ti.$slots,"layer",{bounds:Ai.value,bbox:Ci.value,map:vue.unref(ii)},void 0,!0)],4)):vue.createCommentVNode("",!0)]))}}),MapboxMap_vue_vue_type_style_index_0_scoped_8f6ef37a_lang="",MapboxMap=_export_sfc(_sfc_main$A,[["__scopeId","data-v-8f6ef37a"]]),_hoisted_1$q={class:"preview-image"},_hoisted_2$i=["src"],_hoisted_3$b={class:"map-wrapper"},_sfc_main$z=vue.defineComponent({__name:"Map",props:{modelValue:{},padding:{default:0},mapStyle:{default:"mapbox://styles/mapbox/streets-v11"},mapboxAccessToken:{},type:{default:"popup"},aspectRatio:{}},emits:["update:model-value"],setup(m,{emit:c}){const ne=m,we=c,Pe=vue.ref(),{width:Me}=useElementBounding(Pe),Ze=vue.ref(!1);vue.watch(Ze,()=>{Ze.value||(ie.value=ii.value,we("update:model-value",ie.value))});const ie=vue.ref(ne.modelValue),ii=vue.ref(ne.modelValue),di=debounce(Ci=>{ii.value=Ci,ne.type==="inline"&&we("update:model-value",ii.value)},500);function li(){const Ci=ne.mapStyle?.replace("mapbox://styles/",""),Ai=Math.round(Me.value??200);return`https://api.mapbox.com/styles/v1/${Ci}/static/[${ie.value.join(",")}]/${Ai}x${Math.round(Ai/ne.aspectRatio)}@2x?access_token=${ne.mapboxAccessToken}`}const mi=vue.ref(li());return vue.watch(ie,debounce(()=>{mi.value=li()},500)),(Ci,Ai)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"mapFieldRef",ref:Pe,class:vue.normalizeClass(["field-map",{["type-"+Ci.type]:!0}]),style:vue.normalizeStyle({"--aspect-ratio":Ci.aspectRatio})},[Ci.type==="inline"?(vue.openBlock(),vue.createBlock(MapboxMap,{key:0,bounds:Ci.modelValue,"onUpdate:bounds":vue.unref(di),bearing:0,pitch:0,"mapbox-access-token":Ci.mapboxAccessToken,"mapbox-style":Ci.mapStyle,padding:[Ci.padding,Ci.padding,Ci.padding,Ci.padding],projection:{name:"globe"},ratio:Ci.aspectRatio,"synchronous-precision":8},{layer:vue.withCtx(({bounds:Ti,map:Ii,bbox:Di})=>[Ti&&Ii?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layer-wrapper",style:vue.normalizeStyle({"--x":`${Ii.project([Ti[0],Ti[1]]).x}px`,"--y":`${Ii.project([Ti[2],Ti[3]]).y}px`,"--width":`${Ii.project([Ti[2],Ti[3]]).x-Ii.project([Ti[0],Ti[1]]).x}px`,"--height":`${Ii.project([Ti[0],Ti[1]]).y-Ii.project([Ti[2],Ti[3]]).y}px`})},Ai[1]||(Ai[1]=[vue.createElementVNode("div",{class:"overlay"},null,-1),vue.createElementVNode("div",{class:"viewport-border"},null,-1)]),4)):vue.createCommentVNode("",!0)]),_:1},8,["bounds","onUpdate:bounds","mapbox-access-token","mapbox-style","padding","ratio"])):(vue.openBlock(),vue.createBlock(_sfc_main$17,{key:1,type:"layer",transculent:"",show:Ze.value,"onUpdate:show":Ai[0]||(Ai[0]=Ti=>Ze.value=Ti)},{trigger:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$q,[vue.createElementVNode("img",{src:mi.value},null,8,_hoisted_2$i)])]),"close-btn":vue.withCtx(()=>[vue.createVNode(BxButton,{round:"",tertiary:"",class:"close-btn"},{default:vue.withCtx(()=>Ai[2]||(Ai[2]=[vue.createTextVNode(" Done ")])),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$b,[vue.createVNode(MapboxMap,{bounds:Ci.modelValue,"onUpdate:bounds":vue.unref(di),bearing:0,pitch:0,"mapbox-access-token":Ci.mapboxAccessToken,"mapbox-style":Ci.mapStyle,padding:[Ci.padding,Ci.padding,Ci.padding,Ci.padding],projection:{name:"globe"},ratio:Ci.aspectRatio,"synchronous-precision":8},{layer:vue.withCtx(({bounds:Ti,map:Ii,bbox:Di})=>[Ti&&Ii?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layer-wrapper",style:vue.normalizeStyle({"--x":`${Ii.project([Ti[0],Ti[1]]).x}px`,"--y":`${Ii.project([Ti[2],Ti[3]]).y}px`,"--width":`${Ii.project([Ti[2],Ti[3]]).x-Ii.project([Ti[0],Ti[1]]).x}px`,"--height":`${Ii.project([Ti[0],Ti[1]]).y-Ii.project([Ti[2],Ti[3]]).y}px`})},Ai[3]||(Ai[3]=[vue.createElementVNode("div",{class:"overlay"},null,-1),vue.createElementVNode("div",{class:"viewport-border"},null,-1),vue.createElementVNode("div",{class:"marker"},[vue.createElementVNode("svg",{version:"1.0",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 64 64","enable-background":"new 0 0 64 64","xml:space":"preserve"},[vue.createElementVNode("path",{d:"M32,0C18.746,0,8,10.746,8,24c0,5.219,1.711,10.008,4.555,13.93c0.051,0.094,0.059,0.199,0.117,0.289l16,24 C29.414,63.332,30.664,64,32,64s2.586-0.668,3.328-1.781l16-24c0.059-0.09,0.066-0.195,0.117-0.289C54.289,34.008,56,29.219,56,24 C56,10.746,45.254,0,32,0z M32,32c-4.418,0-8-3.582-8-8s3.582-8,8-8s8,3.582,8,8S36.418,32,32,32z"})])],-1)]),4)):vue.createCommentVNode("",!0)]),_:1},8,["bounds","onUpdate:bounds","mapbox-access-token","mapbox-style","padding","ratio"])])]),_:1},8,["show"]))],6))}}),Map_vue_vue_type_style_index_0_scoped_2e4a6276_lamng_scss_lang="",Map_vue_vue_type_style_index_1_lang="",Map$1=_export_sfc(_sfc_main$z,[["__scopeId","data-v-2e4a6276"]]),_hoisted_1$p={class:"field-color"},_sfc_main$y=vue.defineComponent({__name:"Color",props:vue.mergeModels({alpha:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue");return(ne,we)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$p,[vue.withDirectives(vue.createElementVNode("input",{type:"color","onUpdate:modelValue":we[0]||(we[0]=Pe=>c.value=Pe)},null,512),[[vue.vModelText,c.value]])]))}}),Color_vue_vue_type_style_index_0_scoped_14e2dc54_lang="",Color$1=_export_sfc(_sfc_main$y,[["__scopeId","data-v-14e2dc54"]]);function e$1(m,c,ne=1e3,we){let Pe,Me=0;const Ze=()=>{Pe&&clearTimeout(Pe)};return vue.watch(m,async(ie,ii)=>{we&&we(ie,ii);const di=()=>(Ze(),Me=Date.now(),c(ie,ii)),li=Date.now()-Me;li>=ne?di():(Ze(),Pe=setTimeout(di,ne-li))})}const _sfc_main$x=vue.defineComponent({__name:"BxSlider",props:vue.mergeModels({min:{},max:{},step:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.inject("darkmode"),ne=vue.useModel(m,"modelValue"),we=m,Pe=vue.ref(),{left:Me,width:Ze}=useElementBounding(Pe),ie=vue.computed(()=>isNaN(ne.value)?we.min:Math.min(we.max,Math.max(we.min,ne.value))),ii=vue.computed(()=>we.max-we.min),di=vue.computed(()=>(ie.value-we.min)/ii.value),li=vue.ref();function mi(Ii){if(Ii.preventDefault(),Ii.target?.closest(".slider-thumb"))Ii.type==="mousedown"?li.value={x:Ii.clientX,value:ie.value}:li.value={x:Ii.touches[0].clientX,value:ie.value};else{const Di=Ii.type==="mousedown"?Ii.clientX:Ii.touches[0].clientX,Ui=(Di-Me.value)/Ze.value*ii.value,Wi=we.min+Ui;ne.value=Math.min(we.max,Math.max(we.min,Wi-Wi%we.step)),li.value={x:Di,value:Wi}}}const Ci=vue.ref({x:0,y:0});e$1(()=>Ci.value,()=>{if(!li.value)return;const Zi=(li.value.x-Ci.value.x)/Ze.value*ii.value,Fi=li.value.value-Zi;ne.value=Math.min(we.max,Math.max(we.min,Fi-Fi%we.step))},16,()=>{});function Ai(Ii){!li.value||(Ii.preventDefault(),Ii.type==="mousemove"?Ci.value={x:Ii.clientX,y:Ii.clientY}:Ci.value={x:Ii.touches[0].clientX,y:Ii.touches[0].clientY})}function Ti(Ii){li.value&&Ii.preventDefault(),li.value=void 0}return window.addEventListener("mousemove",Ai),window.addEventListener("mouseup",Ti),window.addEventListener("touchmove",Ai),window.addEventListener("touchend",Ti),vue.onUnmounted(()=>{window.removeEventListener("mousemove",Ai),window.removeEventListener("mouseup",Ti),window.removeEventListener("touchmove",Ai),window.removeEventListener("touchend",Ti)}),(Ii,Di)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bx-slider swiper-no-swiping",{darkmode:vue.unref(c)}]),style:vue.normalizeStyle({"--value-relative":di.value}),onMousedown:mi,onTouchstart:mi},[vue.createElementVNode("div",{class:"slider-body",ref_key:"sliderBodyRef",ref:Pe},Di[0]||(Di[0]=[vue.createElementVNode("div",{class:"slider-value"},null,-1)]),512),Di[1]||(Di[1]=vue.createElementVNode("div",{class:"slider-thumb"},null,-1))],38))}}),BxSlider_vue_vue_type_style_index_0_scoped_27197875_lang="",BxSlider=_export_sfc(_sfc_main$x,[["__scopeId","data-v-27197875"]]),_hoisted_1$o={class:"field-number"},_hoisted_2$h=["min","max","step"],_sfc_main$w=vue.defineComponent({__name:"Number",props:vue.mergeModels({min:{},max:{},step:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=vue.computed({get(){return Number(c.value)},set(we){c.value=Number(we)}});return(we,Pe)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$o,[we.type==="slider"?(vue.openBlock(),vue.createBlock(BxSlider,{key:0,type:"range",modelValue:ne.value,"onUpdate:modelValue":Pe[0]||(Pe[0]=Me=>ne.value=Me),min:we.min,max:we.max,step:we.step},null,8,["modelValue","min","max","step"])):vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{key:1,type:"number","onUpdate:modelValue":Pe[1]||(Pe[1]=Me=>ne.value=Me),min:we.min,max:we.max,step:we.step},null,8,_hoisted_2$h)),[[vue.vModelText,ne.value]])]))}}),Number_vue_vue_type_style_index_0_scoped_7b17f563_lang="",Number$1=_export_sfc(_sfc_main$w,[["__scopeId","data-v-7b17f563"]]),_hoisted_1$n={key:0,class:"select-dropdown-wrapper"},_hoisted_2$g=["onClick"],_hoisted_3$a={class:"preview-wrapper"},_hoisted_4$6={key:0,class:"label-wrapper"},_sfc_main$v=vue.defineComponent({__name:"SelectItem",props:vue.mergeModels({options:{},layout:{},size:{},showLabels:{type:Boolean},mobile:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=m;vue.useSlots();const we=vue.computed(()=>ne.options.map(Pe=>({label:Pe.label,value:Pe.value,icon:Pe.image?()=>vue.h("img",{src:Pe.image,style:{"object-fit":"cover",width:"19px",height:"19px"}}):void 0})));return(Pe,Me)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-item-wrapper",{[`size-${Pe.size}`]:!0,["swiper-no-swiping"]:Pe.mobile&&Pe.layout==="carroussel"}])},[Pe.layout==="dropdown"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$n,[vue.createVNode(BxSelect,{modelValue:c.value,"onUpdate:modelValue":Me[0]||(Me[0]=Ze=>c.value=Ze),options:we.value,"placeholder-active-label":"Select option"},null,8,["modelValue","options"])])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["select-buttons-wrapper",{carroussel:Pe.layout==="carroussel"}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Pe.options,Ze=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-option-button",{selected:Ze.value===c.value}]),onClick:ie=>c.value=Ze.value},[vue.createElementVNode("div",_hoisted_3$a,[vue.renderSlot(Pe.$slots,"preview",{option:Ze,selected:c.value===Ze.value},void 0,!0)]),Ze.label?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$6,vue.toDisplayString(Ze.label),1)):vue.createCommentVNode("",!0)],10,_hoisted_2$g))),256))],2))],2))}}),SelectItem_vue_vue_type_style_index_0_scoped_0aeb4f24_lang="",SelectItem=_export_sfc(_sfc_main$v,[["__scopeId","data-v-0aeb4f24"]]),_hoisted_1$m={class:"select-text-field"},_sfc_main$u=vue.defineComponent({__name:"SelectText",props:vue.mergeModels({options:{},layout:{},imageDisplay:{},showLabels:{type:Boolean},size:{},mobile:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=m,we=vue.computed(()=>ne.layout==="button"&&ne.mobile?"carroussel":ne.layout);return(Pe,Me)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$m,[vue.createVNode(SelectItem,{modelValue:c.value,"onUpdate:modelValue":Me[0]||(Me[0]=Ze=>c.value=Ze),options:Pe.options,layout:we.value,"image-display":Pe.imageDisplay,"show-labels":Pe.showLabels,size:Pe.size,mobile:Pe.mobile},null,8,["modelValue","options","layout","image-display","show-labels","size","mobile"])]))}}),SelectText_vue_vue_type_style_index_0_scoped_cb108a08_lang="",SelectText=_export_sfc(_sfc_main$u,[["__scopeId","data-v-cb108a08"]]),_sfc_main$t=vue.defineComponent({__name:"SelectColor",props:vue.mergeModels({options:{},layout:{},imageDisplay:{},showLabels:{type:Boolean},size:{},mobile:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=useDarkmode(),we=m,Pe=vue.computed(()=>we.layout==="button"&&we.mobile?"carroussel":we.layout),Me=vue.computed(()=>we.layout==="dropdown"?we.options.map(Ze=>({label:Ze.label||Ze.value,value:Ze.value,image:`data:image/svg+xml;base64,${window.btoa(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50%" cy="50%" r="50%" style="fill: ${Ze.image};" /></svg>`)}`})):we.options);return(Ze,ie)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-color-field",{darkmode:vue.unref(ne)}])},[vue.createVNode(SelectItem,{modelValue:c.value,"onUpdate:modelValue":ie[0]||(ie[0]=ii=>c.value=ii),options:Me.value,layout:Pe.value,"image-display":Ze.imageDisplay,"show-labels":Ze.showLabels,size:Ze.size,mobile:Ze.mobile},{preview:vue.withCtx(({option:ii,selected:di})=>[vue.createElementVNode("div",{class:vue.normalizeClass(["preview-color",{selected:di}]),style:vue.normalizeStyle({"--color":ii.image||ii.value})},null,6)]),_:1},8,["modelValue","options","layout","image-display","show-labels","size","mobile"])],2))}}),SelectColor_vue_vue_type_style_index_0_scoped_eb8315a9_lang="",SelectColor=_export_sfc(_sfc_main$t,[["__scopeId","data-v-eb8315a9"]]),_hoisted_1$l=["src"],_sfc_main$s=vue.defineComponent({__name:"SelectImage",props:vue.mergeModels({options:{},layout:{},imageDisplay:{},showLabels:{type:Boolean},size:{},mobile:{type:Boolean,default:!1}},{modelValue:{required:!0,default:()=>({src:"https://picsum.photos/536/354",scale:1,innerPos:[0,0],innerRotate:0})},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=useDarkmode(),ne=vue.useModel(m,"modelValue"),we=m,Pe=vue.computed(()=>we.layout==="button"&&we.mobile?"carroussel":we.layout),Me=vue.computed({get(){return typeof ne.value=="string"?ne.value:ne.value.src},set(Ze){typeof ne.value=="string"?ne.value=Ze:ne.value={...ne.value,src:Ze}}});return(Ze,ie)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-image-field",{mobile:Ze.mobile,darkmode:vue.unref(c)}])},[vue.createVNode(SelectItem,{modelValue:Me.value,"onUpdate:modelValue":ie[0]||(ie[0]=ii=>Me.value=ii),options:Ze.options,layout:Pe.value,"image-display":Ze.imageDisplay,"show-labels":Ze.showLabels,size:Ze.size,mobile:Ze.mobile},{preview:vue.withCtx(({option:ii,selected:di})=>[vue.createElementVNode("img",{class:vue.normalizeClass(["preview-image",{[`image-display-${Ze.imageDisplay}`]:!0,selected:di}]),src:ii.image},null,10,_hoisted_1$l)]),_:1},8,["modelValue","options","layout","image-display","show-labels","size","mobile"])],2))}}),SelectImage_vue_vue_type_style_index_0_scoped_d55f1edb_lang="",SelectImage=_export_sfc(_sfc_main$s,[["__scopeId","data-v-d55f1edb"]]),style$1="",_hoisted_1$k={key:0,class:"info-symbol-wrapper"},_hoisted_2$f={class:"instruction-text"},_hoisted_3$9={class:"detailed-description-text"},_sfc_main$r=vue.defineComponent({__name:"Instruction",props:{instruction:{},description:{},detailedDescription:{}},setup(m){const c=useDarkmode();return(ne,we)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["instruction-field",{darkmode:vue.unref(c)}])},[ne.description===void 0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[vue.createVNode(BxIcon,null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(InformationCircleOutline))]),_:1})])):vue.createCommentVNode("",!0),vue.createElementVNode("main",null,[vue.createElementVNode("div",_hoisted_2$f,vue.toDisplayString(ne.instruction),1),vue.createElementVNode("div",_hoisted_3$9,vue.toDisplayString(ne.detailedDescription),1)])],2))}}),Instruction_vue_vue_type_style_index_0_scoped_d63c188c_lang="",Instruction=_export_sfc(_sfc_main$r,[["__scopeId","data-v-d63c188c"]]),BluepciFieldComponents=Object.freeze(Object.defineProperty({__proto__:null,ImageEdit,Image:Image$1,Group,Text,ImageAdjust,Select,Checkbox,Collection,Map:Map$1,Color:Color$1,Number:Number$1,SelectText,SelectColor,SelectImage,Instruction},Symbol.toStringTag,{value:"Module"})),_hoisted_1$j={class:"inner"},_hoisted_2$e={key:1},_sfc_main$q=vue.defineComponent({__name:"FieldsList",props:{layout:{default:"list"},fields:{},isRoot:{type:Boolean}},setup(m){const c=vue.inject("darkmode"),ne=m,we=vue.inject("bridge"),Pe=vue.inject("data"),Me=vue.inject("computedPropEvaluator");Me||console.error("computedPropEvaluator is not provided");const Ze=di=>{if("pos"in di&&"scale"in di){const mi=di.image,Ci=di.pos,Ai=di.scale;return{image:Pe.value[mi],"onUpdate:image":Ii=>{Pe.value[mi]=Ii},adjust:{scale:Pe.value[Ai],innerPos:Pe.value[Ci]},"onUpdate:adjust":Ii=>{Pe.value[Ai]=Ii.scale,Pe.value[Ci]=Ii.innerPos}}}return{...Object.fromEntries(Object.entries(di).map(([mi,Ci])=>[mi,Pe.value[Ci]])),...Object.fromEntries(Object.entries(di).map(([mi])=>[`onUpdate:${mi}`,Ci=>{Pe.value[di[mi]]=Ci}]))}};function ie(di){return Object.fromEntries(Object.entries(di).map(([li,mi])=>typeof mi=="function"?[li,Me(mi)]:[li,mi]))}const ii=di=>{const li=ne.fields.indexOf(di),mi=ne.fields.slice(0,li).filter(Ci=>Ci.type==="Instruction");return li-mi.length+1};return(di,li)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bluepic-fields",{["layout-"+di.layout]:!0,darkmode:vue.unref(c)}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(di.fields,(mi,Ci)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["field",{"is-root":di.isRoot,["field-type-"+mi.type.toLowerCase()]:!0,"field-has-card":mi.type==="Group"&&mi.props.card}]),style:vue.normalizeStyle({"--min-width":mi.layout?.minWidth,"--max-width":mi.layout?.maxWidth})},[mi.type!=="Group"&&mi.description?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["description",{"no-detailed-description":!mi.detailedDescription,"text-overlaying-description":!di.isRoot&&mi.type==="Text"}])},[vue.createElementVNode("div",_hoisted_1$j,[di.isRoot?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["root-index",{}])},[mi.type==="Instruction"?(vue.openBlock(),vue.createBlock(BxIcon,{key:0},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(InformationOutline))]),_:1})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$e,vue.toDisplayString(ii(mi)),1))])):vue.createCommentVNode("",!0),vue.createElementVNode("span",null,vue.toDisplayString(mi.description),1),mi.detailedDescription&&mi.type!=="Instruction"?(vue.openBlock(),vue.createBlock(BxTooltip,{key:1,trigger:"hover",darkmode:vue.unref(c)},{trigger:vue.withCtx(()=>[vue.createVNode(BxIcon,null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(HelpOutline))]),_:1})]),content:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(mi.detailedDescription),1)]),_:2},1032,["darkmode"])):vue.createCommentVNode("",!0)])],2)):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(BluepciFieldComponents[mi.type]),vue.mergeProps({bridge:vue.unref(we),index:Ci,"is-root":di.isRoot,ref_for:!0},{...ie(mi.props),...Ze(mi.model),field:mi,description:mi.description,detailedDescription:mi.detailedDescription,...(()=>{if(mi.type==="Text")return{...mi.layout}})()}),null,16,["bridge","index","is-root"]))],6))),256))],2))}}),FieldsList_vue_vue_type_style_index_0_scoped_50eeb93e_lang="",FieldsList=_export_sfc(_sfc_main$q,[["__scopeId","data-v-50eeb93e"]]),_hoisted_1$i={class:"bx-fields"},_sfc_main$p=vue.defineComponent({__name:"Fields",props:{fields:{}},setup(m){return(c,ne)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createVNode(FieldsList,{fields:c.fields,"is-root":""},null,8,["fields"])]))}}),_sfc_main$o=vue.defineComponent({__name:"PopupProvider",setup(m,{expose:c}){const ne=vue.ref([]);function we(li,mi,Ci){ne.value.push({id:li,render:mi,type:Ci.type,close:Ci.close,handleClickOutside:Ci.handleClickOutside,disableBackgroundEffect:Ci.disableBackgroundEffect,wrapperCustomClasses:Ci.wrapperCustomClasses})}function Pe(li){const mi=ne.value.findIndex(Ci=>Ci.id===li);mi!==-1&&ne.value.splice(mi,1)}function Me(li){return ne.value.some(mi=>mi.id===li)}const Ze=vue.computed(()=>ne.value.length>0),ie=vue.ref(["a","b","c"]);window.tPush=()=>ie.value.push("d"),window.tPull=()=>ie.value=ie.value.slice(0,-1);const ii=vue.computed(()=>ne.value.filter(li=>!li.disableBackgroundEffect));vue.watch([Ze,ii],()=>{const li=document.querySelector(GLOBAL_APP_WRAPPER_SELECTOR);!li||(Ze.value&&ii.value.length>0&&li.classList.add("bluepic-popup-app-wrapper-in-background"),Ze.value||li.classList.remove("bluepic-popup-app-wrapper-in-background"))});function di(li){li.close()}return c({isVisible:Me,push:we,pull:Pe}),(li,mi)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bluepic-popup-provider",{visible:Ze.value}])},[vue.createVNode(vue.TransitionGroup,{name:"slide-popup-element"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ne.value,(Ci,Ai)=>(vue.openBlock(),vue.createElementBlock("div",{key:Ci.id,class:vue.normalizeClass(["popup-wrapper",{["type-"+Ci.type]:!0,...Object.fromEntries(Ci.wrapperCustomClasses.map(Ti=>[Ti,!0]))}])},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ci.render),{onClickOutside:Ti=>di(Ci),onClose:Ci.close,style:vue.normalizeStyle({"--level":-(Ai-(ne.value.length-1))})},null,40,["onClickOutside","onClose","style"]))],2))),128))]),_:1})],2))}}),PopupProvider_vue_vue_type_style_index_0_scoped_bc5c5238_lang="",PopupProvider=_export_sfc(_sfc_main$o,[["__scopeId","data-v-bc5c5238"]]),_sfc_main$n=vue.defineComponent({__name:"PopoverProvider",setup(m,{expose:c}){const ne=vue.ref([]),we=vue.computed(()=>ne.value.length>0);function Pe(ii,di,li){ne.value.push({id:ii,render:di,darkenBackground:li.darkenBackground,handleClickOutside:li.handleClickOutside})}function Me(ii){console.log("pull",ii);const di=ne.value.findIndex(li=>li.id===ii);di!==-1&&ne.value.splice(di,1)}function Ze(ii){return ne.value.some(di=>di.id===ii)}vue.watch(we,()=>{});function ie(ii){ii.handleClickOutside()}return c({isVisible:Ze,push:Pe,pull:Me}),(ii,di)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bluepic-popover-provider",{visible:we.value,"darken-background":ne.value.filter(li=>li.darkenBackground).length>0}])},[vue.createVNode(vue.TransitionGroup,{name:"show-popover-element"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ne.value,(li,mi)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(li.render),{key:li.id,onClickOutside:Ci=>ie(li)},null,40,["onClickOutside"]))),128))]),_:1})],2))}}),PopoverProvider_vue_vue_type_style_index_0_scoped_c7215d57_lang="",PopoverProvider=_export_sfc(_sfc_main$n,[["__scopeId","data-v-c7215d57"]]);class BluepicPopupProvider{popupProviderRef;popoverProviderRef;constructor(){const c=document.createElement("div");c.classList.add("bluepic-popup-provider__wrapper");const ne=document.createElement("style");ne.setAttribute("type","text/css"),ne.setAttribute("data-bluepic-popup-app-wrapper","true"),ne.innerHTML=`
|
|
2512
|
+
(${ke.data.width}, ${ke.data.height})`)));const Si=!(xe instanceof HTMLImageElement||ImageBitmap&&xe instanceof ImageBitmap);let Li=!1;ke.usvg?(ke.data=new ie.r({width:ri,height:ai},new Uint8Array(vi)),ke.usvg=!1,ke.icon=void 0,Li=!0):ke.data.replace(vi,Si),this.style.updateImage(qe,ke,Li)}hasImage(qe){return qe?!!this.style&&!!this.style.getImage(qe):(this.fire(new ie.y(new Error("Missing required image id"))),!1)}removeImage(qe){this.style.removeImage(qe)}loadImage(qe,xe){ie.o(this._requestManager.transformRequest(qe,ie.R.Image),(ke,He)=>{xe(ke,He instanceof HTMLImageElement?ie.q.getImageData(He):He)})}listImages(){return this.style.listImages()}addModel(qe,xe){this._lazyInitEmptyStyle(),this.style.addModel(qe,xe)}hasModel(qe){return qe?this.style.hasModel(qe):(this.fire(new ie.y(new Error("Missing required model id"))),!1)}removeModel(qe){this.style.removeModel(qe)}listModels(){return this.style.listModels()}addLayer(qe,xe){return this._isValidId(qe.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(qe,xe),this._update(!0)):this}getSlot(qe){const xe=this.getLayer(qe);return xe&&xe.slot||null}setSlot(qe,xe){return this.style.setSlot(qe,xe),this.style.mergeLayers(),this._update(!0)}addImport(qe,xe){return this.style.addImport(qe,xe),this}updateImport(qe,xe){return typeof xe!="string"&&xe.id!==qe?(this.removeImport(qe),this.addImport(xe)):(this.style.updateImport(qe,xe),this._update(!0))}removeImport(qe){return this.style.removeImport(qe),this}moveImport(qe,xe){return this.style.moveImport(qe,xe),this._update(!0)}moveLayer(qe,xe){return this._isValidId(qe)?(this.style.moveLayer(qe,xe),this._update(!0)):this}removeLayer(qe){return this._isValidId(qe)?(this.style.removeLayer(qe),this._update(!0)):this}getLayer(qe){if(!this._isValidId(qe))return null;const xe=this.style.getOwnLayer(qe);return xe?xe.type==="custom"?xe.implementation:xe.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(qe,xe,ke){return this._isValidId(qe)?(this.style.setLayerZoomRange(qe,xe,ke),this._update(!0)):this}setFilter(qe,xe,ke={}){return this._isValidId(qe)?(this.style.setFilter(qe,xe,ke),this._update(!0)):this}getFilter(qe){return this._isValidId(qe)?this.style.getFilter(qe):null}setPaintProperty(qe,xe,ke,He={}){return this._isValidId(qe)?(this.style.setPaintProperty(qe,xe,ke,He),this._update(!0)):this}getPaintProperty(qe,xe){return this._isValidId(qe)?this.style.getPaintProperty(qe,xe):null}setLayoutProperty(qe,xe,ke,He={}){return this._isValidId(qe)?(this.style.setLayoutProperty(qe,xe,ke,He),this._update(!0)):this}getLayoutProperty(qe,xe){return this._isValidId(qe)?this.style.getLayoutProperty(qe,xe):null}getSchema(qe){return this.style.getSchema(qe)}setSchema(qe,xe){return this.style.setSchema(qe,xe),this._update(!0)}getConfig(qe){return this.style.getConfig(qe)}setConfig(qe,xe){return this.style.setConfig(qe,xe),this._update(!0)}getConfigProperty(qe,xe){return this.style.getConfigProperty(qe,xe)}setConfigProperty(qe,xe,ke){return this.style.setConfigProperty(qe,xe,ke),this._update(!0)}getFeaturesetDescriptors(qe){return this.style.getFeaturesetDescriptors(qe)}setLights(qe){if(this._lazyInitEmptyStyle(),qe&&qe.length===1&&qe[0].type==="flat"){const xe=qe[0];xe.properties?this.style.setFlatLight(xe.properties,xe.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(qe),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const qe=this.style.getLights()||[];return qe.length===0&&qe.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),qe}setLight(qe,xe={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:qe}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(qe){return this._lazyInitEmptyStyle(),!qe&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(qe),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(qe){return this._lazyInitEmptyStyle(),this.style.setFog(qe),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(qe){return this._lazyInitEmptyStyle(),this.style.setSnow(qe),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(qe){return this._lazyInitEmptyStyle(),this.style.setRain(qe),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(qe){return this._lazyInitEmptyStyle(),this.style.setColorTheme(qe),this._update(!0)}setImportColorTheme(qe,xe){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(qe,xe),this._update(!0)}setCamera(qe){return this.style.setCamera(qe),this._triggerCameraUpdate(qe)}_triggerCameraUpdate(qe){return this._update(this.transform.setOrthographicProjectionAtLowPitch(qe["camera-projection"]==="orthographic"))}getCamera(){return this.style.camera}_queryFogOpacity(qe){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(ie.bO.convert(qe),this.transform):0}setFeatureState(qe,xe){return qe.source&&!this._isValidId(qe.source)?this:(this.style.setFeatureState(qe,xe),this._update())}removeFeatureState(qe,xe){return qe.source&&!this._isValidId(qe.source)?this:(this.style.removeFeatureState(qe,xe),this._update())}getFeatureState(qe){return qe.source&&!this._isValidId(qe.source)?null:this.style.getFeatureState(qe)}_updateContainerDimensions(){if(!this._container)return;const qe=this._container.getBoundingClientRect().width||400,xe=this._container.getBoundingClientRect().height||300;let ke,He,ri,ai=this._container;for(;ai&&(!He||!ri);){const vi=window.getComputedStyle(ai).transform;vi&&vi!=="none"&&(ke=vi.match(/matrix.*\((.+)\)/)[1].split(", "),ke[0]&&ke[0]!=="0"&&ke[0]!=="1"&&(He=ke[0]),ke[3]&&ke[3]!=="0"&&ke[3]!=="1"&&(ri=ke[3])),ai=ai.parentElement}this._containerWidth=He?Math.abs(qe/He):qe,this._containerHeight=ri?Math.abs(xe/ri):xe}_detectMissingCSS(){window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&ie.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const qe=this._container;qe.classList.add("mapboxgl-map"),(this._missingCSSCanary=Ii("div","mapboxgl-canary",qe)).style.visibility="hidden",this._detectMissingCSS();const xe=this._canvasContainer=Ii("div","mapboxgl-canvas-container",qe);this._canvas=Ii("canvas","mapboxgl-canvas",xe),this._interactive&&(xe.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const ke=this._controlContainer=Ii("div","mapboxgl-control-container",qe),He=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(ri=>{He[ri]=Ii("div",`mapboxgl-ctrl-${ri}`,ke)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(qe,xe){const ke=ie.q.devicePixelRatio||1;this._canvas.width=ke*Math.ceil(qe),this._canvas.height=ke*Math.ceil(xe),this._canvas.style.width=`${qe}px`,this._canvas.style.height=`${xe}px`}_addMarker(qe){this._markers.push(qe)}_removeMarker(qe){const xe=this._markers.indexOf(qe);xe!==-1&&this._markers.splice(xe,1)}_addPopup(qe){this._popups.push(qe)}_removePopup(qe){const xe=this._popups.indexOf(qe);xe!==-1&&this._popups.splice(xe,1)}_setupPainter(){const qe=ie.l({},Ti.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),xe=this._canvas.getContext("webgl2",qe);xe?(vr(xe,!0),this.painter=new ef(xe,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",ke=>{ke.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),ie.m.testSupport(xe)):this.fire(new ie.y(new Error("Failed to initialize WebGL")))}_contextLost(qe){qe.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new ie.z("webglcontextlost",{originalEvent:qe}))}_contextRestored(qe){this._setupPainter(),this.resize(),this._update(),this.fire(new ie.z("webglcontextrestored",{originalEvent:qe}))}_onMapScroll(qe){if(qe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(qe){return this.style?(this._styleDirty=this._styleDirty||qe,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(qe){return this._update(),this._renderTaskQueue.add(qe)}_cancelRenderFrame(qe){this._renderTaskQueue.remove(qe)}_requestDomTask(qe){!this.loaded()||this.loaded()&&!this.isMoving()?qe():this._domRenderTaskQueue.add(qe)}_render(qe){let xe;this.fire(new ie.z("renderstart")),++this._frameId;const ke=this.painter.context.extTimerQuery,He=ie.q.now(),ri=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(xe=ri.createQuery(),ri.beginQuery(ke.TIME_ELAPSED_EXT,xe)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(qe),this._domRenderTaskQueue.run(qe),this._removed)return;this._updateProjectionTransition();const ai=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const Pi=this.transform.zoom,Oi=this.transform.pitch,Gi=ie.q.now(),qi=new ie.a8(Pi,{now:Gi,fadeDuration:ai,pitch:Oi,transition:this.style.transition});this.style.update(qi)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let vi=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),vi=this._updateAverageElevation(He),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):vi=this._updateAverageElevation(He);const Si=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,ai,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),Si&&(this._placementDirty=Si.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:ai,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new ie.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,li.mark(di.load),this.fire(new ie.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),xe){const Pi=ie.q.now()-He;ri.endQuery(ke.TIME_ELAPSED_EXT),setTimeout(()=>{const Oi=ri.getQueryParameter(xe,ri.QUERY_RESULT)/1e6;ri.deleteQuery(xe),this.fire(new ie.z("gpu-timing-frame",{cpuTime:Pi,gpuTime:Oi}))},50)}if(this.listens("gpu-timing-layer")){const Pi=this.painter.collectGpuTimers();setTimeout(()=>{const Oi=this.painter.queryGpuTimers(Pi);this.fire(new ie.z("gpu-timing-layer",{layerTimes:Oi}))},50)}if(this.listens("gpu-timing-deferred-render")){const Pi=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const Oi=this.painter.queryGpuTimeDeferredRender(Pi);this.fire(new ie.z("gpu-timing-deferred-render",{gpuTime:Oi}))},50)}const Li=this._sourcesDirty||this._styleDirty||this._placementDirty||vi;if(Li||this._repaint)this.triggerRepaint();else{const Pi=this.idle();if(Pi&&(vi=this._updateAverageElevation(He,!0)),vi)this.triggerRepaint();else if(this._triggerFrame(!1),Pi&&(this.fire(new ie.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const Oi=this._calculateSpeedIndex();this.fire(new ie.z("speedindexcompleted",{speedIndex:Oi})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||Li||(this._fullyLoaded=!0,li.mark(di.fullLoad),this._performanceMetricsCollection&&br(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(qe){for(const xe of this._markers)qe&&!this.getRenderWorldCopies()&&(xe._lngLat=xe._lngLat.wrap()),xe._update();for(const xe of this._popups)!qe||this.getRenderWorldCopies()||xe._trackPointer||(xe._lngLat=xe._lngLat.wrap()),xe._update()}_updateAverageElevation(qe,xe=!1){const ke=ri=>(this.transform.averageElevation=ri,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&ke(0);const He=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(He||(xe||qe-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(qe)){const ri=this.transform.averageElevation;let ai=this.transform.sampleAverageElevation();this.transform.elevation!=null&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(ai)?ai=0:this._averageElevationLastSampledAt=qe;const vi=Math.abs(ri-ai);if(vi>1){if(this._isInitialLoad||He)return this._averageElevation.jumpTo(ai),ke(ai);this._averageElevation.easeTo(ai,qe,300)}else if(vi>1e-4)return this._averageElevation.jumpTo(ai),ke(ai)}return!!this._averageElevation.isEasing(qe)&&ke(this._averageElevation.getValue(qe))}_authenticate(){Xi(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,qe=>{if(qe&&(qe.message===ze||qe.status===401)){const xe=this.painter.context.gl;vr(xe,!1),this._logoControl instanceof pa&&this._logoControl._updateLogo(),xe&&xe.clear(xe.DEPTH_BUFFER_BIT|xe.COLOR_BUFFER_BIT|xe.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new ie.y(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),fr(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&wr(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const qe=this._isDragging();this.painter.updateTerrain(this.style,qe)}_calculateSpeedIndex(){const qe=this.painter.canvasCopy(),xe=this.painter.getCanvasCopiesAndTimestamps();xe.timeStamps.push(performance.now());const ke=this.painter.context.gl,He=ke.createFramebuffer();function ri(ai){ke.framebufferTexture2D(ke.FRAMEBUFFER,ke.COLOR_ATTACHMENT0,ke.TEXTURE_2D,ai,0);const vi=new Uint8Array(ke.drawingBufferWidth*ke.drawingBufferHeight*4);return ke.readPixels(0,0,ke.drawingBufferWidth,ke.drawingBufferHeight,ke.RGBA,ke.UNSIGNED_BYTE,vi),vi}return ke.bindFramebuffer(ke.FRAMEBUFFER,He),this._canvasPixelComparison(ri(qe),xe.canvasCopies.map(ri),xe.timeStamps)}_canvasPixelComparison(qe,xe,ke){let He=ke[1]-ke[0];const ri=qe.length/4;for(let ai=0;ai<xe.length;ai++){const vi=xe[ai];let Si=0;for(let Li=0;Li<vi.length;Li+=4)vi[Li]===qe[Li]&&vi[Li+1]===qe[Li+1]&&vi[Li+2]===qe[Li+2]&&vi[Li+3]===qe[Li+3]&&(Si+=1);He+=(ke[ai+2]-ke[ai+1])*(1-Si/ri)}return He}remove(){this._hash&&this._hash.remove();for(const xe of this._controls)xe.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.indoor.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const qe=this.painter.context.gl.getExtension("WEBGL_lose_context");qe&&qe.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),xr.delete(this.painter.context.gl),er.remove(),Hi.remove(),this._removed=!0,this.fire(new ie.z("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(qe){this._renderNextFrame=this._renderNextFrame||qe,this.style&&!this._frame&&(this._frame=ie.q.frame(xe=>{const ke=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,ke&&this._render(xe)}))}_preloadTiles(qe){const xe=this.style?this.style.getSourceCaches():[];return ie.bl(xe,(ke,He)=>ke._preloadTiles(qe,He),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(qe){this._trackResize&&this.resize({originalEvent:qe})._update()}_onVisibilityChange(){document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(qe){this._showTileBoundaries!==qe&&(this._showTileBoundaries=qe,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(qe){this._showParseStatus!==qe&&(this._showParseStatus=qe,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(qe){this._showTerrainWireframe!==qe&&(this._showTerrainWireframe=qe,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(qe){this._showLayers2DWireframe!==qe&&(this._showLayers2DWireframe=qe,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(qe){this._showLayers3DWireframe!==qe&&(this._showLayers3DWireframe=qe,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(qe){this._speedIndexTiming!==qe&&(this._speedIndexTiming=qe,this._update())}get showPadding(){return!!this._showPadding}set showPadding(qe){this._showPadding!==qe&&(this._showPadding=qe,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(qe){this._showCollisionBoxes!==qe&&(this._showCollisionBoxes=qe,this._tp.refreshUI(),qe?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(qe){this._showOverdrawInspector!==qe&&(this._showOverdrawInspector=qe,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(qe){this._repaint!==qe&&(this._repaint=qe,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(qe){this._vertices=qe,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(qe){this._showTileAABBs!==qe&&(this._showTileAABBs=qe,this._tp.refreshUI(),qe&&this._update())}_setCacheLimits(qe,xe){ie.dG(qe,xe)}get version(){return ii}},NavigationControl:class{constructor(qe={}){this.options=ie.l({},Ia,qe),this._container=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",xe=>xe.preventDefault()),this.options.showZoom&&(ie.aP(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",xe=>{this._map&&this._map.zoomIn({},{originalEvent:xe})}),Ii("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",xe=>{this._map&&this._map.zoomOut({},{originalEvent:xe})}),Ii("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(ie.aP(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",xe=>{const ke=this._map;ke&&(this.options.visualizePitch?ke.resetNorthPitch({},{originalEvent:xe}):ke.resetNorth({},{originalEvent:xe}))}),this._compassIcon=Ii("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const qe=this._map;if(!qe)return;const xe=qe.getZoom(),ke=xe===qe.getMaxZoom(),He=xe===qe.getMinZoom();this._zoomInButton.disabled=ke,this._zoomOutButton.disabled=He,this._zoomInButton.setAttribute("aria-disabled",ke.toString()),this._zoomOutButton.setAttribute("aria-disabled",He.toString())}_rotateCompassArrow(){const qe=this._map;if(!qe)return;const xe=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(qe.transform.pitch*(Math.PI/180)),.5)}) rotateX(${qe.transform.pitch}deg) rotateZ(${qe.transform.angle*(180/Math.PI)}deg)`:`rotate(${qe.transform.angle*(180/Math.PI)}deg)`;qe._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=xe)})}onAdd(qe){return this._map=qe,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),qe.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&qe.on("pitch",this._rotateCompassArrow),qe.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new mu(qe,this._compass,this.options.visualizePitch)),this._container}onRemove(){const qe=this._map;qe&&(this._container.remove(),this.options.showZoom&&qe.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&qe.off("pitch",this._rotateCompassArrow),qe.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(qe,xe){const ke=Ii("button",qe,this._container);return ke.type="button",ke.addEventListener("click",xe),ke}_setButtonTitle(qe,xe){if(!this._map)return;const ke=this._map._getUIString(`NavigationControl.${xe}`);qe.setAttribute("aria-label",ke),qe.firstElementChild&&qe.firstElementChild.setAttribute("title",ke)}},GeolocateControl:class extends ie.E{constructor(qe={}){super();const xe=navigator.geolocation;this.options=ie.l({geolocation:xe},Fu,qe),ie.aP(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=od(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(qe){return this._map=qe,this._container=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(qe){const xe=(ke=!!this.options.geolocation)=>{this._supportsGeolocation=ke,qe(ke)};this._supportsGeolocation!==void 0?qe(this._supportsGeolocation):navigator.permissions!==void 0?navigator.permissions.query({name:"geolocation"}).then(ke=>xe(ke.state!=="denied")).catch(()=>xe()):xe()}_isOutOfMapMaxBounds(qe){const xe=this._map.getMaxBounds(),ke=qe.coords;return!!xe&&(ke.longitude<xe.getWest()||ke.longitude>xe.getEast()||ke.latitude<xe.getSouth()||ke.latitude>xe.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(qe){if(this._map){if(this._isOutOfMapMaxBounds(qe))return this._setErrorState(),this.fire(new ie.z("outofmaxbounds",qe)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=qe,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(qe),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(qe),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new ie.z("geolocate",qe)),this._finish()}}_updateCamera(qe){const xe=new ie.bO(qe.coords.longitude,qe.coords.latitude),ke=qe.coords.accuracy,He=this._map.getBearing(),ri=ie.l({bearing:He},this.options.fitBoundsOptions);this._map.fitBounds(xe.toBounds(ke),ri,{geolocateSource:!0})}_updateMarker(qe){if(qe){const xe=new ie.bO(qe.coords.longitude,qe.coords.latitude);this._accuracyCircleMarker.setLngLat(xe).addTo(this._map),this._userLocationDotMarker.setLngLat(xe).addTo(this._map),this._accuracy=qe.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const qe=this._map.transform,xe=ie.bH(1,qe._center.lat)*qe.worldSize,ke=Math.ceil(2*this._accuracy*xe);this._circleElement.style.width=`${ke}px`,this._circleElement.style.height=`${ke}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(qe){if(this._map){if(this.options.trackUserLocation)if(qe.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const xe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",xe),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",xe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(qe.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new ie.z("error",qe)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(qe){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",xe=>xe.preventDefault()),this._geolocateButton=Ii("button","mapboxgl-ctrl-geolocate",this._container),Ii("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",qe===!1){ie.w("Geolocation support is not available so the GeolocateControl will be disabled.");const xe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",xe),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",xe)}else{const xe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",xe),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",xe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ii("div","mapboxgl-user-location"),this._dotElement.appendChild(Ii("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(Ii("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new uf({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=Ii("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new uf({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",xe=>{xe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||xe.originalEvent&&xe.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new ie.z("trackuserlocationend")))})}}_onDeviceOrientation(qe){this._userLocationDotMarker&&(qe.webkitCompassHeading?this._heading=qe.webkitCompassHeading:qe.absolute===!0&&(this._heading=-1*qe.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return ie.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new ie.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new ie.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new ie.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let qe;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(qe={maximumAge:6e5,timeout:0},this._noTimeout=!0):(qe=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,qe),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const qe=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};typeof DeviceMotionEvent<"u"&&typeof DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(xe=>{xe==="granted"&&qe()}).catch(console.error):qe()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ou,ScaleControl:class{constructor(qe={}){this.options=ie.l({},vu,qe),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),ie.aP(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const qe=this.options.maxWidth||100,xe=this._map,ke=xe._containerHeight/2,He=xe._containerWidth/2-qe/2,ri=xe.unproject([He,ke]),ai=xe.unproject([He+qe,ke]),vi=ri.distanceTo(ai);if(this.options.unit==="imperial"){const Si=3.2808*vi;Si>5280?this._setScale(qe,Si/5280,"mile"):this._setScale(qe,Si,"foot")}else this.options.unit==="nautical"?this._setScale(qe,vi/1852,"nautical-mile"):vi>=1e3?this._setScale(qe,vi/1e3,"kilometer"):this._setScale(qe,vi,"meter")}_setScale(qe,xe,ke){this._map._requestDomTask(()=>{const He=function(ai){const vi=Math.pow(10,`${Math.floor(ai)}`.length-1);let Si=ai/vi;return Si=Si>=10?10:Si>=5?5:Si>=3?3:Si>=2?2:Si>=1?1:function(Li){const Pi=Math.pow(10,Math.ceil(-Math.log(Li)/Math.LN10));return Math.round(Li*Pi)/Pi}(Si),vi*Si}(xe),ri=He/xe;this._container.innerHTML=this._isNumberFormatSupported&&ke!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:ke}).format(He):`${He} ${As[ke]}`,this._container.style.width=qe*ri+"px"})}onAdd(qe){return this._map=qe,this._language=qe.getLanguage(),this._container=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-scale",qe.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(qe){this._language=qe,this._update()}setUnit(qe){this.options.unit=qe,this._update()}},FullscreenControl:class{constructor(qe={}){this._fullscreen=!1,qe&&qe.container&&(qe.container instanceof HTMLElement?this._container=qe.container:ie.w("Full screen control 'container' must be a DOM element.")),ie.aP(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(qe){return this._map=qe,this._container||(this._container=this._map.getContainer()),this._controlContainer=Ii("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",ie.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const qe=this._fullscreenButton=Ii("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Ii("span","mapboxgl-ctrl-icon",qe).setAttribute("aria-hidden","true"),qe.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const qe=this._getTitle();this._fullscreenButton.setAttribute("aria-label",qe),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",qe)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends ie.E{constructor(qe){super(),this.options=ie.l(Object.create(xs),qe),ie.aP(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(qe&&qe.className?qe.className.trim().split(/\s+/):[])}addTo(qe){return this._map&&this.remove(),this._map=qe,this.options.closeOnClick&&qe.on("preclick",this._onClose),this.options.closeOnMove&&qe.on("move",this._onClose),qe.on("remove",this.remove),this._update(),qe._addPopup(this),this._focusFirstElement(),this._trackPointer?(qe.on("mousemove",this._onMouseEvent),qe.on("mouseup",this._onMouseEvent),qe._canvasContainer.classList.add("mapboxgl-track-pointer")):qe.on("move",this._update),this.fire(new ie.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const qe=this._map;return qe&&(qe.off("move",this._update),qe.off("move",this._onClose),qe.off("preclick",this._onClose),qe.off("click",this._onClose),qe.off("remove",this.remove),qe.off("mousemove",this._onMouseEvent),qe.off("mouseup",this._onMouseEvent),qe.off("drag",this._onMouseEvent),qe._canvasContainer&&qe._canvasContainer.classList.remove("mapboxgl-track-pointer"),qe._removePopup(this),this._map=void 0),this.fire(new ie.z("close")),this}getLngLat(){return this._lngLat}setLngLat(qe){this._lngLat=ie.bO.convert(qe),this._pos=null,this._trackPointer=!1,this._update();const xe=this._map;return xe&&(xe.on("move",this._update),xe.off("mousemove",this._onMouseEvent),xe._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const qe=this._map;return qe&&(qe.off("move",this._update),qe.on("mousemove",this._onMouseEvent),qe.on("drag",this._onMouseEvent),qe._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(qe){return this.setDOMContent(document.createTextNode(qe))}setHTML(qe){const xe=document.createDocumentFragment(),ke=document.createElement("body");let He;for(ke.innerHTML=qe;He=ke.firstChild,He;)xe.appendChild(He);return this.setDOMContent(xe)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(qe){return this.options.maxWidth=qe,this._update(),this}setDOMContent(qe){let xe=this._content;if(xe)for(;xe.hasChildNodes();)xe.firstChild&&xe.removeChild(xe.firstChild);else xe=this._content=Ii("div","mapboxgl-popup-content",this._container||void 0);if(xe.appendChild(qe),this.options.closeButton){const ke=this._closeButton=Ii("button","mapboxgl-popup-close-button",xe);ke.type="button",ke.setAttribute("aria-label","Close popup"),ke.setAttribute("aria-hidden","true"),ke.innerHTML="×",ke.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(qe){return this._classList.add(qe),this._updateClassList(),this}removeClassName(qe){return this._classList.delete(qe),this._updateClassList(),this}setOffset(qe){return this.options.offset=qe,this._update(),this}toggleClassName(qe){let xe;return this._classList.delete(qe)?xe=!1:(this._classList.add(qe),xe=!0),this._updateClassList(),xe}_onMouseEvent(qe){this._update(qe.point)}_getAnchor(qe){if(this.options.anchor)return this.options.anchor;const xe=this._map,ke=this._container,He=this._pos;if(!xe||!ke||!He)return"bottom";const ri=ke.offsetWidth,ai=ke.offsetHeight,vi=He.x<ri/2,Si=He.x>xe.transform.width-ri/2;if(He.y+qe<ai)return vi?"top-left":Si?"top-right":"top";if(He.y>xe.transform.height-ai){if(vi)return"bottom-left";if(Si)return"bottom-right"}return vi?"left":Si?"right":"bottom"}_updateClassList(){const qe=this._container;if(!qe)return;const xe=[...this._classList];xe.push("mapboxgl-popup"),this._anchor&&xe.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&xe.push("mapboxgl-popup-track-pointer"),qe.className=xe.join(" ")}_update(qe){const xe=this._map,ke=this._content;if(!xe||!this._lngLat&&!this._trackPointer||!ke)return;let He=this._container;if(He||(He=this._container=Ii("div","mapboxgl-popup",xe.getContainer()),this._tip=Ii("div","mapboxgl-popup-tip",He),He.appendChild(ke)),this.options.maxWidth&&He.style.maxWidth!==this.options.maxWidth&&(He.style.maxWidth=this.options.maxWidth),xe.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=i0(this._lngLat,this._pos,xe.transform)),!this._trackPointer||qe){const ri=this._pos=this._trackPointer&&qe instanceof ie.P?qe:xe.project(this._lngLat),ai=em(this.options.offset),vi=this._anchor=this._getAnchor(ai.y),Si=em(this.options.offset,vi),Li=ri.add(Si).round();xe._requestDomTask(()=>{this._container&&vi&&(this._container.style.transform=`${up[vi]} translate(${Li.x}px,${Li.y}px)`)})}if(!this._marker&&xe._showingGlobe()){const ri=ie.dH(xe.transform,this._lngLat)?0:1;this._setOpacity(ri)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const qe=this._container.querySelector(Fs);qe&&qe.focus()}_onClose(){this.remove()}_setOpacity(qe){this._container&&(this._container.style.opacity=`${qe}`),this._content&&(this._content.style.pointerEvents=qe?"auto":"none")}},Marker:uf,Style:za,LngLat:ie.bO,LngLatBounds:ie.az,Point:ie.P,MercatorCoordinate:ie.aa,FreeCameraOptions:Oh,Evented:ie.E,config:ie.e,prewarm:ie.dM,clearPrewarmedResources:ie.dN,get accessToken(){return ie.e.ACCESS_TOKEN},set accessToken(qe){ie.e.ACCESS_TOKEN=qe},get baseApiUrl(){return ie.e.API_URL},set baseApiUrl(qe){ie.e.API_URL=qe},get workerCount(){return ie.dO.workerCount},set workerCount(qe){ie.dO.workerCount=qe},get maxParallelImageRequests(){return ie.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(qe){ie.e.MAX_PARALLEL_IMAGE_REQUESTS=qe},clearStorage(qe){ie.dP(qe)},get workerUrl(){return ie.dQ.workerUrl},set workerUrl(qe){ie.dQ.workerUrl=qe},get workerClass(){return ie.dQ.workerClass},set workerClass(qe){ie.dQ.workerClass=qe},get workerParams(){return ie.dQ.workerParams},set workerParams(qe){ie.dQ.workerParams=qe},get dracoUrl(){return ie.dR()},set dracoUrl(qe){ie.dS(qe)},get meshoptUrl(){return ie.dT()},set meshoptUrl(qe){ie.dU(qe)},setNow:ie.q.setNow,restoreNow:ie.q.restoreNow}});var Ze=Pe;return Ze})})(mapboxGl);const mapboxgl=getDefaultExportFromCjs$1(mapboxGl.exports);function debounce(m,c){let ne=null;const we=this;return()=>{clearTimeout(ne);var Pe=arguments;ne=setTimeout(()=>{m.apply(we,Pe)},c)}}const _hoisted_1$r={class:"map"},_sfc_main$A=vue.defineComponent({__name:"MapboxMap",props:{bounds:{},padding:{},mapboxAccessToken:{},mapboxStyle:{},projection:{},bearing:{},pitch:{},synchronousPrecision:{},ratio:{}},emits:["update:bounds"],setup(m,{emit:c}){const ne=m,we=c;function Pe(Ti){return{left:Ti[0],top:Ti[1],right:Ti[2],bottom:Ti[3]}}const Me=vue.ref(),{width:Ze,height:ie}=useElementBounding(Me);let ii;const di=()=>{ii?.fitBounds(ne.bounds,{padding:Pe(ne.padding),pitch:ne.pitch,bearing:ne.bearing})},li=()=>{if(Ci.value&&ii){const{x:Ti,y:Ii,width:Di,height:Zi}=Ci.value,Fi=ii.unproject([Ti+Di,Ii]),Ui=ii.unproject([Ti,Ii+Zi]);Ai.value=[Ui.lng,Ui.lat,Fi.lng,Fi.lat].map(Wi=>Number(Wi.toFixed(ne.synchronousPrecision)))}};vue.onMounted(()=>{ii=new mapboxgl.Map({container:Me.value,style:ne.mapboxStyle,bounds:ne.bounds,accessToken:ne.mapboxAccessToken,projection:ne.projection,bearing:ne.bearing,pitch:ne.pitch}),ii.on("render",li),ii.on("load",()=>{di()})}),vue.watch(()=>ne.mapboxStyle,()=>{ii?.setStyle(ne.mapboxStyle)}),vue.watch(()=>ne.projection,()=>{ii?.setProjection(ne.projection)}),vue.watch(()=>ne.bearing,()=>{ii?.setBearing(ne.bearing)}),vue.watch(()=>ne.pitch,()=>{ii?.setPitch(ne.pitch)}),vue.watch([()=>ne.bounds,()=>ne.padding],di);const mi=vue.computed(()=>Ze.value&&ie.value?Ze.value/ie.value:1),Ci=vue.computed(()=>{const Ti=Ze.value-ne.padding[0]-ne.padding[2],Ii=ie.value-ne.padding[1]-ne.padding[3];if(mi.value>=ne.ratio){const Di=Ii*ne.ratio;return{x:ne.padding[0]+(Ti-Di)/2,y:ne.padding[1]+0,width:Di,height:Ii}}else{const Di=Ti/ne.ratio;return{x:ne.padding[0]+0,y:ne.padding[1]+(Ii-Di)/2,width:Ti,height:Di}}}),Ai=vue.ref();return vue.watch(Ai,debounce(()=>{!isEqual(Ai.value,ne.bounds)&&Ai.value&&we("update:bounds",Ai.value)},100)),(Ti,Ii)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$r,[vue.createElementVNode("div",{ref_key:"mapboxMapRef",ref:Me,class:"mapbox-map"},null,512),Ci.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layer",style:vue.normalizeStyle({"--x":`${Ci.value.x}px`,"--y":`${Ci.value.y}px`,"--width":`${Ci.value.width}px`,"--height":`${Ci.value.height}px`})},[vue.renderSlot(Ti.$slots,"layer",{bounds:Ai.value,bbox:Ci.value,map:vue.unref(ii)},void 0,!0)],4)):vue.createCommentVNode("",!0)]))}}),MapboxMap_vue_vue_type_style_index_0_scoped_8f6ef37a_lang="",MapboxMap=_export_sfc(_sfc_main$A,[["__scopeId","data-v-8f6ef37a"]]),_hoisted_1$q={class:"preview-image"},_hoisted_2$i=["src"],_hoisted_3$b={class:"map-wrapper"},_sfc_main$z=vue.defineComponent({__name:"Map",props:{modelValue:{},padding:{default:0},mapStyle:{default:"mapbox://styles/mapbox/streets-v11"},mapboxAccessToken:{},type:{default:"popup"},aspectRatio:{}},emits:["update:model-value"],setup(m,{emit:c}){const ne=m,we=c,Pe=vue.ref(),{width:Me}=useElementBounding(Pe),Ze=vue.ref(!1);vue.watch(Ze,()=>{Ze.value||(ie.value=ii.value,we("update:model-value",ie.value))});const ie=vue.ref(ne.modelValue),ii=vue.ref(ne.modelValue),di=debounce(Ci=>{ii.value=Ci,ne.type==="inline"&&we("update:model-value",ii.value)},500);function li(){const Ci=ne.mapStyle?.replace("mapbox://styles/",""),Ai=Math.round(Me.value??200);return`https://api.mapbox.com/styles/v1/${Ci}/static/[${ie.value.join(",")}]/${Ai}x${Math.round(Ai/ne.aspectRatio)}@2x?access_token=${ne.mapboxAccessToken}`}const mi=vue.ref(li());return vue.watch(ie,debounce(()=>{mi.value=li()},500)),(Ci,Ai)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"mapFieldRef",ref:Pe,class:vue.normalizeClass(["field-map",{["type-"+Ci.type]:!0}]),style:vue.normalizeStyle({"--aspect-ratio":Ci.aspectRatio})},[Ci.type==="inline"?(vue.openBlock(),vue.createBlock(MapboxMap,{key:0,bounds:Ci.modelValue,"onUpdate:bounds":vue.unref(di),bearing:0,pitch:0,"mapbox-access-token":Ci.mapboxAccessToken,"mapbox-style":Ci.mapStyle,padding:[Ci.padding,Ci.padding,Ci.padding,Ci.padding],projection:{name:"globe"},ratio:Ci.aspectRatio,"synchronous-precision":8},{layer:vue.withCtx(({bounds:Ti,map:Ii,bbox:Di})=>[Ti&&Ii?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layer-wrapper",style:vue.normalizeStyle({"--x":`${Ii.project([Ti[0],Ti[1]]).x}px`,"--y":`${Ii.project([Ti[2],Ti[3]]).y}px`,"--width":`${Ii.project([Ti[2],Ti[3]]).x-Ii.project([Ti[0],Ti[1]]).x}px`,"--height":`${Ii.project([Ti[0],Ti[1]]).y-Ii.project([Ti[2],Ti[3]]).y}px`})},Ai[1]||(Ai[1]=[vue.createElementVNode("div",{class:"overlay"},null,-1),vue.createElementVNode("div",{class:"viewport-border"},null,-1)]),4)):vue.createCommentVNode("",!0)]),_:1},8,["bounds","onUpdate:bounds","mapbox-access-token","mapbox-style","padding","ratio"])):(vue.openBlock(),vue.createBlock(_sfc_main$17,{key:1,type:"layer",transculent:"",show:Ze.value,"onUpdate:show":Ai[0]||(Ai[0]=Ti=>Ze.value=Ti)},{trigger:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$q,[vue.createElementVNode("img",{src:mi.value},null,8,_hoisted_2$i)])]),"close-btn":vue.withCtx(()=>[vue.createVNode(BxButton,{round:"",tertiary:"",class:"close-btn"},{default:vue.withCtx(()=>Ai[2]||(Ai[2]=[vue.createTextVNode(" Done ")])),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$b,[vue.createVNode(MapboxMap,{bounds:Ci.modelValue,"onUpdate:bounds":vue.unref(di),bearing:0,pitch:0,"mapbox-access-token":Ci.mapboxAccessToken,"mapbox-style":Ci.mapStyle,padding:[Ci.padding,Ci.padding,Ci.padding,Ci.padding],projection:{name:"globe"},ratio:Ci.aspectRatio,"synchronous-precision":8},{layer:vue.withCtx(({bounds:Ti,map:Ii,bbox:Di})=>[Ti&&Ii?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"layer-wrapper",style:vue.normalizeStyle({"--x":`${Ii.project([Ti[0],Ti[1]]).x}px`,"--y":`${Ii.project([Ti[2],Ti[3]]).y}px`,"--width":`${Ii.project([Ti[2],Ti[3]]).x-Ii.project([Ti[0],Ti[1]]).x}px`,"--height":`${Ii.project([Ti[0],Ti[1]]).y-Ii.project([Ti[2],Ti[3]]).y}px`})},Ai[3]||(Ai[3]=[vue.createElementVNode("div",{class:"overlay"},null,-1),vue.createElementVNode("div",{class:"viewport-border"},null,-1),vue.createElementVNode("div",{class:"marker"},[vue.createElementVNode("svg",{version:"1.0",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 64 64","enable-background":"new 0 0 64 64","xml:space":"preserve"},[vue.createElementVNode("path",{d:"M32,0C18.746,0,8,10.746,8,24c0,5.219,1.711,10.008,4.555,13.93c0.051,0.094,0.059,0.199,0.117,0.289l16,24 C29.414,63.332,30.664,64,32,64s2.586-0.668,3.328-1.781l16-24c0.059-0.09,0.066-0.195,0.117-0.289C54.289,34.008,56,29.219,56,24 C56,10.746,45.254,0,32,0z M32,32c-4.418,0-8-3.582-8-8s3.582-8,8-8s8,3.582,8,8S36.418,32,32,32z"})])],-1)]),4)):vue.createCommentVNode("",!0)]),_:1},8,["bounds","onUpdate:bounds","mapbox-access-token","mapbox-style","padding","ratio"])])]),_:1},8,["show"]))],6))}}),Map_vue_vue_type_style_index_0_scoped_2e4a6276_lamng_scss_lang="",Map_vue_vue_type_style_index_1_lang="",Map$1=_export_sfc(_sfc_main$z,[["__scopeId","data-v-2e4a6276"]]),_hoisted_1$p={class:"field-color"},_sfc_main$y=vue.defineComponent({__name:"Color",props:vue.mergeModels({alpha:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue");return(ne,we)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$p,[vue.withDirectives(vue.createElementVNode("input",{type:"color","onUpdate:modelValue":we[0]||(we[0]=Pe=>c.value=Pe)},null,512),[[vue.vModelText,c.value]])]))}}),Color_vue_vue_type_style_index_0_scoped_14e2dc54_lang="",Color$1=_export_sfc(_sfc_main$y,[["__scopeId","data-v-14e2dc54"]]);function e$1(m,c,ne=1e3,we){let Pe,Me=0;const Ze=()=>{Pe&&clearTimeout(Pe)};return vue.watch(m,async(ie,ii)=>{we&&we(ie,ii);const di=()=>(Ze(),Me=Date.now(),c(ie,ii)),li=Date.now()-Me;li>=ne?di():(Ze(),Pe=setTimeout(di,ne-li))})}const _sfc_main$x=vue.defineComponent({__name:"BxSlider",props:vue.mergeModels({min:{},max:{},step:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.inject("darkmode"),ne=vue.useModel(m,"modelValue"),we=m,Pe=vue.ref(),{left:Me,width:Ze}=useElementBounding(Pe),ie=vue.computed(()=>isNaN(ne.value)?we.min:Math.min(we.max,Math.max(we.min,ne.value))),ii=vue.computed(()=>we.max-we.min),di=vue.computed(()=>(ie.value-we.min)/ii.value),li=vue.ref();function mi(Ii){if(Ii.preventDefault(),Ii.target?.closest(".slider-thumb"))Ii.type==="mousedown"?li.value={x:Ii.clientX,value:ie.value}:li.value={x:Ii.touches[0].clientX,value:ie.value};else{const Di=Ii.type==="mousedown"?Ii.clientX:Ii.touches[0].clientX,Ui=(Di-Me.value)/Ze.value*ii.value,Wi=we.min+Ui;ne.value=Math.min(we.max,Math.max(we.min,Wi-Wi%we.step)),li.value={x:Di,value:Wi}}}const Ci=vue.ref({x:0,y:0});e$1(()=>Ci.value,()=>{if(!li.value)return;const Zi=(li.value.x-Ci.value.x)/Ze.value*ii.value,Fi=li.value.value-Zi;ne.value=Math.min(we.max,Math.max(we.min,Fi-Fi%we.step))},16,()=>{});function Ai(Ii){!li.value||(Ii.preventDefault(),Ii.type==="mousemove"?Ci.value={x:Ii.clientX,y:Ii.clientY}:Ci.value={x:Ii.touches[0].clientX,y:Ii.touches[0].clientY})}function Ti(Ii){li.value&&Ii.preventDefault(),li.value=void 0}return window.addEventListener("mousemove",Ai),window.addEventListener("mouseup",Ti),window.addEventListener("touchmove",Ai),window.addEventListener("touchend",Ti),vue.onUnmounted(()=>{window.removeEventListener("mousemove",Ai),window.removeEventListener("mouseup",Ti),window.removeEventListener("touchmove",Ai),window.removeEventListener("touchend",Ti)}),(Ii,Di)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bx-slider swiper-no-swiping",{darkmode:vue.unref(c)}]),style:vue.normalizeStyle({"--value-relative":di.value}),onMousedown:mi,onTouchstart:mi},[vue.createElementVNode("div",{class:"slider-body",ref_key:"sliderBodyRef",ref:Pe},Di[0]||(Di[0]=[vue.createElementVNode("div",{class:"slider-value"},null,-1)]),512),Di[1]||(Di[1]=vue.createElementVNode("div",{class:"slider-thumb"},null,-1))],38))}}),BxSlider_vue_vue_type_style_index_0_scoped_27197875_lang="",BxSlider=_export_sfc(_sfc_main$x,[["__scopeId","data-v-27197875"]]),_hoisted_1$o={class:"field-number"},_hoisted_2$h=["min","max","step"],_sfc_main$w=vue.defineComponent({__name:"Number",props:vue.mergeModels({min:{},max:{},step:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=vue.computed({get(){return Number(c.value)},set(we){c.value=Number(we)}});return(we,Pe)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$o,[we.type==="slider"?(vue.openBlock(),vue.createBlock(BxSlider,{key:0,type:"range",modelValue:ne.value,"onUpdate:modelValue":Pe[0]||(Pe[0]=Me=>ne.value=Me),min:we.min,max:we.max,step:we.step},null,8,["modelValue","min","max","step"])):vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{key:1,type:"number","onUpdate:modelValue":Pe[1]||(Pe[1]=Me=>ne.value=Me),min:we.min,max:we.max,step:we.step},null,8,_hoisted_2$h)),[[vue.vModelText,ne.value]])]))}}),Number_vue_vue_type_style_index_0_scoped_7b17f563_lang="",Number$1=_export_sfc(_sfc_main$w,[["__scopeId","data-v-7b17f563"]]),_hoisted_1$n={key:0,class:"select-dropdown-wrapper"},_hoisted_2$g=["onClick"],_hoisted_3$a={class:"preview-wrapper"},_hoisted_4$6={key:0,class:"label-wrapper"},_sfc_main$v=vue.defineComponent({__name:"SelectItem",props:vue.mergeModels({options:{},layout:{},size:{},showLabels:{type:Boolean},mobile:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=m;vue.useSlots();const we=vue.computed(()=>ne.options.map(Pe=>({label:Pe.label,value:Pe.value,icon:Pe.image?()=>vue.h("img",{src:Pe.image,style:{"object-fit":"cover",width:"19px",height:"19px"}}):void 0})));return(Pe,Me)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-item-wrapper",{[`size-${Pe.size}`]:!0,["swiper-no-swiping"]:Pe.mobile&&Pe.layout==="carroussel"}])},[Pe.layout==="dropdown"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$n,[vue.createVNode(BxSelect,{modelValue:c.value,"onUpdate:modelValue":Me[0]||(Me[0]=Ze=>c.value=Ze),options:we.value,"placeholder-active-label":"Select option"},null,8,["modelValue","options"])])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["select-buttons-wrapper",{carroussel:Pe.layout==="carroussel"}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Pe.options,Ze=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-option-button",{selected:Ze.value===c.value}]),onClick:ie=>c.value=Ze.value},[vue.createElementVNode("div",_hoisted_3$a,[vue.renderSlot(Pe.$slots,"preview",{option:Ze,selected:c.value===Ze.value},void 0,!0)]),Ze.label?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$6,vue.toDisplayString(Ze.label),1)):vue.createCommentVNode("",!0)],10,_hoisted_2$g))),256))],2))],2))}}),SelectItem_vue_vue_type_style_index_0_scoped_0aeb4f24_lang="",SelectItem=_export_sfc(_sfc_main$v,[["__scopeId","data-v-0aeb4f24"]]),_hoisted_1$m={class:"select-text-field"},_sfc_main$u=vue.defineComponent({__name:"SelectText",props:vue.mergeModels({options:{},layout:{},imageDisplay:{},showLabels:{type:Boolean},size:{},mobile:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=m,we=vue.computed(()=>ne.layout==="button"&&ne.mobile?"carroussel":ne.layout);return(Pe,Me)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$m,[vue.createVNode(SelectItem,{modelValue:c.value,"onUpdate:modelValue":Me[0]||(Me[0]=Ze=>c.value=Ze),options:Pe.options,layout:we.value,"image-display":Pe.imageDisplay,"show-labels":Pe.showLabels,size:Pe.size,mobile:Pe.mobile},null,8,["modelValue","options","layout","image-display","show-labels","size","mobile"])]))}}),SelectText_vue_vue_type_style_index_0_scoped_cb108a08_lang="",SelectText=_export_sfc(_sfc_main$u,[["__scopeId","data-v-cb108a08"]]),_sfc_main$t=vue.defineComponent({__name:"SelectColor",props:vue.mergeModels({options:{},layout:{},imageDisplay:{},showLabels:{type:Boolean},size:{},mobile:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=vue.useModel(m,"modelValue"),ne=useDarkmode(),we=m,Pe=vue.computed(()=>we.layout==="button"&&we.mobile?"carroussel":we.layout),Me=vue.computed(()=>we.layout==="dropdown"?we.options.map(Ze=>({label:Ze.label||Ze.value,value:Ze.value,image:`data:image/svg+xml;base64,${window.btoa(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50%" cy="50%" r="50%" style="fill: ${Ze.image};" /></svg>`)}`})):we.options);return(Ze,ie)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-color-field",{darkmode:vue.unref(ne)}])},[vue.createVNode(SelectItem,{modelValue:c.value,"onUpdate:modelValue":ie[0]||(ie[0]=ii=>c.value=ii),options:Me.value,layout:Pe.value,"image-display":Ze.imageDisplay,"show-labels":Ze.showLabels,size:Ze.size,mobile:Ze.mobile},{preview:vue.withCtx(({option:ii,selected:di})=>[vue.createElementVNode("div",{class:vue.normalizeClass(["preview-color",{selected:di}]),style:vue.normalizeStyle({"--color":ii.image||ii.value})},null,6)]),_:1},8,["modelValue","options","layout","image-display","show-labels","size","mobile"])],2))}}),SelectColor_vue_vue_type_style_index_0_scoped_eb8315a9_lang="",SelectColor=_export_sfc(_sfc_main$t,[["__scopeId","data-v-eb8315a9"]]),_hoisted_1$l=["src"],_sfc_main$s=vue.defineComponent({__name:"SelectImage",props:vue.mergeModels({options:{},layout:{},imageDisplay:{},showLabels:{type:Boolean},size:{},mobile:{type:Boolean,default:!1}},{modelValue:{required:!0,default:()=>({src:"https://picsum.photos/536/354",scale:1,innerPos:[0,0],innerRotate:0})},modelModifiers:{}}),emits:["update:modelValue"],setup(m){const c=useDarkmode(),ne=vue.useModel(m,"modelValue"),we=m,Pe=vue.computed(()=>we.layout==="button"&&we.mobile?"carroussel":we.layout),Me=vue.computed({get(){return typeof ne.value=="string"?ne.value:ne.value.src},set(Ze){typeof ne.value=="string"?ne.value=Ze:ne.value={...ne.value,src:Ze}}});return(Ze,ie)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["select-image-field",{mobile:Ze.mobile,darkmode:vue.unref(c)}])},[vue.createVNode(SelectItem,{modelValue:Me.value,"onUpdate:modelValue":ie[0]||(ie[0]=ii=>Me.value=ii),options:Ze.options,layout:Pe.value,"image-display":Ze.imageDisplay,"show-labels":Ze.showLabels,size:Ze.size,mobile:Ze.mobile},{preview:vue.withCtx(({option:ii,selected:di})=>[vue.createElementVNode("img",{class:vue.normalizeClass(["preview-image",{[`image-display-${Ze.imageDisplay}`]:!0,selected:di}]),src:ii.image},null,10,_hoisted_1$l)]),_:1},8,["modelValue","options","layout","image-display","show-labels","size","mobile"])],2))}}),SelectImage_vue_vue_type_style_index_0_scoped_d55f1edb_lang="",SelectImage=_export_sfc(_sfc_main$s,[["__scopeId","data-v-d55f1edb"]]),style$1="",_hoisted_1$k={key:0,class:"info-symbol-wrapper"},_hoisted_2$f={class:"instruction-text"},_hoisted_3$9={class:"detailed-description-text"},_sfc_main$r=vue.defineComponent({__name:"Instruction",props:{instruction:{},description:{},detailedDescription:{}},setup(m){const c=useDarkmode();return(ne,we)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["instruction-field",{darkmode:vue.unref(c)}])},[ne.description===void 0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[vue.createVNode(BxIcon,null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(InformationCircleOutline))]),_:1})])):vue.createCommentVNode("",!0),vue.createElementVNode("main",null,[vue.createElementVNode("div",_hoisted_2$f,vue.toDisplayString(ne.instruction),1),vue.createElementVNode("div",_hoisted_3$9,vue.toDisplayString(ne.detailedDescription),1)])],2))}}),Instruction_vue_vue_type_style_index_0_scoped_d63c188c_lang="",Instruction=_export_sfc(_sfc_main$r,[["__scopeId","data-v-d63c188c"]]),BluepciFieldComponents=Object.freeze(Object.defineProperty({__proto__:null,ImageEdit,Image:Image$1,Group,Text,ImageAdjust,Select,Checkbox,Collection,Map:Map$1,Color:Color$1,Number:Number$1,SelectText,SelectColor,SelectImage,Instruction},Symbol.toStringTag,{value:"Module"})),_hoisted_1$j={class:"inner"},_hoisted_2$e={key:1},_sfc_main$q=vue.defineComponent({__name:"FieldsList",props:{layout:{default:"list"},fields:{},isRoot:{type:Boolean}},setup(m){const c=vue.inject("darkmode"),ne=m,we=vue.inject("bridge"),Pe=vue.inject("data"),Me=vue.inject("computedPropEvaluator");Me||console.error("computedPropEvaluator is not provided");const Ze=di=>{if("pos"in di&&"scale"in di){const mi=di.image,Ci=di.pos,Ai=di.scale;return{image:Pe.value[mi],"onUpdate:image":Ii=>{Pe.value[mi]=Ii},adjust:{scale:Pe.value[Ai],innerPos:Pe.value[Ci]},"onUpdate:adjust":Ii=>{Pe.value[Ai]=Ii.scale,Pe.value[Ci]=Ii.innerPos}}}return{...Object.fromEntries(Object.entries(di).map(([mi,Ci])=>[mi,Pe.value[Ci]])),...Object.fromEntries(Object.entries(di).map(([mi])=>[`onUpdate:${mi}`,Ci=>{Pe.value[di[mi]]=Ci}]))}};function ie(di){return Object.fromEntries(Object.entries(di).map(([li,mi])=>typeof mi=="function"?[li,Me(mi)]:[li,mi]))}const ii=di=>{const li=ne.fields.indexOf(di),mi=ne.fields.slice(0,li).filter(Ci=>Ci.type==="Instruction");return li-mi.length+1};return(di,li)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bluepic-fields",{["layout-"+di.layout]:!0,darkmode:vue.unref(c)}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(di.fields,(mi,Ci)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["field",{"is-root":di.isRoot,["field-type-"+mi.type.toLowerCase()]:!0,"field-has-card":mi.type==="Group"&&mi.props.card}]),style:vue.normalizeStyle({"--min-width":mi.layout?.minWidth,"--max-width":mi.layout?.maxWidth})},[mi.type!=="Group"&&mi.description?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["description",{"no-detailed-description":!mi.detailedDescription,"text-overlaying-description":!di.isRoot&&mi.type==="Text"}])},[vue.createElementVNode("div",_hoisted_1$j,[di.isRoot?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["root-index",{}])},[mi.type==="Instruction"?(vue.openBlock(),vue.createBlock(BxIcon,{key:0},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(InformationOutline))]),_:1})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$e,vue.toDisplayString(ii(mi)),1))])):vue.createCommentVNode("",!0),vue.createElementVNode("span",null,vue.toDisplayString(mi.description),1),mi.detailedDescription&&mi.type!=="Instruction"?(vue.openBlock(),vue.createBlock(BxTooltip,{key:1,trigger:"hover",darkmode:vue.unref(c)},{trigger:vue.withCtx(()=>[vue.createVNode(BxIcon,null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(HelpOutline))]),_:1})]),content:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(mi.detailedDescription),1)]),_:2},1032,["darkmode"])):vue.createCommentVNode("",!0)])],2)):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(BluepciFieldComponents[mi.type]),vue.mergeProps({bridge:vue.unref(we),index:Ci,"is-root":di.isRoot,ref_for:!0},{...ie(mi.props),...Ze(mi.model),field:mi,description:mi.description,detailedDescription:mi.detailedDescription,...(()=>{if(mi.type==="Text")return{...mi.layout}})()}),null,16,["bridge","index","is-root"]))],6))),256))],2))}}),FieldsList_vue_vue_type_style_index_0_scoped_d180b0a4_lang="",FieldsList=_export_sfc(_sfc_main$q,[["__scopeId","data-v-d180b0a4"]]),_hoisted_1$i={class:"bx-fields"},_sfc_main$p=vue.defineComponent({__name:"Fields",props:{fields:{}},setup(m){return(c,ne)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createVNode(FieldsList,{fields:c.fields,"is-root":""},null,8,["fields"])]))}}),_sfc_main$o=vue.defineComponent({__name:"PopupProvider",setup(m,{expose:c}){const ne=vue.ref([]);function we(li,mi,Ci){ne.value.push({id:li,render:mi,type:Ci.type,close:Ci.close,handleClickOutside:Ci.handleClickOutside,disableBackgroundEffect:Ci.disableBackgroundEffect,wrapperCustomClasses:Ci.wrapperCustomClasses})}function Pe(li){const mi=ne.value.findIndex(Ci=>Ci.id===li);mi!==-1&&ne.value.splice(mi,1)}function Me(li){return ne.value.some(mi=>mi.id===li)}const Ze=vue.computed(()=>ne.value.length>0),ie=vue.ref(["a","b","c"]);window.tPush=()=>ie.value.push("d"),window.tPull=()=>ie.value=ie.value.slice(0,-1);const ii=vue.computed(()=>ne.value.filter(li=>!li.disableBackgroundEffect));vue.watch([Ze,ii],()=>{const li=document.querySelector(GLOBAL_APP_WRAPPER_SELECTOR);!li||(Ze.value&&ii.value.length>0&&li.classList.add("bluepic-popup-app-wrapper-in-background"),Ze.value||li.classList.remove("bluepic-popup-app-wrapper-in-background"))});function di(li){li.close()}return c({isVisible:Me,push:we,pull:Pe}),(li,mi)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bluepic-popup-provider",{visible:Ze.value}])},[vue.createVNode(vue.TransitionGroup,{name:"slide-popup-element"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ne.value,(Ci,Ai)=>(vue.openBlock(),vue.createElementBlock("div",{key:Ci.id,class:vue.normalizeClass(["popup-wrapper",{["type-"+Ci.type]:!0,...Object.fromEntries(Ci.wrapperCustomClasses.map(Ti=>[Ti,!0]))}])},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ci.render),{onClickOutside:Ti=>di(Ci),onClose:Ci.close,style:vue.normalizeStyle({"--level":-(Ai-(ne.value.length-1))})},null,40,["onClickOutside","onClose","style"]))],2))),128))]),_:1})],2))}}),PopupProvider_vue_vue_type_style_index_0_scoped_bc5c5238_lang="",PopupProvider=_export_sfc(_sfc_main$o,[["__scopeId","data-v-bc5c5238"]]),_sfc_main$n=vue.defineComponent({__name:"PopoverProvider",setup(m,{expose:c}){const ne=vue.ref([]),we=vue.computed(()=>ne.value.length>0);function Pe(ii,di,li){ne.value.push({id:ii,render:di,darkenBackground:li.darkenBackground,handleClickOutside:li.handleClickOutside})}function Me(ii){console.log("pull",ii);const di=ne.value.findIndex(li=>li.id===ii);di!==-1&&ne.value.splice(di,1)}function Ze(ii){return ne.value.some(di=>di.id===ii)}vue.watch(we,()=>{});function ie(ii){ii.handleClickOutside()}return c({isVisible:Ze,push:Pe,pull:Me}),(ii,di)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["bluepic-popover-provider",{visible:we.value,"darken-background":ne.value.filter(li=>li.darkenBackground).length>0}])},[vue.createVNode(vue.TransitionGroup,{name:"show-popover-element"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ne.value,(li,mi)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(li.render),{key:li.id,onClickOutside:Ci=>ie(li)},null,40,["onClickOutside"]))),128))]),_:1})],2))}}),PopoverProvider_vue_vue_type_style_index_0_scoped_c7215d57_lang="",PopoverProvider=_export_sfc(_sfc_main$n,[["__scopeId","data-v-c7215d57"]]);class BluepicPopupProvider{popupProviderRef;popoverProviderRef;constructor(){const c=document.createElement("div");c.classList.add("bluepic-popup-provider__wrapper");const ne=document.createElement("style");ne.setAttribute("type","text/css"),ne.setAttribute("data-bluepic-popup-app-wrapper","true"),ne.innerHTML=`
|
|
2513
2513
|
.bluepic-popup-body {
|
|
2514
2514
|
|
|
2515
2515
|
}
|