@ulb-darmstadt/shacl-form 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/assets/{mode-BZASEKwb.js → mode-Bjl1P7KJ.js} +2 -2
- package/dist/assets/mode-C_BqcQqf.js +13 -0
- package/dist/assets/query-DOX-ExQB.js +91 -0
- package/dist/assets/{query-D2xZjtP6.js → query-Y4qLEXu3.js} +50 -47
- package/dist/bundle.js +24 -22
- package/dist/config.d.ts +2 -0
- package/dist/constants.d.ts +1 -0
- package/dist/form.d.ts +7 -0
- package/dist/graph-loader.d.ts +2 -2
- package/dist/index.js +17 -15
- package/dist/plugins/assets/property-template-DgV0sNnv.js +1 -0
- package/dist/plugins/file-upload.js +1 -1
- package/dist/plugins/leaflet.js +1 -1
- package/dist/sparql.js +1 -1
- package/dist/theme.d.ts +2 -0
- package/package.json +2 -2
- package/dist/assets/mode-_I_CsUK6.js +0 -13
- package/dist/assets/query-CWN5zxbg.js +0 -87
- package/dist/plugins/assets/property-template-r31Q9rrE.js +0 -1
package/dist/bundle.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,D as r,E as i,G as a,H as o,J as s,L as c,M as l,O as u,P as d,Q as f,R as p,S as m,T as ee,V as h,W as g,X as te,Y as ne,Z as re,_ as ie,
|
|
1
|
+
import{A as e,B as t,C as n,D as r,E as i,G as a,H as o,J as s,L as c,M as l,O as u,P as d,Q as f,R as p,S as m,T as ee,V as h,W as g,X as te,Y as ne,Z as re,_ as ie,_t as ae,at as oe,c as se,ct as _,d as v,dt as ce,et as le,f as ue,ft as y,g as de,gt as b,h as fe,ht as x,i as S,it as C,j as w,l as T,lt as E,m as D,mt as pe,n as me,ot as he,pt as ge,q as _e,r as ve,rt as ye,s as be,st as xe,t as Se,u as Ce,ut as we,w as Te,x as Ee,y as De,z as Oe}from"./assets/query-Y4qLEXu3.js";var ke=`
|
|
2
2
|
.editor:not([type='checkbox']) { border: 1px solid var(--shacl-border-color, #DDD); }
|
|
3
|
-
.property-instance label { display: inline-flex; word-break: break-word; line-height: 1em; padding-
|
|
3
|
+
.property-instance label { display: inline-flex; align-self: center; word-break: break-word; line-height: 1em; padding-right: 1em; flex-shrink: 0; position: relative; }
|
|
4
|
+
.property-instance:has(> .editor:is(textarea, rokit-textarea)) > label { align-self: flex-start; padding-top: 0.45em; }
|
|
4
5
|
.property-instance:not(:first-child) > label:not(.persistent) { visibility: hidden; max-height: 0; }
|
|
5
6
|
.mode-edit .property-instance label { width: var(--label-width); }
|
|
6
|
-
`,
|
|
7
|
+
`,Ae=class extends r{constructor(e){super(e||ke),this.idCtr=0}createDefaultTemplate(e,t,n,r,i){let a=t??i?.defaultValue??null;if(r.id=`e${this.idCtr++}`,r.classList.add(`editor`),r.setAttribute(`part`,`editor`),i?.datatype?r.shaclDatatype=i.datatype:t instanceof ge&&(r.shaclDatatype=t.datatype),i&&l(i)>0&&(r.dataset.minCount=String(l(i))),i?.class&&(r.dataset.class=i.class.value),i?.nodeKind)r.dataset.nodeKind=i.nodeKind.value;else if(t&&(t instanceof pe||i?.nodeKind?.equals(C))&&(r.dataset.nodeKind=le+`IRI`,i)){let e=_e(i.config.store.getQuads(t,null,null,null),i.config.languages);e&&(t=y.literal(e))}(i?.hasValue&&t||i?.readonly)&&(r.disabled=!0);let o=t?.value||i?.defaultValue?.value||``;t instanceof ce?o=t.id:t instanceof pe&&i?.nodeKind?.value===`http://www.w3.org/ns/shacl#IRIOrLiteral`&&(o=`<${t.value}>`),i?.datatype?.equals(E)?r.checked=t?.value===`true`||i?.defaultValue?.value===`true`:r.type===`file`?r.binaryData=o||void 0:r.value=o,Te(r,a);let s=document.createElement(`label`);s.htmlFor=r.id,s.innerText=e,s.setAttribute(`part`,`label`),i?.description&&s.setAttribute(`title`,i.description.value);let c=i?.description?i.description.value:i?.pattern?i.pattern:null;c&&r.setAttribute(`placeholder`,c),n&&(r.setAttribute(`required`,`true`),s.classList.add(`required`));let u=document.createElement(`div`);return u.setAttribute(`part`,`field`),u.appendChild(s),u.appendChild(r),u}createDateEditor(e,t,n,r){let i=new fe;r.datatype?.value===`http://www.w3.org/2001/XMLSchema#dateTime`?(i.type=`datetime-local`,i.setAttribute(`step`,`1`)):i.type=`date`,i.clearable=!0,i.dense=this.dense,i.classList.add(`pr-0`);let a=this.createDefaultTemplate(e,null,n,i,r);if(t){let e=r.datatype?.value===`http://www.w3.org/2001/XMLSchema#dateTime`?s(t.value):ne(t.value);e?(i.value=e.value,e.suffix&&(i.dataset.xsdTemporalSuffix=e.suffix)):console.error(`unable to parse xsd date literal`,t),Te(i,t)}return a}createTextEditor(e,t,n,r){let i;return r.singleLine===!1?(i=new ue,i.resize=`auto`):i=new fe,i.dense=this.dense,r.pattern&&(i.pattern=r.pattern),r.minLength&&(i.minLength=r.minLength),r.maxLength&&(i.maxLength=r.maxLength),this.createDefaultTemplate(e,t,n,i,r)}createLangStringEditor(e,t,n,r){let i=this.createTextEditor(e,t,n,r),a=i.querySelector(`:scope .editor`),o;if(r.languageIn?.length){o=document.createElement(`select`);for(let e of r.languageIn){let t=document.createElement(`option`);t.innerText=e.value,o.appendChild(t)}}else o=document.createElement(`input`),o.maxLength=5,o.size=5,o.placeholder=`lang?`;return o.title=`Language of the text`,o.classList.add(`lang-chooser`),o.setAttribute(`part`,`lang-chooser`),o.slot=`suffix`,a.addEventListener(`change`,()=>{o.required=a.value!==``}),o.addEventListener(`change`,e=>{e.stopPropagation(),a&&(a.dataset.lang=o.value,a.dispatchEvent(new Event(`change`,{bubbles:!0})))}),t instanceof ge&&(o.value=t.language),a.dataset.lang=o.value,Te(a,t??r.defaultValue),a.appendChild(o),i}createBooleanEditor(e,t,n,r){let i=document.createElement(`input`);i.type=`checkbox`,i.classList.add(`ml-0`);let a=this.createDefaultTemplate(e,null,n,i,r);return i.removeAttribute(`required`),a.querySelector(`:scope label`)?.classList.remove(`required`),t instanceof ge&&(i.checked=t.value===`true`,Te(i,t)),a}createFileEditor(e,t,n,r){let i=document.createElement(`input`);return i.type=`file`,i.addEventListener(`change`,e=>{if(i.files?.length){e.stopPropagation();let t=new FileReader;t.readAsDataURL(i.files[0]),t.onload=()=>{i.binaryData=btoa(t.result),i.parentElement?.dispatchEvent(new Event(`change`,{bubbles:!0}))}}else i.binaryData=void 0}),this.createDefaultTemplate(e,t,n,i,r)}createNumberEditor(e,t,n,r){let i=new fe,a=f.has(r.datatype?.value??``);i.type=a?`text`:`number`,a&&(i.pattern=r.datatype?.value===`http://www.w3.org/2001/XMLSchema#decimal`?`[+\\-]?(?:[0-9]+(?:[.,][0-9]*)?|[.,][0-9]+)`:`[+\\-]?(?:[0-9]+(?:[.,][0-9]*)?|[.,][0-9]+)(?:[eE][+\\-]?[0-9]+)?`,i.updateComplete.then(()=>{i.inputElement.inputMode=`decimal`})),i.clearable=!0,i.dense=this.dense,i.classList.add(`pr-0`);let o=r.minInclusive===void 0?r.minExclusive===void 0?void 0:r.minExclusive+1:r.minInclusive,s=r.maxInclusive===void 0?r.maxExclusive===void 0?void 0:r.maxExclusive-1:r.maxInclusive;return o!==void 0&&(i.min=String(o)),s!==void 0&&(i.max=String(s)),!a&&r.datatype?.value!==`http://www.w3.org/2001/XMLSchema#integer`&&(i.step=`any`),this.createDefaultTemplate(e,t,n,i,r)}createListEditor(e,t,n,r,a){let o=new D;o.clearable=!0,o.dense=this.dense;let s=this.createDefaultTemplate(e,null,n,o,a),c=document.createElement(`ul`),l=[],u=!0,d=(e,t)=>{let n=document.createElement(`li`);if(typeof e.value==`string`?(n.dataset.value=e.value,n.innerText=e.label?e.label:e.value):(n.dataset.value=i(e.value),l.push(e.value),n.innerText=e.label?e.label:e.value.value),t.appendChild(n),e.children?.length){u=!1;let t=document.createElement(`ul`);n.appendChild(t);for(let n of e.children)d(n,t)}};for(let e of r)d(e,c);return u||(o.collapse=!0),o.appendChild(c),ee(o,l),t=t??a?.defaultValue??null,t&&(o.value=i(t),Te(o,t)),s}createButton(e,t){let n=new ie;return n.dense=this.dense,n.innerHTML=e,t?(n.setAttribute(`primary`,``),n.setAttribute(`part`,`button primary`)):n.setAttribute(`part`,`button`),n}};function je(e){return`_:`+e.value}function Me(e,t){return[...e].map(e=>t(e)).join(`
|
|
7
8
|
`)+`
|
|
8
|
-
`}function je(){return``}function Me(e){return`<`+e.value+`>`}var Ne=/["\\\\\n\r]/,Pe=/["\\\\\n\r]/g,Fe={'"':`\\"`,"\\":`\\\\`,"\n":`\\n`,"\r":`\\r`};function Ie(e){return Fe[e]}function Le(e){return Ne.test(e)?e.replace(Pe,Ie):e}function Re(e){let t=Le(e.value);return e.datatype.value===`http://www.w3.org/2001/XMLSchema#string`?`"`+t+`"`:e.datatype.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`?`"`+t+`"@`+e.language:`"`+t+`"^^`+Me(e.datatype)}function ze(e,t){let n=t(e.subject),r=t(e.predicate),i=t(e.object),a=t(e.graph);return`${n} ${r} ${i} ${a?a+` `:``}.`}function Be(e){return`?`+e.value}function k(e){if(!e)return null;if(e.termType===`BlankNode`)return ke(e);if(e.termType===`DefaultGraph`)return je();if(e.termType===`Literal`)return Re(e);if(e.termType===`NamedNode`)return Me(e);if(e.termType===`Quad`||e.subject&&e.predicate&&e.object&&e.graph)return ze(e,k);if(e.termType===`Variable`)return Be(e);if(e[Symbol.iterator])return Ae(e,k);throw Error(`unknown termType ${e.termType}`)}var A=class{constructor(e){if(this.index=new Map,e)for(let[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(k(e))}*entries(){for(let[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(let n of this.entries())e.call(t,n[1],n[0],this)}get(e){let t=this.index.get(k(e));return t&&t.value}has(e){return this.index.has(k(e))}*keys(){for(let[,{term:e}]of this.index)yield e}set(e,t){let n=k(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(let[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}},Ve=class{constructor({dataset:e,end:t,quad:n,start:r}){this.dataset=e,this.end=t,this.quad=n,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};function He(e){try{return k(e)}catch{return null}}var j=class{constructor(e){if(this.index=new Map,e)for(let t of e)this.add(t)}get size(){return this.index.size}add(e){let t=k(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(He(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(He(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}},Ue=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Ue.prototype.termType=`BlankNode`;var We=class{equals(e){return!!e&&e.termType===this.termType}};We.prototype.termType=`DefaultGraph`,We.prototype.value=``;function Ge(e,t){if(!t)return null;if(t.termType===`BlankNode`)return e.blankNode(t.value);if(t.termType===`DefaultGraph`)return e.defaultGraph();if(t.termType===`Literal`)return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if(t.termType===`NamedNode`)return e.namedNode(t.value);if(t.termType===`Quad`){let n=e.fromTerm(t.subject),r=e.fromTerm(t.predicate),i=e.fromTerm(t.object),a=e.fromTerm(t.graph);return e.quad(n,r,i,a)}if(t.termType===`Variable`)return e.variable(t.value);throw Error(`unknown termType ${t.termType}`)}var Ke=class{constructor(e,t,n,r=``){this.value=e,this.language=t,this.datatype=n,this.direction=r}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||``)===this.direction}};Ke.prototype.termType=`Literal`;var qe=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};qe.prototype.termType=`NamedNode`;var Je=class{constructor(e,t,n,r){this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&(e.termType===`Quad`||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}};Je.prototype.termType=`Quad`,Je.prototype.value=``;var Ye=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Ye.prototype.termType=`Variable`;var Xe=new qe(`http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString`),Ze=new qe(`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`),Qe=new qe(`http://www.w3.org/2001/XMLSchema#string`),$e=class{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new We}}namedNode(e){return new qe(e)}blankNode(e){return e||=`b`+ ++this._data.blankNodeCounter,new Ue(e)}literal(e,t){return typeof t==`string`?new Ke(e,t,Ze):typeof t?.language==`string`?new Ke(e,t.language,t.direction?Xe:Ze,t.direction):new Ke(e,``,t||Qe)}variable(e){return new Ye(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,r=this.defaultGraph()){return new Je(e,t,n,r)}fromTerm(e){return Ge(this,e)}fromQuad(e){return Ge(this,e)}};$e.exports=[`blankNode`,`defaultGraph`,`fromQuad`,`fromTerm`,`literal`,`namedNode`,`quad`,`variable`];var et=new $e,tt={apply:(e,t,n)=>e(n[0]),get:(e,t)=>e(t)};function M(e,{factory:t=et}={}){let n=(n=``)=>t.namedNode(`${e}${n.raw||n}`);return typeof Proxy>`u`?n:new Proxy(n,tt)}M(`http://www.w3.org/2001/XMLSchema#`);var N=M(`http://www.w3.org/1999/02/22-rdf-syntax-ns#`);M(`http://www.w3.org/2000/01/rdf-schema#`);var P=class e{static add({ptr:e,start:t,end:n,subjects:r=[null],predicates:i=[null],objects:a=[null],graphs:o,callback:s}={}){if(!e.factory)throw Error(`add operation requires a factory`);let c=()=>{};s&&(c=r=>{s(new Ve({dataset:e.dataset,start:t,end:n,quad:r}))});for(let n of r)for(let r of i)for(let i of a)for(let a of o){let o={subject:n,predicate:r,object:i,graph:a};o[t]=e.term;let s=e.factory.quad(o.subject,o.predicate,o.object,o.graph);e.dataset.add(s),c(s)}return e}static addList({ptr:e,predicates:t,items:n,graphs:r}){if(e.isAny())throw Error(`can't attach a list to an any ptr`);for(let i of t)for(let t of r){let r=n.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,i,r[0]||N.nil,t));for(let i=0;i<r.length;i++)e.dataset.add(e.factory.quad(r[i],N.first,n[i],t)),e.dataset.add(e.factory.quad(r[i],N.rest,r[i+1]||N.nil,t))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:r=[null],objects:i=[null]}){for(let a of n)for(let n of r)for(let r of i){let i={subject:a,predicate:n,object:r};i[t]=e.term;let o=e.dataset.match(i.subject,i.predicate,i.object);for(let t of o)e.dataset.delete(t)}return e}static deleteList({ptr:e,predicates:t}){let n=[];for(let r of t)for(let t of e.dataset.match(e.term,r)){let r=t.object;for(n.push(t);!N.nil.equals(r);){r=n[n.length-1].object;let t=e.dataset.match(r);if(t.size===0)break;for(let e of t)n.push(e)}}for(let t of n)e.dataset.delete(t);return e}static execute({ptr:t,operation:n=`traverse`,quantifier:r,start:i,end:a,subjects:o,predicates:s,objects:c,graphs:l,items:u,callback:d}={}){if(n===`add`)return e.add({ptr:t,start:i,end:a,subjects:o,predicates:s,objects:c,graphs:l,callback:d});if(n===`addList`)return e.addList({ptr:t,predicates:s,items:u,graphs:l});if(n===`delete`)return e.delete({ptr:t,start:i,subjects:o,predicates:s,objects:c});if(n===`deleteList`)return e.deleteList({ptr:t,predicates:s});if(n===`isList`)return e.isList({ptr:t});if(n===`list`)return e.list({ptr:t});if(n===`traverse`)return e.traverse({ptr:t,quantifier:r,start:i,end:a,subjects:o,predicates:s,objects:c,graphs:l});throw Error(`unknown operation ${n}`)}static isList({ptr:t}){return!t.isAny()&&!!(N.nil.equals(t.term)||e.traverse({ptr:t,predicates:[N.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(N.nil);){let t=e.out([N.first]);if(t.length!==1)throw Error(`Invalid list: rdf:first count not equals one on ${e.value}`);let n=e.out([N.rest]);if(n.length!==1)throw Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:t,quantifier:n=`one`,start:r=`subject`,end:i=`object`,subjects:a=[null],predicates:o=[null],objects:s=[null],graphs:c=[null],callback:l}){if(n===`one`)return e.traverseOne({ptr:t,start:r,end:i,subjects:a,predicates:o,objects:s,graphs:c,callback:l});if(n===`oneOrMore`){let n=e.traverse({ptr:t,end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l});return e.traverseMore({ptrs:n,end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l})}if(n===`zeroOrMore`)return e.traverseMore({ptrs:[t],end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l});if(n===`zeroOrOne`)return[t,...e.traverse({ptr:t,end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l})];throw Error(`unknown quantifier ${n}`)}static traverseMore({ptrs:t,end:n,start:r,subjects:i,predicates:a,objects:o,graphs:s,callback:c}={}){let l=[...t],u,d;do{u=[];for(let l of t)u=[...u,...e.traverseOne({ptr:l,end:n,start:r,subjects:i,predicates:a,objects:o,graphs:s,callback:c})];d&&(u=u.filter(e=>!d.has(e.term))),t=u,l=[...l,...u],d=new j(l.map(e=>e.term))}while(u.length>0);return l}static traverseOne({ptr:e,start:t,end:n,subjects:r,predicates:i,objects:a,graphs:o,callback:s=(e,t)=>t.extend(e)}={}){let c=[];for(let l of r)for(let r of i)for(let i of a)for(let a of o){let o={subject:l,predicate:r,object:i,graph:a};o[t]=e.term;for(let r of e.dataset.match(o.subject,o.predicate,o.object,o.graph))c.push(s(new Ve({dataset:e.dataset,end:n,quad:r,start:t}),e))}return c}};function nt(e,t){return t?n=>t(e.extend(n)):()=>{}}var rt=class{constructor({dataset:e,edges:t=[],factory:n,graph:r,term:i}){if(!e&&t.length===0)throw Error(`dataset or edges is required`);if(t.length===0&&i===void 0||t.length>0&&i)throw Error(`edges or term must be given`);this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=r,t.length===0&&(this._term=i)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph==`object`?this._graph:this.edge&&this.edge.graph}get length(){return this._term===void 0?this.edges.length+1:1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term===void 0?this.edge.term:this._term}get value(){let e=this.term;return e===null?void 0:e.value}addIn(e,t,n){return P.add({ptr:this,start:`object`,end:`subject`,subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:nt(this,n)})}addList(e,t){return P.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return P.add({ptr:this,start:`subject`,end:`object`,predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:nt(this,n)})}deleteIn(e,t){return P.delete({ptr:this,start:`object`,subjects:t,predicates:e})}deleteList(e){return P.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return P.delete({ptr:this,start:`subject`,predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:a,objects:o,graphs:s,items:c,callback:l}){return P.execute({ptr:this,operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:a,objects:o,graphs:s,items:c,callback:l})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return P.traverse({ptr:this,start:`object`,end:`object`,subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return P.traverse({ptr:this,start:`subject`,end:`subject`,predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return P.traverse({ptr:this,start:`object`,end:`subject`,subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return P.isList({ptr:this})}list(){return P.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term===void 0?this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term}):yield{dataset:this.dataset,term:this._term}}out(e,t){return P.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(let{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}};function it(e,t){return e?e.equals(t):e===t}function at(e,t){return!(e.dataset!==t.dataset||!it(e.graph,t.graph)||!it(e.term,t.term))}function ot(e,t){return t?n=>t(new e.constructor({factory:e.factory,ptrs:[n]})):()=>{}}var st=class{constructor({dataset:e,factory:t,ptrs:n,terms:r,graphs:i}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(let n of r||[null])for(let r of i||[null])this.ptrs.push(new rt({dataset:e,factory:t,graph:r,term:n}))}}get dataset(){let e=new Set(this.datasets);return e.size===1?e[Symbol.iterator]().next().value:null}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){let e=new j(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){return this.term?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,n){let r=ot(this,n);for(let n of this.ptrs)n.addIn(e,t,r);return this}addList(e,t){if(this.isAny())throw Error(`can't attach a list to an any ptr`);for(let n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){let r=ot(this,n);for(let n of this.ptrs)n.addOut(e,t,r);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(let n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(let t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(let n of this.ptrs)n.deleteOut(e,t);return this}distinct(){let e=this.ptrs.reduce((e,t)=>(e.some(e=>at(e,t))||e.push(t.trim()),e),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(t=>t.execute(e))})}executeAll(e){let t=this;for(let n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map(e=>e.ptrs[0])})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasIn(e,t))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasOut(e,t))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.in(e,t))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length===1&&this.ptrs[0].isList()}list(){if(!this.isList())return;let e=this.ptrs[0].list(),t=this;return(function*(){for(let n of e)yield t.clone({ptrs:[n]})})()}map(e){return[...this].map(e)}node(e){let t=this.dataset,n=[...e].map(e=>new rt({dataset:t,factory:this.factory,term:e}));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.out(e,t))})}*quads(){for(let{edges:e}of this.ptrs)for(let{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(let e of this.ptrs)yield this.clone({ptrs:[e]})}};M(`http://www.w3.org/2002/07/owl#`);var ct=M(`http://www.w3.org/1999/02/22-rdf-syntax-ns#`),lt=M(`http://www.w3.org/2000/01/rdf-schema#`),F=M(`http://www.w3.org/ns/shacl#`),ut=M(`https://schemas.link/shacl-next#`),dt=M(`http://www.w3.org/2001/XMLSchema#`);function ft(e){return e?`{${[...e.quads()].map(e=>k(e)).join(` `)}}`:`{}`}function pt(e){return e?`{${e.map(e=>ft(e)).join(` `)}}`:`{}`}var mt=D(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),ht=D(((e,t)=>{var n=mt(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),gt=D(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),_t=D(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),vt=D(((e,t)=>{var n=_t(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),yt=D(((e,t)=>{t.exports=vt().Symbol})),bt=D(((e,t)=>{var n=yt(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),xt=D(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),St=D(((e,t)=>{var n=yt(),r=bt(),i=xt(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Ct=D(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),wt=D(((e,t)=>{var n=St(),r=Ct(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),I=D(((e,t)=>{var n=ht(),r=gt(),i=wt(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),R=D(((e,t)=>{var n=I(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Tt=D(((e,t)=>{var n=R();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Et=D(((e,t)=>{var n=Tt(),r=`Expected a function`;function i(e,t){var i;if(typeof t!=`function`)throw TypeError(r);return e=n(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=void 0),i}}t.exports=i})),z=de(D(((e,t)=>{var n=Et();function r(e){return n(2,e)}t.exports=r}))(),1),Dt=class{constructor({details:e,factory:t,options:n,results:r=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=r,this._conforms=(0,z.default)(()=>!this.results.some(e=>e.severity.equals(F.Info)||e.severity.equals(F.Violation)||e.severity.equals(F.Warning))),this._ptr=(0,z.default)(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){let e=new st({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([ct.type],[F.ValidationReport]).addOut([F.conforms],[this.factory.literal(this.conforms.toString(),dt.boolean)]);for(let t of this.results)e.addOut([F.result],[this.factory.blankNode()],e=>{t.build(e,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function B(e,t){return Object.entries(t).reduce((e,[t,n])=>(n&&n.termType&&(n=k(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n)),e)}var V=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:r,message:i=[],path:a,results:o=[],severity:s,shape:c,source:l=[],value:u,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=r,this.path=a||c.path,this.results=o,this.severity=s,this.shape=c,this.source=l,this.value=u,this.valuePaths=d,this._message=(0,z.default)(()=>(this.shape.message.length>0&&(i=this.shape.message),i.length===0&&(i=this.shape.ptr.node([this.constraintComponent]).out([F.message]).terms),i.map(t=>n.literal(B(t.value,e,n),t.language||void 0))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([ct.type],[F.ValidationResult]).addOut([F.focusNode],this.focusNode.terms).addOut([F.resultSeverity],[this.severity]).addOut([F.sourceConstraint],this.source).addOut([F.sourceConstraintComponent],[this.constraintComponent]).addOut([F.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([F.resultMessage],this.message);let n=t=>{if(t.quantifier===`one`)return t.predicates.length>1?e.node([this.factory.blankNode()]).addList([F.alternativePath],t.predicates):t.start===`object`?e.node([this.factory.blankNode()]).addOut([F.inversePath],[t.predicates[0]]):e.node([t.predicates[0]]);if(t.quantifier===`oneOrMore`)return e.node([this.factory.blankNode()]).addOut([F.oneOrMorePath],[t.predicates[0]]);if(t.quantifier===`zeroOrMore`)return e.node([this.factory.blankNode()]).addOut([F.zeroOrMorePath],[t.predicates[0]]);if(t.quantifier===`zeroOrOne`)return e.node([this.factory.blankNode()]).addOut([F.zeroOrOnePath],[t.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([F.resultPath],n(this.path[0]).terms):e.addList([F.resultPath],this.path.map(e=>n(e).term))),this.value!==void 0&&e.addOut([F.value],this.value.terms),t)for(let n of this.results)e.addOut([F.detail],[this.factory.blankNode()],e=>{n.build(e,{details:t})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}},Ot=class e{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:r=new Set,report:i=new Dt({factory:e,options:n}),results:a=new Map,shape:o,value:s,valueOrNode:c,valuePaths:l,values:u}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=r,this.report=i,this.results=a,this.shape=o,this.value=s,this.valuePaths=l,this.valueOrNode=c,this.values=u}create({child:t,focusNode:n=this.focusNode,shape:r=this.shape,value:i=this.value,valueOrNode:a=this.valueOrNode,valuePaths:o=this.valuePaths,values:s=this.values}={}){return new e({factory:this.factory,focusNode:n,options:this.options,processed:this.processed,report:t?new Dt({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:i,valueOrNode:a,valuePaths:o,values:s})}id({shape:e=this.shape}={}){return`${k(e.ptr.term)} - ${k(this.focusNode.term)} - ${pt(this.valuePaths)}`}result(e){let t=new V({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:ut.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:ut.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||F.Violation,...t})}};function kt(){return{generic:H()}}function H(){return e=>{e.trace(ut.TraversalConstraintComponent,{args:{},message:[e.factory.literal(`Traversal`)],value:e.valueOrNode})}}var At=class{constructor(e){this.validations=new A(e)}compile(e){let t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1,r=new Set;for(let t of e.ptr.execute({start:`subject`,end:`predicate`})){let e=this.validations.get(t.term);e&&(r.add(e),t.term.equals(F.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&r.add(kt),[...r].map(t=>t(e)).filter(Boolean)}},jt=D((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(let n of t)this.supportedRdfDatatypes.push(n),this.fromRdfHandlers[n.value]=e;for(let t of n){let n=this.toRdfHandlers[t];n||(this.toRdfHandlers[t]=n=[]),n.push(e)}}fromRdf(e,t){let n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){let n=this.toRdfHandlers[typeof e];if(n)for(let r of n){let n=r.toRdf(e,t);if(n)return n}throw Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}})),Mt=D((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;var t=jt(),n=class e{fromRdf(e,n){switch(e.value){case`true`:return!0;case`false`:return!1;case`1`:return!0;case`0`:return!1}return n&&t.Translator.incorrectRdfDataType(e),!1}toRdf(t,{datatype:n,dataFactory:r}){return r.literal(t?`true`:`false`,n||r.namedNode(e.TYPE))}};e.TypeHandlerBoolean=n,n.TYPE=`http://www.w3.org/2001/XMLSchema#boolean`})),U=D((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;var t=jt(),n=class e{fromRdf(n,r){switch(r&&!n.value.match(e.VALIDATORS[n.datatype.value.substr(33,n.datatype.value.length)])&&t.Translator.incorrectRdfDataType(n),n.datatype.value){case`http://www.w3.org/2001/XMLSchema#gDay`:return new Date(0,0,parseInt(n.value,10));case`http://www.w3.org/2001/XMLSchema#gMonthDay`:let e=n.value.split(`-`);return new Date(0,parseInt(e[0],10)-1,parseInt(e[1],10));case`http://www.w3.org/2001/XMLSchema#gYear`:return new Date(n.value+`-01-01`);case`http://www.w3.org/2001/XMLSchema#gYearMonth`:return new Date(n.value+`-01`);default:return new Date(n.value)}}toRdf(t,{datatype:n,dataFactory:r}){if(n||=r.namedNode(e.TYPES[0]),!(t instanceof Date))return null;let i=t,a;switch(n.value){case`http://www.w3.org/2001/XMLSchema#gDay`:a=String(i.getUTCDate());break;case`http://www.w3.org/2001/XMLSchema#gMonthDay`:a=i.getUTCMonth()+1+`-`+i.getUTCDate();break;case`http://www.w3.org/2001/XMLSchema#gYear`:a=String(i.getUTCFullYear());break;case`http://www.w3.org/2001/XMLSchema#gYearMonth`:a=i.getUTCFullYear()+`-`+(i.getUTCMonth()+1);break;case`http://www.w3.org/2001/XMLSchema#date`:a=i.toISOString().replace(/T.*$/,``);break;default:a=i.toISOString()}return r.literal(a,n)}};e.TypeHandlerDate=n,n.TYPES=[`http://www.w3.org/2001/XMLSchema#dateTime`,`http://www.w3.org/2001/XMLSchema#date`,`http://www.w3.org/2001/XMLSchema#gDay`,`http://www.w3.org/2001/XMLSchema#gMonthDay`,`http://www.w3.org/2001/XMLSchema#gYear`,`http://www.w3.org/2001/XMLSchema#gYearMonth`],n.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}})),Nt=D((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;var t=jt(),n=class e{fromRdf(e,n){let r=parseFloat(e.value);return n&&isNaN(r)&&t.Translator.incorrectRdfDataType(e),r}toRdf(t,{datatype:n,dataFactory:r}){return n||=r.namedNode(e.TYPES[0]),isNaN(t)?r.literal(`NaN`,n):isFinite(t)?t%1==0?null:r.literal(t.toExponential(15).replace(/(\d)0*e\+?/,`$1E`),n):r.literal(t>0?`INF`:`-INF`,n)}};e.TypeHandlerNumberDouble=n,n.TYPES=[`http://www.w3.org/2001/XMLSchema#double`,`http://www.w3.org/2001/XMLSchema#decimal`,`http://www.w3.org/2001/XMLSchema#float`]})),Pt=D((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;var t=jt(),n=class e{fromRdf(e,n){let r=parseInt(e.value,10);return n&&(isNaN(r)||e.value.indexOf(`.`)>=0)&&t.Translator.incorrectRdfDataType(e),r}toRdf(t,{datatype:n,dataFactory:r}){return r.literal(String(t),n||(t<=e.MAX_INT&&t>=e.MIN_INT?r.namedNode(e.TYPES[0]):r.namedNode(e.TYPES[1])))}};e.TypeHandlerNumberInteger=n,n.TYPES=[`http://www.w3.org/2001/XMLSchema#integer`,`http://www.w3.org/2001/XMLSchema#long`,`http://www.w3.org/2001/XMLSchema#int`,`http://www.w3.org/2001/XMLSchema#byte`,`http://www.w3.org/2001/XMLSchema#short`,`http://www.w3.org/2001/XMLSchema#negativeInteger`,`http://www.w3.org/2001/XMLSchema#nonNegativeInteger`,`http://www.w3.org/2001/XMLSchema#nonPositiveInteger`,`http://www.w3.org/2001/XMLSchema#positiveInteger`,`http://www.w3.org/2001/XMLSchema#unsignedByte`,`http://www.w3.org/2001/XMLSchema#unsignedInt`,`http://www.w3.org/2001/XMLSchema#unsignedLong`,`http://www.w3.org/2001/XMLSchema#unsignedShort`],n.MAX_INT=2147483647,n.MIN_INT=-2147483648})),Ft=D((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;var t=class{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}};e.TypeHandlerString=t,t.TYPES=[`http://www.w3.org/2001/XMLSchema#string`,`http://www.w3.org/2001/XMLSchema#normalizedString`,`http://www.w3.org/2001/XMLSchema#anyURI`,`http://www.w3.org/2001/XMLSchema#base64Binary`,`http://www.w3.org/2001/XMLSchema#language`,`http://www.w3.org/2001/XMLSchema#Name`,`http://www.w3.org/2001/XMLSchema#NCName`,`http://www.w3.org/2001/XMLSchema#NMTOKEN`,`http://www.w3.org/2001/XMLSchema#token`,`http://www.w3.org/2001/XMLSchema#hexBinary`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString`,`http://www.w3.org/2001/XMLSchema#time`,`http://www.w3.org/2001/XMLSchema#duration`]})),It=D((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Mt(),e),n(U(),e),n(Nt(),e),n(Pt(),e),n(Ft(),e)})),Lt=D((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Rt=D((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.fromRdf=l,e.toRdf=u,e.getTermRaw=d,e.getSupportedRdfDatatypes=f,e.getSupportedJavaScriptPrimitives=p;var r=o(),i=It(),a=jt();n(It(),e),n(Lt(),e),n(jt(),e);var s=new r.DataFactory,c=new a.Translator;c.registerHandler(new i.TypeHandlerString,i.TypeHandlerString.TYPES.map(e=>s.namedNode(e)),[`string`]),c.registerHandler(new i.TypeHandlerBoolean,[i.TypeHandlerBoolean.TYPE].map(e=>s.namedNode(e)),[`boolean`]),c.registerHandler(new i.TypeHandlerNumberDouble,i.TypeHandlerNumberDouble.TYPES.map(e=>s.namedNode(e)),[`number`]),c.registerHandler(new i.TypeHandlerNumberInteger,i.TypeHandlerNumberInteger.TYPES.map(e=>s.namedNode(e)),[`number`]),c.registerHandler(new i.TypeHandlerDate,i.TypeHandlerDate.TYPES.map(e=>s.namedNode(e)),[`object`]);function l(e,t){return c.fromRdf(e,t)}function u(e,t){return t&&`namedNode`in t&&(t={dataFactory:t}),t||={},t&&!t.dataFactory&&(t.dataFactory=s),c.toRdf(e,t)}function d(e,t){return e.termType===`Literal`?l(e,t):e.value}function f(){return c.getSupportedRdfDatatypes()}function p(){return c.getSupportedJavaScriptPrimitives()}}))();function zt(e){if(e.term.termType!==`BlankNode`)return{quantifier:`one`,start:`subject`,end:`object`,predicates:[e.term]};let t=e.out([F.alternativePath]);if(t.ptrs.length===1&&t.ptrs[0].isList())return{quantifier:`one`,start:`subject`,end:`object`,predicates:[...t.list()].map(e=>e.term)};let n=e.out([F.inversePath]);if(n.term)return{quantifier:`one`,start:`object`,end:`subject`,predicates:[n.term]};let r=e.out([F.oneOrMorePath]);if(r.term)return{quantifier:`oneOrMore`,start:`subject`,end:`object`,predicates:[r.term]};let i=e.out([F.zeroOrMorePath]);if(i.term)return{quantifier:`zeroOrMore`,start:`subject`,end:`object`,predicates:[i.term]};let a=e.out([F.zeroOrOnePath]);if(a.term)return{quantifier:`zeroOrOne`,start:`subject`,end:`object`,predicates:[a.term]}}function Bt(e){return e.terms.length===0?null:e.ptrs[0].isList()?[...e.list()].map(e=>zt(e)):[zt(e)]}var Vt=class{constructor(e){this.shape=e,this._compiled=(0,z.default)(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){let t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(let e of this.compiled)e.node&&await e.node(t),e.generic&&await e.generic(t)}async validateProperty(e){let t;t=this.shape.isSparqlShape?e.focusNode:e.focusNode.executeAll(this.shape.path);let n=t.node(new j(t.terms)),r=[...t].reduce((e,n)=>{let r=n.term,i=t.node([r]);return e.has(r)||e.set(r,{value:i,valuePaths:[]}),e.get(r).valuePaths.push(n),e},new A).values(),i=e.create({shape:this.shape,values:n});for(let e of this.compiled)e.property&&await e.property(i);for(let{value:t,valuePaths:n}of r){let r=e.create({shape:this.shape,value:t,valueOrNode:t,valuePaths:n});for(let e of this.compiled)e.generic&&await e.generic(r)}}};function Ht(e){let t=new j,n=new st({dataset:e.dataset,terms:e.terms}).execute({quantifier:`zeroOrMore`,start:`object`,end:`subject`,predicates:[lt.subClassOf]});for(let e of n.ptrs)for(let{term:n}of e.nodes())t.add(n);return t}var Ut=class{constructor(e,{registry:t}){this.registry=t,this.targetClass=new j([...Ht(e.hasOut([ct.type],[F.NodeShape])),...Ht(e.out([F.targetClass]))]),this.targetNode=e.out([F.targetNode]).terms,this.targetObjectsOf=e.out([F.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([F.targetSubjectsOf]).terms,this.targets=[...e.out([F.target])]}async resolve(e){let t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([ct.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:`object`,end:`object`,predicates:this.targetObjectsOf}).ptrs,...t.execute({start:`subject`,end:`subject`,predicates:this.targetSubjectsOf}).ptrs];for(let t of this.targets)for(let[,r]of this.registry.targetResolvers){let i=await r(t,e);n.push(...e.focusNode.node(i).ptrs)}let r=e.focusNode.clone({ptrs:n});return r.node([...new j(r.terms)])}},Wt=class{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=(0,z.default)(()=>{let e=this.ptr.out([F.deactivated]).term;return e&&(0,Rt.fromRdf)(e)}),this._message=(0,z.default)(()=>this.ptr.out([F.message]).terms),this._path=(0,z.default)(()=>Bt(this.ptr.out([F.path]))),this._severity=(0,z.default)(()=>this.ptr.out([F.severity]).term),this._shapeValidator=(0,z.default)(()=>new Vt(this)),this._sparql=(0,z.default)(()=>this.ptr.out([F.sparql])),this._targetResolver=(0,z.default)(()=>new Ut(this.ptr,{registry:this.validator.targetResolverRegistry}))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}async resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){let t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(let n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}},Gt=class{constructor(e){this.targetResolvers=new A(e)}};function Kt(e){return{property:W(parseInt(e.ptr.out([F.maxCount]).value))}}function W(e){return t=>{t.test(t.values.terms.length<=e,F.MaxCountConstraintComponent,{args:{maxCount:e},message:[t.factory.literal(`More than {$maxCount} values`)]})}}function qt(e){return{property:G(parseInt(e.ptr.out([F.minCount]).value))}}function G(e){return t=>{t.test(t.values.terms.length>=e,F.MinCountConstraintComponent,{args:{minCount:e},message:[t.factory.literal(`Less than {$minCount} values`)]})}}async function Jt(e,t){for(let n of e)if(!await t(n))return!1;return!0}async function Yt(e,t){return(await Promise.all(e.map(e=>t(e)))).filter(Boolean)}async function Xt(e,t){return Promise.all(e.map(t))}async function Zt(e,t){for(let n of e)if(await t(n))return!0;return!1}function Qt(e){return{generic:$t([...e.ptr.out([F.and])].flatMap(e=>[...e.list()]).map(t=>e.validator.shape(t)))}}function $t(e){return async t=>{let n=await Xt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),r=n.every(e=>e.conforms);t.test(r,F.AndConstraintComponent,{results:n.flatMap(e=>e.results),value:t.valueOrNode})}}function en(e){return{generic:K(e.validator.shape(e.ptr.out([F.not])))}}function K(e){return async t=>{let n=(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report,r=!n.conforms;t.test(r,F.NotConstraintComponent,{args:{not:e.ptr.term},message:[t.factory.literal(`Value does have shape {$not}`)],results:n.results,value:t.valueOrNode})}}function tn(e){return{generic:nn([...e.ptr.out([F.or])].flatMap(e=>[...e.list()]).map(t=>e.validator.shape(t)))}}function nn(e){return async t=>{let n=[],r;if(t.options.debug||t.options.details){let i=await Xt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report);n=i.flatMap(e=>e.results),r=i.some(e=>e.conforms)}else r=await Zt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report.conforms);t.test(r,F.OrConstraintComponent,{results:n,value:t.valueOrNode})}}function rn(e){return{generic:an([...e.ptr.out([F.xone])].flatMap(e=>[...e.list()]).map(t=>e.validator.shape(t)))}}function an(e){return async t=>{let n=await Xt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),r=n.filter(e=>e.conforms).length===1;t.test(r,F.XoneConstraintComponent,{results:n.flatMap(e=>e.results),value:t.valueOrNode})}}function on(e){return(0,Rt.fromRdf)(e.ptr.out([F.closed]).term)?{node:sn(new j(e.ptr.out([F.property]).map(t=>e.validator.shape(t)).filter(e=>!e.deactivated).map(e=>e.path[0].predicates[0])),new j([...e.ptr.out([F.ignoredProperties]).list()||[]].map(e=>e.term)))}:null}function sn(e,t){return n=>{let r=n.focusNode.execute({start:`subject`,end:`predicate`}).filter(n=>!t.has(n.term)&&!e.has(n.term));if(r.ptrs.length>0)for(let e of r)n.violation(F.ClosedConstraintComponent,{message:[n.factory.literal(`Predicate is not allowed (closed shape)`)],path:[{quantifier:`one`,start:`subject`,end:`object`,predicates:[e.term]}],value:n.focusNode.node([[...e.quads()][0].object])});else n.debug(F.ClosedConstraintComponent)}}function cn(e){let t=e.ptr.out([F.hasValue]).term;return{node:ln(t),property:q(t)}}function ln(e){return t=>{t.test(e.equals(t.valueOrNode.term),F.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal(`Value must be {$hasValue}`)]})}}function q(e){return t=>{let n=[...t.values].some(t=>e.equals(t.term));t.test(n,F.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal(`Missing expected value {$hasValue}`)]})}}function un(e){return{generic:dn(new j([...e.ptr.out([F.in]).list()].map(e=>e.term)))}}function dn(e){return t=>{t.test(e.has(t.valueOrNode.term),F.InConstraintComponent,{args:{in:[...e].map(e=>e.value).join(`, `)},message:[t.factory.literal(`Value is not in {$in}`)],value:t.valueOrNode})}}function fn(e,t){if(!e||e.termType!==`Literal`||!t||t.termType!==`Literal`||pn(e)!==pn(t))return null;let n=(0,Rt.fromRdf)(e),r=(0,Rt.fromRdf)(t);return typeof n==typeof r?typeof n==`string`?n.localeCompare(r):n-r:null}function pn(e){return dt.dateTime.equals(e.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(e.value)}function mn(e){let t=e.ptr.out([F.disjoint]).term;return{generic:hn(t)}}function hn(e){return t=>{let n=t.focusNode.dataset.match(t.focusNode.term,e,t.valueOrNode.term);t.test(n.size===0,F.DisjointConstraintComponent,{args:{disjoint:e},message:[t.factory.literal(`Value node must not also be one of the values of {$disjoint}`)],value:t.valueOrNode})}}function gn(e){let t=e.ptr.out([F.equals]).term;return{node:_n(t),property:vn(t)}}function _n(e){return t=>{let n=t.focusNode.out([e]),r=n.filter(e=>!e.term.equals(t.focusNode.term)),i=n.terms.length!==0&&r.terms.length===0;t.test(i,F.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal(`Must have same values as {$equals}`)],value:r.terms[0]&&t.focusNode.node([r.terms[0]])||t.focusNode})}}function vn(e){return t=>{let n=new j(t.focusNode.out([e]).terms),r=new j(t.values.terms),i=[...r].filter(e=>!n.has(e)),a=[...n].filter(e=>!r.has(e)),o=[...i,...a];for(let n of o)t.violation(F.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal(`Must have same values as {$equals}`)],value:t.focusNode.node([n])});o.length===0&&t.debug(F.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal(`Must have same values as {$equals}`)]})}}function yn(e){let t=e.ptr.out([F.lessThan]).term;return{property:bn(t)}}function bn(e){return t=>{let n=t.focusNode.out([e]).terms;for(let r of t.values)for(let i of n){let n=fn(r.term,i);n===null||n>=0?t.violation(F.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal(`Value is not less than value of {$lessThan}`)],value:r}):t.debug(F.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal(`Value is not less than value of {$lessThan}`)],value:r})}}}function xn(e){let t=e.ptr.out([F.lessThanOrEquals]).term;return{property:Sn(t)}}function Sn(e){return t=>{let n=t.focusNode.out([e]).terms;for(let r of t.values)for(let i of n){let n=fn(r.term,i);n===null||n>0?t.violation(F.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal(`Value is not less than or equal to value of {$lessThanOrEquals}`)],value:r}):t.debug(F.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal(`Value is not less than or equal to value of {$lessThanOrEquals}`)],value:r})}}}function Cn(e){let t=e.ptr.out([F.maxExclusive]).term;return{generic:wn(t)}}function wn(e){return t=>{let n=fn(t.valueOrNode.term,e);t.test(n!==null&&n<0,F.MaxExclusiveConstraintComponent,{args:{maxExclusive:e},message:[t.factory.literal(`Value is not less than {$maxExclusive}`)],value:t.valueOrNode})}}function Tn(e){let t=e.ptr.out([F.maxInclusive]).term;return{generic:En(t)}}function En(e){return t=>{let n=fn(t.valueOrNode.term,e);t.test(n!==null&&n<=0,F.MaxInclusiveConstraintComponent,{args:{maxInclusive:e},message:[t.factory.literal(`Value is not less than or equal to {$maxInclusive}`)],value:t.valueOrNode})}}function Dn(e){let t=e.ptr.out([F.minExclusive]).term;return{generic:On(t)}}function On(e){return t=>{let n=fn(t.valueOrNode.term,e);t.test(n!==null&&n>0,F.MinExclusiveConstraintComponent,{args:{minExclusive:e},message:[t.factory.literal(`Value is not greater than {$minExclusive}`)],value:t.valueOrNode})}}function kn(e){let t=e.ptr.out([F.minInclusive]).term;return{generic:An(t)}}function An(e){return t=>{let n=fn(t.valueOrNode.term,e);t.test(n!==null&&n>=0,F.MinInclusiveConstraintComponent,{args:{minInclusive:e},message:[t.factory.literal(`Value is not greater than or equal to {$minInclusive}`)],value:t.valueOrNode})}}function jn(e){return{generic:Mn([...e.ptr.out([F.node])].map(t=>e.validator.shape(t)))}}function Mn(e){return async t=>{for(let n of e){let e=await n.validate(t.create({child:!0,focusNode:t.valueOrNode}));t.test(e.report.conforms,F.NodeConstraintComponent,{args:{node:n.ptr.term},message:[t.factory.literal(`Value does not have shape {$node}`)],results:e.report.results,value:t.valueOrNode})}}}function Nn(e){return{generic:Pn([...e.ptr.out([F.property])].map(t=>e.validator.shape(t)))}}function Pn(e){return async t=>{let n=t.create({focusNode:t.valueOrNode});for(let t of e)await t.validate(n)}}function Fn(e){let t=e.validator.shape(e.ptr.out([F.qualifiedValueShape])),n=e.ptr.out([F.qualifiedValueShapesDisjoint]).term,r=n?(0,Rt.fromRdf)(n):!1,i=e.ptr.out([F.qualifiedMaxCount]).term,a=i?parseInt(i.value):null,o=e.ptr.out([F.qualifiedMinCount]).term;return{property:In(t,r,a,o?parseInt(o.value):null)}}function In(e,t,n,r){return async i=>{let a=[],o=[];t&&(o=new Set(i.shape.ptr.in([F.property]).out([F.property]).out([F.qualifiedValueShape]).filter(t=>!t.term.equals(e.ptr.term)).map(e=>i.shape.validator.shape(e))));let s=(await Yt(i.values,async t=>{let n=(await e.validate(i.create({child:!0,focusNode:t}))).report;if(a.push(n.results),!n.conforms)return!1;if(o.length===0)return!0;if(i.options.debug||i.options.details){let e=await Xt([...o],async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report);return a.push(e.flatMap(e=>e.results)),!e.every(e=>e.conforms)}else return!await Jt([...o],async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report.conforms)})).length;n!==null&&i.test(s<=n,F.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal(`More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}`)],results:a.flat()}),r!==null&&i.test(s>=r,F.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal(`Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}`)],results:a.flat()})}}function Ln(e,t){return t?t.slice(0,e.length)===e:!1}function Rn(e){return{generic:zn([...new Set([...e.ptr.out([F.languageIn]).list()].map(e=>e.value))])}}function zn(e){return t=>{let n=e.some(e=>Ln(e,t.valueOrNode.term.language));t.test(n,F.LanguageInConstraintComponent,{args:{languageIn:e.join(`, `)},message:[t.factory.literal(`Language does not match any of {$languageIn}`)],value:t.valueOrNode})}}function J(e){return{generic:Bn(parseInt(e.ptr.out([F.maxLength]).value))}}function Bn(e){return t=>{let n=t.valueOrNode.term.termType!==`BlankNode`&&t.valueOrNode.value.length<=e;t.test(n,F.MaxLengthConstraintComponent,{args:{maxLength:e},message:[t.factory.literal(`Value has more than {$maxLength} characters`)],value:t.valueOrNode})}}function Vn(e){return{generic:Hn(parseInt(e.ptr.out([F.minLength]).value))}}function Hn(e){return t=>{let n=t.valueOrNode.term.termType!==`BlankNode`&&t.valueOrNode.value.length>=e;t.test(n,F.MinLengthConstraintComponent,{args:{minLength:e},message:[t.factory.literal(`Value has less than {$minLength} characters`)],value:t.valueOrNode})}}function Un(e){let t=e.ptr.out([F.pattern]).value,n=e.ptr.out([F.flags]).value;return{generic:Wn(t,n,new RegExp(t,n))}}function Wn(e,t,n){return r=>{r.test(n.test(r.valueOrNode.term.value),F.PatternConstraintComponent,{args:{flags:t,pattern:e},message:[r.factory.literal(`Value does not match pattern "{$pattern}"`)],value:r.valueOrNode})}}function Gn(e){let t=e.ptr.out([F.uniqueLang]).term;return t.value===`true`&&dt.boolean.equals(t.datatype)?{property:Kn()}:null}function Kn(){return e=>{let t=Object.entries(e.values.terms.reduce((e,t)=>(t.language&&(e[t.language]=(e[t.language]||0)+1),e),{})).filter(([,e])=>e>1);for(let[n]of t)e.violation(F.UniqueLangConstraintComponent,{args:{lang:n},message:[e.factory.literal(`Language "{?lang}" used more than once`)]});t.length===0&&e.debug(F.UniqueLangConstraintComponent)}}var qn=M(`http://www.w3.org/ns/shacl#`),Jn=M(`https://schemas.link/shacl-next#`),Y=class{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(qn.Info)||e.severity.equals(qn.Violation)||e.severity.equals(qn.Warning))}};function Yn(e,t){return Object.entries(t).reduce((e,[t,n])=>(n&&n.termType&&(n=k(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n)),e)}var Xn=class{constructor({args:e={},factory:t,message:n=[],severity:r=qn.Violation}={}){this.severity=r,this.message=n.map(n=>t.literal(Yn(n.value,e),n.language||null))}},Zn=class e{constructor({factory:e=et}={}){this.factory=e}clone({factory:t}={}){return new e({factory:t||this.factory})}validate(){return new Y}validateSimple(){return!0}},Qn=class e extends Zn{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(let t of Array.isArray(e)?e:[e])t&&this.datatypes.push(this.factory.fromTerm(t))}clone({factory:t}={}){return new e({datatypes:this.datatypes,factory:t||this.factory})}},$n=class{constructor({factory:e=et,validations:t}={}){if(this.factory=e,this.validations=new A,t)for(let e of Object.values(t)){let t=e.clone({factory:this.factory});for(let e of t.datatypes)this.validations.set(e,t)}}validate(e){let t=this.validations.get(e.datatype);return t?t.validate(e):new Y}validateSimple(e){let t=this.validations.get(e.datatype);return!t||t.validateSimple(e)}},X=class e extends Qn{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal(`term value {$this} matches pattern {$pattern}`)],this.patterns=Array.isArray(e)?e:[e]}clone({factory:t}={}){return new e(this.patterns,this.datatypes,{factory:t||this.factory})}validate(e){return new Y({results:this.patterns.map(t=>{let n;return t.test(e.value)&&(n=Jn.Debug),new Xn({args:{pattern:this.factory.literal(t.toString()),this:e},factory:this.factory,message:this.message,severity:n})})})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}},er=/^([-+]?[0-9]+)$/,Z=class e extends X{constructor(e=null,t=null,n,{factory:r}={}){super(er,n,{factory:r}),this.maxInclusive=null,this.minInclusive=null,typeof t==`string`&&(this.maxInclusive=BigInt(t)),typeof e==`string`&&(this.minInclusive=BigInt(e))}clone({factory:t}={}){return new e(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:t||this.factory})}validate(e){let t=super.validate(e).results;if(!Jn.Debug.equals(t[0].severity))return new Y({results:t});let n=BigInt(e.value);if(this.minInclusive!==null&&n<this.minInclusive){let n=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Xn({factory:this.factory,message:r}))}if(this.maxInclusive!==null&&n>this.maxInclusive){let n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Xn({factory:this.factory,message:r}))}return new Y({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;let t=BigInt(e.value);return!(this.minInclusive!==null&&t<this.minInclusive||this.maxInclusive!==null&&t>this.maxInclusive)}},tr=class e extends Qn{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:t}={}){return new e(this.values,this.datatypes,{factory:t||this.factory})}validate(e){let t=[];if(!this.values.has(e.value)){let n=`term value "${e.value}" is not included in the list: ${[...this.values].join(`,`)}`,r=[this.factory.literal(n)];t.push(new Xn({factory:this.factory,message:r}))}return new Y({results:t})}validateSimple(e){return this.values.has(e.value)}},nr=fe({anyAtomicType:()=>ir,anySimpleType:()=>rr,anyURI:()=>Fr,base64Binary:()=>Pr,boolean:()=>br,byte:()=>Zr,date:()=>Dr,dateTime:()=>Tr,dateTimeStamp:()=>oi,dayTimeDuration:()=>ai,decimal:()=>xr,double:()=>Cr,duration:()=>wr,float:()=>Sr,gDay:()=>jr,gMonth:()=>Mr,gMonthDay:()=>Ar,gYear:()=>kr,gYearMonth:()=>Or,hexBinary:()=>Nr,int:()=>Yr,integer:()=>Gr,language:()=>Wr,long:()=>Jr,negativeInteger:()=>qr,nonNegativeInteger:()=>Qr,nonPositiveInteger:()=>Kr,normalizedString:()=>Hr,positiveInteger:()=>ri,short:()=>Xr,string:()=>yr,time:()=>Er,token:()=>Ur,unsignedByte:()=>ni,unsignedInt:()=>ei,unsignedLong:()=>$r,unsignedShort:()=>ti,yearMonthDuration:()=>ii}),Q={xsd:M(`http://www.w3.org/2001/XMLSchema#`)},rr=new Qn({datatypes:Q.xsd.anySimpleType}),ir=new Qn({datatypes:Q.xsd.anyAtomicType}),ar=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,or=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,sr=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,cr=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,lr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ur=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,dr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,fr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,pr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,mr=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,hr=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,gr=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,_r=/^(([0-9a-fA-F]{2})*)$/,vr=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,yr=new X(ar,Q.xsd.string),br=new tr([`1`,`true`,`0`,`false`],Q.xsd.boolean),xr=new X(or,Q.xsd.decimal),Sr=new X(sr,Q.xsd.float),Cr=new X(sr,Q.xsd.double),wr=new X(cr,Q.xsd.duration),Tr=new X(lr,Q.xsd.dateTime),Er=new X(ur,Q.xsd.time),Dr=new X(dr,Q.xsd.date),Or=new X(fr,Q.xsd.gYearMonth),kr=new X(pr,Q.xsd.gYear),Ar=new X(mr,Q.xsd.gMonthDay),jr=new X(hr,Q.xsd.gDay),Mr=new X(gr,Q.xsd.gMonth),Nr=new X(_r,Q.xsd.hexBinary),Pr=new X(vr,Q.xsd.base64Binary),Fr=new X(ar,Q.xsd.anyURI),Ir=/^([^\u000d\u000a\u0009]*)$/,Lr=/^([^ ]+( [^ ]+)*)*$/,Rr=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,zr=/^([^DT]*)$/,Br=/^([^YM]*[DT].*)$/,Vr=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Hr=new X([ar,Ir],Q.xsd.normalizedString),Ur=new X([ar,Ir,Lr],Q.xsd.token),Wr=new X(Rr,Q.xsd.language),Gr=new Z(null,null,Q.xsd.integer),Kr=new Z(null,`0`,Q.xsd.nonPositiveInteger),qr=new Z(null,`-1`,Q.xsd.negativeInteger),Jr=new Z(`-9223372036854775808`,`9223372036854775807`,Q.xsd.long),Yr=new Z(`-2147483648`,`2147483647`,Q.xsd.int),Xr=new Z(`-32768`,`32767`,Q.xsd.short),Zr=new Z(`-128`,`127`,Q.xsd.byte),Qr=new Z(`0`,null,Q.xsd.nonNegativeInteger),$r=new Z(`0`,`18446744073709551615`,Q.xsd.unsignedLong),ei=new Z(`0`,`4294967295`,Q.xsd.unsignedInt),ti=new Z(`0`,`65535`,Q.xsd.unsignedShort),ni=new Z(`0`,`255`,Q.xsd.unsignedByte),ri=new Z(`1`,null,Q.xsd.positiveInteger),ii=new X([cr,zr],Q.xsd.yearMonthDuration),ai=new X([cr,Br],Q.xsd.dayTimeDuration),oi=new X([lr,Vr],Q.xsd.dateTimeStamp),si=class extends $n{constructor({factory:e}={}){super({factory:e,validations:{...nr}})}},ci=new A([[F.BlankNode,new Set([`BlankNode`])],[F.BlankNodeOrIRI,new Set([`BlankNode`,`NamedNode`])],[F.BlankNodeOrLiteral,new Set([`BlankNode`,`Literal`])],[F.IRI,new Set([`NamedNode`])],[F.IRIOrLiteral,new Set([`NamedNode`,`Literal`])],[F.Literal,new Set([`Literal`])]]);function li(e){return{generic:ui(e.ptr.out([F.class]).map(e=>Ht(e)))}}function ui(e){return t=>{let n=new j(t.valueOrNode.out([ct.type]).terms);for(let r of e){let e=[...n].some(e=>r.has(e));t.test(e,F.ClassConstraintComponent,{value:t.valueOrNode})}}}function di(e){let t=e.ptr.out([F.datatype]).term;return{generic:fi(t,new si)}}function fi(e,t){return n=>{let r=e.equals(n.valueOrNode.term.datatype)&&t.validateSimple(n.valueOrNode.term);n.test(r,F.DatatypeConstraintComponent,{args:{datatype:e},message:[n.factory.literal(`Value does not have datatype {$datatype}`)],value:n.valueOrNode})}}function pi(e){let t=e.ptr.out([F.nodeKind]).term;return{generic:mi(t,ci.get(t))}}function mi(e,t){return n=>{n.test(t.has(n.valueOrNode.term.termType),F.NodeKindConstraintComponent,{args:{nodeKind:e},message:[n.factory.literal(`Value does not have node kind {$nodeKind}`)],value:n.valueOrNode})}}var hi=new A([[F.maxCount,Kt],[F.minCount,qt],[F.and,Qt],[F.not,en],[F.or,tn],[F.xone,rn],[F.closed,on],[F.hasValue,cn],[F.in,un],[F.disjoint,mn],[F.equals,gn],[F.lessThan,yn],[F.lessThanOrEquals,xn],[F.maxExclusive,Cn],[F.maxInclusive,Tn],[F.minExclusive,Dn],[F.minInclusive,kn],[F.node,jn],[F.property,Nn],[F.qualifiedValueShape,Fn],[F.languageIn,Rn],[F.maxLength,J],[F.minLength,Vn],[F.pattern,Un],[F.uniqueLang,Gn],[F.class,li],[F.datatype,di],[F.nodeKind,pi]]),gi=class{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new At(hi),this.targetResolverRegistry=new Gt(this.options.targetResolvers||[]),this.shapesPtr=new st({dataset:e,factory:t}),this.shapes=new A,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(let[e,t]of this.options.validations)this.registry.validations.set(e,t);let r=[...this.shapesPtr.hasOut([F.targetClass]),...this.shapesPtr.hasOut([F.targetNode]),...this.shapesPtr.hasOut([F.targetObjectsOf]),...this.shapesPtr.hasOut([F.targetSubjectsOf]),...this.shapesPtr.hasOut([F.target]),...this.shapesPtr.hasOut([ct.type],[F.NodeShape]),...this.shapesPtr.hasOut([ct.type],[F.PropertyShape])];for(let e of r)this.shape(e)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new Wt(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){let n=new st({...e,factory:this.factory}),r=new Ot({factory:this.factory,focusNode:n,options:this.options,validator:this});t=t?t.map(e=>this.shape(this.shapesPtr.node(e.terms))):this.shapes.values();for(let e of t){let t=r.create({shape:e}),i;i=n.isAny()?await e.resolveTargets(t):n;for(let n of i)await e.validate(t.create({focusNode:n}))}return r.report}},_i=class{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace=``,this.valuesGraph=null,this.view=null,this.mode=null,this.language=null,this.loading=`Loading…`,this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.hierarchyColors=null,this.submitButton=null,this.generateNodeShapeReference=re.value,this.showNodeIds=null,this.showRootShapeLabel=null,this.dense=`true`,this.useShadowRoot=`true`}},vi=`#4c93d785, #f85e9a85, #00327385, #87001f85`,yi=class{constructor(e){this.attributes=new _i,this.mode=`edit`,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new T,this._nodeTemplates={},this._propertyTemplates={},this.validator=new gi(this._store,{details:!0,factory:v}),this.providedConformingResourceIds={},this.providedResources={},this.providedResourceLabels={},this.form=e,this._theme=new Oe,this.languages=[...new Set(navigator.languages.flatMap(e=>e.length>2?[e.toLocaleLowerCase(),e.substring(0,2)]:e)),``]}reset(){this.lists={},this.groups=[],this.renderedNodes.clear(),this.providedConformingResourceIds={},this.providedResources={},this.providedResourceLabels={},this._nodeTemplates={},this._propertyTemplates={}}updateAttributes(e){let t=new _i;if(Object.keys(t).forEach(n=>{let r=e.dataset[n];r!==void 0&&(t[n]=r)}),t.mode!==null&&![`edit`,`view`,`query`].includes(t.mode))throw Error(`invalid shacl-form mode: ${t.mode}`);if(this.mode=t.mode??(t.view===null?`edit`:`view`),this.theme.setDense(t.dense===`true`),this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){let e=this.languages.indexOf(t.language);e>-1&&this.languages.splice(e,1),this.languages.unshift(t.language)}if(t.valuesGraph&&(this.valuesGraphId=v.namedNode(t.valuesGraph)),t.hierarchyColors!=null){let e=t.hierarchyColors.length?t.hierarchyColors:vi,n=`:host { --hierarchy-colors: ${e}; --hierarchy-colors-length: ${e.split(`,`).length} }`;for(let e=8;e>=0;e--){let t=`shacl-property { --hierarchy-level: ${e} }`;for(let n=0;n<e;n++)t=`shacl-property `+t;n=n+`
|
|
9
|
-
`+t}this.hierarchyColorsStyleSheet=new CSSStyleSheet,this.hierarchyColorsStyleSheet.replaceSync(n)}}static dataAttributes(){let e=new
|
|
9
|
+
`}function Ne(){return``}function Pe(e){return`<`+e.value+`>`}var Fe=/["\\\\\n\r]/,Ie=/["\\\\\n\r]/g,Le={'"':`\\"`,"\\":`\\\\`,"\n":`\\n`,"\r":`\\r`};function Re(e){return Le[e]}function ze(e){return Fe.test(e)?e.replace(Ie,Re):e}function Be(e){let t=ze(e.value);return e.datatype.value===`http://www.w3.org/2001/XMLSchema#string`?`"`+t+`"`:e.datatype.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`?`"`+t+`"@`+e.language:`"`+t+`"^^`+Pe(e.datatype)}function Ve(e,t){let n=t(e.subject),r=t(e.predicate),i=t(e.object),a=t(e.graph);return`${n} ${r} ${i} ${a?a+` `:``}.`}function He(e){return`?`+e.value}function O(e){if(!e)return null;if(e.termType===`BlankNode`)return je(e);if(e.termType===`DefaultGraph`)return Ne();if(e.termType===`Literal`)return Be(e);if(e.termType===`NamedNode`)return Pe(e);if(e.termType===`Quad`||e.subject&&e.predicate&&e.object&&e.graph)return Ve(e,O);if(e.termType===`Variable`)return He(e);if(e[Symbol.iterator])return Me(e,O);throw Error(`unknown termType ${e.termType}`)}var Ue=class{constructor(e){if(this.index=new Map,e)for(let[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(O(e))}*entries(){for(let[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(let n of this.entries())e.call(t,n[1],n[0],this)}get(e){let t=this.index.get(O(e));return t&&t.value}has(e){return this.index.has(O(e))}*keys(){for(let[,{term:e}]of this.index)yield e}set(e,t){let n=O(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(let[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}},We=class{constructor({dataset:e,end:t,quad:n,start:r}){this.dataset=e,this.end=t,this.quad=n,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};function Ge(e){try{return O(e)}catch{return null}}var k=class{constructor(e){if(this.index=new Map,e)for(let t of e)this.add(t)}get size(){return this.index.size}add(e){let t=O(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(Ge(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(Ge(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}},Ke=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Ke.prototype.termType=`BlankNode`;var qe=class{equals(e){return!!e&&e.termType===this.termType}};qe.prototype.termType=`DefaultGraph`,qe.prototype.value=``;function Je(e,t){if(!t)return null;if(t.termType===`BlankNode`)return e.blankNode(t.value);if(t.termType===`DefaultGraph`)return e.defaultGraph();if(t.termType===`Literal`)return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if(t.termType===`NamedNode`)return e.namedNode(t.value);if(t.termType===`Quad`){let n=e.fromTerm(t.subject),r=e.fromTerm(t.predicate),i=e.fromTerm(t.object),a=e.fromTerm(t.graph);return e.quad(n,r,i,a)}if(t.termType===`Variable`)return e.variable(t.value);throw Error(`unknown termType ${t.termType}`)}var Ye=class{constructor(e,t,n,r=``){this.value=e,this.language=t,this.datatype=n,this.direction=r}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||``)===this.direction}};Ye.prototype.termType=`Literal`;var Xe=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Xe.prototype.termType=`NamedNode`;var Ze=class{constructor(e,t,n,r){this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&(e.termType===`Quad`||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}};Ze.prototype.termType=`Quad`,Ze.prototype.value=``;var Qe=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Qe.prototype.termType=`Variable`;var $e=new Xe(`http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString`),et=new Xe(`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`),tt=new Xe(`http://www.w3.org/2001/XMLSchema#string`),nt=class{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new qe}}namedNode(e){return new Xe(e)}blankNode(e){return e||=`b`+ ++this._data.blankNodeCounter,new Ke(e)}literal(e,t){return typeof t==`string`?new Ye(e,t,et):typeof t?.language==`string`?new Ye(e,t.language,t.direction?$e:et,t.direction):new Ye(e,``,t||tt)}variable(e){return new Qe(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,r=this.defaultGraph()){return new Ze(e,t,n,r)}fromTerm(e){return Je(this,e)}fromQuad(e){return Je(this,e)}};nt.exports=[`blankNode`,`defaultGraph`,`fromQuad`,`fromTerm`,`literal`,`namedNode`,`quad`,`variable`];var rt=new nt,it={apply:(e,t,n)=>e(n[0]),get:(e,t)=>e(t)};function A(e,{factory:t=rt}={}){let n=(n=``)=>t.namedNode(`${e}${n.raw||n}`);return typeof Proxy>`u`?n:new Proxy(n,it)}A(`http://www.w3.org/2001/XMLSchema#`);var j=A(`http://www.w3.org/1999/02/22-rdf-syntax-ns#`);A(`http://www.w3.org/2000/01/rdf-schema#`);var M=class e{static add({ptr:e,start:t,end:n,subjects:r=[null],predicates:i=[null],objects:a=[null],graphs:o,callback:s}={}){if(!e.factory)throw Error(`add operation requires a factory`);let c=()=>{};s&&(c=r=>{s(new We({dataset:e.dataset,start:t,end:n,quad:r}))});for(let n of r)for(let r of i)for(let i of a)for(let a of o){let o={subject:n,predicate:r,object:i,graph:a};o[t]=e.term;let s=e.factory.quad(o.subject,o.predicate,o.object,o.graph);e.dataset.add(s),c(s)}return e}static addList({ptr:e,predicates:t,items:n,graphs:r}){if(e.isAny())throw Error(`can't attach a list to an any ptr`);for(let i of t)for(let t of r){let r=n.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,i,r[0]||j.nil,t));for(let i=0;i<r.length;i++)e.dataset.add(e.factory.quad(r[i],j.first,n[i],t)),e.dataset.add(e.factory.quad(r[i],j.rest,r[i+1]||j.nil,t))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:r=[null],objects:i=[null]}){for(let a of n)for(let n of r)for(let r of i){let i={subject:a,predicate:n,object:r};i[t]=e.term;let o=e.dataset.match(i.subject,i.predicate,i.object);for(let t of o)e.dataset.delete(t)}return e}static deleteList({ptr:e,predicates:t}){let n=[];for(let r of t)for(let t of e.dataset.match(e.term,r)){let r=t.object;for(n.push(t);!j.nil.equals(r);){r=n[n.length-1].object;let t=e.dataset.match(r);if(t.size===0)break;for(let e of t)n.push(e)}}for(let t of n)e.dataset.delete(t);return e}static execute({ptr:t,operation:n=`traverse`,quantifier:r,start:i,end:a,subjects:o,predicates:s,objects:c,graphs:l,items:u,callback:d}={}){if(n===`add`)return e.add({ptr:t,start:i,end:a,subjects:o,predicates:s,objects:c,graphs:l,callback:d});if(n===`addList`)return e.addList({ptr:t,predicates:s,items:u,graphs:l});if(n===`delete`)return e.delete({ptr:t,start:i,subjects:o,predicates:s,objects:c});if(n===`deleteList`)return e.deleteList({ptr:t,predicates:s});if(n===`isList`)return e.isList({ptr:t});if(n===`list`)return e.list({ptr:t});if(n===`traverse`)return e.traverse({ptr:t,quantifier:r,start:i,end:a,subjects:o,predicates:s,objects:c,graphs:l});throw Error(`unknown operation ${n}`)}static isList({ptr:t}){return!t.isAny()&&!!(j.nil.equals(t.term)||e.traverse({ptr:t,predicates:[j.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(j.nil);){let t=e.out([j.first]);if(t.length!==1)throw Error(`Invalid list: rdf:first count not equals one on ${e.value}`);let n=e.out([j.rest]);if(n.length!==1)throw Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:t,quantifier:n=`one`,start:r=`subject`,end:i=`object`,subjects:a=[null],predicates:o=[null],objects:s=[null],graphs:c=[null],callback:l}){if(n===`one`)return e.traverseOne({ptr:t,start:r,end:i,subjects:a,predicates:o,objects:s,graphs:c,callback:l});if(n===`oneOrMore`){let n=e.traverse({ptr:t,end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l});return e.traverseMore({ptrs:n,end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l})}if(n===`zeroOrMore`)return e.traverseMore({ptrs:[t],end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l});if(n===`zeroOrOne`)return[t,...e.traverse({ptr:t,end:i,start:r,subjects:a,predicates:o,objects:s,graphs:c,callback:l})];throw Error(`unknown quantifier ${n}`)}static traverseMore({ptrs:t,end:n,start:r,subjects:i,predicates:a,objects:o,graphs:s,callback:c}={}){let l=[...t],u,d;do{u=[];for(let l of t)u=[...u,...e.traverseOne({ptr:l,end:n,start:r,subjects:i,predicates:a,objects:o,graphs:s,callback:c})];d&&(u=u.filter(e=>!d.has(e.term))),t=u,l=[...l,...u],d=new k(l.map(e=>e.term))}while(u.length>0);return l}static traverseOne({ptr:e,start:t,end:n,subjects:r,predicates:i,objects:a,graphs:o,callback:s=(e,t)=>t.extend(e)}={}){let c=[];for(let l of r)for(let r of i)for(let i of a)for(let a of o){let o={subject:l,predicate:r,object:i,graph:a};o[t]=e.term;for(let r of e.dataset.match(o.subject,o.predicate,o.object,o.graph))c.push(s(new We({dataset:e.dataset,end:n,quad:r,start:t}),e))}return c}};function at(e,t){return t?n=>t(e.extend(n)):()=>{}}var ot=class{constructor({dataset:e,edges:t=[],factory:n,graph:r,term:i}){if(!e&&t.length===0)throw Error(`dataset or edges is required`);if(t.length===0&&i===void 0||t.length>0&&i)throw Error(`edges or term must be given`);this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=r,t.length===0&&(this._term=i)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph==`object`?this._graph:this.edge&&this.edge.graph}get length(){return this._term===void 0?this.edges.length+1:1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term===void 0?this.edge.term:this._term}get value(){let e=this.term;return e===null?void 0:e.value}addIn(e,t,n){return M.add({ptr:this,start:`object`,end:`subject`,subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:at(this,n)})}addList(e,t){return M.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return M.add({ptr:this,start:`subject`,end:`object`,predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:at(this,n)})}deleteIn(e,t){return M.delete({ptr:this,start:`object`,subjects:t,predicates:e})}deleteList(e){return M.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return M.delete({ptr:this,start:`subject`,predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:a,objects:o,graphs:s,items:c,callback:l}){return M.execute({ptr:this,operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:a,objects:o,graphs:s,items:c,callback:l})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return M.traverse({ptr:this,start:`object`,end:`object`,subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return M.traverse({ptr:this,start:`subject`,end:`subject`,predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return M.traverse({ptr:this,start:`object`,end:`subject`,subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return M.isList({ptr:this})}list(){return M.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term===void 0?this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term}):yield{dataset:this.dataset,term:this._term}}out(e,t){return M.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(let{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}};function st(e,t){return e?e.equals(t):e===t}function ct(e,t){return!(e.dataset!==t.dataset||!st(e.graph,t.graph)||!st(e.term,t.term))}function lt(e,t){return t?n=>t(new e.constructor({factory:e.factory,ptrs:[n]})):()=>{}}var ut=class{constructor({dataset:e,factory:t,ptrs:n,terms:r,graphs:i}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(let n of r||[null])for(let r of i||[null])this.ptrs.push(new ot({dataset:e,factory:t,graph:r,term:n}))}}get dataset(){let e=new Set(this.datasets);return e.size===1?e[Symbol.iterator]().next().value:null}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){let e=new k(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){return this.term?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,n){let r=lt(this,n);for(let n of this.ptrs)n.addIn(e,t,r);return this}addList(e,t){if(this.isAny())throw Error(`can't attach a list to an any ptr`);for(let n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){let r=lt(this,n);for(let n of this.ptrs)n.addOut(e,t,r);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(let n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(let t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(let n of this.ptrs)n.deleteOut(e,t);return this}distinct(){let e=this.ptrs.reduce((e,t)=>(e.some(e=>ct(e,t))||e.push(t.trim()),e),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(t=>t.execute(e))})}executeAll(e){let t=this;for(let n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map(e=>e.ptrs[0])})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasIn(e,t))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasOut(e,t))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.in(e,t))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length===1&&this.ptrs[0].isList()}list(){if(!this.isList())return;let e=this.ptrs[0].list(),t=this;return(function*(){for(let n of e)yield t.clone({ptrs:[n]})})()}map(e){return[...this].map(e)}node(e){let t=this.dataset,n=[...e].map(e=>new ot({dataset:t,factory:this.factory,term:e}));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.out(e,t))})}*quads(){for(let{edges:e}of this.ptrs)for(let{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(let e of this.ptrs)yield this.clone({ptrs:[e]})}};A(`http://www.w3.org/2002/07/owl#`);var dt=A(`http://www.w3.org/1999/02/22-rdf-syntax-ns#`),ft=A(`http://www.w3.org/2000/01/rdf-schema#`),N=A(`http://www.w3.org/ns/shacl#`),pt=A(`https://schemas.link/shacl-next#`),mt=A(`http://www.w3.org/2001/XMLSchema#`);function ht(e){return e?`{${[...e.quads()].map(e=>O(e)).join(` `)}}`:`{}`}function gt(e){return e?`{${e.map(e=>ht(e)).join(` `)}}`:`{}`}var _t=x(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),vt=x(((e,t)=>{var n=_t(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),yt=x(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),bt=x(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),xt=x(((e,t)=>{var n=bt(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),St=x(((e,t)=>{t.exports=xt().Symbol})),Ct=x(((e,t)=>{var n=St(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),wt=x(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),Tt=x(((e,t)=>{var n=St(),r=Ct(),i=wt(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Et=x(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),P=x(((e,t)=>{var n=Tt(),r=Et(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),F=x(((e,t)=>{var n=vt(),r=yt(),i=P(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Dt=x(((e,t)=>{var n=F(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Ot=x(((e,t)=>{var n=Dt();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),kt=x(((e,t)=>{var n=Ot(),r=`Expected a function`;function i(e,t){var i;if(typeof t!=`function`)throw TypeError(r);return e=n(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=void 0),i}}t.exports=i})),I=ae(x(((e,t)=>{var n=kt();function r(e){return n(2,e)}t.exports=r}))(),1),R=class{constructor({details:e,factory:t,options:n,results:r=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=r,this._conforms=(0,I.default)(()=>!this.results.some(e=>e.severity.equals(N.Info)||e.severity.equals(N.Violation)||e.severity.equals(N.Warning))),this._ptr=(0,I.default)(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){let e=new ut({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([dt.type],[N.ValidationReport]).addOut([N.conforms],[this.factory.literal(this.conforms.toString(),mt.boolean)]);for(let t of this.results)e.addOut([N.result],[this.factory.blankNode()],e=>{t.build(e,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function z(e,t){return Object.entries(t).reduce((e,[t,n])=>(n&&n.termType&&(n=O(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n)),e)}var At=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:r,message:i=[],path:a,results:o=[],severity:s,shape:c,source:l=[],value:u,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=r,this.path=a||c.path,this.results=o,this.severity=s,this.shape=c,this.source=l,this.value=u,this.valuePaths=d,this._message=(0,I.default)(()=>(this.shape.message.length>0&&(i=this.shape.message),i.length===0&&(i=this.shape.ptr.node([this.constraintComponent]).out([N.message]).terms),i.map(t=>n.literal(z(t.value,e,n),t.language||void 0))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([dt.type],[N.ValidationResult]).addOut([N.focusNode],this.focusNode.terms).addOut([N.resultSeverity],[this.severity]).addOut([N.sourceConstraint],this.source).addOut([N.sourceConstraintComponent],[this.constraintComponent]).addOut([N.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([N.resultMessage],this.message);let n=t=>{if(t.quantifier===`one`)return t.predicates.length>1?e.node([this.factory.blankNode()]).addList([N.alternativePath],t.predicates):t.start===`object`?e.node([this.factory.blankNode()]).addOut([N.inversePath],[t.predicates[0]]):e.node([t.predicates[0]]);if(t.quantifier===`oneOrMore`)return e.node([this.factory.blankNode()]).addOut([N.oneOrMorePath],[t.predicates[0]]);if(t.quantifier===`zeroOrMore`)return e.node([this.factory.blankNode()]).addOut([N.zeroOrMorePath],[t.predicates[0]]);if(t.quantifier===`zeroOrOne`)return e.node([this.factory.blankNode()]).addOut([N.zeroOrOnePath],[t.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([N.resultPath],n(this.path[0]).terms):e.addList([N.resultPath],this.path.map(e=>n(e).term))),this.value!==void 0&&e.addOut([N.value],this.value.terms),t)for(let n of this.results)e.addOut([N.detail],[this.factory.blankNode()],e=>{n.build(e,{details:t})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}},jt=class e{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:r=new Set,report:i=new R({factory:e,options:n}),results:a=new Map,shape:o,value:s,valueOrNode:c,valuePaths:l,values:u}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=r,this.report=i,this.results=a,this.shape=o,this.value=s,this.valuePaths=l,this.valueOrNode=c,this.values=u}create({child:t,focusNode:n=this.focusNode,shape:r=this.shape,value:i=this.value,valueOrNode:a=this.valueOrNode,valuePaths:o=this.valuePaths,values:s=this.values}={}){return new e({factory:this.factory,focusNode:n,options:this.options,processed:this.processed,report:t?new R({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:i,valueOrNode:a,valuePaths:o,values:s})}id({shape:e=this.shape}={}){return`${O(e.ptr.term)} - ${O(this.focusNode.term)} - ${gt(this.valuePaths)}`}result(e){let t=new At({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:pt.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:pt.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||N.Violation,...t})}};function B(){return{generic:Mt()}}function Mt(){return e=>{e.trace(pt.TraversalConstraintComponent,{args:{},message:[e.factory.literal(`Traversal`)],value:e.valueOrNode})}}var Nt=class{constructor(e){this.validations=new Ue(e)}compile(e){let t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1,r=new Set;for(let t of e.ptr.execute({start:`subject`,end:`predicate`})){let e=this.validations.get(t.term);e&&(r.add(e),t.term.equals(N.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&r.add(B),[...r].map(t=>t(e)).filter(Boolean)}},V=x((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(let n of t)this.supportedRdfDatatypes.push(n),this.fromRdfHandlers[n.value]=e;for(let t of n){let n=this.toRdfHandlers[t];n||(this.toRdfHandlers[t]=n=[]),n.push(e)}}fromRdf(e,t){let n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){let n=this.toRdfHandlers[typeof e];if(n)for(let r of n){let n=r.toRdf(e,t);if(n)return n}throw Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}})),H=x((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;var t=V(),n=class e{fromRdf(e,n){switch(e.value){case`true`:return!0;case`false`:return!1;case`1`:return!0;case`0`:return!1}return n&&t.Translator.incorrectRdfDataType(e),!1}toRdf(t,{datatype:n,dataFactory:r}){return r.literal(t?`true`:`false`,n||r.namedNode(e.TYPE))}};e.TypeHandlerBoolean=n,n.TYPE=`http://www.w3.org/2001/XMLSchema#boolean`})),Pt=x((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;var t=V(),n=class e{fromRdf(n,r){switch(r&&!n.value.match(e.VALIDATORS[n.datatype.value.substr(33,n.datatype.value.length)])&&t.Translator.incorrectRdfDataType(n),n.datatype.value){case`http://www.w3.org/2001/XMLSchema#gDay`:return new Date(0,0,parseInt(n.value,10));case`http://www.w3.org/2001/XMLSchema#gMonthDay`:let e=n.value.split(`-`);return new Date(0,parseInt(e[0],10)-1,parseInt(e[1],10));case`http://www.w3.org/2001/XMLSchema#gYear`:return new Date(n.value+`-01-01`);case`http://www.w3.org/2001/XMLSchema#gYearMonth`:return new Date(n.value+`-01`);default:return new Date(n.value)}}toRdf(t,{datatype:n,dataFactory:r}){if(n||=r.namedNode(e.TYPES[0]),!(t instanceof Date))return null;let i=t,a;switch(n.value){case`http://www.w3.org/2001/XMLSchema#gDay`:a=String(i.getUTCDate());break;case`http://www.w3.org/2001/XMLSchema#gMonthDay`:a=i.getUTCMonth()+1+`-`+i.getUTCDate();break;case`http://www.w3.org/2001/XMLSchema#gYear`:a=String(i.getUTCFullYear());break;case`http://www.w3.org/2001/XMLSchema#gYearMonth`:a=i.getUTCFullYear()+`-`+(i.getUTCMonth()+1);break;case`http://www.w3.org/2001/XMLSchema#date`:a=i.toISOString().replace(/T.*$/,``);break;default:a=i.toISOString()}return r.literal(a,n)}};e.TypeHandlerDate=n,n.TYPES=[`http://www.w3.org/2001/XMLSchema#dateTime`,`http://www.w3.org/2001/XMLSchema#date`,`http://www.w3.org/2001/XMLSchema#gDay`,`http://www.w3.org/2001/XMLSchema#gMonthDay`,`http://www.w3.org/2001/XMLSchema#gYear`,`http://www.w3.org/2001/XMLSchema#gYearMonth`],n.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}})),Ft=x((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;var t=V(),n=class e{fromRdf(e,n){let r=parseFloat(e.value);return n&&isNaN(r)&&t.Translator.incorrectRdfDataType(e),r}toRdf(t,{datatype:n,dataFactory:r}){return n||=r.namedNode(e.TYPES[0]),isNaN(t)?r.literal(`NaN`,n):isFinite(t)?t%1==0?null:r.literal(t.toExponential(15).replace(/(\d)0*e\+?/,`$1E`),n):r.literal(t>0?`INF`:`-INF`,n)}};e.TypeHandlerNumberDouble=n,n.TYPES=[`http://www.w3.org/2001/XMLSchema#double`,`http://www.w3.org/2001/XMLSchema#decimal`,`http://www.w3.org/2001/XMLSchema#float`]})),It=x((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;var t=V(),n=class e{fromRdf(e,n){let r=parseInt(e.value,10);return n&&(isNaN(r)||e.value.indexOf(`.`)>=0)&&t.Translator.incorrectRdfDataType(e),r}toRdf(t,{datatype:n,dataFactory:r}){return r.literal(String(t),n||(t<=e.MAX_INT&&t>=e.MIN_INT?r.namedNode(e.TYPES[0]):r.namedNode(e.TYPES[1])))}};e.TypeHandlerNumberInteger=n,n.TYPES=[`http://www.w3.org/2001/XMLSchema#integer`,`http://www.w3.org/2001/XMLSchema#long`,`http://www.w3.org/2001/XMLSchema#int`,`http://www.w3.org/2001/XMLSchema#byte`,`http://www.w3.org/2001/XMLSchema#short`,`http://www.w3.org/2001/XMLSchema#negativeInteger`,`http://www.w3.org/2001/XMLSchema#nonNegativeInteger`,`http://www.w3.org/2001/XMLSchema#nonPositiveInteger`,`http://www.w3.org/2001/XMLSchema#positiveInteger`,`http://www.w3.org/2001/XMLSchema#unsignedByte`,`http://www.w3.org/2001/XMLSchema#unsignedInt`,`http://www.w3.org/2001/XMLSchema#unsignedLong`,`http://www.w3.org/2001/XMLSchema#unsignedShort`],n.MAX_INT=2147483647,n.MIN_INT=-2147483648})),Lt=x((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;var t=class{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}};e.TypeHandlerString=t,t.TYPES=[`http://www.w3.org/2001/XMLSchema#string`,`http://www.w3.org/2001/XMLSchema#normalizedString`,`http://www.w3.org/2001/XMLSchema#anyURI`,`http://www.w3.org/2001/XMLSchema#base64Binary`,`http://www.w3.org/2001/XMLSchema#language`,`http://www.w3.org/2001/XMLSchema#Name`,`http://www.w3.org/2001/XMLSchema#NCName`,`http://www.w3.org/2001/XMLSchema#NMTOKEN`,`http://www.w3.org/2001/XMLSchema#token`,`http://www.w3.org/2001/XMLSchema#hexBinary`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`,`http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString`,`http://www.w3.org/2001/XMLSchema#time`,`http://www.w3.org/2001/XMLSchema#duration`]})),Rt=x((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(H(),e),n(Pt(),e),n(Ft(),e),n(It(),e),n(Lt(),e)})),zt=x((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Bt=x((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.fromRdf=l,e.toRdf=u,e.getTermRaw=d,e.getSupportedRdfDatatypes=f,e.getSupportedJavaScriptPrimitives=p;var r=o(),i=Rt(),a=V();n(Rt(),e),n(zt(),e),n(V(),e);var s=new r.DataFactory,c=new a.Translator;c.registerHandler(new i.TypeHandlerString,i.TypeHandlerString.TYPES.map(e=>s.namedNode(e)),[`string`]),c.registerHandler(new i.TypeHandlerBoolean,[i.TypeHandlerBoolean.TYPE].map(e=>s.namedNode(e)),[`boolean`]),c.registerHandler(new i.TypeHandlerNumberDouble,i.TypeHandlerNumberDouble.TYPES.map(e=>s.namedNode(e)),[`number`]),c.registerHandler(new i.TypeHandlerNumberInteger,i.TypeHandlerNumberInteger.TYPES.map(e=>s.namedNode(e)),[`number`]),c.registerHandler(new i.TypeHandlerDate,i.TypeHandlerDate.TYPES.map(e=>s.namedNode(e)),[`object`]);function l(e,t){return c.fromRdf(e,t)}function u(e,t){return t&&`namedNode`in t&&(t={dataFactory:t}),t||={},t&&!t.dataFactory&&(t.dataFactory=s),c.toRdf(e,t)}function d(e,t){return e.termType===`Literal`?l(e,t):e.value}function f(){return c.getSupportedRdfDatatypes()}function p(){return c.getSupportedJavaScriptPrimitives()}}))();function Vt(e){if(e.term.termType!==`BlankNode`)return{quantifier:`one`,start:`subject`,end:`object`,predicates:[e.term]};let t=e.out([N.alternativePath]);if(t.ptrs.length===1&&t.ptrs[0].isList())return{quantifier:`one`,start:`subject`,end:`object`,predicates:[...t.list()].map(e=>e.term)};let n=e.out([N.inversePath]);if(n.term)return{quantifier:`one`,start:`object`,end:`subject`,predicates:[n.term]};let r=e.out([N.oneOrMorePath]);if(r.term)return{quantifier:`oneOrMore`,start:`subject`,end:`object`,predicates:[r.term]};let i=e.out([N.zeroOrMorePath]);if(i.term)return{quantifier:`zeroOrMore`,start:`subject`,end:`object`,predicates:[i.term]};let a=e.out([N.zeroOrOnePath]);if(a.term)return{quantifier:`zeroOrOne`,start:`subject`,end:`object`,predicates:[a.term]}}function Ht(e){return e.terms.length===0?null:e.ptrs[0].isList()?[...e.list()].map(e=>Vt(e)):[Vt(e)]}var Ut=class{constructor(e){this.shape=e,this._compiled=(0,I.default)(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){let t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(let e of this.compiled)e.node&&await e.node(t),e.generic&&await e.generic(t)}async validateProperty(e){let t;t=this.shape.isSparqlShape?e.focusNode:e.focusNode.executeAll(this.shape.path);let n=t.node(new k(t.terms)),r=[...t].reduce((e,n)=>{let r=n.term,i=t.node([r]);return e.has(r)||e.set(r,{value:i,valuePaths:[]}),e.get(r).valuePaths.push(n),e},new Ue).values(),i=e.create({shape:this.shape,values:n});for(let e of this.compiled)e.property&&await e.property(i);for(let{value:t,valuePaths:n}of r){let r=e.create({shape:this.shape,value:t,valueOrNode:t,valuePaths:n});for(let e of this.compiled)e.generic&&await e.generic(r)}}};function Wt(e){let t=new k,n=new ut({dataset:e.dataset,terms:e.terms}).execute({quantifier:`zeroOrMore`,start:`object`,end:`subject`,predicates:[ft.subClassOf]});for(let e of n.ptrs)for(let{term:n}of e.nodes())t.add(n);return t}var Gt=class{constructor(e,{registry:t}){this.registry=t,this.targetClass=new k([...Wt(e.hasOut([dt.type],[N.NodeShape])),...Wt(e.out([N.targetClass]))]),this.targetNode=e.out([N.targetNode]).terms,this.targetObjectsOf=e.out([N.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([N.targetSubjectsOf]).terms,this.targets=[...e.out([N.target])]}async resolve(e){let t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([dt.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:`object`,end:`object`,predicates:this.targetObjectsOf}).ptrs,...t.execute({start:`subject`,end:`subject`,predicates:this.targetSubjectsOf}).ptrs];for(let t of this.targets)for(let[,r]of this.registry.targetResolvers){let i=await r(t,e);n.push(...e.focusNode.node(i).ptrs)}let r=e.focusNode.clone({ptrs:n});return r.node([...new k(r.terms)])}},Kt=class{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=(0,I.default)(()=>{let e=this.ptr.out([N.deactivated]).term;return e&&(0,Bt.fromRdf)(e)}),this._message=(0,I.default)(()=>this.ptr.out([N.message]).terms),this._path=(0,I.default)(()=>Ht(this.ptr.out([N.path]))),this._severity=(0,I.default)(()=>this.ptr.out([N.severity]).term),this._shapeValidator=(0,I.default)(()=>new Ut(this)),this._sparql=(0,I.default)(()=>this.ptr.out([N.sparql])),this._targetResolver=(0,I.default)(()=>new Gt(this.ptr,{registry:this.validator.targetResolverRegistry}))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}async resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){let t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(let n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}},qt=class{constructor(e){this.targetResolvers=new Ue(e)}};function U(e){return{property:Jt(parseInt(e.ptr.out([N.maxCount]).value))}}function Jt(e){return t=>{t.test(t.values.terms.length<=e,N.MaxCountConstraintComponent,{args:{maxCount:e},message:[t.factory.literal(`More than {$maxCount} values`)]})}}function W(e){return{property:Yt(parseInt(e.ptr.out([N.minCount]).value))}}function Yt(e){return t=>{t.test(t.values.terms.length>=e,N.MinCountConstraintComponent,{args:{minCount:e},message:[t.factory.literal(`Less than {$minCount} values`)]})}}async function Xt(e,t){for(let n of e)if(!await t(n))return!1;return!0}async function Zt(e,t){return(await Promise.all(e.map(e=>t(e)))).filter(Boolean)}async function Qt(e,t){return Promise.all(e.map(t))}async function $t(e,t){for(let n of e)if(await t(n))return!0;return!1}function en(e){return{generic:tn([...e.ptr.out([N.and])].flatMap(e=>[...e.list()]).map(t=>e.validator.shape(t)))}}function tn(e){return async t=>{let n=await Qt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),r=n.every(e=>e.conforms);t.test(r,N.AndConstraintComponent,{results:n.flatMap(e=>e.results),value:t.valueOrNode})}}function G(e){return{generic:nn(e.validator.shape(e.ptr.out([N.not])))}}function nn(e){return async t=>{let n=(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report,r=!n.conforms;t.test(r,N.NotConstraintComponent,{args:{not:e.ptr.term},message:[t.factory.literal(`Value does have shape {$not}`)],results:n.results,value:t.valueOrNode})}}function rn(e){return{generic:an([...e.ptr.out([N.or])].flatMap(e=>[...e.list()]).map(t=>e.validator.shape(t)))}}function an(e){return async t=>{let n=[],r;if(t.options.debug||t.options.details){let i=await Qt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report);n=i.flatMap(e=>e.results),r=i.some(e=>e.conforms)}else r=await $t(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report.conforms);t.test(r,N.OrConstraintComponent,{results:n,value:t.valueOrNode})}}function on(e){return{generic:sn([...e.ptr.out([N.xone])].flatMap(e=>[...e.list()]).map(t=>e.validator.shape(t)))}}function sn(e){return async t=>{let n=await Qt(e,async e=>(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),r=n.filter(e=>e.conforms).length===1;t.test(r,N.XoneConstraintComponent,{results:n.flatMap(e=>e.results),value:t.valueOrNode})}}function cn(e){return(0,Bt.fromRdf)(e.ptr.out([N.closed]).term)?{node:ln(new k(e.ptr.out([N.property]).map(t=>e.validator.shape(t)).filter(e=>!e.deactivated).map(e=>e.path[0].predicates[0])),new k([...e.ptr.out([N.ignoredProperties]).list()||[]].map(e=>e.term)))}:null}function ln(e,t){return n=>{let r=n.focusNode.execute({start:`subject`,end:`predicate`}).filter(n=>!t.has(n.term)&&!e.has(n.term));if(r.ptrs.length>0)for(let e of r)n.violation(N.ClosedConstraintComponent,{message:[n.factory.literal(`Predicate is not allowed (closed shape)`)],path:[{quantifier:`one`,start:`subject`,end:`object`,predicates:[e.term]}],value:n.focusNode.node([[...e.quads()][0].object])});else n.debug(N.ClosedConstraintComponent)}}function un(e){let t=e.ptr.out([N.hasValue]).term;return{node:K(t),property:dn(t)}}function K(e){return t=>{t.test(e.equals(t.valueOrNode.term),N.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal(`Value must be {$hasValue}`)]})}}function dn(e){return t=>{let n=[...t.values].some(t=>e.equals(t.term));t.test(n,N.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal(`Missing expected value {$hasValue}`)]})}}function fn(e){return{generic:pn(new k([...e.ptr.out([N.in]).list()].map(e=>e.term)))}}function pn(e){return t=>{t.test(e.has(t.valueOrNode.term),N.InConstraintComponent,{args:{in:[...e].map(e=>e.value).join(`, `)},message:[t.factory.literal(`Value is not in {$in}`)],value:t.valueOrNode})}}function mn(e,t){if(!e||e.termType!==`Literal`||!t||t.termType!==`Literal`||hn(e)!==hn(t))return null;let n=(0,Bt.fromRdf)(e),r=(0,Bt.fromRdf)(t);return typeof n==typeof r?typeof n==`string`?n.localeCompare(r):n-r:null}function hn(e){return mt.dateTime.equals(e.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(e.value)}function gn(e){let t=e.ptr.out([N.disjoint]).term;return{generic:_n(t)}}function _n(e){return t=>{let n=t.focusNode.dataset.match(t.focusNode.term,e,t.valueOrNode.term);t.test(n.size===0,N.DisjointConstraintComponent,{args:{disjoint:e},message:[t.factory.literal(`Value node must not also be one of the values of {$disjoint}`)],value:t.valueOrNode})}}function vn(e){let t=e.ptr.out([N.equals]).term;return{node:yn(t),property:bn(t)}}function yn(e){return t=>{let n=t.focusNode.out([e]),r=n.filter(e=>!e.term.equals(t.focusNode.term)),i=n.terms.length!==0&&r.terms.length===0;t.test(i,N.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal(`Must have same values as {$equals}`)],value:r.terms[0]&&t.focusNode.node([r.terms[0]])||t.focusNode})}}function bn(e){return t=>{let n=new k(t.focusNode.out([e]).terms),r=new k(t.values.terms),i=[...r].filter(e=>!n.has(e)),a=[...n].filter(e=>!r.has(e)),o=[...i,...a];for(let n of o)t.violation(N.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal(`Must have same values as {$equals}`)],value:t.focusNode.node([n])});o.length===0&&t.debug(N.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal(`Must have same values as {$equals}`)]})}}function xn(e){let t=e.ptr.out([N.lessThan]).term;return{property:Sn(t)}}function Sn(e){return t=>{let n=t.focusNode.out([e]).terms;for(let r of t.values)for(let i of n){let n=mn(r.term,i);n===null||n>=0?t.violation(N.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal(`Value is not less than value of {$lessThan}`)],value:r}):t.debug(N.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal(`Value is not less than value of {$lessThan}`)],value:r})}}}function Cn(e){let t=e.ptr.out([N.lessThanOrEquals]).term;return{property:wn(t)}}function wn(e){return t=>{let n=t.focusNode.out([e]).terms;for(let r of t.values)for(let i of n){let n=mn(r.term,i);n===null||n>0?t.violation(N.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal(`Value is not less than or equal to value of {$lessThanOrEquals}`)],value:r}):t.debug(N.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal(`Value is not less than or equal to value of {$lessThanOrEquals}`)],value:r})}}}function Tn(e){let t=e.ptr.out([N.maxExclusive]).term;return{generic:En(t)}}function En(e){return t=>{let n=mn(t.valueOrNode.term,e);t.test(n!==null&&n<0,N.MaxExclusiveConstraintComponent,{args:{maxExclusive:e},message:[t.factory.literal(`Value is not less than {$maxExclusive}`)],value:t.valueOrNode})}}function Dn(e){let t=e.ptr.out([N.maxInclusive]).term;return{generic:On(t)}}function On(e){return t=>{let n=mn(t.valueOrNode.term,e);t.test(n!==null&&n<=0,N.MaxInclusiveConstraintComponent,{args:{maxInclusive:e},message:[t.factory.literal(`Value is not less than or equal to {$maxInclusive}`)],value:t.valueOrNode})}}function kn(e){let t=e.ptr.out([N.minExclusive]).term;return{generic:An(t)}}function An(e){return t=>{let n=mn(t.valueOrNode.term,e);t.test(n!==null&&n>0,N.MinExclusiveConstraintComponent,{args:{minExclusive:e},message:[t.factory.literal(`Value is not greater than {$minExclusive}`)],value:t.valueOrNode})}}function jn(e){let t=e.ptr.out([N.minInclusive]).term;return{generic:Mn(t)}}function Mn(e){return t=>{let n=mn(t.valueOrNode.term,e);t.test(n!==null&&n>=0,N.MinInclusiveConstraintComponent,{args:{minInclusive:e},message:[t.factory.literal(`Value is not greater than or equal to {$minInclusive}`)],value:t.valueOrNode})}}function Nn(e){return{generic:Pn([...e.ptr.out([N.node])].map(t=>e.validator.shape(t)))}}function Pn(e){return async t=>{for(let n of e){let e=await n.validate(t.create({child:!0,focusNode:t.valueOrNode}));t.test(e.report.conforms,N.NodeConstraintComponent,{args:{node:n.ptr.term},message:[t.factory.literal(`Value does not have shape {$node}`)],results:e.report.results,value:t.valueOrNode})}}}function Fn(e){return{generic:In([...e.ptr.out([N.property])].map(t=>e.validator.shape(t)))}}function In(e){return async t=>{let n=t.create({focusNode:t.valueOrNode});for(let t of e)await t.validate(n)}}function Ln(e){let t=e.validator.shape(e.ptr.out([N.qualifiedValueShape])),n=e.ptr.out([N.qualifiedValueShapesDisjoint]).term,r=n?(0,Bt.fromRdf)(n):!1,i=e.ptr.out([N.qualifiedMaxCount]).term,a=i?parseInt(i.value):null,o=e.ptr.out([N.qualifiedMinCount]).term;return{property:Rn(t,r,a,o?parseInt(o.value):null)}}function Rn(e,t,n,r){return async i=>{let a=[],o=[];t&&(o=new Set(i.shape.ptr.in([N.property]).out([N.property]).out([N.qualifiedValueShape]).filter(t=>!t.term.equals(e.ptr.term)).map(e=>i.shape.validator.shape(e))));let s=(await Zt(i.values,async t=>{let n=(await e.validate(i.create({child:!0,focusNode:t}))).report;if(a.push(n.results),!n.conforms)return!1;if(o.length===0)return!0;if(i.options.debug||i.options.details){let e=await Qt([...o],async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report);return a.push(e.flatMap(e=>e.results)),!e.every(e=>e.conforms)}else return!await Xt([...o],async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report.conforms)})).length;n!==null&&i.test(s<=n,N.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal(`More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}`)],results:a.flat()}),r!==null&&i.test(s>=r,N.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal(`Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}`)],results:a.flat()})}}function zn(e,t){return t?t.slice(0,e.length)===e:!1}function Bn(e){return{generic:q([...new Set([...e.ptr.out([N.languageIn]).list()].map(e=>e.value))])}}function q(e){return t=>{let n=e.some(e=>zn(e,t.valueOrNode.term.language));t.test(n,N.LanguageInConstraintComponent,{args:{languageIn:e.join(`, `)},message:[t.factory.literal(`Language does not match any of {$languageIn}`)],value:t.valueOrNode})}}function Vn(e){return{generic:Hn(parseInt(e.ptr.out([N.maxLength]).value))}}function Hn(e){return t=>{let n=t.valueOrNode.term.termType!==`BlankNode`&&t.valueOrNode.value.length<=e;t.test(n,N.MaxLengthConstraintComponent,{args:{maxLength:e},message:[t.factory.literal(`Value has more than {$maxLength} characters`)],value:t.valueOrNode})}}function Un(e){return{generic:Wn(parseInt(e.ptr.out([N.minLength]).value))}}function Wn(e){return t=>{let n=t.valueOrNode.term.termType!==`BlankNode`&&t.valueOrNode.value.length>=e;t.test(n,N.MinLengthConstraintComponent,{args:{minLength:e},message:[t.factory.literal(`Value has less than {$minLength} characters`)],value:t.valueOrNode})}}function Gn(e){let t=e.ptr.out([N.pattern]).value,n=e.ptr.out([N.flags]).value;return{generic:Kn(t,n,new RegExp(t,n))}}function Kn(e,t,n){return r=>{r.test(n.test(r.valueOrNode.term.value),N.PatternConstraintComponent,{args:{flags:t,pattern:e},message:[r.factory.literal(`Value does not match pattern "{$pattern}"`)],value:r.valueOrNode})}}function qn(e){let t=e.ptr.out([N.uniqueLang]).term;return t.value===`true`&&mt.boolean.equals(t.datatype)?{property:Jn()}:null}function Jn(){return e=>{let t=Object.entries(e.values.terms.reduce((e,t)=>(t.language&&(e[t.language]=(e[t.language]||0)+1),e),{})).filter(([,e])=>e>1);for(let[n]of t)e.violation(N.UniqueLangConstraintComponent,{args:{lang:n},message:[e.factory.literal(`Language "{?lang}" used more than once`)]});t.length===0&&e.debug(N.UniqueLangConstraintComponent)}}var Yn=A(`http://www.w3.org/ns/shacl#`),J=A(`https://schemas.link/shacl-next#`),Xn=class{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(Yn.Info)||e.severity.equals(Yn.Violation)||e.severity.equals(Yn.Warning))}};function Zn(e,t){return Object.entries(t).reduce((e,[t,n])=>(n&&n.termType&&(n=O(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n)),e)}var Y=class{constructor({args:e={},factory:t,message:n=[],severity:r=Yn.Violation}={}){this.severity=r,this.message=n.map(n=>t.literal(Zn(n.value,e),n.language||null))}},Qn=class e{constructor({factory:e=rt}={}){this.factory=e}clone({factory:t}={}){return new e({factory:t||this.factory})}validate(){return new Xn}validateSimple(){return!0}},$n=class e extends Qn{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(let t of Array.isArray(e)?e:[e])t&&this.datatypes.push(this.factory.fromTerm(t))}clone({factory:t}={}){return new e({datatypes:this.datatypes,factory:t||this.factory})}},er=class{constructor({factory:e=rt,validations:t}={}){if(this.factory=e,this.validations=new Ue,t)for(let e of Object.values(t)){let t=e.clone({factory:this.factory});for(let e of t.datatypes)this.validations.set(e,t)}}validate(e){let t=this.validations.get(e.datatype);return t?t.validate(e):new Xn}validateSimple(e){let t=this.validations.get(e.datatype);return!t||t.validateSimple(e)}},X=class e extends $n{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal(`term value {$this} matches pattern {$pattern}`)],this.patterns=Array.isArray(e)?e:[e]}clone({factory:t}={}){return new e(this.patterns,this.datatypes,{factory:t||this.factory})}validate(e){return new Xn({results:this.patterns.map(t=>{let n;return t.test(e.value)&&(n=J.Debug),new Y({args:{pattern:this.factory.literal(t.toString()),this:e},factory:this.factory,message:this.message,severity:n})})})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}},tr=/^([-+]?[0-9]+)$/,Z=class e extends X{constructor(e=null,t=null,n,{factory:r}={}){super(tr,n,{factory:r}),this.maxInclusive=null,this.minInclusive=null,typeof t==`string`&&(this.maxInclusive=BigInt(t)),typeof e==`string`&&(this.minInclusive=BigInt(e))}clone({factory:t}={}){return new e(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:t||this.factory})}validate(e){let t=super.validate(e).results;if(!J.Debug.equals(t[0].severity))return new Xn({results:t});let n=BigInt(e.value);if(this.minInclusive!==null&&n<this.minInclusive){let n=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Y({factory:this.factory,message:r}))}if(this.maxInclusive!==null&&n>this.maxInclusive){let n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Y({factory:this.factory,message:r}))}return new Xn({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;let t=BigInt(e.value);return!(this.minInclusive!==null&&t<this.minInclusive||this.maxInclusive!==null&&t>this.maxInclusive)}},nr=class e extends $n{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:t}={}){return new e(this.values,this.datatypes,{factory:t||this.factory})}validate(e){let t=[];if(!this.values.has(e.value)){let n=`term value "${e.value}" is not included in the list: ${[...this.values].join(`,`)}`,r=[this.factory.literal(n)];t.push(new Y({factory:this.factory,message:r}))}return new Xn({results:t})}validateSimple(e){return this.values.has(e.value)}},rr=b({anyAtomicType:()=>ar,anySimpleType:()=>ir,anyURI:()=>Ir,base64Binary:()=>Fr,boolean:()=>xr,byte:()=>Qr,date:()=>Or,dateTime:()=>Er,dateTimeStamp:()=>si,dayTimeDuration:()=>oi,decimal:()=>Sr,double:()=>wr,duration:()=>Tr,float:()=>Cr,gDay:()=>Mr,gMonth:()=>Nr,gMonthDay:()=>jr,gYear:()=>Ar,gYearMonth:()=>kr,hexBinary:()=>Pr,int:()=>Xr,integer:()=>Kr,language:()=>Gr,long:()=>Yr,negativeInteger:()=>Jr,nonNegativeInteger:()=>$r,nonPositiveInteger:()=>qr,normalizedString:()=>Ur,positiveInteger:()=>ii,short:()=>Zr,string:()=>br,time:()=>Dr,token:()=>Wr,unsignedByte:()=>ri,unsignedInt:()=>ti,unsignedLong:()=>ei,unsignedShort:()=>ni,yearMonthDuration:()=>ai}),Q={xsd:A(`http://www.w3.org/2001/XMLSchema#`)},ir=new $n({datatypes:Q.xsd.anySimpleType}),ar=new $n({datatypes:Q.xsd.anyAtomicType}),or=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,sr=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,cr=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,lr=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,ur=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,dr=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,fr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,pr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,mr=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,hr=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,gr=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,_r=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,vr=/^(([0-9a-fA-F]{2})*)$/,yr=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,br=new X(or,Q.xsd.string),xr=new nr([`1`,`true`,`0`,`false`],Q.xsd.boolean),Sr=new X(sr,Q.xsd.decimal),Cr=new X(cr,Q.xsd.float),wr=new X(cr,Q.xsd.double),Tr=new X(lr,Q.xsd.duration),Er=new X(ur,Q.xsd.dateTime),Dr=new X(dr,Q.xsd.time),Or=new X(fr,Q.xsd.date),kr=new X(pr,Q.xsd.gYearMonth),Ar=new X(mr,Q.xsd.gYear),jr=new X(hr,Q.xsd.gMonthDay),Mr=new X(gr,Q.xsd.gDay),Nr=new X(_r,Q.xsd.gMonth),Pr=new X(vr,Q.xsd.hexBinary),Fr=new X(yr,Q.xsd.base64Binary),Ir=new X(or,Q.xsd.anyURI),Lr=/^([^\u000d\u000a\u0009]*)$/,Rr=/^([^ ]+( [^ ]+)*)*$/,zr=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Br=/^([^DT]*)$/,Vr=/^([^YM]*[DT].*)$/,Hr=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Ur=new X([or,Lr],Q.xsd.normalizedString),Wr=new X([or,Lr,Rr],Q.xsd.token),Gr=new X(zr,Q.xsd.language),Kr=new Z(null,null,Q.xsd.integer),qr=new Z(null,`0`,Q.xsd.nonPositiveInteger),Jr=new Z(null,`-1`,Q.xsd.negativeInteger),Yr=new Z(`-9223372036854775808`,`9223372036854775807`,Q.xsd.long),Xr=new Z(`-2147483648`,`2147483647`,Q.xsd.int),Zr=new Z(`-32768`,`32767`,Q.xsd.short),Qr=new Z(`-128`,`127`,Q.xsd.byte),$r=new Z(`0`,null,Q.xsd.nonNegativeInteger),ei=new Z(`0`,`18446744073709551615`,Q.xsd.unsignedLong),ti=new Z(`0`,`4294967295`,Q.xsd.unsignedInt),ni=new Z(`0`,`65535`,Q.xsd.unsignedShort),ri=new Z(`0`,`255`,Q.xsd.unsignedByte),ii=new Z(`1`,null,Q.xsd.positiveInteger),ai=new X([lr,Br],Q.xsd.yearMonthDuration),oi=new X([lr,Vr],Q.xsd.dayTimeDuration),si=new X([ur,Hr],Q.xsd.dateTimeStamp),ci=class extends er{constructor({factory:e}={}){super({factory:e,validations:{...rr}})}},li=new Ue([[N.BlankNode,new Set([`BlankNode`])],[N.BlankNodeOrIRI,new Set([`BlankNode`,`NamedNode`])],[N.BlankNodeOrLiteral,new Set([`BlankNode`,`Literal`])],[N.IRI,new Set([`NamedNode`])],[N.IRIOrLiteral,new Set([`NamedNode`,`Literal`])],[N.Literal,new Set([`Literal`])]]);function ui(e){return{generic:di(e.ptr.out([N.class]).map(e=>Wt(e)))}}function di(e){return t=>{let n=new k(t.valueOrNode.out([dt.type]).terms);for(let r of e){let e=[...n].some(e=>r.has(e));t.test(e,N.ClassConstraintComponent,{value:t.valueOrNode})}}}function fi(e){let t=e.ptr.out([N.datatype]).term;return{generic:pi(t,new ci)}}function pi(e,t){return n=>{let r=e.equals(n.valueOrNode.term.datatype)&&t.validateSimple(n.valueOrNode.term);n.test(r,N.DatatypeConstraintComponent,{args:{datatype:e},message:[n.factory.literal(`Value does not have datatype {$datatype}`)],value:n.valueOrNode})}}function mi(e){let t=e.ptr.out([N.nodeKind]).term;return{generic:hi(t,li.get(t))}}function hi(e,t){return n=>{n.test(t.has(n.valueOrNode.term.termType),N.NodeKindConstraintComponent,{args:{nodeKind:e},message:[n.factory.literal(`Value does not have node kind {$nodeKind}`)],value:n.valueOrNode})}}var gi=new Ue([[N.maxCount,U],[N.minCount,W],[N.and,en],[N.not,G],[N.or,rn],[N.xone,on],[N.closed,cn],[N.hasValue,un],[N.in,fn],[N.disjoint,gn],[N.equals,vn],[N.lessThan,xn],[N.lessThanOrEquals,Cn],[N.maxExclusive,Tn],[N.maxInclusive,Dn],[N.minExclusive,kn],[N.minInclusive,jn],[N.node,Nn],[N.property,Fn],[N.qualifiedValueShape,Ln],[N.languageIn,Bn],[N.maxLength,Vn],[N.minLength,Un],[N.pattern,Gn],[N.uniqueLang,qn],[N.class,ui],[N.datatype,fi],[N.nodeKind,mi]]),_i=class{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new Nt(gi),this.targetResolverRegistry=new qt(this.options.targetResolvers||[]),this.shapesPtr=new ut({dataset:e,factory:t}),this.shapes=new Ue,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(let[e,t]of this.options.validations)this.registry.validations.set(e,t);let r=[...this.shapesPtr.hasOut([N.targetClass]),...this.shapesPtr.hasOut([N.targetNode]),...this.shapesPtr.hasOut([N.targetObjectsOf]),...this.shapesPtr.hasOut([N.targetSubjectsOf]),...this.shapesPtr.hasOut([N.target]),...this.shapesPtr.hasOut([dt.type],[N.NodeShape]),...this.shapesPtr.hasOut([dt.type],[N.PropertyShape])];for(let e of r)this.shape(e)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new Kt(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){let n=new ut({...e,factory:this.factory}),r=new jt({factory:this.factory,focusNode:n,options:this.options,validator:this});t=t?t.map(e=>this.shape(this.shapesPtr.node(e.terms))):this.shapes.values();for(let e of t){let t=r.create({shape:e}),i;i=n.isAny()?await e.resolveTargets(t):n;for(let n of i)await e.validate(t.create({focusNode:n}))}return r.report}},vi=class{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace=``,this.valuesGraph=null,this.preserveUnmappedValues=null,this.view=null,this.mode=null,this.language=null,this.loading=`Loading…`,this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.hierarchyColors=null,this.submitButton=null,this.generateNodeShapeReference=re.value,this.showNodeIds=null,this.showRootShapeLabel=null,this.dense=`true`,this.useShadowRoot=`true`}},yi=`#4c93d785, #f85e9a85, #00327385, #87001f85`,bi=class{constructor(e){this.attributes=new vi,this.mode=`edit`,this.lists={},this.groups=[],this.renderedNodes=new Set,this.originalValues=new we,this._store=new we,this._nodeTemplates={},this._propertyTemplates={},this.validator=new _i(this._store,{details:!0,factory:y}),this.providedConformingResourceIds={},this.providedResources={},this.providedResourceLabels={},this.form=e,this._theme=new Ae,this.languages=[...new Set(navigator.languages.flatMap(e=>e.length>2?[e.toLocaleLowerCase(),e.substring(0,2)]:e)),``]}reset(){this.lists={},this.groups=[],this.renderedNodes.clear(),this.providedConformingResourceIds={},this.providedResources={},this.providedResourceLabels={},this.originalValues=new we,this._nodeTemplates={},this._propertyTemplates={}}updateAttributes(e){let t=new vi;if(Object.keys(t).forEach(n=>{let r=e.dataset[n];r!==void 0&&(t[n]=r)}),t.mode!==null&&![`edit`,`view`,`query`].includes(t.mode))throw Error(`invalid shacl-form mode: ${t.mode}`);if(this.mode=t.mode??(t.view===null?`edit`:`view`),this.theme.setDense(t.dense===`true`),this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){let e=this.languages.indexOf(t.language);e>-1&&this.languages.splice(e,1),this.languages.unshift(t.language)}if(t.valuesGraph&&(this.valuesGraphId=y.namedNode(t.valuesGraph)),t.hierarchyColors!=null){let e=t.hierarchyColors.length?t.hierarchyColors:yi,n=`:host { --hierarchy-colors: ${e}; --hierarchy-colors-length: ${e.split(`,`).length} }`;for(let e=8;e>=0;e--){let t=`shacl-property { --hierarchy-level: ${e} }`;for(let n=0;n<e;n++)t=`shacl-property `+t;n=n+`
|
|
10
|
+
`+t}this.hierarchyColorsStyleSheet=new CSSStyleSheet,this.hierarchyColorsStyleSheet.replaceSync(n)}}static dataAttributes(){let e=new vi;return Object.keys(e).map(e=>(e=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),`data-`+e))}buildTemplateKey(e,t){let n=e.value;return t&&(t instanceof w?n+=`*`+t.id.value:n+=`*`+this.buildTemplateKey(t.id,t.parent)),n}registerNodeTemplate(e){this._nodeTemplates[this.buildTemplateKey(e.id,e.parent)]=e}registerPropertyTemplate(e){this._propertyTemplates[this.buildTemplateKey(e.id,e.parent)]=e}getNodeTemplateIds(){let e=new Set;for(let t of Object.values(this._nodeTemplates))e.add(t.id.value);return e}getNodeTemplate(e,t){let n=this.buildTemplateKey(e,t),r=this._nodeTemplates[n];return r||=new ve(e,this,t),r}getPropertyTemplate(e,t){let n=this.buildTemplateKey(e,t),r=this._propertyTemplates[n];return r||=new w(e,t),r}get nodeTemplates(){return Object.values(this._nodeTemplates)}get theme(){return this._theme}set theme(e){this._theme=e,e.setDense(this.attributes.dense===`true`)}get store(){return this._store}get editMode(){return this.mode===`edit`}get queryMode(){return this.mode===`query`}set store(e){this._store=e,this.lists=g(e,{ignoreErrors:!0}),this.groups=[],e.forSubjects(e=>{this.groups.push(e.id)},ye,`${le}PropertyGroup`,null),this.validator=new _i(e,{details:!0,factory:y})}},xi=200,Si=class extends HTMLElement{static get observedAttributes(){return bi.dataAttributes()}constructor(){super(),this.shape=null,this.styleElement=null,this.validationQueue=Promise.resolve(),this.validationGeneration=0,this.form=document.createElement(`form`),this.form.setAttribute(`part`,`form`),this.config=new bi(this.form),this.form.addEventListener(`change`,e=>{e.stopPropagation(),this.config.queryMode?this.queryController?.handleChange():this.config.editMode&&this.validate(!0).then(e=>{this.refreshClassInstanceEditors(),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:e.conforms,report:e}}))}).catch(e=>{console.warn(e)})})}connectedCallback(){this.config.updateAttributes(this),this.ensureRenderRoot(),this.initialize()}attributeChangedCallback(){this.config.updateAttributes(this),this.ensureRenderRoot(),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.queryController?.dispose(),this.queryController=void 0,this.setAttribute(`loading`,``),this.config.theme.apply(this.form),this.applyStyles([this.config.theme.stylesheet]),this.form.replaceChildren(document.createTextNode(this.config.attributes.loading)),this.initDebounceTimeout=setTimeout(async()=>{try{this.config.reset(),this.config.store=await v({shapes:this.config.attributes.shapes,shapesUrl:this.config.attributes.shapesUrl,values:this.config.attributes.values,valuesUrl:this.config.attributes.valuesUrl,valuesSubject:this.config.attributes.valuesSubject,loadOwlImports:this.config.attributes.ignoreOwlImports===null,classInstanceProvider:this.config.classInstanceProvider,rdfUrlResolver:this.config.rdfUrlResolver,proxy:this.config.attributes.proxy},this.config.originalValues),this.config.resourceLinkProvider&&await be(this.config),this.config.attributes.valuesSubject||(this.config.attributes.valuesSubject=T(this.config.store)||null),this.form.replaceChildren();let t=this.findRootShaclShapeSubject();if(t){if(this.form.classList.forEach(e=>{this.form.classList.remove(e)}),this.form.classList.toggle(`mode-edit`,this.config.editMode),this.form.classList.toggle(`mode-view`,this.config.mode===`view`),this.form.classList.toggle(`mode-query`,this.config.queryMode),this.config.queryMode){let{QueryModeController:t}=await e(async()=>{let{QueryModeController:e}=await import(`./assets/mode-Bjl1P7KJ.js`);return{QueryModeController:e}},[]);this.queryController=new t(this)}this.config.theme.apply(this.form);let n=[this.config.theme.stylesheet];this.config.hierarchyColorsStyleSheet&&n.push(this.config.hierarchyColorsStyleSheet),this.queryController&&n.push(this.queryController.stylesheet);for(let e of Ee())e.stylesheet&&n.push(e.stylesheet);this.applyStyles(n);let r=new ve(t,this.config);for(let e of this.config.nodeTemplates)S(e);if(this.shape=new me(r,this.config.attributes.valuesSubject?y.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.attributes.showRootShapeLabel!==null&&r.label){let e=document.createElement(`h3`);e.innerText=r.label.value,this.form.prepend(e)}if(this.config.editMode){if(this.config.attributes.submitButton!==null){let e=this.config.theme.createButton(this.config.attributes.submitButton||`Submit`,!0);e.classList.add(`submit-button`);let t=e.getAttribute(`part`);e.setAttribute(`part`,`${t?t+` `:``}submit-button`),e.addEventListener(`click`,e=>{e.preventDefault(),this.form.reportValidity()?this.validate().then(e=>{e?.conforms?this.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0})):this.focusFirstInvalidElement()}):this.validate().then(()=>{this.focusFirstInvalidElement(!0)})}),this.form.appendChild(e)}await this.shape?.ready,this.config.attributes.valuesSubject&&this.removeFromDataGraph(y.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0),this.refreshClassInstanceEditors()}else this.config.queryMode&&(await this.shape.ready,await this.queryController?.initialize())}else if(this.config.store.countQuads(null,null,null,_)>0)throw Error(`shacl root node shape not found`)}catch(e){console.error(e);let t=document.createElement(`div`);t.innerText=String(e),this.form.replaceChildren(t)}this.config.queryMode&&this.config.queryFacetProvider&&this.queryController||this.removeAttribute(`loading`),await this.shape?.ready,this.dispatchEvent(new Event(`ready`))},200)}ensureRenderRoot(){this.config.attributes.useShadowRoot===`false`?(this.shadowRoot?.contains(this.form)&&this.shadowRoot.removeChild(this.form),this.contains(this.form)||this.prepend(this.form)):(this.shadowRoot||this.attachShadow({mode:`open`}),this.shadowRoot.contains(this.form)||this.shadowRoot.prepend(this.form))}focusFirstInvalidElement(e=!1){let t=this.form.querySelector(`:scope .invalid > .editor`);t?(e&&t.reportValidity?.(),t instanceof D?t.input.inputElement.focus():t.focus()):this.form.querySelector(`:scope .invalid`)?.scrollIntoView()}applyStyles(e){if(this.config.attributes.useShadowRoot!==`false`&&this.shadowRoot){this.shadowRoot.adoptedStyleSheets=e,this.styleElement&&=(this.styleElement.remove(),null);return}let t=e.map(e=>Array.from(e.cssRules).map(e=>e.cssText).join(`
|
|
10
11
|
`).replace(/:host\b/g,`shacl-form`)).join(`
|
|
11
|
-
`);this.styleElement||(this.styleElement=document.createElement(`style`),this.prepend(this.styleElement)),this.styleElement.textContent=t}serialize(e=`text/turtle`,r){return this.assertNotQueryMode(`serialize`),r??=this.toRDF(),n(r.getQuads(null,null,null,null),e,t)}toRDF(e=new
|
|
12
|
-
:scope shacl-node[data-node-id='${r.id}'] > shacl-property > .property-instance[${e}='${
|
|
13
|
-
:scope shacl-node[data-node-id='${r.id}'] > shacl-property > .shacl-group > .property-instance[${e}='${
|
|
14
|
-
:scope shacl-node[data-node-id='${r.id}'] > .shacl-group > shacl-property > .property-instance[${e}='${
|
|
15
|
-
:scope shacl-node[data-node-id='${r.id}'] > .shacl-group > shacl-property > .shacl-group > .property-instance[${e}='${
|
|
16
|
-
:scope [data-node-id='${r.id}'] > shacl-property > .property-instance[data-path='${
|
|
17
|
-
:scope [data-node-id='${r.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${
|
|
18
|
-
:scope [data-node-id='${r.id}'] > shacl-property > .alternative-path-constraint[data-path='${
|
|
19
|
-
:scope [data-node-id='${r.id}'] > shacl-property > .shacl-group > .alternative-path-constraint[data-path='${
|
|
20
|
-
:scope [data-node-id='${r.id}'] > shacl-property > .property-instance[data-predicate='${
|
|
21
|
-
:scope [data-node-id='${r.id}'] > shacl-property > .shacl-group > .property-instance[data-predicate='${n.id}']`));for(let n of a)if(n.classList.contains(`editor`)){if(!e||n.value){let e=n.parentElement;e.classList.add(`invalid`),e.classList.remove(`valid`),e.appendChild(this.createValidationErrorDisplay(t));do e instanceof y&&(e.open=!0),e=e.parentElement;while(e)}}else e||(n.classList.add(`invalid`),n.classList.remove(`valid`),n.appendChild(this.createValidationErrorDisplay(t,`node`)))}else e||this.form.querySelector(`:scope [data-node-id='${r.id}']:not([part~='linked-node'])`)?.prepend(this.createValidationErrorDisplay(t,`node`))}n(r)}catch(e){console.error(e),n({conforms:!1,results:[]})}})})}assertNotQueryMode(e){if(this.config.queryMode)throw Error(`${e}() is not available in query mode; use getQuery()`)}refreshClassInstanceEditors(){if(!(!this.shape||!this.config.editMode))for(let e of this.form.querySelectorAll(`shacl-property`))e.refreshClassInstances()}createValidationErrorDisplay(e,t){let n=document.createElement(`span`);n.classList.add(`validation-error`),t&&n.classList.add(t);let r=typeof e==`object`&&e?e:null;return r?r.message?.length?n.title+=a(this.config.languages,r.message):r.sourceConstraintComponent?.value&&(n.title=r.sourceConstraintComponent.value):typeof e==`string`&&(n.title=e),n}findRootShaclShapeSubject(){if(this.config.attributes.shapeSubject){let e=v.namedNode(this.config.attributes.shapeSubject);if(this.config.store.getQuads(e,O,ae,null).length===0){console.warn(`shapes graph does not contain requested node shape ${this.config.attributes.shapeSubject}`);return}else return e}else{if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,te)>0){let e=v.namedNode(this.config.attributes.valuesSubject),t=oe(this.config.store,this.config.attributes.valuesSubject),n=this.config.store.getQuads(e,O,null,te);if(n.length===0&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${O.id} nor ${re.id} statement`),t)return t;for(let e of n)if(this.config.store.getQuads(e.object,O,ae,null).length>0)return e.object;let r=this.config.store.getObjects(e,O,te);for(let e of r)for(let t of this.config.store.getQuads(null,me,e,null))return t.subject}let e=this.config.store.getQuads(null,O,ae,null);if(e.length==0){console.warn(`shapes graph does not contain any node shapes`);return}return e.length>1&&(console.warn(`shapes graph contains`,e.length,`node shapes. choosing first found which is`,e[0].subject.value),console.info(`hint: set the node shape to use with element attribute "data-shape-subject"`)),e[0].subject}}removeFromDataGraph(e){for(let t of this.config.store.getQuads(e,null,null,te))this.config.store.delete(t),(t.object.termType===`NamedNode`||t.object.termType===`BlankNode`)&&this.removeFromDataGraph(t.object)}};window.customElements.define(`shacl-form`,xi);var Si=class extends Te{constructor(e,t,n){super(e),this.onChange=t,this.fileType=n}createEditor(e){let t=l(e)>0,n=e.config.theme.createFileEditor(e.label,null,t,e);return n.addEventListener(`change`,e=>{e.stopPropagation(),this.onChange(e)}),this.fileType&&n.querySelector(`input[type="file"]`)?.setAttribute(`accept`,this.fileType),n}},Ci=D(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.leaflet={}))})(e,(function(e){var t=`1.9.4`;function n(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n],i)e[t]=i[t];return e}var r=Object.create||(function(){function e(){}return function(t){return e.prototype=t,new e}})();function i(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var a=0;function o(e){return`_leaflet_id`in e||(e._leaflet_id=++a),e._leaflet_id}function s(e,t,n){var r,i,a,o=function(){r=!1,i&&=(a.apply(n,i),!1)};return a=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(o,t),r=!0)},a}function c(e,t,n){var r=t[1],i=t[0],a=r-i;return e===r&&n?e:((e-i)%a+a)%a+i}function l(){return!1}function u(e,t){if(t===!1)return e;var n=10**(t===void 0?6:t);return Math.round(e*n)/n}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function f(e){return d(e).split(/\s+/)}function p(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,`options`)||(e.options=e.options?r(e.options):{}),t)e.options[n]=t[n];return e.options}function m(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+`=`+encodeURIComponent(e[i]));return(!t||t.indexOf(`?`)===-1?`?`:`&`)+r.join(`&`)}var ee=/\{ *([\w_ -]+) *\}/g;function h(e,t){return e.replace(ee,function(e,n){var r=t[n];if(r===void 0)throw Error(`No value provided for variable `+e);return typeof r==`function`&&(r=r(t)),r})}var g=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`};function te(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var ne=`data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=`;function re(e){return window[`webkit`+e]||window[`moz`+e]||window[`ms`+e]}var ie=0;function ae(e){var t=+new Date,n=Math.max(0,16-(t-ie));return ie=t+n,window.setTimeout(e,n)}var oe=window.requestAnimationFrame||re(`RequestAnimationFrame`)||ae,se=window.cancelAnimationFrame||re(`CancelAnimationFrame`)||re(`CancelRequestAnimationFrame`)||function(e){window.clearTimeout(e)};function _(e,t,n){if(n&&oe===ae)e.call(t);else return oe.call(window,i(e,t))}function v(e){e&&se.call(window,e)}var ce={__proto__:null,extend:n,create:r,bind:i,get lastId(){return a},stamp:o,throttle:s,wrapNum:c,falseFn:l,formatNum:u,trim:d,splitWords:f,setOptions:p,getParamString:m,template:h,isArray:g,indexOf:te,emptyImageUrl:ne,requestFn:oe,cancelFn:se,requestAnimFrame:_,cancelAnimFrame:v};function le(){}le.extend=function(e){var t=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=t.__super__=this.prototype,a=r(i);for(var o in a.constructor=t,t.prototype=a,this)Object.prototype.hasOwnProperty.call(this,o)&&o!==`prototype`&&o!==`__super__`&&(t[o]=this[o]);return e.statics&&n(t,e.statics),e.includes&&(ue(e.includes),n.apply(null,[a].concat(e.includes))),n(a,e),delete a.statics,delete a.includes,a.options&&(a.options=i.options?r(i.options):{},n(a.options,e.options)),a._initHooks=[],a.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=a._initHooks.length;e<t;e++)a._initHooks[e].call(this)}},t},le.include=function(e){var t=this.prototype.options;return n(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},le.mergeOptions=function(e){return n(this.prototype.options,e),this},le.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n=typeof e==`function`?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};function ue(e){if(!(typeof L>`u`||!L||!L.Mixin)){e=g(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn(`Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.`,Error().stack)}}var y={on:function(e,t,n){if(typeof e==`object`)for(var r in e)this._on(r,e[r],t);else{e=f(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n)}return this},off:function(e,t,n){if(!arguments.length)delete this._events;else if(typeof e==`object`)for(var r in e)this._off(r,e[r],t);else{e=f(e);for(var i=arguments.length===1,a=0,o=e.length;a<o;a++)i?this._off(e[a]):this._off(e[a],t,n)}return this},_on:function(e,t,n,r){if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}if(this._listens(e,t,n)===!1){n===this&&(n=void 0);var i={fn:t,ctx:n};r&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}},_off:function(e,t,n){var r,i,a;if(this._events&&(r=this._events[e],r)){if(arguments.length===1){if(this._firingCount)for(i=0,a=r.length;i<a;i++)r[i].fn=l;delete this._events[e];return}if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}var o=this._listens(e,t,n);if(o!==!1){var s=r[o];this._firingCount&&(s.fn=l,this._events[e]=r=r.slice()),r.splice(o,1)}}},fire:function(e,t,r){if(!this.listens(e,r))return this;var i=n({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var a=this._events[e];if(a){this._firingCount=this._firingCount+1||1;for(var o=0,s=a.length;o<s;o++){var c=a[o],l=c.fn;c.once&&this.off(e,l,c.ctx),l.call(c.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(e,t,n,r){typeof e!=`string`&&console.warn(`"string" type argument expected`);var i=t;typeof t!=`function`&&(r=!!t,i=void 0,n=void 0);var a=this._events&&this._events[e];if(a&&a.length&&this._listens(e,i,n)!==!1)return!0;if(r){for(var o in this._eventParents)if(this._eventParents[o].listens(e,t,n,r))return!0}return!1},_listens:function(e,t,n){if(!this._events)return!1;var r=this._events[e]||[];if(!t)return!!r.length;n===this&&(n=void 0);for(var i=0,a=r.length;i<a;i++)if(r[i].fn===t&&r[i].ctx===n)return i;return!1},once:function(e,t,n){if(typeof e==`object`)for(var r in e)this._on(r,e[r],t,!0);else{e=f(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[o(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[o(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,n({layer:e.target,propagatedFrom:e.target},e),!0)}};y.addEventListener=y.on,y.removeEventListener=y.clearAllEventListeners=y.off,y.addOneTimeEventListener=y.once,y.fireEvent=y.fire,y.hasEventListeners=y.listens;var de=le.extend(y);function b(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var fe=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};b.prototype={clone:function(){return new b(this.x,this.y)},add:function(e){return this.clone()._add(x(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(x(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new b(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new b(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=fe(this.x),this.y=fe(this.y),this},distanceTo:function(e){e=x(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=x(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=x(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return`Point(`+u(this.x)+`, `+u(this.y)+`)`}};function x(e,t,n){return e instanceof b?e:g(e)?new b(e[0],e[1]):e==null?e:typeof e==`object`&&`x`in e&&`y`in e?new b(e.x,e.y):new b(e,t,n)}function S(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}S.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof b||typeof e[0]==`number`||`x`in e)t=n=x(e);else if(e=C(e),t=e.min,n=e.max,!t||!n)return this;return!this.min&&!this.max?(this.min=t.clone(),this.max=n.clone()):(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)),this},getCenter:function(e){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return e=typeof e[0]==`number`||e instanceof b?x(e):C(e),e instanceof S?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=C(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>=t.x&&r.x<=n.x,o=i.y>=t.y&&r.y<=n.y;return a&&o},overlaps:function(e){e=C(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>t.x&&r.x<n.x,o=i.y>t.y&&r.y<n.y;return a&&o},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var t=this.min,n=this.max,r=Math.abs(t.x-n.x)*e,i=Math.abs(t.y-n.y)*e;return C(x(t.x-r,t.y-i),x(n.x+r,n.y+i))},equals:function(e){return e?(e=C(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight())):!1}};function C(e,t){return!e||e instanceof S?e:new S(e,t)}function w(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}w.prototype={extend:function(e){var t=this._southWest,n=this._northEast,r,i;if(e instanceof E)r=e,i=e;else if(e instanceof w){if(r=e._southWest,i=e._northEast,!r||!i)return this}else return e?this.extend(D(e)||T(e)):this;return!t&&!n?(this._southWest=new E(r.lat,r.lng),this._northEast=new E(i.lat,i.lng)):(t.lat=Math.min(r.lat,t.lat),t.lng=Math.min(r.lng,t.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,i=Math.abs(t.lng-n.lng)*e;return new w(new E(t.lat-r,t.lng-i),new E(n.lat+r,n.lng+i))},getCenter:function(){return new E((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new E(this.getNorth(),this.getWest())},getSouthEast:function(){return new E(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e=typeof e[0]==`number`||e instanceof E||`lat`in e?D(e):T(e);var t=this._southWest,n=this._northEast,r,i;return e instanceof w?(r=e.getSouthWest(),i=e.getNorthEast()):r=i=e,r.lat>=t.lat&&i.lat<=n.lat&&r.lng>=t.lng&&i.lng<=n.lng},intersects:function(e){e=T(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>=t.lat&&r.lat<=n.lat,o=i.lng>=t.lng&&r.lng<=n.lng;return a&&o},overlaps:function(e){e=T(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>t.lat&&r.lat<n.lat,o=i.lng>t.lng&&r.lng<n.lng;return a&&o},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(`,`)},equals:function(e,t){return e?(e=T(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function T(e,t){return e instanceof w?e:new w(e,t)}function E(e,t,n){if(isNaN(e)||isNaN(t))throw Error(`Invalid LatLng object: (`+e+`, `+t+`)`);this.lat=+e,this.lng=+t,n!==void 0&&(this.alt=+n)}E.prototype={equals:function(e,t){return e?(e=D(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(t===void 0?1e-9:t)):!1},toString:function(e){return`LatLng(`+u(this.lat,e)+`, `+u(this.lng,e)+`)`},distanceTo:function(e){return me.distance(this,D(e))},wrap:function(){return me.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return T([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new E(this.lat,this.lng,this.alt)}};function D(e,t,n){return e instanceof E?e:g(e)&&typeof e[0]!=`object`?e.length===3?new E(e[0],e[1],e[2]):e.length===2?new E(e[0],e[1]):null:e==null?e:typeof e==`object`&&`lat`in e?new E(e.lat,`lng`in e?e.lng:e.lon,e.alt):t===void 0?null:new E(e,t,n)}var pe={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*2**e},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new S(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?c(e.lng,this.wrapLng,!0):e.lng,n=this.wrapLat?c(e.lat,this.wrapLat,!0):e.lat,r=e.alt;return new E(n,t,r)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),r=t.lat-n.lat,i=t.lng-n.lng;if(r===0&&i===0)return e;var a=e.getSouthWest(),o=e.getNorthEast();return new w(new E(a.lat-r,a.lng-i),new E(o.lat-r,o.lng-i))}},me=n({},pe,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=Math.sin((t.lat-e.lat)*n/2),o=Math.sin((t.lng-e.lng)*n/2),s=a*a+Math.cos(r)*Math.cos(i)*o*o,c=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*c}}),he=6378137,ge={R:he,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),i=Math.sin(r*t);return new b(this.R*e.lng*t,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(e){var t=180/Math.PI;return new E((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(function(){var e=he*Math.PI;return new S([-e,-e],[e,e])})()};function _e(e,t,n,r){if(g(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=t,this._c=n,this._d=r}_e.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t||=1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t||=1,new b((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};function O(e,t,n,r){return new _e(e,t,n,r)}var ve=n({},me,{code:`EPSG:3857`,projection:ge,transformation:function(){var e=.5/(Math.PI*ge.R);return O(e,.5,-e,.5)}()}),ye=n({},ve,{code:`EPSG:900913`});function be(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function xe(e,t){var n=``,r,i,a,o,s,c;for(r=0,a=e.length;r<a;r++){for(s=e[r],i=0,o=s.length;i<o;i++)c=s[i],n+=(i?`L`:`M`)+c.x+` `+c.y;n+=t?N.svg?`z`:`x`:``}return n||`M0 0`}var Se=document.documentElement.style,Ce=`ActiveXObject`in window,we=Ce&&!document.addEventListener,Te=`msLaunchUri`in navigator&&!(`documentMode`in document),Ee=M(`webkit`),De=M(`android`),Oe=M(`android 2`)||M(`android 3`),ke=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ae=De&&M(`Google`)&&ke<537&&!(`AudioNode`in window),je=!!window.opera,Me=!Te&&M(`chrome`),Ne=M(`gecko`)&&!Ee&&!je&&!Ce,Pe=!Me&&M(`safari`),Fe=M(`phantom`),Ie=`OTransition`in Se,Le=navigator.platform.indexOf(`Win`)===0,Re=Ce&&`transition`in Se,ze=`WebKitCSSMatrix`in window&&`m11`in new window.WebKitCSSMatrix&&!Oe,Be=`MozPerspective`in Se,k=!window.L_DISABLE_3D&&(Re||ze||Be)&&!Ie&&!Fe,A=typeof orientation<`u`||M(`mobile`),Ve=A&&Ee,He=A&&ze,j=!window.PointerEvent&&window.MSPointerEvent,Ue=!!(window.PointerEvent||j),We=`ontouchstart`in window||!!window.TouchEvent,Ge=!window.L_NO_TOUCH&&(We||Ue),Ke=A&&je,qe=A&&Ne,Je=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ye=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`testPassiveEventSupport`,l,t),window.removeEventListener(`testPassiveEventSupport`,l,t)}catch{}return e}(),Xe=function(){return!!document.createElement(`canvas`).getContext}(),Ze=!!(document.createElementNS&&be(`svg`).createSVGRect),Qe=!!Ze&&(function(){var e=document.createElement(`div`);return e.innerHTML=`<svg/>`,(e.firstChild&&e.firstChild.namespaceURI)===`http://www.w3.org/2000/svg`})(),$e=!Ze&&function(){try{var e=document.createElement(`div`);e.innerHTML=`<v:shape adj="1"/>`;var t=e.firstChild;return t.style.behavior=`url(#default#VML)`,t&&typeof t.adj==`object`}catch{return!1}}(),et=navigator.platform.indexOf(`Mac`)===0,tt=navigator.platform.indexOf(`Linux`)===0;function M(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var N={ie:Ce,ielt9:we,edge:Te,webkit:Ee,android:De,android23:Oe,androidStock:Ae,opera:je,chrome:Me,gecko:Ne,safari:Pe,phantom:Fe,opera12:Ie,win:Le,ie3d:Re,webkit3d:ze,gecko3d:Be,any3d:k,mobile:A,mobileWebkit:Ve,mobileWebkit3d:He,msPointer:j,pointer:Ue,touch:Ge,touchNative:We,mobileOpera:Ke,mobileGecko:qe,retina:Je,passiveEvents:Ye,canvas:Xe,svg:Ze,vml:$e,inlineSvg:Qe,mac:et,linux:tt},P=N.msPointer?`MSPointerDown`:`pointerdown`,nt=N.msPointer?`MSPointerMove`:`pointermove`,rt=N.msPointer?`MSPointerUp`:`pointerup`,it=N.msPointer?`MSPointerCancel`:`pointercancel`,at={touchstart:P,touchmove:nt,touchend:rt,touchcancel:it},ot={touchstart:ht,touchmove:mt,touchend:mt,touchcancel:mt},st={},ct=!1;function lt(e,t,n){return t===`touchstart`&&pt(),ot[t]?(n=ot[t].bind(this,n),e.addEventListener(at[t],n,!1),n):(console.warn(`wrong event specified:`,t),l)}function F(e,t,n){if(!at[t]){console.warn(`wrong event specified:`,t);return}e.removeEventListener(at[t],n,!1)}function ut(e){st[e.pointerId]=e}function dt(e){st[e.pointerId]&&(st[e.pointerId]=e)}function ft(e){delete st[e.pointerId]}function pt(){ct||=(document.addEventListener(P,ut,!0),document.addEventListener(nt,dt,!0),document.addEventListener(rt,ft,!0),document.addEventListener(it,ft,!0),!0)}function mt(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||`mouse`)){for(var n in t.touches=[],st)t.touches.push(st[n]);t.changedTouches=[t],e(t)}}function ht(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&K(t),mt(e,t)}function gt(e){var t={},n,r;for(r in e)n=e[r],t[r]=n&&n.bind?n.bind(e):n;return e=t,t.type=`dblclick`,t.detail=2,t.isTrusted=!1,t._simulated=!0,t}var _t=200;function vt(e,t){e.addEventListener(`dblclick`,t);var n=0,r;function i(e){if(e.detail!==1){r=e.detail;return}if(!(e.pointerType===`mouse`||e.sourceCapabilities&&!e.sourceCapabilities.firesTouchEvents)){var i=nn(e);if(!(i.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})&&!i.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var a=Date.now();a-n<=_t?(r++,r===2&&t(gt(e))):r=1,n=a}}}return e.addEventListener(`click`,i),{dblclick:t,simDblclick:i}}function yt(e,t){e.removeEventListener(`dblclick`,t.dblclick),e.removeEventListener(`click`,t.simDblclick)}var bt=jt([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),xt=jt([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]),St=xt===`webkitTransition`||xt===`OTransition`?xt+`End`:`transitionend`;function Ct(e){return typeof e==`string`?document.getElementById(e):e}function wt(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||n===`auto`)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return n===`auto`?null:n}function I(e,t,n){var r=document.createElement(e);return r.className=t||``,n&&n.appendChild(r),r}function R(e){var t=e.parentNode;t&&t.removeChild(e)}function Tt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Et(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function z(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function Dt(e,t){if(e.classList!==void 0)return e.classList.contains(t);var n=kt(e);return n.length>0&&RegExp(`(^|\\s)`+t+`(\\s|$)`).test(n)}function B(e,t){if(e.classList!==void 0)for(var n=f(t),r=0,i=n.length;r<i;r++)e.classList.add(n[r]);else if(!Dt(e,t)){var a=kt(e);Ot(e,(a?a+` `:``)+t)}}function V(e,t){e.classList===void 0?Ot(e,d((` `+kt(e)+` `).replace(` `+t+` `,` `))):e.classList.remove(t)}function Ot(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}function kt(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function H(e,t){`opacity`in e.style?e.style.opacity=t:`filter`in e.style&&At(e,t)}function At(e,t){var n=!1,r=`DXImageTransform.Microsoft.Alpha`;try{n=e.filters.item(r)}catch{if(t===1)return}t=Math.round(t*100),n?(n.Enabled=t!==100,n.Opacity=t):e.style.filter+=` progid:`+r+`(opacity=`+t+`)`}function jt(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function Mt(e,t,n){var r=t||new b(0,0);e.style[bt]=(N.ie3d?`translate(`+r.x+`px,`+r.y+`px)`:`translate3d(`+r.x+`px,`+r.y+`px,0)`)+(n?` scale(`+n+`)`:``)}function U(e,t){e._leaflet_pos=t,N.any3d?Mt(e,t):(e.style.left=t.x+`px`,e.style.top=t.y+`px`)}function Nt(e){return e._leaflet_pos||new b(0,0)}var Pt,Ft,It;if(`onselectstart`in document)Pt=function(){W(window,`selectstart`,K)},Ft=function(){G(window,`selectstart`,K)};else{var Lt=jt([`userSelect`,`WebkitUserSelect`,`OUserSelect`,`MozUserSelect`,`msUserSelect`]);Pt=function(){if(Lt){var e=document.documentElement.style;It=e[Lt],e[Lt]=`none`}},Ft=function(){Lt&&(document.documentElement.style[Lt]=It,It=void 0)}}function Rt(){W(window,`dragstart`,K)}function zt(){G(window,`dragstart`,K)}var Bt,Vt;function Ht(e){for(;e.tabIndex===-1;)e=e.parentNode;e.style&&(Ut(),Bt=e,Vt=e.style.outlineStyle,e.style.outlineStyle=`none`,W(window,`keydown`,Ut))}function Ut(){Bt&&(Bt.style.outlineStyle=Vt,Bt=void 0,Vt=void 0,G(window,`keydown`,Ut))}function Wt(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body);return e}function Gt(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var Kt={__proto__:null,TRANSFORM:bt,TRANSITION:xt,TRANSITION_END:St,get:Ct,getStyle:wt,create:I,remove:R,empty:Tt,toFront:Et,toBack:z,hasClass:Dt,addClass:B,removeClass:V,setClass:Ot,getClass:kt,setOpacity:H,testProp:jt,setTransform:Mt,setPosition:U,getPosition:Nt,get disableTextSelection(){return Pt},get enableTextSelection(){return Ft},disableImageDrag:Rt,enableImageDrag:zt,preventOutline:Ht,restoreOutline:Ut,getSizedParentNode:Wt,getScale:Gt};function W(e,t,n,r){if(t&&typeof t==`object`)for(var i in t)Xt(e,i,t[i],n);else{t=f(t);for(var a=0,o=t.length;a<o;a++)Xt(e,t[a],n,r)}return this}var qt=`_leaflet_events`;function G(e,t,n,r){if(arguments.length===1)Jt(e),delete e[qt];else if(t&&typeof t==`object`)for(var i in t)Zt(e,i,t[i],n);else if(t=f(t),arguments.length===2)Jt(e,function(e){return te(t,e)!==-1});else for(var a=0,o=t.length;a<o;a++)Zt(e,t[a],n,r);return this}function Jt(e,t){for(var n in e[qt]){var r=n.split(/\d/)[0];(!t||t(r))&&Zt(e,r,null,null,n)}}var Yt={mouseenter:`mouseover`,mouseleave:`mouseout`,wheel:!(`onwheel`in window)&&`mousewheel`};function Xt(e,t,n,r){var i=t+o(n)+(r?`_`+o(r):``);if(e[qt]&&e[qt][i])return this;var a=function(t){return n.call(r||e,t||window.event)},s=a;!N.touchNative&&N.pointer&&t.indexOf(`touch`)===0?a=lt(e,t,a):N.touch&&t===`dblclick`?a=vt(e,a):`addEventListener`in e?t===`touchstart`||t===`touchmove`||t===`wheel`||t===`mousewheel`?e.addEventListener(Yt[t]||t,a,N.passiveEvents?{passive:!1}:!1):t===`mouseenter`||t===`mouseleave`?(a=function(t){t||=window.event,sn(e,t)&&s(t)},e.addEventListener(Yt[t],a,!1)):e.addEventListener(t,s,!1):e.attachEvent(`on`+t,a),e[qt]=e[qt]||{},e[qt][i]=a}function Zt(e,t,n,r,i){i||=t+o(n)+(r?`_`+o(r):``);var a=e[qt]&&e[qt][i];if(!a)return this;!N.touchNative&&N.pointer&&t.indexOf(`touch`)===0?F(e,t,a):N.touch&&t===`dblclick`?yt(e,a):`removeEventListener`in e?e.removeEventListener(Yt[t]||t,a,!1):e.detachEvent(`on`+t,a),e[qt][i]=null}function Qt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function $t(e){return Xt(e,`wheel`,Qt),this}function en(e){return W(e,`mousedown touchstart dblclick contextmenu`,Qt),e._leaflet_disable_click=!0,this}function K(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function tn(e){return K(e),Qt(e),this}function nn(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function rn(e,t){if(!t)return new b(e.clientX,e.clientY);var n=Gt(t),r=n.boundingClientRect;return new b((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var an=N.linux&&N.chrome?window.devicePixelRatio:N.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function on(e){return N.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/an:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function sn(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch{return!1}return n!==e}var cn={__proto__:null,on:W,off:G,stopPropagation:Qt,disableScrollPropagation:$t,disableClickPropagation:en,preventDefault:K,stop:tn,getPropagationPath:nn,getMousePosition:rn,getWheelDelta:on,isExternalTarget:sn,addListener:W,removeListener:G},ln=de.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Nt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire(`start`),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=_(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=this._duration*1e3;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),U(this._el,n),this.fire(`step`)},_complete:function(){v(this._animId),this._inProgress=!1,this.fire(`end`)},_easeOut:function(e){return 1-(1-e)**this._easeOutPower}}),q=de.extend({options:{crs:ve,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=p(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=i(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.zoom!==void 0&&(this._zoom=this._limitZoom(t.zoom)),t.center&&t.zoom!==void 0&&this.setView(D(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=xt&&N.any3d&&!N.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),W(this._proxy,St,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,r){return t=t===void 0?this._zoom:this._limitZoom(t),e=this._limitCenter(D(e),t,this.options.maxBounds),r||={},this._stop(),this._loaded&&!r.reset&&r!==!0&&(r.animate!==void 0&&(r.zoom=n({animate:r.animate},r.zoom),r.pan=n({animate:r.animate,duration:r.duration},r.pan)),this._zoom===t?this._tryAnimatedPan(e,r.pan):this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,r.zoom))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,r.pan&&r.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e||=N.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e||=N.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),i=this.getSize().divideBy(2),a=(e instanceof b?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/r),o=this.containerPointToLatLng(i.add(a));return this.setView(o,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t||={},e=e.getBounds?e.getBounds():T(e);var n=x(t.paddingTopLeft||t.padding||[0,0]),r=x(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,n.add(r));if(i=typeof t.maxZoom==`number`?Math.min(t.maxZoom,i):i,i===1/0)return{center:e.getCenter(),zoom:i};var a=r.subtract(n).divideBy(2),o=this.project(e.getSouthWest(),i),s=this.project(e.getNorthEast(),i);return{center:this.unproject(o.add(s).divideBy(2).add(a),i),zoom:i}},fitBounds:function(e,t){if(e=T(e),!e.isValid())throw Error(`Bounds are not valid.`);var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(e=x(e).round(),t||={},!e.x&&!e.y)return this.fire(`moveend`);if(t.animate!==!0&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ln,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire(`movestart`),t.animate!==!1){B(this._mapPane,`leaflet-pan-anim`);var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire(`move`).fire(`moveend`);return this},flyTo:function(e,t,n){if(n||={},n.animate===!1||!N.any3d)return this.setView(e,t,n);this._stop();var r=this.project(this.getCenter()),i=this.project(e),a=this.getSize(),o=this._zoom;e=D(e),t=t===void 0?o:t;var s=Math.max(a.x,a.y),c=s*this.getZoomScale(o,t),l=i.distanceTo(r)||1,u=1.42,d=u*u;function f(e){var t=e?-1:1,n=e?c:s,r=(c*c-s*s+t*d*d*l*l)/(2*n*d*l),i=Math.sqrt(r*r+1)-r;return i<1e-9?-18:Math.log(i)}function p(e){return(Math.exp(e)-Math.exp(-e))/2}function m(e){return(Math.exp(e)+Math.exp(-e))/2}function ee(e){return p(e)/m(e)}var h=f(0);function g(e){return s*(m(h)/m(h+u*e))}function te(e){return s*(m(h)*ee(h+u*e)-p(h))/d}function ne(e){return 1-(1-e)**1.5}var re=Date.now(),ie=(f(1)-h)/u,ae=n.duration?1e3*n.duration:1e3*ie*.8;function oe(){var n=(Date.now()-re)/ae,a=ne(n)*ie;n<=1?(this._flyToFrame=_(oe,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(te(a)/l)),o),this.getScaleZoom(s/g(a),o),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),oe.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=T(e),this.listens(`moveend`,this._panInsideMaxBounds)&&this.off(`moveend`,this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on(`moveend`,this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,T(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){t||={};var n=x(t.paddingTopLeft||t.padding||[0,0]),r=x(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),a=this.project(e),o=this.getPixelBounds(),s=C([o.min.add(n),o.max.subtract(r)]),c=s.getSize();if(!s.contains(a)){this._enforcingBounds=!0;var l=a.subtract(s.getCenter()),u=s.extend(a).getSize().subtract(c);i.x+=l.x<0?-u.x:u.x,i.y+=l.y<0?-u.y:u.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},e===!0?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),a=t.divideBy(2).round(),o=r.divideBy(2).round(),s=a.subtract(o);return!s.x&&!s.y?this:(e.animate&&e.pan?this.panBy(s):(e.pan&&this._rawPanBy(s),this.fire(`move`),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,`moveend`),200)):this.fire(`moveend`)),this.fire(`resize`,{oldSize:t,newSize:r}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire(`viewreset`),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!(`geolocation`in navigator))return this._handleGeolocationError({code:0,message:`Geolocation not supported.`}),this;var t=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(t===1?`permission denied`:t===2?`position unavailable`:`timeout`);this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire(`locationerror`,{code:t,message:`Geolocation error: `+n+`.`})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=e.coords.latitude,n=e.coords.longitude,r=new E(t,n),i=r.toBounds(e.coords.accuracy*2),a=this._locateOptions;if(a.setView){var o=this.getBoundsZoom(i);this.setView(r,a.maxZoom?Math.min(o,a.maxZoom):o)}var s={latlng:r,bounds:i,timestamp:e.timestamp};for(var c in e.coords)typeof e.coords[c]==`number`&&(s[c]=e.coords[c]);this.fire(`locationfound`,s)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off(`moveend`,this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error(`Map container is being reused by another instance`);try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}for(var e in this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),R(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&=(v(this._resizeRequest),null),this._clearHandlers(),this._loaded&&this.fire(`unload`),this._layers)this._layers[e].remove();for(e in this._panes)R(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=I(`div`,`leaflet-pane`+(e?` leaflet-`+e.replace(`Pane`,``)+`-pane`:``),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new w(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=T(e),n=x(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),a=this.getMaxZoom(),o=e.getNorthWest(),s=e.getSouthEast(),c=this.getSize().subtract(n),l=C(this.project(s,r),this.project(o,r)).getSize(),u=N.any3d?this.options.zoomSnap:1,d=c.x/l.x,f=c.y/l.y,p=t?Math.max(d,f):Math.min(d,f);return r=this.getScaleZoom(p,r),u&&(r=Math.round(r/(u/100))*(u/100),r=t?Math.ceil(r/u)*u:Math.floor(r/u)*u),Math.max(i,Math.min(a,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new b(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new S(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e==`string`?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=t===void 0?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=t===void 0?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.latLngToPoint(D(e),t)},unproject:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.pointToLatLng(x(e),t)},layerPointToLatLng:function(e){var t=x(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(D(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(D(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(T(e))},distance:function(e,t){return this.options.crs.distance(D(e),D(t))},containerPointToLayerPoint:function(e){return x(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return x(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(x(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(D(e)))},mouseEventToContainerPoint:function(e){return rn(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=Ct(e);if(!t)throw Error(`Map container not found.`);if(t._leaflet_id)throw Error(`Map container is already initialized.`);W(t,`scroll`,this._onScroll,this),this._containerId=o(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&N.any3d,B(e,`leaflet-container`+(N.touch?` leaflet-touch`:``)+(N.retina?` leaflet-retina`:``)+(N.ielt9?` leaflet-oldie`:``)+(N.safari?` leaflet-safari`:``)+(this._fadeAnimated?` leaflet-fade-anim`:``));var t=wt(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`fixed`&&t!==`sticky`&&(e.style.position=`relative`),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane(`mapPane`,this._container),U(this._mapPane,new b(0,0)),this.createPane(`tilePane`),this.createPane(`overlayPane`),this.createPane(`shadowPane`),this.createPane(`markerPane`),this.createPane(`tooltipPane`),this.createPane(`popupPane`),this.options.markerZoomAnimation||(B(e.markerPane,`leaflet-zoom-hide`),B(e.shadowPane,`leaflet-zoom-hide`))},_resetView:function(e,t,n){U(this._mapPane,new b(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire(`viewprereset`);var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire(`viewreset`),r&&this.fire(`load`)},_moveStart:function(e,t){return e&&this.fire(`zoomstart`),t||this.fire(`movestart`),this},_move:function(e,t,n,r){t===void 0&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire(`zoom`,n):((i||n&&n.pinch)&&this.fire(`zoom`,n),this.fire(`move`,n)),this},_moveEnd:function(e){return e&&this.fire(`zoomend`),this.fire(`moveend`)},_stop:function(){return v(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){U(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error(`Set map center and zoom first.`)},_initEvents:function(e){this._targets={},this._targets[o(this._container)]=this;var t=e?G:W;t(this._container,`click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup`,this._handleDOMEvent,this),this.options.trackResize&&t(window,`resize`,this._onResize,this),N.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,`moveend`,this._onMoveEnd)},_onResize:function(){v(this._resizeRequest),this._resizeRequest=_(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n=[],r,i=t===`mouseout`||t===`mouseover`,a=e.target||e.srcElement,s=!1;a;){if(r=this._targets[o(a)],r&&(t===`click`||t===`preclick`)&&this._draggableMoved(r)){s=!0;break}if(r&&r.listens(t,!0)&&(i&&!sn(a,e)||(n.push(r),i))||a===this._container)break;a=a.parentNode}return!n.length&&!s&&!i&&this.listens(t,!0)&&(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||e.type===`click`&&this._isClickDisabled(t))){var n=e.type;n===`mousedown`&&Ht(t),this._fireDOMEvent(e,n)}},_mouseEvents:[`click`,`dblclick`,`mouseover`,`mouseout`,`contextmenu`],_fireDOMEvent:function(e,t,r){if(e.type===`click`){var i=n({},e);i.type=`preclick`,this._fireDOMEvent(i,i.type,r)}var a=this._findEventTargets(e,t);if(r){for(var o=[],s=0;s<r.length;s++)r[s].listens(t,!0)&&o.push(r[s]);a=o.concat(a)}if(a.length){t===`contextmenu`&&K(e);var c=a[0],l={originalEvent:e};if(e.type!==`keypress`&&e.type!==`keydown`&&e.type!==`keyup`){var u=c.getLatLng&&(!c._radius||c._radius<=10);l.containerPoint=u?this.latLngToContainerPoint(c.getLatLng()):this.mouseEventToContainerPoint(e),l.layerPoint=this.containerPointToLayerPoint(l.containerPoint),l.latlng=u?c.getLatLng():this.layerPointToLatLng(l.layerPoint)}for(s=0;s<a.length;s++)if(a[s].fire(t,l,!0),l.originalEvent._stopped||a[s].options.bubblingMouseEvents===!1&&te(this._mouseEvents,t)!==-1)return}},_draggableMoved:function(e){return e=e.dragging&&e.dragging.enabled()?e:this,e.dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on(`load`,e,t),this},_getMapPanePos:function(){return Nt(this._mapPane)||new b(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&t!==void 0?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return C([this.project(e.getSouthWest(),t)._subtract(r),this.project(e.getNorthWest(),t)._subtract(r),this.project(e.getSouthEast(),t)._subtract(r),this.project(e.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),i=this.getSize().divideBy(2),a=new S(r.subtract(i),r.add(i)),o=this._getBoundsOffset(a,n,t);return Math.abs(o.x)<=1&&Math.abs(o.y)<=1?e:this.unproject(r.add(o),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new S(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=C(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),i=r.min.subtract(e.min),a=r.max.subtract(e.max);return new b(this._rebound(i.x,-a.x),this._rebound(i.y,-a.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=N.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire(`move`)},_onPanTransitionEnd:function(){V(this._mapPane,`leaflet-pan-anim`),this.fire(`moveend`)},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(t&&t.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=I(`div`,`leaflet-proxy leaflet-zoom-animated`);this._panes.mapPane.appendChild(e),this.on(`zoomanim`,function(e){var t=bt,n=this._proxy.style[t];Mt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on(`load moveend`,this._animMoveEnd,this),this._on(`unload`,this._destroyAnimProxy,this)},_destroyAnimProxy:function(){R(this._proxy),this.off(`load moveend`,this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Mt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf(`transform`)>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName(`leaflet-zoom-animated`).length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n||={},!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return n.animate!==!0&&!this.getSize().contains(i)?!1:(_(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,B(this._mapPane,`leaflet-zoom-anim`)),this.fire(`zoomanim`,{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||=this._zoom!==this._animateToZoom,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&V(this._mapPane,`leaflet-zoom-anim`),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire(`zoom`),delete this._tempFireZoomEvent,this.fire(`move`),this._moveEnd(!0))}});function un(e,t){return new q(e,t)}var dn=le.extend({options:{position:`topright`},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return B(t,`leaflet-control`),n.indexOf(`bottom`)===-1?r.appendChild(t):r.insertBefore(t,r.firstChild),this._map.on(`unload`,this.remove,this),this},remove:function(){return this._map?(R(this._container),this.onRemove&&this.onRemove(this._map),this._map.off(`unload`,this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),fn=function(e){return new dn(e)};q.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t=`leaflet-`,n=this._controlContainer=I(`div`,t+`control-container`,this._container);function r(r,i){var a=t+r+` `+t+i;e[r+i]=I(`div`,a,n)}r(`top`,`left`),r(`top`,`right`),r(`bottom`,`left`),r(`bottom`,`right`)},_clearControlPos:function(){for(var e in this._controlCorners)R(this._controlCorners[e]);R(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var pn=dn.extend({options:{collapsed:!0,position:`topright`,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n<r?-1:+(r<n)}},initialize:function(e,t,n){for(var r in p(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on(`zoomend`,this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on(`add remove`,this._onLayerChange,this);return this._container},addTo:function(e){return dn.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off(`zoomend`,this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off(`add remove`,this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off(`add remove`,this._onLayerChange,this);var t=this._getLayer(o(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){B(this._container,`leaflet-control-layers-expanded`),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(B(this._section,`leaflet-control-layers-scrollbar`),this._section.style.height=e+`px`):V(this._section,`leaflet-control-layers-scrollbar`),this._checkDisabledLayers(),this},collapse:function(){return V(this._container,`leaflet-control-layers-expanded`),this},_initLayout:function(){var e=`leaflet-control-layers`,t=this._container=I(`div`,e),n=this.options.collapsed;t.setAttribute(`aria-haspopup`,!0),en(t),$t(t);var r=this._section=I(`section`,e+`-list`);n&&(this._map.on(`click`,this.collapse,this),W(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=I(`a`,e+`-toggle`,t);i.href=`#`,i.title=`Layers`,i.setAttribute(`role`,`button`),W(i,{keydown:function(e){e.keyCode===13&&this._expandSafely()},click:function(e){K(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=I(`div`,e+`-base`,r),this._separator=I(`div`,e+`-separator`,r),this._overlaysList=I(`div`,e+`-overlays`,r),t.appendChild(r)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&o(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on(`add remove`,this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(i(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Tt(this._baseLayersList),Tt(this._overlaysList),this._layerControlInputs=[];var e,t,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),t||=r.overlay,e||=!r.overlay,i+=+!r.overlay;return this.options.hideSingleBase&&(e&&=i>1,this._baseLayersList.style.display=e?``:`none`),this._separator.style.display=t&&e?``:`none`,this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(o(e.target)),n=t.overlay?e.type===`add`?`overlayadd`:`overlayremove`:e.type===`add`?`baselayerchange`:null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=`<input type="radio" class="leaflet-control-layers-selector" name="`+e+`"`+(t?` checked="checked"`:``)+`/>`,r=document.createElement(`div`);return r.innerHTML=n,r.firstChild},_addItem:function(e){var t=document.createElement(`label`),n=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement(`input`),r.type=`checkbox`,r.className=`leaflet-control-layers-selector`,r.defaultChecked=n):r=this._createRadioElement(`leaflet-base-layers_`+o(this),n),this._layerControlInputs.push(r),r.layerId=o(e.layer),W(r,`click`,this._onInputClick,this);var i=document.createElement(`span`);i.innerHTML=` `+e.name;var a=document.createElement(`span`);return t.appendChild(a),a.appendChild(r),a.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(t),this._checkDisabledLayers(),t},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,t,n,r=[],i=[];this._handlingClick=!0;for(var a=e.length-1;a>=0;a--)t=e[a],n=this._getLayer(t.layerId).layer,t.checked?r.push(n):t.checked||i.push(n);for(a=0;a<i.length;a++)this._map.hasLayer(i[a])&&this._map.removeLayer(i[a]);for(a=0;a<r.length;a++)this._map.hasLayer(r[a])||this._map.addLayer(r[a]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e=this._layerControlInputs,t,n,r=this._map.getZoom(),i=e.length-1;i>=0;i--)t=e[i],n=this._getLayer(t.layerId).layer,t.disabled=n.options.minZoom!==void 0&&r<n.options.minZoom||n.options.maxZoom!==void 0&&r>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,W(e,`click`,K),this.expand();var t=this;setTimeout(function(){G(e,`click`,K),t._preventClick=!1})}}),mn=function(e,t,n){return new pn(e,t,n)},hn=dn.extend({options:{position:`topleft`,zoomInText:`<span aria-hidden="true">+</span>`,zoomInTitle:`Zoom in`,zoomOutText:`<span aria-hidden="true">−</span>`,zoomOutTitle:`Zoom out`},onAdd:function(e){var t=`leaflet-control-zoom`,n=I(`div`,t+` leaflet-bar`),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+`-in`,n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+`-out`,n,this._zoomOut),this._updateDisabled(),e.on(`zoomend zoomlevelschange`,this._updateDisabled,this),n},onRemove:function(e){e.off(`zoomend zoomlevelschange`,this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var a=I(`a`,n,r);return a.innerHTML=e,a.href=`#`,a.title=t,a.setAttribute(`role`,`button`),a.setAttribute(`aria-label`,t),en(a),W(a,`click`,tn),W(a,`click`,i,this),W(a,`click`,this._refocusOnMap,this),a},_updateDisabled:function(){var e=this._map,t=`leaflet-disabled`;V(this._zoomInButton,t),V(this._zoomOutButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`false`),this._zoomOutButton.setAttribute(`aria-disabled`,`false`),(this._disabled||e._zoom===e.getMinZoom())&&(B(this._zoomOutButton,t),this._zoomOutButton.setAttribute(`aria-disabled`,`true`)),(this._disabled||e._zoom===e.getMaxZoom())&&(B(this._zoomInButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`true`))}});q.mergeOptions({zoomControl:!0}),q.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new hn,this.addControl(this.zoomControl))});var gn=function(e){return new hn(e)},_n=dn.extend({options:{position:`bottomleft`,maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=`leaflet-control-scale`,n=I(`div`,t),r=this.options;return this._addScales(r,t+`-line`,n),e.on(r.updateWhenIdle?`moveend`:`move`,this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?`moveend`:`move`,this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=I(`div`,t,n)),e.imperial&&(this._iScale=I(`div`,t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+` m`:t/1e3+` km`;this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t=e*3.2808399,n,r,i;t>5280?(n=t/5280,r=this._getRoundNum(n),this._updateScale(this._iScale,r+` mi`,r/n)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+` ft`,i/t))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+`px`,e.innerHTML=t},_getRoundNum:function(e){var t=10**((Math.floor(e)+``).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),vn=function(e){return new _n(e)},yn=dn.extend({options:{position:`bottomright`,prefix:`<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">`+(N.inlineSvg?`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> `:``)+`Leaflet</a>`},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=I(`div`,`leaflet-control-attribution`),en(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on(`layeradd`,this._addAttribution,this),this._container},onRemove:function(e){e.off(`layeradd`,this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once(`remove`,function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(`, `)),this._container.innerHTML=n.join(` <span aria-hidden="true">|</span> `)}}});q.mergeOptions({attributionControl:!0}),q.addInitHook(function(){this.options.attributionControl&&new yn().addTo(this)}),dn.Layers=pn,dn.Zoom=hn,dn.Scale=_n,dn.Attribution=yn,fn.layers=mn,fn.zoom=gn,fn.scale=vn,fn.attribution=function(e){return new yn(e)};var bn=le.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});bn.addTo=function(e,t){return e.addHandler(t,this),this};var xn={Events:y},Sn=N.touch?`touchstart mousedown`:`mousedown`,Cn=de.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||=(W(this._dragStartTarget,Sn,this._onDown,this),!0)},disable:function(){this._enabled&&(Cn._dragging===this&&this.finishDrag(!0),G(this._dragStartTarget,Sn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Dt(this._element,`leaflet-zoom-anim`))){if(e.touches&&e.touches.length!==1){Cn._dragging===this&&this.finishDrag();return}if(!(Cn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Cn._dragging=this,this._preventOutline&&Ht(this._element),Rt(),Pt(),!this._moving)){this.fire(`down`);var t=e.touches?e.touches[0]:e,n=Wt(this._element);this._startPoint=new b(t.clientX,t.clientY),this._startPos=Nt(this._element),this._parentScale=Gt(n);var r=e.type===`mousedown`;W(document,r?`mousemove`:`touchmove`,this._onMove,this),W(document,r?`mouseup`:`touchend touchcancel`,this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,n=new b(t.clientX,t.clientY)._subtract(this._startPoint);!n.x&&!n.y||Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,K(e),this._moved||(this.fire(`dragstart`),this._moved=!0,B(document.body,`leaflet-dragging`),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),B(this._lastTarget,`leaflet-drag-target`)),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition())}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire(`predrag`,e),U(this._element,this._newPos),this.fire(`drag`,e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){V(document.body,`leaflet-dragging`),this._lastTarget&&=(V(this._lastTarget,`leaflet-drag-target`),null),G(document,`mousemove touchmove`,this._onMove,this),G(document,`mouseup touchend touchcancel`,this._onUp,this),zt(),Ft();var t=this._moved&&this._moving;this._moving=!1,Cn._dragging=!1,t&&this.fire(`dragend`,{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function wn(e,t,n){var r,i=[1,4,2,8],a,o,s,c,l,u,d,f;for(a=0,u=e.length;a<u;a++)e[a]._code=Ln(e[a],t);for(s=0;s<4;s++){for(d=i[s],r=[],a=0,u=e.length,o=u-1;a<u;o=a++)c=e[a],l=e[o],c._code&d?l._code&d||(f=In(l,c,d,t,n),f._code=Ln(f,t),r.push(f)):(l._code&d&&(f=In(l,c,d,t,n),f._code=Ln(f,t),r.push(f)),r.push(c));e=r}return e}function Tn(e,t){var n,r,i,a,o,s,c,l,u;if(!e||e.length===0)throw Error(`latlngs not passed`);J(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var d=D([0,0]),f=T(e);f.getNorthWest().distanceTo(f.getSouthWest())*f.getNorthEast().distanceTo(f.getNorthWest())<1700&&(d=En(e));var p=e.length,m=[];for(n=0;n<p;n++){var ee=D(e[n]);m.push(t.project(D([ee.lat-d.lat,ee.lng-d.lng])))}for(s=c=l=0,n=0,r=p-1;n<p;r=n++)i=m[n],a=m[r],o=i.y*a.x-a.y*i.x,c+=(i.x+a.x)*o,l+=(i.y+a.y)*o,s+=o*3;u=s===0?m[0]:[c/s,l/s];var h=t.unproject(x(u));return D([h.lat+d.lat,h.lng+d.lng])}function En(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=D(e[i]);t+=a.lat,n+=a.lng,r++}return D([t/r,n/r])}var Dn={__proto__:null,clipPolygon:wn,polygonCenter:Tn,centroid:En};function On(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=Nn(e,n),e=jn(e,n),e}function kn(e,t,n){return Math.sqrt(zn(e,t,n,!0))}function An(e,t,n){return zn(e,t,n)}function jn(e,t){var n=e.length,r=new(typeof Uint8Array<`u`?Uint8Array:Array)(n);r[0]=r[n-1]=1,Mn(e,r,t,0,n-1);var i,a=[];for(i=0;i<n;i++)r[i]&&a.push(e[i]);return a}function Mn(e,t,n,r,i){var a=0,o,s,c;for(s=r+1;s<=i-1;s++)c=zn(e[s],e[r],e[i],!0),c>a&&(o=s,a=c);a>n&&(t[o]=1,Mn(e,t,n,r,o),Mn(e,t,n,o,i))}function Nn(e,t){for(var n=[e[0]],r=1,i=0,a=e.length;r<a;r++)Rn(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<a-1&&n.push(e[a-1]),n}var Pn;function Fn(e,t,n,r,i){var a=r?Pn:Ln(e,n),o=Ln(t,n),s,c,l;for(Pn=o;;){if(!(a|o))return[e,t];if(a&o)return!1;s=a||o,c=In(e,t,s,n,i),l=Ln(c,n),s===a?(e=c,a=l):(t=c,o=l)}}function In(e,t,n,r,i){var a=t.x-e.x,o=t.y-e.y,s=r.min,c=r.max,l,u;return n&8?(l=e.x+a*(c.y-e.y)/o,u=c.y):n&4?(l=e.x+a*(s.y-e.y)/o,u=s.y):n&2?(l=c.x,u=e.y+o*(c.x-e.x)/a):n&1&&(l=s.x,u=e.y+o*(s.x-e.x)/a),new b(l,u,i)}function Ln(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function Rn(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function zn(e,t,n,r){var i=t.x,a=t.y,o=n.x-i,s=n.y-a,c=o*o+s*s,l;return c>0&&(l=((e.x-i)*o+(e.y-a)*s)/c,l>1?(i=n.x,a=n.y):l>0&&(i+=o*l,a+=s*l)),o=e.x-i,s=e.y-a,r?o*o+s*s:new b(i,a)}function J(e){return!g(e[0])||typeof e[0][0]!=`object`&&e[0][0]!==void 0}function Bn(e){return console.warn(`Deprecated use of _flat, please use L.LineUtil.isFlat instead.`),J(e)}function Vn(e,t){var n,r,i,a,o,s,c,l;if(!e||e.length===0)throw Error(`latlngs not passed`);J(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var u=D([0,0]),d=T(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=En(e));var f=e.length,p=[];for(n=0;n<f;n++){var m=D(e[n]);p.push(t.project(D([m.lat-u.lat,m.lng-u.lng])))}for(n=0,r=0;n<f-1;n++)r+=p[n].distanceTo(p[n+1])/2;if(r===0)l=p[0];else for(n=0,a=0;n<f-1;n++)if(o=p[n],s=p[n+1],i=o.distanceTo(s),a+=i,a>r){c=(a-r)/i,l=[s.x-c*(s.x-o.x),s.y-c*(s.y-o.y)];break}var ee=t.unproject(x(l));return D([ee.lat+u.lat,ee.lng+u.lng])}var Hn={__proto__:null,simplify:On,pointToSegmentDistance:kn,closestPointOnSegment:An,clipSegment:Fn,_getEdgeIntersection:In,_getBitCode:Ln,_sqClosestPointOnSegment:zn,isFlat:J,_flat:Bn,polylineCenter:Vn},Un={project:function(e){return new b(e.lng,e.lat)},unproject:function(e){return new E(e.y,e.x)},bounds:new S([-180,-90],[180,90])},Wn={R:6378137,R_MINOR:6356752.314245179,bounds:new S([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,a=Math.sqrt(1-i*i),o=a*Math.sin(r),s=Math.tan(Math.PI/4-r/2)/((1-o)/(1+o))**(a/2);return r=-n*Math.log(Math.max(s,1e-10)),new b(e.lng*t*n,r)},unproject:function(e){for(var t=180/Math.PI,n=this.R,r=this.R_MINOR/n,i=Math.sqrt(1-r*r),a=Math.exp(-e.y/n),o=Math.PI/2-2*Math.atan(a),s=0,c=.1,l;s<15&&Math.abs(c)>1e-7;s++)l=i*Math.sin(o),l=((1-l)/(1+l))**(i/2),c=Math.PI/2-2*Math.atan(a*l)-o,o+=c;return new E(o*t,e.x*t/n)}},Gn={__proto__:null,LonLat:Un,Mercator:Wn,SphericalMercator:ge},Kn=n({},me,{code:`EPSG:3395`,projection:Wn,transformation:function(){var e=.5/(Math.PI*Wn.R);return O(e,.5,-e,.5)}()}),qn=n({},me,{code:`EPSG:4326`,projection:Un,transformation:O(1/180,1,-1/180,.5)}),Jn=n({},pe,{projection:Un,transformation:O(1,0,-1,0),scale:function(e){return 2**e},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});pe.Earth=me,pe.EPSG3395=Kn,pe.EPSG3857=ve,pe.EPSG900913=ye,pe.EPSG4326=qn,pe.Simple=Jn;var Y=de.extend({options:{pane:`overlayPane`,attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[o(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[o(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once(`remove`,function(){t.off(n,this)},this)}this.onAdd(t),this.fire(`add`),t.fire(`layeradd`,{layer:this})}}});q.include({addLayer:function(e){if(!e._layerAdd)throw Error(`The provided object is not a Layer.`);var t=o(e);return this._layers[t]?this:(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var t=o(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire(`layerremove`,{layer:e}),e.fire(`remove`)),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return o(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?g(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){(!isNaN(e.options.maxZoom)||!isNaN(e.options.minZoom))&&(this._zoomBoundLayers[o(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=o(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;e=i.minZoom===void 0?e:Math.min(e,i.minZoom),t=i.maxZoom===void 0?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire(`zoomlevelschange`),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Yn=Y.extend({initialize:function(e,t){p(this,t),this._layers={};var n,r;if(e)for(n=0,r=e.length;n<r;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return(typeof e==`number`?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t=Array.prototype.slice.call(arguments,1),n,r;for(n in this._layers)r=this._layers[n],r[e]&&r[e].apply(r,t);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke(`setZIndex`,e)},getLayerId:function(e){return o(e)}}),Xn=function(e,t){return new Yn(e,t)},Zn=Yn.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Yn.prototype.addLayer.call(this,e),this.fire(`layeradd`,{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Yn.prototype.removeLayer.call(this,e),this.fire(`layerremove`,{layer:e})):this},setStyle:function(e){return this.invoke(`setStyle`,e)},bringToFront:function(){return this.invoke(`bringToFront`)},bringToBack:function(){return this.invoke(`bringToBack`)},getBounds:function(){var e=new w;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),Qn=function(e,t){return new Zn(e,t)},$n=le.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){p(this,e)},createIcon:function(e){return this._createIcon(`icon`,e)},createShadow:function(e){return this._createIcon(`shadow`,e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e===`icon`)throw Error(`iconUrl not set in Icon options (see the docs).`);return null}var r=this._createImg(n,t&&t.tagName===`IMG`?t:null);return this._setIconStyles(r,e),(this.options.crossOrigin||this.options.crossOrigin===``)&&(r.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),r},_setIconStyles:function(e,t){var n=this.options,r=n[t+`Size`];typeof r==`number`&&(r=[r,r]);var i=x(r),a=x(t===`shadow`&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));e.className=`leaflet-marker-`+t+` `+(n.className||``),a&&(e.style.marginLeft=-a.x+`px`,e.style.marginTop=-a.y+`px`),i&&(e.style.width=i.x+`px`,e.style.height=i.y+`px`)},_createImg:function(e,t){return t||=document.createElement(`img`),t.src=e,t},_getIconUrl:function(e){return N.retina&&this.options[e+`RetinaUrl`]||this.options[e+`Url`]}});function X(e){return new $n(e)}var er=$n.extend({options:{iconUrl:`marker-icon.png`,iconRetinaUrl:`marker-icon-2x.png`,shadowUrl:`marker-shadow.png`,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return typeof er.imagePath!=`string`&&(er.imagePath=this._detectIconPath()),(this.options.imagePath||er.imagePath)+$n.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var r=t.exec(e);return r&&r[n]};return e=t(e,/^url\((['"])?(.+)\1\)$/,2),e&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=I(`div`,`leaflet-default-icon-path`,document.body),t=wt(e,`background-image`)||wt(e,`backgroundImage`);if(document.body.removeChild(e),t=this._stripUrl(t),t)return t;var n=document.querySelector(`link[href$="leaflet.css"]`);return n?n.href.substring(0,n.href.length-11-1):``}}),Z=bn.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||=new Cn(e,e,!0),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),B(e,`leaflet-marker-draggable`)},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&V(this._marker._icon,`leaflet-marker-draggable`)},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,a=Nt(t._icon),o=n.getPixelBounds(),s=n.getPixelOrigin(),c=C(o.min._subtract(s).add(i),o.max._subtract(s).subtract(i));if(!c.contains(a)){var l=x((Math.max(c.max.x,a.x)-c.max.x)/(o.max.x-c.max.x)-(Math.min(c.min.x,a.x)-c.min.x)/(o.min.x-c.min.x),(Math.max(c.max.y,a.y)-c.max.y)/(o.max.y-c.max.y)-(Math.min(c.min.y,a.y)-c.min.y)/(o.min.y-c.min.y)).multiplyBy(r);n.panBy(l,{animate:!1}),this._draggable._newPos._add(l),this._draggable._startPos._add(l),U(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=_(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire(`movestart`).fire(`dragstart`)},_onPreDrag:function(e){this._marker.options.autoPan&&(v(this._panRequest),this._panRequest=_(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,r=Nt(t._icon),i=t._map.layerPointToLatLng(r);n&&U(n,r),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire(`move`,e).fire(`drag`,e)},_onDragEnd:function(e){v(this._panRequest),delete this._oldLatLng,this._marker.fire(`moveend`).fire(`dragend`,e)}}),tr=Y.extend({options:{icon:new er,interactive:!0,keyboard:!0,title:``,alt:`Marker`,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:`markerPane`,shadowPane:`shadowPane`,bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){p(this,t),this._latlng=D(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on(`zoomanim`,this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off(`zoomanim`,this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=D(e),this.update(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t=`leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`),n=e.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,e.title&&(n.title=e.title),n.tagName===`IMG`&&(n.alt=e.alt||``)),B(n,t),e.keyboard&&(n.tabIndex=`0`,n.setAttribute(`role`,`button`)),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&W(n,`focus`,this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),a=!1;i!==this._shadow&&(this._removeShadow(),a=!0),i&&(B(i,t),i.alt=``),this._shadow=i,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&a&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&G(this._icon,`focus`,this._panOnFocus,this),R(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&R(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&U(this._icon,e),this._shadow&&U(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(B(this._icon,`leaflet-interactive`),this.addInteractiveTarget(this._icon),Z)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Z(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&H(this._icon,e),this._shadow&&H(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?x(t.iconSize):x(0,0),r=t.iconAnchor?x(t.iconAnchor):x(0,0);e.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:n.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function nr(e,t){return new tr(e,t)}var Q=Y.extend({options:{stroke:!0,color:`#3388ff`,weight:3,opacity:1,lineCap:`round`,lineJoin:`round`,dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:`evenodd`,interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return p(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,`weight`)&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),rr=Q.extend({options:{fill:!0,radius:10},initialize:function(e,t){p(this,t),this._latlng=D(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=D(e),this.redraw(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return Q.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),r=[e+n,t+n];this._pxBounds=new S(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ir(e,t){return new rr(e,t)}var ar=rr.extend({initialize:function(e,t,r){if(typeof t==`number`&&(t=n({},r,{radius:t})),p(this,t),this._latlng=D(e),isNaN(this.options.radius))throw Error(`Circle radius cannot be NaN`);this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new w(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:Q.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===me.distance){var i=Math.PI/180,a=this._mRadius/me.R/i,o=n.project([t+a,e]),s=n.project([t-a,e]),c=o.add(s).divideBy(2),l=n.unproject(c).lat,u=Math.acos((Math.cos(a*i)-Math.sin(t*i)*Math.sin(l*i))/(Math.cos(t*i)*Math.cos(l*i)))/i;(isNaN(u)||u===0)&&(u=a/Math.cos(Math.PI/180*t)),this._point=c.subtract(n.getPixelOrigin()),this._radius=isNaN(u)?0:c.x-n.project([l,e-u]).x,this._radiusY=c.y-o.y}else{var d=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}});function or(e,t,n){return new ar(e,t,n)}var sr=Q.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){p(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t=1/0,n=null,r=zn,i,a,o=0,s=this._parts.length;o<s;o++)for(var c=this._parts[o],l=1,u=c.length;l<u;l++){i=c[l-1],a=c[l];var d=r(e,i,a,!0);d<t&&(t=d,n=r(e,i,a))}return n&&(n.distance=Math.sqrt(t)),n},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return Vn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t||=this._defaultShape(),e=D(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new w,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return J(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=J(e),r=0,i=e.length;r<i;r++)n?(t[r]=D(e[r]),this._bounds.extend(t[r])):t[r]=this._convertLatLngs(e[r]);return t},_project:function(){var e=new S;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new b(e,e);this._rawPxBounds&&(this._pxBounds=new S([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var r=e[0]instanceof E,i=e.length,a,o;if(r){for(o=[],a=0;a<i;a++)o[a]=this._map.latLngToLayerPoint(e[a]),n.extend(o[a]);t.push(o)}else for(a=0;a<i;a++)this._projectLatlngs(e[a],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}var t=this._parts,n,r,i,a,o,s,c;for(n=0,i=0,a=this._rings.length;n<a;n++)for(c=this._rings[n],r=0,o=c.length;r<o-1;r++)s=Fn(c[r],c[r+1],e,r,!0),s&&(t[i]=t[i]||[],t[i].push(s[0]),(s[1]!==c[r+1]||r===o-2)&&(t[i].push(s[1]),i++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,r=e.length;n<r;n++)e[n]=On(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,r,i,a,o,s,c=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=this._parts[n],r=0,o=s.length,i=o-1;r<o;i=r++)if(!(!t&&r===0)&&kn(e,s[i],s[r])<=c)return!0;return!1}});function cr(e,t){return new sr(e,t)}sr._flat=Bn;var lr=sr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return Tn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=sr.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof E&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){sr.prototype._setLatLngs.call(this,e),J(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return J(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new b(t,t);if(e=new S(e.min.subtract(n),e.max.add(n)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,i=this._rings.length,a;r<i;r++)a=wn(this._rings[r],e,!0),a.length&&this._parts.push(a)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t=!1,n,r,i,a,o,s,c,l;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(a=0,c=this._parts.length;a<c;a++)for(n=this._parts[a],o=0,l=n.length,s=l-1;o<l;s=o++)r=n[o],i=n[s],r.y>e.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(t=!t);return t||sr.prototype._containsPoint.call(this,e,!0)}});function ur(e,t){return new lr(e,t)}var dr=Zn.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=g(e)?e:e.features,n,r,i;if(t){for(n=0,r=t.length;n<r;n++)i=t[n],(i.geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var a=this.options;if(a.filter&&!a.filter(e))return this;var o=fr(e,a);return o?(o.feature=yr(e),o.defaultOptions=o.options,this.resetStyle(o),a.onEachFeature&&a.onEachFeature(e,o),this.addLayer(o)):this},resetStyle:function(e){return e===void 0?this.eachLayer(this.resetStyle,this):(e.options=n({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&(typeof t==`function`&&(t=t(e.feature)),e.setStyle(t))}});function fr(e,t){var n=e.type===`Feature`?e.geometry:e,r=n?n.coordinates:null,i=[],a=t&&t.pointToLayer,o=t&&t.coordsToLatLng||mr,s,c,l,u;if(!r&&!n)return null;switch(n.type){case`Point`:return s=o(r),pr(a,e,s,t);case`MultiPoint`:for(l=0,u=r.length;l<u;l++)s=o(r[l]),i.push(pr(a,e,s,t));return new Zn(i);case`LineString`:case`MultiLineString`:return c=hr(r,n.type===`LineString`?0:1,o),new sr(c,t);case`Polygon`:case`MultiPolygon`:return c=hr(r,n.type===`Polygon`?1:2,o),new lr(c,t);case`GeometryCollection`:for(l=0,u=n.geometries.length;l<u;l++){var d=fr({geometry:n.geometries[l],type:`Feature`,properties:e.properties},t);d&&i.push(d)}return new Zn(i);case`FeatureCollection`:for(l=0,u=n.features.length;l<u;l++){var f=fr(n.features[l],t);f&&i.push(f)}return new Zn(i);default:throw Error(`Invalid GeoJSON object.`)}}function pr(e,t,n,r){return e?e(t,n):new tr(n,r&&r.markersInheritOptions&&r)}function mr(e){return new E(e[1],e[0],e[2])}function hr(e,t,n){for(var r=[],i=0,a=e.length,o;i<a;i++)o=t?hr(e[i],t-1,n):(n||mr)(e[i]),r.push(o);return r}function gr(e,t){return e=D(e),e.alt===void 0?[u(e.lng,t),u(e.lat,t)]:[u(e.lng,t),u(e.lat,t),u(e.alt,t)]}function _r(e,t,n,r){for(var i=[],a=0,o=e.length;a<o;a++)i.push(t?_r(e[a],J(e[a])?0:t-1,n,r):gr(e[a],r));return!t&&n&&i.length>0&&i.push(i[0].slice()),i}function vr(e,t){return e.feature?n({},e.feature,{geometry:t}):yr(t)}function yr(e){return e.type===`Feature`||e.type===`FeatureCollection`?e:{type:`Feature`,properties:{},geometry:e}}var br={toGeoJSON:function(e){return vr(this,{type:`Point`,coordinates:gr(this.getLatLng(),e)})}};tr.include(br),ar.include(br),rr.include(br),sr.include({toGeoJSON:function(e){var t=!J(this._latlngs),n=_r(this._latlngs,+!!t,!1,e);return vr(this,{type:(t?`Multi`:``)+`LineString`,coordinates:n})}}),lr.include({toGeoJSON:function(e){var t=!J(this._latlngs),n=t&&!J(this._latlngs[0]),r=_r(this._latlngs,n?2:+!!t,!0,e);return t||(r=[r]),vr(this,{type:(n?`Multi`:``)+`Polygon`,coordinates:r})}}),Yn.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),vr(this,{type:`MultiPoint`,coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(t===`MultiPoint`)return this.toMultiPoint(e);var n=t===`GeometryCollection`,r=[];return this.eachLayer(function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var a=yr(i);a.type===`FeatureCollection`?r.push.apply(r,a.features):r.push(a)}}}),n?vr(this,{geometries:r,type:`GeometryCollection`}):{type:`FeatureCollection`,features:r}}});function xr(e,t){return new dr(e,t)}var Sr=xr,Cr=Y.extend({options:{opacity:1,alt:``,interactive:!1,crossOrigin:!1,errorOverlayUrl:``,zIndex:1,className:``},initialize:function(e,t,n){this._url=e,this._bounds=T(t),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(B(this._image,`leaflet-interactive`),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){R(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&Et(this._image),this},bringToBack:function(){return this._map&&z(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=T(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName===`IMG`,t=this._image=e?this._url:I(`img`);if(B(t,`leaflet-image-layer`),this._zoomAnimated&&B(t,`leaflet-zoom-animated`),this.options.className&&B(t,this.options.className),t.onselectstart=l,t.onmousemove=l,t.onload=i(this.fire,this,`load`),t.onerror=i(this._overlayOnError,this,`error`),(this.options.crossOrigin||this.options.crossOrigin===``)&&(t.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Mt(this._image,n,t)},_reset:function(){var e=this._image,t=new S(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();U(e,t.min),e.style.width=n.x+`px`,e.style.height=n.y+`px`},_updateOpacity:function(){H(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire(`error`);var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),wr=function(e,t,n){return new Cr(e,t,n)},Tr=Cr.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName===`VIDEO`,t=this._image=e?this._url:I(`video`);if(B(t,`leaflet-image-layer`),this._zoomAnimated&&B(t,`leaflet-zoom-animated`),this.options.className&&B(t,this.options.className),t.onselectstart=l,t.onmousemove=l,t.onloadeddata=i(this.fire,this,`load`),e){for(var n=t.getElementsByTagName(`source`),r=[],a=0;a<n.length;a++)r.push(n[a].src);this._url=n.length>0?r:[t.src];return}g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,`objectFit`)&&(t.style.objectFit=`fill`),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var o=0;o<this._url.length;o++){var s=I(`source`);s.src=this._url[o],t.appendChild(s)}}});function Er(e,t,n){return new Tr(e,t,n)}var Dr=Cr.extend({_initImage:function(){var e=this._image=this._url;B(e,`leaflet-image-layer`),this._zoomAnimated&&B(e,`leaflet-zoom-animated`),this.options.className&&B(e,this.options.className),e.onselectstart=l,e.onmousemove=l}});function Or(e,t,n){return new Dr(e,t,n)}var kr=Y.extend({options:{interactive:!1,offset:[0,0],className:``,pane:void 0,content:``},initialize:function(e,t){e&&(e instanceof E||g(e))?(this._latlng=D(e),p(this,t)):(p(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&H(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&H(this._container,1),this.bringToFront(),this.options.interactive&&(B(this._container,`leaflet-interactive`),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(H(this._container,0),this._removeTimeout=setTimeout(i(R,void 0,this._container),200)):R(this._container),this.options.interactive&&(V(this._container,`leaflet-interactive`),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=D(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility=`hidden`,this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility=``,this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Et(this._container),this},bringToBack:function(){return this._map&&z(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Zn){t=null;var n=this._source._layers;for(var r in n)if(n[r]._map){t=n[r];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else if(t.getBounds)e=t.getBounds().getCenter();else throw Error(`Unable to get source layer LatLng.`);return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t=typeof this._content==`function`?this._content(this._source||this):this._content;if(typeof t==`string`)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire(`contentupdate`)}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=x(this.options.offset),n=this._getAnchor();this._zoomAnimated?U(this._container,e.add(n)):t=t.add(e).add(n);var r=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=r+`px`,this._container.style.left=i+`px`}},_getAnchor:function(){return[0,0]}});q.include({_initOverlay:function(e,t,n,r){var i=t;return i instanceof e||(i=new e(r).setContent(t)),n&&i.setLatLng(n),i}}),Y.include({_initOverlay:function(e,t,n,r){var i=n;return i instanceof e?(p(i,r),i._source=this):(i=t&&!r?t:new e(r,this),i.setContent(n)),i}});var Ar=kr.extend({options:{pane:`popupPane`,offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:``},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,kr.prototype.openOn.call(this,e)},onAdd:function(e){kr.prototype.onAdd.call(this,e),e.fire(`popupopen`,{popup:this}),this._source&&(this._source.fire(`popupopen`,{popup:this},!0),this._source instanceof Q||this._source.on(`preclick`,Qt))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire(`popupclose`,{popup:this}),this._source&&(this._source.fire(`popupclose`,{popup:this},!0),this._source instanceof Q||this._source.off(`preclick`,Qt))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return(this.options.closeOnClick===void 0?this._map.options.closePopupOnClick:this.options.closeOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e=`leaflet-popup`,t=this._container=I(`div`,e+` `+(this.options.className||``)+` leaflet-zoom-animated`),n=this._wrapper=I(`div`,e+`-content-wrapper`,t);if(this._contentNode=I(`div`,e+`-content`,n),en(t),$t(this._contentNode),W(t,`contextmenu`,Qt),this._tipContainer=I(`div`,e+`-tip-container`,t),this._tip=I(`div`,e+`-tip`,this._tipContainer),this.options.closeButton){var r=this._closeButton=I(`a`,e+`-close-button`,t);r.setAttribute(`role`,`button`),r.setAttribute(`aria-label`,`Close popup`),r.href=`#close`,r.innerHTML=`<span aria-hidden="true">×</span>`,W(r,`click`,function(e){K(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width=``,t.whiteSpace=`nowrap`;var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+`px`,t.whiteSpace=``,t.height=``;var r=e.offsetHeight,i=this.options.maxHeight,a=`leaflet-popup-scrolled`;i&&r>i?(t.height=i+`px`,B(e,a)):V(e,a),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();U(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,t=parseInt(wt(this._container,`marginBottom`),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new b(this._containerLeft,-n-this._containerBottom);i._add(Nt(this._container));var a=e.layerPointToContainerPoint(i),o=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||o),c=x(this.options.autoPanPaddingBottomRight||o),l=e.getSize(),u=0,d=0;a.x+r+c.x>l.x&&(u=a.x+r-l.x+c.x),a.x-u-s.x<0&&(u=a.x-s.x),a.y+n+c.y>l.y&&(d=a.y+n-l.y+c.y),a.y-d-s.y<0&&(d=a.y-s.y),(u||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire(`autopanstart`).panBy([u,d]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),jr=function(e,t){return new Ar(e,t)};q.mergeOptions({closePopupOnClick:!0}),q.include({openPopup:function(e,t,n){return this._initOverlay(Ar,e,t,n).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Y.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Ar,this._popup,e,t),this._popupHandlersAdded||=(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),!0),this},unbindPopup:function(){return this._popup&&=(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,null),this},openPopup:function(e){return this._popup&&(this instanceof Zn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){tn(e);var t=e.layer||e.target;if(this._popup._source===t&&!(t instanceof Q)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=t,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var Mr=kr.extend({options:{pane:`tooltipPane`,offset:[0,0],direction:`auto`,permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){kr.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire(`tooltipopen`,{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire(`tooltipopen`,{tooltip:this},!0))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire(`tooltipclose`,{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire(`tooltipclose`,{tooltip:this},!0))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e=`leaflet-tooltip `+(this.options.className||``)+` leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`);this._contentNode=this._container=I(`div`,e),this._container.setAttribute(`role`,`tooltip`),this._container.setAttribute(`id`,`leaflet-tooltip-`+o(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,a=r.latLngToContainerPoint(r.getCenter()),o=r.layerPointToContainerPoint(e),s=this.options.direction,c=i.offsetWidth,l=i.offsetHeight,u=x(this.options.offset),d=this._getAnchor();s===`top`?(t=c/2,n=l):s===`bottom`?(t=c/2,n=0):s===`center`?(t=c/2,n=l/2):s===`right`?(t=0,n=l/2):s===`left`?(t=c,n=l/2):o.x<a.x?(s=`right`,t=0,n=l/2):(s=`left`,t=c+(u.x+d.x)*2,n=l/2),e=e.subtract(x(t,n,!0)).add(u).add(d),V(i,`leaflet-tooltip-right`),V(i,`leaflet-tooltip-left`),V(i,`leaflet-tooltip-top`),V(i,`leaflet-tooltip-bottom`),B(i,`leaflet-tooltip-`+s),U(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&H(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return x(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Nr=function(e,t){return new Mr(e,t)};q.include({openTooltip:function(e,t,n){return this._initOverlay(Mr,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),Y.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Mr,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&=(this._initTooltipInteractions(!0),this.closeTooltip(),null),this},_initTooltipInteractions:function(e){if(!(!e&&this._tooltipHandlersAdded)){var t=e?`off`:`on`,n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Zn||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&(W(t,`focus`,function(){this._tooltip._source=e,this.openTooltip()},this),W(t,`blur`,this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&t.setAttribute(`aria-describedby`,this._tooltip._container.id)},_openTooltip:function(e){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once(`moveend`,function(){t._openOnceFlag=!1,t._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var t=e.latlng,n,r;this._tooltip.options.sticky&&e.originalEvent&&(n=this._map.mouseEventToContainerPoint(e.originalEvent),r=this._map.containerPointToLayerPoint(n),t=this._map.layerPointToLatLng(r)),this._tooltip.setLatLng(t)}});var Pr=$n.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:`leaflet-div-icon`},createIcon:function(e){var t=e&&e.tagName===`DIV`?e:document.createElement(`div`),n=this.options;if(n.html instanceof Element?(Tt(t),t.appendChild(n.html)):t.innerHTML=n.html===!1?``:n.html,n.bgPos){var r=x(n.bgPos);t.style.backgroundPosition=-r.x+`px `+-r.y+`px`}return this._setIconStyles(t,`icon`),t},createShadow:function(){return null}});function Fr(e){return new Pr(e)}$n.Default=er;var Ir=Y.extend({options:{tileSize:256,opacity:1,updateWhenIdle:N.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:`tilePane`,className:``,keepBuffer:2},initialize:function(e){p(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),R(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Et(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(z(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||=s(this._onMoveEnd,this.options.updateInterval,this),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement(`div`)},getTileSize:function(){var e=this.options.tileSize;return e instanceof b?e:new b(e,e)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t=this.getPane().children,n=-e(-1/0,1/0),r=0,i=t.length,a;r<i;r++)a=t[r].style.zIndex,t[r]!==this._container&&a&&(n=e(n,+a));isFinite(n)&&(this.options.zIndex=n+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!N.ielt9){H(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(!(!i.current||!i.loaded)){var a=Math.min(1,(e-i.loaded)/200);H(i.el,a),a<1?t=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(v(this._fadeFrame),this._fadeFrame=_(this._updateOpacity,this))}},_onOpaqueTile:l,_initContainer:function(){this._container||(this._container=I(`div`,`leaflet-layer `+(this.options.className||``)),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(e!==void 0){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(R(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[e],i=this._map;return r||(r=this._levels[e]={},r.el=I(`div`,`leaflet-tile-container leaflet-zoom-animated`,this._container),r.el.style.zIndex=t,r.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),r.zoom=e,this._setZoomTransform(r,i.getCenter(),i.getZoom()),r.el.offsetWidth,this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:l,_onRemoveLevel:l,_onCreateLevel:l,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom){this._removeAllTiles();return}for(e in this._tiles)t=this._tiles[e],t.retain=t.current;for(e in this._tiles)if(t=this._tiles[e],t.current&&!t.active){var r=t.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)R(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,r){var i=Math.floor(e/2),a=Math.floor(t/2),o=n-1,s=new b(+i,+a);s.z=+o;var c=this._tileCoordsToKey(s),l=this._tiles[c];return l&&l.active?(l.retain=!0,!0):(l&&l.loaded&&(l.retain=!0),o>r&&this._retainParent(i,a,o,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var a=2*t;a<2*t+2;a++){var o=new b(i,a);o.z=n+1;var s=this._tileCoordsToKey(o),c=this._tiles[s];if(c&&c.active){c.retain=!0;continue}else c&&c.loaded&&(c.retain=!0);n+1<r&&this._retainChildren(i,a,n+1,r)}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return t.minNativeZoom!==void 0&&e<t.minNativeZoom?t.minNativeZoom:t.maxNativeZoom!==void 0&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,r){var i=Math.round(t);i=this.options.maxZoom!==void 0&&i>this.options.maxZoom||this.options.minZoom!==void 0&&i<this.options.minZoom?void 0:this._clampZoom(i);var a=this.options.updateWhenZooming&&i!==this._tileZoom;(!r||a)&&(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),i!==void 0&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var r=this._map.getZoomScale(n,e.zoom),i=e.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,n)).round();N.any3d?Mt(e.el,i,r):U(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],r).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],r).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],r).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),r=t.getZoomScale(n,this._tileZoom),i=t.project(e,this._tileZoom).floor(),a=t.getSize().divideBy(r*2);return new S(i.subtract(a),i.add(a))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(e===void 0&&(e=t.getCenter()),this._tileZoom!==void 0){var r=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(r),a=i.getCenter(),o=[],s=this.options.keepBuffer,c=new S(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw Error(`Attempted to load an infinite number of tiles`);for(var l in this._tiles){var u=this._tiles[l].coords;(u.z!==this._tileZoom||!c.contains(new b(u.x,u.y)))&&(this._tiles[l].current=!1)}if(Math.abs(n-this._tileZoom)>1){this._setView(e,n);return}for(var d=i.min.y;d<=i.max.y;d++)for(var f=i.min.x;f<=i.max.x;f++){var p=new b(f,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:o.push(p)}}if(o.sort(function(e,t){return e.distanceTo(a)-t.distanceTo(a)}),o.length!==0){this._loading||(this._loading=!0,this.fire(`loading`));var ee=document.createDocumentFragment();for(f=0;f<o.length;f++)this._addTile(o[f],ee);this._level.el.appendChild(ee)}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return T(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new w(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+`:`+e.y+`:`+e.z},_keyToTileCoords:function(e){var t=e.split(`:`),n=new b(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(R(t.el),delete this._tiles[e],this.fire(`tileunload`,{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){B(e,`leaflet-tile`);var t=this.getTileSize();e.style.width=t.x+`px`,e.style.height=t.y+`px`,e.onselectstart=l,e.onmousemove=l,N.ielt9&&this.options.opacity<1&&H(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),a=this.createTile(this._wrapCoords(e),i(this._tileReady,this,e));this._initTile(a),this.createTile.length<2&&_(i(this._tileReady,this,e,null,a)),U(a,n),this._tiles[r]={el:a,coords:e,current:!0},t.appendChild(a),this.fire(`tileloadstart`,{tile:a,coords:e})},_tileReady:function(e,t,n){t&&this.fire(`tileerror`,{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);n=this._tiles[r],n&&(n.loaded=+new Date,this._map._fadeAnimated?(H(n.el,0),v(this._fadeFrame),this._fadeFrame=_(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(B(n.el,`leaflet-tile-loaded`),this.fire(`tileload`,{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire(`load`),N.ielt9||!this._map._fadeAnimated?_(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new b(this._wrapX?c(e.x,this._wrapX):e.x,this._wrapY?c(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new S(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Lr(e){return new Ir(e)}var Rr=Ir.extend({options:{minZoom:0,maxZoom:18,subdomains:`abc`,errorTileUrl:``,zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,t=p(this,t),t.detectRetina&&N.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),typeof t.subdomains==`string`&&(t.subdomains=t.subdomains.split(``)),this.on(`tileunload`,this._onTileRemove)},setUrl:function(e,t){return this._url===e&&t===void 0&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement(`img`);return W(n,`load`,i(this._tileOnLoad,this,t,n)),W(n,`error`,i(this._tileOnError,this,t,n)),(this.options.crossOrigin||this.options.crossOrigin===``)&&(n.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),typeof this.options.referrerPolicy==`string`&&(n.referrerPolicy=this.options.referrerPolicy),n.alt=``,n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:N.retina?`@2x`:``,s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=r),t[`-y`]=r}return h(this._url,n(t,this.options))},_tileOnLoad:function(e,t){N.ielt9?setTimeout(i(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute(`src`)!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom,n=this.options.zoomReverse,r=this.options.zoomOffset;return n&&(e=t-e),e+r},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(t=this._tiles[e].el,t.onload=l,t.onerror=l,!t.complete)){t.src=ne;var n=this._tiles[e].coords;R(t),delete this._tiles[e],this.fire(`tileabort`,{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute(`src`,ne),Ir.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(!(!this._map||n&&n.getAttribute(`src`)===ne))return Ir.prototype._tileReady.call(this,e,t,n)}});function zr(e,t){return new Rr(e,t)}var Br=Rr.extend({defaultWmsParams:{service:`WMS`,request:`GetMap`,layers:``,styles:``,format:`image/jpeg`,transparent:!1,version:`1.1.1`},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var r=n({},this.defaultWmsParams);for(var i in t)i in this.options||(r[i]=t[i]);t=p(this,t);var a=t.detectRetina&&N.retina?2:1,o=this.getTileSize();r.width=o.x*a,r.height=o.y*a,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?`crs`:`srs`;this.wmsParams[t]=this._crs.code,Rr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=C(n.project(t[0]),n.project(t[1])),i=r.min,a=r.max,o=(this._wmsVersion>=1.3&&this._crs===qn?[i.y,i.x,a.y,a.x]:[i.x,i.y,a.x,a.y]).join(`,`),s=Rr.prototype.getTileUrl.call(this,e);return s+m(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?`&BBOX=`:`&bbox=`)+o},setParams:function(e,t){return n(this.wmsParams,e),t||this.redraw(),this}});function Vr(e,t){return new Br(e,t)}Rr.WMS=Br,zr.wms=Vr;var Hr=Y.extend({options:{padding:.1},initialize:function(e){p(this,e),o(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),B(this._container,`leaflet-zoom-animated`)),this.getPane().appendChild(this._container),this._update(),this.on(`update`,this._updatePaths,this)},onRemove:function(){this.off(`update`,this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),a=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));N.any3d?Mt(this._container,a,n):U(this._container,a)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new S(n,n.add(t.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ur=Hr.extend({options:{tolerance:0},getEvents:function(){var e=Hr.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Hr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement(`canvas`);W(e,`mousemove`,this._onMouseMove,this),W(e,`click dblclick mousedown mouseup contextmenu`,this._onClick,this),W(e,`mouseout`,this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext(`2d`)},_destroyContainer:function(){v(this._redrawRequest),delete this._ctx,R(this._container),G(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;for(var t in this._redrawBounds=null,this._layers)e=this._layers[t],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Hr.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=N.retina?2:1;U(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+`px`,t.style.height=n.y+`px`,N.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire(`update`)}},_reset:function(){Hr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[o(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[o(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray==`string`){var t=e.options.dashArray.split(/[, ]+/),n=[],r,i;for(i=0;i<t.length;i++){if(r=Number(t[i]),isNaN(r))return;n.push(r)}e.options._dashArray=n}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||_(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new S,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)e=r.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,r,i,a,o=e._parts,s=o.length,c=this._ctx;if(s){for(c.beginPath(),n=0;n<s;n++){for(r=0,i=o[n].length;r<i;r++)a=o[n][r],c[r?`lineTo`:`moveTo`](a.x,a.y);t&&c.closePath()}this._fillStroke(c,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var t=e._point,n=this._ctx,r=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||r)/r;i!==1&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(t.x,t.y/i,r,0,Math.PI*2,!1),i!==1&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||`evenodd`)),n.stroke&&n.weight!==0&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t=this._map.mouseEventToLayerPoint(e),n,r,i=this._drawFirst;i;i=i.next)n=i.layer,n.options.interactive&&n._containsPoint(t)&&(!(e.type===`click`||e.type===`preclick`)||!this._map._draggableMoved(n))&&(r=n);this._fireEvent(r?[r]:!1,e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(V(this._container,`leaflet-interactive`),this._fireEvent([t],e,`mouseout`),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,r,a=this._drawFirst;a;a=a.next)n=a.layer,n.options.interactive&&n._containsPoint(t)&&(r=n);r!==this._hoveredLayer&&(this._handleMouseOut(e),r&&(B(this._container,`leaflet-interactive`),this._fireEvent([r],e,`mouseover`),this._hoveredLayer=r)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,e),this._mouseHoverThrottled=!0,setTimeout(i(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(n)n.prev=r;else return;r?r.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e)}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(r)r.next=n;else return;n?n.prev=r:r&&(this._drawLast=r),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e)}}});function Wr(e){return N.canvas?new Ur(e):null}var Gr=(function(){try{return document.namespaces.add(`lvml`,`urn:schemas-microsoft-com:vml`),function(e){return document.createElement(`<lvml:`+e+` class="lvml">`)}}catch{}return function(e){return document.createElement(`<`+e+` xmlns="urn:schemas-microsoft.com:vml" class="lvml">`)}})(),Kr={_initContainer:function(){this._container=I(`div`,`leaflet-vml-container`)},_update:function(){this._map._animatingZoom||(Hr.prototype._update.call(this),this.fire(`update`))},_initPath:function(e){var t=e._container=Gr(`shape`);B(t,`leaflet-vml-shape `+(this.options.className||``)),t.coordsize=`1 1`,e._path=Gr(`path`),t.appendChild(e._path),this._updateStyle(e),this._layers[o(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;R(t),e.removeInteractiveTarget(t),delete this._layers[o(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||=e._stroke=Gr(`stroke`),i.appendChild(t),t.weight=r.weight+`px`,t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=g(r.dashArray)?r.dashArray.join(` `):r.dashArray.replace(/( *, *)/g,` `):t.dashStyle=``,t.endcap=r.lineCap.replace(`butt`,`flat`),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||=e._fill=Gr(`fill`),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?`M0 0`:`AL `+t.x+`,`+t.y+` `+n+`,`+r+` 0,23592600`)},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){Et(e._container)},_bringToBack:function(e){z(e._container)}},qr=N.vml?Gr:be,Jr=Hr.extend({_initContainer:function(){this._container=qr(`svg`),this._container.setAttribute(`pointer-events`,`none`),this._rootGroup=qr(`g`),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){R(this._container),G(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Hr.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;(!this._svgSize||!this._svgSize.equals(t))&&(this._svgSize=t,n.setAttribute(`width`,t.x),n.setAttribute(`height`,t.y)),U(n,e.min),n.setAttribute(`viewBox`,[e.min.x,e.min.y,t.x,t.y].join(` `)),this.fire(`update`)}},_initPath:function(e){var t=e._path=qr(`path`);e.options.className&&B(t,e.options.className),e.options.interactive&&B(t,`leaflet-interactive`),this._updateStyle(e),this._layers[o(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){R(e._path),e.removeInteractiveTarget(e._path),delete this._layers[o(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute(`stroke`,n.color),t.setAttribute(`stroke-opacity`,n.opacity),t.setAttribute(`stroke-width`,n.weight),t.setAttribute(`stroke-linecap`,n.lineCap),t.setAttribute(`stroke-linejoin`,n.lineJoin),n.dashArray?t.setAttribute(`stroke-dasharray`,n.dashArray):t.removeAttribute(`stroke-dasharray`),n.dashOffset?t.setAttribute(`stroke-dashoffset`,n.dashOffset):t.removeAttribute(`stroke-dashoffset`)):t.setAttribute(`stroke`,`none`),n.fill?(t.setAttribute(`fill`,n.fillColor||n.color),t.setAttribute(`fill-opacity`,n.fillOpacity),t.setAttribute(`fill-rule`,n.fillRule||`evenodd`)):t.setAttribute(`fill`,`none`))},_updatePoly:function(e,t){this._setPath(e,xe(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||n,i=`a`+n+`,`+r+` 0 1,0 `,a=e._empty()?`M0 0`:`M`+(t.x-n)+`,`+t.y+i+n*2+`,0 `+i+-n*2+`,0 `;this._setPath(e,a)},_setPath:function(e,t){e._path.setAttribute(`d`,t)},_bringToFront:function(e){Et(e._path)},_bringToBack:function(e){z(e._path)}});N.vml&&Jr.include(Kr);function Yr(e){return N.svg||N.vml?new Jr(e):null}q.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||=this._renderer=this._createRenderer(),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if(e===`overlayPane`||e===void 0)return!1;var t=this._paneRenderers[e];return t===void 0&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Wr(e)||Yr(e)}});var Xr=lr.extend({initialize:function(e,t){lr.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=T(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Zr(e,t){return new Xr(e,t)}Jr.create=qr,Jr.pointsToPath=xe,dr.geometryToLayer=fr,dr.coordsToLatLng=mr,dr.coordsToLatLngs=hr,dr.latLngToCoords=gr,dr.latLngsToCoords=_r,dr.getFeature=vr,dr.asFeature=yr,q.mergeOptions({boxZoom:!0});var Qr=bn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on(`unload`,this._destroy,this)},addHooks:function(){W(this._container,`mousedown`,this._onMouseDown,this)},removeHooks:function(){G(this._container,`mousedown`,this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){R(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Pt(),Rt(),this._startPoint=this._map.mouseEventToContainerPoint(e),W(document,{contextmenu:tn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=I(`div`,`leaflet-zoom-box`,this._container),B(this._container,`leaflet-crosshair`),this._map.fire(`boxzoomstart`)),this._point=this._map.mouseEventToContainerPoint(e);var t=new S(this._point,this._startPoint),n=t.getSize();U(this._box,t.min),this._box.style.width=n.x+`px`,this._box.style.height=n.y+`px`},_finish:function(){this._moved&&(R(this._box),V(this._container,`leaflet-crosshair`)),Ft(),zt(),G(document,{contextmenu:tn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var t=new w(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire(`boxzoomend`,{boxZoomBounds:t})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});q.addInitHook(`addHandler`,`boxZoom`,Qr),q.mergeOptions({doubleClickZoom:!0});var $r=bn.extend({addHooks:function(){this._map.on(`dblclick`,this._onDoubleClick,this)},removeHooks:function(){this._map.off(`dblclick`,this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;t.options.doubleClickZoom===`center`?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});q.addInitHook(`addHandler`,`doubleClickZoom`,$r),q.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ei=bn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Cn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on(`predrag`,this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on(`predrag`,this._onPreDragWrap,this),e.on(`zoomend`,this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}B(this._map._container,`leaflet-grab leaflet-touch-drag`),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){V(this._map._container,`leaflet-grab`),V(this._map._container,`leaflet-touch-drag`),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=T(this._map.options.maxBounds);this._offsetLimit=C(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire(`movestart`).fire(`dragstart`),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire(`move`,e).fire(`drag`,e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,a=(r+t+n)%e-t-n,o=Math.abs(i+n)<Math.abs(a+n)?i:a;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=o},_onDragEnd:function(e){var t=this._map,n=t.options,r=!n.inertia||e.noInertia||this._times.length<2;if(t.fire(`dragend`,e),r)t.fire(`moveend`);else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,o=n.easeLinearity,s=i.multiplyBy(o/a),c=s.distanceTo([0,0]),l=Math.min(n.inertiaMaxSpeed,c),u=s.multiplyBy(l/c),d=l/(n.inertiaDeceleration*o),f=u.multiplyBy(-d/2).round();!f.x&&!f.y?t.fire(`moveend`):(f=t._limitOffset(f,t.options.maxBounds),_(function(){t.panBy(f,{duration:d,easeLinearity:o,noMoveStart:!0,animate:!0})}))}}});q.addInitHook(`addHandler`,`dragging`,ei),q.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ti=bn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex=`0`),W(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),G(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,r=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire(`focus`)},_onBlur:function(){this._focused=!1,this._map.fire(`blur`)},_setPanDelta:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;r<i;r++)t[n.left[r]]=[-1*e,0];for(r=0,i=n.right.length;r<i;r++)t[n.right[r]]=[e,0];for(r=0,i=n.down.length;r<i;r++)t[n.down[r]]=[0,e];for(r=0,i=n.up.length;r<i;r++)t[n.up[r]]=[0,-1*e]},_setZoomDelta:function(e){var t=this._zoomKeys={},n=this.keyCodes,r,i;for(r=0,i=n.zoomIn.length;r<i;r++)t[n.zoomIn[r]]=e;for(r=0,i=n.zoomOut.length;r<i;r++)t[n.zoomOut[r]]=-e},_addHooks:function(){W(document,`keydown`,this._onKeyDown,this)},_removeHooks:function(){G(document,`keydown`,this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=e.keyCode,n=this._map,r;if(t in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(r=this._panKeys[t],e.shiftKey&&(r=x(r).multiplyBy(3)),n.options.maxBounds&&(r=n._limitOffset(x(r),n.options.maxBounds)),n.options.worldCopyJump){var i=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(r)));n.panTo(i)}else n.panBy(r)}else if(t in this._zoomKeys)n.setZoom(n.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[t]);else if(t===27&&n._popup&&n._popup.options.closeOnEscapeKey)n.closePopup();else return;tn(e)}}});q.addInitHook(`addHandler`,`keyboard`,ti),q.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ni=bn.extend({addHooks:function(){W(this._map._container,`wheel`,this._onWheelScroll,this),this._delta=0},removeHooks:function(){G(this._map._container,`wheel`,this._onWheelScroll,this)},_onWheelScroll:function(e){var t=on(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||=+new Date;var r=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i(this._performZoom,this),r),tn(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var r=this._delta/(this._map.options.wheelPxPerZoomLevel*4),i=4*Math.log(2/(1+Math.exp(-Math.abs(r))))/Math.LN2,a=n?Math.ceil(i/n)*n:i,o=e._limitZoom(t+(this._delta>0?a:-a))-t;this._delta=0,this._startTime=null,o&&(e.options.scrollWheelZoom===`center`?e.setZoom(t+o):e.setZoomAround(this._lastMousePos,t+o))}});q.addInitHook(`addHandler`,`scrollWheelZoom`,ni);var ri=600;q.mergeOptions({tapHold:N.touchNative&&N.safari&&N.mobile,tapTolerance:15});var ii=bn.extend({addHooks:function(){W(this._map._container,`touchstart`,this._onDown,this)},removeHooks:function(){G(this._map._container,`touchstart`,this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var t=e.touches[0];this._startPos=this._newPos=new b(t.clientX,t.clientY),this._holdTimeout=setTimeout(i(function(){this._cancel(),this._isTapValid()&&(W(document,`touchend`,K),W(document,`touchend touchcancel`,this._cancelClickPrevent),this._simulateEvent(`contextmenu`,t))},this),ri),W(document,`touchend touchcancel contextmenu`,this._cancel,this),W(document,`touchmove`,this._onMove,this)}},_cancelClickPrevent:function e(){G(document,`touchend`,K),G(document,`touchend touchcancel`,e)},_cancel:function(){clearTimeout(this._holdTimeout),G(document,`touchend touchcancel contextmenu`,this._cancel,this),G(document,`touchmove`,this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new b(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});q.addInitHook(`addHandler`,`tapHold`,ii),q.mergeOptions({touchZoom:N.touch,bounceAtZoomLimits:!0});var ai=bn.extend({addHooks:function(){B(this._map._container,`leaflet-touch-zoom`),W(this._map._container,`touchstart`,this._onTouchStart,this)},removeHooks:function(){V(this._map._container,`leaflet-touch-zoom`),G(this._map._container,`touchstart`,this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),t.options.touchZoom!==`center`&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),W(document,`touchmove`,this._onTouchMove,this),W(document,`touchend touchcancel`,this._onTouchEnd,this),K(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),a=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(a,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&a<1||this._zoom>t.getMaxZoom()&&a>1)&&(this._zoom=t._limitZoom(this._zoom)),t.options.touchZoom===`center`){if(this._center=this._startLatLng,a===1)return}else{var o=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(a===1&&o.x===0&&o.y===0)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(o),this._zoom)}this._moved||=(t._moveStart(!0,!1),!0),v(this._animRequest);var s=i(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=_(s,this,!0),K(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,v(this._animRequest),G(document,`touchmove`,this._onTouchMove,this),G(document,`touchend touchcancel`,this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});q.addInitHook(`addHandler`,`touchZoom`,ai),q.BoxZoom=Qr,q.DoubleClickZoom=$r,q.Drag=ei,q.Keyboard=ti,q.ScrollWheelZoom=ni,q.TapHold=ii,q.TouchZoom=ai,e.Bounds=S,e.Browser=N,e.CRS=pe,e.Canvas=Ur,e.Circle=ar,e.CircleMarker=rr,e.Class=le,e.Control=dn,e.DivIcon=Pr,e.DivOverlay=kr,e.DomEvent=cn,e.DomUtil=Kt,e.Draggable=Cn,e.Evented=de,e.FeatureGroup=Zn,e.GeoJSON=dr,e.GridLayer=Ir,e.Handler=bn,e.Icon=$n,e.ImageOverlay=Cr,e.LatLng=E,e.LatLngBounds=w,e.Layer=Y,e.LayerGroup=Yn,e.LineUtil=Hn,e.Map=q,e.Marker=tr,e.Mixin=xn,e.Path=Q,e.Point=b,e.PolyUtil=Dn,e.Polygon=lr,e.Polyline=sr,e.Popup=Ar,e.PosAnimation=ln,e.Projection=Gn,e.Rectangle=Xr,e.Renderer=Hr,e.SVG=Jr,e.SVGOverlay=Dr,e.TileLayer=Rr,e.Tooltip=Mr,e.Transformation=_e,e.Util=ce,e.VideoOverlay=Tr,e.bind=i,e.bounds=C,e.canvas=Wr,e.circle=or,e.circleMarker=ir,e.control=fn,e.divIcon=Fr,e.extend=n,e.featureGroup=Qn,e.geoJSON=xr,e.geoJson=Sr,e.gridLayer=Lr,e.icon=X,e.imageOverlay=wr,e.latLng=D,e.latLngBounds=T,e.layerGroup=Xn,e.map=un,e.marker=nr,e.point=x,e.polygon=ur,e.polyline=cr,e.popup=jr,e.rectangle=Zr,e.setOptions=p,e.stamp=o,e.svg=Yr,e.svgOverlay=Or,e.tileLayer=zr,e.tooltip=Nr,e.transformation=O,e.version=t,e.videoOverlay=Er;var oi=window.L;e.noConflict=function(){return window.L=oi,this},window.L=e}))})),wi=D(((e,t)=>{((n,r)=>{typeof define==`function`&&define.amd?define([`leaflet`],n):typeof e==`object`&&(t.exports=n(Ci())),r!==void 0&&r.L&&n(r.L)})(e=>{e.Editable=e.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:e.Polygon,polylineClass:e.Polyline,markerClass:e.Marker,circleMarkerClass:e.CircleMarker,rectangleClass:e.Rectangle,circleClass:e.Circle,drawingCSSClass:`leaflet-editable-drawing`,drawingCursor:`crosshair`,editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,circleMarkerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(t,n){e.setOptions(this,n),this._lastZIndex=this.options.zIndex,this.map=t,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(e,t){t||={},t.editTools=this,this.fire(e,t),this.map.fire(e,t)},createLineGuide:function(){let t=e.extend({dashArray:`5,10`,weight:1,interactive:!1},this.options.lineGuideOptions);return e.polyline([],t)},createVertexIcon:t=>e.Browser.mobile&&e.Browser.touch?new e.Editable.TouchVertexIcon(t):new e.Editable.VertexIcon(t),createEditLayer:function(){return this.options.editLayer||new e.LayerGroup().addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||new e.LayerGroup().addTo(this.map)},moveForwardLineGuide:function(e){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=e,this.forwardLineGuide._bounds.extend(e),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(e){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=e,this.backwardLineGuide._bounds.extend(e),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(e){this.forwardLineGuide._latlngs[0]=e,this.forwardLineGuide._bounds.extend(e),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(e){this.backwardLineGuide._latlngs[0]=e,this.backwardLineGuide._bounds.extend(e),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=e.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(t){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),t.reset(),this._drawingEditor=t,this.map.on(`mousemove touchmove`,t.onDrawingMouseMove,t),this.map.on(`mousedown`,this.onMousedown,this),this.map.on(`mouseup`,this.onMouseup,this),e.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(t){this.unblockEvents(),e.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,t||=this._drawingEditor,t&&(this.map.off(`mousemove touchmove`,t.onDrawingMouseMove,t),this.map.off(`mousedown`,this.onMousedown,this),this.map.off(`mouseup`,this.onMouseup,this),t===this._drawingEditor&&(delete this._drawingEditor,t._drawing&&t.cancelDrawing()))},onMousedown:function(e){e.originalEvent.which==1&&(this._mouseDown=e,this._drawingEditor.onDrawingMouseDown(e))},onMouseup:function(t){if(this._mouseDown){let n=this._drawingEditor,r=this._mouseDown;if(this._mouseDown=null,n.onDrawingMouseUp(t),this._drawingEditor!==n)return;let i=e.point(r.originalEvent.clientX,r.originalEvent.clientY),a=e.point(t.originalEvent.clientX,t.originalEvent.clientY).distanceTo(i);Math.abs(a)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(t)}},drawing:function(){return this._drawingEditor?.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(e){this._drawingEditor&&this._drawingEditor.commitDrawing(e)},connectCreatedToMap:function(e){return this.featuresLayer.addLayer(e)},startPolyline:function(e,t){let n=this.createPolyline([],t);return n.enableEdit(this.map).newShape(e),n},startPolygon:function(e,t){let n=this.createPolygon([],t);return n.enableEdit(this.map).newShape(e),n},startMarker:function(e,t){e||=this.map.getCenter().clone();let n=this.createMarker(e,t);return n.enableEdit(this.map).startDrawing(),n},startCircleMarker:function(e,t){e||=this.map.getCenter().clone();let n=this.createCircleMarker(e,t);return n.enableEdit(this.map).startDrawing(),n},startRectangle:function(t,n){let r=t||e.latLng([0,0]),i=new e.LatLngBounds(r,r),a=this.createRectangle(i,n);return a.enableEdit(this.map).startDrawing(),a},startCircle:function(e,t){e||=this.map.getCenter().clone();let n=this.createCircle(e,t);return n.enableEdit(this.map).startDrawing(),n},startHole:(e,t)=>{e.newHole(t)},createLayer:function(t,n,r){r=e.Util.extend({editOptions:{editTools:this}},r);let i=new t(n,r);return this.fireAndForward(`editable:created`,{layer:i}),i},createPolyline:function(e,t){return this.createLayer(t?.polylineClass||this.options.polylineClass,e,t)},createPolygon:function(e,t){return this.createLayer(t?.polygonClass||this.options.polygonClass,e,t)},createMarker:function(e,t){return this.createLayer(t?.markerClass||this.options.markerClass,e,t)},createCircleMarker:function(e,t){return this.createLayer(t?.circleMarkerClass||this.options.circleMarkerClass,e,t)},createRectangle:function(e,t){return this.createLayer(t?.rectangleClass||this.options.rectangleClass,e,t)},createCircle:function(e,t){return this.createLayer(t?.circleClass||this.options.circleClass,e,t)}}),e.extend(e.Editable,{makeCancellable:e=>{e.cancel=()=>{e._cancelled=!0}}}),e.Map.mergeOptions({editToolsClass:e.Editable,editable:!1,editOptions:{}}),e.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),e.Editable.VertexIcon=e.DivIcon.extend({options:{iconSize:new e.Point(8,8)}}),e.Editable.TouchVertexIcon=e.Editable.VertexIcon.extend({options:{iconSize:new e.Point(20,20)}}),e.Editable.VertexMarker=e.Marker.extend({options:{draggable:!0,className:`leaflet-div-icon leaflet-vertex-icon`},initialize:function(t,n,r,i){this.latlng=t,this.latlngs=n,this.editor=r,e.Marker.prototype.initialize.call(this,t,i),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.connect(),this.setZIndexOffset(r.tools._lastZIndex+1)},connect:function(){this.editor.editLayer.addLayer(this)},onAdd:function(t){e.Marker.prototype.onAdd.call(this,t),this.on(`drag`,this.onDrag),this.on(`dragstart`,this.onDragStart),this.on(`dragend`,this.onDragEnd),this.on(`mouseup`,this.onMouseup),this.on(`click`,this.onClick),this.on(`contextmenu`,this.onContextMenu),this.on(`mousedown touchstart`,this.onMouseDown),this.on(`mouseover`,this.onMouseOver),this.on(`mouseout`,this.onMouseOut),this.addMiddleMarkers()},onRemove:function(t){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off(`drag`,this.onDrag),this.off(`dragstart`,this.onDragStart),this.off(`dragend`,this.onDragEnd),this.off(`mouseup`,this.onMouseup),this.off(`click`,this.onClick),this.off(`contextmenu`,this.onContextMenu),this.off(`mousedown touchstart`,this.onMouseDown),this.off(`mouseover`,this.onMouseOver),this.off(`mouseout`,this.onMouseOut),e.Marker.prototype.onRemove.call(this,t)},onDrag:function(t){t.vertex=this,this.editor.onVertexMarkerDrag(t);let n=e.DomUtil.getPosition(this._icon),r=this._map.layerPointToLatLng(n);this.latlng.update(r),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();let i=this.getNext();i?.middleMarker&&i.middleMarker.updateLatLng()},onDragStart:function(e){e.vertex=this,this.editor.onVertexMarkerDragStart(e)},onDragEnd:function(e){e.vertex=this,this.editor.onVertexMarkerDragEnd(e)},onClick:function(e){e.vertex=this,this.editor.onVertexMarkerClick(e)},onMouseup:function(t){e.DomEvent.stop(t),t.vertex=this,this.editor.map.fire(`mouseup`,t)},onContextMenu:function(e){e.vertex=this,this.editor.onVertexMarkerContextMenu(e)},onMouseDown:function(e){e.vertex=this,this.editor.onVertexMarkerMouseDown(e)},onMouseOver:function(e){e.vertex=this,this.editor.onVertexMarkerMouseOver(e)},onMouseOut:function(e){e.vertex=this,this.editor.onVertexMarkerMouseOut(e)},delete:function(){let e=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),e&&e.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(this.latlngs.length<2)return;let e=this.getIndex(),t=e-1;e===0&&this.editor.CLOSED&&(t=this.getLastIndex());let n=this.latlngs[t];if(n)return n.__vertex},getNext:function(){if(this.latlngs.length<2)return;let e=this.getIndex(),t=e+1;e===this.getLastIndex()&&this.editor.CLOSED&&(t=0);let n=this.latlngs[t];if(n)return n.__vertex},addMiddleMarker:function(e){this.editor.hasMiddleMarkers()&&(e||=this.getPrevious(),e&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(e,this,this.latlngs,this.editor)))},addMiddleMarkers:function(){if(!this.editor.hasMiddleMarkers())return;let e=this.getPrevious();e&&this.addMiddleMarker(e);let t=this.getNext();t&&t.resetMiddleMarker()},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(!this.editor.continueBackward)return;let e=this.getIndex();e===0?this.editor.continueBackward(this.latlngs):e===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}),e.Editable.mergeOptions({vertexMarkerClass:e.Editable.VertexMarker}),e.Editable.MiddleMarker=e.Marker.extend({options:{opacity:.5,className:`leaflet-div-icon leaflet-middle-icon`,draggable:!0},initialize:function(t,n,r,i,a){this.left=t,this.right=n,this.editor=i,this.latlngs=r,e.Marker.prototype.initialize.call(this,this.computeLatLng(),a),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){let t=this._map.latLngToContainerPoint(this.left.latlng),n=this._map.latLngToContainerPoint(this.right.latlng),r=e.point(this.options.icon.options.iconSize);t.distanceTo(n)<r.x*3?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){let e=this.editor.map.latLngToContainerPoint(this.left.latlng),t=this.editor.map.latLngToContainerPoint(this.right.latlng),n=(e.y+t.y)/2,r=(e.x+t.x)/2;return this.editor.map.containerPointToLatLng([r,n])},onAdd:function(t){e.Marker.prototype.onAdd.call(this,t),e.DomEvent.on(this._icon,`mousedown touchstart`,this.onMouseDown,this),t.on(`zoomend`,this.setVisibility,this)},onRemove:function(t){delete this.right.middleMarker,e.DomEvent.off(this._icon,`mousedown touchstart`,this.onMouseDown,this),t.off(`zoomend`,this.setVisibility,this),e.Marker.prototype.onRemove.call(this,t)},onMouseDown:function(t){let n=e.DomUtil.getPosition(this._icon),r=this.editor.map.layerPointToLatLng(n);if(t={originalEvent:t,latlng:r},this.options.opacity===0||(e.Editable.makeCancellable(t),this.editor.onMiddleMarkerMouseDown(t),t._cancelled))return;this.latlngs.splice(this.index(),0,t.latlng),this.editor.refresh();let i=this._icon,a=this.editor.addVertexMarker(t.latlng,this.latlngs);this.editor.onNewVertex(a);let o=a._icon.parentNode;o.removeChild(a._icon),a._icon=i,o.appendChild(a._icon),a._initIcon(),a._initInteraction(),a.setOpacity(1),e.Draggable._dragging=!1,a.dragging._draggable._onDown(t.originalEvent),this.delete()},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),e.Editable.mergeOptions({middleMarkerClass:e.Editable.MiddleMarker}),e.Editable.BaseEditor=e.Handler.extend({initialize:function(t,n,r){e.setOptions(this,r),this.map=t,this.feature=n,this.feature.editor=this,this.editLayer=new e.LayerGroup,this.tools=this.options.editTools||t.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once(`add`,this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:()=>{},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.options.draggable!=0&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(e,t){t||={},t.layer=this.feature,this.feature.fire(e,t),this.tools.fireAndForward(e,t)},onEnable:function(){this.fireAndForward(`editable:enable`)},onDisable:function(){this.fireAndForward(`editable:disable`)},onEditing:function(){this.fireAndForward(`editable:editing`)},onEdited:function(){this.fireAndForward(`editable:edited`)},onStartDrawing:function(){this.fireAndForward(`editable:drawing:start`)},onEndDrawing:function(){this.fireAndForward(`editable:drawing:end`)},onCancelDrawing:function(){this.fireAndForward(`editable:drawing:cancel`)},onCommitDrawing:function(e){this.fireAndForward(`editable:drawing:commit`,e),this.onEdited()},onDrawingMouseDown:function(e){this.fireAndForward(`editable:drawing:mousedown`,e)},onDrawingMouseUp:function(e){this.fireAndForward(`editable:drawing:mouseup`,e)},startDrawing:function(){this._drawing||=e.Editable.FORWARD,this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(e){this.onCommitDrawing(e),this.endDrawing()},cancelDrawing:function(){e.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(t){this.drawing()&&(e.Editable.makeCancellable(t),this.fireAndForward(`editable:drawing:click`,t),!t._cancelled&&(this.isConnected()||this.connect(t),this.processDrawingClick(t)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(e){this.fireAndForward(`editable:drawing:move`,e)},onDrawingMouseMove:function(e){this.onMove(e)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(e){this.onEditing(),this.fireAndForward(`editable:dragstart`,e)},onDrag:function(e){this.onMove(e),this.fireAndForward(`editable:drag`,e)},onDragEnd:function(e){this.fireAndForward(`editable:dragend`,e),this.onEdited()}}),e.Editable.MarkerEditor=e.Editable.BaseEditor.extend({onDrawingMouseMove:function(t){e.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&this.feature.setLatLng(t.latlng)},processDrawingClick:function(e){this.fireAndForward(`editable:drawing:clicked`,e),this.commitDrawing(e)},connect:function(t){t&&(this.feature._latlng=t.latlng),e.Editable.BaseEditor.prototype.connect.call(this,t)}}),e.Editable.CircleMarkerEditor=e.Editable.BaseEditor.extend({onDrawingMouseMove:function(t){e.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&this.feature.setLatLng(t.latlng)},processDrawingClick:function(e){this.fireAndForward(`editable:drawing:clicked`,e),this.commitDrawing(e)},connect:function(t){t&&(this.feature._latlng=t.latlng),e.Editable.BaseEditor.prototype.connect.call(this,t)}}),e.Editable.PathEditor=e.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return e.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&(this.initVertexMarkers(),this.map.on(`moveend`,this.onMoveEnd,this)),this},removeHooks:function(){e.Editable.BaseEditor.prototype.removeHooks.call(this),this.feature&&this.map.off(`moveend`,this.onMoveEnd,this)},onMoveEnd:function(){this.initVertexMarkers()},initVertexMarkers:function(e){if(this.enabled())if(e||=this.getLatLngs(),l(e))this.addVertexMarkers(e);else for(let t of e)this.initVertexMarkers(t)},getLatLngs:function(){return this.feature.getLatLngs()},reset:function(){this.editLayer.clearLayers(),this.initVertexMarkers()},addVertexMarker:function(e,t){return e.__vertex?(e.__vertex.connect(),e.__vertex):new this.tools.options.vertexMarkerClass(e,t,this)},onNewVertex:function(e){this.fireAndForward(`editable:vertex:new`,{latlng:e.latlng,vertex:e})},addVertexMarkers:function(e){let t=this.map.getBounds();for(let n of e)t.contains(n)&&this.addVertexMarker(n,e)},refreshVertexMarkers:function(e){e||=this.getDefaultLatLngs();for(let t of e)t.__vertex.update()},addMiddleMarker:function(e,t,n){return new this.tools.options.middleMarkerClass(e,t,n,this)},onVertexMarkerClick:function(t){if(e.Editable.makeCancellable(t),this.fireAndForward(`editable:vertex:click`,t),t._cancelled||this.tools.drawing()&&this.tools._drawingEditor!==this)return;let n=t.vertex.getIndex(),r;t.originalEvent.ctrlKey?this.onVertexMarkerCtrlClick(t):t.originalEvent.altKey?this.onVertexMarkerAltClick(t):t.originalEvent.shiftKey?this.onVertexMarkerShiftClick(t):t.originalEvent.metaKey?this.onVertexMarkerMetaKeyClick(t):n===t.vertex.getLastIndex()&&this._drawing===e.Editable.FORWARD?n>=this.MIN_VERTEX-1&&(r=!0):n===0&&this._drawing===e.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||n===0&&this._drawing===e.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?r=!0:this.onVertexRawMarkerClick(t),this.fireAndForward(`editable:vertex:clicked`,t),r&&this.commitDrawing(t)},onVertexRawMarkerClick:function(e){this.fireAndForward(`editable:vertex:rawclick`,e),!e._cancelled&&this.vertexCanBeDeleted(e.vertex)&&e.vertex.delete()},vertexCanBeDeleted:function(e){return e.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(e){this.fireAndForward(`editable:vertex:deleted`,e),this.onEdited()},onVertexMarkerCtrlClick:function(e){this.fireAndForward(`editable:vertex:ctrlclick`,e)},onVertexMarkerShiftClick:function(e){this.fireAndForward(`editable:vertex:shiftclick`,e)},onVertexMarkerMetaKeyClick:function(e){this.fireAndForward(`editable:vertex:metakeyclick`,e)},onVertexMarkerAltClick:function(e){this.fireAndForward(`editable:vertex:altclick`,e)},onVertexMarkerContextMenu:function(e){this.fireAndForward(`editable:vertex:contextmenu`,e)},onVertexMarkerMouseDown:function(e){this.fireAndForward(`editable:vertex:mousedown`,e)},onVertexMarkerMouseOver:function(e){this.fireAndForward(`editable:vertex:mouseover`,e)},onVertexMarkerMouseOut:function(e){this.fireAndForward(`editable:vertex:mouseout`,e)},onMiddleMarkerMouseDown:function(e){this.fireAndForward(`editable:middlemarker:mousedown`,e)},onVertexMarkerDrag:function(e){this.onMove(e),this.feature._bounds&&this.extendBounds(e),this.fireAndForward(`editable:vertex:drag`,e)},onVertexMarkerDragStart:function(e){this.fireAndForward(`editable:vertex:dragstart`,e)},onVertexMarkerDragEnd:function(e){this.fireAndForward(`editable:vertex:dragend`,e),this.onEdited()},setDrawnLatLngs:function(e){this._drawnLatLngs=e||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),e.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length<this.MIN_VERTEX&&this.deleteShape(this._drawnLatLngs),e.Editable.BaseEditor.prototype.endDrawing.call(this),delete this._drawnLatLngs},addLatLng:function(t){this._drawing===e.Editable.FORWARD?this._drawnLatLngs.push(t):this._drawnLatLngs.unshift(t),this.feature._bounds.extend(t);let n=this.addVertexMarker(t,this._drawnLatLngs);this.onNewVertex(n),this.refresh()},newPointForward:function(e){this.addLatLng(e),this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(e)},newPointBackward:function(e){this.addLatLng(e),this.tools.anchorBackwardLineGuide(e)},push:function(t){if(!t)return console.error(`L.Editable.PathEditor.push expect a valid latlng as parameter`);this._drawing===e.Editable.FORWARD?this.newPointForward(t):this.newPointBackward(t)},removeLatLng:function(e){e.__vertex.delete(),this.refresh()},pop:function(){if(this._drawnLatLngs.length<=1)return;let t;return t=this._drawing===e.Editable.FORWARD?this._drawnLatLngs[this._drawnLatLngs.length-1]:this._drawnLatLngs[0],this.removeLatLng(t),this._drawing===e.Editable.FORWARD?this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length-1]):this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]),t},processDrawingClick:function(t){t.vertex&&t.vertex.editor===this||(this._drawing===e.Editable.FORWARD?this.newPointForward(t.latlng):this.newPointBackward(t.latlng),this.fireAndForward(`editable:drawing:clicked`,t))},onDrawingMouseMove:function(t){e.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&(this.tools.moveForwardLineGuide(t.latlng),this.tools.moveBackwardLineGuide(t.latlng))},refresh:function(){this.feature.redraw(),this.onEditing()},newShape:function(e){let t=this.addNewEmptyShape();t&&(this.setDrawnLatLngs(t[0]||t),this.startDrawingForward(),this.fireAndForward(`editable:shape:new`,{shape:t}),e&&this.newPointForward(e))},deleteShape:function(t,n){let r={shape:t};if(e.Editable.makeCancellable(r),this.fireAndForward(`editable:shape:delete`,r),!r._cancelled)return t=this._deleteShape(t,n),this.ensureNotFlat&&this.ensureNotFlat(),this.feature.setLatLngs(this.getLatLngs()),this.refresh(),this.reset(),this.fireAndForward(`editable:shape:deleted`,{shape:t}),this.onEdited(),t},_deleteShape:function(e,t){if(t||=this.getLatLngs(),!t.length)return;let n=(e,t)=>e.splice(0,Number.MAX_VALUE),r=(e,t)=>(e.splice(e.indexOf(t),1),e.length||this._deleteShape(e),t);if(t===e)return n(t,e);for(let n of t){if(n===e)return r(t,e);if(n.indexOf(e)!==-1)return r(n,e)}},deleteShapeAt:function(e){let t=this.feature.shapeAt(e);if(t)return this.deleteShape(t)},appendShape:function(e){this.insertShape(e)},prependShape:function(e){this.insertShape(e,0)},insertShape:function(e,t){this.ensureMulti(),e=this.formatShape(e),t===void 0&&(t=this.feature._latlngs.length),this.feature._latlngs.splice(t,0,e),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(e){this.feature._bounds.extend(e.vertex.latlng)},onDragStart:function(t){this.editLayer.clearLayers(),e.Editable.BaseEditor.prototype.onDragStart.call(this,t)},onDragEnd:function(t){this.initVertexMarkers(),e.Editable.BaseEditor.prototype.onDragEnd.call(this,t)}}),e.Editable.PolylineEditor=e.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=e.Editable.BACKWARD,this.startDrawing()},continueBackward:function(e){this.drawing()||(e||=this.getDefaultLatLngs(),this.setDrawnLatLngs(e),e.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(e[0])),this.startDrawingBackward())},continueForward:function(e){this.drawing()||(e||=this.getDefaultLatLngs(),this.setDrawnLatLngs(e),e.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(e[e.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(t){return t||=this.feature._latlngs,!t.length||t[0]instanceof e.LatLng?t:this.getDefaultLatLngs(t[0])},ensureMulti:function(){this.feature._latlngs.length&&l(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){let e=[];return this.appendShape(e),e}return this.feature._latlngs},formatShape:function(e){if(l(e))return e;if(e[0])return this.formatShape(e[0])},splitShape:function(t,n){if(!n||n>=t.length-1)return;this.ensureMulti();let r=this.feature._latlngs.indexOf(t);if(r===-1)return;let i=t.slice(0,n+1),a=t.slice(n);a[0]=e.latLng(a[0].lat,a[0].lng,a[0].alt),this.feature._latlngs.splice(r,1,i,a),this.refresh(),this.reset(),this.onEdited()}}),e.Editable.PolygonEditor=e.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(t){e.Editable.PathEditor.prototype.newPointForward.call(this,t),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(t),this._drawnLatLngs.length===2&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(e){this.ensureNotFlat();let t=this.feature.shapeAt(e);if(!t)return;let n=[];return t.push(n),n},newHole:function(e){let t=this.addNewEmptyHole(e);t&&(this.setDrawnLatLngs(t),this.startDrawingForward(),e&&this.newPointForward(e))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){let e=[];return this.appendShape(e),e}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&l(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){(!this.feature._latlngs.length||l(this.feature._latlngs))&&(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(t){let n=this.feature.parentShape(t.latlngs);return e.Util.indexOf(n,t.latlngs)>0||e.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,t)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:e=>l(e)&&(!e[0]||e[0].length!==0)?[e]:e}),e.Editable.RectangleEditor=e.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(t){let n=t.vertex.getIndex(),r=t.vertex.getNext(),i=t.vertex.getPrevious(),a=(n+2)%4,o=t.vertex.latlngs[a],s=new e.LatLngBounds(t.latlng,o);i.latlng.update([t.latlng.lat,o.lng]),r.latlng.update([o.lat,t.latlng.lng]),this.updateBounds(s),this.refreshVertexMarkers()},onDrawingMouseDown:function(t){e.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,t),this.connect();let n=this.getDefaultLatLngs();n.length===3&&n.push(t.latlng);let r=new e.LatLngBounds(t.latlng,t.latlng);this.updateBounds(r),this.updateLatLngs(r),this.refresh(),this.reset(),t.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(t.originalEvent),n[3].__vertex.dragging._draggable._onDown(t.originalEvent)},onDrawingMouseUp:function(t){this.commitDrawing(t),t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,t)},onDrawingMouseMove:function(t){t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,t)},getDefaultLatLngs:function(e){return e||this.feature._latlngs[0]},updateBounds:function(e){this.feature._bounds=e},updateLatLngs:function(e){let t=this.getDefaultLatLngs(),n=this.feature._boundsToLatLngs(e);for(let e=0;e<t.length;e++)t[e].update(n[e])}}),e.Editable.CircleEditor=e.Editable.PathEditor.extend({MIN_VERTEX:2,options:{skipMiddleMarkers:!0},initialize:function(t,n,r){e.Editable.PathEditor.prototype.initialize.call(this,t,n,r),this._resizeLatLng=this.computeResizeLatLng()},computeResizeLatLng:function(){let e=(this.feature._radius||this.feature._mRadius)*Math.cos(Math.PI/4),t=this.map.project(this.feature._latlng);return this.map.unproject([t.x+e,t.y-e])},updateResizeLatLng:function(){this._resizeLatLng.update(this.computeResizeLatLng()),this._resizeLatLng.__vertex.update()},getLatLngs:function(){return[this.feature._latlng,this._resizeLatLng]},getDefaultLatLngs:function(){return this.getLatLngs()},onVertexMarkerDrag:function(t){t.vertex.getIndex()===1?this.resize(t):this.updateResizeLatLng(t),e.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this,t)},resize:function(e){let t;t=this.map.options.crs?this.map.options.crs.distance(this.feature._latlng,e.latlng):this.feature._latlng.distanceTo(e.latlng),this.feature.setRadius(t)},onDrawingMouseDown:function(t){e.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,t),this._resizeLatLng.update(t.latlng),this.feature._latlng.update(t.latlng),this.connect(),t.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(t.originalEvent),this._resizeLatLng.__vertex.dragging._draggable._onDown(t.originalEvent)},onDrawingMouseUp:function(t){this.commitDrawing(t),t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,t)},onDrawingMouseMove:function(t){t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,t)},onDrag:function(t){e.Editable.PathEditor.prototype.onDrag.call(this,t),this.feature.dragging.updateLatLng(this._resizeLatLng)}});let t={createEditor:function(e){e||=this._map;let t=this.options.editOptions?.editTools||e.editTools;if(!t)throw Error(`Unable to detect Editable instance.`);return new(this.options.editorClass||(this.getEditorClass(t)))(e,this,this.options.editOptions)},enableEdit:function(e){return this.editor||this.createEditor(e),this.editor.enable(),this.editor},editEnabled:function(){return this.editor?.enabled()},disableEdit:function(){this.editor&&(this.editor.disable(),delete this.editor)},toggleEdit:function(){this.editEnabled()?this.disableEdit():this.enableEdit()},_onEditableAdd:function(){this.editor&&this.enableEdit()}},n={getEditorClass:t=>t?.options?.polylineEditorClass||e.Editable.PolylineEditor,shapeAt:function(e,t){let n=null;if(t||=this._latlngs,!t.length)return n;if(l(t)&&this.isInLatLngs(e,t))n=t;else for(let n of t)if(this.isInLatLngs(e,n))return n;return n},isInLatLngs:function(t,n){if(!n)return!1;let r,i,a,o=[],s,c=this._clickTolerance();if(this._projectLatlngs(n,o,this._pxBounds),o=o[0],s=this._map.latLngToLayerPoint(t),!this._pxBounds.contains(s))return!1;for(r=1,a=o.length,i=0;r<a;i=r++)if(e.LineUtil.pointToSegmentDistance(s,o[i],o[r])<=c)return!0;return!1}},r={getEditorClass:t=>t?.options?.polygonEditorClass||e.Editable.PolygonEditor,shapeAt:function(e,t){let n=null;if(t||=this._latlngs,!t.length)return n;if(l(t)&&this.isInLatLngs(e,t)&&(n=t),l(t[0])&&this.isInLatLngs(e,t[0]))n=t;else for(let n of t)if(this.isInLatLngs(e,n[0]))return n;return n},isInLatLngs:(e,t)=>{let n=!1,r,i,a,o,s;for(a=0,s=t.length,o=s-1;a<s;o=a++)r=t[a],i=t[o],r.lat>e.lat!=i.lat>e.lat&&e.lng<(i.lng-r.lng)*(e.lat-r.lat)/(i.lat-r.lat)+r.lng&&(n=!n);return n},parentShape:function(t,n){if(n||=this._latlngs,!n)return;let r=e.Util.indexOf(n,t);if(r!==-1)return n;for(let i of n)if(r=e.Util.indexOf(i,t),r!==-1)return i}},i={getEditorClass:t=>t?.options?.markerEditorClass||e.Editable.MarkerEditor},a={getEditorClass:t=>t?.options?.circleMarkerEditorClass||e.Editable.CircleMarkerEditor},o={getEditorClass:t=>t?.options?.rectangleEditorClass||e.Editable.RectangleEditor},s={getEditorClass:t=>t?.options?.circleEditorClass||e.Editable.CircleEditor},c=function(){this.on(`add`,this._onEditableAdd)},l=e.LineUtil.isFlat||e.LineUtil._flat||e.Polyline._flat;e.Polyline&&(e.Polyline.include(t),e.Polyline.include(n),e.Polyline.addInitHook(c)),e.Polygon&&(e.Polygon.include(t),e.Polygon.include(r)),e.Marker&&(e.Marker.include(t),e.Marker.include(i),e.Marker.addInitHook(c)),e.CircleMarker&&(e.CircleMarker.include(t),e.CircleMarker.include(a),e.CircleMarker.addInitHook(c)),e.Rectangle&&(e.Rectangle.include(t),e.Rectangle.include(o)),e.Circle&&(e.Circle.include(t),e.Circle.include(s)),e.LatLng.prototype.update=function(t){t=e.latLng(t),this.lat=t.lat,this.lng=t.lng}},window)})),$=de(Ci(),1);wi();var Ti=`/* required styles */\r
|
|
12
|
+
`);this.styleElement||(this.styleElement=document.createElement(`style`),this.prepend(this.styleElement)),this.styleElement.textContent=t}serialize(e=`text/turtle`,r){return this.assertNotQueryMode(`serialize`),r??=this.toRDF(),n(r.getQuads(null,null,null,null),e,t)}toRDF(e=new we){this.assertNotQueryMode(`toRDF`);let t;return this.config.attributes.preserveUnmappedValues!==null&&(t=this.preparePreservedOutput(e)),this.shape?.toRDF(e,void 0,this.config.attributes.generateNodeShapeReference),t?.size&&this.pruneOrphanedBlankNodes(e,t),e}preparePreservedOutput(e){let t=this.config.originalValues,n=new Map;e.addQuads(t.getQuads(null,null,null,null));for(let r of this.form.querySelectorAll(`shacl-property`))if(!r.parent.linked){for(let i of r.template.pathAlternatives??[r.template.path])if(i)for(let a of t.getQuads(r.parent.nodeId,i,null,null))e.delete(a),a.object.termType===`BlankNode`&&n.set(a.object.id,a.object)}for(let n of this.form.querySelectorAll(`shacl-node:not([part~="linked-node"])`))if(n.template.targetClass)for(let r of t.getQuads(n.nodeId,ye,n.template.targetClass,null))e.delete(r);let r=this.config.attributes.generateNodeShapeReference;if(this.shape&&r)for(let n of t.getQuads(this.shape.nodeId,y.namedNode(r),this.shape.template.id,null))e.delete(n);return n}pruneOrphanedBlankNodes(e,t){let n=new Map(t),r=[...t.values()];for(;r.length;){let t=r.pop();for(let i of e.getQuads(t,null,null,null))i.object.termType===`BlankNode`&&!n.has(i.object.id)&&(n.set(i.object.id,i.object),r.push(i.object))}let i=new Set,a=[],o=e=>{i.has(e.id)||(i.add(e.id),a.push(e))};for(let e of this.form.querySelectorAll(`shacl-node:not([part~="linked-node"])`))e.nodeId.termType===`BlankNode`&&n.has(e.nodeId.id)&&o(e.nodeId);for(let t of n.values())e.getQuads(null,null,t,null).some(e=>e.subject.termType!==`BlankNode`||!n.has(e.subject.id))&&o(t);for(;a.length;){let t=a.pop();for(let r of e.getQuads(t,null,null,null))r.object.termType===`BlankNode`&&n.has(r.object.id)&&o(r.object)}for(let t of n.values())if(!i.has(t.id))for(let n of e.getQuads(t,null,null,null))e.delete(n)}registerPlugin(e){m(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}setRdfUrlResolver(e){this.config.rdfUrlResolver=e,this.initialize()}setResourceLinkProvider(e){this.config.resourceLinkProvider=e,this.initialize()}setQueryFacetProvider(e){this.config.queryFacetProvider=e,this.queryController?.refreshFacets()}getQuery(){return this.shape?this.queryController?.getQuery()??{rootShapeId:this.shape.template.id.value,targetClass:this.shape.template.targetClass?.value,criteria:[]}:{rootShapeId:``,criteria:[]}}refreshQueryFacets(){this.queryController?.refreshFacets()}async validate(e=!1){this.assertNotQueryMode(`validate`);let t=++this.validationGeneration;for(let e of this.form.querySelectorAll(`:scope .validation-error`))e.remove();for(let t of this.form.querySelectorAll(`:scope .property-instance`)){let n=t.querySelector(`:scope > .editor`),r=!!n?.value,i=n?.validity?.valid===!1&&(r||!e);t.classList.toggle(`invalid`,i),r&&!i?t.classList.add(`valid`):t.classList.remove(`valid`),i&&n?.validationMessage&&this.appendValidationErrorDisplay(t,n.validationMessage)}for(let e of this.form.querySelectorAll(`.add-button-wrapper`))e.classList.remove(`invalid`,`validation-error`);if(!this.shape)return{conforms:!0,results:[]};if(!e){let e=this.form.querySelectorAll(`.add-button-wrapper.required`);for(let t of e)t.classList.add(`invalid`),t.after(this.createValidationErrorDisplay(`Value is required`,`node`));if(e.length>0)return{conforms:!1,results:[]}}let n=this.shape,r=()=>new Promise(r=>{this.config.store.deleteGraph(this.config.valuesGraphId||``).on(`end`,async()=>{n.toRDF(this.config.store,void 0,this.config.attributes.generateNodeShapeReference);try{let i=await this.config.validator.validate({dataset:this.config.store,terms:[n.nodeId]},[{terms:[n.template.id]}]);if(t!==this.validationGeneration){r(i);return}let a=[...i.results];for(let t=0;t<a.length;t++){let n=a[t];if(a.push(...n.results??[]),n.focusNode?.ptrs?.length)for(let t of n.focusNode.ptrs){let r=t._term;if(n.path?.length){let t=n.path[0].predicates[0],i=e=>`
|
|
13
|
+
:scope shacl-node[data-node-id='${r.id}'] > shacl-property > .property-instance[${e}='${t.id}'] > .editor,
|
|
14
|
+
:scope shacl-node[data-node-id='${r.id}'] > shacl-property > .shacl-group > .property-instance[${e}='${t.id}'] > .editor,
|
|
15
|
+
:scope shacl-node[data-node-id='${r.id}'] > .shacl-group > shacl-property > .property-instance[${e}='${t.id}'] > .editor,
|
|
16
|
+
:scope shacl-node[data-node-id='${r.id}'] > .shacl-group > shacl-property > .shacl-group > .property-instance[${e}='${t.id}'] > .editor`,a=this.form.querySelectorAll(i(`data-path`));a.length===0&&(a=this.form.querySelectorAll(i(`data-predicate`))),a.length===0&&(a=this.form.querySelectorAll(`
|
|
17
|
+
:scope [data-node-id='${r.id}'] > shacl-property > .property-instance[data-path='${t.id}'],
|
|
18
|
+
:scope [data-node-id='${r.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${t.id}'],
|
|
19
|
+
:scope [data-node-id='${r.id}'] > shacl-property > .alternative-path-constraint[data-path='${t.id}'],
|
|
20
|
+
:scope [data-node-id='${r.id}'] > shacl-property > .shacl-group > .alternative-path-constraint[data-path='${t.id}']`)),a.length===0&&(a=this.form.querySelectorAll(`
|
|
21
|
+
:scope [data-node-id='${r.id}'] > shacl-property > .property-instance[data-predicate='${t.id}'],
|
|
22
|
+
:scope [data-node-id='${r.id}'] > shacl-property > .shacl-group > .property-instance[data-predicate='${t.id}']`));for(let t of a)if(t.classList.contains(`editor`)){if(!e||t.value){let e=t.parentElement;e.classList.add(`invalid`),e.classList.remove(`valid`),this.appendValidationErrorDisplay(e,n);do e instanceof de&&(e.open=!0),e=e.parentElement;while(e)}}else e||(t.classList.add(`invalid`),t.classList.remove(`valid`),t.appendChild(this.createValidationErrorDisplay(n,`node`)))}else e||this.form.querySelector(`:scope [data-node-id='${r.id}']:not([part~='linked-node'])`)?.prepend(this.createValidationErrorDisplay(n,`node`))}}r(i)}catch(e){console.error(e),r({conforms:!1,results:[]})}})}),i=this.validationQueue.then(r,r);return this.validationQueue=i.then(()=>void 0,()=>void 0),i}assertNotQueryMode(e){if(this.config.queryMode)throw Error(`${e}() is not available in query mode; use getQuery()`)}refreshClassInstanceEditors(){if(!(!this.shape||!this.config.editMode))for(let e of this.form.querySelectorAll(`shacl-property`))e.refreshClassInstances()}appendValidationErrorDisplay(e,t,n){let r=this.createValidationErrorDisplay(t,n),i=e.querySelector(`:scope > .validation-error`);if(!i){e.appendChild(r);return}if(r.title&&this.hasExplicitShaclMessage(t)){i.title=r.title;return}r.title&&!i.title.split(`
|
|
23
|
+
`).includes(r.title)&&(i.title=i.title?`${i.title}\n${r.title}`:r.title)}hasExplicitShaclMessage(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.shape?.message?.length?!0:[...t.shape?.ptr?.terms??[],...t.source??[]].some(e=>this.config.store.countQuads(e,he,null,null)>0)}createValidationErrorDisplay(e,t){let n=document.createElement(`span`);n.classList.add(`validation-error`),t&&n.classList.add(t);let r=typeof e==`object`&&e?e:null;return r?r.message?.length?n.title+=a(this.config.languages,r.message):r.sourceConstraintComponent?.value&&(n.title=r.sourceConstraintComponent.value):typeof e==`string`&&(n.title=e),n}findRootShaclShapeSubject(){if(this.config.attributes.shapeSubject){let e=y.namedNode(this.config.attributes.shapeSubject);if(this.config.store.getQuads(e,ye,oe,null).length===0){console.warn(`shapes graph does not contain requested node shape ${this.config.attributes.shapeSubject}`);return}else return e}else{if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,te)>0){let e=y.namedNode(this.config.attributes.valuesSubject),t=se(this.config.store,this.config.attributes.valuesSubject),n=this.config.store.getQuads(e,ye,null,te);if(n.length===0&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${ye.id} nor ${re.id} statement`),t)return t;for(let e of n)if(this.config.store.getQuads(e.object,ye,oe,null).length>0)return e.object;let r=this.config.store.getObjects(e,ye,te);for(let e of r)for(let t of this.config.store.getQuads(null,xe,e,null))return t.subject}let e=this.config.store.getQuads(null,ye,oe,null);if(e.length==0){console.warn(`shapes graph does not contain any node shapes`);return}return e.length>1&&(console.warn(`shapes graph contains`,e.length,`node shapes. choosing first found which is`,e[0].subject.value),console.info(`hint: set the node shape to use with element attribute "data-shape-subject"`)),e[0].subject}}removeFromDataGraph(e){for(let t of this.config.store.getQuads(e,null,null,te))this.config.store.delete(t),(t.object.termType===`NamedNode`||t.object.termType===`BlankNode`)&&this.removeFromDataGraph(t.object)}};window.customElements.define(`shacl-form`,Si);var Ci=class extends De{constructor(e,t,n){super(e),this.onChange=t,this.fileType=n}createEditor(e){let t=l(e)>0,n=e.config.theme.createFileEditor(e.label,null,t,e);return n.addEventListener(`change`,e=>{e.stopPropagation(),this.onChange(e)}),this.fileType&&n.querySelector(`input[type="file"]`)?.setAttribute(`accept`,this.fileType),n}},wi=x(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.leaflet={}))})(e,(function(e){var t=`1.9.4`;function n(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n],i)e[t]=i[t];return e}var r=Object.create||(function(){function e(){}return function(t){return e.prototype=t,new e}})();function i(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var a=0;function o(e){return`_leaflet_id`in e||(e._leaflet_id=++a),e._leaflet_id}function s(e,t,n){var r,i,a,o=function(){r=!1,i&&=(a.apply(n,i),!1)};return a=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(o,t),r=!0)},a}function c(e,t,n){var r=t[1],i=t[0],a=r-i;return e===r&&n?e:((e-i)%a+a)%a+i}function l(){return!1}function u(e,t){if(t===!1)return e;var n=10**(t===void 0?6:t);return Math.round(e*n)/n}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function f(e){return d(e).split(/\s+/)}function p(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,`options`)||(e.options=e.options?r(e.options):{}),t)e.options[n]=t[n];return e.options}function m(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+`=`+encodeURIComponent(e[i]));return(!t||t.indexOf(`?`)===-1?`?`:`&`)+r.join(`&`)}var ee=/\{ *([\w_ -]+) *\}/g;function h(e,t){return e.replace(ee,function(e,n){var r=t[n];if(r===void 0)throw Error(`No value provided for variable `+e);return typeof r==`function`&&(r=r(t)),r})}var g=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`};function te(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var ne=`data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=`;function re(e){return window[`webkit`+e]||window[`moz`+e]||window[`ms`+e]}var ie=0;function ae(e){var t=+new Date,n=Math.max(0,16-(t-ie));return ie=t+n,window.setTimeout(e,n)}var oe=window.requestAnimationFrame||re(`RequestAnimationFrame`)||ae,se=window.cancelAnimationFrame||re(`CancelAnimationFrame`)||re(`CancelRequestAnimationFrame`)||function(e){window.clearTimeout(e)};function _(e,t,n){if(n&&oe===ae)e.call(t);else return oe.call(window,i(e,t))}function v(e){e&&se.call(window,e)}var ce={__proto__:null,extend:n,create:r,bind:i,get lastId(){return a},stamp:o,throttle:s,wrapNum:c,falseFn:l,formatNum:u,trim:d,splitWords:f,setOptions:p,getParamString:m,template:h,isArray:g,indexOf:te,emptyImageUrl:ne,requestFn:oe,cancelFn:se,requestAnimFrame:_,cancelAnimFrame:v};function le(){}le.extend=function(e){var t=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=t.__super__=this.prototype,a=r(i);for(var o in a.constructor=t,t.prototype=a,this)Object.prototype.hasOwnProperty.call(this,o)&&o!==`prototype`&&o!==`__super__`&&(t[o]=this[o]);return e.statics&&n(t,e.statics),e.includes&&(ue(e.includes),n.apply(null,[a].concat(e.includes))),n(a,e),delete a.statics,delete a.includes,a.options&&(a.options=i.options?r(i.options):{},n(a.options,e.options)),a._initHooks=[],a.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=a._initHooks.length;e<t;e++)a._initHooks[e].call(this)}},t},le.include=function(e){var t=this.prototype.options;return n(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},le.mergeOptions=function(e){return n(this.prototype.options,e),this},le.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n=typeof e==`function`?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};function ue(e){if(!(typeof L>`u`||!L||!L.Mixin)){e=g(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn(`Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.`,Error().stack)}}var y={on:function(e,t,n){if(typeof e==`object`)for(var r in e)this._on(r,e[r],t);else{e=f(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n)}return this},off:function(e,t,n){if(!arguments.length)delete this._events;else if(typeof e==`object`)for(var r in e)this._off(r,e[r],t);else{e=f(e);for(var i=arguments.length===1,a=0,o=e.length;a<o;a++)i?this._off(e[a]):this._off(e[a],t,n)}return this},_on:function(e,t,n,r){if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}if(this._listens(e,t,n)===!1){n===this&&(n=void 0);var i={fn:t,ctx:n};r&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}},_off:function(e,t,n){var r,i,a;if(this._events&&(r=this._events[e],r)){if(arguments.length===1){if(this._firingCount)for(i=0,a=r.length;i<a;i++)r[i].fn=l;delete this._events[e];return}if(typeof t!=`function`){console.warn(`wrong listener type: `+typeof t);return}var o=this._listens(e,t,n);if(o!==!1){var s=r[o];this._firingCount&&(s.fn=l,this._events[e]=r=r.slice()),r.splice(o,1)}}},fire:function(e,t,r){if(!this.listens(e,r))return this;var i=n({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var a=this._events[e];if(a){this._firingCount=this._firingCount+1||1;for(var o=0,s=a.length;o<s;o++){var c=a[o],l=c.fn;c.once&&this.off(e,l,c.ctx),l.call(c.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(e,t,n,r){typeof e!=`string`&&console.warn(`"string" type argument expected`);var i=t;typeof t!=`function`&&(r=!!t,i=void 0,n=void 0);var a=this._events&&this._events[e];if(a&&a.length&&this._listens(e,i,n)!==!1)return!0;if(r){for(var o in this._eventParents)if(this._eventParents[o].listens(e,t,n,r))return!0}return!1},_listens:function(e,t,n){if(!this._events)return!1;var r=this._events[e]||[];if(!t)return!!r.length;n===this&&(n=void 0);for(var i=0,a=r.length;i<a;i++)if(r[i].fn===t&&r[i].ctx===n)return i;return!1},once:function(e,t,n){if(typeof e==`object`)for(var r in e)this._on(r,e[r],t,!0);else{e=f(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[o(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[o(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,n({layer:e.target,propagatedFrom:e.target},e),!0)}};y.addEventListener=y.on,y.removeEventListener=y.clearAllEventListeners=y.off,y.addOneTimeEventListener=y.once,y.fireEvent=y.fire,y.hasEventListeners=y.listens;var de=le.extend(y);function b(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var fe=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};b.prototype={clone:function(){return new b(this.x,this.y)},add:function(e){return this.clone()._add(x(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(x(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new b(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new b(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=fe(this.x),this.y=fe(this.y),this},distanceTo:function(e){e=x(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=x(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=x(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return`Point(`+u(this.x)+`, `+u(this.y)+`)`}};function x(e,t,n){return e instanceof b?e:g(e)?new b(e[0],e[1]):e==null?e:typeof e==`object`&&`x`in e&&`y`in e?new b(e.x,e.y):new b(e,t,n)}function S(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}S.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof b||typeof e[0]==`number`||`x`in e)t=n=x(e);else if(e=C(e),t=e.min,n=e.max,!t||!n)return this;return!this.min&&!this.max?(this.min=t.clone(),this.max=n.clone()):(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)),this},getCenter:function(e){return x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return x(this.min.x,this.max.y)},getTopRight:function(){return x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return e=typeof e[0]==`number`||e instanceof b?x(e):C(e),e instanceof S?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=C(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>=t.x&&r.x<=n.x,o=i.y>=t.y&&r.y<=n.y;return a&&o},overlaps:function(e){e=C(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>t.x&&r.x<n.x,o=i.y>t.y&&r.y<n.y;return a&&o},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var t=this.min,n=this.max,r=Math.abs(t.x-n.x)*e,i=Math.abs(t.y-n.y)*e;return C(x(t.x-r,t.y-i),x(n.x+r,n.y+i))},equals:function(e){return e?(e=C(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight())):!1}};function C(e,t){return!e||e instanceof S?e:new S(e,t)}function w(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}w.prototype={extend:function(e){var t=this._southWest,n=this._northEast,r,i;if(e instanceof E)r=e,i=e;else if(e instanceof w){if(r=e._southWest,i=e._northEast,!r||!i)return this}else return e?this.extend(D(e)||T(e)):this;return!t&&!n?(this._southWest=new E(r.lat,r.lng),this._northEast=new E(i.lat,i.lng)):(t.lat=Math.min(r.lat,t.lat),t.lng=Math.min(r.lng,t.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,i=Math.abs(t.lng-n.lng)*e;return new w(new E(t.lat-r,t.lng-i),new E(n.lat+r,n.lng+i))},getCenter:function(){return new E((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new E(this.getNorth(),this.getWest())},getSouthEast:function(){return new E(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e=typeof e[0]==`number`||e instanceof E||`lat`in e?D(e):T(e);var t=this._southWest,n=this._northEast,r,i;return e instanceof w?(r=e.getSouthWest(),i=e.getNorthEast()):r=i=e,r.lat>=t.lat&&i.lat<=n.lat&&r.lng>=t.lng&&i.lng<=n.lng},intersects:function(e){e=T(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>=t.lat&&r.lat<=n.lat,o=i.lng>=t.lng&&r.lng<=n.lng;return a&&o},overlaps:function(e){e=T(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>t.lat&&r.lat<n.lat,o=i.lng>t.lng&&r.lng<n.lng;return a&&o},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(`,`)},equals:function(e,t){return e?(e=T(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function T(e,t){return e instanceof w?e:new w(e,t)}function E(e,t,n){if(isNaN(e)||isNaN(t))throw Error(`Invalid LatLng object: (`+e+`, `+t+`)`);this.lat=+e,this.lng=+t,n!==void 0&&(this.alt=+n)}E.prototype={equals:function(e,t){return e?(e=D(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(t===void 0?1e-9:t)):!1},toString:function(e){return`LatLng(`+u(this.lat,e)+`, `+u(this.lng,e)+`)`},distanceTo:function(e){return me.distance(this,D(e))},wrap:function(){return me.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return T([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new E(this.lat,this.lng,this.alt)}};function D(e,t,n){return e instanceof E?e:g(e)&&typeof e[0]!=`object`?e.length===3?new E(e[0],e[1],e[2]):e.length===2?new E(e[0],e[1]):null:e==null?e:typeof e==`object`&&`lat`in e?new E(e.lat,`lng`in e?e.lng:e.lon,e.alt):t===void 0?null:new E(e,t,n)}var pe={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*2**e},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new S(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?c(e.lng,this.wrapLng,!0):e.lng,n=this.wrapLat?c(e.lat,this.wrapLat,!0):e.lat,r=e.alt;return new E(n,t,r)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),r=t.lat-n.lat,i=t.lng-n.lng;if(r===0&&i===0)return e;var a=e.getSouthWest(),o=e.getNorthEast();return new w(new E(a.lat-r,a.lng-i),new E(o.lat-r,o.lng-i))}},me=n({},pe,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=Math.sin((t.lat-e.lat)*n/2),o=Math.sin((t.lng-e.lng)*n/2),s=a*a+Math.cos(r)*Math.cos(i)*o*o,c=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*c}}),he=6378137,ge={R:he,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),i=Math.sin(r*t);return new b(this.R*e.lng*t,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(e){var t=180/Math.PI;return new E((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(function(){var e=he*Math.PI;return new S([-e,-e],[e,e])})()};function _e(e,t,n,r){if(g(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=t,this._c=n,this._d=r}_e.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t||=1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t||=1,new b((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};function ve(e,t,n,r){return new _e(e,t,n,r)}var ye=n({},me,{code:`EPSG:3857`,projection:ge,transformation:function(){var e=.5/(Math.PI*ge.R);return ve(e,.5,-e,.5)}()}),be=n({},ye,{code:`EPSG:900913`});function xe(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function Se(e,t){var n=``,r,i,a,o,s,c;for(r=0,a=e.length;r<a;r++){for(s=e[r],i=0,o=s.length;i<o;i++)c=s[i],n+=(i?`L`:`M`)+c.x+` `+c.y;n+=t?A.svg?`z`:`x`:``}return n||`M0 0`}var Ce=document.documentElement.style,we=`ActiveXObject`in window,Te=we&&!document.addEventListener,Ee=`msLaunchUri`in navigator&&!(`documentMode`in document),De=it(`webkit`),Oe=it(`android`),ke=it(`android 2`)||it(`android 3`),Ae=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),je=Oe&&it(`Google`)&&Ae<537&&!(`AudioNode`in window),Me=!!window.opera,Ne=!Ee&&it(`chrome`),Pe=it(`gecko`)&&!De&&!Me&&!we,Fe=!Ne&&it(`safari`),Ie=it(`phantom`),Le=`OTransition`in Ce,Re=navigator.platform.indexOf(`Win`)===0,ze=we&&`transition`in Ce,Be=`WebKitCSSMatrix`in window&&`m11`in new window.WebKitCSSMatrix&&!ke,Ve=`MozPerspective`in Ce,He=!window.L_DISABLE_3D&&(ze||Be||Ve)&&!Le&&!Ie,O=typeof orientation<`u`||it(`mobile`),Ue=O&&De,We=O&&Be,Ge=!window.PointerEvent&&window.MSPointerEvent,k=!!(window.PointerEvent||Ge),Ke=`ontouchstart`in window||!!window.TouchEvent,qe=!window.L_NO_TOUCH&&(Ke||k),Je=O&&Me,Ye=O&&Pe,Xe=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ze=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`testPassiveEventSupport`,l,t),window.removeEventListener(`testPassiveEventSupport`,l,t)}catch{}return e}(),Qe=function(){return!!document.createElement(`canvas`).getContext}(),$e=!!(document.createElementNS&&xe(`svg`).createSVGRect),et=!!$e&&(function(){var e=document.createElement(`div`);return e.innerHTML=`<svg/>`,(e.firstChild&&e.firstChild.namespaceURI)===`http://www.w3.org/2000/svg`})(),tt=!$e&&function(){try{var e=document.createElement(`div`);e.innerHTML=`<v:shape adj="1"/>`;var t=e.firstChild;return t.style.behavior=`url(#default#VML)`,t&&typeof t.adj==`object`}catch{return!1}}(),nt=navigator.platform.indexOf(`Mac`)===0,rt=navigator.platform.indexOf(`Linux`)===0;function it(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var A={ie:we,ielt9:Te,edge:Ee,webkit:De,android:Oe,android23:ke,androidStock:je,opera:Me,chrome:Ne,gecko:Pe,safari:Fe,phantom:Ie,opera12:Le,win:Re,ie3d:ze,webkit3d:Be,gecko3d:Ve,any3d:He,mobile:O,mobileWebkit:Ue,mobileWebkit3d:We,msPointer:Ge,pointer:k,touch:qe,touchNative:Ke,mobileOpera:Je,mobileGecko:Ye,retina:Xe,passiveEvents:Ze,canvas:Qe,svg:$e,vml:tt,inlineSvg:et,mac:nt,linux:rt},j=A.msPointer?`MSPointerDown`:`pointerdown`,M=A.msPointer?`MSPointerMove`:`pointermove`,at=A.msPointer?`MSPointerUp`:`pointerup`,ot=A.msPointer?`MSPointerCancel`:`pointercancel`,st={touchstart:j,touchmove:M,touchend:at,touchcancel:ot},ct={touchstart:_t,touchmove:gt,touchend:gt,touchcancel:gt},lt={},ut=!1;function dt(e,t,n){return t===`touchstart`&&ht(),ct[t]?(n=ct[t].bind(this,n),e.addEventListener(st[t],n,!1),n):(console.warn(`wrong event specified:`,t),l)}function ft(e,t,n){if(!st[t]){console.warn(`wrong event specified:`,t);return}e.removeEventListener(st[t],n,!1)}function N(e){lt[e.pointerId]=e}function pt(e){lt[e.pointerId]&&(lt[e.pointerId]=e)}function mt(e){delete lt[e.pointerId]}function ht(){ut||=(document.addEventListener(j,N,!0),document.addEventListener(M,pt,!0),document.addEventListener(at,mt,!0),document.addEventListener(ot,mt,!0),!0)}function gt(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||`mouse`)){for(var n in t.touches=[],lt)t.touches.push(lt[n]);t.changedTouches=[t],e(t)}}function _t(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&G(t),gt(e,t)}function vt(e){var t={},n,r;for(r in e)n=e[r],t[r]=n&&n.bind?n.bind(e):n;return e=t,t.type=`dblclick`,t.detail=2,t.isTrusted=!1,t._simulated=!0,t}var yt=200;function bt(e,t){e.addEventListener(`dblclick`,t);var n=0,r;function i(e){if(e.detail!==1){r=e.detail;return}if(!(e.pointerType===`mouse`||e.sourceCapabilities&&!e.sourceCapabilities.firesTouchEvents)){var i=rn(e);if(!(i.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})&&!i.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var a=Date.now();a-n<=yt?(r++,r===2&&t(vt(e))):r=1,n=a}}}return e.addEventListener(`click`,i),{dblclick:t,simDblclick:i}}function xt(e,t){e.removeEventListener(`dblclick`,t.dblclick),e.removeEventListener(`click`,t.simDblclick)}var St=Nt([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),Ct=Nt([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]),wt=Ct===`webkitTransition`||Ct===`OTransition`?Ct+`End`:`transitionend`;function Tt(e){return typeof e==`string`?document.getElementById(e):e}function Et(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||n===`auto`)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return n===`auto`?null:n}function P(e,t,n){var r=document.createElement(e);return r.className=t||``,n&&n.appendChild(r),r}function F(e){var t=e.parentNode;t&&t.removeChild(e)}function Dt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ot(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function kt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function I(e,t){if(e.classList!==void 0)return e.classList.contains(t);var n=jt(e);return n.length>0&&RegExp(`(^|\\s)`+t+`(\\s|$)`).test(n)}function R(e,t){if(e.classList!==void 0)for(var n=f(t),r=0,i=n.length;r<i;r++)e.classList.add(n[r]);else if(!I(e,t)){var a=jt(e);At(e,(a?a+` `:``)+t)}}function z(e,t){e.classList===void 0?At(e,d((` `+jt(e)+` `).replace(` `+t+` `,` `))):e.classList.remove(t)}function At(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}function jt(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function B(e,t){`opacity`in e.style?e.style.opacity=t:`filter`in e.style&&Mt(e,t)}function Mt(e,t){var n=!1,r=`DXImageTransform.Microsoft.Alpha`;try{n=e.filters.item(r)}catch{if(t===1)return}t=Math.round(t*100),n?(n.Enabled=t!==100,n.Opacity=t):e.style.filter+=` progid:`+r+`(opacity=`+t+`)`}function Nt(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function V(e,t,n){var r=t||new b(0,0);e.style[St]=(A.ie3d?`translate(`+r.x+`px,`+r.y+`px)`:`translate3d(`+r.x+`px,`+r.y+`px,0)`)+(n?` scale(`+n+`)`:``)}function H(e,t){e._leaflet_pos=t,A.any3d?V(e,t):(e.style.left=t.x+`px`,e.style.top=t.y+`px`)}function Pt(e){return e._leaflet_pos||new b(0,0)}var Ft,It,Lt;if(`onselectstart`in document)Ft=function(){U(window,`selectstart`,G)},It=function(){W(window,`selectstart`,G)};else{var Rt=Nt([`userSelect`,`WebkitUserSelect`,`OUserSelect`,`MozUserSelect`,`msUserSelect`]);Ft=function(){if(Rt){var e=document.documentElement.style;Lt=e[Rt],e[Rt]=`none`}},It=function(){Rt&&(document.documentElement.style[Rt]=Lt,Lt=void 0)}}function zt(){U(window,`dragstart`,G)}function Bt(){W(window,`dragstart`,G)}var Vt,Ht;function Ut(e){for(;e.tabIndex===-1;)e=e.parentNode;e.style&&(Wt(),Vt=e,Ht=e.style.outlineStyle,e.style.outlineStyle=`none`,U(window,`keydown`,Wt))}function Wt(){Vt&&(Vt.style.outlineStyle=Ht,Vt=void 0,Ht=void 0,W(window,`keydown`,Wt))}function Gt(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body);return e}function Kt(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var qt={__proto__:null,TRANSFORM:St,TRANSITION:Ct,TRANSITION_END:wt,get:Tt,getStyle:Et,create:P,remove:F,empty:Dt,toFront:Ot,toBack:kt,hasClass:I,addClass:R,removeClass:z,setClass:At,getClass:jt,setOpacity:B,testProp:Nt,setTransform:V,setPosition:H,getPosition:Pt,get disableTextSelection(){return Ft},get enableTextSelection(){return It},disableImageDrag:zt,enableImageDrag:Bt,preventOutline:Ut,restoreOutline:Wt,getSizedParentNode:Gt,getScale:Kt};function U(e,t,n,r){if(t&&typeof t==`object`)for(var i in t)Zt(e,i,t[i],n);else{t=f(t);for(var a=0,o=t.length;a<o;a++)Zt(e,t[a],n,r)}return this}var Jt=`_leaflet_events`;function W(e,t,n,r){if(arguments.length===1)Yt(e),delete e[Jt];else if(t&&typeof t==`object`)for(var i in t)Qt(e,i,t[i],n);else if(t=f(t),arguments.length===2)Yt(e,function(e){return te(t,e)!==-1});else for(var a=0,o=t.length;a<o;a++)Qt(e,t[a],n,r);return this}function Yt(e,t){for(var n in e[Jt]){var r=n.split(/\d/)[0];(!t||t(r))&&Qt(e,r,null,null,n)}}var Xt={mouseenter:`mouseover`,mouseleave:`mouseout`,wheel:!(`onwheel`in window)&&`mousewheel`};function Zt(e,t,n,r){var i=t+o(n)+(r?`_`+o(r):``);if(e[Jt]&&e[Jt][i])return this;var a=function(t){return n.call(r||e,t||window.event)},s=a;!A.touchNative&&A.pointer&&t.indexOf(`touch`)===0?a=dt(e,t,a):A.touch&&t===`dblclick`?a=bt(e,a):`addEventListener`in e?t===`touchstart`||t===`touchmove`||t===`wheel`||t===`mousewheel`?e.addEventListener(Xt[t]||t,a,A.passiveEvents?{passive:!1}:!1):t===`mouseenter`||t===`mouseleave`?(a=function(t){t||=window.event,cn(e,t)&&s(t)},e.addEventListener(Xt[t],a,!1)):e.addEventListener(t,s,!1):e.attachEvent(`on`+t,a),e[Jt]=e[Jt]||{},e[Jt][i]=a}function Qt(e,t,n,r,i){i||=t+o(n)+(r?`_`+o(r):``);var a=e[Jt]&&e[Jt][i];if(!a)return this;!A.touchNative&&A.pointer&&t.indexOf(`touch`)===0?ft(e,t,a):A.touch&&t===`dblclick`?xt(e,a):`removeEventListener`in e?e.removeEventListener(Xt[t]||t,a,!1):e.detachEvent(`on`+t,a),e[Jt][i]=null}function $t(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function en(e){return Zt(e,`wheel`,$t),this}function tn(e){return U(e,`mousedown touchstart dblclick contextmenu`,$t),e._leaflet_disable_click=!0,this}function G(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function nn(e){return G(e),$t(e),this}function rn(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function an(e,t){if(!t)return new b(e.clientX,e.clientY);var n=Kt(t),r=n.boundingClientRect;return new b((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var on=A.linux&&A.chrome?window.devicePixelRatio:A.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function sn(e){return A.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/on:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function cn(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch{return!1}return n!==e}var ln={__proto__:null,on:U,off:W,stopPropagation:$t,disableScrollPropagation:en,disableClickPropagation:tn,preventDefault:G,stop:nn,getPropagationPath:rn,getMousePosition:an,getWheelDelta:sn,isExternalTarget:cn,addListener:U,removeListener:W},un=de.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Pt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire(`start`),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=_(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=this._duration*1e3;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),H(this._el,n),this.fire(`step`)},_complete:function(){v(this._animId),this._inProgress=!1,this.fire(`end`)},_easeOut:function(e){return 1-(1-e)**this._easeOutPower}}),K=de.extend({options:{crs:ye,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=p(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=i(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),t.zoom!==void 0&&(this._zoom=this._limitZoom(t.zoom)),t.center&&t.zoom!==void 0&&this.setView(D(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Ct&&A.any3d&&!A.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),U(this._proxy,wt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,r){return t=t===void 0?this._zoom:this._limitZoom(t),e=this._limitCenter(D(e),t,this.options.maxBounds),r||={},this._stop(),this._loaded&&!r.reset&&r!==!0&&(r.animate!==void 0&&(r.zoom=n({animate:r.animate},r.zoom),r.pan=n({animate:r.animate,duration:r.duration},r.pan)),this._zoom===t?this._tryAnimatedPan(e,r.pan):this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,r.zoom))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,r.pan&&r.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e||=A.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e||=A.any3d?this.options.zoomDelta:1,this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),i=this.getSize().divideBy(2),a=(e instanceof b?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/r),o=this.containerPointToLatLng(i.add(a));return this.setView(o,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t||={},e=e.getBounds?e.getBounds():T(e);var n=x(t.paddingTopLeft||t.padding||[0,0]),r=x(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,n.add(r));if(i=typeof t.maxZoom==`number`?Math.min(t.maxZoom,i):i,i===1/0)return{center:e.getCenter(),zoom:i};var a=r.subtract(n).divideBy(2),o=this.project(e.getSouthWest(),i),s=this.project(e.getNorthEast(),i);return{center:this.unproject(o.add(s).divideBy(2).add(a),i),zoom:i}},fitBounds:function(e,t){if(e=T(e),!e.isValid())throw Error(`Bounds are not valid.`);var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(e=x(e).round(),t||={},!e.x&&!e.y)return this.fire(`moveend`);if(t.animate!==!0&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new un,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire(`movestart`),t.animate!==!1){R(this._mapPane,`leaflet-pan-anim`);var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire(`move`).fire(`moveend`);return this},flyTo:function(e,t,n){if(n||={},n.animate===!1||!A.any3d)return this.setView(e,t,n);this._stop();var r=this.project(this.getCenter()),i=this.project(e),a=this.getSize(),o=this._zoom;e=D(e),t=t===void 0?o:t;var s=Math.max(a.x,a.y),c=s*this.getZoomScale(o,t),l=i.distanceTo(r)||1,u=1.42,d=u*u;function f(e){var t=e?-1:1,n=e?c:s,r=(c*c-s*s+t*d*d*l*l)/(2*n*d*l),i=Math.sqrt(r*r+1)-r;return i<1e-9?-18:Math.log(i)}function p(e){return(Math.exp(e)-Math.exp(-e))/2}function m(e){return(Math.exp(e)+Math.exp(-e))/2}function ee(e){return p(e)/m(e)}var h=f(0);function g(e){return s*(m(h)/m(h+u*e))}function te(e){return s*(m(h)*ee(h+u*e)-p(h))/d}function ne(e){return 1-(1-e)**1.5}var re=Date.now(),ie=(f(1)-h)/u,ae=n.duration?1e3*n.duration:1e3*ie*.8;function oe(){var n=(Date.now()-re)/ae,a=ne(n)*ie;n<=1?(this._flyToFrame=_(oe,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(te(a)/l)),o),this.getScaleZoom(s/g(a),o),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),oe.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return e=T(e),this.listens(`moveend`,this._panInsideMaxBounds)&&this.off(`moveend`,this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on(`moveend`,this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire(`zoomlevelschange`),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,T(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){t||={};var n=x(t.paddingTopLeft||t.padding||[0,0]),r=x(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),a=this.project(e),o=this.getPixelBounds(),s=C([o.min.add(n),o.max.subtract(r)]),c=s.getSize();if(!s.contains(a)){this._enforcingBounds=!0;var l=a.subtract(s.getCenter()),u=s.extend(a).getSize().subtract(c);i.x+=l.x<0?-u.x:u.x,i.y+=l.y<0?-u.y:u.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},e===!0?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),a=t.divideBy(2).round(),o=r.divideBy(2).round(),s=a.subtract(o);return!s.x&&!s.y?this:(e.animate&&e.pan?this.panBy(s):(e.pan&&this._rawPanBy(s),this.fire(`move`),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,`moveend`),200)):this.fire(`moveend`)),this.fire(`resize`,{oldSize:t,newSize:r}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire(`viewreset`),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!(`geolocation`in navigator))return this._handleGeolocationError({code:0,message:`Geolocation not supported.`}),this;var t=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(t===1?`permission denied`:t===2?`position unavailable`:`timeout`);this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire(`locationerror`,{code:t,message:`Geolocation error: `+n+`.`})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=e.coords.latitude,n=e.coords.longitude,r=new E(t,n),i=r.toBounds(e.coords.accuracy*2),a=this._locateOptions;if(a.setView){var o=this.getBoundsZoom(i);this.setView(r,a.maxZoom?Math.min(o,a.maxZoom):o)}var s={latlng:r,bounds:i,timestamp:e.timestamp};for(var c in e.coords)typeof e.coords[c]==`number`&&(s[c]=e.coords[c]);this.fire(`locationfound`,s)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off(`moveend`,this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error(`Map container is being reused by another instance`);try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}for(var e in this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),F(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&=(v(this._resizeRequest),null),this._clearHandlers(),this._loaded&&this.fire(`unload`),this._layers)this._layers[e].remove();for(e in this._panes)F(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=P(`div`,`leaflet-pane`+(e?` leaflet-`+e.replace(`Pane`,``)+`-pane`:``),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new w(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=T(e),n=x(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),a=this.getMaxZoom(),o=e.getNorthWest(),s=e.getSouthEast(),c=this.getSize().subtract(n),l=C(this.project(s,r),this.project(o,r)).getSize(),u=A.any3d?this.options.zoomSnap:1,d=c.x/l.x,f=c.y/l.y,p=t?Math.max(d,f):Math.min(d,f);return r=this.getScaleZoom(p,r),u&&(r=Math.round(r/(u/100))*(u/100),r=t?Math.ceil(r/u)*u:Math.floor(r/u)*u),Math.max(i,Math.min(a,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new b(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new S(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e==`string`?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=t===void 0?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=t===void 0?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.latLngToPoint(D(e),t)},unproject:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.pointToLatLng(x(e),t)},layerPointToLatLng:function(e){var t=x(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(D(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(D(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(T(e))},distance:function(e,t){return this.options.crs.distance(D(e),D(t))},containerPointToLayerPoint:function(e){return x(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return x(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(x(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(D(e)))},mouseEventToContainerPoint:function(e){return an(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=Tt(e);if(!t)throw Error(`Map container not found.`);if(t._leaflet_id)throw Error(`Map container is already initialized.`);U(t,`scroll`,this._onScroll,this),this._containerId=o(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&A.any3d,R(e,`leaflet-container`+(A.touch?` leaflet-touch`:``)+(A.retina?` leaflet-retina`:``)+(A.ielt9?` leaflet-oldie`:``)+(A.safari?` leaflet-safari`:``)+(this._fadeAnimated?` leaflet-fade-anim`:``));var t=Et(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`fixed`&&t!==`sticky`&&(e.style.position=`relative`),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane(`mapPane`,this._container),H(this._mapPane,new b(0,0)),this.createPane(`tilePane`),this.createPane(`overlayPane`),this.createPane(`shadowPane`),this.createPane(`markerPane`),this.createPane(`tooltipPane`),this.createPane(`popupPane`),this.options.markerZoomAnimation||(R(e.markerPane,`leaflet-zoom-hide`),R(e.shadowPane,`leaflet-zoom-hide`))},_resetView:function(e,t,n){H(this._mapPane,new b(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire(`viewprereset`);var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire(`viewreset`),r&&this.fire(`load`)},_moveStart:function(e,t){return e&&this.fire(`zoomstart`),t||this.fire(`movestart`),this},_move:function(e,t,n,r){t===void 0&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire(`zoom`,n):((i||n&&n.pinch)&&this.fire(`zoom`,n),this.fire(`move`,n)),this},_moveEnd:function(e){return e&&this.fire(`zoomend`),this.fire(`moveend`)},_stop:function(){return v(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){H(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error(`Set map center and zoom first.`)},_initEvents:function(e){this._targets={},this._targets[o(this._container)]=this;var t=e?W:U;t(this._container,`click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup`,this._handleDOMEvent,this),this.options.trackResize&&t(window,`resize`,this._onResize,this),A.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,`moveend`,this._onMoveEnd)},_onResize:function(){v(this._resizeRequest),this._resizeRequest=_(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n=[],r,i=t===`mouseout`||t===`mouseover`,a=e.target||e.srcElement,s=!1;a;){if(r=this._targets[o(a)],r&&(t===`click`||t===`preclick`)&&this._draggableMoved(r)){s=!0;break}if(r&&r.listens(t,!0)&&(i&&!cn(a,e)||(n.push(r),i))||a===this._container)break;a=a.parentNode}return!n.length&&!s&&!i&&this.listens(t,!0)&&(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||e.type===`click`&&this._isClickDisabled(t))){var n=e.type;n===`mousedown`&&Ut(t),this._fireDOMEvent(e,n)}},_mouseEvents:[`click`,`dblclick`,`mouseover`,`mouseout`,`contextmenu`],_fireDOMEvent:function(e,t,r){if(e.type===`click`){var i=n({},e);i.type=`preclick`,this._fireDOMEvent(i,i.type,r)}var a=this._findEventTargets(e,t);if(r){for(var o=[],s=0;s<r.length;s++)r[s].listens(t,!0)&&o.push(r[s]);a=o.concat(a)}if(a.length){t===`contextmenu`&&G(e);var c=a[0],l={originalEvent:e};if(e.type!==`keypress`&&e.type!==`keydown`&&e.type!==`keyup`){var u=c.getLatLng&&(!c._radius||c._radius<=10);l.containerPoint=u?this.latLngToContainerPoint(c.getLatLng()):this.mouseEventToContainerPoint(e),l.layerPoint=this.containerPointToLayerPoint(l.containerPoint),l.latlng=u?c.getLatLng():this.layerPointToLatLng(l.layerPoint)}for(s=0;s<a.length;s++)if(a[s].fire(t,l,!0),l.originalEvent._stopped||a[s].options.bubblingMouseEvents===!1&&te(this._mouseEvents,t)!==-1)return}},_draggableMoved:function(e){return e=e.dragging&&e.dragging.enabled()?e:this,e.dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on(`load`,e,t),this},_getMapPanePos:function(){return Pt(this._mapPane)||new b(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&t!==void 0?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return C([this.project(e.getSouthWest(),t)._subtract(r),this.project(e.getNorthWest(),t)._subtract(r),this.project(e.getSouthEast(),t)._subtract(r),this.project(e.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),i=this.getSize().divideBy(2),a=new S(r.subtract(i),r.add(i)),o=this._getBoundsOffset(a,n,t);return Math.abs(o.x)<=1&&Math.abs(o.y)<=1?e:this.unproject(r.add(o),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new S(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=C(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),i=r.min.subtract(e.min),a=r.max.subtract(e.max);return new b(this._rebound(i.x,-a.x),this._rebound(i.y,-a.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=A.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire(`move`)},_onPanTransitionEnd:function(){z(this._mapPane,`leaflet-pan-anim`),this.fire(`moveend`)},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(t&&t.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=P(`div`,`leaflet-proxy leaflet-zoom-animated`);this._panes.mapPane.appendChild(e),this.on(`zoomanim`,function(e){var t=St,n=this._proxy.style[t];V(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on(`load moveend`,this._animMoveEnd,this),this._on(`unload`,this._destroyAnimProxy,this)},_destroyAnimProxy:function(){F(this._proxy),this.off(`load moveend`,this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();V(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf(`transform`)>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName(`leaflet-zoom-animated`).length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n||={},!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return n.animate!==!0&&!this.getSize().contains(i)?!1:(_(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,R(this._mapPane,`leaflet-zoom-anim`)),this.fire(`zoomanim`,{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||=this._zoom!==this._animateToZoom,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,`leaflet-zoom-anim`),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire(`zoom`),delete this._tempFireZoomEvent,this.fire(`move`),this._moveEnd(!0))}});function dn(e,t){return new K(e,t)}var fn=le.extend({options:{position:`topright`},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return R(t,`leaflet-control`),n.indexOf(`bottom`)===-1?r.appendChild(t):r.insertBefore(t,r.firstChild),this._map.on(`unload`,this.remove,this),this},remove:function(){return this._map?(F(this._container),this.onRemove&&this.onRemove(this._map),this._map.off(`unload`,this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),pn=function(e){return new fn(e)};K.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t=`leaflet-`,n=this._controlContainer=P(`div`,t+`control-container`,this._container);function r(r,i){var a=t+r+` `+t+i;e[r+i]=P(`div`,a,n)}r(`top`,`left`),r(`top`,`right`),r(`bottom`,`left`),r(`bottom`,`right`)},_clearControlPos:function(){for(var e in this._controlCorners)F(this._controlCorners[e]);F(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var mn=fn.extend({options:{collapsed:!0,position:`topright`,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n<r?-1:+(r<n)}},initialize:function(e,t,n){for(var r in p(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on(`zoomend`,this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on(`add remove`,this._onLayerChange,this);return this._container},addTo:function(e){return fn.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off(`zoomend`,this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off(`add remove`,this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off(`add remove`,this._onLayerChange,this);var t=this._getLayer(o(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){R(this._container,`leaflet-control-layers-expanded`),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(R(this._section,`leaflet-control-layers-scrollbar`),this._section.style.height=e+`px`):z(this._section,`leaflet-control-layers-scrollbar`),this._checkDisabledLayers(),this},collapse:function(){return z(this._container,`leaflet-control-layers-expanded`),this},_initLayout:function(){var e=`leaflet-control-layers`,t=this._container=P(`div`,e),n=this.options.collapsed;t.setAttribute(`aria-haspopup`,!0),tn(t),en(t);var r=this._section=P(`section`,e+`-list`);n&&(this._map.on(`click`,this.collapse,this),U(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=P(`a`,e+`-toggle`,t);i.href=`#`,i.title=`Layers`,i.setAttribute(`role`,`button`),U(i,{keydown:function(e){e.keyCode===13&&this._expandSafely()},click:function(e){G(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=P(`div`,e+`-base`,r),this._separator=P(`div`,e+`-separator`,r),this._overlaysList=P(`div`,e+`-overlays`,r),t.appendChild(r)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&o(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on(`add remove`,this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(i(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Dt(this._baseLayersList),Dt(this._overlaysList),this._layerControlInputs=[];var e,t,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),t||=r.overlay,e||=!r.overlay,i+=+!r.overlay;return this.options.hideSingleBase&&(e&&=i>1,this._baseLayersList.style.display=e?``:`none`),this._separator.style.display=t&&e?``:`none`,this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(o(e.target)),n=t.overlay?e.type===`add`?`overlayadd`:`overlayremove`:e.type===`add`?`baselayerchange`:null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=`<input type="radio" class="leaflet-control-layers-selector" name="`+e+`"`+(t?` checked="checked"`:``)+`/>`,r=document.createElement(`div`);return r.innerHTML=n,r.firstChild},_addItem:function(e){var t=document.createElement(`label`),n=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement(`input`),r.type=`checkbox`,r.className=`leaflet-control-layers-selector`,r.defaultChecked=n):r=this._createRadioElement(`leaflet-base-layers_`+o(this),n),this._layerControlInputs.push(r),r.layerId=o(e.layer),U(r,`click`,this._onInputClick,this);var i=document.createElement(`span`);i.innerHTML=` `+e.name;var a=document.createElement(`span`);return t.appendChild(a),a.appendChild(r),a.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(t),this._checkDisabledLayers(),t},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,t,n,r=[],i=[];this._handlingClick=!0;for(var a=e.length-1;a>=0;a--)t=e[a],n=this._getLayer(t.layerId).layer,t.checked?r.push(n):t.checked||i.push(n);for(a=0;a<i.length;a++)this._map.hasLayer(i[a])&&this._map.removeLayer(i[a]);for(a=0;a<r.length;a++)this._map.hasLayer(r[a])||this._map.addLayer(r[a]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e=this._layerControlInputs,t,n,r=this._map.getZoom(),i=e.length-1;i>=0;i--)t=e[i],n=this._getLayer(t.layerId).layer,t.disabled=n.options.minZoom!==void 0&&r<n.options.minZoom||n.options.maxZoom!==void 0&&r>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,U(e,`click`,G),this.expand();var t=this;setTimeout(function(){W(e,`click`,G),t._preventClick=!1})}}),hn=function(e,t,n){return new mn(e,t,n)},gn=fn.extend({options:{position:`topleft`,zoomInText:`<span aria-hidden="true">+</span>`,zoomInTitle:`Zoom in`,zoomOutText:`<span aria-hidden="true">−</span>`,zoomOutTitle:`Zoom out`},onAdd:function(e){var t=`leaflet-control-zoom`,n=P(`div`,t+` leaflet-bar`),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+`-in`,n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+`-out`,n,this._zoomOut),this._updateDisabled(),e.on(`zoomend zoomlevelschange`,this._updateDisabled,this),n},onRemove:function(e){e.off(`zoomend zoomlevelschange`,this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var a=P(`a`,n,r);return a.innerHTML=e,a.href=`#`,a.title=t,a.setAttribute(`role`,`button`),a.setAttribute(`aria-label`,t),tn(a),U(a,`click`,nn),U(a,`click`,i,this),U(a,`click`,this._refocusOnMap,this),a},_updateDisabled:function(){var e=this._map,t=`leaflet-disabled`;z(this._zoomInButton,t),z(this._zoomOutButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`false`),this._zoomOutButton.setAttribute(`aria-disabled`,`false`),(this._disabled||e._zoom===e.getMinZoom())&&(R(this._zoomOutButton,t),this._zoomOutButton.setAttribute(`aria-disabled`,`true`)),(this._disabled||e._zoom===e.getMaxZoom())&&(R(this._zoomInButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`true`))}});K.mergeOptions({zoomControl:!0}),K.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new gn,this.addControl(this.zoomControl))});var _n=function(e){return new gn(e)},vn=fn.extend({options:{position:`bottomleft`,maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=`leaflet-control-scale`,n=P(`div`,t),r=this.options;return this._addScales(r,t+`-line`,n),e.on(r.updateWhenIdle?`moveend`:`move`,this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?`moveend`:`move`,this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=P(`div`,t,n)),e.imperial&&(this._iScale=P(`div`,t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+` m`:t/1e3+` km`;this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t=e*3.2808399,n,r,i;t>5280?(n=t/5280,r=this._getRoundNum(n),this._updateScale(this._iScale,r+` mi`,r/n)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+` ft`,i/t))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+`px`,e.innerHTML=t},_getRoundNum:function(e){var t=10**((Math.floor(e)+``).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),yn=function(e){return new vn(e)},bn=fn.extend({options:{position:`bottomright`,prefix:`<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">`+(A.inlineSvg?`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> `:``)+`Leaflet</a>`},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=P(`div`,`leaflet-control-attribution`),tn(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on(`layeradd`,this._addAttribution,this),this._container},onRemove:function(e){e.off(`layeradd`,this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once(`remove`,function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(`, `)),this._container.innerHTML=n.join(` <span aria-hidden="true">|</span> `)}}});K.mergeOptions({attributionControl:!0}),K.addInitHook(function(){this.options.attributionControl&&new bn().addTo(this)}),fn.Layers=mn,fn.Zoom=gn,fn.Scale=vn,fn.Attribution=bn,pn.layers=hn,pn.zoom=_n,pn.scale=yn,pn.attribution=function(e){return new bn(e)};var xn=le.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xn.addTo=function(e,t){return e.addHandler(t,this),this};var Sn={Events:y},Cn=A.touch?`touchstart mousedown`:`mousedown`,wn=de.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||=(U(this._dragStartTarget,Cn,this._onDown,this),!0)},disable:function(){this._enabled&&(wn._dragging===this&&this.finishDrag(!0),W(this._dragStartTarget,Cn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!I(this._element,`leaflet-zoom-anim`))){if(e.touches&&e.touches.length!==1){wn._dragging===this&&this.finishDrag();return}if(!(wn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(wn._dragging=this,this._preventOutline&&Ut(this._element),zt(),Ft(),!this._moving)){this.fire(`down`);var t=e.touches?e.touches[0]:e,n=Gt(this._element);this._startPoint=new b(t.clientX,t.clientY),this._startPos=Pt(this._element),this._parentScale=Kt(n);var r=e.type===`mousedown`;U(document,r?`mousemove`:`touchmove`,this._onMove,this),U(document,r?`mouseup`:`touchend touchcancel`,this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,n=new b(t.clientX,t.clientY)._subtract(this._startPoint);!n.x&&!n.y||Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,G(e),this._moved||(this.fire(`dragstart`),this._moved=!0,R(document.body,`leaflet-dragging`),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),R(this._lastTarget,`leaflet-drag-target`)),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition())}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire(`predrag`,e),H(this._element,this._newPos),this.fire(`drag`,e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){z(document.body,`leaflet-dragging`),this._lastTarget&&=(z(this._lastTarget,`leaflet-drag-target`),null),W(document,`mousemove touchmove`,this._onMove,this),W(document,`mouseup touchend touchcancel`,this._onUp,this),Bt(),It();var t=this._moved&&this._moving;this._moving=!1,wn._dragging=!1,t&&this.fire(`dragend`,{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function Tn(e,t,n){var r,i=[1,4,2,8],a,o,s,c,l,u,d,f;for(a=0,u=e.length;a<u;a++)e[a]._code=Rn(e[a],t);for(s=0;s<4;s++){for(d=i[s],r=[],a=0,u=e.length,o=u-1;a<u;o=a++)c=e[a],l=e[o],c._code&d?l._code&d||(f=Ln(l,c,d,t,n),f._code=Rn(f,t),r.push(f)):(l._code&d&&(f=Ln(l,c,d,t,n),f._code=Rn(f,t),r.push(f)),r.push(c));e=r}return e}function En(e,t){var n,r,i,a,o,s,c,l,u;if(!e||e.length===0)throw Error(`latlngs not passed`);q(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var d=D([0,0]),f=T(e);f.getNorthWest().distanceTo(f.getSouthWest())*f.getNorthEast().distanceTo(f.getNorthWest())<1700&&(d=Dn(e));var p=e.length,m=[];for(n=0;n<p;n++){var ee=D(e[n]);m.push(t.project(D([ee.lat-d.lat,ee.lng-d.lng])))}for(s=c=l=0,n=0,r=p-1;n<p;r=n++)i=m[n],a=m[r],o=i.y*a.x-a.y*i.x,c+=(i.x+a.x)*o,l+=(i.y+a.y)*o,s+=o*3;u=s===0?m[0]:[c/s,l/s];var h=t.unproject(x(u));return D([h.lat+d.lat,h.lng+d.lng])}function Dn(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=D(e[i]);t+=a.lat,n+=a.lng,r++}return D([t/r,n/r])}var On={__proto__:null,clipPolygon:Tn,polygonCenter:En,centroid:Dn};function kn(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=Pn(e,n),e=Mn(e,n),e}function An(e,t,n){return Math.sqrt(Bn(e,t,n,!0))}function jn(e,t,n){return Bn(e,t,n)}function Mn(e,t){var n=e.length,r=new(typeof Uint8Array<`u`?Uint8Array:Array)(n);r[0]=r[n-1]=1,Nn(e,r,t,0,n-1);var i,a=[];for(i=0;i<n;i++)r[i]&&a.push(e[i]);return a}function Nn(e,t,n,r,i){var a=0,o,s,c;for(s=r+1;s<=i-1;s++)c=Bn(e[s],e[r],e[i],!0),c>a&&(o=s,a=c);a>n&&(t[o]=1,Nn(e,t,n,r,o),Nn(e,t,n,o,i))}function Pn(e,t){for(var n=[e[0]],r=1,i=0,a=e.length;r<a;r++)zn(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<a-1&&n.push(e[a-1]),n}var Fn;function In(e,t,n,r,i){var a=r?Fn:Rn(e,n),o=Rn(t,n),s,c,l;for(Fn=o;;){if(!(a|o))return[e,t];if(a&o)return!1;s=a||o,c=Ln(e,t,s,n,i),l=Rn(c,n),s===a?(e=c,a=l):(t=c,o=l)}}function Ln(e,t,n,r,i){var a=t.x-e.x,o=t.y-e.y,s=r.min,c=r.max,l,u;return n&8?(l=e.x+a*(c.y-e.y)/o,u=c.y):n&4?(l=e.x+a*(s.y-e.y)/o,u=s.y):n&2?(l=c.x,u=e.y+o*(c.x-e.x)/a):n&1&&(l=s.x,u=e.y+o*(s.x-e.x)/a),new b(l,u,i)}function Rn(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function zn(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function Bn(e,t,n,r){var i=t.x,a=t.y,o=n.x-i,s=n.y-a,c=o*o+s*s,l;return c>0&&(l=((e.x-i)*o+(e.y-a)*s)/c,l>1?(i=n.x,a=n.y):l>0&&(i+=o*l,a+=s*l)),o=e.x-i,s=e.y-a,r?o*o+s*s:new b(i,a)}function q(e){return!g(e[0])||typeof e[0][0]!=`object`&&e[0][0]!==void 0}function Vn(e){return console.warn(`Deprecated use of _flat, please use L.LineUtil.isFlat instead.`),q(e)}function Hn(e,t){var n,r,i,a,o,s,c,l;if(!e||e.length===0)throw Error(`latlngs not passed`);q(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var u=D([0,0]),d=T(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=Dn(e));var f=e.length,p=[];for(n=0;n<f;n++){var m=D(e[n]);p.push(t.project(D([m.lat-u.lat,m.lng-u.lng])))}for(n=0,r=0;n<f-1;n++)r+=p[n].distanceTo(p[n+1])/2;if(r===0)l=p[0];else for(n=0,a=0;n<f-1;n++)if(o=p[n],s=p[n+1],i=o.distanceTo(s),a+=i,a>r){c=(a-r)/i,l=[s.x-c*(s.x-o.x),s.y-c*(s.y-o.y)];break}var ee=t.unproject(x(l));return D([ee.lat+u.lat,ee.lng+u.lng])}var Un={__proto__:null,simplify:kn,pointToSegmentDistance:An,closestPointOnSegment:jn,clipSegment:In,_getEdgeIntersection:Ln,_getBitCode:Rn,_sqClosestPointOnSegment:Bn,isFlat:q,_flat:Vn,polylineCenter:Hn},Wn={project:function(e){return new b(e.lng,e.lat)},unproject:function(e){return new E(e.y,e.x)},bounds:new S([-180,-90],[180,90])},Gn={R:6378137,R_MINOR:6356752.314245179,bounds:new S([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,a=Math.sqrt(1-i*i),o=a*Math.sin(r),s=Math.tan(Math.PI/4-r/2)/((1-o)/(1+o))**(a/2);return r=-n*Math.log(Math.max(s,1e-10)),new b(e.lng*t*n,r)},unproject:function(e){for(var t=180/Math.PI,n=this.R,r=this.R_MINOR/n,i=Math.sqrt(1-r*r),a=Math.exp(-e.y/n),o=Math.PI/2-2*Math.atan(a),s=0,c=.1,l;s<15&&Math.abs(c)>1e-7;s++)l=i*Math.sin(o),l=((1-l)/(1+l))**(i/2),c=Math.PI/2-2*Math.atan(a*l)-o,o+=c;return new E(o*t,e.x*t/n)}},Kn={__proto__:null,LonLat:Wn,Mercator:Gn,SphericalMercator:ge},qn=n({},me,{code:`EPSG:3395`,projection:Gn,transformation:function(){var e=.5/(Math.PI*Gn.R);return ve(e,.5,-e,.5)}()}),Jn=n({},me,{code:`EPSG:4326`,projection:Wn,transformation:ve(1/180,1,-1/180,.5)}),Yn=n({},pe,{projection:Wn,transformation:ve(1,0,-1,0),scale:function(e){return 2**e},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});pe.Earth=me,pe.EPSG3395=qn,pe.EPSG3857=ye,pe.EPSG900913=be,pe.EPSG4326=Jn,pe.Simple=Yn;var J=de.extend({options:{pane:`overlayPane`,attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[o(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[o(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once(`remove`,function(){t.off(n,this)},this)}this.onAdd(t),this.fire(`add`),t.fire(`layeradd`,{layer:this})}}});K.include({addLayer:function(e){if(!e._layerAdd)throw Error(`The provided object is not a Layer.`);var t=o(e);return this._layers[t]?this:(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var t=o(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire(`layerremove`,{layer:e}),e.fire(`remove`)),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return o(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?g(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){(!isNaN(e.options.maxZoom)||!isNaN(e.options.minZoom))&&(this._zoomBoundLayers[o(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=o(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;e=i.minZoom===void 0?e:Math.min(e,i.minZoom),t=i.maxZoom===void 0?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire(`zoomlevelschange`),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Xn=J.extend({initialize:function(e,t){p(this,t),this._layers={};var n,r;if(e)for(n=0,r=e.length;n<r;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return(typeof e==`number`?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t=Array.prototype.slice.call(arguments,1),n,r;for(n in this._layers)r=this._layers[n],r[e]&&r[e].apply(r,t);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke(`setZIndex`,e)},getLayerId:function(e){return o(e)}}),Zn=function(e,t){return new Xn(e,t)},Y=Xn.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Xn.prototype.addLayer.call(this,e),this.fire(`layeradd`,{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Xn.prototype.removeLayer.call(this,e),this.fire(`layerremove`,{layer:e})):this},setStyle:function(e){return this.invoke(`setStyle`,e)},bringToFront:function(){return this.invoke(`bringToFront`)},bringToBack:function(){return this.invoke(`bringToBack`)},getBounds:function(){var e=new w;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),Qn=function(e,t){return new Y(e,t)},$n=le.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){p(this,e)},createIcon:function(e){return this._createIcon(`icon`,e)},createShadow:function(e){return this._createIcon(`shadow`,e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e===`icon`)throw Error(`iconUrl not set in Icon options (see the docs).`);return null}var r=this._createImg(n,t&&t.tagName===`IMG`?t:null);return this._setIconStyles(r,e),(this.options.crossOrigin||this.options.crossOrigin===``)&&(r.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),r},_setIconStyles:function(e,t){var n=this.options,r=n[t+`Size`];typeof r==`number`&&(r=[r,r]);var i=x(r),a=x(t===`shadow`&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));e.className=`leaflet-marker-`+t+` `+(n.className||``),a&&(e.style.marginLeft=-a.x+`px`,e.style.marginTop=-a.y+`px`),i&&(e.style.width=i.x+`px`,e.style.height=i.y+`px`)},_createImg:function(e,t){return t||=document.createElement(`img`),t.src=e,t},_getIconUrl:function(e){return A.retina&&this.options[e+`RetinaUrl`]||this.options[e+`Url`]}});function er(e){return new $n(e)}var X=$n.extend({options:{iconUrl:`marker-icon.png`,iconRetinaUrl:`marker-icon-2x.png`,shadowUrl:`marker-shadow.png`,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return typeof X.imagePath!=`string`&&(X.imagePath=this._detectIconPath()),(this.options.imagePath||X.imagePath)+$n.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var r=t.exec(e);return r&&r[n]};return e=t(e,/^url\((['"])?(.+)\1\)$/,2),e&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=P(`div`,`leaflet-default-icon-path`,document.body),t=Et(e,`background-image`)||Et(e,`backgroundImage`);if(document.body.removeChild(e),t=this._stripUrl(t),t)return t;var n=document.querySelector(`link[href$="leaflet.css"]`);return n?n.href.substring(0,n.href.length-11-1):``}}),tr=xn.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||=new wn(e,e,!0),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),R(e,`leaflet-marker-draggable`)},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&z(this._marker._icon,`leaflet-marker-draggable`)},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,a=Pt(t._icon),o=n.getPixelBounds(),s=n.getPixelOrigin(),c=C(o.min._subtract(s).add(i),o.max._subtract(s).subtract(i));if(!c.contains(a)){var l=x((Math.max(c.max.x,a.x)-c.max.x)/(o.max.x-c.max.x)-(Math.min(c.min.x,a.x)-c.min.x)/(o.min.x-c.min.x),(Math.max(c.max.y,a.y)-c.max.y)/(o.max.y-c.max.y)-(Math.min(c.min.y,a.y)-c.min.y)/(o.min.y-c.min.y)).multiplyBy(r);n.panBy(l,{animate:!1}),this._draggable._newPos._add(l),this._draggable._startPos._add(l),H(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=_(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire(`movestart`).fire(`dragstart`)},_onPreDrag:function(e){this._marker.options.autoPan&&(v(this._panRequest),this._panRequest=_(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,r=Pt(t._icon),i=t._map.layerPointToLatLng(r);n&&H(n,r),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire(`move`,e).fire(`drag`,e)},_onDragEnd:function(e){v(this._panRequest),delete this._oldLatLng,this._marker.fire(`moveend`).fire(`dragend`,e)}}),Z=J.extend({options:{icon:new X,interactive:!0,keyboard:!0,title:``,alt:`Marker`,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:`markerPane`,shadowPane:`shadowPane`,bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){p(this,t),this._latlng=D(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on(`zoomanim`,this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off(`zoomanim`,this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=D(e),this.update(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t=`leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`),n=e.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,e.title&&(n.title=e.title),n.tagName===`IMG`&&(n.alt=e.alt||``)),R(n,t),e.keyboard&&(n.tabIndex=`0`,n.setAttribute(`role`,`button`)),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&U(n,`focus`,this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),a=!1;i!==this._shadow&&(this._removeShadow(),a=!0),i&&(R(i,t),i.alt=``),this._shadow=i,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&a&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&W(this._icon,`focus`,this._panOnFocus,this),F(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&F(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&H(this._icon,e),this._shadow&&H(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(R(this._icon,`leaflet-interactive`),this.addInteractiveTarget(this._icon),tr)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new tr(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&B(this._icon,e),this._shadow&&B(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?x(t.iconSize):x(0,0),r=t.iconAnchor?x(t.iconAnchor):x(0,0);e.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:n.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function nr(e,t){return new Z(e,t)}var rr=J.extend({options:{stroke:!0,color:`#3388ff`,weight:3,opacity:1,lineCap:`round`,lineJoin:`round`,dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:`evenodd`,interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return p(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,`weight`)&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Q=rr.extend({options:{fill:!0,radius:10},initialize:function(e,t){p(this,t),this._latlng=D(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=D(e),this.redraw(),this.fire(`move`,{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return rr.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),r=[e+n,t+n];this._pxBounds=new S(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ir(e,t){return new Q(e,t)}var ar=Q.extend({initialize:function(e,t,r){if(typeof t==`number`&&(t=n({},r,{radius:t})),p(this,t),this._latlng=D(e),isNaN(this.options.radius))throw Error(`Circle radius cannot be NaN`);this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new w(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:rr.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===me.distance){var i=Math.PI/180,a=this._mRadius/me.R/i,o=n.project([t+a,e]),s=n.project([t-a,e]),c=o.add(s).divideBy(2),l=n.unproject(c).lat,u=Math.acos((Math.cos(a*i)-Math.sin(t*i)*Math.sin(l*i))/(Math.cos(t*i)*Math.cos(l*i)))/i;(isNaN(u)||u===0)&&(u=a/Math.cos(Math.PI/180*t)),this._point=c.subtract(n.getPixelOrigin()),this._radius=isNaN(u)?0:c.x-n.project([l,e-u]).x,this._radiusY=c.y-o.y}else{var d=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}});function or(e,t,n){return new ar(e,t,n)}var sr=rr.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){p(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t=1/0,n=null,r=Bn,i,a,o=0,s=this._parts.length;o<s;o++)for(var c=this._parts[o],l=1,u=c.length;l<u;l++){i=c[l-1],a=c[l];var d=r(e,i,a,!0);d<t&&(t=d,n=r(e,i,a))}return n&&(n.distance=Math.sqrt(t)),n},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return Hn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t||=this._defaultShape(),e=D(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new w,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return q(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=q(e),r=0,i=e.length;r<i;r++)n?(t[r]=D(e[r]),this._bounds.extend(t[r])):t[r]=this._convertLatLngs(e[r]);return t},_project:function(){var e=new S;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new b(e,e);this._rawPxBounds&&(this._pxBounds=new S([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var r=e[0]instanceof E,i=e.length,a,o;if(r){for(o=[],a=0;a<i;a++)o[a]=this._map.latLngToLayerPoint(e[a]),n.extend(o[a]);t.push(o)}else for(a=0;a<i;a++)this._projectLatlngs(e[a],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}var t=this._parts,n,r,i,a,o,s,c;for(n=0,i=0,a=this._rings.length;n<a;n++)for(c=this._rings[n],r=0,o=c.length;r<o-1;r++)s=In(c[r],c[r+1],e,r,!0),s&&(t[i]=t[i]||[],t[i].push(s[0]),(s[1]!==c[r+1]||r===o-2)&&(t[i].push(s[1]),i++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,r=e.length;n<r;n++)e[n]=kn(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,r,i,a,o,s,c=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=this._parts[n],r=0,o=s.length,i=o-1;r<o;i=r++)if(!(!t&&r===0)&&An(e,s[i],s[r])<=c)return!0;return!1}});function cr(e,t){return new sr(e,t)}sr._flat=Vn;var lr=sr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw Error(`Must add layer to map before using getCenter()`);return En(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=sr.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof E&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){sr.prototype._setLatLngs.call(this,e),q(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return q(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new b(t,t);if(e=new S(e.min.subtract(n),e.max.add(n)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,i=this._rings.length,a;r<i;r++)a=Tn(this._rings[r],e,!0),a.length&&this._parts.push(a)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t=!1,n,r,i,a,o,s,c,l;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(a=0,c=this._parts.length;a<c;a++)for(n=this._parts[a],o=0,l=n.length,s=l-1;o<l;s=o++)r=n[o],i=n[s],r.y>e.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(t=!t);return t||sr.prototype._containsPoint.call(this,e,!0)}});function ur(e,t){return new lr(e,t)}var dr=Y.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=g(e)?e:e.features,n,r,i;if(t){for(n=0,r=t.length;n<r;n++)i=t[n],(i.geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var a=this.options;if(a.filter&&!a.filter(e))return this;var o=fr(e,a);return o?(o.feature=yr(e),o.defaultOptions=o.options,this.resetStyle(o),a.onEachFeature&&a.onEachFeature(e,o),this.addLayer(o)):this},resetStyle:function(e){return e===void 0?this.eachLayer(this.resetStyle,this):(e.options=n({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&(typeof t==`function`&&(t=t(e.feature)),e.setStyle(t))}});function fr(e,t){var n=e.type===`Feature`?e.geometry:e,r=n?n.coordinates:null,i=[],a=t&&t.pointToLayer,o=t&&t.coordsToLatLng||mr,s,c,l,u;if(!r&&!n)return null;switch(n.type){case`Point`:return s=o(r),pr(a,e,s,t);case`MultiPoint`:for(l=0,u=r.length;l<u;l++)s=o(r[l]),i.push(pr(a,e,s,t));return new Y(i);case`LineString`:case`MultiLineString`:return c=hr(r,n.type===`LineString`?0:1,o),new sr(c,t);case`Polygon`:case`MultiPolygon`:return c=hr(r,n.type===`Polygon`?1:2,o),new lr(c,t);case`GeometryCollection`:for(l=0,u=n.geometries.length;l<u;l++){var d=fr({geometry:n.geometries[l],type:`Feature`,properties:e.properties},t);d&&i.push(d)}return new Y(i);case`FeatureCollection`:for(l=0,u=n.features.length;l<u;l++){var f=fr(n.features[l],t);f&&i.push(f)}return new Y(i);default:throw Error(`Invalid GeoJSON object.`)}}function pr(e,t,n,r){return e?e(t,n):new Z(n,r&&r.markersInheritOptions&&r)}function mr(e){return new E(e[1],e[0],e[2])}function hr(e,t,n){for(var r=[],i=0,a=e.length,o;i<a;i++)o=t?hr(e[i],t-1,n):(n||mr)(e[i]),r.push(o);return r}function gr(e,t){return e=D(e),e.alt===void 0?[u(e.lng,t),u(e.lat,t)]:[u(e.lng,t),u(e.lat,t),u(e.alt,t)]}function _r(e,t,n,r){for(var i=[],a=0,o=e.length;a<o;a++)i.push(t?_r(e[a],q(e[a])?0:t-1,n,r):gr(e[a],r));return!t&&n&&i.length>0&&i.push(i[0].slice()),i}function vr(e,t){return e.feature?n({},e.feature,{geometry:t}):yr(t)}function yr(e){return e.type===`Feature`||e.type===`FeatureCollection`?e:{type:`Feature`,properties:{},geometry:e}}var br={toGeoJSON:function(e){return vr(this,{type:`Point`,coordinates:gr(this.getLatLng(),e)})}};Z.include(br),ar.include(br),Q.include(br),sr.include({toGeoJSON:function(e){var t=!q(this._latlngs),n=_r(this._latlngs,+!!t,!1,e);return vr(this,{type:(t?`Multi`:``)+`LineString`,coordinates:n})}}),lr.include({toGeoJSON:function(e){var t=!q(this._latlngs),n=t&&!q(this._latlngs[0]),r=_r(this._latlngs,n?2:+!!t,!0,e);return t||(r=[r]),vr(this,{type:(n?`Multi`:``)+`Polygon`,coordinates:r})}}),Xn.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),vr(this,{type:`MultiPoint`,coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(t===`MultiPoint`)return this.toMultiPoint(e);var n=t===`GeometryCollection`,r=[];return this.eachLayer(function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var a=yr(i);a.type===`FeatureCollection`?r.push.apply(r,a.features):r.push(a)}}}),n?vr(this,{geometries:r,type:`GeometryCollection`}):{type:`FeatureCollection`,features:r}}});function xr(e,t){return new dr(e,t)}var Sr=xr,Cr=J.extend({options:{opacity:1,alt:``,interactive:!1,crossOrigin:!1,errorOverlayUrl:``,zIndex:1,className:``},initialize:function(e,t,n){this._url=e,this._bounds=T(t),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(R(this._image,`leaflet-interactive`),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){F(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&Ot(this._image),this},bringToBack:function(){return this._map&&kt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=T(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName===`IMG`,t=this._image=e?this._url:P(`img`);if(R(t,`leaflet-image-layer`),this._zoomAnimated&&R(t,`leaflet-zoom-animated`),this.options.className&&R(t,this.options.className),t.onselectstart=l,t.onmousemove=l,t.onload=i(this.fire,this,`load`),t.onerror=i(this._overlayOnError,this,`error`),(this.options.crossOrigin||this.options.crossOrigin===``)&&(t.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;V(this._image,n,t)},_reset:function(){var e=this._image,t=new S(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();H(e,t.min),e.style.width=n.x+`px`,e.style.height=n.y+`px`},_updateOpacity:function(){B(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire(`error`);var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),wr=function(e,t,n){return new Cr(e,t,n)},Tr=Cr.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName===`VIDEO`,t=this._image=e?this._url:P(`video`);if(R(t,`leaflet-image-layer`),this._zoomAnimated&&R(t,`leaflet-zoom-animated`),this.options.className&&R(t,this.options.className),t.onselectstart=l,t.onmousemove=l,t.onloadeddata=i(this.fire,this,`load`),e){for(var n=t.getElementsByTagName(`source`),r=[],a=0;a<n.length;a++)r.push(n[a].src);this._url=n.length>0?r:[t.src];return}g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,`objectFit`)&&(t.style.objectFit=`fill`),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var o=0;o<this._url.length;o++){var s=P(`source`);s.src=this._url[o],t.appendChild(s)}}});function Er(e,t,n){return new Tr(e,t,n)}var Dr=Cr.extend({_initImage:function(){var e=this._image=this._url;R(e,`leaflet-image-layer`),this._zoomAnimated&&R(e,`leaflet-zoom-animated`),this.options.className&&R(e,this.options.className),e.onselectstart=l,e.onmousemove=l}});function Or(e,t,n){return new Dr(e,t,n)}var kr=J.extend({options:{interactive:!1,offset:[0,0],className:``,pane:void 0,content:``},initialize:function(e,t){e&&(e instanceof E||g(e))?(this._latlng=D(e),p(this,t)):(p(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&B(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&B(this._container,1),this.bringToFront(),this.options.interactive&&(R(this._container,`leaflet-interactive`),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(B(this._container,0),this._removeTimeout=setTimeout(i(F,void 0,this._container),200)):F(this._container),this.options.interactive&&(z(this._container,`leaflet-interactive`),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=D(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility=`hidden`,this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility=``,this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Ot(this._container),this},bringToBack:function(){return this._map&&kt(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Y){t=null;var n=this._source._layers;for(var r in n)if(n[r]._map){t=n[r];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else if(t.getBounds)e=t.getBounds().getCenter();else throw Error(`Unable to get source layer LatLng.`);return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t=typeof this._content==`function`?this._content(this._source||this):this._content;if(typeof t==`string`)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire(`contentupdate`)}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=x(this.options.offset),n=this._getAnchor();this._zoomAnimated?H(this._container,e.add(n)):t=t.add(e).add(n);var r=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=r+`px`,this._container.style.left=i+`px`}},_getAnchor:function(){return[0,0]}});K.include({_initOverlay:function(e,t,n,r){var i=t;return i instanceof e||(i=new e(r).setContent(t)),n&&i.setLatLng(n),i}}),J.include({_initOverlay:function(e,t,n,r){var i=n;return i instanceof e?(p(i,r),i._source=this):(i=t&&!r?t:new e(r,this),i.setContent(n)),i}});var Ar=kr.extend({options:{pane:`popupPane`,offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:``},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,kr.prototype.openOn.call(this,e)},onAdd:function(e){kr.prototype.onAdd.call(this,e),e.fire(`popupopen`,{popup:this}),this._source&&(this._source.fire(`popupopen`,{popup:this},!0),this._source instanceof rr||this._source.on(`preclick`,$t))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire(`popupclose`,{popup:this}),this._source&&(this._source.fire(`popupclose`,{popup:this},!0),this._source instanceof rr||this._source.off(`preclick`,$t))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return(this.options.closeOnClick===void 0?this._map.options.closePopupOnClick:this.options.closeOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e=`leaflet-popup`,t=this._container=P(`div`,e+` `+(this.options.className||``)+` leaflet-zoom-animated`),n=this._wrapper=P(`div`,e+`-content-wrapper`,t);if(this._contentNode=P(`div`,e+`-content`,n),tn(t),en(this._contentNode),U(t,`contextmenu`,$t),this._tipContainer=P(`div`,e+`-tip-container`,t),this._tip=P(`div`,e+`-tip`,this._tipContainer),this.options.closeButton){var r=this._closeButton=P(`a`,e+`-close-button`,t);r.setAttribute(`role`,`button`),r.setAttribute(`aria-label`,`Close popup`),r.href=`#close`,r.innerHTML=`<span aria-hidden="true">×</span>`,U(r,`click`,function(e){G(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width=``,t.whiteSpace=`nowrap`;var n=e.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),t.width=n+1+`px`,t.whiteSpace=``,t.height=``;var r=e.offsetHeight,i=this.options.maxHeight,a=`leaflet-popup-scrolled`;i&&r>i?(t.height=i+`px`,R(e,a)):z(e,a),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();H(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,t=parseInt(Et(this._container,`marginBottom`),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new b(this._containerLeft,-n-this._containerBottom);i._add(Pt(this._container));var a=e.layerPointToContainerPoint(i),o=x(this.options.autoPanPadding),s=x(this.options.autoPanPaddingTopLeft||o),c=x(this.options.autoPanPaddingBottomRight||o),l=e.getSize(),u=0,d=0;a.x+r+c.x>l.x&&(u=a.x+r-l.x+c.x),a.x-u-s.x<0&&(u=a.x-s.x),a.y+n+c.y>l.y&&(d=a.y+n-l.y+c.y),a.y-d-s.y<0&&(d=a.y-s.y),(u||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire(`autopanstart`).panBy([u,d]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),jr=function(e,t){return new Ar(e,t)};K.mergeOptions({closePopupOnClick:!0}),K.include({openPopup:function(e,t,n){return this._initOverlay(Ar,e,t,n).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),J.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Ar,this._popup,e,t),this._popupHandlersAdded||=(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),!0),this},unbindPopup:function(){return this._popup&&=(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,null),this},openPopup:function(e){return this._popup&&(this instanceof Y||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){nn(e);var t=e.layer||e.target;if(this._popup._source===t&&!(t instanceof rr)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=t,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var Mr=kr.extend({options:{pane:`tooltipPane`,offset:[0,0],direction:`auto`,permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){kr.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire(`tooltipopen`,{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire(`tooltipopen`,{tooltip:this},!0))},onRemove:function(e){kr.prototype.onRemove.call(this,e),e.fire(`tooltipclose`,{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire(`tooltipclose`,{tooltip:this},!0))},getEvents:function(){var e=kr.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e=`leaflet-tooltip `+(this.options.className||``)+` leaflet-zoom-`+(this._zoomAnimated?`animated`:`hide`);this._contentNode=this._container=P(`div`,e),this._container.setAttribute(`role`,`tooltip`),this._container.setAttribute(`id`,`leaflet-tooltip-`+o(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,a=r.latLngToContainerPoint(r.getCenter()),o=r.layerPointToContainerPoint(e),s=this.options.direction,c=i.offsetWidth,l=i.offsetHeight,u=x(this.options.offset),d=this._getAnchor();s===`top`?(t=c/2,n=l):s===`bottom`?(t=c/2,n=0):s===`center`?(t=c/2,n=l/2):s===`right`?(t=0,n=l/2):s===`left`?(t=c,n=l/2):o.x<a.x?(s=`right`,t=0,n=l/2):(s=`left`,t=c+(u.x+d.x)*2,n=l/2),e=e.subtract(x(t,n,!0)).add(u).add(d),z(i,`leaflet-tooltip-right`),z(i,`leaflet-tooltip-left`),z(i,`leaflet-tooltip-top`),z(i,`leaflet-tooltip-bottom`),R(i,`leaflet-tooltip-`+s),H(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&B(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return x(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Nr=function(e,t){return new Mr(e,t)};K.include({openTooltip:function(e,t,n){return this._initOverlay(Mr,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),J.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Mr,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&=(this._initTooltipInteractions(!0),this.closeTooltip(),null),this},_initTooltipInteractions:function(e){if(!(!e&&this._tooltipHandlersAdded)){var t=e?`off`:`on`,n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[t](n),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Y||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&(U(t,`focus`,function(){this._tooltip._source=e,this.openTooltip()},this),U(t,`blur`,this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t=typeof e.getElement==`function`&&e.getElement();t&&t.setAttribute(`aria-describedby`,this._tooltip._container.id)},_openTooltip:function(e){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once(`moveend`,function(){t._openOnceFlag=!1,t._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var t=e.latlng,n,r;this._tooltip.options.sticky&&e.originalEvent&&(n=this._map.mouseEventToContainerPoint(e.originalEvent),r=this._map.containerPointToLayerPoint(n),t=this._map.layerPointToLatLng(r)),this._tooltip.setLatLng(t)}});var Pr=$n.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:`leaflet-div-icon`},createIcon:function(e){var t=e&&e.tagName===`DIV`?e:document.createElement(`div`),n=this.options;if(n.html instanceof Element?(Dt(t),t.appendChild(n.html)):t.innerHTML=n.html===!1?``:n.html,n.bgPos){var r=x(n.bgPos);t.style.backgroundPosition=-r.x+`px `+-r.y+`px`}return this._setIconStyles(t,`icon`),t},createShadow:function(){return null}});function Fr(e){return new Pr(e)}$n.Default=X;var Ir=J.extend({options:{tileSize:256,opacity:1,updateWhenIdle:A.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:`tilePane`,className:``,keepBuffer:2},initialize:function(e){p(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),F(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ot(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(kt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||=s(this._onMoveEnd,this.options.updateInterval,this),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement(`div`)},getTileSize:function(){var e=this.options.tileSize;return e instanceof b?e:new b(e,e)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t=this.getPane().children,n=-e(-1/0,1/0),r=0,i=t.length,a;r<i;r++)a=t[r].style.zIndex,t[r]!==this._container&&a&&(n=e(n,+a));isFinite(n)&&(this.options.zIndex=n+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!A.ielt9){B(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(!(!i.current||!i.loaded)){var a=Math.min(1,(e-i.loaded)/200);B(i.el,a),a<1?t=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(v(this._fadeFrame),this._fadeFrame=_(this._updateOpacity,this))}},_onOpaqueTile:l,_initContainer:function(){this._container||(this._container=P(`div`,`leaflet-layer `+(this.options.className||``)),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(e!==void 0){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(F(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[e],i=this._map;return r||(r=this._levels[e]={},r.el=P(`div`,`leaflet-tile-container leaflet-zoom-animated`,this._container),r.el.style.zIndex=t,r.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),r.zoom=e,this._setZoomTransform(r,i.getCenter(),i.getZoom()),r.el.offsetWidth,this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:l,_onRemoveLevel:l,_onCreateLevel:l,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom){this._removeAllTiles();return}for(e in this._tiles)t=this._tiles[e],t.retain=t.current;for(e in this._tiles)if(t=this._tiles[e],t.current&&!t.active){var r=t.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)F(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,r){var i=Math.floor(e/2),a=Math.floor(t/2),o=n-1,s=new b(+i,+a);s.z=+o;var c=this._tileCoordsToKey(s),l=this._tiles[c];return l&&l.active?(l.retain=!0,!0):(l&&l.loaded&&(l.retain=!0),o>r&&this._retainParent(i,a,o,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var a=2*t;a<2*t+2;a++){var o=new b(i,a);o.z=n+1;var s=this._tileCoordsToKey(o),c=this._tiles[s];if(c&&c.active){c.retain=!0;continue}else c&&c.loaded&&(c.retain=!0);n+1<r&&this._retainChildren(i,a,n+1,r)}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return t.minNativeZoom!==void 0&&e<t.minNativeZoom?t.minNativeZoom:t.maxNativeZoom!==void 0&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,r){var i=Math.round(t);i=this.options.maxZoom!==void 0&&i>this.options.maxZoom||this.options.minZoom!==void 0&&i<this.options.minZoom?void 0:this._clampZoom(i);var a=this.options.updateWhenZooming&&i!==this._tileZoom;(!r||a)&&(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),i!==void 0&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var r=this._map.getZoomScale(n,e.zoom),i=e.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,n)).round();A.any3d?V(e.el,i,r):H(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],r).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],r).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],r).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),r=t.getZoomScale(n,this._tileZoom),i=t.project(e,this._tileZoom).floor(),a=t.getSize().divideBy(r*2);return new S(i.subtract(a),i.add(a))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(e===void 0&&(e=t.getCenter()),this._tileZoom!==void 0){var r=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(r),a=i.getCenter(),o=[],s=this.options.keepBuffer,c=new S(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw Error(`Attempted to load an infinite number of tiles`);for(var l in this._tiles){var u=this._tiles[l].coords;(u.z!==this._tileZoom||!c.contains(new b(u.x,u.y)))&&(this._tiles[l].current=!1)}if(Math.abs(n-this._tileZoom)>1){this._setView(e,n);return}for(var d=i.min.y;d<=i.max.y;d++)for(var f=i.min.x;f<=i.max.x;f++){var p=new b(f,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:o.push(p)}}if(o.sort(function(e,t){return e.distanceTo(a)-t.distanceTo(a)}),o.length!==0){this._loading||(this._loading=!0,this.fire(`loading`));var ee=document.createDocumentFragment();for(f=0;f<o.length;f++)this._addTile(o[f],ee);this._level.el.appendChild(ee)}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return T(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new w(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+`:`+e.y+`:`+e.z},_keyToTileCoords:function(e){var t=e.split(`:`),n=new b(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(F(t.el),delete this._tiles[e],this.fire(`tileunload`,{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){R(e,`leaflet-tile`);var t=this.getTileSize();e.style.width=t.x+`px`,e.style.height=t.y+`px`,e.onselectstart=l,e.onmousemove=l,A.ielt9&&this.options.opacity<1&&B(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),a=this.createTile(this._wrapCoords(e),i(this._tileReady,this,e));this._initTile(a),this.createTile.length<2&&_(i(this._tileReady,this,e,null,a)),H(a,n),this._tiles[r]={el:a,coords:e,current:!0},t.appendChild(a),this.fire(`tileloadstart`,{tile:a,coords:e})},_tileReady:function(e,t,n){t&&this.fire(`tileerror`,{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);n=this._tiles[r],n&&(n.loaded=+new Date,this._map._fadeAnimated?(B(n.el,0),v(this._fadeFrame),this._fadeFrame=_(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(R(n.el,`leaflet-tile-loaded`),this.fire(`tileload`,{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire(`load`),A.ielt9||!this._map._fadeAnimated?_(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new b(this._wrapX?c(e.x,this._wrapX):e.x,this._wrapY?c(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new S(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Lr(e){return new Ir(e)}var Rr=Ir.extend({options:{minZoom:0,maxZoom:18,subdomains:`abc`,errorTileUrl:``,zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,t=p(this,t),t.detectRetina&&A.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),typeof t.subdomains==`string`&&(t.subdomains=t.subdomains.split(``)),this.on(`tileunload`,this._onTileRemove)},setUrl:function(e,t){return this._url===e&&t===void 0&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement(`img`);return U(n,`load`,i(this._tileOnLoad,this,t,n)),U(n,`error`,i(this._tileOnError,this,t,n)),(this.options.crossOrigin||this.options.crossOrigin===``)&&(n.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),typeof this.options.referrerPolicy==`string`&&(n.referrerPolicy=this.options.referrerPolicy),n.alt=``,n.src=this.getTileUrl(e),n},getTileUrl:function(e){var t={r:A.retina?`@2x`:``,s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=r),t[`-y`]=r}return h(this._url,n(t,this.options))},_tileOnLoad:function(e,t){A.ielt9?setTimeout(i(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute(`src`)!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom,n=this.options.zoomReverse,r=this.options.zoomOffset;return n&&(e=t-e),e+r},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(t=this._tiles[e].el,t.onload=l,t.onerror=l,!t.complete)){t.src=ne;var n=this._tiles[e].coords;F(t),delete this._tiles[e],this.fire(`tileabort`,{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute(`src`,ne),Ir.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(!(!this._map||n&&n.getAttribute(`src`)===ne))return Ir.prototype._tileReady.call(this,e,t,n)}});function zr(e,t){return new Rr(e,t)}var Br=Rr.extend({defaultWmsParams:{service:`WMS`,request:`GetMap`,layers:``,styles:``,format:`image/jpeg`,transparent:!1,version:`1.1.1`},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var r=n({},this.defaultWmsParams);for(var i in t)i in this.options||(r[i]=t[i]);t=p(this,t);var a=t.detectRetina&&A.retina?2:1,o=this.getTileSize();r.width=o.x*a,r.height=o.y*a,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?`crs`:`srs`;this.wmsParams[t]=this._crs.code,Rr.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=C(n.project(t[0]),n.project(t[1])),i=r.min,a=r.max,o=(this._wmsVersion>=1.3&&this._crs===Jn?[i.y,i.x,a.y,a.x]:[i.x,i.y,a.x,a.y]).join(`,`),s=Rr.prototype.getTileUrl.call(this,e);return s+m(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?`&BBOX=`:`&bbox=`)+o},setParams:function(e,t){return n(this.wmsParams,e),t||this.redraw(),this}});function Vr(e,t){return new Br(e,t)}Rr.WMS=Br,zr.wms=Vr;var Hr=J.extend({options:{padding:.1},initialize:function(e){p(this,e),o(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),R(this._container,`leaflet-zoom-animated`)),this.getPane().appendChild(this._container),this._update(),this.on(`update`,this._updatePaths,this)},onRemove:function(){this.off(`update`,this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),a=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));A.any3d?V(this._container,a,n):H(this._container,a)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new S(n,n.add(t.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ur=Hr.extend({options:{tolerance:0},getEvents:function(){var e=Hr.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Hr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement(`canvas`);U(e,`mousemove`,this._onMouseMove,this),U(e,`click dblclick mousedown mouseup contextmenu`,this._onClick,this),U(e,`mouseout`,this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext(`2d`)},_destroyContainer:function(){v(this._redrawRequest),delete this._ctx,F(this._container),W(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;for(var t in this._redrawBounds=null,this._layers)e=this._layers[t],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Hr.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=A.retina?2:1;H(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+`px`,t.style.height=n.y+`px`,A.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire(`update`)}},_reset:function(){Hr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[o(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[o(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray==`string`){var t=e.options.dashArray.split(/[, ]+/),n=[],r,i;for(i=0;i<t.length;i++){if(r=Number(t[i]),isNaN(r))return;n.push(r)}e.options._dashArray=n}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||_(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new S,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)e=r.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,r,i,a,o=e._parts,s=o.length,c=this._ctx;if(s){for(c.beginPath(),n=0;n<s;n++){for(r=0,i=o[n].length;r<i;r++)a=o[n][r],c[r?`lineTo`:`moveTo`](a.x,a.y);t&&c.closePath()}this._fillStroke(c,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var t=e._point,n=this._ctx,r=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||r)/r;i!==1&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(t.x,t.y/i,r,0,Math.PI*2,!1),i!==1&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||`evenodd`)),n.stroke&&n.weight!==0&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t=this._map.mouseEventToLayerPoint(e),n,r,i=this._drawFirst;i;i=i.next)n=i.layer,n.options.interactive&&n._containsPoint(t)&&(!(e.type===`click`||e.type===`preclick`)||!this._map._draggableMoved(n))&&(r=n);this._fireEvent(r?[r]:!1,e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(z(this._container,`leaflet-interactive`),this._fireEvent([t],e,`mouseout`),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,r,a=this._drawFirst;a;a=a.next)n=a.layer,n.options.interactive&&n._containsPoint(t)&&(r=n);r!==this._hoveredLayer&&(this._handleMouseOut(e),r&&(R(this._container,`leaflet-interactive`),this._fireEvent([r],e,`mouseover`),this._hoveredLayer=r)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,e),this._mouseHoverThrottled=!0,setTimeout(i(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(n)n.prev=r;else return;r?r.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e)}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(r)r.next=n;else return;n?n.prev=r:r&&(this._drawLast=r),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e)}}});function Wr(e){return A.canvas?new Ur(e):null}var Gr=(function(){try{return document.namespaces.add(`lvml`,`urn:schemas-microsoft-com:vml`),function(e){return document.createElement(`<lvml:`+e+` class="lvml">`)}}catch{}return function(e){return document.createElement(`<`+e+` xmlns="urn:schemas-microsoft.com:vml" class="lvml">`)}})(),Kr={_initContainer:function(){this._container=P(`div`,`leaflet-vml-container`)},_update:function(){this._map._animatingZoom||(Hr.prototype._update.call(this),this.fire(`update`))},_initPath:function(e){var t=e._container=Gr(`shape`);R(t,`leaflet-vml-shape `+(this.options.className||``)),t.coordsize=`1 1`,e._path=Gr(`path`),t.appendChild(e._path),this._updateStyle(e),this._layers[o(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;F(t),e.removeInteractiveTarget(t),delete this._layers[o(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||=e._stroke=Gr(`stroke`),i.appendChild(t),t.weight=r.weight+`px`,t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=g(r.dashArray)?r.dashArray.join(` `):r.dashArray.replace(/( *, *)/g,` `):t.dashStyle=``,t.endcap=r.lineCap.replace(`butt`,`flat`),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||=e._fill=Gr(`fill`),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?`M0 0`:`AL `+t.x+`,`+t.y+` `+n+`,`+r+` 0,23592600`)},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){Ot(e._container)},_bringToBack:function(e){kt(e._container)}},qr=A.vml?Gr:xe,Jr=Hr.extend({_initContainer:function(){this._container=qr(`svg`),this._container.setAttribute(`pointer-events`,`none`),this._rootGroup=qr(`g`),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){F(this._container),W(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Hr.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;(!this._svgSize||!this._svgSize.equals(t))&&(this._svgSize=t,n.setAttribute(`width`,t.x),n.setAttribute(`height`,t.y)),H(n,e.min),n.setAttribute(`viewBox`,[e.min.x,e.min.y,t.x,t.y].join(` `)),this.fire(`update`)}},_initPath:function(e){var t=e._path=qr(`path`);e.options.className&&R(t,e.options.className),e.options.interactive&&R(t,`leaflet-interactive`),this._updateStyle(e),this._layers[o(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){F(e._path),e.removeInteractiveTarget(e._path),delete this._layers[o(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute(`stroke`,n.color),t.setAttribute(`stroke-opacity`,n.opacity),t.setAttribute(`stroke-width`,n.weight),t.setAttribute(`stroke-linecap`,n.lineCap),t.setAttribute(`stroke-linejoin`,n.lineJoin),n.dashArray?t.setAttribute(`stroke-dasharray`,n.dashArray):t.removeAttribute(`stroke-dasharray`),n.dashOffset?t.setAttribute(`stroke-dashoffset`,n.dashOffset):t.removeAttribute(`stroke-dashoffset`)):t.setAttribute(`stroke`,`none`),n.fill?(t.setAttribute(`fill`,n.fillColor||n.color),t.setAttribute(`fill-opacity`,n.fillOpacity),t.setAttribute(`fill-rule`,n.fillRule||`evenodd`)):t.setAttribute(`fill`,`none`))},_updatePoly:function(e,t){this._setPath(e,Se(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||n,i=`a`+n+`,`+r+` 0 1,0 `,a=e._empty()?`M0 0`:`M`+(t.x-n)+`,`+t.y+i+n*2+`,0 `+i+-n*2+`,0 `;this._setPath(e,a)},_setPath:function(e,t){e._path.setAttribute(`d`,t)},_bringToFront:function(e){Ot(e._path)},_bringToBack:function(e){kt(e._path)}});A.vml&&Jr.include(Kr);function Yr(e){return A.svg||A.vml?new Jr(e):null}K.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||=this._renderer=this._createRenderer(),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if(e===`overlayPane`||e===void 0)return!1;var t=this._paneRenderers[e];return t===void 0&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Wr(e)||Yr(e)}});var Xr=lr.extend({initialize:function(e,t){lr.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=T(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Zr(e,t){return new Xr(e,t)}Jr.create=qr,Jr.pointsToPath=Se,dr.geometryToLayer=fr,dr.coordsToLatLng=mr,dr.coordsToLatLngs=hr,dr.latLngToCoords=gr,dr.latLngsToCoords=_r,dr.getFeature=vr,dr.asFeature=yr,K.mergeOptions({boxZoom:!0});var Qr=xn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on(`unload`,this._destroy,this)},addHooks:function(){U(this._container,`mousedown`,this._onMouseDown,this)},removeHooks:function(){W(this._container,`mousedown`,this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){F(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Ft(),zt(),this._startPoint=this._map.mouseEventToContainerPoint(e),U(document,{contextmenu:nn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=P(`div`,`leaflet-zoom-box`,this._container),R(this._container,`leaflet-crosshair`),this._map.fire(`boxzoomstart`)),this._point=this._map.mouseEventToContainerPoint(e);var t=new S(this._point,this._startPoint),n=t.getSize();H(this._box,t.min),this._box.style.width=n.x+`px`,this._box.style.height=n.y+`px`},_finish:function(){this._moved&&(F(this._box),z(this._container,`leaflet-crosshair`)),It(),Bt(),W(document,{contextmenu:nn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var t=new w(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire(`boxzoomend`,{boxZoomBounds:t})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});K.addInitHook(`addHandler`,`boxZoom`,Qr),K.mergeOptions({doubleClickZoom:!0});var $r=xn.extend({addHooks:function(){this._map.on(`dblclick`,this._onDoubleClick,this)},removeHooks:function(){this._map.off(`dblclick`,this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;t.options.doubleClickZoom===`center`?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});K.addInitHook(`addHandler`,`doubleClickZoom`,$r),K.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ei=xn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new wn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on(`predrag`,this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on(`predrag`,this._onPreDragWrap,this),e.on(`zoomend`,this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}R(this._map._container,`leaflet-grab leaflet-touch-drag`),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,`leaflet-grab`),z(this._map._container,`leaflet-touch-drag`),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=T(this._map.options.maxBounds);this._offsetLimit=C(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire(`movestart`).fire(`dragstart`),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire(`move`,e).fire(`drag`,e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,a=(r+t+n)%e-t-n,o=Math.abs(i+n)<Math.abs(a+n)?i:a;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=o},_onDragEnd:function(e){var t=this._map,n=t.options,r=!n.inertia||e.noInertia||this._times.length<2;if(t.fire(`dragend`,e),r)t.fire(`moveend`);else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,o=n.easeLinearity,s=i.multiplyBy(o/a),c=s.distanceTo([0,0]),l=Math.min(n.inertiaMaxSpeed,c),u=s.multiplyBy(l/c),d=l/(n.inertiaDeceleration*o),f=u.multiplyBy(-d/2).round();!f.x&&!f.y?t.fire(`moveend`):(f=t._limitOffset(f,t.options.maxBounds),_(function(){t.panBy(f,{duration:d,easeLinearity:o,noMoveStart:!0,animate:!0})}))}}});K.addInitHook(`addHandler`,`dragging`,ei),K.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ti=xn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex=`0`),U(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),W(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,r=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire(`focus`)},_onBlur:function(){this._focused=!1,this._map.fire(`blur`)},_setPanDelta:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;r<i;r++)t[n.left[r]]=[-1*e,0];for(r=0,i=n.right.length;r<i;r++)t[n.right[r]]=[e,0];for(r=0,i=n.down.length;r<i;r++)t[n.down[r]]=[0,e];for(r=0,i=n.up.length;r<i;r++)t[n.up[r]]=[0,-1*e]},_setZoomDelta:function(e){var t=this._zoomKeys={},n=this.keyCodes,r,i;for(r=0,i=n.zoomIn.length;r<i;r++)t[n.zoomIn[r]]=e;for(r=0,i=n.zoomOut.length;r<i;r++)t[n.zoomOut[r]]=-e},_addHooks:function(){U(document,`keydown`,this._onKeyDown,this)},_removeHooks:function(){W(document,`keydown`,this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=e.keyCode,n=this._map,r;if(t in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(r=this._panKeys[t],e.shiftKey&&(r=x(r).multiplyBy(3)),n.options.maxBounds&&(r=n._limitOffset(x(r),n.options.maxBounds)),n.options.worldCopyJump){var i=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(r)));n.panTo(i)}else n.panBy(r)}else if(t in this._zoomKeys)n.setZoom(n.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[t]);else if(t===27&&n._popup&&n._popup.options.closeOnEscapeKey)n.closePopup();else return;nn(e)}}});K.addInitHook(`addHandler`,`keyboard`,ti),K.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ni=xn.extend({addHooks:function(){U(this._map._container,`wheel`,this._onWheelScroll,this),this._delta=0},removeHooks:function(){W(this._map._container,`wheel`,this._onWheelScroll,this)},_onWheelScroll:function(e){var t=sn(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||=+new Date;var r=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i(this._performZoom,this),r),nn(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var r=this._delta/(this._map.options.wheelPxPerZoomLevel*4),i=4*Math.log(2/(1+Math.exp(-Math.abs(r))))/Math.LN2,a=n?Math.ceil(i/n)*n:i,o=e._limitZoom(t+(this._delta>0?a:-a))-t;this._delta=0,this._startTime=null,o&&(e.options.scrollWheelZoom===`center`?e.setZoom(t+o):e.setZoomAround(this._lastMousePos,t+o))}});K.addInitHook(`addHandler`,`scrollWheelZoom`,ni);var ri=600;K.mergeOptions({tapHold:A.touchNative&&A.safari&&A.mobile,tapTolerance:15});var ii=xn.extend({addHooks:function(){U(this._map._container,`touchstart`,this._onDown,this)},removeHooks:function(){W(this._map._container,`touchstart`,this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var t=e.touches[0];this._startPos=this._newPos=new b(t.clientX,t.clientY),this._holdTimeout=setTimeout(i(function(){this._cancel(),this._isTapValid()&&(U(document,`touchend`,G),U(document,`touchend touchcancel`,this._cancelClickPrevent),this._simulateEvent(`contextmenu`,t))},this),ri),U(document,`touchend touchcancel contextmenu`,this._cancel,this),U(document,`touchmove`,this._onMove,this)}},_cancelClickPrevent:function e(){W(document,`touchend`,G),W(document,`touchend touchcancel`,e)},_cancel:function(){clearTimeout(this._holdTimeout),W(document,`touchend touchcancel contextmenu`,this._cancel,this),W(document,`touchmove`,this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new b(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});K.addInitHook(`addHandler`,`tapHold`,ii),K.mergeOptions({touchZoom:A.touch,bounceAtZoomLimits:!0});var ai=xn.extend({addHooks:function(){R(this._map._container,`leaflet-touch-zoom`),U(this._map._container,`touchstart`,this._onTouchStart,this)},removeHooks:function(){z(this._map._container,`leaflet-touch-zoom`),W(this._map._container,`touchstart`,this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),t.options.touchZoom!==`center`&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),U(document,`touchmove`,this._onTouchMove,this),U(document,`touchend touchcancel`,this._onTouchEnd,this),G(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),a=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(a,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&a<1||this._zoom>t.getMaxZoom()&&a>1)&&(this._zoom=t._limitZoom(this._zoom)),t.options.touchZoom===`center`){if(this._center=this._startLatLng,a===1)return}else{var o=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(a===1&&o.x===0&&o.y===0)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(o),this._zoom)}this._moved||=(t._moveStart(!0,!1),!0),v(this._animRequest);var s=i(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=_(s,this,!0),G(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,v(this._animRequest),W(document,`touchmove`,this._onTouchMove,this),W(document,`touchend touchcancel`,this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});K.addInitHook(`addHandler`,`touchZoom`,ai),K.BoxZoom=Qr,K.DoubleClickZoom=$r,K.Drag=ei,K.Keyboard=ti,K.ScrollWheelZoom=ni,K.TapHold=ii,K.TouchZoom=ai,e.Bounds=S,e.Browser=A,e.CRS=pe,e.Canvas=Ur,e.Circle=ar,e.CircleMarker=Q,e.Class=le,e.Control=fn,e.DivIcon=Pr,e.DivOverlay=kr,e.DomEvent=ln,e.DomUtil=qt,e.Draggable=wn,e.Evented=de,e.FeatureGroup=Y,e.GeoJSON=dr,e.GridLayer=Ir,e.Handler=xn,e.Icon=$n,e.ImageOverlay=Cr,e.LatLng=E,e.LatLngBounds=w,e.Layer=J,e.LayerGroup=Xn,e.LineUtil=Un,e.Map=K,e.Marker=Z,e.Mixin=Sn,e.Path=rr,e.Point=b,e.PolyUtil=On,e.Polygon=lr,e.Polyline=sr,e.Popup=Ar,e.PosAnimation=un,e.Projection=Kn,e.Rectangle=Xr,e.Renderer=Hr,e.SVG=Jr,e.SVGOverlay=Dr,e.TileLayer=Rr,e.Tooltip=Mr,e.Transformation=_e,e.Util=ce,e.VideoOverlay=Tr,e.bind=i,e.bounds=C,e.canvas=Wr,e.circle=or,e.circleMarker=ir,e.control=pn,e.divIcon=Fr,e.extend=n,e.featureGroup=Qn,e.geoJSON=xr,e.geoJson=Sr,e.gridLayer=Lr,e.icon=er,e.imageOverlay=wr,e.latLng=D,e.latLngBounds=T,e.layerGroup=Zn,e.map=dn,e.marker=nr,e.point=x,e.polygon=ur,e.polyline=cr,e.popup=jr,e.rectangle=Zr,e.setOptions=p,e.stamp=o,e.svg=Yr,e.svgOverlay=Or,e.tileLayer=zr,e.tooltip=Nr,e.transformation=ve,e.version=t,e.videoOverlay=Er;var oi=window.L;e.noConflict=function(){return window.L=oi,this},window.L=e}))})),Ti=x(((e,t)=>{((n,r)=>{typeof define==`function`&&define.amd?define([`leaflet`],n):typeof e==`object`&&(t.exports=n(wi())),r!==void 0&&r.L&&n(r.L)})(e=>{e.Editable=e.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:e.Polygon,polylineClass:e.Polyline,markerClass:e.Marker,circleMarkerClass:e.CircleMarker,rectangleClass:e.Rectangle,circleClass:e.Circle,drawingCSSClass:`leaflet-editable-drawing`,drawingCursor:`crosshair`,editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,circleMarkerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(t,n){e.setOptions(this,n),this._lastZIndex=this.options.zIndex,this.map=t,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(e,t){t||={},t.editTools=this,this.fire(e,t),this.map.fire(e,t)},createLineGuide:function(){let t=e.extend({dashArray:`5,10`,weight:1,interactive:!1},this.options.lineGuideOptions);return e.polyline([],t)},createVertexIcon:t=>e.Browser.mobile&&e.Browser.touch?new e.Editable.TouchVertexIcon(t):new e.Editable.VertexIcon(t),createEditLayer:function(){return this.options.editLayer||new e.LayerGroup().addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||new e.LayerGroup().addTo(this.map)},moveForwardLineGuide:function(e){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=e,this.forwardLineGuide._bounds.extend(e),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(e){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=e,this.backwardLineGuide._bounds.extend(e),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(e){this.forwardLineGuide._latlngs[0]=e,this.forwardLineGuide._bounds.extend(e),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(e){this.backwardLineGuide._latlngs[0]=e,this.backwardLineGuide._bounds.extend(e),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=e.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(t){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),t.reset(),this._drawingEditor=t,this.map.on(`mousemove touchmove`,t.onDrawingMouseMove,t),this.map.on(`mousedown`,this.onMousedown,this),this.map.on(`mouseup`,this.onMouseup,this),e.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(t){this.unblockEvents(),e.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,t||=this._drawingEditor,t&&(this.map.off(`mousemove touchmove`,t.onDrawingMouseMove,t),this.map.off(`mousedown`,this.onMousedown,this),this.map.off(`mouseup`,this.onMouseup,this),t===this._drawingEditor&&(delete this._drawingEditor,t._drawing&&t.cancelDrawing()))},onMousedown:function(e){e.originalEvent.which==1&&(this._mouseDown=e,this._drawingEditor.onDrawingMouseDown(e))},onMouseup:function(t){if(this._mouseDown){let n=this._drawingEditor,r=this._mouseDown;if(this._mouseDown=null,n.onDrawingMouseUp(t),this._drawingEditor!==n)return;let i=e.point(r.originalEvent.clientX,r.originalEvent.clientY),a=e.point(t.originalEvent.clientX,t.originalEvent.clientY).distanceTo(i);Math.abs(a)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(t)}},drawing:function(){return this._drawingEditor?.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(e){this._drawingEditor&&this._drawingEditor.commitDrawing(e)},connectCreatedToMap:function(e){return this.featuresLayer.addLayer(e)},startPolyline:function(e,t){let n=this.createPolyline([],t);return n.enableEdit(this.map).newShape(e),n},startPolygon:function(e,t){let n=this.createPolygon([],t);return n.enableEdit(this.map).newShape(e),n},startMarker:function(e,t){e||=this.map.getCenter().clone();let n=this.createMarker(e,t);return n.enableEdit(this.map).startDrawing(),n},startCircleMarker:function(e,t){e||=this.map.getCenter().clone();let n=this.createCircleMarker(e,t);return n.enableEdit(this.map).startDrawing(),n},startRectangle:function(t,n){let r=t||e.latLng([0,0]),i=new e.LatLngBounds(r,r),a=this.createRectangle(i,n);return a.enableEdit(this.map).startDrawing(),a},startCircle:function(e,t){e||=this.map.getCenter().clone();let n=this.createCircle(e,t);return n.enableEdit(this.map).startDrawing(),n},startHole:(e,t)=>{e.newHole(t)},createLayer:function(t,n,r){r=e.Util.extend({editOptions:{editTools:this}},r);let i=new t(n,r);return this.fireAndForward(`editable:created`,{layer:i}),i},createPolyline:function(e,t){return this.createLayer(t?.polylineClass||this.options.polylineClass,e,t)},createPolygon:function(e,t){return this.createLayer(t?.polygonClass||this.options.polygonClass,e,t)},createMarker:function(e,t){return this.createLayer(t?.markerClass||this.options.markerClass,e,t)},createCircleMarker:function(e,t){return this.createLayer(t?.circleMarkerClass||this.options.circleMarkerClass,e,t)},createRectangle:function(e,t){return this.createLayer(t?.rectangleClass||this.options.rectangleClass,e,t)},createCircle:function(e,t){return this.createLayer(t?.circleClass||this.options.circleClass,e,t)}}),e.extend(e.Editable,{makeCancellable:e=>{e.cancel=()=>{e._cancelled=!0}}}),e.Map.mergeOptions({editToolsClass:e.Editable,editable:!1,editOptions:{}}),e.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),e.Editable.VertexIcon=e.DivIcon.extend({options:{iconSize:new e.Point(8,8)}}),e.Editable.TouchVertexIcon=e.Editable.VertexIcon.extend({options:{iconSize:new e.Point(20,20)}}),e.Editable.VertexMarker=e.Marker.extend({options:{draggable:!0,className:`leaflet-div-icon leaflet-vertex-icon`},initialize:function(t,n,r,i){this.latlng=t,this.latlngs=n,this.editor=r,e.Marker.prototype.initialize.call(this,t,i),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.connect(),this.setZIndexOffset(r.tools._lastZIndex+1)},connect:function(){this.editor.editLayer.addLayer(this)},onAdd:function(t){e.Marker.prototype.onAdd.call(this,t),this.on(`drag`,this.onDrag),this.on(`dragstart`,this.onDragStart),this.on(`dragend`,this.onDragEnd),this.on(`mouseup`,this.onMouseup),this.on(`click`,this.onClick),this.on(`contextmenu`,this.onContextMenu),this.on(`mousedown touchstart`,this.onMouseDown),this.on(`mouseover`,this.onMouseOver),this.on(`mouseout`,this.onMouseOut),this.addMiddleMarkers()},onRemove:function(t){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off(`drag`,this.onDrag),this.off(`dragstart`,this.onDragStart),this.off(`dragend`,this.onDragEnd),this.off(`mouseup`,this.onMouseup),this.off(`click`,this.onClick),this.off(`contextmenu`,this.onContextMenu),this.off(`mousedown touchstart`,this.onMouseDown),this.off(`mouseover`,this.onMouseOver),this.off(`mouseout`,this.onMouseOut),e.Marker.prototype.onRemove.call(this,t)},onDrag:function(t){t.vertex=this,this.editor.onVertexMarkerDrag(t);let n=e.DomUtil.getPosition(this._icon),r=this._map.layerPointToLatLng(n);this.latlng.update(r),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();let i=this.getNext();i?.middleMarker&&i.middleMarker.updateLatLng()},onDragStart:function(e){e.vertex=this,this.editor.onVertexMarkerDragStart(e)},onDragEnd:function(e){e.vertex=this,this.editor.onVertexMarkerDragEnd(e)},onClick:function(e){e.vertex=this,this.editor.onVertexMarkerClick(e)},onMouseup:function(t){e.DomEvent.stop(t),t.vertex=this,this.editor.map.fire(`mouseup`,t)},onContextMenu:function(e){e.vertex=this,this.editor.onVertexMarkerContextMenu(e)},onMouseDown:function(e){e.vertex=this,this.editor.onVertexMarkerMouseDown(e)},onMouseOver:function(e){e.vertex=this,this.editor.onVertexMarkerMouseOver(e)},onMouseOut:function(e){e.vertex=this,this.editor.onVertexMarkerMouseOut(e)},delete:function(){let e=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),e&&e.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(this.latlngs.length<2)return;let e=this.getIndex(),t=e-1;e===0&&this.editor.CLOSED&&(t=this.getLastIndex());let n=this.latlngs[t];if(n)return n.__vertex},getNext:function(){if(this.latlngs.length<2)return;let e=this.getIndex(),t=e+1;e===this.getLastIndex()&&this.editor.CLOSED&&(t=0);let n=this.latlngs[t];if(n)return n.__vertex},addMiddleMarker:function(e){this.editor.hasMiddleMarkers()&&(e||=this.getPrevious(),e&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(e,this,this.latlngs,this.editor)))},addMiddleMarkers:function(){if(!this.editor.hasMiddleMarkers())return;let e=this.getPrevious();e&&this.addMiddleMarker(e);let t=this.getNext();t&&t.resetMiddleMarker()},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(!this.editor.continueBackward)return;let e=this.getIndex();e===0?this.editor.continueBackward(this.latlngs):e===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}),e.Editable.mergeOptions({vertexMarkerClass:e.Editable.VertexMarker}),e.Editable.MiddleMarker=e.Marker.extend({options:{opacity:.5,className:`leaflet-div-icon leaflet-middle-icon`,draggable:!0},initialize:function(t,n,r,i,a){this.left=t,this.right=n,this.editor=i,this.latlngs=r,e.Marker.prototype.initialize.call(this,this.computeLatLng(),a),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){let t=this._map.latLngToContainerPoint(this.left.latlng),n=this._map.latLngToContainerPoint(this.right.latlng),r=e.point(this.options.icon.options.iconSize);t.distanceTo(n)<r.x*3?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){let e=this.editor.map.latLngToContainerPoint(this.left.latlng),t=this.editor.map.latLngToContainerPoint(this.right.latlng),n=(e.y+t.y)/2,r=(e.x+t.x)/2;return this.editor.map.containerPointToLatLng([r,n])},onAdd:function(t){e.Marker.prototype.onAdd.call(this,t),e.DomEvent.on(this._icon,`mousedown touchstart`,this.onMouseDown,this),t.on(`zoomend`,this.setVisibility,this)},onRemove:function(t){delete this.right.middleMarker,e.DomEvent.off(this._icon,`mousedown touchstart`,this.onMouseDown,this),t.off(`zoomend`,this.setVisibility,this),e.Marker.prototype.onRemove.call(this,t)},onMouseDown:function(t){let n=e.DomUtil.getPosition(this._icon),r=this.editor.map.layerPointToLatLng(n);if(t={originalEvent:t,latlng:r},this.options.opacity===0||(e.Editable.makeCancellable(t),this.editor.onMiddleMarkerMouseDown(t),t._cancelled))return;this.latlngs.splice(this.index(),0,t.latlng),this.editor.refresh();let i=this._icon,a=this.editor.addVertexMarker(t.latlng,this.latlngs);this.editor.onNewVertex(a);let o=a._icon.parentNode;o.removeChild(a._icon),a._icon=i,o.appendChild(a._icon),a._initIcon(),a._initInteraction(),a.setOpacity(1),e.Draggable._dragging=!1,a.dragging._draggable._onDown(t.originalEvent),this.delete()},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),e.Editable.mergeOptions({middleMarkerClass:e.Editable.MiddleMarker}),e.Editable.BaseEditor=e.Handler.extend({initialize:function(t,n,r){e.setOptions(this,r),this.map=t,this.feature=n,this.feature.editor=this,this.editLayer=new e.LayerGroup,this.tools=this.options.editTools||t.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once(`add`,this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:()=>{},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.options.draggable!=0&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(e,t){t||={},t.layer=this.feature,this.feature.fire(e,t),this.tools.fireAndForward(e,t)},onEnable:function(){this.fireAndForward(`editable:enable`)},onDisable:function(){this.fireAndForward(`editable:disable`)},onEditing:function(){this.fireAndForward(`editable:editing`)},onEdited:function(){this.fireAndForward(`editable:edited`)},onStartDrawing:function(){this.fireAndForward(`editable:drawing:start`)},onEndDrawing:function(){this.fireAndForward(`editable:drawing:end`)},onCancelDrawing:function(){this.fireAndForward(`editable:drawing:cancel`)},onCommitDrawing:function(e){this.fireAndForward(`editable:drawing:commit`,e),this.onEdited()},onDrawingMouseDown:function(e){this.fireAndForward(`editable:drawing:mousedown`,e)},onDrawingMouseUp:function(e){this.fireAndForward(`editable:drawing:mouseup`,e)},startDrawing:function(){this._drawing||=e.Editable.FORWARD,this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(e){this.onCommitDrawing(e),this.endDrawing()},cancelDrawing:function(){e.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(t){this.drawing()&&(e.Editable.makeCancellable(t),this.fireAndForward(`editable:drawing:click`,t),!t._cancelled&&(this.isConnected()||this.connect(t),this.processDrawingClick(t)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(e){this.fireAndForward(`editable:drawing:move`,e)},onDrawingMouseMove:function(e){this.onMove(e)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(e){this.onEditing(),this.fireAndForward(`editable:dragstart`,e)},onDrag:function(e){this.onMove(e),this.fireAndForward(`editable:drag`,e)},onDragEnd:function(e){this.fireAndForward(`editable:dragend`,e),this.onEdited()}}),e.Editable.MarkerEditor=e.Editable.BaseEditor.extend({onDrawingMouseMove:function(t){e.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&this.feature.setLatLng(t.latlng)},processDrawingClick:function(e){this.fireAndForward(`editable:drawing:clicked`,e),this.commitDrawing(e)},connect:function(t){t&&(this.feature._latlng=t.latlng),e.Editable.BaseEditor.prototype.connect.call(this,t)}}),e.Editable.CircleMarkerEditor=e.Editable.BaseEditor.extend({onDrawingMouseMove:function(t){e.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&this.feature.setLatLng(t.latlng)},processDrawingClick:function(e){this.fireAndForward(`editable:drawing:clicked`,e),this.commitDrawing(e)},connect:function(t){t&&(this.feature._latlng=t.latlng),e.Editable.BaseEditor.prototype.connect.call(this,t)}}),e.Editable.PathEditor=e.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return e.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&(this.initVertexMarkers(),this.map.on(`moveend`,this.onMoveEnd,this)),this},removeHooks:function(){e.Editable.BaseEditor.prototype.removeHooks.call(this),this.feature&&this.map.off(`moveend`,this.onMoveEnd,this)},onMoveEnd:function(){this.initVertexMarkers()},initVertexMarkers:function(e){if(this.enabled())if(e||=this.getLatLngs(),l(e))this.addVertexMarkers(e);else for(let t of e)this.initVertexMarkers(t)},getLatLngs:function(){return this.feature.getLatLngs()},reset:function(){this.editLayer.clearLayers(),this.initVertexMarkers()},addVertexMarker:function(e,t){return e.__vertex?(e.__vertex.connect(),e.__vertex):new this.tools.options.vertexMarkerClass(e,t,this)},onNewVertex:function(e){this.fireAndForward(`editable:vertex:new`,{latlng:e.latlng,vertex:e})},addVertexMarkers:function(e){let t=this.map.getBounds();for(let n of e)t.contains(n)&&this.addVertexMarker(n,e)},refreshVertexMarkers:function(e){e||=this.getDefaultLatLngs();for(let t of e)t.__vertex.update()},addMiddleMarker:function(e,t,n){return new this.tools.options.middleMarkerClass(e,t,n,this)},onVertexMarkerClick:function(t){if(e.Editable.makeCancellable(t),this.fireAndForward(`editable:vertex:click`,t),t._cancelled||this.tools.drawing()&&this.tools._drawingEditor!==this)return;let n=t.vertex.getIndex(),r;t.originalEvent.ctrlKey?this.onVertexMarkerCtrlClick(t):t.originalEvent.altKey?this.onVertexMarkerAltClick(t):t.originalEvent.shiftKey?this.onVertexMarkerShiftClick(t):t.originalEvent.metaKey?this.onVertexMarkerMetaKeyClick(t):n===t.vertex.getLastIndex()&&this._drawing===e.Editable.FORWARD?n>=this.MIN_VERTEX-1&&(r=!0):n===0&&this._drawing===e.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||n===0&&this._drawing===e.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?r=!0:this.onVertexRawMarkerClick(t),this.fireAndForward(`editable:vertex:clicked`,t),r&&this.commitDrawing(t)},onVertexRawMarkerClick:function(e){this.fireAndForward(`editable:vertex:rawclick`,e),!e._cancelled&&this.vertexCanBeDeleted(e.vertex)&&e.vertex.delete()},vertexCanBeDeleted:function(e){return e.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(e){this.fireAndForward(`editable:vertex:deleted`,e),this.onEdited()},onVertexMarkerCtrlClick:function(e){this.fireAndForward(`editable:vertex:ctrlclick`,e)},onVertexMarkerShiftClick:function(e){this.fireAndForward(`editable:vertex:shiftclick`,e)},onVertexMarkerMetaKeyClick:function(e){this.fireAndForward(`editable:vertex:metakeyclick`,e)},onVertexMarkerAltClick:function(e){this.fireAndForward(`editable:vertex:altclick`,e)},onVertexMarkerContextMenu:function(e){this.fireAndForward(`editable:vertex:contextmenu`,e)},onVertexMarkerMouseDown:function(e){this.fireAndForward(`editable:vertex:mousedown`,e)},onVertexMarkerMouseOver:function(e){this.fireAndForward(`editable:vertex:mouseover`,e)},onVertexMarkerMouseOut:function(e){this.fireAndForward(`editable:vertex:mouseout`,e)},onMiddleMarkerMouseDown:function(e){this.fireAndForward(`editable:middlemarker:mousedown`,e)},onVertexMarkerDrag:function(e){this.onMove(e),this.feature._bounds&&this.extendBounds(e),this.fireAndForward(`editable:vertex:drag`,e)},onVertexMarkerDragStart:function(e){this.fireAndForward(`editable:vertex:dragstart`,e)},onVertexMarkerDragEnd:function(e){this.fireAndForward(`editable:vertex:dragend`,e),this.onEdited()},setDrawnLatLngs:function(e){this._drawnLatLngs=e||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),e.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length<this.MIN_VERTEX&&this.deleteShape(this._drawnLatLngs),e.Editable.BaseEditor.prototype.endDrawing.call(this),delete this._drawnLatLngs},addLatLng:function(t){this._drawing===e.Editable.FORWARD?this._drawnLatLngs.push(t):this._drawnLatLngs.unshift(t),this.feature._bounds.extend(t);let n=this.addVertexMarker(t,this._drawnLatLngs);this.onNewVertex(n),this.refresh()},newPointForward:function(e){this.addLatLng(e),this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(e)},newPointBackward:function(e){this.addLatLng(e),this.tools.anchorBackwardLineGuide(e)},push:function(t){if(!t)return console.error(`L.Editable.PathEditor.push expect a valid latlng as parameter`);this._drawing===e.Editable.FORWARD?this.newPointForward(t):this.newPointBackward(t)},removeLatLng:function(e){e.__vertex.delete(),this.refresh()},pop:function(){if(this._drawnLatLngs.length<=1)return;let t;return t=this._drawing===e.Editable.FORWARD?this._drawnLatLngs[this._drawnLatLngs.length-1]:this._drawnLatLngs[0],this.removeLatLng(t),this._drawing===e.Editable.FORWARD?this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length-1]):this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]),t},processDrawingClick:function(t){t.vertex&&t.vertex.editor===this||(this._drawing===e.Editable.FORWARD?this.newPointForward(t.latlng):this.newPointBackward(t.latlng),this.fireAndForward(`editable:drawing:clicked`,t))},onDrawingMouseMove:function(t){e.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,t),this._drawing&&(this.tools.moveForwardLineGuide(t.latlng),this.tools.moveBackwardLineGuide(t.latlng))},refresh:function(){this.feature.redraw(),this.onEditing()},newShape:function(e){let t=this.addNewEmptyShape();t&&(this.setDrawnLatLngs(t[0]||t),this.startDrawingForward(),this.fireAndForward(`editable:shape:new`,{shape:t}),e&&this.newPointForward(e))},deleteShape:function(t,n){let r={shape:t};if(e.Editable.makeCancellable(r),this.fireAndForward(`editable:shape:delete`,r),!r._cancelled)return t=this._deleteShape(t,n),this.ensureNotFlat&&this.ensureNotFlat(),this.feature.setLatLngs(this.getLatLngs()),this.refresh(),this.reset(),this.fireAndForward(`editable:shape:deleted`,{shape:t}),this.onEdited(),t},_deleteShape:function(e,t){if(t||=this.getLatLngs(),!t.length)return;let n=(e,t)=>e.splice(0,Number.MAX_VALUE),r=(e,t)=>(e.splice(e.indexOf(t),1),e.length||this._deleteShape(e),t);if(t===e)return n(t,e);for(let n of t){if(n===e)return r(t,e);if(n.indexOf(e)!==-1)return r(n,e)}},deleteShapeAt:function(e){let t=this.feature.shapeAt(e);if(t)return this.deleteShape(t)},appendShape:function(e){this.insertShape(e)},prependShape:function(e){this.insertShape(e,0)},insertShape:function(e,t){this.ensureMulti(),e=this.formatShape(e),t===void 0&&(t=this.feature._latlngs.length),this.feature._latlngs.splice(t,0,e),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(e){this.feature._bounds.extend(e.vertex.latlng)},onDragStart:function(t){this.editLayer.clearLayers(),e.Editable.BaseEditor.prototype.onDragStart.call(this,t)},onDragEnd:function(t){this.initVertexMarkers(),e.Editable.BaseEditor.prototype.onDragEnd.call(this,t)}}),e.Editable.PolylineEditor=e.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=e.Editable.BACKWARD,this.startDrawing()},continueBackward:function(e){this.drawing()||(e||=this.getDefaultLatLngs(),this.setDrawnLatLngs(e),e.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(e[0])),this.startDrawingBackward())},continueForward:function(e){this.drawing()||(e||=this.getDefaultLatLngs(),this.setDrawnLatLngs(e),e.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(e[e.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(t){return t||=this.feature._latlngs,!t.length||t[0]instanceof e.LatLng?t:this.getDefaultLatLngs(t[0])},ensureMulti:function(){this.feature._latlngs.length&&l(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){let e=[];return this.appendShape(e),e}return this.feature._latlngs},formatShape:function(e){if(l(e))return e;if(e[0])return this.formatShape(e[0])},splitShape:function(t,n){if(!n||n>=t.length-1)return;this.ensureMulti();let r=this.feature._latlngs.indexOf(t);if(r===-1)return;let i=t.slice(0,n+1),a=t.slice(n);a[0]=e.latLng(a[0].lat,a[0].lng,a[0].alt),this.feature._latlngs.splice(r,1,i,a),this.refresh(),this.reset(),this.onEdited()}}),e.Editable.PolygonEditor=e.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(t){e.Editable.PathEditor.prototype.newPointForward.call(this,t),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(t),this._drawnLatLngs.length===2&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(e){this.ensureNotFlat();let t=this.feature.shapeAt(e);if(!t)return;let n=[];return t.push(n),n},newHole:function(e){let t=this.addNewEmptyHole(e);t&&(this.setDrawnLatLngs(t),this.startDrawingForward(),e&&this.newPointForward(e))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){let e=[];return this.appendShape(e),e}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&l(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){(!this.feature._latlngs.length||l(this.feature._latlngs))&&(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(t){let n=this.feature.parentShape(t.latlngs);return e.Util.indexOf(n,t.latlngs)>0||e.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,t)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:e=>l(e)&&(!e[0]||e[0].length!==0)?[e]:e}),e.Editable.RectangleEditor=e.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(t){let n=t.vertex.getIndex(),r=t.vertex.getNext(),i=t.vertex.getPrevious(),a=(n+2)%4,o=t.vertex.latlngs[a],s=new e.LatLngBounds(t.latlng,o);i.latlng.update([t.latlng.lat,o.lng]),r.latlng.update([o.lat,t.latlng.lng]),this.updateBounds(s),this.refreshVertexMarkers()},onDrawingMouseDown:function(t){e.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,t),this.connect();let n=this.getDefaultLatLngs();n.length===3&&n.push(t.latlng);let r=new e.LatLngBounds(t.latlng,t.latlng);this.updateBounds(r),this.updateLatLngs(r),this.refresh(),this.reset(),t.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(t.originalEvent),n[3].__vertex.dragging._draggable._onDown(t.originalEvent)},onDrawingMouseUp:function(t){this.commitDrawing(t),t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,t)},onDrawingMouseMove:function(t){t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,t)},getDefaultLatLngs:function(e){return e||this.feature._latlngs[0]},updateBounds:function(e){this.feature._bounds=e},updateLatLngs:function(e){let t=this.getDefaultLatLngs(),n=this.feature._boundsToLatLngs(e);for(let e=0;e<t.length;e++)t[e].update(n[e])}}),e.Editable.CircleEditor=e.Editable.PathEditor.extend({MIN_VERTEX:2,options:{skipMiddleMarkers:!0},initialize:function(t,n,r){e.Editable.PathEditor.prototype.initialize.call(this,t,n,r),this._resizeLatLng=this.computeResizeLatLng()},computeResizeLatLng:function(){let e=(this.feature._radius||this.feature._mRadius)*Math.cos(Math.PI/4),t=this.map.project(this.feature._latlng);return this.map.unproject([t.x+e,t.y-e])},updateResizeLatLng:function(){this._resizeLatLng.update(this.computeResizeLatLng()),this._resizeLatLng.__vertex.update()},getLatLngs:function(){return[this.feature._latlng,this._resizeLatLng]},getDefaultLatLngs:function(){return this.getLatLngs()},onVertexMarkerDrag:function(t){t.vertex.getIndex()===1?this.resize(t):this.updateResizeLatLng(t),e.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this,t)},resize:function(e){let t;t=this.map.options.crs?this.map.options.crs.distance(this.feature._latlng,e.latlng):this.feature._latlng.distanceTo(e.latlng),this.feature.setRadius(t)},onDrawingMouseDown:function(t){e.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,t),this._resizeLatLng.update(t.latlng),this.feature._latlng.update(t.latlng),this.connect(),t.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(t.originalEvent),this._resizeLatLng.__vertex.dragging._draggable._onDown(t.originalEvent)},onDrawingMouseUp:function(t){this.commitDrawing(t),t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,t)},onDrawingMouseMove:function(t){t.originalEvent._simulated=!1,e.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,t)},onDrag:function(t){e.Editable.PathEditor.prototype.onDrag.call(this,t),this.feature.dragging.updateLatLng(this._resizeLatLng)}});let t={createEditor:function(e){e||=this._map;let t=this.options.editOptions?.editTools||e.editTools;if(!t)throw Error(`Unable to detect Editable instance.`);return new(this.options.editorClass||(this.getEditorClass(t)))(e,this,this.options.editOptions)},enableEdit:function(e){return this.editor||this.createEditor(e),this.editor.enable(),this.editor},editEnabled:function(){return this.editor?.enabled()},disableEdit:function(){this.editor&&(this.editor.disable(),delete this.editor)},toggleEdit:function(){this.editEnabled()?this.disableEdit():this.enableEdit()},_onEditableAdd:function(){this.editor&&this.enableEdit()}},n={getEditorClass:t=>t?.options?.polylineEditorClass||e.Editable.PolylineEditor,shapeAt:function(e,t){let n=null;if(t||=this._latlngs,!t.length)return n;if(l(t)&&this.isInLatLngs(e,t))n=t;else for(let n of t)if(this.isInLatLngs(e,n))return n;return n},isInLatLngs:function(t,n){if(!n)return!1;let r,i,a,o=[],s,c=this._clickTolerance();if(this._projectLatlngs(n,o,this._pxBounds),o=o[0],s=this._map.latLngToLayerPoint(t),!this._pxBounds.contains(s))return!1;for(r=1,a=o.length,i=0;r<a;i=r++)if(e.LineUtil.pointToSegmentDistance(s,o[i],o[r])<=c)return!0;return!1}},r={getEditorClass:t=>t?.options?.polygonEditorClass||e.Editable.PolygonEditor,shapeAt:function(e,t){let n=null;if(t||=this._latlngs,!t.length)return n;if(l(t)&&this.isInLatLngs(e,t)&&(n=t),l(t[0])&&this.isInLatLngs(e,t[0]))n=t;else for(let n of t)if(this.isInLatLngs(e,n[0]))return n;return n},isInLatLngs:(e,t)=>{let n=!1,r,i,a,o,s;for(a=0,s=t.length,o=s-1;a<s;o=a++)r=t[a],i=t[o],r.lat>e.lat!=i.lat>e.lat&&e.lng<(i.lng-r.lng)*(e.lat-r.lat)/(i.lat-r.lat)+r.lng&&(n=!n);return n},parentShape:function(t,n){if(n||=this._latlngs,!n)return;let r=e.Util.indexOf(n,t);if(r!==-1)return n;for(let i of n)if(r=e.Util.indexOf(i,t),r!==-1)return i}},i={getEditorClass:t=>t?.options?.markerEditorClass||e.Editable.MarkerEditor},a={getEditorClass:t=>t?.options?.circleMarkerEditorClass||e.Editable.CircleMarkerEditor},o={getEditorClass:t=>t?.options?.rectangleEditorClass||e.Editable.RectangleEditor},s={getEditorClass:t=>t?.options?.circleEditorClass||e.Editable.CircleEditor},c=function(){this.on(`add`,this._onEditableAdd)},l=e.LineUtil.isFlat||e.LineUtil._flat||e.Polyline._flat;e.Polyline&&(e.Polyline.include(t),e.Polyline.include(n),e.Polyline.addInitHook(c)),e.Polygon&&(e.Polygon.include(t),e.Polygon.include(r)),e.Marker&&(e.Marker.include(t),e.Marker.include(i),e.Marker.addInitHook(c)),e.CircleMarker&&(e.CircleMarker.include(t),e.CircleMarker.include(a),e.CircleMarker.addInitHook(c)),e.Rectangle&&(e.Rectangle.include(t),e.Rectangle.include(o)),e.Circle&&(e.Circle.include(t),e.Circle.include(s)),e.LatLng.prototype.update=function(t){t=e.latLng(t),this.lat=t.lat,this.lng=t.lng}},window)})),$=ae(wi(),1);Ti();var Ei=`/* required styles */\r
|
|
22
24
|
\r
|
|
23
25
|
.leaflet-pane,\r
|
|
24
26
|
.leaflet-tile,\r
|
|
@@ -679,7 +681,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
679
681
|
print-color-adjust: exact;\r
|
|
680
682
|
}\r
|
|
681
683
|
}\r
|
|
682
|
-
`,
|
|
684
|
+
`,Di=`:root {
|
|
683
685
|
--fullscreen-icon-enter: url('data:image/svg+xml,<svg viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M5 10.3V5.9c0-.5.4-.9.9-.9h4.4c.2 0 .4.2.4.4V7c0 .2-.2.4-.4.4h-3v3c0 .2-.2.4-.4.4H5.4a.4.4 0 0 1-.4-.4zm10.3-4.9V7c0 .2.2.4.4.4h3v3c0 .2.2.4.4.4h1.5c.2 0 .4-.2.4-.4V5.9c0-.5-.4-.9-.9-.9h-4.4c-.2 0-.4.2-.4.4zm5.3 9.9H19c-.2 0-.4.2-.4.4v3h-3c-.2 0-.4.2-.4.4v1.5c0 .2.2.4.4.4h4.4c.5 0 .9-.4.9-.9v-4.4c0-.2-.2-.4-.4-.4zm-9.9 5.3V19c0-.2-.2-.4-.4-.4h-3v-3c0-.2-.2-.4-.4-.4H5.4c-.2 0-.4.2-.4.4v4.4c0 .5.4.9.9.9h4.4c.2 0 .4-.2.4-.4z" fill="%23333"/></svg>');
|
|
684
686
|
--fullscreen-icon-exit: url('data:image/svg+xml,<svg viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M20.6 10.7H16a.9.9 0 0 1-.8-.8v-4.5c0-.2.2-.4.4-.4h1.4c.3 0 .5.2.5.4v3h3c.2 0 .4.2.4.5v1.4c0 .2-.2.4-.4.4zm-9.9-.8V5.4c0-.2-.2-.4-.4-.4H8.9c-.3 0-.5.2-.5.4v3h-3c-.2 0-.4.2-.4.5v1.4c0 .2.2.4.4.4H9.9c.4 0 .8-.4.8-.8zm0 10.7V16c0-.4-.4-.8-.8-.8H5.4c-.2 0-.4.2-.4.4v1.4c0 .3.2.5.4.5h3v3c0 .2.2.4.5.4h1.4c.2 0 .4-.2.4-.4zm6.9 0v-3h3c.2 0 .4-.2.4-.5v-1.4c0-.2-.2-.4-.4-.4H16c-.4 0-.8.4-.8.8v4.5c0 .2.2.4.4.4h1.5c.3 0 .5-.2.5-.4z" fill="%23333"/></svg>');
|
|
685
687
|
}
|
|
@@ -709,7 +711,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
709
711
|
left: 0 !important;
|
|
710
712
|
z-index: 99999;
|
|
711
713
|
}
|
|
712
|
-
`;typeof document>`u`&&console.warn(`"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM`);var
|
|
714
|
+
`;typeof document>`u`&&console.warn(`"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM`);var Oi=(()=>{let e=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`]],t=e[0],n={};for(let r of e)if(r[1]in document){for(let e=0;e<r.length;e++)n[t[e]]=r[e];return n}return!1})(),ki={change:Oi.fullscreenchange,error:Oi.fullscreenerror},Ai={async request(e,t){e||=document.documentElement;let n=Oi.requestFullscreen;await this._callNative(()=>e[n](t))},async exit(){if(!this.isFullscreen)return;let e=Oi.exitFullscreen;await this._callNative(()=>document[e]())},async _callNative(e){let t=e();if(t instanceof Promise){await t;return}await new Promise(e=>{let t=()=>{this.off(`change`,t),e()};this.on(`change`,t)})},on(e,t){let n=ki[e];n&&document.addEventListener(n,t)},off(e,t){let n=ki[e];n&&document.removeEventListener(n,t)},nativeAPI:Oi};Object.defineProperties(Ai,{isFullscreen:{get(){return!!document[Oi.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[Oi.fullscreenEnabled]}}});var ji=$.Control.extend({options:{position:`topleft`,title:`Full Screen`,titleCancel:`Exit Full Screen`,forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:Ai,onAdd(e){let t=`leaflet-control-zoom-fullscreen`,n,r=``;return e.zoomControl&&!this.options.forceSeparateButton?n=e.zoomControl._container:(n=document.createElement(`div`),n.className=`leaflet-bar`),this.options.content?r=this.options.content:t+=` leaflet-fullscreen-icon`,this._createButton(this.options.title,t,r,n,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on(`enterFullscreen exitFullscreen`,this._toggleState,this),n},onRemove(){$.DomEvent.off(this.link,`click`,$.DomEvent.stop).off(this.link,`click`,this.toggleFullScreen,this),this._screenfull.isEnabled&&$.DomEvent.off(document,this._screenfull.nativeAPI.fullscreenchange,$.DomEvent.stop).off(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this)},_createButton(e,t,n,r,i,a){return this.link=document.createElement(`a`),this.link.className=t,r.appendChild(this.link),this.link.href=`#`,this.link.title=e,this.link.innerHTML=n,this.link.setAttribute(`role`,`button`),this.link.setAttribute(`aria-label`,e),$.DomEvent.disableClickPropagation(r),$.DomEvent.on(this.link,`click`,$.DomEvent.stop).on(this.link,`click`,i,a),this._screenfull.isEnabled&&$.DomEvent.on(document,this._screenfull.nativeAPI.fullscreenchange,$.DomEvent.stop).on(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,a),this.link},async toggleFullScreen(){let e=this._map,{fullscreenElement:t,forcePseudoFullscreen:n}=this.options,r=t||e.getContainer(),i=this._screenfull.isEnabled&&!n;e._isFullscreen?(e._exitFired=!0,i?await this._screenfull.exit():r.classList.remove(`leaflet-pseudo-fullscreen`),e.invalidateSize(),e._isFullscreen=!1,e.fire(`exitFullscreen`)):(e._exitFired=!1,i?await this._screenfull.request(r):r.classList.add(`leaflet-pseudo-fullscreen`),e.invalidateSize(),e._isFullscreen=!0,e.fire(`enterFullscreen`))},_toggleState(){let{title:e,titleCancel:t}=this.options,n=this._map._isFullscreen;this.link.title=n?t:e,this.link.setAttribute(`aria-label`,this.link.title),this.link.setAttribute(`aria-pressed`,n.toString()),this.link.classList.toggle(`leaflet-fullscreen-on`,n)},_handleFullscreenChange(){let e=this._map;!this._screenfull.isFullscreen&&e._isFullscreen&&!e._exitFired&&(e._exitFired=!0,e._isFullscreen=!1,e.fire(`exitFullscreen`),e.invalidateSize())}});$.Map.include({toggleFullscreen(){this.fullscreenControl.toggleFullScreen()}}),$.Map.mergeOptions({fullscreenControl:!1}),$.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(new ji(this.options.fullscreenControlOptions))}),(function(){function e(t){return this instanceof e?(this._canvas=t=typeof t==`string`?document.getElementById(t):t,this._ctx=t.getContext(`2d`),this._width=t.width,this._height=t.height,this._max=1,void this.clear()):new e(t)}e.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e,t){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t){t||=15;var n=this._circle=document.createElement(`canvas`),r=n.getContext(`2d`),i=this._r=e+t;return n.width=n.height=2*i,r.shadowOffsetX=r.shadowOffsetY=200,r.shadowBlur=t,r.shadowColor=`black`,r.beginPath(),r.arc(i-200,i-200,e,0,2*Math.PI,!0),r.closePath(),r.fill(),this},gradient:function(e){var t=document.createElement(`canvas`),n=t.getContext(`2d`),r=n.createLinearGradient(0,0,0,256);for(var i in t.width=1,t.height=256,e)r.addColorStop(i,e[i]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var t=this._ctx;t.clearRect(0,0,this._width,this._height);for(var n,r=0,i=this._data.length;i>r;r++)n=this._data[r],t.globalAlpha=Math.max(n[2]/this._max,e||.05),t.drawImage(this._circle,n[0]-this._r,n[1]-this._r);var a=t.getImageData(0,0,this._width,this._height);return this._colorize(a.data,this._grad),t.putImageData(a,0,0),this},_colorize:function(e,t){for(var n,r=3,i=e.length;i>r;r+=4)n=4*e[r],n&&(e[r-3]=t[n],e[r-2]=t[n+1],e[r-1]=t[n+2])}},window.simpleheat=e})(),L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(e,t){this._latlngs=e,L.setOptions(this,t)},setLatLngs:function(e){return this._latlngs=e,this.redraw()},addLatLng:function(e){return this._latlngs.push(e),this.redraw()},setOptions:function(e){return L.setOptions(this,e),this._heat&&this._updateOptions(),this.redraw()},redraw:function(){return!this._heat||this._frame||this._map._animating||(this._frame=L.Util.requestAnimFrame(this._redraw,this)),this},onAdd:function(e){this._map=e,this._canvas||this._initCanvas(),e._panes.overlayPane.appendChild(this._canvas),e.on(`moveend`,this._reset,this),e.options.zoomAnimation&&L.Browser.any3d&&e.on(`zoomanim`,this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._canvas),e.off(`moveend`,this._reset,this),e.options.zoomAnimation&&e.off(`zoomanim`,this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},_initCanvas:function(){var e=this._canvas=L.DomUtil.create(`canvas`,`leaflet-heatmap-layer leaflet-layer`),t=L.DomUtil.testProp([`transformOrigin`,`WebkitTransformOrigin`,`msTransformOrigin`]);e.style[t]=`50% 50%`;var n=this._map.getSize();e.width=n.x,e.height=n.y;var r=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(e,`leaflet-zoom-`+(r?`animated`:`hide`)),this._heat=simpleheat(e),this._updateOptions()},_updateOptions:function(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)},_reset:function(){var e=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,e);var t=this._map.getSize();this._heat._width!==t.x&&(this._canvas.width=this._heat._width=t.x),this._heat._height!==t.y&&(this._canvas.height=this._heat._height=t.y),this._redraw()},_redraw:function(){var e,t,n,r,i,a,o,s,c,l=[],u=this._heat._r,d=this._map.getSize(),f=new L.Bounds(L.point([-u,-u]),d.add([u,u])),p=this.options.max===void 0?1:this.options.max,m=this.options.maxZoom===void 0?this._map.getMaxZoom():this.options.maxZoom,ee=1/2**Math.max(0,Math.min(m-this._map.getZoom(),12)),h=u/2,g=[],te=this._map._getMapPanePos(),ne=te.x%h,re=te.y%h;for(e=0,t=this._latlngs.length;t>e;e++)n=this._map.latLngToContainerPoint(this._latlngs[e]),f.contains(n)&&(i=Math.floor((n.x-ne)/h)+2,a=Math.floor((n.y-re)/h)+2,c=(this._latlngs[e].alt===void 0?this._latlngs[e][2]===void 0?1:+this._latlngs[e][2]:this._latlngs[e].alt)*ee,g[a]=g[a]||[],r=g[a][i],r?(r[0]=(r[0]*r[2]+n.x*c)/(r[2]+c),r[1]=(r[1]*r[2]+n.y*c)/(r[2]+c),r[2]+=c):g[a][i]=[n.x,n.y,c]);for(e=0,t=g.length;t>e;e++)if(g[e])for(o=0,s=g[e].length;s>o;o++)r=g[e][o],r&&l.push([Math.round(r[0]),Math.round(r[1]),Math.min(r[2],p)]);this._heat.data(l).draw(this.options.minOpacity),this._frame=null},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._getCenterOffset(e.center)._multiplyBy(-t).subtract(this._map._getMapPanePos());L.DomUtil.setTransform?L.DomUtil.setTransform(this._canvas,n,t):this._canvas.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(n)+` scale(`+t+`)`}}),L.heatLayer=function(e,t){return new L.HeatLayer(e,t)};var Mi=Di.replace(`:root`,`:host`),Ni=`
|
|
713
715
|
#shaclMapDialog .closeButton { position: absolute; right: 0; top: 0; z-index: 1000; padding: 6px 8px; cursor: pointer; border: 0; background-color: #FFFA; font-size: 24px; }
|
|
714
716
|
#shaclMapDialog { padding: 0; width:90vw; height: 90vh; margin: auto; }
|
|
715
717
|
#shaclMapDialog::backdrop { background-color: #0007; }
|
|
@@ -726,11 +728,11 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
726
728
|
.query-editor .query-map-clear { position: absolute; top: 8px; right: 8px; z-index: 1; }
|
|
727
729
|
.query-editor .query-map-clear::part(button) { background-color: rgba(255, 255, 255, 0.9); }
|
|
728
730
|
.query-editor .query-map-clear[hidden] { display: none; }
|
|
729
|
-
`,
|
|
731
|
+
`,Pi=`
|
|
730
732
|
<dialog id="shaclMapDialog">
|
|
731
733
|
<div id="shaclMapDialogContainer"></div>
|
|
732
734
|
<div class="hint">ⓘ Draw a polygon or marker, then close dialog</div>
|
|
733
735
|
<button class="closeButton" type="button">✕</button>
|
|
734
|
-
</dialog>`,
|
|
735
|
-
`+
|
|
736
|
-
`+
|
|
736
|
+
</dialog>`,Fi={lng:8.657238961696038,lat:49.87627570549512},Ii=`© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>`,Li=`https://tile.openstreetmap.de/{z}/{x}/{y}.png`,Ri=$.icon({iconUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=`,shadowUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC`,iconSize:[25,41],shadowSize:[41,41],iconAnchor:[12,41],shadowAnchor:[14,41],popupAnchor:[-3,-76]});function zi(e,t){return $.map(e,{...t,layers:[$.tileLayer(Li)]})}function Bi(e,t){let n=$.default??$,r=window.L,i=n,a=r;return!i.heatLayer&&a?.heatLayer&&(i.HeatLayer=a.HeatLayer,i.heatLayer=a.heatLayer),window.L=n,i.heatLayer(e,{maxZoom:t})}function Vi(e,t,n){return new($.Control.extend({options:{position:`topleft`},onAdd:()=>{let r=$.DomUtil.create(`div`,`leaflet-control leaflet-bar`),i=$.DomUtil.create(`a`,``,r);return i.href=`#`,i.title=e,i.innerHTML=t,$.DomEvent.on(i,`click`,$.DomEvent.stop).on(i,`click`,n),r}}))}var Hi=class extends De{constructor(e){super(e,Ei+`
|
|
737
|
+
`+Mi+`
|
|
738
|
+
`+Ni)}initEditMode(e){e.insertAdjacentHTML(`beforeend`,Pi);let t=e.querySelector(`#shaclMapDialogContainer`);this.map=zi(t,{fullscreenControl:!0,editable:!0,zoom:5,maxBounds:Yi,center:Fi}),this.map.attributionControl.addAttribution(Ii);let n=this.map;this.map.addControl(Vi(`Create a new polygon`,`▰`,()=>{this.displayedShape?.remove(),this.displayedShape=n.editTools.startPolygon()})),this.map.addControl(Vi(`Create a new marker`,`•`,()=>{this.displayedShape?.remove(),this.displayedShape=n.editTools.startMarker(void 0,{icon:Ri})})),this.map.on(`editable:drawing:end editable:vertex:dragend`,()=>{this.saveChanges()});let r=e.querySelector(`#shaclMapDialog`);return r.addEventListener(`click`,e=>{e.target===r&&r.close()}),r.querySelector(`.closeButton`)?.addEventListener(`click`,()=>r.close()),r.addEventListener(`close`,()=>{let e=document.body.style.top;document.body.style.position=``,document.body.style.top=``,window.scrollTo(0,parseInt(e||`0`)*-1),this.currentEditor&&this.createdGeometry&&(this.currentEditor.value=Qi(this.createdGeometry),this.currentEditor.dispatchEvent(new Event(`change`,{bubbles:!0})))}),r}createEditor(e,t){let n=e.config.form.querySelector(`#shaclMapDialog`);n||=this.initEditMode(e.config.form);let r=e.config.theme.createButton(`Open map...`,!1);r.style.marginLeft=`5px`,r.classList.add(`open-map-button`),r.onclick=()=>{this.currentEditor=i.querySelector(`.editor`),this.createdGeometry=void 0,this.displayedShape?.remove(),this.drawAndZoomToGeometry(Xi(this.currentEditor.value||``),this.map),document.body.style.top=`-${window.scrollY}px`,document.body.style.position=`fixed`,n.showModal()};let i=u(e,t||null,!0);return i.appendChild(r),i}createQueryEditor(e,t){let n=document.createElement(`div`);n.classList.add(`query-editor`,`query-map-editor`),n.dataset.queryFieldId=e.id,n.setAttribute(`part`,`query-editor`);let r=document.createElement(`label`);r.textContent=t.label,t.description&&(r.title=t.description.value),n.appendChild(r);let i=document.createElement(`div`);i.classList.add(`query-controls`),n.appendChild(i);let a=document.createElement(`div`);a.classList.add(`query-map`),i.appendChild(a);let o=new ie;o.classList.add(`clear`,`query-map-clear`),o.title=`Clear`,o.dense=t.config.theme.dense,o.icon=!0,o.hidden=!0,i.appendChild(o);let s=!1,c,l=zi(a,{attributionControl:!1,fullscreenControl:!0,maxBoundsViscosity:1,trackResize:!1,zoom:0});l.fitBounds(Yi).setMaxBounds(Yi),l.on(`moveend`,()=>{s=l.getZoom()>0,o.hidden=!s;let e=s?Wi(l.getBounds()):void 0;e!==c&&(c=e,n.dispatchEvent(new Event(`change`,{bubbles:!0})))}),o.addEventListener(`click`,e=>{e.stopPropagation(),l.fitBounds(Yi,{animate:!1})});let u,d=$.featureGroup().addTo(l),f=e=>{if(d.clearLayers(),u=void 0,e)if(e.heatmap){if(!Ui(l,a)){u=e;return}let t=$i(e.heatmap);t.length&&Bi(t,l.getZoom()||0).addTo(d)}else Ki(e,d)};return new ResizeObserver(()=>{a.clientWidth<=0||a.clientHeight<=0||(l.invalidateSize({debounceMoveend:!0}),u&&f(u))}).observe(a),n.getQueryCriteria=()=>!s||!c?[]:[{field:e,operator:`equals`,value:y.literal(c,t.datatype)}],n.setQueryFacet=f,n}createViewer(e,t){let n=document.createElement(`div`),r=Xi(t.value);if(r){let e=zi(n,{fullscreenControl:!0,zoom:5,center:Fi,maxBounds:Yi});e.attributionControl.addAttribution(Ii),Ji(r,e)}return n}drawAndZoomToGeometry(e,t){this.displayedShape=Ji(e,t)}saveChanges(){if(this.displayedShape instanceof $.Marker){let{lng:e,lat:t}=this.displayedShape.getLatLng();this.createdGeometry={type:`Point`,coordinates:[e,t]};return}if(this.displayedShape instanceof $.Polygon){let e=this.displayedShape.getLatLngs()[0];if(!e.length){this.createdGeometry=void 0;return}let t=e.map(({lng:e,lat:t})=>[e,t]);e[0].equals(e[e.length-1])||t.push([...t[0]]),this.createdGeometry={type:`Polygon`,coordinates:[t]};return}this.createdGeometry=void 0}};function Ui(e,t){let n=t.getBoundingClientRect(),r=e.getSize();return n.width>0&&n.height>0&&r.x>0&&r.y>0}function Wi(e){let t=Gi(e.getSouth(),-90,90),n=Gi(e.getWest(),-180,180),r=Gi(e.getNorth(),-90,90),i=Gi(e.getEast(),-180,180);return`POLYGON((${n} ${t},${i} ${t},${i} ${r},${n} ${r},${n} ${t}))`}function Gi(e,t,n){return Math.min(n,Math.max(t,e))}function Ki(e,t){if(!e.buckets?.length)return;let n=Math.max(...e.buckets.map(e=>e.count));for(let r of e.buckets){let e=Xi(r.value.value);if(!e)continue;let i=n>0?r.count/n:0;if(e.type===`Point`){let[n,r]=e.coordinates;$.circleMarker({lat:r,lng:n},{radius:4+i*16,fillColor:`#3388ff`,fillOpacity:.4+i*.4,color:`#3388ff`,weight:1}).addTo(t)}else $.polygon(qi(e.coordinates[0]),{fillColor:`#3388ff`,fillOpacity:.15+i*.35,color:`#3388ff`,weight:1}).addTo(t)}}function qi(e){return e.map(([e,t])=>({lat:t,lng:e}))}function Ji(e,t){if(setTimeout(()=>t.invalidateSize()),e?.type===`Point`){let[n,r]=e.coordinates,i={lng:n,lat:r},a=$.marker(i,{icon:Ri}).addTo(t);return t.setView(i,15,{animate:!1}),a}if(e?.type===`Polygon`){let n=$.polygon(qi(e.coordinates[0])).addTo(t),r=n.getBounds();return t.fitBounds(r,{animate:!1}),setTimeout(()=>{t.fitBounds(r,{animate:!1}),t.setView(n.getCenter(),void 0,{animate:!1})},1),n}t.setZoom(5)}var Yi=[[-90,-180],[90,180]];function Xi(e){let t=e.match(/^POINT\s*\(\s*([^()]+)\s*\)$/i);if(t){let e=Zi(t[1]);return e?{type:`Point`,coordinates:e}:void 0}let n=e.match(/^POLYGON\s*\(\(\s*(.*?)\s*\)\)$/i);if(!n)return;let r=n[1].split(`,`).map(Zi);if(!(r.length<3||r.some(e=>!e)))return{type:`Polygon`,coordinates:[r]}}function Zi(e){let t=e.trim().split(/\s+/).map(Number);return t.length===2&&t.every(Number.isFinite)?t:void 0}function Qi(e){return e.type===`Point`?`POINT(${e.coordinates.join(` `)})`:`POLYGON((${e.coordinates[0].map(e=>e.join(` `)).join(`,`)}))`}function $i(e){let t=[];if(e.columns<=0||e.rows<=0||!Number.isFinite(e.minX)||!Number.isFinite(e.maxX)||!Number.isFinite(e.minY)||!Number.isFinite(e.maxY))return t;let n=(e.maxX-e.minX)/e.columns,r=(e.maxY-e.minY)/e.rows;for(let i=0;i<Math.min(e.rows,e.counts.length);i++){let a=e.counts[i];if(a!==null)for(let o=0;o<Math.min(e.columns,a.length);o++){if(!Number.isFinite(a[o])||a[o]<=0)continue;let s=e.maxY-(i+.5)*r,c=e.minX+(o+.5)*n;t.push([s,c,a[o]])}}return t}export{bi as Config,Ae as DefaultTheme,Ci as FileUploadPlugin,Hi as LeafletPlugin,De as Plugin,Si as ShaclForm,w as ShaclPropertyTemplate,r as Theme,c as fetchRDF,se as findConformsToShapeSubject,T as findConformsToValuesSubject,_e as findLabel,Qi as geometryToWkt,Ce as importRDF,xi as initTimeout,Se as isRangeQueryField,v as loadGraphs,p as loadRDF,Oe as parseRDF,t as prefixes,d as propertyMappers,h as rdfCache,m as registerPlugin,Xi as wktToGeometry,Yi as worldBounds};
|