@maptiler/geocoding-control 1.0.1-rc1 → 1.0.1

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/react.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(J,Z){typeof exports=="object"&&typeof module<"u"?Z(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],Z):(J=typeof globalThis<"u"?globalThis:J||self,Z(J.reactMaptilerGeocoder={},J.React))})(this,function(J,Z){"use strict";var Nn=Object.defineProperty;var On=(J,Z,R)=>Z in J?Nn(J,Z,{enumerable:!0,configurable:!0,writable:!0,value:R}):J[Z]=R;var He=(J,Z,R)=>(On(J,typeof Z!="symbol"?Z+"":Z,R),R);function R(){}function pt(n,e){for(const t in e)n[t]=e[t];return n}function Je(n){return n()}function Xe(){return Object.create(null)}function re(n){n.forEach(Je)}function Ye(n){return typeof n=="function"}function ae(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ee;function K(n,e){return n===e?!0:(Ee||(Ee=document.createElement("a")),Ee.href=e,n===Ee.href)}function Tt(n){return Object.keys(n).length===0}function Mt(n,e,t,r){if(n){const l=xe(n,e,t,r);return n[0](l)}}function xe(n,e,t,r){return n[1]&&r?pt(t.ctx.slice(),n[1](r(e))):t.ctx}function Lt(n,e,t,r){if(n[2]&&r){const l=n[2](r(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const u=[],o=Math.max(e.dirty.length,l.length);for(let c=0;c<o;c+=1)u[c]=e.dirty[c]|l[c];return u}return e.dirty|l}return e.dirty}function Rt(n,e,t,r,l,u){if(l){const o=xe(e,t,r,u);n.p(o,l)}}function Bt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let r=0;r<t;r++)e[r]=-1;return e}return-1}function $e(n){return n??""}function p(n,e){n.appendChild(e)}function I(n,e,t){n.insertBefore(e,t||null)}function P(n){n.parentNode&&n.parentNode.removeChild(n)}function z(n){return document.createElement(n)}function se(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function oe(n){return document.createTextNode(n)}function X(){return oe(" ")}function Et(){return oe("")}function D(n,e,t,r){return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}function Ct(n){return function(e){return e.preventDefault(),n.call(this,e)}}function s(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function St(n){return Array.from(n.childNodes)}function Te(n,e){e=""+e,n.data!==e&&(n.data=e)}function et(n,e){n.value=e??""}function ce(n,e,t){n.classList.toggle(e,!!t)}function Ut(n,e,{bubbles:t=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:r})}let Me;function Le(n){Me=n}function tt(){if(!Me)throw new Error("Function called outside component initialization");return Me}function zt(n){tt().$$.on_destroy.push(n)}function Pt(){const n=tt();return(e,t,{cancelable:r=!1}={})=>{const l=n.$$.callbacks[e];if(l){const u=Ut(e,t,{cancelable:r});return l.slice().forEach(o=>{o.call(n,u)}),!u.defaultPrevented}return!0}}function nt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(r=>r.call(this,e))}const ye=[],je=[];let be=[];const rt=[],At=Promise.resolve();let We=!1;function It(){We||(We=!0,At.then(lt))}function Ze(n){be.push(n)}const Ne=new Set;let we=0;function lt(){if(we!==0)return;const n=Me;do{try{for(;we<ye.length;){const e=ye[we];we++,Le(e),jt(e.$$)}}catch(e){throw ye.length=0,we=0,e}for(Le(null),ye.length=0,we=0;je.length;)je.pop()();for(let e=0;e<be.length;e+=1){const t=be[e];Ne.has(t)||(Ne.add(t),t())}be.length=0}while(ye.length);for(;rt.length;)rt.pop()();We=!1,Ne.clear(),Le(n)}function jt(n){if(n.fragment!==null){n.update(),re(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ze)}}function Wt(n){const e=[],t=[];be.forEach(r=>n.indexOf(r)===-1?e.push(r):t.push(r)),t.forEach(r=>r()),be=e}const Ce=new Set;let de;function Se(){de={r:0,c:[],p:de}}function Ue(){de.r||re(de.c),de=de.p}function j(n,e){n&&n.i&&(Ce.delete(n),n.i(e))}function F(n,e,t,r){if(n&&n.o){if(Ce.has(n))return;Ce.add(n),de.c.push(()=>{Ce.delete(n),r&&(t&&n.d(1),r())}),n.o(e)}else r&&r()}function it(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Zt(n,e){F(n,1,1,()=>{e.delete(n.key)})}function Nt(n,e,t,r,l,u,o,c,a,f,d,v){let _=n.length,S=u.length,U=_;const Q={};for(;U--;)Q[n[U].key]=U;const L=[],B=new Map,G=new Map,m=[];for(U=S;U--;){const b=v(l,u,U),k=t(b);let h=o.get(k);h?r&&m.push(()=>h.p(b,e)):(h=f(k,b),h.c()),B.set(k,L[U]=h),k in Q&&G.set(k,Math.abs(U-Q[k]))}const O=new Set,g=new Set;function E(b){j(b,1),b.m(c,d),o.set(b.key,b),d=b.first,S--}for(;_&&S;){const b=L[S-1],k=n[_-1],h=b.key,w=k.key;b===k?(d=b.first,_--,S--):B.has(w)?!o.has(h)||O.has(h)?E(b):g.has(w)?_--:G.get(h)>G.get(w)?(g.add(h),E(b)):(O.add(w),_--):(a(k,o),_--)}for(;_--;){const b=n[_];B.has(b.key)||a(b,o)}for(;S;)E(L[S-1]);return re(m),L}function fe(n){n&&n.c()}function le(n,e,t){const{fragment:r,after_update:l}=n.$$;r&&r.m(e,t),Ze(()=>{const u=n.$$.on_mount.map(Je).filter(Ye);n.$$.on_destroy?n.$$.on_destroy.push(...u):re(u),n.$$.on_mount=[]}),l.forEach(Ze)}function ie(n,e){const t=n.$$;t.fragment!==null&&(Wt(t.after_update),re(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ot(n,e){n.$$.dirty[0]===-1&&(ye.push(n),It(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function he(n,e,t,r,l,u,o=null,c=[-1]){const a=Me;Le(n);const f=n.$$={fragment:null,ctx:[],props:u,update:R,not_equal:l,bound:Xe(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Xe(),dirty:c,skip_bound:!1,root:e.target||a.$$.root};o&&o(f.root);let d=!1;if(f.ctx=t?t(n,e.props||{},(v,_,...S)=>{const U=S.length?S[0]:_;return f.ctx&&l(f.ctx[v],f.ctx[v]=U)&&(!f.skip_bound&&f.bound[v]&&f.bound[v](U),d&&Ot(n,v)),_}):[],f.update(),d=!0,re(f.before_update),f.fragment=r?r(f.ctx):!1,e.target){if(e.hydrate){const v=St(e.target);f.fragment&&f.fragment.l(v),v.forEach(P)}else f.fragment&&f.fragment.c();e.intro&&j(n.$$.fragment),le(n,e.target,e.anchor),lt()}Le(a)}class me{constructor(){He(this,"$$");He(this,"$$set")}$destroy(){ie(this,1),this.$destroy=R}$on(e,t){if(!Ye(t))return R;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const l=r.indexOf(t);l!==-1&&r.splice(l,1)}}$set(e){this.$$set&&!Tt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ft="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ft);function Gt(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),s(e,"viewBox","0 0 14 14"),s(e,"width","13"),s(e,"height","13"),s(e,"class","svelte-en2qvf")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class st extends me{constructor(e){super(),he(this,e,null,Gt,ae,{})}}function Qt(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),s(e,"viewBox","0 0 30 30"),s(e,"fill","none"),s(e,"xmlns","http://www.w3.org/2000/svg"),s(e,"class","svelte-d2loi5")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class ot extends me{constructor(e){super(),he(this,e,null,Qt,ae,{})}}function qt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"area.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"area.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Dt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"poi.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"poi.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Vt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"postal_code.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"postal_code.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Kt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"street.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"street.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Ht(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"road.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"road.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Jt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"housenumber.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"housenumber.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Xt(n){let e,t,r,l;return{c(){e=z("img"),K(e.src,t=n[5])||s(e,"src",t),s(e,"alt",n[4]),s(e,"class","svelte-ltkwvy")},m(u,o){I(u,e,o),r||(l=D(e,"error",n[13]),r=!0)},p(u,o){o&32&&!K(e.src,t=u[5])&&s(e,"src",t),o&16&&s(e,"alt",u[4])},d(u){u&&P(e),r=!1,l()}}}function ct(n){let e,t;return{c(){e=z("span"),t=oe(n[6]),s(e,"class","secondary svelte-ltkwvy")},m(r,l){I(r,e,l),p(e,t)},p(r,l){l&64&&Te(t,r[6])},d(r){r&&P(e)}}}function Yt(n){var b,k;let e,t,r,l,u,o,c,a,f=n[0].place_name.replace(/,.*/,"")+"",d,v,_=n[2]==="always"||n[2]&&!n[0].address&&((b=n[0].properties)==null?void 0:b.kind)!=="road"&&((k=n[0].properties)==null?void 0:k.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5]),S,U,Q=n[0].place_name.replace(/[^,]*,?\s*/,"")+"",L,B,G;function m(h,w){var Y,M;return w&1&&(t=null),w&1&&(r=null),w&1&&(l=null),h[5]?Xt:h[0].address?Jt:((Y=h[0].properties)==null?void 0:Y.kind)==="road"||((M=h[0].properties)==null?void 0:M.kind)==="road_relation"?Ht:(t==null&&(t=!!h[0].id.startsWith("address.")),t?Kt:(r==null&&(r=!!h[0].id.startsWith("postal_code.")),r?Vt:(l==null&&(l=!!h[0].id.startsWith("poi.")),l?Dt:qt)))}let O=m(n,-1),g=O(n),E=_&&ct(n);return{c(){e=z("li"),g.c(),u=X(),o=z("span"),c=z("span"),a=z("span"),d=oe(f),v=X(),E&&E.c(),S=X(),U=z("span"),L=oe(Q),s(a,"class","primary svelte-ltkwvy"),s(c,"class","svelte-ltkwvy"),s(U,"class","line2 svelte-ltkwvy"),s(o,"class","texts svelte-ltkwvy"),s(e,"tabindex","0"),s(e,"data-selected",n[1]),s(e,"class","svelte-ltkwvy"),ce(e,"selected",n[1])},m(h,w){I(h,e,w),g.m(e,null),p(e,u),p(e,o),p(o,c),p(c,a),p(a,d),p(c,v),E&&E.m(c,null),p(o,S),p(o,U),p(U,L),B||(G=[D(e,"mouseenter",n[11]),D(e,"focus",n[12])],B=!0)},p(h,[w]){var Y,M;O===(O=m(h,w))&&g?g.p(h,w):(g.d(1),g=O(h),g&&(g.c(),g.m(e,u))),w&1&&f!==(f=h[0].place_name.replace(/,.*/,"")+"")&&Te(d,f),w&37&&(_=h[2]==="always"||h[2]&&!h[0].address&&((Y=h[0].properties)==null?void 0:Y.kind)!=="road"&&((M=h[0].properties)==null?void 0:M.kind)!=="road_relation"&&!h[0].id.startsWith("address.")&&!h[0].id.startsWith("postal_code.")&&(!h[0].id.startsWith("poi.")||!h[5])),_?E?E.p(h,w):(E=ct(h),E.c(),E.m(c,null)):E&&(E.d(1),E=null),w&1&&Q!==(Q=h[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Te(L,Q),w&2&&s(e,"data-selected",h[1]),w&2&&ce(e,"selected",h[1])},i:R,o:R,d(h){h&&P(e),g.d(),E&&E.d(),B=!1,re(G)}}}function xt(n,e,t){var G;let r,l,{feature:u}=e,{selected:o=!1}=e,{showPlaceType:c}=e,{missingIconsCache:a}=e,{iconsBaseUrl:f}=e;const d=(G=u.properties)==null?void 0:G.categories;let v,_,S=0;function U(m){_&&a.add(_),t(9,S++,S)}function Q(m){nt.call(this,n,m)}function L(m){nt.call(this,n,m)}const B=m=>U(m.currentTarget);return n.$$set=m=>{"feature"in m&&t(0,u=m.feature),"selected"in m&&t(1,o=m.selected),"showPlaceType"in m&&t(2,c=m.showPlaceType),"missingIconsCache"in m&&t(8,a=m.missingIconsCache),"iconsBaseUrl"in m&&t(3,f=m.iconsBaseUrl)},n.$$.update=()=>{var m,O,g,E;if(n.$$.dirty&1848)do t(10,r--,r),t(4,v=d==null?void 0:d[r]),t(5,_=v?f+v.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!_||a.has(_)));n.$$.dirty&1&&t(6,l=u.id.startsWith("poi.")?(O=(m=u.properties)==null?void 0:m.categories)==null?void 0:O.join(", "):((E=(g=u.properties)==null?void 0:g.place_type_name)==null?void 0:E[0])??u.place_type[0])},t(10,r=(d==null?void 0:d.length)??0),[u,o,c,f,v,_,l,U,a,S,r,Q,L,B]}class $t extends me{constructor(e){super(),he(this,e,xt,Yt,ae,{feature:0,selected:1,showPlaceType:2,missingIconsCache:8,iconsBaseUrl:3})}}function en(n){let e;return{c(){e=z("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',s(e,"class","svelte-7cmwmc")},m(t,r){I(t,e,r)},p:R,i:R,o:R,d(t){t&&P(e)}}}class tn extends me{constructor(e){super(),he(this,e,null,en,ae,{})}}function nn(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),s(e,"viewBox","0 0 60.006 21.412"),s(e,"width","14"),s(e,"height","20"),s(e,"class","svelte-en2qvf")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class rn extends me{constructor(e){super(),he(this,e,null,nn,ae,{})}}function ln(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"),s(e,"width","14"),s(e,"height","14"),s(e,"viewBox","0 0 15 15"),s(e,"class","svelte-en2qvf")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class sn extends me{constructor(e){super(),he(this,e,null,ln,ae,{})}}function on(n,e,t){const r=e[1],l=e[0],u=r-l;return n===r&&t?n:((n-l)%u+u)%u+l}function ft(n){const e=[...n];return e[2]<e[0]&&(e[2]+=360),e}let Re;async function cn(n,e,t){const r=n==null?void 0:n.getCenterAndZoom();for(const l of e??[])if(!(r&&(l.minZoom!=null&&l.minZoom>r[0]||l.maxZoom!=null&&l.maxZoom<r[0]))){if(l.type==="fixed")return l.coordinates.join(",");e:if(l.type==="client-geolocation"){if(Re&&l.cachedLocationExpiry&&Re.time+l.cachedLocationExpiry>Date.now()){if(!Re.coords)break e;return Re.coords}let u;try{return u=await new Promise((o,c)=>{t.signal.addEventListener("abort",()=>{c(Error("aborted"))}),navigator.geolocation.getCurrentPosition(a=>{o([a.coords.longitude,a.coords.latitude].map(f=>f.toFixed(6)).join(","))},a=>{c(a)},l)}),u}catch{}finally{l.cachedLocationExpiry&&(Re={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(l.type==="server-geolocation")return"ip";if(r&&l.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}function ut(n,e,t){const r=n.slice();return r[77]=e[t],r[79]=t,r}function at(n){let e,t;return e=new tn({}),{c(){fe(e.$$.fragment)},m(r,l){le(e,r,l),t=!0},i(r){t||(j(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ie(e,r)}}}function dt(n){let e,t,r,l,u;return t=new rn({}),{c(){e=z("button"),fe(t.$$.fragment),s(e,"type","button"),s(e,"title",n[9]),s(e,"class","svelte-1r7dvt7"),ce(e,"active",n[0])},m(o,c){I(o,e,c),le(t,e,null),r=!0,l||(u=D(e,"click",n[63]),l=!0)},p(o,c){(!r||c[0]&512)&&s(e,"title",o[9]),(!r||c[0]&1)&&ce(e,"active",o[0])},i(o){r||(j(t.$$.fragment,o),r=!0)},o(o){F(t.$$.fragment,o),r=!1},d(o){o&&P(e),ie(t),l=!1,u()}}}function fn(n){let e,t=[],r=new Map,l,u,o,c=it(n[13]);const a=f=>f[77].id+(f[77].address?","+f[77].address:"");for(let f=0;f<c.length;f+=1){let d=ut(n,c,f),v=a(d);r.set(v,t[f]=ht(v,d))}return{c(){e=z("ul");for(let f=0;f<t.length;f+=1)t[f].c();s(e,"class","svelte-1r7dvt7")},m(f,d){I(f,e,d);for(let v=0;v<t.length;v+=1)t[v]&&t[v].m(e,null);l=!0,u||(o=[D(e,"mouseleave",n[67]),D(e,"blur",n[68])],u=!0)},p(f,d){d[0]&8940544&&(c=it(f[13]),Se(),t=Nt(t,d,a,1,f,c,r,e,Zt,ht,null,ut),Ue())},i(f){if(!l){for(let d=0;d<c.length;d+=1)j(t[d]);l=!0}},o(f){for(let d=0;d<t.length;d+=1)F(t[d]);l=!1},d(f){f&&P(e);for(let d=0;d<t.length;d+=1)t[d].d();u=!1,re(o)}}}function un(n){let e,t,r,l,u,o;return t=new ot({}),{c(){e=z("div"),fe(t.$$.fragment),r=X(),l=z("div"),u=oe(n[7]),s(l,"class","svelte-1r7dvt7"),s(e,"class","no-results svelte-1r7dvt7")},m(c,a){I(c,e,a),le(t,e,null),p(e,r),p(e,l),p(l,u),o=!0},p(c,a){(!o||a[0]&128)&&Te(u,c[7])},i(c){o||(j(t.$$.fragment,c),o=!0)},o(c){F(t.$$.fragment,c),o=!1},d(c){c&&P(e),ie(t)}}}function an(n){let e="",t;return{c(){t=oe(e)},m(r,l){I(r,t,l)},p:R,i:R,o:R,d(r){r&&P(t)}}}function dn(n){let e,t,r,l,u,o,c,a,f,d,v;return t=new ot({}),a=new st({}),{c(){e=z("div"),fe(t.$$.fragment),r=X(),l=z("div"),u=oe(n[6]),o=X(),c=z("button"),fe(a.$$.fragment),s(l,"class","svelte-1r7dvt7"),s(c,"class","svelte-1r7dvt7"),s(e,"class","error svelte-1r7dvt7")},m(_,S){I(_,e,S),le(t,e,null),p(e,r),p(e,l),p(l,u),p(e,o),p(e,c),le(a,c,null),f=!0,d||(v=D(c,"click",n[64]),d=!0)},p(_,S){(!f||S[0]&64)&&Te(u,_[6])},i(_){f||(j(t.$$.fragment,_),j(a.$$.fragment,_),f=!0)},o(_){F(t.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){_&&P(e),ie(t),ie(a),d=!1,v()}}}function ht(n,e){let t,r,l;function u(){return e[65](e[79])}function o(){return e[66](e[77])}return r=new $t({props:{feature:e[77],showPlaceType:e[10],selected:e[14]===e[79],missingIconsCache:e[19],iconsBaseUrl:e[11]}}),r.$on("mouseenter",u),r.$on("focus",o),{key:n,first:null,c(){t=Et(),fe(r.$$.fragment),this.first=t},m(c,a){I(c,t,a),le(r,c,a),l=!0},p(c,a){e=c;const f={};a[0]&8192&&(f.feature=e[77]),a[0]&1024&&(f.showPlaceType=e[10]),a[0]&24576&&(f.selected=e[14]===e[79]),a[0]&2048&&(f.iconsBaseUrl=e[11]),r.$set(f)},i(c){l||(j(r.$$.fragment,c),l=!0)},o(c){F(r.$$.fragment,c),l=!1},d(c){c&&P(t),ie(r,c)}}}function hn(n){let e,t,r,l,u,o,c,a,f,d,v,_,S,U,Q,L,B,G,m,O,g,E=!1;u=new sn({}),v=new st({});let b=n[18]&&at(),k=n[5]===!0&&dt(n);const h=n[55].default,w=Mt(h,n,n[54],null),Y=[dn,an,un,fn],M=[];function ve(y,A){var H,ge;return y[17]?0:y[15]?((H=y[13])==null?void 0:H.length)===0?2:y[15]&&((ge=y[13])!=null&&ge.length)?3:-1:1}return~(L=ve(n))&&(B=M[L]=Y[L](n)),{c(){e=X(),t=z("form"),r=z("div"),l=z("button"),fe(u.$$.fragment),o=X(),c=z("input"),a=X(),f=z("div"),d=z("button"),fe(v.$$.fragment),_=X(),b&&b.c(),S=X(),k&&k.c(),U=X(),w&&w.c(),Q=X(),B&&B.c(),s(l,"class","search-button svelte-1r7dvt7"),s(l,"type","button"),s(c,"placeholder",n[8]),s(c,"aria-label",n[8]),s(c,"class","svelte-1r7dvt7"),s(d,"type","button"),s(d,"title",n[3]),s(d,"class","svelte-1r7dvt7"),s(f,"class","clear-button-container svelte-1r7dvt7"),ce(f,"displayable",n[1]!==""),s(r,"class","input-group svelte-1r7dvt7"),s(t,"tabindex","0"),s(t,"class",G=$e(n[2])+" svelte-1r7dvt7"),ce(t,"can-collapse",n[4]&&n[1]==="")},m(y,A){I(y,e,A),I(y,t,A),p(t,r),p(r,l),le(u,l,null),p(r,o),p(r,c),n[57](c),et(c,n[1]),p(r,a),p(r,f),p(f,d),le(v,d,null),p(f,_),b&&b.m(f,null),p(r,S),k&&k.m(r,null),p(r,U),w&&w.m(r,null),p(t,Q),~L&&M[L].m(t,null),m=!0,O||(g=[D(l,"click",n[56]),D(c,"input",n[58]),D(c,"focus",n[59]),D(c,"blur",n[60]),D(c,"keydown",n[21]),D(c,"input",n[61]),D(d,"click",n[62]),D(t,"submit",Ct(n[20]))],O=!0)},p(y,A){(!m||A[0]&256)&&s(c,"placeholder",y[8]),(!m||A[0]&256)&&s(c,"aria-label",y[8]),A[0]&2&&c.value!==y[1]&&et(c,y[1]),(!m||A[0]&8)&&s(d,"title",y[3]),y[18]?b?A[0]&262144&&j(b,1):(b=at(),b.c(),j(b,1),b.m(f,null)):b&&(Se(),F(b,1,1,()=>{b=null}),Ue()),(!m||A[0]&2)&&ce(f,"displayable",y[1]!==""),y[5]===!0?k?(k.p(y,A),A[0]&32&&j(k,1)):(k=dt(y),k.c(),j(k,1),k.m(r,U)):k&&(Se(),F(k,1,1,()=>{k=null}),Ue()),w&&w.p&&(!m||A[1]&8388608)&&Rt(w,h,y,y[54],m?Lt(h,y[54],A,null):Bt(y[54]),null);let H=L;L=ve(y),L===H?~L&&M[L].p(y,A):(B&&(Se(),F(M[H],1,1,()=>{M[H]=null}),Ue()),~L?(B=M[L],B?B.p(y,A):(B=M[L]=Y[L](y),B.c()),j(B,1),B.m(t,null)):B=null),(!m||A[0]&4&&G!==(G=$e(y[2])+" svelte-1r7dvt7"))&&s(t,"class",G),(!m||A[0]&22)&&ce(t,"can-collapse",y[4]&&y[1]==="")},i(y){m||(j(E),j(u.$$.fragment,y),j(v.$$.fragment,y),j(b),j(k),j(w,y),j(B),m=!0)},o(y){F(E),F(u.$$.fragment,y),F(v.$$.fragment,y),F(b),F(k),F(w,y),F(B),m=!1},d(y){y&&(P(e),P(t)),ie(u),n[57](null),ie(v),b&&b.d(),k&&k.d(),w&&w.d(y),~L&&M[L].d(),O=!1,re(g)}}}function mn(n,e,t){let r,{$$slots:l={},$$scope:u}=e,{class:o=void 0}=e,{apiKey:c}=e,{bbox:a=void 0}=e,{clearButtonTitle:f="clear"}=e,{clearOnBlur:d=!1}=e,{collapsed:v=!1}=e,{country:_=void 0}=e,{debounceSearch:S=200}=e,{enableReverse:U=!1}=e,{errorMessage:Q="Something went wrong…"}=e,{filter:L=()=>!0}=e,{flyTo:B=!0}=e,{fuzzyMatch:G=!0}=e,{language:m=void 0}=e,{limit:O=void 0}=e,{mapController:g=void 0}=e,{minLength:E=2}=e,{noResultsMessage:b="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:k="Search"}=e,{proximity:h=[{type:"server-geolocation"}]}=e,{reverseActive:w=U==="always"}=e,{reverseButtonTitle:Y="toggle reverse geocoding"}=e,{searchValue:M=""}=e,{showFullGeometry:ve=!0}=e,{showPlaceType:y="ifNeeded"}=e,{showResultsWhileTyping:A=!0}=e,{types:H=void 0}=e,{zoom:ge=16}=e,{maxZoom:Be=18}=e,{apiUrl:Oe="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Fe={}}=e,{iconsBaseUrl:_t="https://cdn.maptiler.com/maptiler-geocoding-control/v1.0.1-rc1/icons/"}=e,{adjustUrlQuery:Ge=i=>{}}=e;function bn(){$.focus()}function wn(){$.blur()}function yt(i,N=!0){t(1,M=i),N?(t(14,W=-1),wt()):(De(),setTimeout(()=>{$.focus(),$.select()}))}function vn(){t(13,C=void 0),t(51,T=void 0),t(14,W=-1)}function kn(){t(50,q=[]),t(51,T=void 0)}let ke=!1,C,q,T,bt="",$,W=-1,ee,ze=[],_e,pe,Pe,Qe;const pn=new Set,ue=Pt();zt(()=>{g&&(g.setEventHandler(void 0),g.indicateReverse(!1),g.setSelectedMarker(-1),g.setMarkers(void 0,void 0))});function wt(i){if(pe&&(clearTimeout(pe),pe=void 0),W>-1&&C)t(51,T=C[W]),t(1,M=T.place_name.replace(/,.*/,"")),t(17,ee=void 0),t(50,q=void 0),t(14,W=-1);else if(M){const N=i||!vt();qe(M,{exact:!0}).then(()=>{t(50,q=C),t(51,T=void 0),N&&Tn()}).catch(te=>t(17,ee=te))}}function vt(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(M)}async function qe(i,{byId:N=!1,exact:te=!1}={}){t(17,ee=void 0),_e==null||_e.abort();const ne=new AbortController;t(18,_e=ne);try{const V=vt(),x=new URLSearchParams;if(m!==void 0&&x.set("language",Array.isArray(m)?m.join(","):m??""),H&&x.set("types",H.join(",")),a&&x.set("bbox",a.map(Ie=>Ie.toFixed(6)).join(",")),_&&x.set("country",Array.isArray(_)?_.join(","):_),!N&&!V){const Ie=await cn(g,h,ne);Ie&&x.set("proximity",Ie),(te||!A)&&x.set("autocomplete","false"),x.set("fuzzyMatch",String(G))}O!==void 0&&(!V||(H==null?void 0:H.length)===1)&&x.set("limit",String(O)),x.set("key",c),Ge(x);const Ae=Oe+"/"+encodeURIComponent(i)+".json?"+x.toString();if(Ae===bt){N?(t(13,C=void 0),t(51,T=ze[0])):t(13,C=ze);return}bt=Ae;const kt=await fetch(Ae,{signal:ne.signal,...Fe});if(!kt.ok)throw new Error;const Ke=await kt.json();ue("response",{url:Ae,featureCollection:Ke}),N?(t(13,C=void 0),t(51,T=Ke.features[0]),ze=[T]):(t(13,C=Ke.features.filter(L)),ze=C,V&&$.focus())}catch(V){if(V&&typeof V=="object"&&"name"in V&&V.name==="AbortError")return;throw V}finally{ne===_e&&t(18,_e=void 0)}}function Tn(){var te;if(!(q!=null&&q.length)||!B)return;const i=[180,90,-180,-90],N=!q.some(ne=>!ne.matching_text);for(const ne of q)if(N||!ne.matching_text)for(const V of[0,1,2,3])i[V]=Math[V<2?"min":"max"](i[V],((te=ne.bbox)==null?void 0:te[V])??ne.center[V%2]);g&&q.length>0&&(T&&i[0]===i[2]&&i[1]===i[3]?g.flyTo(T.center,ge):g.fitBounds(ft(i),50,Be))}function Mn(i){t(0,w=U==="always"),yt(on(i[0],[-180,180],!0).toFixed(6)+","+i[1].toFixed(6))}function Ln(i){if(!C)return;let N=i.key==="ArrowDown"?1:i.key==="ArrowUp"?-1:0;N?(W===-1&&N===-1&&t(14,W=C.length),t(14,W+=N),W>=C.length&&t(14,W=-1),i.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(i.key)&&t(14,W=-1)}function De(i=!0){if(t(17,ee=void 0),A){if(pe&&clearTimeout(pe),M.length<E)return;const N=M;pe=window.setTimeout(()=>{qe(N).catch(te=>t(17,ee=te))},i?S:0)}else t(13,C=void 0),t(17,ee=void 0)}function Ve(i){t(51,T=i),t(1,M=i.place_name),t(14,W=-1)}const Rn=()=>$.focus();function Bn(i){je[i?"unshift":"push"](()=>{$=i,t(16,$)})}function En(){M=this.value,t(1,M),t(12,ke),t(26,d)}const Cn=()=>t(12,ke=!0),Sn=()=>t(12,ke=!1),Un=()=>De(),zn=()=>{t(1,M=""),$.focus()},Pn=()=>t(0,w=!w),An=()=>t(17,ee=void 0),In=i=>t(14,W=i),jn=i=>Ve(i),Wn=()=>t(14,W=-1),Zn=()=>{};return n.$$set=i=>{"class"in i&&t(2,o=i.class),"apiKey"in i&&t(24,c=i.apiKey),"bbox"in i&&t(25,a=i.bbox),"clearButtonTitle"in i&&t(3,f=i.clearButtonTitle),"clearOnBlur"in i&&t(26,d=i.clearOnBlur),"collapsed"in i&&t(4,v=i.collapsed),"country"in i&&t(27,_=i.country),"debounceSearch"in i&&t(28,S=i.debounceSearch),"enableReverse"in i&&t(5,U=i.enableReverse),"errorMessage"in i&&t(6,Q=i.errorMessage),"filter"in i&&t(29,L=i.filter),"flyTo"in i&&t(30,B=i.flyTo),"fuzzyMatch"in i&&t(31,G=i.fuzzyMatch),"language"in i&&t(32,m=i.language),"limit"in i&&t(33,O=i.limit),"mapController"in i&&t(34,g=i.mapController),"minLength"in i&&t(35,E=i.minLength),"noResultsMessage"in i&&t(7,b=i.noResultsMessage),"placeholder"in i&&t(8,k=i.placeholder),"proximity"in i&&t(36,h=i.proximity),"reverseActive"in i&&t(0,w=i.reverseActive),"reverseButtonTitle"in i&&t(9,Y=i.reverseButtonTitle),"searchValue"in i&&t(1,M=i.searchValue),"showFullGeometry"in i&&t(37,ve=i.showFullGeometry),"showPlaceType"in i&&t(10,y=i.showPlaceType),"showResultsWhileTyping"in i&&t(38,A=i.showResultsWhileTyping),"types"in i&&t(39,H=i.types),"zoom"in i&&t(40,ge=i.zoom),"maxZoom"in i&&t(41,Be=i.maxZoom),"apiUrl"in i&&t(42,Oe=i.apiUrl),"fetchParameters"in i&&t(43,Fe=i.fetchParameters),"iconsBaseUrl"in i&&t(11,_t=i.iconsBaseUrl),"adjustUrlQuery"in i&&t(44,Ge=i.adjustUrlQuery),"$$scope"in i&&t(54,u=i.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&67112960&&setTimeout(()=>{t(15,Pe=ke),d&&!ke&&t(1,M="")}),n.$$.dirty[0]&8194|n.$$.dirty[1]&16&&M.length<E&&(t(51,T=void 0),t(13,C=void 0),t(17,ee=void 0),t(50,q=C)),n.$$.dirty[1]&1048640&&ve&&T&&!T.address&&T.geometry.type==="Point"&&qe(T.id,{byId:!0}).catch(i=>t(17,ee=i)),n.$$.dirty[0]&1073741824|n.$$.dirty[1]&3147272&&(g&&T&&T.id!==Qe&&B&&(!T.bbox||T.bbox[0]===T.bbox[2]&&T.bbox[1]===T.bbox[3]?g.flyTo(T.center,T.id.startsWith("poi.")||T.id.startsWith("address.")?Be:ge):g.fitBounds(ft(T.bbox),50,Be),t(13,C=void 0),t(50,q=void 0),t(14,W=-1)),t(52,Qe=T==null?void 0:T.id)),n.$$.dirty[0]&8192|n.$$.dirty[1]&524288&&q!==C&&t(50,q=void 0),n.$$.dirty[1]&1572872&&g&&g.setMarkers(q,T),n.$$.dirty[0]&2&&t(14,W=-1),n.$$.dirty[0]&40961|n.$$.dirty[1]&8&&g&&g.setEventHandler(i=>{switch(i.type){case"mapClick":w&&Mn(i.coordinates);break;case"markerClick":{const N=C==null?void 0:C.find(te=>te.id===i.id);N&&Ve(N)}break;case"markerMouseEnter":t(14,W=Pe?(C==null?void 0:C.findIndex(N=>N.id===i.id))??-1:-1);break;case"markerMouseLeave":t(14,W=-1);break}}),n.$$.dirty[0]&16384|n.$$.dirty[1]&8&&(g==null||g.setSelectedMarker(W)),n.$$.dirty[0]&24576&&t(53,r=C==null?void 0:C[W]),n.$$.dirty[0]&2|n.$$.dirty[1]&8){const i=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(M);g==null||g.setReverseMarker(i?[Number(i[1]),Number(i[2])]:void 0)}n.$$.dirty[1]&4194304&&ue("select",r),n.$$.dirty[1]&1048576&&ue("pick",T),n.$$.dirty[0]&40960&&ue("optionsVisibilityChange",Pe&&!!C),n.$$.dirty[0]&8192&&ue("featuresListed",C),n.$$.dirty[1]&524288&&ue("featuresMarked",q),n.$$.dirty[0]&1&&ue("reverseToggle",w),n.$$.dirty[0]&2&&ue("queryChange",M),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&g&&g.indicateReverse(w)},[w,M,o,f,v,U,Q,b,k,Y,y,_t,ke,C,W,Pe,$,ee,_e,pn,wt,Ln,De,Ve,c,a,d,_,S,L,B,G,m,O,g,E,h,ve,A,H,ge,Be,Oe,Fe,Ge,bn,wn,yt,vn,kn,q,T,Qe,r,u,l,Rn,Bn,En,Cn,Sn,Un,zn,Pn,An,In,jn,Wn,Zn]}class gn extends me{constructor(e){super(),he(this,e,mn,hn,ae,{class:2,apiKey:24,bbox:25,clearButtonTitle:3,clearOnBlur:26,collapsed:4,country:27,debounceSearch:28,enableReverse:5,errorMessage:6,filter:29,flyTo:30,fuzzyMatch:31,language:32,limit:33,mapController:34,minLength:35,noResultsMessage:7,placeholder:8,proximity:36,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:37,showPlaceType:10,showResultsWhileTyping:38,types:39,zoom:40,maxZoom:41,apiUrl:42,fetchParameters:43,iconsBaseUrl:11,adjustUrlQuery:44,focus:45,blur:46,setQuery:47,clearList:48,clearMap:49},null,[-1,-1,-1])}get focus(){return this.$$.ctx[45]}get blur(){return this.$$.ctx[46]}get setQuery(){return this.$$.ctx[47]}get clearList(){return this.$$.ctx[48]}get clearMap(){return this.$$.ctx[49]}}const mt=["featuresListed","featuresMarked","optionsVisibilityChange","pick","queryChange","response","reverseToggle","select"],_n=["apiKey","bbox","clearButtonTitle","clearOnBlur","collapsed","country","debounceSearch","enableReverse","reverseActive","errorMessage","filter","fuzzyMatch","language","limit","minLength","noResultsMessage","placeholder","proximity","reverseButtonTitle","showFullGeometry","showPlaceType","showResultsWhileTyping","adjustUrlQuery","types","zoom","mapController"];function gt(n){return"on"+n[0].toUpperCase()+n.slice(1)}const yn=Z.forwardRef(function(e,t){const r=Z.useRef(),l=Z.useRef(),u={...e};for(const o of mt)delete u[gt(o)];Z.useEffect(()=>{if(!r.current)throw new Error;const o=new gn({target:r.current,props:u});return l.current=o,()=>o.$destroy()},[]);for(const o of _n)Z.useEffect(()=>{l.current&&e[o]!==void 0&&l.current.$set({[o]:e[o]})},[e[o]]);for(const o of mt){const c=e[gt(o)];Z.useEffect(()=>{var a;return c&&((a=l.current)==null?void 0:a.$on(o,f=>{c(f.detail)}))},[c])}return Z.useImperativeHandle(t,()=>({setQuery:(o,c=!0)=>{var a;return(a=l.current)==null?void 0:a.setQuery(o,c)},clearMap:()=>{var o;return(o=l.current)==null?void 0:o.clearMap()},clearList:()=>{var o;return(o=l.current)==null?void 0:o.clearList()},focus:()=>{var o;return(o=l.current)==null?void 0:o.focus()},blur:()=>{var o;return(o=l.current)==null?void 0:o.blur()}})),Z.createElement("div",{ref:r})});J.GeocodingControl=yn,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
1
+ (function(J,Z){typeof exports=="object"&&typeof module<"u"?Z(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],Z):(J=typeof globalThis<"u"?globalThis:J||self,Z(J.reactMaptilerGeocoder={},J.React))})(this,function(J,Z){"use strict";var Nn=Object.defineProperty;var On=(J,Z,R)=>Z in J?Nn(J,Z,{enumerable:!0,configurable:!0,writable:!0,value:R}):J[Z]=R;var He=(J,Z,R)=>(On(J,typeof Z!="symbol"?Z+"":Z,R),R);function R(){}function pt(n,e){for(const t in e)n[t]=e[t];return n}function Je(n){return n()}function Xe(){return Object.create(null)}function re(n){n.forEach(Je)}function Ye(n){return typeof n=="function"}function ae(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ee;function K(n,e){return n===e?!0:(Ee||(Ee=document.createElement("a")),Ee.href=e,n===Ee.href)}function Tt(n){return Object.keys(n).length===0}function Mt(n,e,t,r){if(n){const l=xe(n,e,t,r);return n[0](l)}}function xe(n,e,t,r){return n[1]&&r?pt(t.ctx.slice(),n[1](r(e))):t.ctx}function Lt(n,e,t,r){if(n[2]&&r){const l=n[2](r(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const u=[],o=Math.max(e.dirty.length,l.length);for(let c=0;c<o;c+=1)u[c]=e.dirty[c]|l[c];return u}return e.dirty|l}return e.dirty}function Rt(n,e,t,r,l,u){if(l){const o=xe(e,t,r,u);n.p(o,l)}}function Bt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let r=0;r<t;r++)e[r]=-1;return e}return-1}function $e(n){return n??""}function p(n,e){n.appendChild(e)}function I(n,e,t){n.insertBefore(e,t||null)}function P(n){n.parentNode&&n.parentNode.removeChild(n)}function z(n){return document.createElement(n)}function se(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function oe(n){return document.createTextNode(n)}function X(){return oe(" ")}function Et(){return oe("")}function D(n,e,t,r){return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}function Ct(n){return function(e){return e.preventDefault(),n.call(this,e)}}function s(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function St(n){return Array.from(n.childNodes)}function Te(n,e){e=""+e,n.data!==e&&(n.data=e)}function et(n,e){n.value=e??""}function ce(n,e,t){n.classList.toggle(e,!!t)}function Ut(n,e,{bubbles:t=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:r})}let Me;function Le(n){Me=n}function tt(){if(!Me)throw new Error("Function called outside component initialization");return Me}function zt(n){tt().$$.on_destroy.push(n)}function Pt(){const n=tt();return(e,t,{cancelable:r=!1}={})=>{const l=n.$$.callbacks[e];if(l){const u=Ut(e,t,{cancelable:r});return l.slice().forEach(o=>{o.call(n,u)}),!u.defaultPrevented}return!0}}function nt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(r=>r.call(this,e))}const ye=[],je=[];let be=[];const rt=[],At=Promise.resolve();let We=!1;function It(){We||(We=!0,At.then(lt))}function Ze(n){be.push(n)}const Ne=new Set;let we=0;function lt(){if(we!==0)return;const n=Me;do{try{for(;we<ye.length;){const e=ye[we];we++,Le(e),jt(e.$$)}}catch(e){throw ye.length=0,we=0,e}for(Le(null),ye.length=0,we=0;je.length;)je.pop()();for(let e=0;e<be.length;e+=1){const t=be[e];Ne.has(t)||(Ne.add(t),t())}be.length=0}while(ye.length);for(;rt.length;)rt.pop()();We=!1,Ne.clear(),Le(n)}function jt(n){if(n.fragment!==null){n.update(),re(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ze)}}function Wt(n){const e=[],t=[];be.forEach(r=>n.indexOf(r)===-1?e.push(r):t.push(r)),t.forEach(r=>r()),be=e}const Ce=new Set;let de;function Se(){de={r:0,c:[],p:de}}function Ue(){de.r||re(de.c),de=de.p}function j(n,e){n&&n.i&&(Ce.delete(n),n.i(e))}function F(n,e,t,r){if(n&&n.o){if(Ce.has(n))return;Ce.add(n),de.c.push(()=>{Ce.delete(n),r&&(t&&n.d(1),r())}),n.o(e)}else r&&r()}function it(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Zt(n,e){F(n,1,1,()=>{e.delete(n.key)})}function Nt(n,e,t,r,l,u,o,c,a,f,d,v){let _=n.length,S=u.length,U=_;const Q={};for(;U--;)Q[n[U].key]=U;const L=[],B=new Map,G=new Map,m=[];for(U=S;U--;){const b=v(l,u,U),k=t(b);let h=o.get(k);h?r&&m.push(()=>h.p(b,e)):(h=f(k,b),h.c()),B.set(k,L[U]=h),k in Q&&G.set(k,Math.abs(U-Q[k]))}const O=new Set,g=new Set;function E(b){j(b,1),b.m(c,d),o.set(b.key,b),d=b.first,S--}for(;_&&S;){const b=L[S-1],k=n[_-1],h=b.key,w=k.key;b===k?(d=b.first,_--,S--):B.has(w)?!o.has(h)||O.has(h)?E(b):g.has(w)?_--:G.get(h)>G.get(w)?(g.add(h),E(b)):(O.add(w),_--):(a(k,o),_--)}for(;_--;){const b=n[_];B.has(b.key)||a(b,o)}for(;S;)E(L[S-1]);return re(m),L}function fe(n){n&&n.c()}function le(n,e,t){const{fragment:r,after_update:l}=n.$$;r&&r.m(e,t),Ze(()=>{const u=n.$$.on_mount.map(Je).filter(Ye);n.$$.on_destroy?n.$$.on_destroy.push(...u):re(u),n.$$.on_mount=[]}),l.forEach(Ze)}function ie(n,e){const t=n.$$;t.fragment!==null&&(Wt(t.after_update),re(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ot(n,e){n.$$.dirty[0]===-1&&(ye.push(n),It(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function he(n,e,t,r,l,u,o=null,c=[-1]){const a=Me;Le(n);const f=n.$$={fragment:null,ctx:[],props:u,update:R,not_equal:l,bound:Xe(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Xe(),dirty:c,skip_bound:!1,root:e.target||a.$$.root};o&&o(f.root);let d=!1;if(f.ctx=t?t(n,e.props||{},(v,_,...S)=>{const U=S.length?S[0]:_;return f.ctx&&l(f.ctx[v],f.ctx[v]=U)&&(!f.skip_bound&&f.bound[v]&&f.bound[v](U),d&&Ot(n,v)),_}):[],f.update(),d=!0,re(f.before_update),f.fragment=r?r(f.ctx):!1,e.target){if(e.hydrate){const v=St(e.target);f.fragment&&f.fragment.l(v),v.forEach(P)}else f.fragment&&f.fragment.c();e.intro&&j(n.$$.fragment),le(n,e.target,e.anchor),lt()}Le(a)}class me{constructor(){He(this,"$$");He(this,"$$set")}$destroy(){ie(this,1),this.$destroy=R}$on(e,t){if(!Ye(t))return R;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const l=r.indexOf(t);l!==-1&&r.splice(l,1)}}$set(e){this.$$set&&!Tt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ft="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ft);function Gt(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),s(e,"viewBox","0 0 14 14"),s(e,"width","13"),s(e,"height","13"),s(e,"class","svelte-en2qvf")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class st extends me{constructor(e){super(),he(this,e,null,Gt,ae,{})}}function Qt(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),s(e,"viewBox","0 0 30 30"),s(e,"fill","none"),s(e,"xmlns","http://www.w3.org/2000/svg"),s(e,"class","svelte-d2loi5")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class ot extends me{constructor(e){super(),he(this,e,null,Qt,ae,{})}}function qt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"area.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"area.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Dt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"poi.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"poi.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Vt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"postal_code.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"postal_code.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Kt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"street.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"street.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Ht(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"road.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"road.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Jt(n){let e,t;return{c(){e=z("img"),K(e.src,t=n[3]+"housenumber.svg")||s(e,"src",t),s(e,"alt",n[6]),s(e,"class","svelte-ltkwvy")},m(r,l){I(r,e,l)},p(r,l){l&8&&!K(e.src,t=r[3]+"housenumber.svg")&&s(e,"src",t),l&64&&s(e,"alt",r[6])},d(r){r&&P(e)}}}function Xt(n){let e,t,r,l;return{c(){e=z("img"),K(e.src,t=n[5])||s(e,"src",t),s(e,"alt",n[4]),s(e,"class","svelte-ltkwvy")},m(u,o){I(u,e,o),r||(l=D(e,"error",n[13]),r=!0)},p(u,o){o&32&&!K(e.src,t=u[5])&&s(e,"src",t),o&16&&s(e,"alt",u[4])},d(u){u&&P(e),r=!1,l()}}}function ct(n){let e,t;return{c(){e=z("span"),t=oe(n[6]),s(e,"class","secondary svelte-ltkwvy")},m(r,l){I(r,e,l),p(e,t)},p(r,l){l&64&&Te(t,r[6])},d(r){r&&P(e)}}}function Yt(n){var b,k;let e,t,r,l,u,o,c,a,f=n[0].place_name.replace(/,.*/,"")+"",d,v,_=n[2]==="always"||n[2]&&!n[0].address&&((b=n[0].properties)==null?void 0:b.kind)!=="road"&&((k=n[0].properties)==null?void 0:k.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5]),S,U,Q=n[0].place_name.replace(/[^,]*,?\s*/,"")+"",L,B,G;function m(h,w){var Y,M;return w&1&&(t=null),w&1&&(r=null),w&1&&(l=null),h[5]?Xt:h[0].address?Jt:((Y=h[0].properties)==null?void 0:Y.kind)==="road"||((M=h[0].properties)==null?void 0:M.kind)==="road_relation"?Ht:(t==null&&(t=!!h[0].id.startsWith("address.")),t?Kt:(r==null&&(r=!!h[0].id.startsWith("postal_code.")),r?Vt:(l==null&&(l=!!h[0].id.startsWith("poi.")),l?Dt:qt)))}let O=m(n,-1),g=O(n),E=_&&ct(n);return{c(){e=z("li"),g.c(),u=X(),o=z("span"),c=z("span"),a=z("span"),d=oe(f),v=X(),E&&E.c(),S=X(),U=z("span"),L=oe(Q),s(a,"class","primary svelte-ltkwvy"),s(c,"class","svelte-ltkwvy"),s(U,"class","line2 svelte-ltkwvy"),s(o,"class","texts svelte-ltkwvy"),s(e,"tabindex","0"),s(e,"data-selected",n[1]),s(e,"class","svelte-ltkwvy"),ce(e,"selected",n[1])},m(h,w){I(h,e,w),g.m(e,null),p(e,u),p(e,o),p(o,c),p(c,a),p(a,d),p(c,v),E&&E.m(c,null),p(o,S),p(o,U),p(U,L),B||(G=[D(e,"mouseenter",n[11]),D(e,"focus",n[12])],B=!0)},p(h,[w]){var Y,M;O===(O=m(h,w))&&g?g.p(h,w):(g.d(1),g=O(h),g&&(g.c(),g.m(e,u))),w&1&&f!==(f=h[0].place_name.replace(/,.*/,"")+"")&&Te(d,f),w&37&&(_=h[2]==="always"||h[2]&&!h[0].address&&((Y=h[0].properties)==null?void 0:Y.kind)!=="road"&&((M=h[0].properties)==null?void 0:M.kind)!=="road_relation"&&!h[0].id.startsWith("address.")&&!h[0].id.startsWith("postal_code.")&&(!h[0].id.startsWith("poi.")||!h[5])),_?E?E.p(h,w):(E=ct(h),E.c(),E.m(c,null)):E&&(E.d(1),E=null),w&1&&Q!==(Q=h[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Te(L,Q),w&2&&s(e,"data-selected",h[1]),w&2&&ce(e,"selected",h[1])},i:R,o:R,d(h){h&&P(e),g.d(),E&&E.d(),B=!1,re(G)}}}function xt(n,e,t){var G;let r,l,{feature:u}=e,{selected:o=!1}=e,{showPlaceType:c}=e,{missingIconsCache:a}=e,{iconsBaseUrl:f}=e;const d=(G=u.properties)==null?void 0:G.categories;let v,_,S=0;function U(m){_&&a.add(_),t(9,S++,S)}function Q(m){nt.call(this,n,m)}function L(m){nt.call(this,n,m)}const B=m=>U(m.currentTarget);return n.$$set=m=>{"feature"in m&&t(0,u=m.feature),"selected"in m&&t(1,o=m.selected),"showPlaceType"in m&&t(2,c=m.showPlaceType),"missingIconsCache"in m&&t(8,a=m.missingIconsCache),"iconsBaseUrl"in m&&t(3,f=m.iconsBaseUrl)},n.$$.update=()=>{var m,O,g,E;if(n.$$.dirty&1848)do t(10,r--,r),t(4,v=d==null?void 0:d[r]),t(5,_=v?f+v.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!_||a.has(_)));n.$$.dirty&1&&t(6,l=u.id.startsWith("poi.")?(O=(m=u.properties)==null?void 0:m.categories)==null?void 0:O.join(", "):((E=(g=u.properties)==null?void 0:g.place_type_name)==null?void 0:E[0])??u.place_type[0])},t(10,r=(d==null?void 0:d.length)??0),[u,o,c,f,v,_,l,U,a,S,r,Q,L,B]}class $t extends me{constructor(e){super(),he(this,e,xt,Yt,ae,{feature:0,selected:1,showPlaceType:2,missingIconsCache:8,iconsBaseUrl:3})}}function en(n){let e;return{c(){e=z("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',s(e,"class","svelte-7cmwmc")},m(t,r){I(t,e,r)},p:R,i:R,o:R,d(t){t&&P(e)}}}class tn extends me{constructor(e){super(),he(this,e,null,en,ae,{})}}function nn(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),s(e,"viewBox","0 0 60.006 21.412"),s(e,"width","14"),s(e,"height","20"),s(e,"class","svelte-en2qvf")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class rn extends me{constructor(e){super(),he(this,e,null,nn,ae,{})}}function ln(n){let e,t;return{c(){e=se("svg"),t=se("path"),s(t,"d","M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"),s(e,"width","14"),s(e,"height","14"),s(e,"viewBox","0 0 15 15"),s(e,"class","svelte-en2qvf")},m(r,l){I(r,e,l),p(e,t)},p:R,i:R,o:R,d(r){r&&P(e)}}}class sn extends me{constructor(e){super(),he(this,e,null,ln,ae,{})}}function on(n,e,t){const r=e[1],l=e[0],u=r-l;return n===r&&t?n:((n-l)%u+u)%u+l}function ft(n){const e=[...n];return e[2]<e[0]&&(e[2]+=360),e}let Re;async function cn(n,e,t){const r=n==null?void 0:n.getCenterAndZoom();for(const l of e??[])if(!(r&&(l.minZoom!=null&&l.minZoom>r[0]||l.maxZoom!=null&&l.maxZoom<r[0]))){if(l.type==="fixed")return l.coordinates.join(",");e:if(l.type==="client-geolocation"){if(Re&&l.cachedLocationExpiry&&Re.time+l.cachedLocationExpiry>Date.now()){if(!Re.coords)break e;return Re.coords}let u;try{return u=await new Promise((o,c)=>{t.signal.addEventListener("abort",()=>{c(Error("aborted"))}),navigator.geolocation.getCurrentPosition(a=>{o([a.coords.longitude,a.coords.latitude].map(f=>f.toFixed(6)).join(","))},a=>{c(a)},l)}),u}catch{}finally{l.cachedLocationExpiry&&(Re={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(l.type==="server-geolocation")return"ip";if(r&&l.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}function ut(n,e,t){const r=n.slice();return r[77]=e[t],r[79]=t,r}function at(n){let e,t;return e=new tn({}),{c(){fe(e.$$.fragment)},m(r,l){le(e,r,l),t=!0},i(r){t||(j(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){ie(e,r)}}}function dt(n){let e,t,r,l,u;return t=new rn({}),{c(){e=z("button"),fe(t.$$.fragment),s(e,"type","button"),s(e,"title",n[9]),s(e,"class","svelte-1r7dvt7"),ce(e,"active",n[0])},m(o,c){I(o,e,c),le(t,e,null),r=!0,l||(u=D(e,"click",n[63]),l=!0)},p(o,c){(!r||c[0]&512)&&s(e,"title",o[9]),(!r||c[0]&1)&&ce(e,"active",o[0])},i(o){r||(j(t.$$.fragment,o),r=!0)},o(o){F(t.$$.fragment,o),r=!1},d(o){o&&P(e),ie(t),l=!1,u()}}}function fn(n){let e,t=[],r=new Map,l,u,o,c=it(n[13]);const a=f=>f[77].id+(f[77].address?","+f[77].address:"");for(let f=0;f<c.length;f+=1){let d=ut(n,c,f),v=a(d);r.set(v,t[f]=ht(v,d))}return{c(){e=z("ul");for(let f=0;f<t.length;f+=1)t[f].c();s(e,"class","svelte-1r7dvt7")},m(f,d){I(f,e,d);for(let v=0;v<t.length;v+=1)t[v]&&t[v].m(e,null);l=!0,u||(o=[D(e,"mouseleave",n[67]),D(e,"blur",n[68])],u=!0)},p(f,d){d[0]&8940544&&(c=it(f[13]),Se(),t=Nt(t,d,a,1,f,c,r,e,Zt,ht,null,ut),Ue())},i(f){if(!l){for(let d=0;d<c.length;d+=1)j(t[d]);l=!0}},o(f){for(let d=0;d<t.length;d+=1)F(t[d]);l=!1},d(f){f&&P(e);for(let d=0;d<t.length;d+=1)t[d].d();u=!1,re(o)}}}function un(n){let e,t,r,l,u,o;return t=new ot({}),{c(){e=z("div"),fe(t.$$.fragment),r=X(),l=z("div"),u=oe(n[7]),s(l,"class","svelte-1r7dvt7"),s(e,"class","no-results svelte-1r7dvt7")},m(c,a){I(c,e,a),le(t,e,null),p(e,r),p(e,l),p(l,u),o=!0},p(c,a){(!o||a[0]&128)&&Te(u,c[7])},i(c){o||(j(t.$$.fragment,c),o=!0)},o(c){F(t.$$.fragment,c),o=!1},d(c){c&&P(e),ie(t)}}}function an(n){let e="",t;return{c(){t=oe(e)},m(r,l){I(r,t,l)},p:R,i:R,o:R,d(r){r&&P(t)}}}function dn(n){let e,t,r,l,u,o,c,a,f,d,v;return t=new ot({}),a=new st({}),{c(){e=z("div"),fe(t.$$.fragment),r=X(),l=z("div"),u=oe(n[6]),o=X(),c=z("button"),fe(a.$$.fragment),s(l,"class","svelte-1r7dvt7"),s(c,"class","svelte-1r7dvt7"),s(e,"class","error svelte-1r7dvt7")},m(_,S){I(_,e,S),le(t,e,null),p(e,r),p(e,l),p(l,u),p(e,o),p(e,c),le(a,c,null),f=!0,d||(v=D(c,"click",n[64]),d=!0)},p(_,S){(!f||S[0]&64)&&Te(u,_[6])},i(_){f||(j(t.$$.fragment,_),j(a.$$.fragment,_),f=!0)},o(_){F(t.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){_&&P(e),ie(t),ie(a),d=!1,v()}}}function ht(n,e){let t,r,l;function u(){return e[65](e[79])}function o(){return e[66](e[77])}return r=new $t({props:{feature:e[77],showPlaceType:e[10],selected:e[14]===e[79],missingIconsCache:e[19],iconsBaseUrl:e[11]}}),r.$on("mouseenter",u),r.$on("focus",o),{key:n,first:null,c(){t=Et(),fe(r.$$.fragment),this.first=t},m(c,a){I(c,t,a),le(r,c,a),l=!0},p(c,a){e=c;const f={};a[0]&8192&&(f.feature=e[77]),a[0]&1024&&(f.showPlaceType=e[10]),a[0]&24576&&(f.selected=e[14]===e[79]),a[0]&2048&&(f.iconsBaseUrl=e[11]),r.$set(f)},i(c){l||(j(r.$$.fragment,c),l=!0)},o(c){F(r.$$.fragment,c),l=!1},d(c){c&&P(t),ie(r,c)}}}function hn(n){let e,t,r,l,u,o,c,a,f,d,v,_,S,U,Q,L,B,G,m,O,g,E=!1;u=new sn({}),v=new st({});let b=n[18]&&at(),k=n[5]===!0&&dt(n);const h=n[55].default,w=Mt(h,n,n[54],null),Y=[dn,an,un,fn],M=[];function ve(y,A){var H,ge;return y[17]?0:y[15]?((H=y[13])==null?void 0:H.length)===0?2:y[15]&&((ge=y[13])!=null&&ge.length)?3:-1:1}return~(L=ve(n))&&(B=M[L]=Y[L](n)),{c(){e=X(),t=z("form"),r=z("div"),l=z("button"),fe(u.$$.fragment),o=X(),c=z("input"),a=X(),f=z("div"),d=z("button"),fe(v.$$.fragment),_=X(),b&&b.c(),S=X(),k&&k.c(),U=X(),w&&w.c(),Q=X(),B&&B.c(),s(l,"class","search-button svelte-1r7dvt7"),s(l,"type","button"),s(c,"placeholder",n[8]),s(c,"aria-label",n[8]),s(c,"class","svelte-1r7dvt7"),s(d,"type","button"),s(d,"title",n[3]),s(d,"class","svelte-1r7dvt7"),s(f,"class","clear-button-container svelte-1r7dvt7"),ce(f,"displayable",n[1]!==""),s(r,"class","input-group svelte-1r7dvt7"),s(t,"tabindex","0"),s(t,"class",G=$e(n[2])+" svelte-1r7dvt7"),ce(t,"can-collapse",n[4]&&n[1]==="")},m(y,A){I(y,e,A),I(y,t,A),p(t,r),p(r,l),le(u,l,null),p(r,o),p(r,c),n[57](c),et(c,n[1]),p(r,a),p(r,f),p(f,d),le(v,d,null),p(f,_),b&&b.m(f,null),p(r,S),k&&k.m(r,null),p(r,U),w&&w.m(r,null),p(t,Q),~L&&M[L].m(t,null),m=!0,O||(g=[D(l,"click",n[56]),D(c,"input",n[58]),D(c,"focus",n[59]),D(c,"blur",n[60]),D(c,"keydown",n[21]),D(c,"input",n[61]),D(d,"click",n[62]),D(t,"submit",Ct(n[20]))],O=!0)},p(y,A){(!m||A[0]&256)&&s(c,"placeholder",y[8]),(!m||A[0]&256)&&s(c,"aria-label",y[8]),A[0]&2&&c.value!==y[1]&&et(c,y[1]),(!m||A[0]&8)&&s(d,"title",y[3]),y[18]?b?A[0]&262144&&j(b,1):(b=at(),b.c(),j(b,1),b.m(f,null)):b&&(Se(),F(b,1,1,()=>{b=null}),Ue()),(!m||A[0]&2)&&ce(f,"displayable",y[1]!==""),y[5]===!0?k?(k.p(y,A),A[0]&32&&j(k,1)):(k=dt(y),k.c(),j(k,1),k.m(r,U)):k&&(Se(),F(k,1,1,()=>{k=null}),Ue()),w&&w.p&&(!m||A[1]&8388608)&&Rt(w,h,y,y[54],m?Lt(h,y[54],A,null):Bt(y[54]),null);let H=L;L=ve(y),L===H?~L&&M[L].p(y,A):(B&&(Se(),F(M[H],1,1,()=>{M[H]=null}),Ue()),~L?(B=M[L],B?B.p(y,A):(B=M[L]=Y[L](y),B.c()),j(B,1),B.m(t,null)):B=null),(!m||A[0]&4&&G!==(G=$e(y[2])+" svelte-1r7dvt7"))&&s(t,"class",G),(!m||A[0]&22)&&ce(t,"can-collapse",y[4]&&y[1]==="")},i(y){m||(j(E),j(u.$$.fragment,y),j(v.$$.fragment,y),j(b),j(k),j(w,y),j(B),m=!0)},o(y){F(E),F(u.$$.fragment,y),F(v.$$.fragment,y),F(b),F(k),F(w,y),F(B),m=!1},d(y){y&&(P(e),P(t)),ie(u),n[57](null),ie(v),b&&b.d(),k&&k.d(),w&&w.d(y),~L&&M[L].d(),O=!1,re(g)}}}function mn(n,e,t){let r,{$$slots:l={},$$scope:u}=e,{class:o=void 0}=e,{apiKey:c}=e,{bbox:a=void 0}=e,{clearButtonTitle:f="clear"}=e,{clearOnBlur:d=!1}=e,{collapsed:v=!1}=e,{country:_=void 0}=e,{debounceSearch:S=200}=e,{enableReverse:U=!1}=e,{errorMessage:Q="Something went wrong…"}=e,{filter:L=()=>!0}=e,{flyTo:B=!0}=e,{fuzzyMatch:G=!0}=e,{language:m=void 0}=e,{limit:O=void 0}=e,{mapController:g=void 0}=e,{minLength:E=2}=e,{noResultsMessage:b="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:k="Search"}=e,{proximity:h=[{type:"server-geolocation"}]}=e,{reverseActive:w=U==="always"}=e,{reverseButtonTitle:Y="toggle reverse geocoding"}=e,{searchValue:M=""}=e,{showFullGeometry:ve=!0}=e,{showPlaceType:y="ifNeeded"}=e,{showResultsWhileTyping:A=!0}=e,{types:H=void 0}=e,{zoom:ge=16}=e,{maxZoom:Be=18}=e,{apiUrl:Oe="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Fe={}}=e,{iconsBaseUrl:_t="https://cdn.maptiler.com/maptiler-geocoding-control/v1.0.1/icons/"}=e,{adjustUrlQuery:Ge=i=>{}}=e;function bn(){$.focus()}function wn(){$.blur()}function yt(i,N=!0){t(1,M=i),N?(t(14,W=-1),wt()):(De(),setTimeout(()=>{$.focus(),$.select()}))}function vn(){t(13,C=void 0),t(51,T=void 0),t(14,W=-1)}function kn(){t(50,q=[]),t(51,T=void 0)}let ke=!1,C,q,T,bt="",$,W=-1,ee,ze=[],_e,pe,Pe,Qe;const pn=new Set,ue=Pt();zt(()=>{g&&(g.setEventHandler(void 0),g.indicateReverse(!1),g.setSelectedMarker(-1),g.setMarkers(void 0,void 0))});function wt(i){if(pe&&(clearTimeout(pe),pe=void 0),W>-1&&C)t(51,T=C[W]),t(1,M=T.place_name.replace(/,.*/,"")),t(17,ee=void 0),t(50,q=void 0),t(14,W=-1);else if(M){const N=i||!vt();qe(M,{exact:!0}).then(()=>{t(50,q=C),t(51,T=void 0),N&&Tn()}).catch(te=>t(17,ee=te))}}function vt(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(M)}async function qe(i,{byId:N=!1,exact:te=!1}={}){t(17,ee=void 0),_e==null||_e.abort();const ne=new AbortController;t(18,_e=ne);try{const V=vt(),x=new URLSearchParams;if(m!==void 0&&x.set("language",Array.isArray(m)?m.join(","):m??""),H&&x.set("types",H.join(",")),a&&x.set("bbox",a.map(Ie=>Ie.toFixed(6)).join(",")),_&&x.set("country",Array.isArray(_)?_.join(","):_),!N&&!V){const Ie=await cn(g,h,ne);Ie&&x.set("proximity",Ie),(te||!A)&&x.set("autocomplete","false"),x.set("fuzzyMatch",String(G))}O!==void 0&&(!V||(H==null?void 0:H.length)===1)&&x.set("limit",String(O)),x.set("key",c),Ge(x);const Ae=Oe+"/"+encodeURIComponent(i)+".json?"+x.toString();if(Ae===bt){N?(t(13,C=void 0),t(51,T=ze[0])):t(13,C=ze);return}bt=Ae;const kt=await fetch(Ae,{signal:ne.signal,...Fe});if(!kt.ok)throw new Error;const Ke=await kt.json();ue("response",{url:Ae,featureCollection:Ke}),N?(t(13,C=void 0),t(51,T=Ke.features[0]),ze=[T]):(t(13,C=Ke.features.filter(L)),ze=C,V&&$.focus())}catch(V){if(V&&typeof V=="object"&&"name"in V&&V.name==="AbortError")return;throw V}finally{ne===_e&&t(18,_e=void 0)}}function Tn(){var te;if(!(q!=null&&q.length)||!B)return;const i=[180,90,-180,-90],N=!q.some(ne=>!ne.matching_text);for(const ne of q)if(N||!ne.matching_text)for(const V of[0,1,2,3])i[V]=Math[V<2?"min":"max"](i[V],((te=ne.bbox)==null?void 0:te[V])??ne.center[V%2]);g&&q.length>0&&(T&&i[0]===i[2]&&i[1]===i[3]?g.flyTo(T.center,ge):g.fitBounds(ft(i),50,Be))}function Mn(i){t(0,w=U==="always"),yt(on(i[0],[-180,180],!0).toFixed(6)+","+i[1].toFixed(6))}function Ln(i){if(!C)return;let N=i.key==="ArrowDown"?1:i.key==="ArrowUp"?-1:0;N?(W===-1&&N===-1&&t(14,W=C.length),t(14,W+=N),W>=C.length&&t(14,W=-1),i.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(i.key)&&t(14,W=-1)}function De(i=!0){if(t(17,ee=void 0),A){if(pe&&clearTimeout(pe),M.length<E)return;const N=M;pe=window.setTimeout(()=>{qe(N).catch(te=>t(17,ee=te))},i?S:0)}else t(13,C=void 0),t(17,ee=void 0)}function Ve(i){t(51,T=i),t(1,M=i.place_name),t(14,W=-1)}const Rn=()=>$.focus();function Bn(i){je[i?"unshift":"push"](()=>{$=i,t(16,$)})}function En(){M=this.value,t(1,M),t(12,ke),t(26,d)}const Cn=()=>t(12,ke=!0),Sn=()=>t(12,ke=!1),Un=()=>De(),zn=()=>{t(1,M=""),$.focus()},Pn=()=>t(0,w=!w),An=()=>t(17,ee=void 0),In=i=>t(14,W=i),jn=i=>Ve(i),Wn=()=>t(14,W=-1),Zn=()=>{};return n.$$set=i=>{"class"in i&&t(2,o=i.class),"apiKey"in i&&t(24,c=i.apiKey),"bbox"in i&&t(25,a=i.bbox),"clearButtonTitle"in i&&t(3,f=i.clearButtonTitle),"clearOnBlur"in i&&t(26,d=i.clearOnBlur),"collapsed"in i&&t(4,v=i.collapsed),"country"in i&&t(27,_=i.country),"debounceSearch"in i&&t(28,S=i.debounceSearch),"enableReverse"in i&&t(5,U=i.enableReverse),"errorMessage"in i&&t(6,Q=i.errorMessage),"filter"in i&&t(29,L=i.filter),"flyTo"in i&&t(30,B=i.flyTo),"fuzzyMatch"in i&&t(31,G=i.fuzzyMatch),"language"in i&&t(32,m=i.language),"limit"in i&&t(33,O=i.limit),"mapController"in i&&t(34,g=i.mapController),"minLength"in i&&t(35,E=i.minLength),"noResultsMessage"in i&&t(7,b=i.noResultsMessage),"placeholder"in i&&t(8,k=i.placeholder),"proximity"in i&&t(36,h=i.proximity),"reverseActive"in i&&t(0,w=i.reverseActive),"reverseButtonTitle"in i&&t(9,Y=i.reverseButtonTitle),"searchValue"in i&&t(1,M=i.searchValue),"showFullGeometry"in i&&t(37,ve=i.showFullGeometry),"showPlaceType"in i&&t(10,y=i.showPlaceType),"showResultsWhileTyping"in i&&t(38,A=i.showResultsWhileTyping),"types"in i&&t(39,H=i.types),"zoom"in i&&t(40,ge=i.zoom),"maxZoom"in i&&t(41,Be=i.maxZoom),"apiUrl"in i&&t(42,Oe=i.apiUrl),"fetchParameters"in i&&t(43,Fe=i.fetchParameters),"iconsBaseUrl"in i&&t(11,_t=i.iconsBaseUrl),"adjustUrlQuery"in i&&t(44,Ge=i.adjustUrlQuery),"$$scope"in i&&t(54,u=i.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&67112960&&setTimeout(()=>{t(15,Pe=ke),d&&!ke&&t(1,M="")}),n.$$.dirty[0]&8194|n.$$.dirty[1]&16&&M.length<E&&(t(51,T=void 0),t(13,C=void 0),t(17,ee=void 0),t(50,q=C)),n.$$.dirty[1]&1048640&&ve&&T&&!T.address&&T.geometry.type==="Point"&&qe(T.id,{byId:!0}).catch(i=>t(17,ee=i)),n.$$.dirty[0]&1073741824|n.$$.dirty[1]&3147272&&(g&&T&&T.id!==Qe&&B&&(!T.bbox||T.bbox[0]===T.bbox[2]&&T.bbox[1]===T.bbox[3]?g.flyTo(T.center,T.id.startsWith("poi.")||T.id.startsWith("address.")?Be:ge):g.fitBounds(ft(T.bbox),50,Be),t(13,C=void 0),t(50,q=void 0),t(14,W=-1)),t(52,Qe=T==null?void 0:T.id)),n.$$.dirty[0]&8192|n.$$.dirty[1]&524288&&q!==C&&t(50,q=void 0),n.$$.dirty[1]&1572872&&g&&g.setMarkers(q,T),n.$$.dirty[0]&2&&t(14,W=-1),n.$$.dirty[0]&40961|n.$$.dirty[1]&8&&g&&g.setEventHandler(i=>{switch(i.type){case"mapClick":w&&Mn(i.coordinates);break;case"markerClick":{const N=C==null?void 0:C.find(te=>te.id===i.id);N&&Ve(N)}break;case"markerMouseEnter":t(14,W=Pe?(C==null?void 0:C.findIndex(N=>N.id===i.id))??-1:-1);break;case"markerMouseLeave":t(14,W=-1);break}}),n.$$.dirty[0]&16384|n.$$.dirty[1]&8&&(g==null||g.setSelectedMarker(W)),n.$$.dirty[0]&24576&&t(53,r=C==null?void 0:C[W]),n.$$.dirty[0]&2|n.$$.dirty[1]&8){const i=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(M);g==null||g.setReverseMarker(i?[Number(i[1]),Number(i[2])]:void 0)}n.$$.dirty[1]&4194304&&ue("select",r),n.$$.dirty[1]&1048576&&ue("pick",T),n.$$.dirty[0]&40960&&ue("optionsVisibilityChange",Pe&&!!C),n.$$.dirty[0]&8192&&ue("featuresListed",C),n.$$.dirty[1]&524288&&ue("featuresMarked",q),n.$$.dirty[0]&1&&ue("reverseToggle",w),n.$$.dirty[0]&2&&ue("queryChange",M),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&g&&g.indicateReverse(w)},[w,M,o,f,v,U,Q,b,k,Y,y,_t,ke,C,W,Pe,$,ee,_e,pn,wt,Ln,De,Ve,c,a,d,_,S,L,B,G,m,O,g,E,h,ve,A,H,ge,Be,Oe,Fe,Ge,bn,wn,yt,vn,kn,q,T,Qe,r,u,l,Rn,Bn,En,Cn,Sn,Un,zn,Pn,An,In,jn,Wn,Zn]}class gn extends me{constructor(e){super(),he(this,e,mn,hn,ae,{class:2,apiKey:24,bbox:25,clearButtonTitle:3,clearOnBlur:26,collapsed:4,country:27,debounceSearch:28,enableReverse:5,errorMessage:6,filter:29,flyTo:30,fuzzyMatch:31,language:32,limit:33,mapController:34,minLength:35,noResultsMessage:7,placeholder:8,proximity:36,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:37,showPlaceType:10,showResultsWhileTyping:38,types:39,zoom:40,maxZoom:41,apiUrl:42,fetchParameters:43,iconsBaseUrl:11,adjustUrlQuery:44,focus:45,blur:46,setQuery:47,clearList:48,clearMap:49},null,[-1,-1,-1])}get focus(){return this.$$.ctx[45]}get blur(){return this.$$.ctx[46]}get setQuery(){return this.$$.ctx[47]}get clearList(){return this.$$.ctx[48]}get clearMap(){return this.$$.ctx[49]}}const mt=["featuresListed","featuresMarked","optionsVisibilityChange","pick","queryChange","response","reverseToggle","select"],_n=["apiKey","bbox","clearButtonTitle","clearOnBlur","collapsed","country","debounceSearch","enableReverse","reverseActive","errorMessage","filter","fuzzyMatch","language","limit","minLength","noResultsMessage","placeholder","proximity","reverseButtonTitle","showFullGeometry","showPlaceType","showResultsWhileTyping","adjustUrlQuery","types","zoom","mapController"];function gt(n){return"on"+n[0].toUpperCase()+n.slice(1)}const yn=Z.forwardRef(function(e,t){const r=Z.useRef(),l=Z.useRef(),u={...e};for(const o of mt)delete u[gt(o)];Z.useEffect(()=>{if(!r.current)throw new Error;const o=new gn({target:r.current,props:u});return l.current=o,()=>o.$destroy()},[]);for(const o of _n)Z.useEffect(()=>{l.current&&e[o]!==void 0&&l.current.$set({[o]:e[o]})},[e[o]]);for(const o of mt){const c=e[gt(o)];Z.useEffect(()=>{var a;return c&&((a=l.current)==null?void 0:a.$on(o,f=>{c(f.detail)}))},[c])}return Z.useImperativeHandle(t,()=>({setQuery:(o,c=!0)=>{var a;return(a=l.current)==null?void 0:a.setQuery(o,c)},clearMap:()=>{var o;return(o=l.current)==null?void 0:o.clearMap()},clearList:()=>{var o;return(o=l.current)==null?void 0:o.clearList()},focus:()=>{var o;return(o=l.current)==null?void 0:o.focus()},blur:()=>{var o;return(o=l.current)==null?void 0:o.blur()}})),Z.createElement("div",{ref:r})});J.GeocodingControl=yn,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=react.umd.cjs.map