@phila/phila-ui-map-core 1.1.0-beta.23 → 1.1.0-beta.25

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.
@@ -1,7 +1,7 @@
1
- "use strict";const vue=require("vue"),maplibregl=require("maplibre-gl"),icons=require("@phila/phila-ui-core/icons"),philaUiCore=require("@phila/phila-ui-core"),useMapControl=require("./useMapControl-CPeYYuH7.cjs"),philaUiTooltip=require("@phila/phila-ui-tooltip"),utils=require("./index-CNj5iS7C.cjs"),_hoisted_1$h=["data-layer-id"],_sfc_main$s=vue.defineComponent({__name:"RasterLayer",props:{id:{},source:{},paint:{default:()=>({})},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},setup(k){const t=k,e=vue.inject("map"),n=vue.inject("isLoaded"),i=vue.ref(!1);let r=!0,c=JSON.stringify(t.source);const u=f=>{if(!e?.value)return;typeof t.source=="object"&&(e.value.getSource(t.id)||e.value.addSource(t.id,t.source));const o={id:t.id,type:"raster",source:typeof t.source=="object"?t.id:t.source,paint:t.paint||{}};if(t.minzoom!==void 0&&(o.minzoom=t.minzoom),t.maxzoom!==void 0&&(o.maxzoom=t.maxzoom),!e.value.getLayer(t.id)){const s=t.beforeId;let a;s&&e.value.getLayer(s)&&(a=s),e.value.addLayer(o,a),i.value=!0}},l=()=>{if(e?.value)try{e.value.getLayer?.(t.id)&&(e.value.removeLayer(t.id),i.value=!1),typeof t.source=="object"&&e.value.getSource?.(t.id)&&e.value.removeSource(t.id)}catch{}};return vue.watch(()=>n?.value,f=>{try{if(!r||!f||!e?.value)return;u()}catch{}},{immediate:!0}),vue.watch(()=>t.paint,f=>{try{if(!r||!e?.value?.getLayer?.(t.id)||!f)return;Object.keys(f).forEach(o=>{!r||!e?.value||e.value.setPaintProperty(t.id,o,f[o])})}catch{}},{deep:!0}),vue.watch(()=>t.source,f=>{try{if(!r||!e?.value)return;const o=JSON.stringify(f);if(o===c)return;c=o,l(),u()}catch{}},{deep:!0}),vue.onBeforeUnmount(()=>{r=!1}),vue.onUnmounted(()=>{l()}),(f,o)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":t.id,"data-layer-type":"raster"},null,8,_hoisted_1$h))}}),_hoisted_1$g=["data-layer-id"],_sfc_main$r=vue.defineComponent({__name:"BasemapCeiling",props:{id:{}},setup(k){const t=k,e=vue.inject("map"),n=vue.inject("isLoaded"),i=vue.ref(!1);let r=!0;const c=()=>{if(e?.value&&!e.value.getLayer(t.id)){const l={id:t.id,type:"custom",render(){}};e.value.addLayer(l),i.value=!0}},u=()=>{if(e?.value)try{e.value.getLayer?.(t.id)&&(e.value.removeLayer(t.id),i.value=!1)}catch{}};return vue.watch(()=>n?.value,l=>{try{if(!r||!l||!e?.value)return;c()}catch{}},{immediate:!0}),vue.onBeforeUnmount(()=>{r=!1}),vue.onUnmounted(()=>{u()}),(l,f)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":t.id,"data-layer-type":"custom"},null,8,_hoisted_1$g))}}),qe=["disabled"],He=vue.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},icon:{},src:{},svgRaw:{}},setup(k){const t=k,e=c=>"href"in c&&c.href!==void 0||"to"in c&&c.to!==void 0,n=vue.computed(()=>philaUiCore.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),i=vue.computed(()=>e(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:n.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:n.value}:{}),r=vue.computed(()=>({icon:t.icon,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(c,u)=>e(t)?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.BaseLink),vue.mergeProps({key:0},{...i.value,...c.$attrs},{role:"button"}),{default:vue.withCtx(()=>[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(vue.openBlock(),vue.createElementBlock("button",vue.mergeProps({key:1,type:"button",disabled:t.disabled,class:n.value},c.$attrs),[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)],16,qe))}});function P(k){return typeof k=="string"||k instanceof String}function ve(k){var t;return typeof k=="object"&&k!=null&&(k==null||(t=k.constructor)==null?void 0:t.name)==="Object"}function Ae(k,t){return Array.isArray(t)?Ae(k,(e,n)=>t.includes(n)):Object.entries(k).reduce((e,n)=>{let[i,r]=n;return t(r,i)&&(e[i]=r),e},{})}const d={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ke(k){switch(k){case d.LEFT:return d.FORCE_LEFT;case d.RIGHT:return d.FORCE_RIGHT;default:return k}}function oe(k){return k.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function te(k,t){if(t===k)return!0;const e=Array.isArray(t),n=Array.isArray(k);let i;if(e&&n){if(t.length!=k.length)return!1;for(i=0;i<t.length;i++)if(!te(t[i],k[i]))return!1;return!0}if(e!=n)return!1;if(t&&k&&typeof t=="object"&&typeof k=="object"){const r=t instanceof Date,c=k instanceof Date;if(r&&c)return t.getTime()==k.getTime();if(r!=c)return!1;const u=t instanceof RegExp,l=k instanceof RegExp;if(u&&l)return t.toString()==k.toString();if(u!=l)return!1;const f=Object.keys(t);for(i=0;i<f.length;i++)if(!Object.prototype.hasOwnProperty.call(k,f[i]))return!1;for(i=0;i<f.length;i++)if(!te(k[f[i]],t[f[i]]))return!1;return!0}else if(t&&k&&typeof t=="function"&&typeof k=="function")return t.toString()===k.toString();return!1}class Ge{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?d.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?d.RIGHT:d.LEFT}}function p(k,t){return new p.InputMask(k,t)}function Fe(k){if(k==null)throw new Error("mask property should be defined");return k instanceof RegExp?p.MaskedRegExp:P(k)?p.MaskedPattern:k===Date?p.MaskedDate:k===Number?p.MaskedNumber:Array.isArray(k)||k===Array?p.MaskedDynamic:p.Masked&&k.prototype instanceof p.Masked?k:p.Masked&&k instanceof p.Masked?k.constructor:k instanceof Function?p.MaskedFunction:p.Masked}function Z(k){if(!k)throw new Error("Options in not defined");if(p.Masked){if(k.prototype instanceof p.Masked)return{mask:k};const{mask:t=void 0,...e}=k instanceof p.Masked?{mask:k}:ve(k)&&k.mask instanceof p.Masked?k:{};if(t){const n=t.mask;return{...Ae(t,(i,r)=>!r.startsWith("_")),mask:t.constructor,_mask:n,...e}}}return ve(k)?{...k}:{mask:k}}function T(k){if(p.Masked&&k instanceof p.Masked)return k;const t=Z(k),e=Fe(t.mask);if(!e)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===e&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new e(t)}p.createMask=T;class pe{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,e){if(!(t==null||e==null||t===this.selectionStart&&e===this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}p.MaskElement=pe;const _e$1=90,$e=89;class ie extends pe{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,n;return(t=(e=(n=this.input).getRootNode)==null?void 0:e.call(n))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===_e$1&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===$e&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===_e$1&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}p.HTMLMaskElement=ie;class Ye extends ie{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}p.HTMLMaskElement=ie;class ye extends ie{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return i==null||n==null||n<i?n:i}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return i==null||n==null||n>i?n:i}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,e);const i=this.rootElement,r=i.getSelection&&i.getSelection();r&&(r.removeAllRanges(),r.addRange(n))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}p.HTMLContenteditableMaskElement=ye;class ae{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>ae.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}ae.MAX_LENGTH=100;class Ze{constructor(t,e){this.el=t instanceof pe?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new ye(t):new Ye(t),this.masked=T(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new ae,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return t==null||((e=this.masked)==null?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof p.Masked)&&this.masked.constructor===Fe(t)){this.masked.updateOptions({mask:t});return}const e=t instanceof p.Masked?t:T({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const n=this._listeners[t];n&&n.forEach(i=>i(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue,this.el.value,this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,n=this.masked.value,i=this.masked.rawInputValue,r=this.displayValue,c=this.unmaskedValue!==e||this.value!==n||this._rawInputValue!==i;this._unmaskedValue=e,this._value=n,this._rawInputValue=i,this.el.value!==r&&(this.el.value=r),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),c&&this._fireChangeEvents(),!this._historyChanging&&(c||this.history.isEmpty)&&this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...n}=t,i=!this.maskEquals(e),r=this.masked.optionsIsChanged(n);i&&(this.mask=e),r&&this.masked.updateOptions(n),(i||r)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,d.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const n=this._listeners[t].indexOf(e);return n>=0&&this._listeners[t].splice(n,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Ge({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,i=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,r=n===this.masked.rawInputValue?e.removeDirection:d.NONE;let c=this.masked.nearestInputPos(e.startChangePos+i,r);r!==d.NONE&&(c=this.masked.nearestInputPos(c,d.NONE)),this.updateControl(c),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}p.InputMask=Ze;class g{static normalize(t){return Array.isArray(t)?t:[t,new g]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}p.ChangeDetails=g;class D{constructor(t,e,n){t===void 0&&(t=""),e===void 0&&(e=0),this.value=t,this.from=e,this.stop=n}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class F{constructor(t){this._value="",this._update({...F.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){e===void 0&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new D(this.extractInput(t,e),t)}appendTail(t){return P(t)&&(t=new D(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new g({inserted:t,rawInserted:t})):new g}_appendChar(t,e,n){e===void 0&&(e={});const i=this.state;let r;if([t,r]=this.doPrepareChar(t,e),t&&(r=r.aggregate(this._appendCharRaw(t,e)),!r.rawInserted&&this.autofix==="pad")){const c=this.state;this.state=i;let u=this.pad(e);const l=this._appendCharRaw(t,e);u=u.aggregate(l),l.rawInserted||u.equals(r)?r=u:this.state=c}if(r.inserted){let c,u=this.doValidate(e)!==!1;if(u&&n!=null){const l=this.state;if(this.overwrite===!0){c=n.state;for(let o=0;o<r.rawInserted.length;++o)n.unshift(this.displayValue.length-r.tailShift)}let f=this.appendTail(n);if(u=f.rawInserted.length===n.toString().length,!(u&&f.inserted)&&this.overwrite==="shift"){this.state=l,c=n.state;for(let o=0;o<r.rawInserted.length;++o)n.shift();f=this.appendTail(n),u=f.rawInserted.length===n.toString().length}u&&f.inserted&&(this.state=l)}u||(r=new g,this.state=i,n&&c&&(n.state=c))}return r}_appendPlaceholder(){return new g}_appendEager(){return new g}append(t,e,n){if(!P(t))throw new Error("value should be string");const i=P(n)?new D(String(n)):n;e!=null&&e.tail&&(e._beforeTailState=this.state);let r;[t,r]=this.doPrepare(t,e);for(let c=0;c<t.length;++c){const u=this._appendChar(t[c],e,i);if(!u.rawInserted&&!this.doSkipInvalid(t[c],e,i))break;r.aggregate(u)}return(this.eager===!0||this.eager==="append")&&e!=null&&e.input&&t&&r.aggregate(this._appendEager()),i!=null&&(r.tailShift+=this.appendTail(i).tailShift),r}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new g}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,n=this.value,i=t();return this.rawInputValue=e,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,n=t(this);return this.state=e,delete this._isolated,n}doSkipInvalid(t,e,n){return!!this.skipInvalid}doPrepare(t,e){return e===void 0&&(e={}),g.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return e===void 0&&(e={}),g.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,n,i,r){n===void 0&&(n=""),i===void 0&&(i=d.NONE),r===void 0&&(r={input:!0});const c=t+e,u=this.extractTail(c),l=this.eager===!0||this.eager==="remove";let f;l&&(i=Ke(i),f=this.extractInput(0,c,{raw:!0}));let o=t;const s=new g;if(i!==d.NONE&&(o=this.nearestInputPos(t,e>1&&t!==0&&!l?d.NONE:i),s.tailShift=o-t),s.aggregate(this.remove(o)),l&&i!==d.NONE&&f===this.rawInputValue)if(i===d.FORCE_LEFT){let a;for(;f===this.rawInputValue&&(a=this.displayValue.length);)s.aggregate(new g({tailShift:-1})).aggregate(this.remove(a-1))}else i===d.FORCE_RIGHT&&u.unshift();return s.aggregate(this.append(n,r,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!te(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||F.EMPTY_VALUES.includes(t)&&F.EMPTY_VALUES.includes(e)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new g}}F.DEFAULTS={skipInvalid:!0};F.EMPTY_VALUES=[void 0,null,""];p.Masked=F;class L{constructor(t,e){t===void 0&&(t=[]),e===void 0&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=P(t)?new D(String(t)):t;const e=this.chunks[this.chunks.length-1],n=e&&(e.stop===t.stop||t.stop==null)&&t.from===e.from+e.toString().length;if(t instanceof D)n?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof L){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof p.MaskedPattern))return new D(this.toString()).appendTo(t);const e=new g;for(let n=0;n<this.chunks.length;++n){const i=this.chunks[n],r=t._mapPosToBlock(t.displayValue.length),c=i.stop;let u;if(c!=null&&(!r||r.index<=c)&&((i instanceof L||t._stops.indexOf(c)>=0)&&e.aggregate(t._appendPlaceholder(c)),u=i instanceof L&&t._blocks[c]),u){const l=u.appendTail(i);e.aggregate(l);const f=i.toString().slice(l.rawInserted.length);f&&e.aggregate(t.append(f,{tail:!0}))}else e.aggregate(t.append(i.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...n}=t;Object.assign(this,n),this.chunks=e.map(i=>{const r="chunks"in i?new L:new D;return r.state=i,r})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const e=t!=null?t-this.from:t;let n=0;for(;n<this.chunks.length;){const i=this.chunks[n],r=i.unshift(e);if(i.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],n=e.shift();if(e.toString()){if(!n)break;--t}else this.chunks.splice(t,1);if(n)return n}return""}}class Xe{constructor(t,e){this.masked=t,this._log=[];const{offset:n,index:i}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((e=this.block)==null?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,d.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,d.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,d.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,d.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,d.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,d.NONE),!0})}}class be{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new g}nearestInputPos(t,e){e===void 0&&(e=d.NONE);const n=0,i=this._value.length;switch(e){case d.LEFT:case d.FORCE_LEFT:return n;case d.NONE:case d.RIGHT:case d.FORCE_RIGHT:default:return i}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new g;const n=this.eager===!0||this.eager==="append",i=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!n)&&!e.tail,r=new g({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(e.raw||e.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new g;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new D("")}appendTail(t){return P(t)&&(t=new D(String(t))),t.appendTo(this)}append(t,e,n){const i=this._appendChar(t[0],e);return n!=null&&(i.tailShift+=this.appendTail(n).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class se{constructor(t){const{parent:e,isOptional:n,placeholderChar:i,displayChar:r,lazy:c,eager:u,...l}=t;this.masked=T(l),Object.assign(this,{parent:e,isOptional:n,placeholderChar:i,displayChar:r,lazy:c,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),t===0&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new g}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new g;const n=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(e));return i.inserted&&this.doValidate(e)===!1&&(i=new g,this.masked.state=n),!i.inserted&&!this.isOptional&&!this.lazy&&!e.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,e,n){return this.masked.append(t,this.currentMaskFlags(e),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new g:(this.isFilled=!0,new g({inserted:this.placeholderChar}))}_appendEager(){return new g}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.masked.extractInput(t,e,n)}nearestInputPos(t,e){e===void 0&&(e=d.NONE);const n=0,i=this.value.length,r=Math.min(Math.max(t,n),i);switch(e){case d.LEFT:case d.FORCE_LEFT:return this.isComplete?r:n;case d.RIGHT:case d.FORCE_RIGHT:return this.isComplete?r:i;case d.NONE:default:return r}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(t==null||(e=t._beforeTailState)==null?void 0:e.masked)||t?._beforeTailState}}pad(t){return new g}}se.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0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6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class We extends F{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=n=>n.search(e)>=0),super._update(t)}}p.MaskedRegExp=We;class y extends F{constructor(t){super({...y.DEFAULTS,...t,definitions:Object.assign({},se.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let n=!1,i=!1;for(let r=0;r<e.length;++r){if(this.blocks){const f=e.slice(r),o=Object.keys(this.blocks).filter(a=>f.indexOf(a)===0);o.sort((a,h)=>h.length-a.length);const s=o[0];if(s){const{expose:a,repeat:h,...m}=Z(this.blocks[s]),v={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...m,repeat:h,parent:this},b=h!=null?new p.RepeatBlock(v):T(v);b&&(this._blocks.push(b),a&&(this.exposeBlock=b),this._maskedBlocks[s]||(this._maskedBlocks[s]=[]),this._maskedBlocks[s].push(this._blocks.length-1)),r+=s.length-1;continue}}let c=e[r],u=c in t;if(c===y.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(c==="{"||c==="}"){n=!n;continue}if(c==="["||c==="]"){i=!i;continue}if(c===y.ESCAPE_CHAR){if(++r,c=e[r],!c)break;u=!1}const l=u?new se({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Z(t[c]),parent:this}):new be({char:c,eager:this.eager,isUnmasking:n});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:e,...n}=t;this._blocks.forEach((i,r)=>i.state=e[r]),super.state=n}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+=e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+=e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+=e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new g;let n=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(n==null)return e;this._blocks[n].isFilled&&++n;for(let i=n;i<this._blocks.length;++i){const r=this._blocks[i]._appendEager();if(!r.inserted)break;e.aggregate(r)}return e}_appendCharRaw(t,e){e===void 0&&(e={});const n=this._mapPosToBlock(this.displayValue.length),i=new g;if(!n)return i;for(let c=n.index,u;u=this._blocks[c];++c){var r;const l=u._appendChar(t,{...e,_beforeTailState:(r=e._beforeTailState)==null||(r=r._blocks)==null?void 0:r[c]});if(i.aggregate(l),l.consumed)break}return i}extractTail(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const n=new L;return t===e||this._forEachBlocksInRange(t,e,(i,r,c,u)=>{const l=i.extractTail(c,u);l.stop=this._findStopBefore(r),l.from=this._blockStartPos(r),l instanceof L&&(l.blockIndex=r),n.extend(l)}),n}extractInput(t,e,n){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),n===void 0&&(n={}),t===e)return"";let i="";return this._forEachBlocksInRange(t,e,(r,c,u,l)=>{i+=r.extractInput(u,l,n)}),i}_findStopBefore(t){let e;for(let n=0;n<this._stops.length;++n){const i=this._stops[n];if(i<=t)e=i;else break}return e}_appendPlaceholder(t){const e=new g;if(this.lazy&&t==null)return e;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return e;const i=n.index,r=t??this._blocks.length;return this._blocks.slice(i,r).forEach(c=>{if(!c.lazy||t!=null){var u;e.aggregate(c._appendPlaceholder((u=c._blocks)==null?void 0:u.length))}}),e}_mapPosToBlock(t){let e="";for(let n=0;n<this._blocks.length;++n){const i=this._blocks[n],r=e.length;if(e+=i.displayValue,t<=e.length)return{index:n,offset:t-r}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((e,n)=>e+=n.displayValue.length,0)}_forEachBlocksInRange(t,e,n){e===void 0&&(e=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const r=this._mapPosToBlock(e),c=r&&i.index===r.index,u=i.offset,l=r&&c?r.offset:this._blocks[i.index].displayValue.length;if(n(this._blocks[i.index],i.index,u,l),r&&!c){for(let f=i.index+1;f<r.index;++f)n(this._blocks[f],f,0,this._blocks[f].displayValue.length);n(this._blocks[r.index],r.index,0,r.offset)}}}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const n=super.remove(t,e);return this._forEachBlocksInRange(t,e,(i,r,c,u)=>{n.aggregate(i.remove(c,u))}),n}nearestInputPos(t,e){if(e===void 0&&(e=d.NONE),!this._blocks.length)return 0;const n=new Xe(this,t);if(e===d.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(e===d.LEFT||e===d.FORCE_LEFT){if(e===d.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===t)return t;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),e===d.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=t||(n.popState(),n.ok&&n.pos<=t))return n.pos;n.popState()}return n.ok?n.pos:e===d.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return e===d.RIGHT||e===d.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:e===d.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(t,d.LEFT))):t}totalInputPositions(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);let n=0;return this._forEachBlocksInRange(t,e,(i,r,c,u)=>{n+=i.totalInputPositions(c,u)}),n}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(n=>this._blocks[n]):[]}pad(t){const e=new g;return this._forEachBlocksInRange(0,this.displayValue.length,n=>e.aggregate(n.pad(t))),e}}y.DEFAULTS={...F.DEFAULTS,lazy:!0,placeholderChar:"_"};y.STOP_CHAR="`";y.ESCAPE_CHAR="\\";y.InputDefinition=se;y.FixedDefinition=be;p.MaskedPattern=y;class W extends y{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:n=this.from||0,maxLength:i=this.maxLength||0,autofix:r=this.autofix,...c}=t;this.to=e,this.from=n,this.maxLength=Math.max(String(e).length,i),this.autofix=r;const u=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let f=0;for(;f<l.length&&l[f]===u[f];)++f;c.mask=l.slice(0,f).replace(/0/g,"\\0")+"0".repeat(this.maxLength-f),super._update(c)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let e="",n="";const[,i,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];return r&&(e="0".repeat(i.length)+r,n="9".repeat(i.length)+r),e=e.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[e,n]}doPrepareChar(t,e){e===void 0&&(e={});let n;return[t,n]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(n.skip=!this.isComplete),[t,n]}_appendCharRaw(t,e){if(e===void 0&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const n=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[r,c]=this.boundaries(this.value+t);return Number(c)<this.from?super._appendCharRaw(n[this.value.length],e):Number(r)>this.to?!e.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(i[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(e.search(/[^0]/)===-1&&e.length<=this._matchFrom)return!0;const[n,i]=this.boundaries(e);return this.from<=Number(i)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){const e=new g;if(this.value.length===this.maxLength)return e;const n=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let r=0;r<i;++r)e.aggregate(super._appendCharRaw("0",t));n.split("").forEach(r=>this._appendCharRaw(r))}return e}}p.MaskedRange=W;const Je="d{.}`m{.}`Y";class I extends y{static extractPatternOptions(t){const{mask:e,pattern:n,...i}=t;return{...i,mask:P(e)?e:n}}constructor(t){super(I.extractPatternOptions({...I.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:n,blocks:i,...r}={...I.DEFAULTS,...t},c=Object.assign({},I.GET_DEFAULT_BLOCKS());t.min&&(c.Y.from=t.min.getFullYear()),t.max&&(c.Y.to=t.max.getFullYear()),t.min&&t.max&&c.Y.from===c.Y.to&&(c.m.from=t.min.getMonth()+1,c.m.to=t.max.getMonth()+1,c.m.from===c.m.to&&(c.d.from=t.min.getDate(),c.d.to=t.max.getDate())),Object.assign(c,this.blocks,i),super._update({...r,mask:P(e)?e:n,blocks:c})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&e!=null&&(this.min==null||this.min<=e)&&(this.max==null||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(I.extractPatternOptions(t))}}I.GET_DEFAULT_BLOCKS=()=>({d:{mask:W,from:1,to:31,maxLength:2},m:{mask:W,from:1,to:12,maxLength:2},Y:{mask:W,from:1900,to:9999}});I.DEFAULTS={...y.DEFAULTS,mask:Date,pattern:Je,format:(k,t)=>{if(!k)return"";const e=String(k.getDate()).padStart(2,"0"),n=String(k.getMonth()+1).padStart(2,"0"),i=k.getFullYear();return[e,n,i].join(".")},parse:(k,t)=>{const[e,n,i]=k.split(".").map(Number);return new Date(i,n-1,e)}};p.MaskedDate=I;class ue extends F{constructor(t){super({...ue.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(e=>{const{expose:n,...i}=Z(e),r=T({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return n&&(this.exposeMask=r),r}):[])}_appendCharRaw(t,e){e===void 0&&(e={});const n=this._applyDispatch(t,e);return this.currentMask&&n.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),n}_applyDispatch(t,e,n){t===void 0&&(t=""),e===void 0&&(e={}),n===void 0&&(n="");const i=e.tail&&e._beforeTailState!=null?e._beforeTailState._value:this.value,r=this.rawInputValue,c=e.tail&&e._beforeTailState!=null?e._beforeTailState._rawInputValue:r,u=r.slice(c.length),l=this.currentMask,f=new g,o=l?.state;return this.currentMask=this.doDispatch(t,{...e},n),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),c&&(this.currentMask.append(c,{raw:!0}),f.tailShift=this.currentMask.value.length-i.length),u&&(f.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),f}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new g;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,n;return{...t,_beforeTailState:((e=t._beforeTailState)==null?void 0:e.currentMaskRef)===this.currentMask&&((n=t._beforeTailState)==null?void 0:n.currentMask)||t._beforeTailState}}doDispatch(t,e,n){return e===void 0&&(e={}),n===void 0&&(n=""),this.dispatch(t,this,e,n)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){e===void 0&&(e={});let[n,i]=super.doPrepare(t,e);if(this.currentMask){let r;[n,r]=super.doPrepare(n,this.currentMaskFlags(e)),i=i.aggregate(r)}return[n,i]}doPrepareChar(t,e){e===void 0&&(e={});let[n,i]=super.doPrepareChar(t,e);if(this.currentMask){let r;[n,r]=super.doPrepareChar(n,this.currentMaskFlags(e)),i=i.aggregate(r)}return[n,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,e){const n=new g;return this.currentMask&&n.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),n}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:n,currentMask:i,...r}=t;e&&this.compiledMasks.forEach((c,u)=>c.state=e[u]),n!=null&&(this.currentMask=n,this.currentMask.state=i),super.state=r}extractInput(t,e,n){return this.currentMask?this.currentMask.extractInput(t,e,n):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,n)=>{if(!t[n])return;const{mask:i,...r}=t[n];return te(e,r)&&e.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var e;return!!((e=this.currentMask)!=null&&e.typedValueEquals(t))}}ue.DEFAULTS={...F.DEFAULTS,dispatch:(k,t,e,n)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,r=t.compiledMasks.map((c,u)=>{const l=t.currentMask===c,f=l?c.displayValue.length:c.nearestInputPos(c.displayValue.length,d.FORCE_LEFT);return c.rawInputValue!==i?(c.reset(),c.append(i,{raw:!0})):l||c.remove(f),c.append(k,t.currentMaskFlags(e)),c.appendTail(n),{index:u,weight:c.rawInputValue.length,totalInputPositions:c.totalInputPositions(0,Math.max(f,c.nearestInputPos(c.displayValue.length,d.FORCE_LEFT)))}});return r.sort((c,u)=>u.weight-c.weight||u.totalInputPositions-c.totalInputPositions),t.compiledMasks[r[0].index]}};p.MaskedDynamic=ue;class ne extends y{constructor(t){super({...ne.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...n}=t;if(e){const i=e.map(u=>u.length),r=Math.min(...i),c=Math.max(...i)-r;n.mask="*".repeat(r),c&&(n.mask+="["+"*".repeat(c)+"]"),this.enum=e}super._update(n)}_appendCharRaw(t,e){e===void 0&&(e={});const n=Math.min(this.nearestInputPos(0,d.FORCE_RIGHT),this.value.length),i=this.enum.filter(r=>this.matchValue(r,this.unmaskedValue+t,n));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(c,u)=>{const l=i[0][u];u>=this.value.length||l===c.value||(c.reset(),c._appendChar(l,e))});const r=super._appendCharRaw(i[0][this.value.length],e);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(c=>r.aggregate(super._appendCharRaw(c))),r}return new g({skip:!this.isComplete})}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new D("",t)}remove(t,e){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),t===e)return new g;const n=Math.min(super.nearestInputPos(0,d.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(c=>this.matchValue(c,this.value.slice(n,i),n)).length>1);--i);const r=super.remove(i,e);return r.tailShift+=i-t,r}get isComplete(){return this.enum.indexOf(this.value)>=0}}ne.DEFAULTS={...y.DEFAULTS,matchValue:(k,t,e)=>k.indexOf(t,e)===e};p.MaskedEnum=ne;class Qe extends F{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}p.MaskedFunction=Qe;var xe;class S extends F{constructor(t){super({...S.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e="\\d*",n=(this.scale?"("+oe(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+e+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(oe).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(oe(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){e===void 0&&(e={});const[n,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!n&&(i.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&i.aggregate(this._appendChar("-")),[n,i]}_separatorsCount(t,e){e===void 0&&(e=!1);let n=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++n,e&&(t+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,n))}_appendCharRaw(t,e){e===void 0&&(e={});const n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const r=this._value;this._value+=t;const c=this.number;let u=!isNaN(c),l=!1;if(u){let a;this.min!=null&&this.min<0&&this.number<this.min&&(a=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(a=this.max),a!=null&&(this.autofix?(this._value=this.format(a,this).replace(S.UNMASKED_RADIX,this.radix),l||(l=r===this._value&&!e.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let f;u?f=new g({inserted:this._value.slice(r.length),rawInserted:l?"":t,skip:l}):(this._value=r,f=new g),this._value=this._insertThousandsSeparators(this._value);const o=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return f.tailShift+=(s-i)*this.thousandsSeparator.length,f}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,e);if(n<=t)return n}return-1}_adjustRangeWithSeparators(t,e){const n=this._findSeparatorAround(t);n>=0&&(t=n);const i=this._findSeparatorAround(e);return i>=0&&(e=i+this.thousandsSeparator.length),[t,e]}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const n=this.value.slice(0,t),i=this.value.slice(e),r=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+i));const c=this._separatorsCountFromSlice(n);return new g({tailShift:(c-r)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case d.NONE:case d.LEFT:case d.FORCE_LEFT:{const n=this._findSeparatorAround(t-1);if(n>=0){const i=n+this.thousandsSeparator.length;if(t<i||this.value.length<=i||e===d.FORCE_LEFT)return n}break}case d.RIGHT:case d.FORCE_RIGHT:{const n=this._findSeparatorAround(t);if(n>=0)return n+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;this.min!=null&&(e=Math.max(e,this.min)),this.max!=null&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(n,i,r,c)=>i+c),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,n){e===void 0&&(e={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===S.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,n)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,S.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(S.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||S.EMPTY_VALUES.includes(t)&&S.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}xe=S;S.UNMASKED_RADIX=".";S.EMPTY_VALUES=[...F.EMPTY_VALUES,0];S.DEFAULTS={...F.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[xe.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:k=>k.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};p.MaskedNumber=S;const de={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Se(k,t,e){t===void 0&&(t=de.MASKED),e===void 0&&(e=de.MASKED);const n=T(k);return i=>n.runIsolated(r=>(r[t]=i,r[e]))}function et(k,t,e,n){return Se(t,e,n)(k)}p.PIPE_TYPE=de;p.createPipe=Se;p.pipe=et;class tt extends y{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,n,i;const{repeat:r,...c}=Z(t);this._blockOpts=Object.assign({},this._blockOpts,c);const u=T(this._blockOpts);this.repeat=(e=(n=r??u.repeat)!=null?n:this.repeat)!=null?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(T(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,e){e===void 0&&(e={});const n=new g;for(let l=(i=(r=this._mapPosToBlock(this.displayValue.length))==null?void 0:r.index)!=null?i:Math.max(this._blocks.length-1,0),f,o;f=(c=this._blocks[l])!=null?c:o=!o&&this._allocateBlock(l);++l){var i,r,c,u;const s=f._appendChar(t,{...e,_beforeTailState:(u=e._beforeTailState)==null||(u=u._blocks)==null?void 0:u[l]});if(s.skip&&o){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(s),s.consumed)break}return n}_trimEmptyTail(t,e){var n,i;t===void 0&&(t=0);const r=Math.max(((n=this._mapPosToBlock(t))==null?void 0:n.index)||0,this.repeatFrom,0);let c;e!=null&&(c=(i=this._mapPosToBlock(e))==null?void 0:i.index),c==null&&(c=this._blocks.length-1);let u=0;for(let l=c;r<=l&&!this._blocks[l].unmaskedValue;--l,++u);u&&(this._blocks.splice(c-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const n=super.remove(t,e);return this._trimEmptyTail(t,e),n}totalInputPositions(t,e){return t===void 0&&(t=0),e==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}p.RepeatBlock=tt;try{globalThis.IMask=p}catch{}var st={mask:void 0,prepare:Function,prepareChar:Function,validate:Function,commit:Function,overwrite:{type:Boolean,required:!1,default:void 0},eager:{required:!1,default:void 0,validator:k=>["append","remove"].includes(k)||typeof k=="boolean"},skipInvalid:{type:Boolean,required:!1,default:void 0},placeholderChar:String,displayChar:String,lazy:{type:Boolean,required:!1,default:void 0},definitions:Object,blocks:Object,enum:Array,maxLength:Number,from:Number,to:Number,pattern:String,format:Function,parse:Function,autofix:{required:!1,default:void 0,validator:k=>k==="pad"||typeof k=="boolean"},radix:String,thousandsSeparator:String,mapToRadix:Array,scale:Number,normalizeZeros:{type:Boolean,required:!1,default:void 0},padFractionalZeros:{type:Boolean,required:!1,default:void 0},min:[Number,Date],max:[Number,Date],dispatch:Function};function it(k,t){let{emit:e,onAccept:n,onComplete:i,defaultValue:r,defaultUnmaskedValue:c,defaultTypedValue:u}=t===void 0?{}:t;const l=vue.isRef(k)?k:vue.ref(k),f=vue.ref(),o=vue.ref(),s=vue.ref(""),a=vue.ref(""),h=vue.ref();let m,v=s.value,b=a.value,_=h.value;function w(){_=h.value=o.value.typedValue,b=a.value=o.value.unmaskedValue,v=s.value=o.value.value}function j(z){w(),e&&(e("accept",s.value,z),e("accept:masked",s.value,z),e("accept:typed",h.value,z),e("accept:unmasked",a.value,z)),n?.(z)}function E(z){e&&(e("complete",o.value.value,z),e("complete:masked",o.value.value,z),e("complete:typed",o.value.typedValue,z),e("complete:unmasked",o.value.unmaskedValue,z)),i?.(z)}const A=()=>{!o.value||a.value===void 0||(b!==a.value&&(o.value.unmaskedValue=a.value,o.value.unmaskedValue!==a.value&&j()),b=void 0)};vue.watch(a,A);const O=()=>{!o.value||s.value===void 0||(v!==s.value&&(o.value.value=s.value,o.value.value!==s.value&&j()),v=void 0)};vue.watch(s,O);const M=()=>{!o.value||h.value===void 0||(_!==h.value&&(o.value.typedValue=h.value,o.value.masked.typedValueEquals(h.value)||j()),_=void 0)};vue.watch(h,M);function C(){m=f.value;const z=l.value;!m||!(z!=null&&z.mask)||(o.value=p(m,z),r!==void 0&&(s.value=r),c!==void 0&&(a.value=c),u!==void 0&&(h.value=u),A(),O(),M(),w(),o.value.on("accept",j).on("complete",E))}function N(){var z;(z=o.value)==null||z.destroy(),o.value=void 0}return vue.onMounted(C),vue.onUnmounted(N),vue.watch([f,l],()=>{const z=f.value,B=l.value;(!(B!=null&&B.mask)||z!==m)&&N(),z&&(o.value?o.value.updateOptions(B):C())}),{el:f,mask:vue.readonly(o),masked:s,unmasked:a,typed:h}}function at(k,t){return k={...k},Object.keys(k).forEach(e=>{(k[e]===void 0||t.includes(e))&&delete k[e]}),k}const ut=["typed","unmasked","value","modelValue"];var nt=vue.defineComponent({name:"imask-input",inheritAttrs:!1,props:{modelValue:String,value:String,unmasked:String,typed:{validator:()=>!0},...st},emits:["update:modelValue","update:masked","update:value","update:unmasked","update:typed","accept","accept:value","accept:masked","accept:unmasked","accept:typed","complete","complete:value","complete:masked","complete:unmasked","complete:typed"],setup(k,t){let{attrs:e,emit:n}=t;const{el:i,mask:r,masked:c,unmasked:u,typed:l}=it(at(k,ut),{emit:n,onAccept:h=>{const m=c.value;n("accept:value",m,h),n("update:value",m,h),n("update:masked",m,h),n("update:modelValue",m,h),n("update:unmasked",u.value,h),n("update:typed",l.value,h)},onComplete:h=>{n("complete:value",c.value,h)}}),f=vue.toRef(k,"value"),o=vue.toRef(k,"modelValue"),s=vue.toRef(k,"unmasked"),a=vue.toRef(k,"typed");return c.value=o.value||f.value||"",u.value=s.value||"",l.value=a.value,vue.watch(f,h=>c.value=h),vue.watch(o,h=>c.value=h),vue.watch(s,h=>u.value=h),vue.watch(a,h=>l.value=h),()=>{const h={...e,value:k.value!=null?k.value:k.modelValue!=null?k.modelValue:r.value?r.value.displayValue:"",ref:i};return k.mask||(h.onInput=m=>{n("update:modelValue",m.target.value),n("update:value",m.target.value)}),vue.h("input",h)}}}),rt=nt;const lt=["for"],ot={class:"state-layer"},ht={class:"content"},dt={class:"input-text-container"},pt=["id","placeholder","aria-label"],ct={key:1,class:"has-text-body-small phila-supporting-text"},mt={key:2,class:"has-text-body-small phila-error-text"},gt=vue.defineComponent({inheritAttrs:!1,__name:"TextField",props:{modelValue:{default:void 0},className:{default:""},label:{default:""},id:{default:`phila-text-field-${Math.random().toString(36).substring(2,9)}`},imaskProps:{default:void 0},supportingText:{default:""},placeholder:{default:""},leadingIcon:{type:[Function,Object],default:void 0},trailingIcon:{type:[Function,Object],default:void 0},error:{default(){return[]}}},emits:["update:modelValue","complete"],setup(k,{expose:t,emit:e}){const n=vue.useAttrs(),i=k,r=vue.computed(()=>typeof i.error=="string"?i.error:i.error[0]),c=vue.toRef(i,"id"),u=e,l=vue.ref(""),f=vue.computed({get:()=>i.modelValue!==void 0?i.modelValue:l.value,set:v=>{u("update:modelValue",v),l.value=v}}),o=vue.computed(()=>{const v=["default-class"];return n.disabled!=null&&v.push("phila-input--disabled"),r.value&&v.push("phila-input--error"),n.required!=null&&v.push("phila-input--required"),philaUiCore.cn(...v)}),s=vue.computed(()=>{const v=[];return f.value!==""&&v.push("phila-text-field--filled"),i.className&&v.push(i.className),philaUiCore.cn(...v)}),a=vue.computed(()=>{if(!(i.label||n["aria-label"]))return i.placeholder||void 0}),h=vue.ref(null),m=v=>{v.target.closest("button")||h.value?.focus()};return t({inputRef:h}),(v,b)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["phila-input",o.value])},[i.label?(vue.openBlock(),vue.createElementBlock("label",{key:0,for:c.value,class:"has-text-label-small phila-label"},vue.toDisplayString(i.label),9,lt)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["phila-text-field",s.value]),onClick:vue.withModifiers(m,["prevent"])},[vue.createElementVNode("div",ot,[i.leadingIcon?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.Icon),{key:0,icon:i.leadingIcon,inline:"",decorative:""},null,8,["icon"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",ht,[vue.createElementVNode("div",dt,[i.imaskProps?.mask?(vue.openBlock(),vue.createBlock(vue.unref(rt),vue.mergeProps({key:0},{...vue.unref(n),...i.imaskProps},{id:c.value,modelValue:f.value,"onUpdate:modelValue":b[0]||(b[0]=_=>f.value=_),class:"phila-text-field-input has-text-body-default",placeholder:i.placeholder,onComplete:b[1]||(b[1]=()=>u("complete",l.value))}),null,16,["id","modelValue","placeholder"])):vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",vue.mergeProps({key:1,id:c.value,ref_key:"inputRef",ref:h},vue.unref(n),{"onUpdate:modelValue":b[2]||(b[2]=_=>f.value=_),class:"phila-text-field-input has-text-body-default",placeholder:i.placeholder,"aria-label":a.value}),null,16,pt)),[[vue.vModelDynamic,f.value]])])]),f.value!=""?(vue.openBlock(),vue.createBlock(vue.unref(He),{key:1,variant:"standard",size:"small","icon-only":"",icon:vue.unref(icons.IconClose),onClick:b[3]||(b[3]=_=>f.value="")},null,8,["icon"])):vue.createCommentVNode("",!0),i.trailingIcon?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.Icon),{key:2,size:"small",icon:i.trailingIcon,inline:"",decorative:""},null,8,["icon"])):vue.createCommentVNode("",!0),vue.renderSlot(v.$slots,"trailing-action")])],2),i.supportingText?(vue.openBlock(),vue.createElementBlock("div",ct,vue.toDisplayString(i.supportingText),1)):vue.createCommentVNode("",!0),r.value?(vue.openBlock(),vue.createElementBlock("div",mt,[vue.createVNode(vue.unref(philaUiCore.Icon),{icon:vue.unref(icons.IconCircleExclamation),size:"small",inline:"",decorative:""},null,8,["icon"]),vue.createTextVNode(" "+vue.toDisplayString(r.value),1)])):vue.createCommentVNode("",!0)],2))}}),ft=["disabled"],kt=vue.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},icon:{},src:{},svgRaw:{}},setup(k){const t=k,e=c=>"href"in c&&c.href!==void 0||"to"in c&&c.to!==void 0,n=vue.computed(()=>philaUiCore.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),i=vue.computed(()=>e(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:n.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:n.value}:{}),r=vue.computed(()=>({icon:t.icon,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(c,u)=>e(t)?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.BaseLink),vue.mergeProps({key:0},{...i.value,...c.$attrs},{role:"button"}),{default:vue.withCtx(()=>[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(vue.openBlock(),vue.createElementBlock("button",vue.mergeProps({key:1,type:"button",disabled:t.disabled,class:n.value},c.$attrs),[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)],16,ft))}}),vt={key:0,class:"search-suggestions-anchor"},_t=["onClick"],Ct=vue.defineComponent({__name:"SearchSuggestions",props:{suggestions:{}},emits:["select","dismiss"],setup(k,{expose:t,emit:e}){const n=k,i=e,r=vue.ref(-1),c=vue.ref(null);vue.watch(()=>n.suggestions,()=>{r.value=-1});function u(o){c.value?.querySelectorAll(".search-suggestion")?.[o]?.focus()}function l(){n.suggestions.length&&(r.value=0,u(0))}function f(o){switch(o.key){case"ArrowDown":{o.preventDefault();const s=Math.min(r.value+1,n.suggestions.length-1);r.value=s,u(s);break}case"ArrowUp":{o.preventDefault(),r.value<=0?(r.value=-1,i("dismiss")):(r.value-=1,u(r.value));break}case"Enter":{o.preventDefault(),r.value>=0&&i("select",n.suggestions[r.value]);break}case"Escape":{o.preventDefault(),i("dismiss");break}}}return t({focusFirst:l}),(o,s)=>k.suggestions.length?(vue.openBlock(),vue.createElementBlock("div",vt,[vue.createElementVNode("ul",{ref_key:"listRef",ref:c,class:"search-suggestions",role:"listbox",onKeydown:f},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.suggestions,(a,h)=>(vue.openBlock(),vue.createElementBlock("li",{key:a,class:vue.normalizeClass(["search-suggestion",{"search-suggestion--active":h===r.value}]),role:"option",tabindex:"-1",onClick:m=>i("select",a)},vue.toDisplayString(a),11,_t))),128))],544)])):vue.createCommentVNode("",!0)}}),Et=(k,t)=>{const e=k.__vccOpts||k;for(const[n,i]of t)e[n]=i;return e},At=Et(Ct,[["__scopeId","data-v-79ffafa6"]]),xt=vue.defineComponent({inheritAttrs:!1,__name:"Search",props:{modelValue:{default:void 0},placeholder:{default:"Search by title or keyword"},suggestions:{default:()=>[]},elevated:{type:Boolean,default:!1},className:{}},emits:["update:modelValue","search","select","dismiss"],setup(k,{expose:t,emit:e}){const n=vue.useAttrs(),i=k,r=e,c=vue.ref(null),u=vue.ref(null),l=vue.computed({get:()=>i.modelValue,set:b=>r("update:modelValue",b)}),f=vue.computed(()=>n["aria-label"]),o=vue.computed(()=>Object.fromEntries(Object.entries(n).filter(([b])=>b!=="aria-label"))),s=vue.computed(()=>philaUiCore.cn("default-class",i.elevated&&"is-elevated",i.className));function a(){c.value?.inputRef?.focus()}function h(b){b.key==="ArrowDown"&&i.suggestions.length>0&&b.target instanceof HTMLInputElement&&(b.preventDefault(),u.value?.focusFirst())}function m(b){r("update:modelValue",b),r("select",b)}function v(){r("dismiss"),a()}return t({focus:a}),(b,_)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps({class:["search",s.value]},o.value,{onKeydown:h}),[vue.createVNode(vue.unref(gt),{ref_key:"textFieldRef",ref:c,modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=w=>l.value=w),"class-name":"phila-text-field--search",placeholder:k.placeholder,"aria-label":f.value,onKeydown:_[2]||(_[2]=vue.withKeys(w=>r("search"),["enter"]))},{"trailing-action":vue.withCtx(()=>[vue.createVNode(vue.unref(kt),{variant:"standard",size:"small","icon-only":"",icon:vue.unref(icons.IconMagnifyingGlass),"aria-label":"Search","class-name":"phila-button--search",onClick:_[0]||(_[0]=w=>r("search"))},null,8,["icon"])]),_:1},8,["modelValue","placeholder","aria-label"]),i.suggestions.length>0?(vue.openBlock(),vue.createBlock(At,{key:0,ref_key:"suggestionsRef",ref:u,suggestions:i.suggestions,onSelect:m,onDismiss:v},null,8,["suggestions"])):vue.createCommentVNode("",!0)],16))}}),_hoisted_1$f=["aria-busy"],_hoisted_2$8={key:0,role:"alert",class:"map-search-error"},_hoisted_3$7={"aria-live":"polite",class:"sr-only"},_hoisted_4$4={key:0},_sfc_main$q=vue.defineComponent({__name:"MapSearchControl",props:{position:{default:"top-left"},placeholder:{default:"Search for an address"},geocode:{type:Boolean,default:!0},centerOnResult:{type:Boolean,default:!0},searchZoom:{default:17},teleportTo:{default:void 0},autocomplete:{type:Boolean,default:!1}},emits:["search","result","error"],setup(k,{expose:t,emit:e}){const n=k,i=e,r=vue.inject("map"),c=vue.ref(""),u=vue.ref(!1),l=vue.ref(null),f=vue.ref(null),o=vue.ref(null),s=n.autocomplete?useMapControl.useAisAddressSuggestions(c):null,a=vue.computed(()=>s?s.searchSuggestions.value:[]),h=async()=>{const j=c.value.trim();if(i("search",j),!!j&&n.geocode){u.value=!0,l.value=null;try{const A=await(await fetch(`https://api.phila.gov/ais/v1/search/${encodeURIComponent(j)}?include_units=false`)).json();if(A.features&&A.features.length>0){const O=A.features[0];if(i("result",O),n.centerOnResult&&r?.value&&O.geometry?.coordinates){const[M,C]=O.geometry.coordinates;r.value.setCenter([M,C]),r.value.setZoom(n.searchZoom)}}else l.value="No results found",i("error",l.value)}catch(E){l.value=E instanceof Error?E.message:"Failed to geocode address",i("error",l.value)}finally{u.value=!1}}};function m(j){s&&(c.value=j,s.dismissSuggestions(),h())}function v(){s&&s.hideSuggestions()}function b(j){!s||s.searchSuggestions.value.length===0||f.value&&!f.value.contains(j.target)&&s.hideSuggestions()}vue.onMounted(()=>{s&&document.addEventListener("mousedown",b)}),vue.onBeforeUnmount(()=>{s&&document.removeEventListener("mousedown",b)});const _=vue.inject("controlCorners",{}),w=vue.computed(()=>n.teleportTo?n.teleportTo:_[n.position??"top-left"]?.value??null);return t({loading:u,error:l,searchQuery:c}),(j,E)=>w.value?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:w.value},[vue.createElementVNode("div",{ref_key:"containerRef",ref:f,class:"maplibregl-ctrl map-search-control",role:"search","aria-label":"Search for an address","aria-busy":u.value},[vue.createVNode(vue.unref(xt),{ref_key:"searchRef",ref:o,modelValue:c.value,"onUpdate:modelValue":E[0]||(E[0]=A=>c.value=A),placeholder:n.placeholder,suggestions:a.value,"aria-label":"Search the map",onSearch:h,onSelect:m,onDismiss:v},null,8,["modelValue","placeholder","suggestions"]),l.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$8,"⚠ "+vue.toDisplayString(l.value),1)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$7,[u.value?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$4,"Searching...")):vue.createCommentVNode("",!0)])],8,_hoisted_1$f)],8,["to"])):vue.createCommentVNode("",!0)}});function useControlTarget(k,t){const e=vue.inject("controlCorners",{});return vue.computed(()=>vue.toValue(t)??e[vue.toValue(k)??"top-right"]?.value??null)}const _hoisted_1$e=["title","aria-label","aria-pressed"],_sfc_main$p=vue.defineComponent({inheritAttrs:!1,__name:"MapButton",props:{icon:{default:void 0},image:{default:""},imagePadding:{default:0},position:{default:"top-right"},title:{default:""},iconSize:{default:void 0},size:{default:void 0},toggleable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},activeColor:{default:"#ffcc80"},teleportTo:{default:void 0},className:{}},emits:["click"],setup(k,{emit:t}){const e=k,n=t,i=vue.useSlots(),r=useControlTarget(()=>e.position,()=>e.teleportTo),c=()=>{n("click")},u=vue.computed(()=>{const o=i.default?.();return o?o.some(s=>s.type!==vue.Comment&&!(s.type===vue.Text&&!String(s.children).trim())):!1}),l=vue.computed(()=>e.position?.includes("right")),f=vue.computed(()=>{const o={};return e.image&&(o.backgroundImage=`url("${e.image}")`,o.backgroundPosition="center",o.backgroundRepeat="no-repeat",e.imagePadding>0?(o.backgroundSize="contain",o.backgroundOrigin="content-box",o.padding=`${e.imagePadding}px`):o.backgroundSize="cover"),e.toggleable&&e.active&&(o.backgroundColor=e.activeColor),o});return vue.onMounted(()=>{}),(o,s)=>vue.unref(r)?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:vue.unref(r)},[vue.createElementVNode("div",{class:vue.normalizeClass(["maplibregl-ctrl",[u.value?"map-button-wrapper":"maplibregl-ctrl-group",o.$attrs.class]])},[l.value?vue.renderSlot(o.$slots,"default",{key:0}):vue.createCommentVNode("",!0),vue.createElementVNode("button",{class:vue.normalizeClass(["map-button",[{"has-image":e.image},e.size?`is-${e.size}`:null]]),type:"button",title:e.title,"aria-label":e.title,"aria-pressed":e.toggleable?String(e.active):void 0,style:vue.normalizeStyle(f.value),onClick:c},[e.icon&&!e.image?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.Icon),{key:0,icon:e.icon,decorative:"",inline:"",style:vue.normalizeStyle(e.iconSize!==void 0?{fontSize:`${e.iconSize}px`}:void 0)},null,8,["icon","style"])):vue.createCommentVNode("",!0)],14,_hoisted_1$e),l.value?vue.createCommentVNode("",!0):vue.renderSlot(o.$slots,"default",{key:1})],2)],8,["to"])):vue.createCommentVNode("",!0)}}),_hoisted_1$d=["title","aria-expanded"],_hoisted_2$7={class:"dropdown-label"},_hoisted_3$6=["aria-checked","tabindex","onClick"],_sfc_main$o=vue.defineComponent({__name:"BasemapDropdown",props:{options:{},position:{default:"top-right"},selectedIndex:{default:0},useAsControl:{type:Boolean,default:!0},isDropUp:{type:Boolean,default:!1},teleportTo:{default:void 0}},emits:["select"],setup(k,{expose:t,emit:e}){const n=vue.inject("handleBasemapChange",null),i=k,r=e,c=vue.ref(!1),u=vue.ref(i.selectedIndex),l=vue.ref(-1),f=vue.ref(null),o=vue.ref(null),s=vue.ref([]),a=vue.computed(()=>i.options[u.value]),h=vue.computed(()=>i.useAsControl?i.position?.includes("bottom")||!1:i.isDropUp),m=vue.inject("controlCorners",{}),v=vue.computed(()=>i.useAsControl?i.teleportTo?i.teleportTo:m[i.position??"top-right"]?.value??null:null);function b(){c.value=!c.value,c.value?(l.value=u.value,vue.nextTick(()=>w(l.value))):l.value=-1}function _(){c.value=!1,l.value=-1,o.value?.focus()}function w(C){s.value[C]?.focus()}function j(C){(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),c.value||(c.value=!0,l.value=u.value,vue.nextTick(()=>w(l.value))))}function E(C){switch(C.key){case"Escape":C.preventDefault(),_();break;case"ArrowDown":C.preventDefault(),l.value=(l.value+1)%i.options.length,w(l.value);break;case"ArrowUp":C.preventDefault(),l.value=(l.value-1+i.options.length)%i.options.length,w(l.value);break;case"Home":C.preventDefault(),l.value=0,w(l.value);break;case"End":C.preventDefault(),l.value=i.options.length-1,w(l.value);break;case"Tab":_();break}}function A(C,N){C&&(s.value[N]=C)}function O(C,N){if(u.value=N,c.value=!1,l.value=-1,o.value?.focus(),r("select",C,N),n){const z={showImagery:!0,imageryUrl:C.imageryUrl,imageryLabelsUrl:C.imageryLabelsUrl,showLabels:C.showLabels??!0};n(z)}}function M(C){f.value&&!f.value.contains(C.target)&&(c.value=!1,l.value=-1)}return vue.onMounted(()=>{if(document.addEventListener("click",M),n&&i.options.length>0){const C=i.options[u.value];if(C){const N={showImagery:!0,imageryUrl:C.imageryUrl,imageryLabelsUrl:C.imageryLabelsUrl,showLabels:C.showLabels??!0};n(N)}}}),vue.onBeforeUnmount(()=>{document.removeEventListener("click",M)}),t({isOpen:c,selectedIndex:u,selectedOption:a,toggleDropdown:b,closeDropdown:_}),(C,N)=>(vue.openBlock(),vue.createBlock(vue.Teleport,{to:v.value??"body",disabled:!v.value},[vue.createElementVNode("div",{ref_key:"containerRef",ref:f,class:vue.normalizeClass(["basemap-dropdown-control-wrapper",{"maplibregl-ctrl":k.useAsControl,"drop-up":h.value,"standalone-control":k.useAsControl,"embedded-control":!k.useAsControl}])},[vue.createElementVNode("button",{ref_key:"toggleRef",ref:o,class:"basemap-dropdown-toggle",title:a.value?.label||"Select basemap","aria-expanded":c.value,"aria-haspopup":"true",onClick:vue.withModifiers(b,["stop"]),onKeydown:j},[vue.createElementVNode("span",_hoisted_2$7,vue.toDisplayString(a.value?.label||"Select"),1),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(h.value?vue.unref(icons.IconChevronUp):vue.unref(icons.IconChevronDown)),{class:vue.normalizeClass(["dropdown-icon",{open:c.value}]),"aria-hidden":"true"},null,8,["class"]))],40,_hoisted_1$d),c.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"basemap-dropdown-menu",role:"menu",onKeydown:E},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.options,(z,B)=>(vue.openBlock(),vue.createElementBlock("button",{key:B,ref_for:!0,ref:V=>A(V,B),role:"menuitemradio","aria-checked":B===u.value,tabindex:B===l.value?0:-1,class:vue.normalizeClass(["basemap-dropdown-item",{selected:B===u.value}]),onClick:vue.withModifiers(V=>O(z,B),["stop"])},vue.toDisplayString(z.label),11,_hoisted_3$6))),128))],32)):vue.createCommentVNode("",!0)],2)],8,["to","disabled"]))}}),defaultImageryIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxNjoxMTowOSAxNDo0MTowMzVIv04AABSySURBVFhH1Vnpb1zXfT0zb/Z9Hw5nSIqbuJO2RK22bEm2YsuS03hNEydu4wRo+6Ft2qZBULgtg34p2iCJUaAB/KVoGzhwUiiIlchJ7MiKaslaSMkSKVIkxXU4M5x937eed9V/wgNcDERdvnfv757fWS4Vz515vv3is/tRbwBNhQLBcALi024in8nA4zTh8o1lvPNfP0Aqk+U8Jb731n9iqNuB/z53SUwd73NieGQQ711cwLF9vVhaDuKjK3f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qF1K9B7yq49pGZB6WHaDmPT0rwqvMla5UYlh6sRHVYzhi5uTjEu67BqPhUvEp4WCu08qy8QKlzPF5rFXJErq7gtw+ZeAzyih9PAtRi6g5GBbA86Irj5cyJECA/KDcIw6OfuUXqFxtjedse7wFcxlkDnEFam/VyCPK+XAslMx6oAiDISPQLD9YtU/cofsqNsrhCxyPkFDnPOJdAASwZUoJXOaQ8CJTzDLCeOagA5FAp8U4wZmDLADzWKgRFeBVBVXAZV3s8pRAAq7OUW2eQZ3rNolM4zJ1I0hnE1bcIUPpCBZhD1Xx5rJSUpZVrACK5jP4JYK0pEO8+HioS9IlS8ezv77f/AInIHJK+SU/cAAAAAElFTkSuQmCC",imageryLabelsUrl="https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_Labels/MapServer/tile/{z}/{y}/{x}",imageryLabelsSource={tiles:[imageryLabelsUrl],type:"raster",tileSize:256},imageryParcelOutlinesSource={tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/PWDParcel_ImageryOverlay/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},imagerySources={2025:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2025_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2024:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2024_1in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2023:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2023/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2022:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2022_2in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2020:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2020_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2019:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2019_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2018:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2018_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2017:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2017_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2016:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2016_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2015:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2015_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2012:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2012_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2010:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2010_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2008:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2008_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2004:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2004_6in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1996:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_1996_6in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1962:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricLandUse_1962/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1942:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricLandUse_1942/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1910:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricBromleyAtlas_1910/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1895:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricBromleyAtlas_1895/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1875:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricGMHopkinsAtlas_1875/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1860:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricHexamerLocherAtlas_1860/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256}},defaultBasemapSource={tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityBasemap/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},defaultLabelsSource={tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityBasemap_Labels/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},defaultImageryOptions=[{label:"2025",year:"2025",imageryUrl:imagerySources[2025].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2024",year:"2024",imageryUrl:imagerySources[2024].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2023",year:"2023",imageryUrl:imagerySources[2023].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2022",year:"2022",imageryUrl:imagerySources[2022].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2020",year:"2020",imageryUrl:imagerySources[2020].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2019",year:"2019",imageryUrl:imagerySources[2019].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2018",year:"2018",imageryUrl:imagerySources[2018].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2017",year:"2017",imageryUrl:imagerySources[2017].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2016",year:"2016",imageryUrl:imagerySources[2016].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2015",year:"2015",imageryUrl:imagerySources[2015].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2012",year:"2012",imageryUrl:imagerySources[2012].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2010",year:"2010",imageryUrl:imagerySources[2010].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2008",year:"2008",imageryUrl:imagerySources[2008].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2004",year:"2004",imageryUrl:imagerySources[2004].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"1996",year:"1996",imageryUrl:imagerySources[1996].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"1962",year:"1962",imageryUrl:imagerySources[1962].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1942",year:"1942",imageryUrl:imagerySources[1942].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1910",year:"1910",imageryUrl:imagerySources[1910].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1895",year:"1895",imageryUrl:imagerySources[1895].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1875",year:"1875",imageryUrl:imagerySources[1875].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1860",year:"1860",imageryUrl:imagerySources[1860].tiles[0],imageryLabelsUrl:null,showLabels:!1}],_sfc_main$n=vue.defineComponent({__name:"BasemapToggle",props:{position:{default:"top-right"},imageryUrl:{default:"https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2024_1in/MapServer/tile/{z}/{y}/{x}"},imageryLabelsUrl:{default:"https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_Labels/MapServer/tile/{z}/{y}/{x}"},iconImage:{},basemapImage:{},title:{default:"Toggle Imagery"},size:{},showDropdown:{type:Boolean,default:!1},dropdownOptions:{default:()=>defaultImageryOptions},teleportTo:{default:void 0},className:{}},emits:["change"],setup(k,{emit:t}){const e=vue.inject("handleBasemapChange",null),n=k,i=t,r=vue.ref(!1),c=vue.ref(n.imageryUrl),u=vue.ref(n.imageryLabelsUrl??null),l=vue.ref(n.dropdownOptions?.[0]?.showLabels??!0),f=vue.ref(0),o=vue.ref(n.iconImage??defaultImageryIcon);function s(){r.value=!r.value;let h;r.value?(o.value=n.basemapImage??defaultBasemapIcon,h={showImagery:!0,imageryUrl:c.value,imageryLabelsUrl:u.value,showLabels:l.value}):(o.value=n.iconImage??defaultImageryIcon,h={showImagery:!1,imageryUrl:null,imageryLabelsUrl:null,showLabels:!0}),i("change",h),e&&e(h)}function a(h,m){if(f.value=m,c.value=h.imageryUrl,u.value=h.imageryLabelsUrl,l.value=h.showLabels??!0,r.value){const v={showImagery:!0,imageryUrl:h.imageryUrl,imageryLabelsUrl:h.imageryLabelsUrl,showLabels:h.showLabels??!0};i("change",v),e&&e(v)}}return(h,m)=>(vue.openBlock(),vue.createBlock(_sfc_main$p,{image:o.value,position:n.position,"teleport-to":n.teleportTo,title:n.title,size:n.size,onClick:s},{default:vue.withCtx(()=>[k.showDropdown&&k.dropdownOptions.length>0&&r.value?(vue.openBlock(),vue.createBlock(_sfc_main$o,{key:0,options:k.dropdownOptions,"selected-index":f.value,"use-as-control":!1,"is-drop-up":k.position?.includes("bottom"),onSelect:a},null,8,["options","selected-index","is-drop-up"])):vue.createCommentVNode("",!0)]),_:1},8,["image","position","teleport-to","title","size"]))}}),_sfc_main$m=vue.defineComponent({__name:"MapNavigationControl",props:{position:{default:"top-right"},className:{}},setup(k){const t=k;return useMapControl.useMapControl(t,()=>new maplibregl.NavigationControl),(e,n)=>vue.renderSlot(e.$slots,"default")}}),_sfc_main$l=vue.defineComponent({__name:"GeolocationButton",props:{position:{default:"top-right"},icon:{},iconSize:{},size:{},title:{default:"Show my location"},trackUser:{type:Boolean,default:!1},markerColor:{default:"#4285F4"},showLocationMarker:{type:Boolean,default:!0},deniedMessage:{default:"Location access is off. Enable it for this site in your browser settings."},teleportTo:{default:void 0},className:{}},emits:["located","error","permission-change"],setup(k,{emit:t}){const e=k,n=e.icon||icons.IconLocationCrosshairs,i=t,r=vue.inject("map"),c=vue.ref(!1),u=vue.ref(!1),l=vue.ref(null),f=vue.computed(()=>l.value==="denied");let o=null;const s=vue.ref(!1);let a=null;const h=vue.computed(()=>[e.position?.includes("right")?"place-left":"place-right",e.position?.includes("bottom")?"anchor-bottom":"anchor-top"]),m=()=>{s.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{s.value=!1,a=null},6e3)},v=()=>{a&&(clearTimeout(a),a=null),s.value=!1},b=z=>{l.value=z,i("permission-change",z)};vue.onMounted(async()=>{if(typeof navigator<"u"&&navigator.permissions?.query)try{o=await navigator.permissions.query({name:"geolocation"}),b(o.state),o.onchange=()=>{o&&b(o.state)}}catch{b("prompt")}else b("prompt")});let _=null,w=null;const j=(z,B)=>{if(!r?.value)return;const V=document.createElement("div");V.className="geolocation-marker",V.style.setProperty("--geolocation-marker-color",e.markerColor),V.setAttribute("role","img"),V.setAttribute("aria-label","Your location"),V.innerHTML=`
1
+ "use strict";const vue=require("vue"),maplibregl=require("maplibre-gl"),icons=require("@phila/phila-ui-core/icons"),philaUiCore=require("@phila/phila-ui-core"),useMapControl=require("./useMapControl-CPeYYuH7.cjs"),philaUiTooltip=require("@phila/phila-ui-tooltip"),utils=require("./index-CNj5iS7C.cjs"),_hoisted_1$h=["data-layer-id"],_sfc_main$s=vue.defineComponent({__name:"RasterLayer",props:{id:{},source:{},paint:{default:()=>({})},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},setup(k){const t=k,e=vue.inject("map"),n=vue.inject("isLoaded"),i=vue.ref(!1);let r=!0,c=JSON.stringify(t.source);const u=f=>{if(!e?.value)return;typeof t.source=="object"&&(e.value.getSource(t.id)||e.value.addSource(t.id,t.source));const o={id:t.id,type:"raster",source:typeof t.source=="object"?t.id:t.source,paint:t.paint||{}};if(t.minzoom!==void 0&&(o.minzoom=t.minzoom),t.maxzoom!==void 0&&(o.maxzoom=t.maxzoom),!e.value.getLayer(t.id)){const s=t.beforeId;let a;s&&e.value.getLayer(s)&&(a=s),e.value.addLayer(o,a),i.value=!0}},l=()=>{if(e?.value)try{e.value.getLayer?.(t.id)&&(e.value.removeLayer(t.id),i.value=!1),typeof t.source=="object"&&e.value.getSource?.(t.id)&&e.value.removeSource(t.id)}catch{}};return vue.watch(()=>n?.value,f=>{try{if(!r||!f||!e?.value)return;u()}catch{}},{immediate:!0}),vue.watch(()=>t.paint,f=>{try{if(!r||!e?.value?.getLayer?.(t.id)||!f)return;Object.keys(f).forEach(o=>{!r||!e?.value||e.value.setPaintProperty(t.id,o,f[o])})}catch{}},{deep:!0}),vue.watch(()=>t.source,f=>{try{if(!r||!e?.value)return;const o=JSON.stringify(f);if(o===c)return;c=o,l(),u()}catch{}},{deep:!0}),vue.onBeforeUnmount(()=>{r=!1}),vue.onUnmounted(()=>{l()}),(f,o)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":t.id,"data-layer-type":"raster"},null,8,_hoisted_1$h))}}),_hoisted_1$g=["data-layer-id"],_sfc_main$r=vue.defineComponent({__name:"BasemapCeiling",props:{id:{}},setup(k){const t=k,e=vue.inject("map"),n=vue.inject("isLoaded"),i=vue.ref(!1);let r=!0;const c=()=>{if(e?.value&&!e.value.getLayer(t.id)){const l={id:t.id,type:"custom",render(){}};e.value.addLayer(l),i.value=!0}},u=()=>{if(e?.value)try{e.value.getLayer?.(t.id)&&(e.value.removeLayer(t.id),i.value=!1)}catch{}};return vue.watch(()=>n?.value,l=>{try{if(!r||!l||!e?.value)return;c()}catch{}},{immediate:!0}),vue.onBeforeUnmount(()=>{r=!1}),vue.onUnmounted(()=>{u()}),(l,f)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":t.id,"data-layer-type":"custom"},null,8,_hoisted_1$g))}}),qe=["disabled"],He=vue.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},icon:{},src:{},svgRaw:{}},setup(k){const t=k,e=c=>"href"in c&&c.href!==void 0||"to"in c&&c.to!==void 0,n=vue.computed(()=>philaUiCore.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),i=vue.computed(()=>e(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:n.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:n.value}:{}),r=vue.computed(()=>({icon:t.icon,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(c,u)=>e(t)?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.BaseLink),vue.mergeProps({key:0},{...i.value,...c.$attrs},{role:"button"}),{default:vue.withCtx(()=>[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(vue.openBlock(),vue.createElementBlock("button",vue.mergeProps({key:1,type:"button",disabled:t.disabled,class:n.value},c.$attrs),[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)],16,qe))}});function P(k){return typeof k=="string"||k instanceof String}function ve(k){var t;return typeof k=="object"&&k!=null&&(k==null||(t=k.constructor)==null?void 0:t.name)==="Object"}function Ae(k,t){return Array.isArray(t)?Ae(k,(e,n)=>t.includes(n)):Object.entries(k).reduce((e,n)=>{let[i,r]=n;return t(r,i)&&(e[i]=r),e},{})}const d={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ke(k){switch(k){case d.LEFT:return d.FORCE_LEFT;case d.RIGHT:return d.FORCE_RIGHT;default:return k}}function oe(k){return k.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function te(k,t){if(t===k)return!0;const e=Array.isArray(t),n=Array.isArray(k);let i;if(e&&n){if(t.length!=k.length)return!1;for(i=0;i<t.length;i++)if(!te(t[i],k[i]))return!1;return!0}if(e!=n)return!1;if(t&&k&&typeof t=="object"&&typeof k=="object"){const r=t instanceof Date,c=k instanceof Date;if(r&&c)return t.getTime()==k.getTime();if(r!=c)return!1;const u=t instanceof RegExp,l=k instanceof RegExp;if(u&&l)return t.toString()==k.toString();if(u!=l)return!1;const f=Object.keys(t);for(i=0;i<f.length;i++)if(!Object.prototype.hasOwnProperty.call(k,f[i]))return!1;for(i=0;i<f.length;i++)if(!te(k[f[i]],t[f[i]]))return!1;return!0}else if(t&&k&&typeof t=="function"&&typeof k=="function")return t.toString()===k.toString();return!1}class Ge{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?d.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?d.RIGHT:d.LEFT}}function p(k,t){return new p.InputMask(k,t)}function Fe(k){if(k==null)throw new Error("mask property should be defined");return k instanceof RegExp?p.MaskedRegExp:P(k)?p.MaskedPattern:k===Date?p.MaskedDate:k===Number?p.MaskedNumber:Array.isArray(k)||k===Array?p.MaskedDynamic:p.Masked&&k.prototype instanceof p.Masked?k:p.Masked&&k instanceof p.Masked?k.constructor:k instanceof Function?p.MaskedFunction:p.Masked}function Z(k){if(!k)throw new Error("Options in not defined");if(p.Masked){if(k.prototype instanceof p.Masked)return{mask:k};const{mask:t=void 0,...e}=k instanceof p.Masked?{mask:k}:ve(k)&&k.mask instanceof p.Masked?k:{};if(t){const n=t.mask;return{...Ae(t,(i,r)=>!r.startsWith("_")),mask:t.constructor,_mask:n,...e}}}return ve(k)?{...k}:{mask:k}}function T(k){if(p.Masked&&k instanceof p.Masked)return k;const t=Z(k),e=Fe(t.mask);if(!e)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===e&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new e(t)}p.createMask=T;class pe{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,e){if(!(t==null||e==null||t===this.selectionStart&&e===this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}p.MaskElement=pe;const _e=90,$e$1=89;class ie extends pe{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,n;return(t=(e=(n=this.input).getRootNode)==null?void 0:e.call(n))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===_e&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===$e$1&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===_e&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}p.HTMLMaskElement=ie;class Ye extends ie{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}p.HTMLMaskElement=ie;class ye extends ie{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return i==null||n==null||n<i?n:i}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return i==null||n==null||n>i?n:i}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,e);const i=this.rootElement,r=i.getSelection&&i.getSelection();r&&(r.removeAllRanges(),r.addRange(n))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}p.HTMLContenteditableMaskElement=ye;class ae{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>ae.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}ae.MAX_LENGTH=100;class Ze{constructor(t,e){this.el=t instanceof pe?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new ye(t):new Ye(t),this.masked=T(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new ae,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return t==null||((e=this.masked)==null?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof p.Masked)&&this.masked.constructor===Fe(t)){this.masked.updateOptions({mask:t});return}const e=t instanceof p.Masked?t:T({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const n=this._listeners[t];n&&n.forEach(i=>i(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue,this.el.value,this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,n=this.masked.value,i=this.masked.rawInputValue,r=this.displayValue,c=this.unmaskedValue!==e||this.value!==n||this._rawInputValue!==i;this._unmaskedValue=e,this._value=n,this._rawInputValue=i,this.el.value!==r&&(this.el.value=r),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),c&&this._fireChangeEvents(),!this._historyChanging&&(c||this.history.isEmpty)&&this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...n}=t,i=!this.maskEquals(e),r=this.masked.optionsIsChanged(n);i&&(this.mask=e),r&&this.masked.updateOptions(n),(i||r)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,d.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const n=this._listeners[t].indexOf(e);return n>=0&&this._listeners[t].splice(n,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Ge({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,i=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,r=n===this.masked.rawInputValue?e.removeDirection:d.NONE;let c=this.masked.nearestInputPos(e.startChangePos+i,r);r!==d.NONE&&(c=this.masked.nearestInputPos(c,d.NONE)),this.updateControl(c),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}p.InputMask=Ze;class g{static normalize(t){return Array.isArray(t)?t:[t,new g]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}p.ChangeDetails=g;class D{constructor(t,e,n){t===void 0&&(t=""),e===void 0&&(e=0),this.value=t,this.from=e,this.stop=n}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class F{constructor(t){this._value="",this._update({...F.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){e===void 0&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new D(this.extractInput(t,e),t)}appendTail(t){return P(t)&&(t=new D(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new g({inserted:t,rawInserted:t})):new g}_appendChar(t,e,n){e===void 0&&(e={});const i=this.state;let r;if([t,r]=this.doPrepareChar(t,e),t&&(r=r.aggregate(this._appendCharRaw(t,e)),!r.rawInserted&&this.autofix==="pad")){const c=this.state;this.state=i;let u=this.pad(e);const l=this._appendCharRaw(t,e);u=u.aggregate(l),l.rawInserted||u.equals(r)?r=u:this.state=c}if(r.inserted){let c,u=this.doValidate(e)!==!1;if(u&&n!=null){const l=this.state;if(this.overwrite===!0){c=n.state;for(let o=0;o<r.rawInserted.length;++o)n.unshift(this.displayValue.length-r.tailShift)}let f=this.appendTail(n);if(u=f.rawInserted.length===n.toString().length,!(u&&f.inserted)&&this.overwrite==="shift"){this.state=l,c=n.state;for(let o=0;o<r.rawInserted.length;++o)n.shift();f=this.appendTail(n),u=f.rawInserted.length===n.toString().length}u&&f.inserted&&(this.state=l)}u||(r=new g,this.state=i,n&&c&&(n.state=c))}return r}_appendPlaceholder(){return new g}_appendEager(){return new g}append(t,e,n){if(!P(t))throw new Error("value should be string");const i=P(n)?new D(String(n)):n;e!=null&&e.tail&&(e._beforeTailState=this.state);let r;[t,r]=this.doPrepare(t,e);for(let c=0;c<t.length;++c){const u=this._appendChar(t[c],e,i);if(!u.rawInserted&&!this.doSkipInvalid(t[c],e,i))break;r.aggregate(u)}return(this.eager===!0||this.eager==="append")&&e!=null&&e.input&&t&&r.aggregate(this._appendEager()),i!=null&&(r.tailShift+=this.appendTail(i).tailShift),r}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new g}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,n=this.value,i=t();return this.rawInputValue=e,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,n=t(this);return this.state=e,delete this._isolated,n}doSkipInvalid(t,e,n){return!!this.skipInvalid}doPrepare(t,e){return e===void 0&&(e={}),g.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return e===void 0&&(e={}),g.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,n,i,r){n===void 0&&(n=""),i===void 0&&(i=d.NONE),r===void 0&&(r={input:!0});const c=t+e,u=this.extractTail(c),l=this.eager===!0||this.eager==="remove";let f;l&&(i=Ke(i),f=this.extractInput(0,c,{raw:!0}));let o=t;const s=new g;if(i!==d.NONE&&(o=this.nearestInputPos(t,e>1&&t!==0&&!l?d.NONE:i),s.tailShift=o-t),s.aggregate(this.remove(o)),l&&i!==d.NONE&&f===this.rawInputValue)if(i===d.FORCE_LEFT){let a;for(;f===this.rawInputValue&&(a=this.displayValue.length);)s.aggregate(new g({tailShift:-1})).aggregate(this.remove(a-1))}else i===d.FORCE_RIGHT&&u.unshift();return s.aggregate(this.append(n,r,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!te(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||F.EMPTY_VALUES.includes(t)&&F.EMPTY_VALUES.includes(e)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new g}}F.DEFAULTS={skipInvalid:!0};F.EMPTY_VALUES=[void 0,null,""];p.Masked=F;class L{constructor(t,e){t===void 0&&(t=[]),e===void 0&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=P(t)?new D(String(t)):t;const e=this.chunks[this.chunks.length-1],n=e&&(e.stop===t.stop||t.stop==null)&&t.from===e.from+e.toString().length;if(t instanceof D)n?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof L){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof p.MaskedPattern))return new D(this.toString()).appendTo(t);const e=new g;for(let n=0;n<this.chunks.length;++n){const i=this.chunks[n],r=t._mapPosToBlock(t.displayValue.length),c=i.stop;let u;if(c!=null&&(!r||r.index<=c)&&((i instanceof L||t._stops.indexOf(c)>=0)&&e.aggregate(t._appendPlaceholder(c)),u=i instanceof L&&t._blocks[c]),u){const l=u.appendTail(i);e.aggregate(l);const f=i.toString().slice(l.rawInserted.length);f&&e.aggregate(t.append(f,{tail:!0}))}else e.aggregate(t.append(i.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...n}=t;Object.assign(this,n),this.chunks=e.map(i=>{const r="chunks"in i?new L:new D;return r.state=i,r})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const e=t!=null?t-this.from:t;let n=0;for(;n<this.chunks.length;){const i=this.chunks[n],r=i.unshift(e);if(i.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],n=e.shift();if(e.toString()){if(!n)break;--t}else this.chunks.splice(t,1);if(n)return n}return""}}class Xe{constructor(t,e){this.masked=t,this._log=[];const{offset:n,index:i}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((e=this.block)==null?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,d.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,d.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,d.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,d.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,d.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,d.NONE),!0})}}class be{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new g}nearestInputPos(t,e){e===void 0&&(e=d.NONE);const n=0,i=this._value.length;switch(e){case d.LEFT:case d.FORCE_LEFT:return n;case d.NONE:case d.RIGHT:case d.FORCE_RIGHT:default:return i}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new g;const n=this.eager===!0||this.eager==="append",i=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!n)&&!e.tail,r=new g({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(e.raw||e.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new g;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new D("")}appendTail(t){return P(t)&&(t=new D(String(t))),t.appendTo(this)}append(t,e,n){const i=this._appendChar(t[0],e);return n!=null&&(i.tailShift+=this.appendTail(n).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class se{constructor(t){const{parent:e,isOptional:n,placeholderChar:i,displayChar:r,lazy:c,eager:u,...l}=t;this.masked=T(l),Object.assign(this,{parent:e,isOptional:n,placeholderChar:i,displayChar:r,lazy:c,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),t===0&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new g}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new g;const n=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(e));return i.inserted&&this.doValidate(e)===!1&&(i=new g,this.masked.state=n),!i.inserted&&!this.isOptional&&!this.lazy&&!e.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,e,n){return this.masked.append(t,this.currentMaskFlags(e),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new g:(this.isFilled=!0,new g({inserted:this.placeholderChar}))}_appendEager(){return new g}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.masked.extractInput(t,e,n)}nearestInputPos(t,e){e===void 0&&(e=d.NONE);const n=0,i=this.value.length,r=Math.min(Math.max(t,n),i);switch(e){case d.LEFT:case d.FORCE_LEFT:return this.isComplete?r:n;case d.RIGHT:case d.FORCE_RIGHT:return this.isComplete?r:i;case d.NONE:default:return r}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(t==null||(e=t._beforeTailState)==null?void 0:e.masked)||t?._beforeTailState}}pad(t){return new g}}se.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class We extends F{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=n=>n.search(e)>=0),super._update(t)}}p.MaskedRegExp=We;class y extends F{constructor(t){super({...y.DEFAULTS,...t,definitions:Object.assign({},se.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let n=!1,i=!1;for(let r=0;r<e.length;++r){if(this.blocks){const f=e.slice(r),o=Object.keys(this.blocks).filter(a=>f.indexOf(a)===0);o.sort((a,h)=>h.length-a.length);const s=o[0];if(s){const{expose:a,repeat:h,...m}=Z(this.blocks[s]),v={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...m,repeat:h,parent:this},b=h!=null?new p.RepeatBlock(v):T(v);b&&(this._blocks.push(b),a&&(this.exposeBlock=b),this._maskedBlocks[s]||(this._maskedBlocks[s]=[]),this._maskedBlocks[s].push(this._blocks.length-1)),r+=s.length-1;continue}}let c=e[r],u=c in t;if(c===y.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(c==="{"||c==="}"){n=!n;continue}if(c==="["||c==="]"){i=!i;continue}if(c===y.ESCAPE_CHAR){if(++r,c=e[r],!c)break;u=!1}const l=u?new se({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Z(t[c]),parent:this}):new be({char:c,eager:this.eager,isUnmasking:n});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:e,...n}=t;this._blocks.forEach((i,r)=>i.state=e[r]),super.state=n}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+=e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+=e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+=e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new g;let n=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(n==null)return e;this._blocks[n].isFilled&&++n;for(let i=n;i<this._blocks.length;++i){const r=this._blocks[i]._appendEager();if(!r.inserted)break;e.aggregate(r)}return e}_appendCharRaw(t,e){e===void 0&&(e={});const n=this._mapPosToBlock(this.displayValue.length),i=new g;if(!n)return i;for(let c=n.index,u;u=this._blocks[c];++c){var r;const l=u._appendChar(t,{...e,_beforeTailState:(r=e._beforeTailState)==null||(r=r._blocks)==null?void 0:r[c]});if(i.aggregate(l),l.consumed)break}return i}extractTail(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const n=new L;return t===e||this._forEachBlocksInRange(t,e,(i,r,c,u)=>{const l=i.extractTail(c,u);l.stop=this._findStopBefore(r),l.from=this._blockStartPos(r),l instanceof L&&(l.blockIndex=r),n.extend(l)}),n}extractInput(t,e,n){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),n===void 0&&(n={}),t===e)return"";let i="";return this._forEachBlocksInRange(t,e,(r,c,u,l)=>{i+=r.extractInput(u,l,n)}),i}_findStopBefore(t){let e;for(let n=0;n<this._stops.length;++n){const i=this._stops[n];if(i<=t)e=i;else break}return e}_appendPlaceholder(t){const e=new g;if(this.lazy&&t==null)return e;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return e;const i=n.index,r=t??this._blocks.length;return this._blocks.slice(i,r).forEach(c=>{if(!c.lazy||t!=null){var u;e.aggregate(c._appendPlaceholder((u=c._blocks)==null?void 0:u.length))}}),e}_mapPosToBlock(t){let e="";for(let n=0;n<this._blocks.length;++n){const i=this._blocks[n],r=e.length;if(e+=i.displayValue,t<=e.length)return{index:n,offset:t-r}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((e,n)=>e+=n.displayValue.length,0)}_forEachBlocksInRange(t,e,n){e===void 0&&(e=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const r=this._mapPosToBlock(e),c=r&&i.index===r.index,u=i.offset,l=r&&c?r.offset:this._blocks[i.index].displayValue.length;if(n(this._blocks[i.index],i.index,u,l),r&&!c){for(let f=i.index+1;f<r.index;++f)n(this._blocks[f],f,0,this._blocks[f].displayValue.length);n(this._blocks[r.index],r.index,0,r.offset)}}}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const n=super.remove(t,e);return this._forEachBlocksInRange(t,e,(i,r,c,u)=>{n.aggregate(i.remove(c,u))}),n}nearestInputPos(t,e){if(e===void 0&&(e=d.NONE),!this._blocks.length)return 0;const n=new Xe(this,t);if(e===d.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(e===d.LEFT||e===d.FORCE_LEFT){if(e===d.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===t)return t;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),e===d.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=t||(n.popState(),n.ok&&n.pos<=t))return n.pos;n.popState()}return n.ok?n.pos:e===d.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return e===d.RIGHT||e===d.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:e===d.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(t,d.LEFT))):t}totalInputPositions(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);let n=0;return this._forEachBlocksInRange(t,e,(i,r,c,u)=>{n+=i.totalInputPositions(c,u)}),n}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(n=>this._blocks[n]):[]}pad(t){const e=new g;return this._forEachBlocksInRange(0,this.displayValue.length,n=>e.aggregate(n.pad(t))),e}}y.DEFAULTS={...F.DEFAULTS,lazy:!0,placeholderChar:"_"};y.STOP_CHAR="`";y.ESCAPE_CHAR="\\";y.InputDefinition=se;y.FixedDefinition=be;p.MaskedPattern=y;class W extends y{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:n=this.from||0,maxLength:i=this.maxLength||0,autofix:r=this.autofix,...c}=t;this.to=e,this.from=n,this.maxLength=Math.max(String(e).length,i),this.autofix=r;const u=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let f=0;for(;f<l.length&&l[f]===u[f];)++f;c.mask=l.slice(0,f).replace(/0/g,"\\0")+"0".repeat(this.maxLength-f),super._update(c)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let e="",n="";const[,i,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];return r&&(e="0".repeat(i.length)+r,n="9".repeat(i.length)+r),e=e.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[e,n]}doPrepareChar(t,e){e===void 0&&(e={});let n;return[t,n]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(n.skip=!this.isComplete),[t,n]}_appendCharRaw(t,e){if(e===void 0&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const n=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[r,c]=this.boundaries(this.value+t);return Number(c)<this.from?super._appendCharRaw(n[this.value.length],e):Number(r)>this.to?!e.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(i[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(e.search(/[^0]/)===-1&&e.length<=this._matchFrom)return!0;const[n,i]=this.boundaries(e);return this.from<=Number(i)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){const e=new g;if(this.value.length===this.maxLength)return e;const n=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let r=0;r<i;++r)e.aggregate(super._appendCharRaw("0",t));n.split("").forEach(r=>this._appendCharRaw(r))}return e}}p.MaskedRange=W;const Je="d{.}`m{.}`Y";class I extends y{static extractPatternOptions(t){const{mask:e,pattern:n,...i}=t;return{...i,mask:P(e)?e:n}}constructor(t){super(I.extractPatternOptions({...I.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:n,blocks:i,...r}={...I.DEFAULTS,...t},c=Object.assign({},I.GET_DEFAULT_BLOCKS());t.min&&(c.Y.from=t.min.getFullYear()),t.max&&(c.Y.to=t.max.getFullYear()),t.min&&t.max&&c.Y.from===c.Y.to&&(c.m.from=t.min.getMonth()+1,c.m.to=t.max.getMonth()+1,c.m.from===c.m.to&&(c.d.from=t.min.getDate(),c.d.to=t.max.getDate())),Object.assign(c,this.blocks,i),super._update({...r,mask:P(e)?e:n,blocks:c})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&e!=null&&(this.min==null||this.min<=e)&&(this.max==null||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(I.extractPatternOptions(t))}}I.GET_DEFAULT_BLOCKS=()=>({d:{mask:W,from:1,to:31,maxLength:2},m:{mask:W,from:1,to:12,maxLength:2},Y:{mask:W,from:1900,to:9999}});I.DEFAULTS={...y.DEFAULTS,mask:Date,pattern:Je,format:(k,t)=>{if(!k)return"";const e=String(k.getDate()).padStart(2,"0"),n=String(k.getMonth()+1).padStart(2,"0"),i=k.getFullYear();return[e,n,i].join(".")},parse:(k,t)=>{const[e,n,i]=k.split(".").map(Number);return new Date(i,n-1,e)}};p.MaskedDate=I;class ue extends F{constructor(t){super({...ue.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(e=>{const{expose:n,...i}=Z(e),r=T({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return n&&(this.exposeMask=r),r}):[])}_appendCharRaw(t,e){e===void 0&&(e={});const n=this._applyDispatch(t,e);return this.currentMask&&n.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),n}_applyDispatch(t,e,n){t===void 0&&(t=""),e===void 0&&(e={}),n===void 0&&(n="");const i=e.tail&&e._beforeTailState!=null?e._beforeTailState._value:this.value,r=this.rawInputValue,c=e.tail&&e._beforeTailState!=null?e._beforeTailState._rawInputValue:r,u=r.slice(c.length),l=this.currentMask,f=new g,o=l?.state;return this.currentMask=this.doDispatch(t,{...e},n),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),c&&(this.currentMask.append(c,{raw:!0}),f.tailShift=this.currentMask.value.length-i.length),u&&(f.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),f}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new g;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,n;return{...t,_beforeTailState:((e=t._beforeTailState)==null?void 0:e.currentMaskRef)===this.currentMask&&((n=t._beforeTailState)==null?void 0:n.currentMask)||t._beforeTailState}}doDispatch(t,e,n){return e===void 0&&(e={}),n===void 0&&(n=""),this.dispatch(t,this,e,n)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){e===void 0&&(e={});let[n,i]=super.doPrepare(t,e);if(this.currentMask){let r;[n,r]=super.doPrepare(n,this.currentMaskFlags(e)),i=i.aggregate(r)}return[n,i]}doPrepareChar(t,e){e===void 0&&(e={});let[n,i]=super.doPrepareChar(t,e);if(this.currentMask){let r;[n,r]=super.doPrepareChar(n,this.currentMaskFlags(e)),i=i.aggregate(r)}return[n,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,e){const n=new g;return this.currentMask&&n.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),n}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:n,currentMask:i,...r}=t;e&&this.compiledMasks.forEach((c,u)=>c.state=e[u]),n!=null&&(this.currentMask=n,this.currentMask.state=i),super.state=r}extractInput(t,e,n){return this.currentMask?this.currentMask.extractInput(t,e,n):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,n)=>{if(!t[n])return;const{mask:i,...r}=t[n];return te(e,r)&&e.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var e;return!!((e=this.currentMask)!=null&&e.typedValueEquals(t))}}ue.DEFAULTS={...F.DEFAULTS,dispatch:(k,t,e,n)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,r=t.compiledMasks.map((c,u)=>{const l=t.currentMask===c,f=l?c.displayValue.length:c.nearestInputPos(c.displayValue.length,d.FORCE_LEFT);return c.rawInputValue!==i?(c.reset(),c.append(i,{raw:!0})):l||c.remove(f),c.append(k,t.currentMaskFlags(e)),c.appendTail(n),{index:u,weight:c.rawInputValue.length,totalInputPositions:c.totalInputPositions(0,Math.max(f,c.nearestInputPos(c.displayValue.length,d.FORCE_LEFT)))}});return r.sort((c,u)=>u.weight-c.weight||u.totalInputPositions-c.totalInputPositions),t.compiledMasks[r[0].index]}};p.MaskedDynamic=ue;class ne extends y{constructor(t){super({...ne.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...n}=t;if(e){const i=e.map(u=>u.length),r=Math.min(...i),c=Math.max(...i)-r;n.mask="*".repeat(r),c&&(n.mask+="["+"*".repeat(c)+"]"),this.enum=e}super._update(n)}_appendCharRaw(t,e){e===void 0&&(e={});const n=Math.min(this.nearestInputPos(0,d.FORCE_RIGHT),this.value.length),i=this.enum.filter(r=>this.matchValue(r,this.unmaskedValue+t,n));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(c,u)=>{const l=i[0][u];u>=this.value.length||l===c.value||(c.reset(),c._appendChar(l,e))});const r=super._appendCharRaw(i[0][this.value.length],e);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(c=>r.aggregate(super._appendCharRaw(c))),r}return new g({skip:!this.isComplete})}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new D("",t)}remove(t,e){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),t===e)return new g;const n=Math.min(super.nearestInputPos(0,d.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(c=>this.matchValue(c,this.value.slice(n,i),n)).length>1);--i);const r=super.remove(i,e);return r.tailShift+=i-t,r}get isComplete(){return this.enum.indexOf(this.value)>=0}}ne.DEFAULTS={...y.DEFAULTS,matchValue:(k,t,e)=>k.indexOf(t,e)===e};p.MaskedEnum=ne;class Qe extends F{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}p.MaskedFunction=Qe;var xe;class S extends F{constructor(t){super({...S.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e="\\d*",n=(this.scale?"("+oe(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+e+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(oe).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(oe(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){e===void 0&&(e={});const[n,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!n&&(i.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&i.aggregate(this._appendChar("-")),[n,i]}_separatorsCount(t,e){e===void 0&&(e=!1);let n=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++n,e&&(t+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,n))}_appendCharRaw(t,e){e===void 0&&(e={});const n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const r=this._value;this._value+=t;const c=this.number;let u=!isNaN(c),l=!1;if(u){let a;this.min!=null&&this.min<0&&this.number<this.min&&(a=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(a=this.max),a!=null&&(this.autofix?(this._value=this.format(a,this).replace(S.UNMASKED_RADIX,this.radix),l||(l=r===this._value&&!e.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let f;u?f=new g({inserted:this._value.slice(r.length),rawInserted:l?"":t,skip:l}):(this._value=r,f=new g),this._value=this._insertThousandsSeparators(this._value);const o=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return f.tailShift+=(s-i)*this.thousandsSeparator.length,f}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,e);if(n<=t)return n}return-1}_adjustRangeWithSeparators(t,e){const n=this._findSeparatorAround(t);n>=0&&(t=n);const i=this._findSeparatorAround(e);return i>=0&&(e=i+this.thousandsSeparator.length),[t,e]}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const n=this.value.slice(0,t),i=this.value.slice(e),r=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+i));const c=this._separatorsCountFromSlice(n);return new g({tailShift:(c-r)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case d.NONE:case d.LEFT:case d.FORCE_LEFT:{const n=this._findSeparatorAround(t-1);if(n>=0){const i=n+this.thousandsSeparator.length;if(t<i||this.value.length<=i||e===d.FORCE_LEFT)return n}break}case d.RIGHT:case d.FORCE_RIGHT:{const n=this._findSeparatorAround(t);if(n>=0)return n+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;this.min!=null&&(e=Math.max(e,this.min)),this.max!=null&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(n,i,r,c)=>i+c),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,n){e===void 0&&(e={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===S.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,n)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,S.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(S.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||S.EMPTY_VALUES.includes(t)&&S.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}xe=S;S.UNMASKED_RADIX=".";S.EMPTY_VALUES=[...F.EMPTY_VALUES,0];S.DEFAULTS={...F.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[xe.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:k=>k.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};p.MaskedNumber=S;const de={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Se(k,t,e){t===void 0&&(t=de.MASKED),e===void 0&&(e=de.MASKED);const n=T(k);return i=>n.runIsolated(r=>(r[t]=i,r[e]))}function et(k,t,e,n){return Se(t,e,n)(k)}p.PIPE_TYPE=de;p.createPipe=Se;p.pipe=et;class tt extends y{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,n,i;const{repeat:r,...c}=Z(t);this._blockOpts=Object.assign({},this._blockOpts,c);const u=T(this._blockOpts);this.repeat=(e=(n=r??u.repeat)!=null?n:this.repeat)!=null?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(T(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,e){e===void 0&&(e={});const n=new g;for(let l=(i=(r=this._mapPosToBlock(this.displayValue.length))==null?void 0:r.index)!=null?i:Math.max(this._blocks.length-1,0),f,o;f=(c=this._blocks[l])!=null?c:o=!o&&this._allocateBlock(l);++l){var i,r,c,u;const s=f._appendChar(t,{...e,_beforeTailState:(u=e._beforeTailState)==null||(u=u._blocks)==null?void 0:u[l]});if(s.skip&&o){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(s),s.consumed)break}return n}_trimEmptyTail(t,e){var n,i;t===void 0&&(t=0);const r=Math.max(((n=this._mapPosToBlock(t))==null?void 0:n.index)||0,this.repeatFrom,0);let c;e!=null&&(c=(i=this._mapPosToBlock(e))==null?void 0:i.index),c==null&&(c=this._blocks.length-1);let u=0;for(let l=c;r<=l&&!this._blocks[l].unmaskedValue;--l,++u);u&&(this._blocks.splice(c-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const n=super.remove(t,e);return this._trimEmptyTail(t,e),n}totalInputPositions(t,e){return t===void 0&&(t=0),e==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}p.RepeatBlock=tt;try{globalThis.IMask=p}catch{}var st={mask:void 0,prepare:Function,prepareChar:Function,validate:Function,commit:Function,overwrite:{type:Boolean,required:!1,default:void 0},eager:{required:!1,default:void 0,validator:k=>["append","remove"].includes(k)||typeof k=="boolean"},skipInvalid:{type:Boolean,required:!1,default:void 0},placeholderChar:String,displayChar:String,lazy:{type:Boolean,required:!1,default:void 0},definitions:Object,blocks:Object,enum:Array,maxLength:Number,from:Number,to:Number,pattern:String,format:Function,parse:Function,autofix:{required:!1,default:void 0,validator:k=>k==="pad"||typeof k=="boolean"},radix:String,thousandsSeparator:String,mapToRadix:Array,scale:Number,normalizeZeros:{type:Boolean,required:!1,default:void 0},padFractionalZeros:{type:Boolean,required:!1,default:void 0},min:[Number,Date],max:[Number,Date],dispatch:Function};function it(k,t){let{emit:e,onAccept:n,onComplete:i,defaultValue:r,defaultUnmaskedValue:c,defaultTypedValue:u}=t===void 0?{}:t;const l=vue.isRef(k)?k:vue.ref(k),f=vue.ref(),o=vue.ref(),s=vue.ref(""),a=vue.ref(""),h=vue.ref();let m,v=s.value,b=a.value,_=h.value;function w(){_=h.value=o.value.typedValue,b=a.value=o.value.unmaskedValue,v=s.value=o.value.value}function j(z){w(),e&&(e("accept",s.value,z),e("accept:masked",s.value,z),e("accept:typed",h.value,z),e("accept:unmasked",a.value,z)),n?.(z)}function E(z){e&&(e("complete",o.value.value,z),e("complete:masked",o.value.value,z),e("complete:typed",o.value.typedValue,z),e("complete:unmasked",o.value.unmaskedValue,z)),i?.(z)}const A=()=>{!o.value||a.value===void 0||(b!==a.value&&(o.value.unmaskedValue=a.value,o.value.unmaskedValue!==a.value&&j()),b=void 0)};vue.watch(a,A);const O=()=>{!o.value||s.value===void 0||(v!==s.value&&(o.value.value=s.value,o.value.value!==s.value&&j()),v=void 0)};vue.watch(s,O);const M=()=>{!o.value||h.value===void 0||(_!==h.value&&(o.value.typedValue=h.value,o.value.masked.typedValueEquals(h.value)||j()),_=void 0)};vue.watch(h,M);function C(){m=f.value;const z=l.value;!m||!(z!=null&&z.mask)||(o.value=p(m,z),r!==void 0&&(s.value=r),c!==void 0&&(a.value=c),u!==void 0&&(h.value=u),A(),O(),M(),w(),o.value.on("accept",j).on("complete",E))}function N(){var z;(z=o.value)==null||z.destroy(),o.value=void 0}return vue.onMounted(C),vue.onUnmounted(N),vue.watch([f,l],()=>{const z=f.value,B=l.value;(!(B!=null&&B.mask)||z!==m)&&N(),z&&(o.value?o.value.updateOptions(B):C())}),{el:f,mask:vue.readonly(o),masked:s,unmasked:a,typed:h}}function at(k,t){return k={...k},Object.keys(k).forEach(e=>{(k[e]===void 0||t.includes(e))&&delete k[e]}),k}const ut=["typed","unmasked","value","modelValue"];var nt=vue.defineComponent({name:"imask-input",inheritAttrs:!1,props:{modelValue:String,value:String,unmasked:String,typed:{validator:()=>!0},...st},emits:["update:modelValue","update:masked","update:value","update:unmasked","update:typed","accept","accept:value","accept:masked","accept:unmasked","accept:typed","complete","complete:value","complete:masked","complete:unmasked","complete:typed"],setup(k,t){let{attrs:e,emit:n}=t;const{el:i,mask:r,masked:c,unmasked:u,typed:l}=it(at(k,ut),{emit:n,onAccept:h=>{const m=c.value;n("accept:value",m,h),n("update:value",m,h),n("update:masked",m,h),n("update:modelValue",m,h),n("update:unmasked",u.value,h),n("update:typed",l.value,h)},onComplete:h=>{n("complete:value",c.value,h)}}),f=vue.toRef(k,"value"),o=vue.toRef(k,"modelValue"),s=vue.toRef(k,"unmasked"),a=vue.toRef(k,"typed");return c.value=o.value||f.value||"",u.value=s.value||"",l.value=a.value,vue.watch(f,h=>c.value=h),vue.watch(o,h=>c.value=h),vue.watch(s,h=>u.value=h),vue.watch(a,h=>l.value=h),()=>{const h={...e,value:k.value!=null?k.value:k.modelValue!=null?k.modelValue:r.value?r.value.displayValue:"",ref:i};return k.mask||(h.onInput=m=>{n("update:modelValue",m.target.value),n("update:value",m.target.value)}),vue.h("input",h)}}}),rt=nt;const lt=["for"],ot={class:"state-layer"},ht={class:"content"},dt={class:"input-text-container"},pt=["id","placeholder","aria-label"],ct={key:1,class:"has-text-body-small phila-supporting-text"},mt={key:2,class:"has-text-body-small phila-error-text"},gt=vue.defineComponent({inheritAttrs:!1,__name:"TextField",props:{modelValue:{default:void 0},className:{default:""},label:{default:""},id:{default:`phila-text-field-${Math.random().toString(36).substring(2,9)}`},imaskProps:{default:void 0},supportingText:{default:""},placeholder:{default:""},leadingIcon:{type:[Function,Object],default:void 0},trailingIcon:{type:[Function,Object],default:void 0},error:{default(){return[]}}},emits:["update:modelValue","complete"],setup(k,{expose:t,emit:e}){const n=vue.useAttrs(),i=k,r=vue.computed(()=>typeof i.error=="string"?i.error:i.error[0]),c=vue.toRef(i,"id"),u=e,l=vue.ref(""),f=vue.computed({get:()=>i.modelValue!==void 0?i.modelValue:l.value,set:v=>{u("update:modelValue",v),l.value=v}}),o=vue.computed(()=>{const v=["default-class"];return n.disabled!=null&&v.push("phila-input--disabled"),r.value&&v.push("phila-input--error"),n.required!=null&&v.push("phila-input--required"),philaUiCore.cn(...v)}),s=vue.computed(()=>{const v=[];return f.value!==""&&v.push("phila-text-field--filled"),i.className&&v.push(i.className),philaUiCore.cn(...v)}),a=vue.computed(()=>{if(!(i.label||n["aria-label"]))return i.placeholder||void 0}),h=vue.ref(null),m=v=>{v.target.closest("button")||h.value?.focus()};return t({inputRef:h}),(v,b)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["phila-input",o.value])},[i.label?(vue.openBlock(),vue.createElementBlock("label",{key:0,for:c.value,class:"has-text-label-small phila-label"},vue.toDisplayString(i.label),9,lt)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["phila-text-field",s.value]),onClick:vue.withModifiers(m,["prevent"])},[vue.createElementVNode("div",ot,[i.leadingIcon?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.Icon),{key:0,icon:i.leadingIcon,inline:"",decorative:""},null,8,["icon"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",ht,[vue.createElementVNode("div",dt,[i.imaskProps?.mask?(vue.openBlock(),vue.createBlock(vue.unref(rt),vue.mergeProps({key:0},{...vue.unref(n),...i.imaskProps},{id:c.value,modelValue:f.value,"onUpdate:modelValue":b[0]||(b[0]=_=>f.value=_),class:"phila-text-field-input has-text-body-default",placeholder:i.placeholder,onComplete:b[1]||(b[1]=()=>u("complete",l.value))}),null,16,["id","modelValue","placeholder"])):vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",vue.mergeProps({key:1,id:c.value,ref_key:"inputRef",ref:h},vue.unref(n),{"onUpdate:modelValue":b[2]||(b[2]=_=>f.value=_),class:"phila-text-field-input has-text-body-default",placeholder:i.placeholder,"aria-label":a.value}),null,16,pt)),[[vue.vModelDynamic,f.value]])])]),f.value!=""?(vue.openBlock(),vue.createBlock(vue.unref(He),{key:1,variant:"standard",size:"small","icon-only":"",icon:vue.unref(icons.IconClose),onClick:b[3]||(b[3]=_=>f.value="")},null,8,["icon"])):vue.createCommentVNode("",!0),i.trailingIcon?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.Icon),{key:2,size:"small",icon:i.trailingIcon,inline:"",decorative:""},null,8,["icon"])):vue.createCommentVNode("",!0),vue.renderSlot(v.$slots,"trailing-action")])],2),i.supportingText?(vue.openBlock(),vue.createElementBlock("div",ct,vue.toDisplayString(i.supportingText),1)):vue.createCommentVNode("",!0),r.value?(vue.openBlock(),vue.createElementBlock("div",mt,[vue.createVNode(vue.unref(philaUiCore.Icon),{icon:vue.unref(icons.IconCircleExclamation),size:"small",inline:"",decorative:""},null,8,["icon"]),vue.createTextVNode(" "+vue.toDisplayString(r.value),1)])):vue.createCommentVNode("",!0)],2))}}),ft=["disabled"],kt=vue.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},icon:{},src:{},svgRaw:{}},setup(k){const t=k,e=c=>"href"in c&&c.href!==void 0||"to"in c&&c.to!==void 0,n=vue.computed(()=>philaUiCore.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),i=vue.computed(()=>e(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:n.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:n.value}:{}),r=vue.computed(()=>({icon:t.icon,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(c,u)=>e(t)?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.BaseLink),vue.mergeProps({key:0},{...i.value,...c.$attrs},{role:"button"}),{default:vue.withCtx(()=>[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(vue.openBlock(),vue.createElementBlock("button",vue.mergeProps({key:1,type:"button",disabled:t.disabled,class:n.value},c.$attrs),[vue.createVNode(vue.unref(philaUiCore.ActionContent),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[vue.renderSlot(c.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(t.text),1)])]),_:3},16)],16,ft))}}),vt={key:0,class:"search-suggestions-anchor"},_t=["onClick"],Ct=vue.defineComponent({__name:"SearchSuggestions",props:{suggestions:{}},emits:["select","dismiss"],setup(k,{expose:t,emit:e}){const n=k,i=e,r=vue.ref(-1),c=vue.ref(null);vue.watch(()=>n.suggestions,()=>{r.value=-1});function u(o){c.value?.querySelectorAll(".search-suggestion")?.[o]?.focus()}function l(){n.suggestions.length&&(r.value=0,u(0))}function f(o){switch(o.key){case"ArrowDown":{o.preventDefault();const s=Math.min(r.value+1,n.suggestions.length-1);r.value=s,u(s);break}case"ArrowUp":{o.preventDefault(),r.value<=0?(r.value=-1,i("dismiss")):(r.value-=1,u(r.value));break}case"Enter":{o.preventDefault(),r.value>=0&&i("select",n.suggestions[r.value]);break}case"Escape":{o.preventDefault(),i("dismiss");break}}}return t({focusFirst:l}),(o,s)=>k.suggestions.length?(vue.openBlock(),vue.createElementBlock("div",vt,[vue.createElementVNode("ul",{ref_key:"listRef",ref:c,class:"search-suggestions",role:"listbox",onKeydown:f},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.suggestions,(a,h)=>(vue.openBlock(),vue.createElementBlock("li",{key:a,class:vue.normalizeClass(["search-suggestion",{"search-suggestion--active":h===r.value}]),role:"option",tabindex:"-1",onClick:m=>i("select",a)},vue.toDisplayString(a),11,_t))),128))],544)])):vue.createCommentVNode("",!0)}}),Et=(k,t)=>{const e=k.__vccOpts||k;for(const[n,i]of t)e[n]=i;return e},At=Et(Ct,[["__scopeId","data-v-79ffafa6"]]),xt=vue.defineComponent({inheritAttrs:!1,__name:"Search",props:{modelValue:{default:void 0},placeholder:{default:"Search by title or keyword"},suggestions:{default:()=>[]},elevated:{type:Boolean,default:!1},className:{}},emits:["update:modelValue","search","select","dismiss"],setup(k,{expose:t,emit:e}){const n=vue.useAttrs(),i=k,r=e,c=vue.ref(null),u=vue.ref(null),l=vue.computed({get:()=>i.modelValue,set:b=>r("update:modelValue",b)}),f=vue.computed(()=>n["aria-label"]),o=vue.computed(()=>Object.fromEntries(Object.entries(n).filter(([b])=>b!=="aria-label"))),s=vue.computed(()=>philaUiCore.cn("default-class",i.elevated&&"is-elevated",i.className));function a(){c.value?.inputRef?.focus()}function h(b){b.key==="ArrowDown"&&i.suggestions.length>0&&b.target instanceof HTMLInputElement&&(b.preventDefault(),u.value?.focusFirst())}function m(b){r("update:modelValue",b),r("select",b)}function v(){r("dismiss"),a()}return t({focus:a}),(b,_)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps({class:["search",s.value]},o.value,{onKeydown:h}),[vue.createVNode(vue.unref(gt),{ref_key:"textFieldRef",ref:c,modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=w=>l.value=w),"class-name":"phila-text-field--search",placeholder:k.placeholder,"aria-label":f.value,onKeydown:_[2]||(_[2]=vue.withKeys(w=>r("search"),["enter"]))},{"trailing-action":vue.withCtx(()=>[vue.createVNode(vue.unref(kt),{variant:"standard",size:"small","icon-only":"",icon:vue.unref(icons.IconMagnifyingGlass),"aria-label":"Search","class-name":"phila-button--search",onClick:_[0]||(_[0]=w=>r("search"))},null,8,["icon"])]),_:1},8,["modelValue","placeholder","aria-label"]),i.suggestions.length>0?(vue.openBlock(),vue.createBlock(At,{key:0,ref_key:"suggestionsRef",ref:u,suggestions:i.suggestions,onSelect:m,onDismiss:v},null,8,["suggestions"])):vue.createCommentVNode("",!0)],16))}}),_hoisted_1$f=["aria-busy"],_hoisted_2$8={key:0,role:"alert",class:"map-search-error"},_hoisted_3$7={"aria-live":"polite",class:"sr-only"},_hoisted_4$4={key:0},_sfc_main$q=vue.defineComponent({__name:"MapSearchControl",props:{position:{default:"top-left"},placeholder:{default:"Search for an address"},geocode:{type:Boolean,default:!0},centerOnResult:{type:Boolean,default:!0},searchZoom:{default:17},teleportTo:{default:void 0},autocomplete:{type:Boolean,default:!1}},emits:["search","result","error"],setup(k,{expose:t,emit:e}){const n=k,i=e,r=vue.inject("map"),c=vue.ref(""),u=vue.ref(!1),l=vue.ref(null),f=vue.ref(null),o=vue.ref(null),s=n.autocomplete?useMapControl.useAisAddressSuggestions(c):null,a=vue.computed(()=>s?s.searchSuggestions.value:[]),h=async()=>{const j=c.value.trim();if(i("search",j),!!j&&n.geocode){u.value=!0,l.value=null;try{const A=await(await fetch(`https://api.phila.gov/ais/v1/search/${encodeURIComponent(j)}?include_units=false`)).json();if(A.features&&A.features.length>0){const O=A.features[0];if(i("result",O),n.centerOnResult&&r?.value&&O.geometry?.coordinates){const[M,C]=O.geometry.coordinates;r.value.setCenter([M,C]),r.value.setZoom(n.searchZoom)}}else l.value="No results found",i("error",l.value)}catch(E){l.value=E instanceof Error?E.message:"Failed to geocode address",i("error",l.value)}finally{u.value=!1}}};function m(j){s&&(c.value=j,s.dismissSuggestions(),h())}function v(){s&&s.hideSuggestions()}function b(j){!s||s.searchSuggestions.value.length===0||f.value&&!f.value.contains(j.target)&&s.hideSuggestions()}vue.onMounted(()=>{s&&document.addEventListener("mousedown",b)}),vue.onBeforeUnmount(()=>{s&&document.removeEventListener("mousedown",b)});const _=vue.inject("controlCorners",{}),w=vue.computed(()=>n.teleportTo?n.teleportTo:_[n.position??"top-left"]?.value??null);return t({loading:u,error:l,searchQuery:c}),(j,E)=>w.value?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:w.value},[vue.createElementVNode("div",{ref_key:"containerRef",ref:f,class:"maplibregl-ctrl map-search-control",role:"search","aria-label":"Search for an address","aria-busy":u.value},[vue.createVNode(vue.unref(xt),{ref_key:"searchRef",ref:o,modelValue:c.value,"onUpdate:modelValue":E[0]||(E[0]=A=>c.value=A),placeholder:n.placeholder,suggestions:a.value,"aria-label":"Search the map",onSearch:h,onSelect:m,onDismiss:v},null,8,["modelValue","placeholder","suggestions"]),l.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$8,"⚠ "+vue.toDisplayString(l.value),1)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$7,[u.value?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$4,"Searching...")):vue.createCommentVNode("",!0)])],8,_hoisted_1$f)],8,["to"])):vue.createCommentVNode("",!0)}});function useControlTarget(k,t){const e=vue.inject("controlCorners",{});return vue.computed(()=>vue.toValue(t)??e[vue.toValue(k)??"top-right"]?.value??null)}const _hoisted_1$e=["title","aria-label","aria-pressed"],_sfc_main$p=vue.defineComponent({inheritAttrs:!1,__name:"MapButton",props:{icon:{default:void 0},image:{default:""},imagePadding:{default:0},position:{default:"top-right"},title:{default:""},iconSize:{default:void 0},size:{default:void 0},toggleable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},activeColor:{default:"#ffcc80"},teleportTo:{default:void 0},className:{}},emits:["click"],setup(k,{emit:t}){const e=k,n=t,i=vue.useSlots(),r=useControlTarget(()=>e.position,()=>e.teleportTo),c=()=>{n("click")},u=vue.computed(()=>{const o=i.default?.();return o?o.some(s=>s.type!==vue.Comment&&!(s.type===vue.Text&&!String(s.children).trim())):!1}),l=vue.computed(()=>e.position?.includes("right")),f=vue.computed(()=>{const o={};return e.image&&(o.backgroundImage=`url("${e.image}")`,o.backgroundPosition="center",o.backgroundRepeat="no-repeat",e.imagePadding>0?(o.backgroundSize="contain",o.backgroundOrigin="content-box",o.padding=`${e.imagePadding}px`):o.backgroundSize="cover"),e.toggleable&&e.active&&(o.backgroundColor=e.activeColor),o});return vue.onMounted(()=>{}),(o,s)=>vue.unref(r)?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:vue.unref(r)},[vue.createElementVNode("div",{class:vue.normalizeClass(["maplibregl-ctrl",[u.value?"map-button-wrapper":"maplibregl-ctrl-group",o.$attrs.class]])},[l.value?vue.renderSlot(o.$slots,"default",{key:0}):vue.createCommentVNode("",!0),vue.createElementVNode("button",{class:vue.normalizeClass(["map-button",[{"has-image":e.image},e.size?`is-${e.size}`:null]]),type:"button",title:e.title,"aria-label":e.title,"aria-pressed":e.toggleable?String(e.active):void 0,style:vue.normalizeStyle(f.value),onClick:c},[e.icon&&!e.image?(vue.openBlock(),vue.createBlock(vue.unref(philaUiCore.Icon),{key:0,icon:e.icon,decorative:"",inline:"",style:vue.normalizeStyle(e.iconSize!==void 0?{fontSize:`${e.iconSize}px`}:void 0)},null,8,["icon","style"])):vue.createCommentVNode("",!0)],14,_hoisted_1$e),l.value?vue.createCommentVNode("",!0):vue.renderSlot(o.$slots,"default",{key:1})],2)],8,["to"])):vue.createCommentVNode("",!0)}}),_hoisted_1$d=["title","aria-expanded"],_hoisted_2$7={class:"dropdown-label"},_hoisted_3$6=["aria-checked","tabindex","onClick"],_sfc_main$o=vue.defineComponent({__name:"BasemapDropdown",props:{options:{},position:{default:"top-right"},selectedIndex:{default:0},useAsControl:{type:Boolean,default:!0},isDropUp:{type:Boolean,default:!1},teleportTo:{default:void 0}},emits:["select"],setup(k,{expose:t,emit:e}){const n=vue.inject("handleBasemapChange",null),i=k,r=e,c=vue.ref(!1),u=vue.ref(i.selectedIndex),l=vue.ref(-1),f=vue.ref(null),o=vue.ref(null),s=vue.ref([]),a=vue.computed(()=>i.options[u.value]),h=vue.computed(()=>i.useAsControl?i.position?.includes("bottom")||!1:i.isDropUp),m=vue.inject("controlCorners",{}),v=vue.computed(()=>i.useAsControl?i.teleportTo?i.teleportTo:m[i.position??"top-right"]?.value??null:null);function b(){c.value=!c.value,c.value?(l.value=u.value,vue.nextTick(()=>w(l.value))):l.value=-1}function _(){c.value=!1,l.value=-1,o.value?.focus()}function w(C){s.value[C]?.focus()}function j(C){(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),c.value||(c.value=!0,l.value=u.value,vue.nextTick(()=>w(l.value))))}function E(C){switch(C.key){case"Escape":C.preventDefault(),_();break;case"ArrowDown":C.preventDefault(),l.value=(l.value+1)%i.options.length,w(l.value);break;case"ArrowUp":C.preventDefault(),l.value=(l.value-1+i.options.length)%i.options.length,w(l.value);break;case"Home":C.preventDefault(),l.value=0,w(l.value);break;case"End":C.preventDefault(),l.value=i.options.length-1,w(l.value);break;case"Tab":_();break}}function A(C,N){C&&(s.value[N]=C)}function O(C,N){if(u.value=N,c.value=!1,l.value=-1,o.value?.focus(),r("select",C,N),n){const z={showImagery:!0,imageryUrl:C.imageryUrl,imageryLabelsUrl:C.imageryLabelsUrl,showLabels:C.showLabels??!0};n(z)}}function M(C){f.value&&!f.value.contains(C.target)&&(c.value=!1,l.value=-1)}return vue.onMounted(()=>{if(document.addEventListener("click",M),n&&i.options.length>0){const C=i.options[u.value];if(C){const N={showImagery:!0,imageryUrl:C.imageryUrl,imageryLabelsUrl:C.imageryLabelsUrl,showLabels:C.showLabels??!0};n(N)}}}),vue.onBeforeUnmount(()=>{document.removeEventListener("click",M)}),t({isOpen:c,selectedIndex:u,selectedOption:a,toggleDropdown:b,closeDropdown:_}),(C,N)=>(vue.openBlock(),vue.createBlock(vue.Teleport,{to:v.value??"body",disabled:!v.value},[vue.createElementVNode("div",{ref_key:"containerRef",ref:f,class:vue.normalizeClass(["basemap-dropdown-control-wrapper",{"maplibregl-ctrl":k.useAsControl,"drop-up":h.value,"standalone-control":k.useAsControl,"embedded-control":!k.useAsControl}])},[vue.createElementVNode("button",{ref_key:"toggleRef",ref:o,class:"basemap-dropdown-toggle",title:a.value?.label||"Select basemap","aria-expanded":c.value,"aria-haspopup":"true",onClick:vue.withModifiers(b,["stop"]),onKeydown:j},[vue.createElementVNode("span",_hoisted_2$7,vue.toDisplayString(a.value?.label||"Select"),1),(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(h.value?vue.unref(icons.IconChevronUp):vue.unref(icons.IconChevronDown)),{class:vue.normalizeClass(["dropdown-icon",{open:c.value}]),"aria-hidden":"true"},null,8,["class"]))],40,_hoisted_1$d),c.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"basemap-dropdown-menu",role:"menu",onKeydown:E},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.options,(z,B)=>(vue.openBlock(),vue.createElementBlock("button",{key:B,ref_for:!0,ref:V=>A(V,B),role:"menuitemradio","aria-checked":B===u.value,tabindex:B===l.value?0:-1,class:vue.normalizeClass(["basemap-dropdown-item",{selected:B===u.value}]),onClick:vue.withModifiers(V=>O(z,B),["stop"])},vue.toDisplayString(z.label),11,_hoisted_3$6))),128))],32)):vue.createCommentVNode("",!0)],2)],8,["to","disabled"]))}}),defaultImageryIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxNjoxMTowOSAxNDo0MTowMzVIv04AABSySURBVFhH1Vnpb1zXfT0zb/Z9Hw5nSIqbuJO2RK22bEm2YsuS03hNEydu4wRo+6Ft2qZBULgtg34p2iCJUaAB/KVoGzhwUiiIlchJ7MiKaslaSMkSKVIkxXU4M5x937eed9V/wgNcDERdvnfv757fWS4Vz515vv3is/tRbwBNhQLBcALi024in8nA4zTh8o1lvPNfP0Aqk+U8Jb731n9iqNuB/z53SUwd73NieGQQ711cwLF9vVhaDuKjK3fw9g//Bls7YVyZW0WjXhdzm+U8Hj+yH2/+418jHktCqVDymQ00uYBkMgqXqwPFYlHMbbcBnU4vRiIRg9vTAemZp4/O6DRKKNVGVGsNtFstqFUSGnyIVm9Apa7gRvQ4d/4iHixvIBrZhVGrRKVcxMRgB8YGfDgw2Q+TRoHNzRCG9vbCYLbg9FMHMTHUjSvXbiFXaaJYyPOZdQQ6nXjxc4fQVkrw+bgASQmb1YJmo4p6vQWr1YpCoSgWq9VqoVaroVRyDc0W/IEApD/7xpdnbGYN8iUutJXH4soaMpk0FNz5bjiMrWAY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UpZVrACK5jP4JYK0pEO8+HioS9IlS8ezv77f/AInIHJK+SU/cAAAAAElFTkSuQmCC",imageryLabelsUrl="https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_Labels/MapServer/tile/{z}/{y}/{x}",imageryLabelsSource={tiles:[imageryLabelsUrl],type:"raster",tileSize:256},imageryParcelOutlinesSource={tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/PWDParcel_ImageryOverlay/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},imagerySources={2025:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2025_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2024:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2024_1in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2023:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2023/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2022:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2022_2in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2020:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2020_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2019:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2019_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2018:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2018_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2017:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2017_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2016:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2016_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2015:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2015_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2012:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2012_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2010:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2010_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2008:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2008_3in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},2004:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2004_6in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1996:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_1996_6in/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1962:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricLandUse_1962/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1942:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricLandUse_1942/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1910:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricBromleyAtlas_1910/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1895:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricBromleyAtlas_1895/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1875:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricGMHopkinsAtlas_1875/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},1860:{tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/HistoricHexamerLocherAtlas_1860/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256}},defaultBasemapSource={tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityBasemap/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},defaultLabelsSource={tiles:["https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityBasemap_Labels/MapServer/tile/{z}/{y}/{x}"],type:"raster",tileSize:256},defaultImageryOptions=[{label:"2025",year:"2025",imageryUrl:imagerySources[2025].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2024",year:"2024",imageryUrl:imagerySources[2024].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2023",year:"2023",imageryUrl:imagerySources[2023].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2022",year:"2022",imageryUrl:imagerySources[2022].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2020",year:"2020",imageryUrl:imagerySources[2020].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2019",year:"2019",imageryUrl:imagerySources[2019].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2018",year:"2018",imageryUrl:imagerySources[2018].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2017",year:"2017",imageryUrl:imagerySources[2017].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2016",year:"2016",imageryUrl:imagerySources[2016].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2015",year:"2015",imageryUrl:imagerySources[2015].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2012",year:"2012",imageryUrl:imagerySources[2012].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2010",year:"2010",imageryUrl:imagerySources[2010].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2008",year:"2008",imageryUrl:imagerySources[2008].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"2004",year:"2004",imageryUrl:imagerySources[2004].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"1996",year:"1996",imageryUrl:imagerySources[1996].tiles[0],imageryLabelsUrl,showLabels:!0},{label:"1962",year:"1962",imageryUrl:imagerySources[1962].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1942",year:"1942",imageryUrl:imagerySources[1942].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1910",year:"1910",imageryUrl:imagerySources[1910].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1895",year:"1895",imageryUrl:imagerySources[1895].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1875",year:"1875",imageryUrl:imagerySources[1875].tiles[0],imageryLabelsUrl:null,showLabels:!1},{label:"1860",year:"1860",imageryUrl:imagerySources[1860].tiles[0],imageryLabelsUrl:null,showLabels:!1}],_sfc_main$n=vue.defineComponent({__name:"BasemapToggle",props:{position:{default:"top-right"},imageryUrl:{default:"https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2024_1in/MapServer/tile/{z}/{y}/{x}"},imageryLabelsUrl:{default:"https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_Labels/MapServer/tile/{z}/{y}/{x}"},iconImage:{},basemapImage:{},title:{default:"Toggle Imagery"},size:{},showDropdown:{type:Boolean,default:!1},dropdownOptions:{default:()=>defaultImageryOptions},teleportTo:{default:void 0},className:{}},emits:["change"],setup(k,{emit:t}){const e=vue.inject("handleBasemapChange",null),n=k,i=t,r=vue.ref(!1),c=vue.ref(n.imageryUrl),u=vue.ref(n.imageryLabelsUrl??null),l=vue.ref(n.dropdownOptions?.[0]?.showLabels??!0),f=vue.ref(0),o=vue.ref(n.iconImage??defaultImageryIcon);function s(){r.value=!r.value;let h;r.value?(o.value=n.basemapImage??defaultBasemapIcon,h={showImagery:!0,imageryUrl:c.value,imageryLabelsUrl:u.value,showLabels:l.value}):(o.value=n.iconImage??defaultImageryIcon,h={showImagery:!1,imageryUrl:null,imageryLabelsUrl:null,showLabels:!0}),i("change",h),e&&e(h)}function a(h,m){if(f.value=m,c.value=h.imageryUrl,u.value=h.imageryLabelsUrl,l.value=h.showLabels??!0,r.value){const v={showImagery:!0,imageryUrl:h.imageryUrl,imageryLabelsUrl:h.imageryLabelsUrl,showLabels:h.showLabels??!0};i("change",v),e&&e(v)}}return(h,m)=>(vue.openBlock(),vue.createBlock(_sfc_main$p,{image:o.value,position:n.position,"teleport-to":n.teleportTo,title:n.title,size:n.size,onClick:s},{default:vue.withCtx(()=>[k.showDropdown&&k.dropdownOptions.length>0&&r.value?(vue.openBlock(),vue.createBlock(_sfc_main$o,{key:0,options:k.dropdownOptions,"selected-index":f.value,"use-as-control":!1,"is-drop-up":k.position?.includes("bottom"),onSelect:a},null,8,["options","selected-index","is-drop-up"])):vue.createCommentVNode("",!0)]),_:1},8,["image","position","teleport-to","title","size"]))}}),_sfc_main$m=vue.defineComponent({__name:"MapNavigationControl",props:{position:{default:"top-right"},className:{}},setup(k){const t=k;return useMapControl.useMapControl(t,()=>new maplibregl.NavigationControl),(e,n)=>vue.renderSlot(e.$slots,"default")}}),_sfc_main$l=vue.defineComponent({__name:"GeolocationButton",props:{position:{default:"top-right"},icon:{},iconSize:{},size:{},title:{default:"Show my location"},trackUser:{type:Boolean,default:!1},markerColor:{default:"#4285F4"},showLocationMarker:{type:Boolean,default:!0},deniedMessage:{default:"Location access is off. Enable it for this site in your browser settings."},teleportTo:{default:void 0},className:{}},emits:["located","error","permission-change"],setup(k,{emit:t}){const e=k,n=e.icon||icons.IconLocationCrosshairs,i=t,r=vue.inject("map"),c=vue.ref(!1),u=vue.ref(!1),l=vue.ref(null),f=vue.computed(()=>l.value==="denied");let o=null;const s=vue.ref(!1);let a=null;const h=vue.computed(()=>[e.position?.includes("right")?"place-left":"place-right",e.position?.includes("bottom")?"anchor-bottom":"anchor-top"]),m=()=>{s.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{s.value=!1,a=null},6e3)},v=()=>{a&&(clearTimeout(a),a=null),s.value=!1},b=z=>{l.value=z,i("permission-change",z)};vue.onMounted(async()=>{if(typeof navigator<"u"&&navigator.permissions?.query)try{o=await navigator.permissions.query({name:"geolocation"}),b(o.state),o.onchange=()=>{o&&b(o.state)}}catch{b("prompt")}else b("prompt")});let _=null,w=null;const j=(z,B)=>{if(!r?.value)return;const V=document.createElement("div");V.className="geolocation-marker",V.style.setProperty("--geolocation-marker-color",e.markerColor),V.setAttribute("role","img"),V.setAttribute("aria-label","Your location"),V.innerHTML=`
2
2
  <div class="geolocation-marker-dot"></div>
3
3
  <div class="geolocation-marker-pulse"></div>
4
- `,_=new maplibregl.Marker({element:V}).setLngLat([z,B]).addTo(r.value)},E=(z,B)=>{_?_.setLngLat([z,B]):j(z,B)},A=()=>{_&&(_.remove(),_=null)},O=()=>{w!==null&&(navigator.geolocation.clearWatch(w),w=null),u.value=!1},M=(z,B=!1)=>{if(!r?.value)return;const{longitude:V,latitude:q,accuracy:X}=z.coords;B&&(r.value.setCenter([V,q]),r.value.setZoom(16)),e.showLocationMarker&&E(V,q),i("located",{longitude:V,latitude:q,accuracy:X}),c.value=!1},C=z=>{z.code===z.PERMISSION_DENIED&&(b("denied"),m()),i("error",z),c.value=!1},N=()=>{if(f.value){m();return}if(!r?.value||!navigator.geolocation){i("error",new Error("Geolocation not supported"));return}if(u.value){O(),A();return}if(c.value=!0,e.trackUser){u.value=!0;let z=!0;w=navigator.geolocation.watchPosition(B=>{M(B,z),z=!1},B=>{C(B),O()},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})}else navigator.geolocation.getCurrentPosition(z=>{M(z,!0)},z=>{C(z)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})};return vue.onBeforeUnmount(()=>{o&&(o.onchange=null),a&&clearTimeout(a),O(),A()}),(z,B)=>(vue.openBlock(),vue.createBlock(_sfc_main$p,{icon:vue.unref(n),position:e.position,"teleport-to":e.teleportTo,title:e.title,"icon-size":e.iconSize,size:e.size,onClick:N},{default:vue.withCtx(()=>[s.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["geolocation-denied-callout",h.value]),role:"status","aria-live":"polite",onClick:v},vue.toDisplayString(e.deniedMessage),3)):vue.createCommentVNode("",!0)]),_:1},8,["icon","position","teleport-to","title","icon-size","size"]))}}),_hoisted_1$c=["aria-label"],BASEMAP_CEILING_ID="basemap-ceiling",_sfc_main$k=vue.defineComponent({__name:"Map",props:{center:{default:()=>[-75.163613,39.952372]},zoom:{default:16},style:{default:()=>({version:8,sources:{},layers:[]})},minZoom:{default:0},maxZoom:{default:22},pitch:{default:0},bearing:{default:0},basemapUrl:{},labelsUrl:{},basemapChangeControls:{},navigationControls:{},geolocationControl:{},mapSearchControl:{},noDefaultTileLayers:{type:Boolean,default:!1},basemapBeforeId:{default:void 0},toolPanelLayout:{default:"vertical"},toolPanelSplitRatio:{default:50},cyclomediaConfig:{},enableCyclomedia:{type:Boolean,default:!1},cyclomediaButtonPosition:{default:"top-right"},pictometryCredentials:{},enablePictometry:{type:Boolean,default:!1},pictometryButtonPosition:{default:"top-right"},ariaLabel:{default:"Interactive map"},className:{}},emits:["load","click","move","moveend","zoom","searchResult"],setup(k,{expose:t,emit:e}){const n=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaButton-8x4aUJ-V.cjs"))),i=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>CyclomediaPanel$1)),r=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaRecordingsLayer-CXVMIczB.cjs"))),c=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaCameraIcon-DV3_GfOf.cjs"))),u=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaViewcone-DaStIxZ1.cjs"))),l=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PictometryButton-DBncEtET.cjs"))),f=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>PictometryPanel$1)),o=k,s=e,a=vue.ref(null),h=vue.ref(null),m=vue.ref(!1),v=vue.ref(o.center),b=vue.ref(o.zoom),_=vue.ref(o.pitch),w=vue.ref(o.bearing),j=vue.ref(null),E=vue.ref(!1),A=vue.ref(defaultImageryOptions[0]?.imageryUrl||null),O=vue.ref(defaultImageryOptions[0]?.imageryLabelsUrl||null),M=vue.ref(defaultImageryOptions[0]?.showLabels??!0),C=vue.ref(!1),N=vue.ref(null),z=vue.ref(!1),B=vue.ref(!1),V=vue.ref(null);function q(sn,fn){N.value=sn,sn==="cyclomedia"?(z.value||(V.value=fn,z.value=!0),C.value=!0):sn==="pictometry"&&(B.value||(V.value=fn,B.value=!0))}function X(){N.value=null,V.value=null,C.value=!1}function K(sn){sn.active?q(sn.tool,sn.location):X()}function $(sn){K({tool:"cyclomedia",...sn})}function re(sn){K({tool:"pictometry",...sn})}const G=vue.ref(null),le=vue.ref(0),ge=vue.ref(80);function Ee(sn){G.value=[sn.lng,sn.lat],le.value=sn.yaw??0,ge.value=sn.hFov??80}function Ce(sn){N.value!=="cyclomedia"?q("cyclomedia",sn):V.value={lng:sn.lng,lat:sn.lat}}function fe(sn){const fn=sn.lonLat.lon,on=sn.lonLat.lat;(V.value?.lng!==fn||V.value?.lat!==on)&&(V.value={lng:fn,lat:on})}function je(sn){return{type:"raster",tiles:[sn.includes("{z}")?sn:`${sn}tile/{z}/{y}/{x}`],tileSize:256}}const Le=vue.computed(()=>E.value&&A.value?je(A.value):o.basemapUrl?je(o.basemapUrl):defaultBasemapSource),bt=vue.computed(()=>E.value?M.value&&O.value?je(O.value):null:o.labelsUrl!==void 0?o.labelsUrl===null?null:je(o.labelsUrl):defaultLabelsSource);function Te(sn){E.value=sn.showImagery,A.value=sn.imageryUrl,O.value=sn.imageryLabelsUrl,M.value=sn.showLabels}function De(sn){const[fn,on]=sn.geometry.coordinates;V.value={lng:fn,lat:on},s("searchResult",sn)}const Lt=vue.computed(()=>o.basemapBeforeId||BASEMAP_CEILING_ID),Ue=vue.computed(()=>N.value!==null),Ie=vue.computed(()=>({"layout-vertical":o.toolPanelLayout==="vertical","layout-horizontal":o.toolPanelLayout==="horizontal"})),Pe=vue.computed(()=>{if(!Ue.value)return{width:"100%",height:"100%"};const fn=`${o.toolPanelSplitRatio??50}%`;return o.toolPanelLayout==="vertical"?{width:"100%",height:fn}:{width:fn,height:"100%"}}),jt=vue.computed(()=>{const fn=`${100-(o.toolPanelSplitRatio??50)}%`;return o.toolPanelLayout==="vertical"?{width:"100%",height:fn}:{width:fn,height:"100%"}});vue.provide("map",h),vue.provide("cyclomediaConfig",o.cyclomediaConfig||null),vue.provide("pictometryCredentials",o.pictometryCredentials||null),vue.provide("toolLocation",V),vue.provide("isLoaded",m),vue.provide("handleBasemapChange",Te);const Nt=vue.ref(!1);vue.provide("isDrawing",Nt);const Ht=vue.ref(new Set),Xt=sn=>{Ht.value.add(sn)};vue.provide("registerClickableLayer",Xt);const Kt=sn=>{Ht.value.delete(sn)};vue.provide("unregisterClickableLayer",Kt),vue.provide("cyclomediaActive",C),vue.provide("activeTool",N),vue.provide("toolLocation",V),vue.provide("handleToolToggle",K);const Mt=vue.ref(null),Yt=vue.ref(null),Dt=vue.ref(null),qt=vue.ref(null);return vue.provide("controlCorners",{"top-left":Mt,"top-right":Yt,"bottom-left":Dt,"bottom-right":qt}),vue.onMounted(()=>{a.value&&(h.value=new maplibregl.Map({container:a.value,style:o.style,center:o.center,zoom:o.zoom,minZoom:o.minZoom,maxZoom:o.maxZoom,pitch:o.pitch,bearing:o.bearing,attributionControl:!1}),h.value.on("load",()=>{m.value=!0,h.value&&s("load",h.value)}),h.value.on("click",sn=>{if(!Nt.value){if(Ht.value.size>0&&h.value){const fn=Array.from(Ht.value).filter(on=>h.value?.getLayer(on));if(fn.length>0){const tn=[[sn.point.x-10,sn.point.y-10],[sn.point.x+10,sn.point.y+10]];if(h.value.queryRenderedFeatures(tn,{layers:fn}).length>0)return}}s("click",sn)}}),h.value.on("move",()=>{h.value&&(v.value=h.value.getCenter(),b.value=h.value.getZoom(),s("move",{center:h.value.getCenter(),zoom:h.value.getZoom()}))}),h.value.on("moveend",()=>{if(h.value){const sn=h.value.getBounds();j.value={west:sn.getWest(),south:sn.getSouth(),east:sn.getEast(),north:sn.getNorth()},s("moveend",{center:h.value.getCenter(),zoom:h.value.getZoom(),bounds:j.value})}}),h.value.on("zoom",()=>{h.value&&(b.value=h.value.getZoom(),s("zoom",h.value.getZoom()))}),h.value.on("pitch",()=>{h.value&&(_.value=h.value.getPitch())}),h.value.on("rotate",()=>{h.value&&(w.value=h.value.getBearing())}))}),vue.watch(()=>o.center,sn=>{h.value&&sn&&(h.value.setCenter(sn),v.value=sn)}),vue.watch(()=>o.zoom,sn=>{h.value&&sn!==void 0&&(h.value.setZoom(sn),b.value=sn)}),vue.watch(()=>o.pitch,sn=>{h.value&&sn!==void 0&&(h.value.setPitch(sn),_.value=sn)}),vue.watch(()=>o.bearing,sn=>{h.value&&sn!==void 0&&(h.value.setBearing(sn),w.value=sn)}),vue.watch(()=>o.style,sn=>{h.value&&sn&&h.value.setStyle(sn)}),vue.watch(()=>o.minZoom,sn=>{h.value&&sn!==void 0&&h.value.setMinZoom(sn)}),vue.watch(()=>o.maxZoom,sn=>{h.value&&sn!==void 0&&h.value.setMaxZoom(sn)}),vue.onBeforeUnmount(()=>{m.value=!1,h.value&&h.value.remove()}),t({map:h,isLoaded:m,currentCenter:v,currentZoom:b,currentPitch:_,currentBearing:w,currentBounds:j,activeTool:N,toolLocation:V,cyclomediaActive:C}),(sn,fn)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["map-wrapper",Ie.value])},[vue.createElementVNode("div",{ref_key:"mapContainer",ref:a,class:"map-container",style:vue.normalizeStyle(Pe.value),role:"region","aria-label":k.ariaLabel||void 0},[vue.createElementVNode("a",{href:"#",class:"map-keyboard-instructions",onClick:fn[0]||(fn[0]=vue.withModifiers(()=>{},["prevent"]))}," Use arrow keys to pan the map. Press + or - to zoom. Press Tab to exit. "),k.noDefaultTileLayers?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(_sfc_main$s,{key:0,id:"basemap",source:Le.value,"before-id":"basemap-labels"},null,8,["source"])),!k.noDefaultTileLayers&&bt.value?(vue.openBlock(),vue.createBlock(_sfc_main$s,{key:1,id:"basemap-labels",source:bt.value,"before-id":Lt.value},null,8,["source","before-id"])):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$r,{id:BASEMAP_CEILING_ID}),N.value==="cyclomedia"?(vue.openBlock(),vue.createBlock(vue.unref(r),{key:2,visible:!0,"min-zoom":17,onRecordingClick:Ce})):vue.createCommentVNode("",!0),k.enableCyclomedia&&N.value==="cyclomedia"&&G.value?(vue.openBlock(),vue.createBlock(vue.unref(u),{key:3,position:G.value,yaw:le.value,"h-fov":ge.value,"icon-size":.5},null,8,["position","yaw","h-fov"])):vue.createCommentVNode("",!0),k.enableCyclomedia&&N.value==="cyclomedia"&&G.value?(vue.openBlock(),vue.createBlock(vue.unref(c),{key:4,position:G.value,yaw:le.value,"icon-size":.09},null,8,["position","yaw"])):vue.createCommentVNode("",!0),k.navigationControls?(vue.openBlock(),vue.createBlock(_sfc_main$m,{key:5,position:k.navigationControls.position},null,8,["position"])):vue.createCommentVNode("",!0),k.geolocationControl?(vue.openBlock(),vue.createBlock(_sfc_main$l,{key:6,position:k.geolocationControl.position},null,8,["position"])):vue.createCommentVNode("",!0),k.mapSearchControl?(vue.openBlock(),vue.createBlock(_sfc_main$q,{key:7,position:k.mapSearchControl.position,placeholder:k.mapSearchControl.placeholder??"Search for an address",autocomplete:k.mapSearchControl.autocomplete??!1,onResult:De},null,8,["position","placeholder","autocomplete"])):vue.createCommentVNode("",!0),k.basemapChangeControls?.toggle?(vue.openBlock(),vue.createBlock(_sfc_main$n,{key:8,position:k.basemapChangeControls.position,"show-dropdown":k.basemapChangeControls.dropdown,onChange:Te},null,8,["position","show-dropdown"])):vue.createCommentVNode("",!0),k.enableCyclomedia?(vue.openBlock(),vue.createBlock(vue.unref(n),{key:9,position:k.cyclomediaButtonPosition,active:N.value==="cyclomedia",onToggle:$},null,8,["position","active"])):vue.createCommentVNode("",!0),k.enablePictometry?(vue.openBlock(),vue.createBlock(vue.unref(l),{key:10,position:k.pictometryButtonPosition,active:N.value==="pictometry",onToggle:re},null,8,["position","active"])):vue.createCommentVNode("",!0),vue.renderSlot(sn.$slots,"default",{},void 0,!0),vue.createElementVNode("div",{ref_key:"cornerTopLeft",ref:Mt,class:"map-controls map-controls-top-left"},null,512),vue.createElementVNode("div",{ref_key:"cornerTopRight",ref:Yt,class:"map-controls map-controls-top-right"},null,512),vue.createElementVNode("div",{ref_key:"cornerBottomLeft",ref:Dt,class:"map-controls map-controls-bottom-left"},null,512),vue.createElementVNode("div",{ref_key:"cornerBottomRight",ref:qt,class:"map-controls map-controls-bottom-right"},null,512)],12,_hoisted_1$c),vue.withDirectives(vue.createElementVNode("div",{class:"tool-panel-container",style:vue.normalizeStyle(jt.value),role:"region","aria-label":"Cyclomedia street view"},[z.value?(vue.openBlock(),vue.createBlock(vue.unref(i),{key:0,"auto-open":!0,"pop-out-enabled":!0,onViewChange:Ee})):vue.createCommentVNode("",!0)],4),[[vue.vShow,N.value==="cyclomedia"]]),vue.withDirectives(vue.createElementVNode("div",{class:"tool-panel-container",style:vue.normalizeStyle(jt.value),role:"region","aria-label":"Pictometry oblique imagery"},[B.value?(vue.openBlock(),vue.createBlock(vue.unref(f),{key:0,"auto-open":!0,"pop-out-enabled":!0,onViewChange:fe})):vue.createCommentVNode("",!0)],4),[[vue.vShow,N.value==="pictometry"]])],2))}}),_export_sfc=(k,t)=>{const e=k.__vccOpts||k;for(const[n,i]of t)e[n]=i;return e},Map$1=_export_sfc(_sfc_main$k,[["__scopeId","data-v-617683af"]]),_sfc_main$j=vue.defineComponent({__name:"MapMarker",props:{lngLat:{},color:{default:"#FF0000"},popup:{default:void 0},draggable:{type:Boolean,default:!1},rotation:{default:0},offset:{default:void 0},icon:{default:void 0},iconSize:{default:24},iconColor:{default:void 0},ariaLabel:{default:void 0},zIndex:{default:void 0},className:{}},emits:["dragstart","drag","dragend"],setup(k,{emit:t}){const e=k,n=t,i=vue.useSlots(),r=vue.ref(null),c=vue.inject("map"),u=vue.inject("isLoaded");let l=null;const f=()=>{if(!c||!c.value||!e.lngLat)return;o();const s={draggable:e.draggable};if(i.default){const h=document.createElement("div");r.value=h,s.element=h,s.anchor="bottom"}else if(e.icon){const h=document.createElement("div");h.className="custom-marker",h.innerHTML=`<i class="${e.icon}" style="font-size: ${e.iconSize}px; color: ${e.iconColor||e.color};"></i>`,s.element=h}else s.color=e.color;if(e.rotation&&(s.rotation=e.rotation),e.offset&&(s.offset=e.offset),l=new maplibregl.Marker(s).setLngLat(e.lngLat),e.popup){const h=new maplibregl.Popup().setHTML(e.popup);l.setPopup(h)}l.addTo(c.value);const a=l.getElement();e.ariaLabel?(a.setAttribute("role","img"),a.setAttribute("aria-label",e.ariaLabel)):a.setAttribute("aria-hidden","true"),e.zIndex!=null&&(a.style.zIndex=String(e.zIndex)),e.draggable&&l&&(l.on("dragstart",()=>l&&n("dragstart",l.getLngLat())),l.on("drag",()=>l&&n("drag",l.getLngLat())),l.on("dragend",()=>l&&n("dragend",l.getLngLat())))},o=()=>{l&&(l.remove(),l=null),r.value=null};return vue.watch(()=>e.zIndex,s=>{if(!l)return;const a=l.getElement();s!=null?a.style.zIndex=String(s):a.style.zIndex=""}),vue.watch(()=>e.lngLat,s=>{s&&l?l.setLngLat(s):s&&!l&&c?.value&&u?.value?f():!s&&l&&o()},{deep:!0}),vue.watch(()=>u?.value,async s=>{s&&c?.value&&e.lngLat&&(await vue.nextTick(),f())},{immediate:!0}),vue.onBeforeUnmount(()=>{o()}),(s,a)=>r.value&&s.$slots.default?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:r.value},[vue.renderSlot(s.$slots,"default")],8,["to"])):vue.createCommentVNode("",!0)}}),_hoisted_1$b=["role","aria-label","aria-hidden"],_hoisted_2$6=["role","aria-label","aria-hidden"],_hoisted_3$5={class:"icon-circle"},_hoisted_4$3={class:"pin-icon"},_hoisted_5$2={key:0,class:"pin-text"},_sfc_main$i=vue.defineComponent({__name:"MapIconTextPin",props:{icon:{},text:{default:void 0},colorTheme:{default:"dark-primary"},color:{default:void 0},size:{default:"large"},zoom:{default:void 0},selected:{type:Boolean,default:!1},visited:{type:Boolean,default:!1},hovered:{type:Boolean,default:!1},ariaLabel:{default:void 0},className:{}},emits:["mouseenter","mouseleave","click"],setup(k){const t=k,e=vue.computed(()=>t.zoom!==void 0?t.zoom<12?"dot":t.zoom<14?"small":"large":t.size),n=vue.computed(()=>{if(t.color)return{"--pin-bg":"white","--pin-fg":t.color,"--pin-border":"white","--pin-bg-hover":"var(--Schemes-Surface-Container-Low)","--pin-fg-hover":t.color,"--pin-border-hover":t.color,"--pin-bg-selected":t.color,"--pin-fg-selected":"white","--pin-border-selected":t.color,"--pin-bg-visited":"var(--Schemes-Surface-Container)","--pin-fg-visited":t.color,"--pin-border-visited":"var(--Schemes-Surface-Container)"}});return(i,r)=>e.value==="dot"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["map-icon-text-pin-dot",[`theme-${k.colorTheme}`,{selected:k.selected,visited:k.visited,hovered:k.hovered}]]),style:vue.normalizeStyle(n.value),role:k.ariaLabel?"img":void 0,"aria-label":k.ariaLabel,"aria-hidden":k.ariaLabel?void 0:"true",onMouseenter:r[0]||(r[0]=c=>i.$emit("mouseenter",c)),onMouseleave:r[1]||(r[1]=c=>i.$emit("mouseleave",c)),onClick:r[2]||(r[2]=c=>i.$emit("click",c))},null,46,_hoisted_1$b)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["map-icon-text-pin",[`theme-${k.colorTheme}`,`size-${e.value}`,{"icon-only":!k.text,selected:k.selected,visited:k.visited,hovered:k.hovered}]]),style:vue.normalizeStyle(n.value),role:k.ariaLabel?"img":void 0,"aria-label":k.ariaLabel,"aria-hidden":k.ariaLabel?void 0:"true",onMouseenter:r[3]||(r[3]=c=>i.$emit("mouseenter",c)),onMouseleave:r[4]||(r[4]=c=>i.$emit("mouseleave",c)),onClick:r[5]||(r[5]=c=>i.$emit("click",c))},[vue.createElementVNode("div",_hoisted_3$5,[vue.createElementVNode("span",_hoisted_4$3,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(k.icon)))])]),k.text?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$2,vue.toDisplayString(k.text),1)):vue.createCommentVNode("",!0)],46,_hoisted_2$6))}}),MapIconTextPin=_export_sfc(_sfc_main$i,[["__scopeId","data-v-8d8be9f2"]]),_sfc_main$h=vue.defineComponent({__name:"MapTooltip",props:{visible:{type:Boolean,default:!1},hoverBridge:{type:Boolean,default:!0},type:{default:"plain"},color:{default:"default"},tail:{type:Boolean,default:!1},placement:{default:"top-center"},title:{},dismissable:{type:Boolean},className:{}},emits:["mouseenter","mouseleave"],setup(k){const t=k;return(e,n)=>k.visible?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"map-tooltip",onMouseenter:n[0]||(n[0]=i=>k.hoverBridge?e.$emit("mouseenter",i):void 0),onMouseleave:n[1]||(n[1]=i=>k.hoverBridge?e.$emit("mouseleave",i):void 0)},[vue.createVNode(vue.unref(philaUiTooltip.TooltipBubble),{type:t.type,color:t.color,tail:t.tail,placement:t.placement,title:t.title,dismissable:t.dismissable,"class-name":t.className},{default:vue.withCtx(()=>[vue.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["type","color","tail","placement","title","dismissable","class-name"])],32)):vue.createCommentVNode("",!0)}}),MapTooltip=_export_sfc(_sfc_main$h,[["__scopeId","data-v-2ee3171f"]]),FOCUSABLE_SELECTOR='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',_sfc_main$g=vue.defineComponent({__name:"MapPopup",props:{lngLat:{},html:{default:void 0},closeButton:{type:Boolean,default:!0},closeOnClick:{type:Boolean,default:!0},className:{default:void 0},maxWidth:{default:"300px"},offset:{default:void 0},anchor:{default:"bottom"},showNavigation:{type:Boolean,default:!1},currentFeatureIndex:{default:0},totalFeatures:{default:1},layerName:{default:void 0}},emits:["close","open","next","previous"],setup(k,{emit:t}){const e=k,n=t,i=vue.useSlots(),r=vue.inject("map"),c=vue.inject("isLoaded");let u=null;const l=vue.ref(null);let f=null,o=null;const s=()=>{if(!r?.value||!u)return;const _=r.value;requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!u)return;const w=u.getElement();if(!w)return;const j=_.getContainer(),E=w.getBoundingClientRect(),A=j.getBoundingClientRect(),O=10;let M=0,C=0;E.top<A.top+O&&(C=E.top-A.top-O),E.bottom>A.bottom-O&&(C=E.bottom-A.bottom+O),E.left<A.left+O&&(M=E.left-A.left-O),E.right>A.right-O&&(M=E.right-A.right+O),(M!==0||C!==0)&&_.panBy([M,C],{duration:300})})})},a=()=>{if(!r?.value)return;const _=document.activeElement;b(),f=_;const w={closeButton:e.closeButton,closeOnClick:e.closeOnClick,maxWidth:e.maxWidth},E=e.showNavigation&&e.totalFeatures&&e.totalFeatures>1?"multi-feature-popup":"";if((e.className||E)&&(w.className=[e.className,E].filter(Boolean).join(" ")),e.offset&&(w.offset=e.offset),e.anchor&&(w.anchor=e.anchor),u=new maplibregl.Popup(w),i.default&&l.value)u.setDOMContent(l.value);else if(e.html){let O="";e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&(O+=h()),O+=`<div class="popup-scroll-content">${e.html}</div>`,u.setHTML(O),e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&setTimeout(()=>{m()},0)}u.setLngLat(e.lngLat),u.addTo(r.value),n("open"),u.on("close",()=>{v(),f&&typeof f.focus=="function"&&(f.focus(),f=null),n("close")});const A=u.getElement();if(A){const O=A.querySelector(".maplibregl-popup-content");if(O){O.setAttribute("tabindex","-1"),O.setAttribute("role","dialog"),O.setAttribute("aria-label","Map popup"),O.focus({preventScroll:!0});const C=O.querySelector(".popup-scroll-content");C&&(C.scrollTop=0)}const M=A.querySelector(".maplibregl-popup-close-button");M&&!M.getAttribute("aria-label")&&M.setAttribute("aria-label","Close"),o=C=>{if(C.key==="Escape"){C.preventDefault(),u?.remove();return}if(C.key==="Tab"){const N=A.querySelectorAll(FOCUSABLE_SELECTOR);if(N.length===0)return;const z=N[0],B=N[N.length-1];C.shiftKey?(document.activeElement===z||document.activeElement===O)&&(C.preventDefault(),B.focus()):document.activeElement===B&&(C.preventDefault(),z.focus())}},A.addEventListener("keydown",o),s()}},h=()=>{const _=e.layerName?`<div class="popup-layer-name">${e.layerName}</div>`:"",w=(e.currentFeatureIndex??0)+1,j=e.totalFeatures??1,E=(e.currentFeatureIndex??0)>0,A=(e.currentFeatureIndex??0)<j-1;return`
4
+ `,_=new maplibregl.Marker({element:V}).setLngLat([z,B]).addTo(r.value)},E=(z,B)=>{_?_.setLngLat([z,B]):j(z,B)},A=()=>{_&&(_.remove(),_=null)},O=()=>{w!==null&&(navigator.geolocation.clearWatch(w),w=null),u.value=!1},M=(z,B=!1)=>{if(!r?.value)return;const{longitude:V,latitude:q,accuracy:X}=z.coords;B&&(r.value.setCenter([V,q]),r.value.setZoom(16)),e.showLocationMarker&&E(V,q),i("located",{longitude:V,latitude:q,accuracy:X}),c.value=!1},C=z=>{z.code===z.PERMISSION_DENIED&&(b("denied"),m()),i("error",z),c.value=!1},N=()=>{if(f.value){m();return}if(!r?.value||!navigator.geolocation){i("error",new Error("Geolocation not supported"));return}if(u.value){O(),A();return}if(c.value=!0,e.trackUser){u.value=!0;let z=!0;w=navigator.geolocation.watchPosition(B=>{M(B,z),z=!1},B=>{C(B),O()},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})}else navigator.geolocation.getCurrentPosition(z=>{M(z,!0)},z=>{C(z)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})};return vue.onBeforeUnmount(()=>{o&&(o.onchange=null),a&&clearTimeout(a),O(),A()}),(z,B)=>(vue.openBlock(),vue.createBlock(_sfc_main$p,{icon:vue.unref(n),position:e.position,"teleport-to":e.teleportTo,title:e.title,"icon-size":e.iconSize,size:e.size,onClick:N},{default:vue.withCtx(()=>[s.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["geolocation-denied-callout",h.value]),role:"status","aria-live":"polite",onClick:v},vue.toDisplayString(e.deniedMessage),3)):vue.createCommentVNode("",!0)]),_:1},8,["icon","position","teleport-to","title","icon-size","size"]))}}),_hoisted_1$c=["aria-label"],BASEMAP_CEILING_ID="basemap-ceiling",_sfc_main$k=vue.defineComponent({__name:"Map",props:{center:{default:()=>[-75.163613,39.952372]},zoom:{default:16},style:{default:()=>({version:8,sources:{},layers:[]})},minZoom:{default:0},maxZoom:{default:22},pitch:{default:0},bearing:{default:0},basemapUrl:{},labelsUrl:{},basemapChangeControls:{},navigationControls:{},geolocationControl:{},mapSearchControl:{},noDefaultTileLayers:{type:Boolean,default:!1},basemapBeforeId:{default:void 0},toolPanelLayout:{default:"vertical"},toolPanelSplitRatio:{default:50},cyclomediaConfig:{},enableCyclomedia:{type:Boolean,default:!1},cyclomediaButtonPosition:{default:"top-right"},pictometryCredentials:{},enablePictometry:{type:Boolean,default:!1},pictometryButtonPosition:{default:"top-right"},ariaLabel:{default:"Interactive map"},className:{}},emits:["load","click","move","moveend","zoom","searchResult"],setup(k,{expose:t,emit:e}){const n=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaButton-D5SZ01UL.cjs"))),i=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>CyclomediaPanel$1)),r=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaRecordingsLayer-Q41SkE9t.cjs"))),c=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaCameraIcon-Dd3Tpeqr.cjs"))),u=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./CyclomediaViewcone-LKZiWXvQ.cjs"))),l=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PictometryButton-DdERnfyH.cjs"))),f=vue.defineAsyncComponent(()=>Promise.resolve().then(()=>PictometryPanel$1)),o=k,s=e,a=vue.ref(null),h=vue.ref(null),m=vue.ref(!1),v=vue.ref(o.center),b=vue.ref(o.zoom),_=vue.ref(o.pitch),w=vue.ref(o.bearing),j=vue.ref(null),E=vue.ref(!1),A=vue.ref(defaultImageryOptions[0]?.imageryUrl||null),O=vue.ref(defaultImageryOptions[0]?.imageryLabelsUrl||null),M=vue.ref(defaultImageryOptions[0]?.showLabels??!0),C=vue.ref(!1),N=vue.ref(null),z=vue.ref(!1),B=vue.ref(!1),V=vue.ref(null);function q(sn,fn){N.value=sn,sn==="cyclomedia"?(z.value||(V.value=fn,z.value=!0),C.value=!0):sn==="pictometry"&&(B.value||(V.value=fn,B.value=!0))}function X(){N.value=null,V.value=null,C.value=!1}function K(sn){sn.active?q(sn.tool,sn.location):X()}function $(sn){K({tool:"cyclomedia",...sn})}function re(sn){K({tool:"pictometry",...sn})}const G=vue.ref(null),le=vue.ref(0),ge=vue.ref(80);function Ee(sn){G.value=[sn.lng,sn.lat],le.value=sn.yaw??0,ge.value=sn.hFov??80}function Ce(sn){N.value!=="cyclomedia"?q("cyclomedia",sn):V.value={lng:sn.lng,lat:sn.lat}}function fe(sn){const fn=sn.lonLat.lon,on=sn.lonLat.lat;(V.value?.lng!==fn||V.value?.lat!==on)&&(V.value={lng:fn,lat:on})}function je(sn){return{type:"raster",tiles:[sn.includes("{z}")?sn:`${sn}tile/{z}/{y}/{x}`],tileSize:256}}const Le=vue.computed(()=>E.value&&A.value?je(A.value):o.basemapUrl?je(o.basemapUrl):defaultBasemapSource),bt=vue.computed(()=>E.value?M.value&&O.value?je(O.value):null:o.labelsUrl!==void 0?o.labelsUrl===null?null:je(o.labelsUrl):defaultLabelsSource);function Te(sn){E.value=sn.showImagery,A.value=sn.imageryUrl,O.value=sn.imageryLabelsUrl,M.value=sn.showLabels}function De(sn){const[fn,on]=sn.geometry.coordinates;V.value={lng:fn,lat:on},s("searchResult",sn)}const Lt=vue.computed(()=>o.basemapBeforeId||BASEMAP_CEILING_ID),Ue=vue.computed(()=>N.value!==null),Ie=vue.computed(()=>({"layout-vertical":o.toolPanelLayout==="vertical","layout-horizontal":o.toolPanelLayout==="horizontal"})),Pe=vue.computed(()=>{if(!Ue.value)return{width:"100%",height:"100%"};const fn=`${o.toolPanelSplitRatio??50}%`;return o.toolPanelLayout==="vertical"?{width:"100%",height:fn}:{width:fn,height:"100%"}}),jt=vue.computed(()=>{const fn=`${100-(o.toolPanelSplitRatio??50)}%`;return o.toolPanelLayout==="vertical"?{width:"100%",height:fn}:{width:fn,height:"100%"}});vue.provide("map",h),vue.provide("cyclomediaConfig",o.cyclomediaConfig||null),vue.provide("pictometryCredentials",o.pictometryCredentials||null),vue.provide("toolLocation",V),vue.provide("isLoaded",m),vue.provide("handleBasemapChange",Te);const Nt=vue.ref(!1);vue.provide("isDrawing",Nt);const Ht=vue.ref(new Set),Xt=sn=>{Ht.value.add(sn)};vue.provide("registerClickableLayer",Xt);const Kt=sn=>{Ht.value.delete(sn)};vue.provide("unregisterClickableLayer",Kt),vue.provide("cyclomediaActive",C),vue.provide("activeTool",N),vue.provide("toolLocation",V),vue.provide("handleToolToggle",K);const Mt=vue.ref(null),Yt=vue.ref(null),Dt=vue.ref(null),qt=vue.ref(null);return vue.provide("controlCorners",{"top-left":Mt,"top-right":Yt,"bottom-left":Dt,"bottom-right":qt}),vue.onMounted(()=>{a.value&&(h.value=new maplibregl.Map({container:a.value,style:o.style,center:o.center,zoom:o.zoom,minZoom:o.minZoom,maxZoom:o.maxZoom,pitch:o.pitch,bearing:o.bearing,attributionControl:!1}),h.value.on("load",()=>{m.value=!0,h.value&&s("load",h.value)}),h.value.on("click",sn=>{if(!Nt.value){if(Ht.value.size>0&&h.value){const fn=Array.from(Ht.value).filter(on=>h.value?.getLayer(on));if(fn.length>0){const tn=[[sn.point.x-10,sn.point.y-10],[sn.point.x+10,sn.point.y+10]];if(h.value.queryRenderedFeatures(tn,{layers:fn}).length>0)return}}s("click",sn)}}),h.value.on("move",()=>{h.value&&(v.value=h.value.getCenter(),b.value=h.value.getZoom(),s("move",{center:h.value.getCenter(),zoom:h.value.getZoom()}))}),h.value.on("moveend",()=>{if(h.value){const sn=h.value.getBounds();j.value={west:sn.getWest(),south:sn.getSouth(),east:sn.getEast(),north:sn.getNorth()},s("moveend",{center:h.value.getCenter(),zoom:h.value.getZoom(),bounds:j.value})}}),h.value.on("zoom",()=>{h.value&&(b.value=h.value.getZoom(),s("zoom",h.value.getZoom()))}),h.value.on("pitch",()=>{h.value&&(_.value=h.value.getPitch())}),h.value.on("rotate",()=>{h.value&&(w.value=h.value.getBearing())}))}),vue.watch(()=>o.center,sn=>{h.value&&sn&&(h.value.setCenter(sn),v.value=sn)}),vue.watch(()=>o.zoom,sn=>{h.value&&sn!==void 0&&(h.value.setZoom(sn),b.value=sn)}),vue.watch(()=>o.pitch,sn=>{h.value&&sn!==void 0&&(h.value.setPitch(sn),_.value=sn)}),vue.watch(()=>o.bearing,sn=>{h.value&&sn!==void 0&&(h.value.setBearing(sn),w.value=sn)}),vue.watch(()=>o.style,sn=>{h.value&&sn&&h.value.setStyle(sn)}),vue.watch(()=>o.minZoom,sn=>{h.value&&sn!==void 0&&h.value.setMinZoom(sn)}),vue.watch(()=>o.maxZoom,sn=>{h.value&&sn!==void 0&&h.value.setMaxZoom(sn)}),vue.onBeforeUnmount(()=>{m.value=!1,h.value&&h.value.remove()}),t({map:h,isLoaded:m,currentCenter:v,currentZoom:b,currentPitch:_,currentBearing:w,currentBounds:j,activeTool:N,toolLocation:V,cyclomediaActive:C}),(sn,fn)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["map-wrapper",Ie.value])},[vue.createElementVNode("div",{ref_key:"mapContainer",ref:a,class:"map-container",style:vue.normalizeStyle(Pe.value),role:"region","aria-label":k.ariaLabel||void 0},[vue.createElementVNode("a",{href:"#",class:"map-keyboard-instructions",onClick:fn[0]||(fn[0]=vue.withModifiers(()=>{},["prevent"]))}," Use arrow keys to pan the map. Press + or - to zoom. Press Tab to exit. "),k.noDefaultTileLayers?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(_sfc_main$s,{key:0,id:"basemap",source:Le.value,"before-id":"basemap-labels"},null,8,["source"])),!k.noDefaultTileLayers&&bt.value?(vue.openBlock(),vue.createBlock(_sfc_main$s,{key:1,id:"basemap-labels",source:bt.value,"before-id":Lt.value},null,8,["source","before-id"])):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$r,{id:BASEMAP_CEILING_ID}),N.value==="cyclomedia"?(vue.openBlock(),vue.createBlock(vue.unref(r),{key:2,visible:!0,"min-zoom":17,onRecordingClick:Ce})):vue.createCommentVNode("",!0),k.enableCyclomedia&&N.value==="cyclomedia"&&G.value?(vue.openBlock(),vue.createBlock(vue.unref(u),{key:3,position:G.value,yaw:le.value,"h-fov":ge.value,"icon-size":.5},null,8,["position","yaw","h-fov"])):vue.createCommentVNode("",!0),k.enableCyclomedia&&N.value==="cyclomedia"&&G.value?(vue.openBlock(),vue.createBlock(vue.unref(c),{key:4,position:G.value,yaw:le.value,"icon-size":.09},null,8,["position","yaw"])):vue.createCommentVNode("",!0),k.navigationControls?(vue.openBlock(),vue.createBlock(_sfc_main$m,{key:5,position:k.navigationControls.position},null,8,["position"])):vue.createCommentVNode("",!0),k.geolocationControl?(vue.openBlock(),vue.createBlock(_sfc_main$l,{key:6,position:k.geolocationControl.position},null,8,["position"])):vue.createCommentVNode("",!0),k.mapSearchControl?(vue.openBlock(),vue.createBlock(_sfc_main$q,{key:7,position:k.mapSearchControl.position,placeholder:k.mapSearchControl.placeholder??"Search for an address",autocomplete:k.mapSearchControl.autocomplete??!1,onResult:De},null,8,["position","placeholder","autocomplete"])):vue.createCommentVNode("",!0),k.basemapChangeControls?.toggle?(vue.openBlock(),vue.createBlock(_sfc_main$n,{key:8,position:k.basemapChangeControls.position,"show-dropdown":k.basemapChangeControls.dropdown,onChange:Te},null,8,["position","show-dropdown"])):vue.createCommentVNode("",!0),k.enableCyclomedia?(vue.openBlock(),vue.createBlock(vue.unref(n),{key:9,position:k.cyclomediaButtonPosition,active:N.value==="cyclomedia",onToggle:$},null,8,["position","active"])):vue.createCommentVNode("",!0),k.enablePictometry?(vue.openBlock(),vue.createBlock(vue.unref(l),{key:10,position:k.pictometryButtonPosition,active:N.value==="pictometry",onToggle:re},null,8,["position","active"])):vue.createCommentVNode("",!0),vue.renderSlot(sn.$slots,"default",{},void 0,!0),vue.createElementVNode("div",{ref_key:"cornerTopLeft",ref:Mt,class:"map-controls map-controls-top-left"},null,512),vue.createElementVNode("div",{ref_key:"cornerTopRight",ref:Yt,class:"map-controls map-controls-top-right"},null,512),vue.createElementVNode("div",{ref_key:"cornerBottomLeft",ref:Dt,class:"map-controls map-controls-bottom-left"},null,512),vue.createElementVNode("div",{ref_key:"cornerBottomRight",ref:qt,class:"map-controls map-controls-bottom-right"},null,512)],12,_hoisted_1$c),vue.withDirectives(vue.createElementVNode("div",{class:"tool-panel-container",style:vue.normalizeStyle(jt.value),role:"region","aria-label":"Cyclomedia street view"},[z.value?(vue.openBlock(),vue.createBlock(vue.unref(i),{key:0,"auto-open":!0,"pop-out-enabled":!0,onViewChange:Ee})):vue.createCommentVNode("",!0)],4),[[vue.vShow,N.value==="cyclomedia"]]),vue.withDirectives(vue.createElementVNode("div",{class:"tool-panel-container",style:vue.normalizeStyle(jt.value),role:"region","aria-label":"Pictometry oblique imagery"},[B.value?(vue.openBlock(),vue.createBlock(vue.unref(f),{key:0,"auto-open":!0,"pop-out-enabled":!0,onViewChange:fe})):vue.createCommentVNode("",!0)],4),[[vue.vShow,N.value==="pictometry"]])],2))}}),_export_sfc=(k,t)=>{const e=k.__vccOpts||k;for(const[n,i]of t)e[n]=i;return e},Map$1=_export_sfc(_sfc_main$k,[["__scopeId","data-v-617683af"]]),_sfc_main$j=vue.defineComponent({__name:"MapMarker",props:{lngLat:{},color:{default:"#FF0000"},popup:{default:void 0},draggable:{type:Boolean,default:!1},rotation:{default:0},offset:{default:void 0},icon:{default:void 0},iconSize:{default:24},iconColor:{default:void 0},ariaLabel:{default:void 0},zIndex:{default:void 0},className:{}},emits:["dragstart","drag","dragend"],setup(k,{emit:t}){const e=k,n=t,i=vue.useSlots(),r=vue.ref(null),c=vue.inject("map"),u=vue.inject("isLoaded");let l=null;const f=()=>{if(!c||!c.value||!e.lngLat)return;o();const s={draggable:e.draggable};if(i.default){const h=document.createElement("div");r.value=h,s.element=h,s.anchor="bottom"}else if(e.icon){const h=document.createElement("div");h.className="custom-marker",h.innerHTML=`<i class="${e.icon}" style="font-size: ${e.iconSize}px; color: ${e.iconColor||e.color};"></i>`,s.element=h}else s.color=e.color;if(e.rotation&&(s.rotation=e.rotation),e.offset&&(s.offset=e.offset),l=new maplibregl.Marker(s).setLngLat(e.lngLat),e.popup){const h=new maplibregl.Popup().setHTML(e.popup);l.setPopup(h)}l.addTo(c.value);const a=l.getElement();e.ariaLabel?(a.setAttribute("role","img"),a.setAttribute("aria-label",e.ariaLabel)):a.setAttribute("aria-hidden","true"),e.zIndex!=null&&(a.style.zIndex=String(e.zIndex)),e.draggable&&l&&(l.on("dragstart",()=>l&&n("dragstart",l.getLngLat())),l.on("drag",()=>l&&n("drag",l.getLngLat())),l.on("dragend",()=>l&&n("dragend",l.getLngLat())))},o=()=>{l&&(l.remove(),l=null),r.value=null};return vue.watch(()=>e.zIndex,s=>{if(!l)return;const a=l.getElement();s!=null?a.style.zIndex=String(s):a.style.zIndex=""}),vue.watch(()=>e.lngLat,s=>{s&&l?l.setLngLat(s):s&&!l&&c?.value&&u?.value?f():!s&&l&&o()},{deep:!0}),vue.watch(()=>u?.value,async s=>{s&&c?.value&&e.lngLat&&(await vue.nextTick(),f())},{immediate:!0}),vue.onBeforeUnmount(()=>{o()}),(s,a)=>r.value&&s.$slots.default?(vue.openBlock(),vue.createBlock(vue.Teleport,{key:0,to:r.value},[vue.renderSlot(s.$slots,"default")],8,["to"])):vue.createCommentVNode("",!0)}}),_hoisted_1$b=["role","aria-label","aria-hidden"],_hoisted_2$6=["role","aria-label","aria-hidden"],_hoisted_3$5={class:"icon-circle"},_hoisted_4$3={class:"pin-icon"},_hoisted_5$2={key:0,class:"pin-text"},_sfc_main$i=vue.defineComponent({__name:"MapIconTextPin",props:{icon:{},text:{default:void 0},colorTheme:{default:"dark-primary"},color:{default:void 0},size:{default:"large"},zoom:{default:void 0},selected:{type:Boolean,default:!1},visited:{type:Boolean,default:!1},hovered:{type:Boolean,default:!1},ariaLabel:{default:void 0},className:{}},emits:["mouseenter","mouseleave","click"],setup(k){const t=k,e=vue.computed(()=>t.zoom!==void 0?t.zoom<12?"dot":t.zoom<14?"small":"large":t.size),n=vue.computed(()=>{if(t.color)return{"--pin-bg":"white","--pin-fg":t.color,"--pin-border":"white","--pin-bg-hover":"var(--Schemes-Surface-Container-Low)","--pin-fg-hover":t.color,"--pin-border-hover":t.color,"--pin-bg-selected":t.color,"--pin-fg-selected":"white","--pin-border-selected":t.color,"--pin-bg-visited":"var(--Schemes-Surface-Container)","--pin-fg-visited":t.color,"--pin-border-visited":"var(--Schemes-Surface-Container)"}});return(i,r)=>e.value==="dot"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["map-icon-text-pin-dot",[`theme-${k.colorTheme}`,{selected:k.selected,visited:k.visited,hovered:k.hovered}]]),style:vue.normalizeStyle(n.value),role:k.ariaLabel?"img":void 0,"aria-label":k.ariaLabel,"aria-hidden":k.ariaLabel?void 0:"true",onMouseenter:r[0]||(r[0]=c=>i.$emit("mouseenter",c)),onMouseleave:r[1]||(r[1]=c=>i.$emit("mouseleave",c)),onClick:r[2]||(r[2]=c=>i.$emit("click",c))},null,46,_hoisted_1$b)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["map-icon-text-pin",[`theme-${k.colorTheme}`,`size-${e.value}`,{"icon-only":!k.text,selected:k.selected,visited:k.visited,hovered:k.hovered}]]),style:vue.normalizeStyle(n.value),role:k.ariaLabel?"img":void 0,"aria-label":k.ariaLabel,"aria-hidden":k.ariaLabel?void 0:"true",onMouseenter:r[3]||(r[3]=c=>i.$emit("mouseenter",c)),onMouseleave:r[4]||(r[4]=c=>i.$emit("mouseleave",c)),onClick:r[5]||(r[5]=c=>i.$emit("click",c))},[vue.createElementVNode("div",_hoisted_3$5,[vue.createElementVNode("span",_hoisted_4$3,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(k.icon)))])]),k.text?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$2,vue.toDisplayString(k.text),1)):vue.createCommentVNode("",!0)],46,_hoisted_2$6))}}),MapIconTextPin=_export_sfc(_sfc_main$i,[["__scopeId","data-v-8d8be9f2"]]),_sfc_main$h=vue.defineComponent({__name:"MapTooltip",props:{visible:{type:Boolean,default:!1},hoverBridge:{type:Boolean,default:!0},type:{default:"plain"},color:{default:"default"},tail:{type:Boolean,default:!1},placement:{default:"top-center"},title:{},dismissable:{type:Boolean},className:{}},emits:["mouseenter","mouseleave"],setup(k){const t=k;return(e,n)=>k.visible?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"map-tooltip",onMouseenter:n[0]||(n[0]=i=>k.hoverBridge?e.$emit("mouseenter",i):void 0),onMouseleave:n[1]||(n[1]=i=>k.hoverBridge?e.$emit("mouseleave",i):void 0)},[vue.createVNode(vue.unref(philaUiTooltip.TooltipBubble),{type:t.type,color:t.color,tail:t.tail,placement:t.placement,title:t.title,dismissable:t.dismissable,"class-name":t.className},{default:vue.withCtx(()=>[vue.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["type","color","tail","placement","title","dismissable","class-name"])],32)):vue.createCommentVNode("",!0)}}),MapTooltip=_export_sfc(_sfc_main$h,[["__scopeId","data-v-2ee3171f"]]),FOCUSABLE_SELECTOR='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',_sfc_main$g=vue.defineComponent({__name:"MapPopup",props:{lngLat:{},html:{default:void 0},closeButton:{type:Boolean,default:!0},closeOnClick:{type:Boolean,default:!0},className:{default:void 0},maxWidth:{default:"300px"},offset:{default:void 0},anchor:{default:"bottom"},showNavigation:{type:Boolean,default:!1},currentFeatureIndex:{default:0},totalFeatures:{default:1},layerName:{default:void 0}},emits:["close","open","next","previous"],setup(k,{emit:t}){const e=k,n=t,i=vue.useSlots(),r=vue.inject("map"),c=vue.inject("isLoaded");let u=null;const l=vue.ref(null);let f=null,o=null;const s=()=>{if(!r?.value||!u)return;const _=r.value;requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!u)return;const w=u.getElement();if(!w)return;const j=_.getContainer(),E=w.getBoundingClientRect(),A=j.getBoundingClientRect(),O=10;let M=0,C=0;E.top<A.top+O&&(C=E.top-A.top-O),E.bottom>A.bottom-O&&(C=E.bottom-A.bottom+O),E.left<A.left+O&&(M=E.left-A.left-O),E.right>A.right-O&&(M=E.right-A.right+O),(M!==0||C!==0)&&_.panBy([M,C],{duration:300})})})},a=()=>{if(!r?.value)return;const _=document.activeElement;b(),f=_;const w={closeButton:e.closeButton,closeOnClick:e.closeOnClick,maxWidth:e.maxWidth},E=e.showNavigation&&e.totalFeatures&&e.totalFeatures>1?"multi-feature-popup":"";if((e.className||E)&&(w.className=[e.className,E].filter(Boolean).join(" ")),e.offset&&(w.offset=e.offset),e.anchor&&(w.anchor=e.anchor),u=new maplibregl.Popup(w),i.default&&l.value)u.setDOMContent(l.value);else if(e.html){let O="";e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&(O+=h()),O+=`<div class="popup-scroll-content">${e.html}</div>`,u.setHTML(O),e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&setTimeout(()=>{m()},0)}u.setLngLat(e.lngLat),u.addTo(r.value),n("open"),u.on("close",()=>{v(),f&&typeof f.focus=="function"&&(f.focus(),f=null),n("close")});const A=u.getElement();if(A){const O=A.querySelector(".maplibregl-popup-content");if(O){O.setAttribute("tabindex","-1"),O.setAttribute("role","dialog"),O.setAttribute("aria-label","Map popup"),O.focus({preventScroll:!0});const C=O.querySelector(".popup-scroll-content");C&&(C.scrollTop=0)}const M=A.querySelector(".maplibregl-popup-close-button");M&&!M.getAttribute("aria-label")&&M.setAttribute("aria-label","Close"),o=C=>{if(C.key==="Escape"){C.preventDefault(),u?.remove();return}if(C.key==="Tab"){const N=A.querySelectorAll(FOCUSABLE_SELECTOR);if(N.length===0)return;const z=N[0],B=N[N.length-1];C.shiftKey?(document.activeElement===z||document.activeElement===O)&&(C.preventDefault(),B.focus()):document.activeElement===B&&(C.preventDefault(),z.focus())}},A.addEventListener("keydown",o),s()}},h=()=>{const _=e.layerName?`<div class="popup-layer-name">${e.layerName}</div>`:"",w=(e.currentFeatureIndex??0)+1,j=e.totalFeatures??1,E=(e.currentFeatureIndex??0)>0,A=(e.currentFeatureIndex??0)<j-1;return`
5
5
  <div class="popup-navigation-header">
6
6
  ${_}
7
7
  <div class="popup-navigation-controls">
@@ -10,7 +10,7 @@
10
10
  ${A?'<button class="popup-nav-button popup-nav-next" data-action="next" aria-label="Next feature">Next →</button>':""}
11
11
  </div>
12
12
  </div>
13
- `},m=()=>{if(!u)return;const _=u.getElement();if(!_)return;const w=_.querySelector('[data-action="previous"]'),j=_.querySelector('[data-action="next"]');w&&w.addEventListener("click",E=>{E.stopPropagation(),n("previous")}),j&&j.addEventListener("click",E=>{E.stopPropagation(),n("next")})},v=()=>{if(o&&u){const _=u.getElement();_&&_.removeEventListener("keydown",o),o=null}},b=()=>{u&&(v(),u.remove(),u=null)};return vue.watch(()=>c?.value,_=>{_&&r?.value&&!u&&a()}),vue.watch(()=>e.lngLat,_=>{u&&_&&(u.setLngLat(_),s())}),vue.watch([()=>e.html,()=>e.currentFeatureIndex,()=>e.showNavigation],([_])=>{if(u&&_&&!i.default){let w="";e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&(w+=h()),w+=`<div class="popup-scroll-content">${_}</div>`,u.setHTML(w),e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&setTimeout(()=>{m()},0)}}),vue.onMounted(()=>{c?.value&&r?.value&&vue.nextTick(()=>{a()})}),vue.onBeforeUnmount(()=>{b()}),(_,w)=>_.$slots.default?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref_key:"slotContainer",ref:l,class:"popup-scroll-content"},[vue.renderSlot(_.$slots,"default")],512)):vue.createCommentVNode("",!0)}}),LAYER_EVENTS=["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"];function useVectorLayer(k,t){const e=vue.inject("map"),n=vue.inject("isLoaded"),i=vue.inject("registerClickableLayer"),r=vue.inject("unregisterClickableLayer"),c=vue.ref(!1);let u=!0,l=JSON.stringify(vue.unref(k.source));const f=[];let o=null;const s=vue.getCurrentInstance(),a=!!s?.vnode.props?.onClick,h=_=>{if(!e?.value)return;const w=vue.unref(k.id),j=vue.unref(k.source),E=vue.unref(k.sourceLayer),A=vue.unref(k.paint),O=vue.unref(k.layout),M=vue.unref(k.filter),C=vue.unref(k.minzoom),N=vue.unref(k.maxzoom),z=vue.unref(k.beforeId);typeof j=="object"&&(e.value.getSource(w)||e.value.addSource(w,j));const B={id:w,type:k.type,source:typeof j=="object"?w:j,paint:A||{},layout:O||{}};if(E&&(B["source-layer"]=E),M&&(B.filter=M),C!==void 0&&(B.minzoom=C),N!==void 0&&(B.maxzoom=N),!e.value.getLayer(w)){const V=_??z;let q;V&&e.value.getLayer(V)&&(q=V),e.value.addLayer(B,q),c.value=!0,v(),a&&i&&i(w)}},m=()=>{if(!e?.value)return;const _=vue.unref(k.id),w=vue.unref(k.source);try{a&&r&&r(_),b(),e.value.getLayer?.(_)&&(e.value.removeLayer(_),c.value=!1),typeof w=="object"&&e.value.getSource?.(_)&&e.value.removeSource(_)}catch{}},v=()=>{if(!e?.value||!s?.vnode.props)return;const _=vue.unref(k.id);for(const w of LAYER_EVENTS){const j=`on${w.charAt(0).toUpperCase()}${w.slice(1)}`;if(s.vnode.props[j])if(w==="click")o=A=>{const O=[[A.point.x-10,A.point.y-10],[A.point.x+10,A.point.y+10]],M=e.value.queryRenderedFeatures(O,{layers:[_]});if(M.length>0){const C=A;C.features=M,t("click",C)}},e.value.on("click",o);else{const E=A=>{t(w,A)};e.value.on(w,_,E),f.push({event:w,handler:E})}}if(a){const w=()=>{e?.value&&(e.value.getCanvas().style.cursor="pointer")},j=()=>{e?.value&&(e.value.getCanvas().style.cursor="")};e.value.on("mouseenter",_,w),e.value.on("mouseleave",_,j),f.push({event:"mouseenter",handler:w}),f.push({event:"mouseleave",handler:j})}},b=()=>{if(!e?.value)return;const _=vue.unref(k.id);for(const{event:w,handler:j}of f)try{e.value.off(w,_,j)}catch{}if(f.length=0,o){try{e.value.off("click",o)}catch{}o=null}};return vue.watch(()=>n?.value,_=>{try{if(!u||!_||!e?.value)return;h()}catch{}},{immediate:!0}),vue.watch(()=>vue.unref(k.paint),_=>{try{const w=vue.unref(k.id);if(!u||!e?.value?.getLayer?.(w)||!_)return;Object.keys(_).forEach(j=>{!u||!e?.value||e.value.setPaintProperty(w,j,_[j])})}catch{}},{deep:!0}),vue.watch(()=>vue.unref(k.layout),_=>{try{const w=vue.unref(k.id);if(!u||!e?.value?.getLayer?.(w)||!_)return;Object.keys(_).forEach(j=>{!u||!e?.value||e.value.setLayoutProperty(w,j,_[j])})}catch{}},{deep:!0}),vue.watch(()=>vue.unref(k.filter),_=>{try{const w=vue.unref(k.id);if(!u||!e?.value?.getLayer?.(w))return;e.value.setFilter(w,_)}catch{}}),vue.watch(()=>vue.unref(k.source),_=>{try{if(!u||!e?.value)return;const w=vue.unref(k.id),j=JSON.stringify(_);if(j===l)return;if(l=j,typeof _=="object"&&_.type==="geojson"){const E=e.value.getSource(w);if(E&&"setData"in E){E.setData(_.data);return}}m(),h()}catch{}},{deep:!0}),vue.onBeforeUnmount(()=>{u=!1}),vue.onUnmounted(()=>{m()}),{map:e,isLoaded:n,isLayerAdded:c,addLayer:h,removeLayer:m}}const _hoisted_1$a=["data-layer-id"],_sfc_main$f=vue.defineComponent({__name:"FillLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a}=vue.toRefs(e);return useVectorLayer({id:i,type:"fill",source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a},n),(h,m)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"fill"},null,8,_hoisted_1$a))}}),_hoisted_1$9=["data-layer-id"],_sfc_main$e=vue.defineComponent({__name:"LineLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a}=vue.toRefs(e);return useVectorLayer({id:i,type:"line",source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a},n),(h,m)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"line"},null,8,_hoisted_1$9))}}),_hoisted_1$8=["data-layer-id"],_sfc_main$d=vue.defineComponent({__name:"CircleLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a}=vue.toRefs(e);return useVectorLayer({id:i,type:"circle",source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a},n),(h,m)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"circle"},null,8,_hoisted_1$8))}}),_hoisted_1$7=["data-layer-id"],_sfc_main$c=vue.defineComponent({__name:"SymbolLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},icon:{default:void 0},iconName:{default:void 0},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,filter:l,minzoom:f,maxzoom:o,beforeId:s,icon:a,iconName:h}=vue.toRefs(e),m=vue.computed(()=>{const w=e.layout||{};return e.iconName?{...w,"icon-image":e.iconName}:w}),{map:v,isLoaded:b,removeLayer:_}=useVectorLayer({id:i,type:"symbol",source:r,sourceLayer:c,paint:u,layout:m,filter:l,minzoom:f,maxzoom:o,beforeId:s},n);return vue.watch(()=>b?.value,async w=>{if(!(!w||!v?.value||!a.value||!h.value)){if(v.value.hasImage(h.value)){v.value.triggerRepaint();return}try{const j=await v.value.loadImage(a.value);if(!v.value)return;v.value.hasImage(h.value)||v.value.addImage(h.value,j.data),v.value.triggerRepaint()}catch{_()}}},{immediate:!0}),vue.onUnmounted(()=>{if(!(!v?.value||!h.value))try{v.value.hasImage(h.value)&&v.value.removeImage(h.value)}catch{}}),(w,j)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"symbol"},null,8,_hoisted_1$7))}}),_hoisted_1$6={key:0,class:"map-loading-overlay"},_hoisted_2$5={class:"map-loading-content"},_hoisted_3$4={class:"map-loading-text"},_sfc_main$b=vue.defineComponent({__name:"MapLoadingOverlay",props:{visible:{type:Boolean},text:{default:"Loading..."}},setup(k){return(t,e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:"overlay-fade"},{default:vue.withCtx(()=>[k.visible?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",_hoisted_2$5,[e[0]||(e[0]=vue.createElementVNode("div",{class:"map-loading-spinner"},null,-1)),vue.createElementVNode("span",_hoisted_3$4,vue.toDisplayString(k.text),1)])])):vue.createCommentVNode("",!0)]),_:1}))}}),MapLoadingOverlay=_export_sfc(_sfc_main$b,[["__scopeId","data-v-760930b2"]]),_hoisted_1$5=["aria-label"],_sfc_main$a=vue.defineComponent({__name:"MapFloatingPanel",props:{position:{default:"top-right"},visible:{type:Boolean,default:!0},offset:{default:()=>({x:10,y:10})},leaveRoomForControls:{type:Boolean,default:!0},ariaLabel:{default:"Map panel"},teleportTo:{default:null},className:{}},setup(k){const t=k,e=vue.ref(null);let n=null;vue.watch(()=>t.visible,r=>{r?(n=document.activeElement,vue.nextTick(()=>{e.value?.focus()})):n&&typeof n.focus=="function"&&(n.focus(),n=null)});const i=vue.computed(()=>{if(t.teleportTo)return{};const r={position:"absolute",zIndex:"1"},c=t.offset?.x??10,u=t.offset?.y??10,l=t.leaveRoomForControls?50:0;switch(t.position){case"top-right":r.top=`${u}px`,r.right=`${l+c}px`;break;case"top-left":r.top=`${u}px`,r.left=`${l+c}px`;break;case"bottom-right":r.bottom=`${u}px`,r.right=`${l+c}px`;break;case"bottom-left":r.bottom=`${u}px`,r.left=`${l+c}px`;break}return r});return(r,c)=>(vue.openBlock(),vue.createBlock(vue.Teleport,{to:k.teleportTo||"body",disabled:!k.teleportTo},[vue.withDirectives(vue.createElementVNode("div",{ref_key:"panelRef",ref:e,class:"map-floating-panel",style:vue.normalizeStyle(i.value),tabindex:"-1",role:"region","aria-label":k.ariaLabel},[vue.renderSlot(r.$slots,"default")],12,_hoisted_1$5),[[vue.vShow,k.visible]])],8,["to","disabled"]))}}),_e=vue.defineComponent({__name:"CheckboxIcon",props:{checked:{type:Boolean}},setup(k){return(t,e)=>(vue.openBlock(),vue.createElementBlock("svg",{class:vue.normalizeClass(["checkbox-svg",{"checkbox-svg--checked":k.checked}]),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...e[0]||(e[0]=[vue.createElementVNode("rect",{class:"checkbox-bg",x:"1",y:"1",width:"18",height:"18",rx:"3",ry:"3"},null,-1),vue.createElementVNode("path",{class:"checkbox-check",d:"M 4.5 10 L 8.5 14 L 15.5 6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),_hoisted_1$4={class:"map-checkbox-legend__title"},_hoisted_2$4={class:"map-checkbox-legend__rows"},_hoisted_3$3=["checked","onChange"],_hoisted_4$2={class:"map-checkbox-legend__label"},_sfc_main$9=vue.defineComponent({__name:"MapCheckboxLegend",props:{items:{},modelValue:{},title:{default:"Legend"},position:{default:"bottom-left"},visible:{type:Boolean,default:!0},leaveRoomForControls:{type:Boolean,default:!0},teleportTo:{default:null},className:{}},emits:["update:modelValue","change"],setup(k,{emit:t}){const e=k,n=t;function i(c){return e.modelValue.includes(c)}function r(c,u){const l=u.target.checked,f=l?[...e.modelValue,c]:e.modelValue.filter(o=>o!==c);n("update:modelValue",f),n("change",c,l)}return(c,u)=>(vue.openBlock(),vue.createBlock(_sfc_main$a,{position:k.position,visible:k.visible,"leave-room-for-controls":k.leaveRoomForControls,"aria-label":k.title,"teleport-to":k.teleportTo},{default:vue.withCtx(()=>[vue.createElementVNode("h4",_hoisted_1$4,vue.toDisplayString(k.title),1),vue.createElementVNode("div",_hoisted_2$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.items,l=>(vue.openBlock(),vue.createElementBlock("label",{key:l.value,class:"map-checkbox-legend__row"},[vue.createElementVNode("input",{type:"checkbox",class:"map-checkbox-legend__input",checked:i(l.value),onChange:f=>r(l.value,f)},null,40,_hoisted_3$3),vue.createVNode(vue.unref(_e),{checked:i(l.value)},null,8,["checked"]),vue.createElementVNode("span",{class:"map-checkbox-legend__swatch",style:vue.normalizeStyle({backgroundColor:l.color}),"aria-hidden":"true"},null,4),vue.createElementVNode("span",_hoisted_4$2,vue.toDisplayString(l.label),1)]))),128))])]),_:1},8,["position","visible","leave-room-for-controls","aria-label","teleport-to"]))}}),MapCheckboxLegend=_export_sfc(_sfc_main$9,[["__scopeId","data-v-edabb1fa"]]),rulersImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAGJJREFUOI1jYGBgOM3AwPAfCTMwMDA8QxPDhT8xoAlIM5AG/jMi2QoDjKQYwITEkSFRM9w2qrkA5oqBc8EIDYNHDAzkp0I4QE/fMDF5YvnoBsiTwscWBiQBJgYGhpMU6D8CAJDrOVecOVsbAAAAAElFTkSuQmCC",_hoisted_1$3={"aria-live":"polite",class:"draw-tool-sr-only"},_hoisted_2$3=["innerHTML"],drawLayerId="drawing-polygon-layer",drawLineLayerId="drawing-polygon-line-layer",drawPointsLayerId="drawing-points-layer",drawLabelsLayerId="drawing-labels-layer",completedPolygonsLayerId="completed-polygons-layer",completedPolygonsLineLayerId="completed-polygons-line-layer",completedPolygonsPointLayerId="completed-polygons-point-layer",completedPolygonsPointsLayerId="completed-polygons-points-layer",completedPolygonsLabelsLayerId="completed-polygons-labels-layer",_sfc_main$8=vue.defineComponent({__name:"DrawTool",props:{icon:{},image:{},position:{default:"top-right"},title:{default:"Draw Tool"},iconSize:{},size:{},teleportTo:{default:void 0},className:{}},emits:["polygonComplete"],setup(k,{emit:t}){const e=k,n=e.icon?void 0:e.image||rulersImage,i=t,r=vue.inject("isDrawing",vue.ref(!1)),c=vue.ref(""),u=vue.ref([]),l=vue.ref([]),f=vue.ref(null);let o=null,s=null,a=null;const h=(Te,De)=>{const Ue=Te.lat*Math.PI/180,Ie=De.lat*Math.PI/180,Pe=(De.lat-Te.lat)*Math.PI/180,jt=(De.lng-Te.lng)*Math.PI/180,Nt=Math.sin(Pe/2)*Math.sin(Pe/2)+Math.cos(Ue)*Math.cos(Ie)*Math.sin(jt/2)*Math.sin(jt/2);return(6371e3*(2*Math.atan2(Math.sqrt(Nt),Math.sqrt(1-Nt)))*3.28084).toFixed(2)},m=(Te,De)=>({lng:(Te.lng+De.lng)/2,lat:(Te.lat+De.lat)/2}),v=Te=>{if(Te.length<2)return"0";let De=0;for(let Lt=1;Lt<Te.length;Lt++)De+=parseFloat(h(Te[Lt-1],Te[Lt]));return Te.length>=3&&(De+=parseFloat(h(Te[Te.length-1],Te[0]))),De.toFixed(2)},b=()=>{G?.value&&(o&&(G.value.off("click",o),o=null),s&&(G.value.off("dblclick",s),s=null))},_=Te=>{if(Te.length<3)return"0";const De=Te.reduce((Nt,Ht)=>Nt+Ht.lat,0)/Te.length,Lt=111320,Ue=111320*Math.cos(De*Math.PI/180),Ie=Te.map(Nt=>({x:Nt.lng*Ue,y:Nt.lat*Lt}));let Pe=0;for(let Nt=0;Nt<Ie.length;Nt++){const Ht=(Nt+1)%Ie.length;Pe+=Ie[Nt].x*Ie[Ht].y,Pe-=Ie[Ht].x*Ie[Nt].y}return Pe=Math.abs(Pe)/2,(Pe*10.7639).toFixed(2)},w=()=>{if(u.value.length<1)return;const Te=`shape-${Date.now()}`;if(u.value.length===1){const Ue=u.value[0];l.value.push({id:Te,coordinates:[[Ue.lng,Ue.lat]],points:[Ue],isLine:!1,isPoint:!0}),f.value=Te,c.value="Shape completed",i("polygonComplete",{type:"Point",coordinates:[Ue.lng,Ue.lat]}),u.value=[],b(),G?.value&&(G.value.getCanvas().style.cursor="");return}const De=u.value.map(Ue=>[Ue.lng,Ue.lat]),Lt=u.value.length>=3;Lt&&De.push(De[0]),l.value.push({id:Te,coordinates:De,points:[...u.value],isLine:!Lt,isPoint:!1}),f.value=Te,c.value="Shape completed",Lt?i("polygonComplete",{type:"Polygon",coordinates:[De]}):i("polygonComplete",{type:"LineString",coordinates:De}),u.value=[],b(),G?.value&&(G.value.getCanvas().style.cursor="")},j=w,E=()=>{if(!f.value)return;const Te=l.value.findIndex(De=>De.id===f.value);Te!==-1&&(l.value.splice(Te,1),f.value=null,c.value="Shape deleted")},A=()=>{u.value=[],b(),r.value=!1,c.value="Drawing mode ended",G?.value&&(G.value.getCanvas().style.cursor="")},O=()=>{u.value.length>=1&&w()},M=()=>{if(!G?.value)return;a=Ue=>{const Ie=Ue.originalEvent?.target;if(!(Ie&&(Ie.closest(".vertices-table")||Ie.closest(".maplibregl-ctrl")))&&f.value!==null&&u.value.length===0)try{const Pe=G.value?.getLayer(completedPolygonsLayerId)?G.value.queryRenderedFeatures(Ue.point,{layers:[completedPolygonsLayerId]}):[],jt=G.value?.getLayer(completedPolygonsLineLayerId)?G.value.queryRenderedFeatures(Ue.point,{layers:[completedPolygonsLineLayerId]}):[],Nt=G.value?.getLayer(completedPolygonsPointLayerId)?G.value.queryRenderedFeatures(Ue.point,{layers:[completedPolygonsPointLayerId]}):[];(Pe.length>0?Pe:jt.length>0?jt:Nt).length===0&&(f.value=null)}catch{}},G.value.on("click",a);let Te=null,De=null;G.value.on("mouseenter",completedPolygonsPointsLayerId,()=>{const Ue=z();Ue&&!Ue.isPoint&&G?.value&&(G.value.getCanvas().style.cursor="move")}),G.value.on("mouseenter",completedPolygonsPointLayerId,()=>{const Ue=z();Ue&&Ue.isPoint&&G?.value&&(G.value.getCanvas().style.cursor="move")}),G.value.on("mouseleave",completedPolygonsPointsLayerId,()=>{!r.value&&G?.value&&(G.value.getCanvas().style.cursor="")}),G.value.on("mouseleave",completedPolygonsPointLayerId,()=>{!r.value&&G?.value&&(G.value.getCanvas().style.cursor="")});const Lt=(Ue,Ie)=>{const Pe=z();if(!Pe||!Ue.features||Ue.features.length===0||!G?.value)return;const jt=Ue.features[0];if(!jt.properties?.active)return;Ue.preventDefault(),Ie?(Te=0,De=Pe.id):(Te=jt.properties.index,De=jt.properties.polygonId),G.value.getCanvas().style.cursor="grabbing";const Nt=Xt=>{if(Te===null||De===null)return;const Kt=l.value.find(Yt=>Yt.id===De);if(!Kt)return;const Mt=Xt.lngLat;Kt.points[Te]={lat:Mt.lat,lng:Mt.lng},Kt.isPoint?Kt.coordinates=[[Mt.lng,Mt.lat]]:(Kt.coordinates=Kt.points.map(Yt=>[Yt.lng,Yt.lat]),Kt.isLine||Kt.coordinates.push(Kt.coordinates[0]))},Ht=()=>{Te=null,De=null,G?.value&&(G.value.getCanvas().style.cursor="move",G.value.off("mousemove",Nt),G.value.off("mouseup",Ht))};G.value.on("mousemove",Nt),G.value.on("mouseup",Ht)};G.value.on("mousedown",completedPolygonsPointsLayerId,Ue=>{Lt(Ue,!1)}),G.value.on("mousedown",completedPolygonsPointLayerId,Ue=>{Lt(Ue,!0)})},C=Te=>{const De=Te.originalEvent?.target;if(!(De&&(De.closest(".vertices-table")||De.closest(".maplibregl-ctrl")))&&Te.features&&Te.features.length>0){const Lt=Te.features[0].properties?.id;Lt&&(r.value=!0,f.value=Lt)}},N=()=>{G?.value&&(r.value=!r.value,r.value?(G.value.getCanvas().style.cursor="crosshair",u.value=[],c.value="Drawing mode active",o=Te=>{if(G?.value){if(u.value.length>=3){const De=u.value[0],Lt=Te.lngLat,Ue=G.value.project([De.lng,De.lat]),Ie=G.value.project([Lt.lng,Lt.lat]);if(Math.sqrt(Math.pow(Ue.x-Ie.x,2)+Math.pow(Ue.y-Ie.y,2))<10){j();return}}u.value.push(Te.lngLat),c.value=`Point added, ${u.value.length} point${u.value.length===1?"":"s"} total`}},s=Te=>{Te.preventDefault(),u.value.length>0&&u.value.pop(),u.value.length>=1&&w()},G.value.on("click",o),G.value.on("dblclick",s)):(b(),u.value=[],c.value="Drawing mode ended",G.value.getCanvas().style.cursor=""))},z=()=>{if(f.value!==null)return l.value.find(Te=>Te.id===f.value)},B=()=>{if(r.value&&u.value.length>0)return u.value;const Te=z();return Te?Te.points:[]},V=()=>{const Te=B();if(Te.length===0&&r.value)return`
13
+ `},m=()=>{if(!u)return;const _=u.getElement();if(!_)return;const w=_.querySelector('[data-action="previous"]'),j=_.querySelector('[data-action="next"]');w&&w.addEventListener("click",E=>{E.stopPropagation(),n("previous")}),j&&j.addEventListener("click",E=>{E.stopPropagation(),n("next")})},v=()=>{if(o&&u){const _=u.getElement();_&&_.removeEventListener("keydown",o),o=null}},b=()=>{u&&(v(),u.remove(),u=null)};return vue.watch(()=>c?.value,_=>{_&&r?.value&&!u&&a()}),vue.watch(()=>e.lngLat,_=>{u&&_&&(u.setLngLat(_),s())}),vue.watch([()=>e.html,()=>e.currentFeatureIndex,()=>e.showNavigation],([_])=>{if(u&&_&&!i.default){let w="";e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&(w+=h()),w+=`<div class="popup-scroll-content">${_}</div>`,u.setHTML(w),e.showNavigation&&e.totalFeatures&&e.totalFeatures>1&&setTimeout(()=>{m()},0)}}),vue.onMounted(()=>{c?.value&&r?.value&&vue.nextTick(()=>{a()})}),vue.onBeforeUnmount(()=>{b()}),(_,w)=>_.$slots.default?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref_key:"slotContainer",ref:l,class:"popup-scroll-content"},[vue.renderSlot(_.$slots,"default")],512)):vue.createCommentVNode("",!0)}}),LAYER_EVENTS=["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"];function useVectorLayer(k,t){const e=vue.inject("map"),n=vue.inject("isLoaded"),i=vue.inject("registerClickableLayer"),r=vue.inject("unregisterClickableLayer"),c=vue.ref(!1);let u=!0,l=JSON.stringify(vue.unref(k.source));const f=[];let o=null;const s=vue.getCurrentInstance(),a=!!s?.vnode.props?.onClick,h=_=>{if(!e?.value)return;const w=vue.unref(k.id),j=vue.unref(k.source),E=vue.unref(k.sourceLayer),A=vue.unref(k.paint),O=vue.unref(k.layout),M=vue.unref(k.filter),C=vue.unref(k.minzoom),N=vue.unref(k.maxzoom),z=vue.unref(k.beforeId);typeof j=="object"&&(e.value.getSource(w)||e.value.addSource(w,j));const B={id:w,type:k.type,source:typeof j=="object"?w:j,paint:A||{},layout:O||{}};if(E&&(B["source-layer"]=E),M&&(B.filter=M),C!==void 0&&(B.minzoom=C),N!==void 0&&(B.maxzoom=N),!e.value.getLayer(w)){const V=_??z;let q;V&&e.value.getLayer(V)&&(q=V),e.value.addLayer(B,q),c.value=!0,v(),a&&i&&i(w)}},m=()=>{if(!e?.value)return;const _=vue.unref(k.id),w=vue.unref(k.source);try{a&&r&&r(_),b(),e.value.getLayer?.(_)&&(e.value.removeLayer(_),c.value=!1),typeof w=="object"&&e.value.getSource?.(_)&&e.value.removeSource(_)}catch{}},v=()=>{if(!e?.value||!s?.vnode.props)return;const _=vue.unref(k.id);for(const w of LAYER_EVENTS){const j=`on${w.charAt(0).toUpperCase()}${w.slice(1)}`;if(s.vnode.props[j])if(w==="click")o=A=>{const O=[[A.point.x-10,A.point.y-10],[A.point.x+10,A.point.y+10]],M=e.value.queryRenderedFeatures(O,{layers:[_]});if(M.length>0){const C=A;C.features=M,t("click",C)}},e.value.on("click",o);else{const E=A=>{t(w,A)};e.value.on(w,_,E),f.push({event:w,handler:E})}}if(a){const w=()=>{e?.value&&(e.value.getCanvas().style.cursor="pointer")},j=()=>{e?.value&&(e.value.getCanvas().style.cursor="")};e.value.on("mouseenter",_,w),e.value.on("mouseleave",_,j),f.push({event:"mouseenter",handler:w}),f.push({event:"mouseleave",handler:j})}},b=()=>{if(!e?.value)return;const _=vue.unref(k.id);for(const{event:w,handler:j}of f)try{e.value.off(w,_,j)}catch{}if(f.length=0,o){try{e.value.off("click",o)}catch{}o=null}};return vue.watch(()=>n?.value,_=>{try{if(!u||!_||!e?.value)return;h()}catch{}},{immediate:!0}),vue.watch(()=>vue.unref(k.paint),_=>{try{const w=vue.unref(k.id);if(!u||!e?.value?.getLayer?.(w)||!_)return;Object.keys(_).forEach(j=>{!u||!e?.value||e.value.setPaintProperty(w,j,_[j])})}catch{}},{deep:!0}),vue.watch(()=>vue.unref(k.layout),_=>{try{const w=vue.unref(k.id);if(!u||!e?.value?.getLayer?.(w)||!_)return;Object.keys(_).forEach(j=>{!u||!e?.value||e.value.setLayoutProperty(w,j,_[j])})}catch{}},{deep:!0}),vue.watch(()=>vue.unref(k.filter),_=>{try{const w=vue.unref(k.id);if(!u||!e?.value?.getLayer?.(w))return;e.value.setFilter(w,_)}catch{}}),vue.watch(()=>vue.unref(k.source),_=>{try{if(!u||!e?.value)return;const w=vue.unref(k.id),j=JSON.stringify(_);if(j===l)return;if(l=j,typeof _=="object"&&_.type==="geojson"){const E=e.value.getSource(w);if(E&&"setData"in E){E.setData(_.data);return}}m(),h()}catch{}},{deep:!0}),vue.onBeforeUnmount(()=>{u=!1}),vue.onUnmounted(()=>{m()}),{map:e,isLoaded:n,isLayerAdded:c,addLayer:h,removeLayer:m}}const _hoisted_1$a=["data-layer-id"],_sfc_main$f=vue.defineComponent({__name:"FillLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a}=vue.toRefs(e);return useVectorLayer({id:i,type:"fill",source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a},n),(h,m)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"fill"},null,8,_hoisted_1$a))}}),_hoisted_1$9=["data-layer-id"],_sfc_main$e=vue.defineComponent({__name:"LineLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a}=vue.toRefs(e);return useVectorLayer({id:i,type:"line",source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a},n),(h,m)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"line"},null,8,_hoisted_1$9))}}),_hoisted_1$8=["data-layer-id"],_sfc_main$d=vue.defineComponent({__name:"CircleLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a}=vue.toRefs(e);return useVectorLayer({id:i,type:"circle",source:r,sourceLayer:c,paint:u,layout:l,filter:f,minzoom:o,maxzoom:s,beforeId:a},n),(h,m)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"circle"},null,8,_hoisted_1$8))}}),_hoisted_1$7=["data-layer-id"],_sfc_main$c=vue.defineComponent({__name:"SymbolLayer",props:{paint:{default:()=>({})},layout:{default:()=>({})},icon:{default:void 0},iconName:{default:void 0},id:{},source:{},sourceLayer:{default:void 0},filter:{type:[Boolean,Array],default:void 0},minzoom:{default:void 0},maxzoom:{default:void 0},beforeId:{default:void 0},className:{}},emits:["click","dblclick","mouseenter","mouseleave","mousemove","mousedown","mouseup","contextmenu"],setup(k,{emit:t}){const e=k,n=t,{id:i,source:r,sourceLayer:c,paint:u,filter:l,minzoom:f,maxzoom:o,beforeId:s,icon:a,iconName:h}=vue.toRefs(e),m=vue.computed(()=>{const w=e.layout||{};return e.iconName?{...w,"icon-image":e.iconName}:w}),{map:v,isLoaded:b,removeLayer:_}=useVectorLayer({id:i,type:"symbol",source:r,sourceLayer:c,paint:u,layout:m,filter:l,minzoom:f,maxzoom:o,beforeId:s},n);return vue.watch(()=>b?.value,async w=>{if(!(!w||!v?.value||!a.value||!h.value)){if(v.value.hasImage(h.value)){v.value.triggerRepaint();return}try{const j=await v.value.loadImage(a.value);if(!v.value)return;v.value.hasImage(h.value)||v.value.addImage(h.value,j.data),v.value.triggerRepaint()}catch{_()}}},{immediate:!0}),vue.onUnmounted(()=>{if(!(!v?.value||!h.value))try{v.value.hasImage(h.value)&&v.value.removeImage(h.value)}catch{}}),(w,j)=>(vue.openBlock(),vue.createElementBlock("span",{style:{display:"none"},"data-layer-id":e.id,"data-layer-type":"symbol"},null,8,_hoisted_1$7))}}),_hoisted_1$6={key:0,class:"map-loading-overlay"},_hoisted_2$5={class:"map-loading-content"},_hoisted_3$4={class:"map-loading-text"},_sfc_main$b=vue.defineComponent({__name:"MapLoadingOverlay",props:{visible:{type:Boolean},text:{default:"Loading..."}},setup(k){return(t,e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:"overlay-fade"},{default:vue.withCtx(()=>[k.visible?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",_hoisted_2$5,[e[0]||(e[0]=vue.createElementVNode("div",{class:"map-loading-spinner"},null,-1)),vue.createElementVNode("span",_hoisted_3$4,vue.toDisplayString(k.text),1)])])):vue.createCommentVNode("",!0)]),_:1}))}}),MapLoadingOverlay=_export_sfc(_sfc_main$b,[["__scopeId","data-v-760930b2"]]),_hoisted_1$5=["aria-label"],_sfc_main$a=vue.defineComponent({__name:"MapFloatingPanel",props:{position:{default:"top-right"},visible:{type:Boolean,default:!0},offset:{default:()=>({x:10,y:10})},leaveRoomForControls:{type:Boolean,default:!0},ariaLabel:{default:"Map panel"},teleportTo:{default:null},className:{}},setup(k){const t=k,e=vue.ref(null);let n=null;vue.watch(()=>t.visible,r=>{r?(n=document.activeElement,vue.nextTick(()=>{e.value?.focus()})):n&&typeof n.focus=="function"&&(n.focus(),n=null)});const i=vue.computed(()=>{if(t.teleportTo)return{};const r={position:"absolute",zIndex:"1"},c=t.offset?.x??10,u=t.offset?.y??10,l=t.leaveRoomForControls?50:0;switch(t.position){case"top-right":r.top=`${u}px`,r.right=`${l+c}px`;break;case"top-left":r.top=`${u}px`,r.left=`${l+c}px`;break;case"bottom-right":r.bottom=`${u}px`,r.right=`${l+c}px`;break;case"bottom-left":r.bottom=`${u}px`,r.left=`${l+c}px`;break}return r});return(r,c)=>(vue.openBlock(),vue.createBlock(vue.Teleport,{to:k.teleportTo||"body",disabled:!k.teleportTo},[vue.withDirectives(vue.createElementVNode("div",{ref_key:"panelRef",ref:e,class:"map-floating-panel",style:vue.normalizeStyle(i.value),tabindex:"-1",role:"region","aria-label":k.ariaLabel},[vue.renderSlot(r.$slots,"default")],12,_hoisted_1$5),[[vue.vShow,k.visible]])],8,["to","disabled"]))}}),$e=vue.defineComponent({__name:"CheckboxIcon",props:{checked:{type:Boolean}},setup(k){return(t,e)=>(vue.openBlock(),vue.createElementBlock("svg",{class:vue.normalizeClass(["checkbox-svg",{"checkbox-svg--checked":k.checked}]),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...e[0]||(e[0]=[vue.createElementVNode("rect",{class:"checkbox-bg",x:"1",y:"1",width:"18",height:"18",rx:"3",ry:"3"},null,-1),vue.createElementVNode("path",{class:"checkbox-check",d:"M 4.5 10 L 8.5 14 L 15.5 6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),_hoisted_1$4={class:"map-checkbox-legend__title"},_hoisted_2$4={class:"map-checkbox-legend__rows"},_hoisted_3$3=["checked","onChange"],_hoisted_4$2={class:"map-checkbox-legend__label"},_sfc_main$9=vue.defineComponent({__name:"MapCheckboxLegend",props:{items:{},modelValue:{},title:{default:"Legend"},position:{default:"bottom-left"},visible:{type:Boolean,default:!0},leaveRoomForControls:{type:Boolean,default:!0},teleportTo:{default:null},className:{}},emits:["update:modelValue","change"],setup(k,{emit:t}){const e=k,n=t;function i(c){return e.modelValue.includes(c)}function r(c,u){const l=u.target.checked,f=l?[...e.modelValue,c]:e.modelValue.filter(o=>o!==c);n("update:modelValue",f),n("change",c,l)}return(c,u)=>(vue.openBlock(),vue.createBlock(_sfc_main$a,{position:k.position,visible:k.visible,"leave-room-for-controls":k.leaveRoomForControls,"aria-label":k.title,"teleport-to":k.teleportTo},{default:vue.withCtx(()=>[vue.createElementVNode("h4",_hoisted_1$4,vue.toDisplayString(k.title),1),vue.createElementVNode("div",_hoisted_2$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.items,l=>(vue.openBlock(),vue.createElementBlock("label",{key:l.value,class:"map-checkbox-legend__row"},[vue.createElementVNode("input",{type:"checkbox",class:"map-checkbox-legend__input",checked:i(l.value),onChange:f=>r(l.value,f)},null,40,_hoisted_3$3),vue.createVNode(vue.unref($e),{checked:i(l.value)},null,8,["checked"]),vue.createElementVNode("span",{class:"map-checkbox-legend__swatch",style:vue.normalizeStyle({backgroundColor:l.color}),"aria-hidden":"true"},null,4),vue.createElementVNode("span",_hoisted_4$2,vue.toDisplayString(l.label),1)]))),128))])]),_:1},8,["position","visible","leave-room-for-controls","aria-label","teleport-to"]))}}),MapCheckboxLegend=_export_sfc(_sfc_main$9,[["__scopeId","data-v-edabb1fa"]]),rulersImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAGJJREFUOI1jYGBgOM3AwPAfCTMwMDA8QxPDhT8xoAlIM5AG/jMi2QoDjKQYwITEkSFRM9w2qrkA5oqBc8EIDYNHDAzkp0I4QE/fMDF5YvnoBsiTwscWBiQBJgYGhpMU6D8CAJDrOVecOVsbAAAAAElFTkSuQmCC",_hoisted_1$3={"aria-live":"polite",class:"draw-tool-sr-only"},_hoisted_2$3=["innerHTML"],drawLayerId="drawing-polygon-layer",drawLineLayerId="drawing-polygon-line-layer",drawPointsLayerId="drawing-points-layer",drawLabelsLayerId="drawing-labels-layer",completedPolygonsLayerId="completed-polygons-layer",completedPolygonsLineLayerId="completed-polygons-line-layer",completedPolygonsPointLayerId="completed-polygons-point-layer",completedPolygonsPointsLayerId="completed-polygons-points-layer",completedPolygonsLabelsLayerId="completed-polygons-labels-layer",_sfc_main$8=vue.defineComponent({__name:"DrawTool",props:{icon:{},image:{},position:{default:"top-right"},title:{default:"Draw Tool"},iconSize:{},size:{},teleportTo:{default:void 0},className:{}},emits:["polygonComplete"],setup(k,{emit:t}){const e=k,n=e.icon?void 0:e.image||rulersImage,i=t,r=vue.inject("isDrawing",vue.ref(!1)),c=vue.ref(""),u=vue.ref([]),l=vue.ref([]),f=vue.ref(null);let o=null,s=null,a=null;const h=(Te,De)=>{const Ue=Te.lat*Math.PI/180,Ie=De.lat*Math.PI/180,Pe=(De.lat-Te.lat)*Math.PI/180,jt=(De.lng-Te.lng)*Math.PI/180,Nt=Math.sin(Pe/2)*Math.sin(Pe/2)+Math.cos(Ue)*Math.cos(Ie)*Math.sin(jt/2)*Math.sin(jt/2);return(6371e3*(2*Math.atan2(Math.sqrt(Nt),Math.sqrt(1-Nt)))*3.28084).toFixed(2)},m=(Te,De)=>({lng:(Te.lng+De.lng)/2,lat:(Te.lat+De.lat)/2}),v=Te=>{if(Te.length<2)return"0";let De=0;for(let Lt=1;Lt<Te.length;Lt++)De+=parseFloat(h(Te[Lt-1],Te[Lt]));return Te.length>=3&&(De+=parseFloat(h(Te[Te.length-1],Te[0]))),De.toFixed(2)},b=()=>{G?.value&&(o&&(G.value.off("click",o),o=null),s&&(G.value.off("dblclick",s),s=null))},_=Te=>{if(Te.length<3)return"0";const De=Te.reduce((Nt,Ht)=>Nt+Ht.lat,0)/Te.length,Lt=111320,Ue=111320*Math.cos(De*Math.PI/180),Ie=Te.map(Nt=>({x:Nt.lng*Ue,y:Nt.lat*Lt}));let Pe=0;for(let Nt=0;Nt<Ie.length;Nt++){const Ht=(Nt+1)%Ie.length;Pe+=Ie[Nt].x*Ie[Ht].y,Pe-=Ie[Ht].x*Ie[Nt].y}return Pe=Math.abs(Pe)/2,(Pe*10.7639).toFixed(2)},w=()=>{if(u.value.length<1)return;const Te=`shape-${Date.now()}`;if(u.value.length===1){const Ue=u.value[0];l.value.push({id:Te,coordinates:[[Ue.lng,Ue.lat]],points:[Ue],isLine:!1,isPoint:!0}),f.value=Te,c.value="Shape completed",i("polygonComplete",{type:"Point",coordinates:[Ue.lng,Ue.lat]}),u.value=[],b(),G?.value&&(G.value.getCanvas().style.cursor="");return}const De=u.value.map(Ue=>[Ue.lng,Ue.lat]),Lt=u.value.length>=3;Lt&&De.push(De[0]),l.value.push({id:Te,coordinates:De,points:[...u.value],isLine:!Lt,isPoint:!1}),f.value=Te,c.value="Shape completed",Lt?i("polygonComplete",{type:"Polygon",coordinates:[De]}):i("polygonComplete",{type:"LineString",coordinates:De}),u.value=[],b(),G?.value&&(G.value.getCanvas().style.cursor="")},j=w,E=()=>{if(!f.value)return;const Te=l.value.findIndex(De=>De.id===f.value);Te!==-1&&(l.value.splice(Te,1),f.value=null,c.value="Shape deleted")},A=()=>{u.value=[],b(),r.value=!1,c.value="Drawing mode ended",G?.value&&(G.value.getCanvas().style.cursor="")},O=()=>{u.value.length>=1&&w()},M=()=>{if(!G?.value)return;a=Ue=>{const Ie=Ue.originalEvent?.target;if(!(Ie&&(Ie.closest(".vertices-table")||Ie.closest(".maplibregl-ctrl")))&&f.value!==null&&u.value.length===0)try{const Pe=G.value?.getLayer(completedPolygonsLayerId)?G.value.queryRenderedFeatures(Ue.point,{layers:[completedPolygonsLayerId]}):[],jt=G.value?.getLayer(completedPolygonsLineLayerId)?G.value.queryRenderedFeatures(Ue.point,{layers:[completedPolygonsLineLayerId]}):[],Nt=G.value?.getLayer(completedPolygonsPointLayerId)?G.value.queryRenderedFeatures(Ue.point,{layers:[completedPolygonsPointLayerId]}):[];(Pe.length>0?Pe:jt.length>0?jt:Nt).length===0&&(f.value=null)}catch{}},G.value.on("click",a);let Te=null,De=null;G.value.on("mouseenter",completedPolygonsPointsLayerId,()=>{const Ue=z();Ue&&!Ue.isPoint&&G?.value&&(G.value.getCanvas().style.cursor="move")}),G.value.on("mouseenter",completedPolygonsPointLayerId,()=>{const Ue=z();Ue&&Ue.isPoint&&G?.value&&(G.value.getCanvas().style.cursor="move")}),G.value.on("mouseleave",completedPolygonsPointsLayerId,()=>{!r.value&&G?.value&&(G.value.getCanvas().style.cursor="")}),G.value.on("mouseleave",completedPolygonsPointLayerId,()=>{!r.value&&G?.value&&(G.value.getCanvas().style.cursor="")});const Lt=(Ue,Ie)=>{const Pe=z();if(!Pe||!Ue.features||Ue.features.length===0||!G?.value)return;const jt=Ue.features[0];if(!jt.properties?.active)return;Ue.preventDefault(),Ie?(Te=0,De=Pe.id):(Te=jt.properties.index,De=jt.properties.polygonId),G.value.getCanvas().style.cursor="grabbing";const Nt=Xt=>{if(Te===null||De===null)return;const Kt=l.value.find(Yt=>Yt.id===De);if(!Kt)return;const Mt=Xt.lngLat;Kt.points[Te]={lat:Mt.lat,lng:Mt.lng},Kt.isPoint?Kt.coordinates=[[Mt.lng,Mt.lat]]:(Kt.coordinates=Kt.points.map(Yt=>[Yt.lng,Yt.lat]),Kt.isLine||Kt.coordinates.push(Kt.coordinates[0]))},Ht=()=>{Te=null,De=null,G?.value&&(G.value.getCanvas().style.cursor="move",G.value.off("mousemove",Nt),G.value.off("mouseup",Ht))};G.value.on("mousemove",Nt),G.value.on("mouseup",Ht)};G.value.on("mousedown",completedPolygonsPointsLayerId,Ue=>{Lt(Ue,!1)}),G.value.on("mousedown",completedPolygonsPointLayerId,Ue=>{Lt(Ue,!0)})},C=Te=>{const De=Te.originalEvent?.target;if(!(De&&(De.closest(".vertices-table")||De.closest(".maplibregl-ctrl")))&&Te.features&&Te.features.length>0){const Lt=Te.features[0].properties?.id;Lt&&(r.value=!0,f.value=Lt)}},N=()=>{G?.value&&(r.value=!r.value,r.value?(G.value.getCanvas().style.cursor="crosshair",u.value=[],c.value="Drawing mode active",o=Te=>{if(G?.value){if(u.value.length>=3){const De=u.value[0],Lt=Te.lngLat,Ue=G.value.project([De.lng,De.lat]),Ie=G.value.project([Lt.lng,Lt.lat]);if(Math.sqrt(Math.pow(Ue.x-Ie.x,2)+Math.pow(Ue.y-Ie.y,2))<10){j();return}}u.value.push(Te.lngLat),c.value=`Point added, ${u.value.length} point${u.value.length===1?"":"s"} total`}},s=Te=>{Te.preventDefault(),u.value.length>0&&u.value.pop(),u.value.length>=1&&w()},G.value.on("click",o),G.value.on("dblclick",s)):(b(),u.value=[],c.value="Drawing mode ended",G.value.getCanvas().style.cursor=""))},z=()=>{if(f.value!==null)return l.value.find(Te=>Te.id===f.value)},B=()=>{if(r.value&&u.value.length>0)return u.value;const Te=z();return Te?Te.points:[]},V=()=>{const Te=B();if(Te.length===0&&r.value)return`
14
14
  <div class="draw-instructions">
15
15
  <div class="instructions-title">Measure distances and areas</div>
16
16
  <div class="instructions-text">Start creating a measurement by adding points to the map.</div>