@maptiler/geocoding-control 0.0.100-rc.2 → 1.0.0-rc.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/leaflet.js +1 -1
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -1
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +1 -1
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -1
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1 -1
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -1
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +1 -1
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +1 -1
- package/openlayers.umd.js.map +1 -1
- package/package.json +1 -1
- package/react.js +94 -94
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/svelte/GeocodingControl.svelte +4 -2
- package/svelte/types.d.ts +1 -1
- package/types.d.ts +1 -1
- package/vanilla.js +1 -1
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/react.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(H,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],U):(H=typeof globalThis<"u"?globalThis:H||self,U(H.reactMaptilerGeocoder={},H.React))})(this,function(H,U){"use strict";var qn=Object.defineProperty;var Dn=(H,U,M)=>U in H?qn(H,U,{enumerable:!0,configurable:!0,writable:!0,value:M}):H[U]=M;var Ye=(H,U,M)=>(Dn(H,typeof U!="symbol"?U+"":U,M),M);function M(){}function Et(n,e){for(const t in e)n[t]=e[t];return n}function xe(n){return n()}function $e(){return Object.create(null)}function ne(n){n.forEach(xe)}function et(n){return typeof n=="function"}function de(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Se;function V(n,e){return n===e?!0:(Se||(Se=document.createElement("a")),Se.href=e,n===Se.href)}function Ct(n){return Object.keys(n).length===0}function St(n,e,t,r){if(n){const l=tt(n,e,t,r);return n[0](l)}}function tt(n,e,t,r){return n[1]&&r?Et(t.ctx.slice(),n[1](r(e))):t.ctx}function It(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=[],s=Math.max(e.dirty.length,l.length);for(let f=0;f<s;f+=1)u[f]=e.dirty[f]|l[f];return u}return e.dirty|l}return e.dirty}function zt(n,e,t,r,l,u){if(l){const s=tt(e,t,r,u);n.p(s,l)}}function Pt(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 nt(n){return n??""}function k(n,e){n.appendChild(e)}function P(n,e,t){n.insertBefore(e,t||null)}function z(n){n.parentNode&&n.parentNode.removeChild(n)}function S(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 At(){return oe("")}function q(n,e,t,r){return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}function Ut(n){return function(e){return e.preventDefault(),n.call(this,e)}}function o(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function jt(n){return Array.from(n.childNodes)}function Le(n,e){e=""+e,n.data!==e&&(n.data=e)}function rt(n,e){n.value=e??""}function ce(n,e,t){n.classList.toggle(e,!!t)}function Wt(n,e,{bubbles:t=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:r})}let Re;function Be(n){Re=n}function lt(){if(!Re)throw new Error("Function called outside component initialization");return Re}function Zt(n){lt().$$.on_destroy.push(n)}function Nt(){const n=lt();return(e,t,{cancelable:r=!1}={})=>{const l=n.$$.callbacks[e];if(l){const u=Wt(e,t,{cancelable:r});return l.slice().forEach(s=>{s.call(n,u)}),!u.defaultPrevented}return!0}}function it(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(r=>r.call(this,e))}const we=[],Ze=[];let ve=[];const st=[],Ft=Promise.resolve();let Ne=!1;function Ot(){Ne||(Ne=!0,Ft.then(ot))}function Fe(n){ve.push(n)}const Oe=new Set;let ke=0;function ot(){if(ke!==0)return;const n=Re;do{try{for(;ke<we.length;){const e=we[ke];ke++,Be(e),Gt(e.$$)}}catch(e){throw we.length=0,ke=0,e}for(Be(null),we.length=0,ke=0;Ze.length;)Ze.pop()();for(let e=0;e<ve.length;e+=1){const t=ve[e];Oe.has(t)||(Oe.add(t),t())}ve.length=0}while(we.length);for(;st.length;)st.pop()();Ne=!1,Oe.clear(),Be(n)}function Gt(n){if(n.fragment!==null){n.update(),ne(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Fe)}}function Qt(n){const e=[],t=[];ve.forEach(r=>n.indexOf(r)===-1?e.push(r):t.push(r)),t.forEach(r=>r()),ve=e}const Ie=new Set;let he;function ze(){he={r:0,c:[],p:he}}function Pe(){he.r||ne(he.c),he=he.p}function j(n,e){n&&n.i&&(Ie.delete(n),n.i(e))}function G(n,e,t,r){if(n&&n.o){if(Ie.has(n))return;Ie.add(n),he.c.push(()=>{Ie.delete(n),r&&(t&&n.d(1),r())}),n.o(e)}else r&&r()}function ct(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function qt(n,e){G(n,1,1,()=>{e.delete(n.key)})}function Dt(n,e,t,r,l,u,s,f,h,c,m,v){let _=n.length,R=u.length,I=_;const T={};for(;I--;)T[n[I].key]=I;const L=[],W=new Map,y=new Map,F=[];for(I=R;I--;){const B=v(l,u,I),E=t(B);let g=s.get(E);g?r&&F.push(()=>g.p(B,e)):(g=c(E,B),g.c()),W.set(E,L[I]=g),E in T&&y.set(E,Math.abs(I-T[E]))}const O=new Set,d=new Set;function b(B){j(B,1),B.m(f,m),s.set(B.key,B),m=B.first,R--}for(;_&&R;){const B=L[R-1],E=n[_-1],g=B.key,w=E.key;B===E?(m=B.first,_--,R--):W.has(w)?!s.has(g)||O.has(g)?b(B):d.has(w)?_--:y.get(g)>y.get(w)?(d.add(g),b(B)):(O.add(w),_--):(h(E,s),_--)}for(;_--;){const B=n[_];W.has(B.key)||h(B,s)}for(;R;)b(L[R-1]);return ne(F),L}function fe(n){n&&n.c()}function re(n,e,t){const{fragment:r,after_update:l}=n.$$;r&&r.m(e,t),Fe(()=>{const u=n.$$.on_mount.map(xe).filter(et);n.$$.on_destroy?n.$$.on_destroy.push(...u):ne(u),n.$$.on_mount=[]}),l.forEach(Fe)}function le(n,e){const t=n.$$;t.fragment!==null&&(Qt(t.after_update),ne(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Vt(n,e){n.$$.dirty[0]===-1&&(we.push(n),Ot(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function me(n,e,t,r,l,u,s=null,f=[-1]){const h=Re;Be(n);const c=n.$$={fragment:null,ctx:[],props:u,update:M,not_equal:l,bound:$e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(h?h.$$.context:[])),callbacks:$e(),dirty:f,skip_bound:!1,root:e.target||h.$$.root};s&&s(c.root);let m=!1;if(c.ctx=t?t(n,e.props||{},(v,_,...R)=>{const I=R.length?R[0]:_;return c.ctx&&l(c.ctx[v],c.ctx[v]=I)&&(!c.skip_bound&&c.bound[v]&&c.bound[v](I),m&&Vt(n,v)),_}):[],c.update(),m=!0,ne(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){const v=jt(e.target);c.fragment&&c.fragment.l(v),v.forEach(z)}else c.fragment&&c.fragment.c();e.intro&&j(n.$$.fragment),re(n,e.target,e.anchor),ot()}Be(h)}class ge{constructor(){Ye(this,"$$");Ye(this,"$$set")}$destroy(){le(this,1),this.$destroy=M}$on(e,t){if(!et(t))return M;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&&!Ct(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Kt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Kt);const Vn="";function Ht(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"viewBox","0 0 14 14"),o(e,"width","13"),o(e,"height","13"),o(e,"class","svelte-en2qvf")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class ft extends ge{constructor(e){super(),me(this,e,null,Ht,de,{})}}const Kn="";function Jt(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"viewBox","0 0 30 30"),o(e,"fill","none"),o(e,"xmlns","http://www.w3.org/2000/svg"),o(e,"class","svelte-d2loi5")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class ut extends ge{constructor(e){super(),me(this,e,null,Jt,de,{})}}const Hn="";function Xt(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"area.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"area.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function Yt(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"poi.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"poi.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function xt(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"postal_code.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"postal_code.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function $t(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"street.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"street.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function en(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"road.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"road.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function tn(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"housenumber.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"housenumber.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function nn(n){let e,t,r,l;return{c(){e=S("img"),V(e.src,t=n[5])||o(e,"src",t),o(e,"alt",n[4]),o(e,"class","svelte-ltkwvy")},m(u,s){P(u,e,s),r||(l=q(e,"error",n[12]),r=!0)},p(u,s){s&32&&!V(e.src,t=u[5])&&o(e,"src",t),s&16&&o(e,"alt",u[4])},d(u){u&&z(e),r=!1,l()}}}function at(n){let e,t;return{c(){e=S("span"),t=oe(n[6]),o(e,"class","secondary svelte-ltkwvy")},m(r,l){P(r,e,l),k(e,t)},p(r,l){l&64&&Le(t,r[6])},d(r){r&&z(e)}}}function rn(n){var B,E;let e,t,r,l,u,s,f,h,c=n[0].place_name.replace(/,.*/,"")+"",m,v,_=n[2]==="always"||n[2]&&!n[0].address&&((B=n[0].properties)==null?void 0:B.kind)!=="road"&&((E=n[0].properties)==null?void 0:E.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5]),R,I,T=n[0].place_name.replace(/[^,]*,?\s*/,"")+"",L,W,y;function F(g,w){var x,a;return w&1&&(t=null),w&1&&(r=null),w&1&&(l=null),g[5]?nn:g[0].address?tn:((x=g[0].properties)==null?void 0:x.kind)==="road"||((a=g[0].properties)==null?void 0:a.kind)==="road_relation"?en:(t==null&&(t=!!g[0].id.startsWith("address.")),t?$t:(r==null&&(r=!!g[0].id.startsWith("postal_code.")),r?xt:(l==null&&(l=!!g[0].id.startsWith("poi.")),l?Yt:Xt)))}let O=F(n,-1),d=O(n),b=_&&at(n);return{c(){e=S("li"),d.c(),u=X(),s=S("span"),f=S("span"),h=S("span"),m=oe(c),v=X(),b&&b.c(),R=X(),I=S("span"),L=oe(T),o(h,"class","primary svelte-ltkwvy"),o(f,"class","svelte-ltkwvy"),o(I,"class","line2 svelte-ltkwvy"),o(s,"class","texts svelte-ltkwvy"),o(e,"tabindex","0"),o(e,"data-selected",n[1]),o(e,"class","svelte-ltkwvy"),ce(e,"selected",n[1])},m(g,w){P(g,e,w),d.m(e,null),k(e,u),k(e,s),k(s,f),k(f,h),k(h,m),k(f,v),b&&b.m(f,null),k(s,R),k(s,I),k(I,L),W||(y=[q(e,"mouseenter",n[10]),q(e,"focus",n[11])],W=!0)},p(g,[w]){var x,a;O===(O=F(g,w))&&d?d.p(g,w):(d.d(1),d=O(g),d&&(d.c(),d.m(e,u))),w&1&&c!==(c=g[0].place_name.replace(/,.*/,"")+"")&&Le(m,c),w&37&&(_=g[2]==="always"||g[2]&&!g[0].address&&((x=g[0].properties)==null?void 0:x.kind)!=="road"&&((a=g[0].properties)==null?void 0:a.kind)!=="road_relation"&&!g[0].id.startsWith("address.")&&!g[0].id.startsWith("postal_code.")&&(!g[0].id.startsWith("poi.")||!g[5])),_?b?b.p(g,w):(b=at(g),b.c(),b.m(f,null)):b&&(b.d(1),b=null),w&1&&T!==(T=g[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Le(L,T),w&2&&o(e,"data-selected",g[1]),w&2&&ce(e,"selected",g[1])},i:M,o:M,d(g){g&&z(e),d.d(),b&&b.d(),W=!1,ne(y)}}}function ln(n,e,t){var W;let r,l,{feature:u}=e,{selected:s=!1}=e,{showPlaceType:f}=e,{missingIconsCache:h}=e,{iconsBaseUrl:c}=e;const m=(W=u.properties)==null?void 0:W.categories;let v,_;function R(y){_&&h.add(_),t(9,r--,r)}function I(y){it.call(this,n,y)}function T(y){it.call(this,n,y)}const L=y=>R(y.currentTarget);return n.$$set=y=>{"feature"in y&&t(0,u=y.feature),"selected"in y&&t(1,s=y.selected),"showPlaceType"in y&&t(2,f=y.showPlaceType),"missingIconsCache"in y&&t(8,h=y.missingIconsCache),"iconsBaseUrl"in y&&t(3,c=y.iconsBaseUrl)},n.$$.update=()=>{var y,F,O,d;if(n.$$.dirty&824)do t(9,r--,r),t(4,v=m==null?void 0:m[r]),t(5,_=v?c+v.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!_||h.has(_)));n.$$.dirty&1&&t(6,l=u.id.startsWith("poi.")?(F=(y=u.properties)==null?void 0:y.categories)==null?void 0:F.join(", "):((d=(O=u.properties)==null?void 0:O.place_type_name)==null?void 0:d[0])??u.place_type[0])},t(9,r=(m==null?void 0:m.length)??0),[u,s,f,c,v,_,l,R,h,r,I,T,L]}class sn extends ge{constructor(e){super(),me(this,e,ln,rn,de,{feature:0,selected:1,showPlaceType:2,missingIconsCache:8,iconsBaseUrl:3})}}const Jn="";function on(n){let e;return{c(){e=S("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>',o(e,"class","svelte-7cmwmc")},m(t,r){P(t,e,r)},p:M,i:M,o:M,d(t){t&&z(e)}}}class cn extends ge{constructor(e){super(),me(this,e,null,on,de,{})}}const Xn="";function fn(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"viewBox","0 0 60.006 21.412"),o(e,"width","14"),o(e,"height","20"),o(e,"class","svelte-en2qvf")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class un extends ge{constructor(e){super(),me(this,e,null,fn,de,{})}}const Yn="";function an(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"width","14"),o(e,"height","14"),o(e,"viewBox","0 0 15 15"),o(e,"class","svelte-en2qvf")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class dn extends ge{constructor(e){super(),me(this,e,null,an,de,{})}}const xn="";function dt(n,e,t){const r=n.slice();return r[76]=e[t],r[78]=t,r}function ht(n){let e,t;return e=new cn({}),{c(){fe(e.$$.fragment)},m(r,l){re(e,r,l),t=!0},i(r){t||(j(e.$$.fragment,r),t=!0)},o(r){G(e.$$.fragment,r),t=!1},d(r){le(e,r)}}}function mt(n){let e,t,r,l,u;return t=new un({}),{c(){e=S("button"),fe(t.$$.fragment),o(e,"type","button"),o(e,"title",n[9]),o(e,"class","svelte-1r7dvt7"),ce(e,"active",n[0])},m(s,f){P(s,e,f),re(t,e,null),r=!0,l||(u=q(e,"click",n[61]),l=!0)},p(s,f){(!r||f[0]&512)&&o(e,"title",s[9]),(!r||f[0]&1)&&ce(e,"active",s[0])},i(s){r||(j(t.$$.fragment,s),r=!0)},o(s){G(t.$$.fragment,s),r=!1},d(s){s&&z(e),le(t),l=!1,u()}}}function hn(n){let e,t=[],r=new Map,l,u,s,f=ct(n[13]);const h=c=>c[76].id+(c[76].address?","+c[76].address:"");for(let c=0;c<f.length;c+=1){let m=dt(n,f,c),v=h(m);r.set(v,t[c]=gt(v,m))}return{c(){e=S("ul");for(let c=0;c<t.length;c+=1)t[c].c();o(e,"class","svelte-1r7dvt7")},m(c,m){P(c,e,m);for(let v=0;v<t.length;v+=1)t[v]&&t[v].m(e,null);l=!0,u||(s=[q(e,"mouseleave",n[65]),q(e,"blur",n[66])],u=!0)},p(c,m){m[0]&8940544&&(f=ct(c[13]),ze(),t=Dt(t,m,h,1,c,f,r,e,qt,gt,null,dt),Pe())},i(c){if(!l){for(let m=0;m<f.length;m+=1)j(t[m]);l=!0}},o(c){for(let m=0;m<t.length;m+=1)G(t[m]);l=!1},d(c){c&&z(e);for(let m=0;m<t.length;m+=1)t[m].d();u=!1,ne(s)}}}function mn(n){let e,t,r,l,u,s;return t=new ut({}),{c(){e=S("div"),fe(t.$$.fragment),r=X(),l=S("div"),u=oe(n[7]),o(l,"class","svelte-1r7dvt7"),o(e,"class","no-results svelte-1r7dvt7")},m(f,h){P(f,e,h),re(t,e,null),k(e,r),k(e,l),k(l,u),s=!0},p(f,h){(!s||h[0]&128)&&Le(u,f[7])},i(f){s||(j(t.$$.fragment,f),s=!0)},o(f){G(t.$$.fragment,f),s=!1},d(f){f&&z(e),le(t)}}}function gn(n){let e="",t;return{c(){t=oe(e)},m(r,l){P(r,t,l)},p:M,i:M,o:M,d(r){r&&z(t)}}}function _n(n){let e,t,r,l,u,s,f,h,c,m,v;return t=new ut({}),h=new ft({}),{c(){e=S("div"),fe(t.$$.fragment),r=X(),l=S("div"),u=oe(n[6]),s=X(),f=S("button"),fe(h.$$.fragment),o(l,"class","svelte-1r7dvt7"),o(f,"class","svelte-1r7dvt7"),o(e,"class","error svelte-1r7dvt7")},m(_,R){P(_,e,R),re(t,e,null),k(e,r),k(e,l),k(l,u),k(e,s),k(e,f),re(h,f,null),c=!0,m||(v=q(f,"click",n[62]),m=!0)},p(_,R){(!c||R[0]&64)&&Le(u,_[6])},i(_){c||(j(t.$$.fragment,_),j(h.$$.fragment,_),c=!0)},o(_){G(t.$$.fragment,_),G(h.$$.fragment,_),c=!1},d(_){_&&z(e),le(t),le(h),m=!1,v()}}}function gt(n,e){let t,r,l;function u(){return e[63](e[78])}function s(){return e[64](e[76])}return r=new sn({props:{feature:e[76],showPlaceType:e[10],selected:e[14]===e[78],missingIconsCache:e[19],iconsBaseUrl:e[11]}}),r.$on("mouseenter",u),r.$on("focus",s),{key:n,first:null,c(){t=At(),fe(r.$$.fragment),this.first=t},m(f,h){P(f,t,h),re(r,f,h),l=!0},p(f,h){e=f;const c={};h[0]&8192&&(c.feature=e[76]),h[0]&1024&&(c.showPlaceType=e[10]),h[0]&24576&&(c.selected=e[14]===e[78]),h[0]&2048&&(c.iconsBaseUrl=e[11]),r.$set(c)},i(f){l||(j(r.$$.fragment,f),l=!0)},o(f){G(r.$$.fragment,f),l=!1},d(f){f&&z(t),le(r,f)}}}function yn(n){let e,t,r,l,u,s,f,h,c,m,v,_,R,I,T,L,W,y,F,O;l=new dn({}),m=new ft({});let d=n[18]&&ht(),b=n[5]===!0&&mt(n);const B=n[53].default,E=St(B,n,n[52],null),g=[_n,gn,mn,hn],w=[];function x(a,A){var ie,_e;return a[17]?0:a[15]?((ie=a[13])==null?void 0:ie.length)===0?2:a[15]&&((_e=a[13])!=null&&_e.length)?3:-1:1}return~(T=x(n))&&(L=w[T]=g[T](n)),{c(){e=S("form"),t=S("div"),r=S("button"),fe(l.$$.fragment),u=X(),s=S("input"),f=X(),h=S("div"),c=S("button"),fe(m.$$.fragment),v=X(),d&&d.c(),_=X(),b&&b.c(),R=X(),E&&E.c(),I=X(),L&&L.c(),o(r,"class","search-button svelte-1r7dvt7"),o(r,"type","button"),o(s,"placeholder",n[8]),o(s,"aria-label",n[8]),o(s,"class","svelte-1r7dvt7"),o(c,"type","button"),o(c,"title",n[3]),o(c,"class","svelte-1r7dvt7"),o(h,"class","clear-button-container svelte-1r7dvt7"),ce(h,"displayable",n[1]!==""),o(t,"class","input-group svelte-1r7dvt7"),o(e,"tabindex","0"),o(e,"class",W=nt(n[2])+" svelte-1r7dvt7"),ce(e,"can-collapse",n[4]&&n[1]==="")},m(a,A){P(a,e,A),k(e,t),k(t,r),re(l,r,null),k(t,u),k(t,s),n[55](s),rt(s,n[1]),k(t,f),k(t,h),k(h,c),re(m,c,null),k(h,v),d&&d.m(h,null),k(t,_),b&&b.m(t,null),k(t,R),E&&E.m(t,null),k(e,I),~T&&w[T].m(e,null),y=!0,F||(O=[q(r,"click",n[54]),q(s,"input",n[56]),q(s,"focus",n[57]),q(s,"blur",n[58]),q(s,"keydown",n[21]),q(s,"input",n[59]),q(c,"click",n[60]),q(e,"submit",Ut(n[20]))],F=!0)},p(a,A){(!y||A[0]&256)&&o(s,"placeholder",a[8]),(!y||A[0]&256)&&o(s,"aria-label",a[8]),A[0]&2&&s.value!==a[1]&&rt(s,a[1]),(!y||A[0]&8)&&o(c,"title",a[3]),a[18]?d?A[0]&262144&&j(d,1):(d=ht(),d.c(),j(d,1),d.m(h,null)):d&&(ze(),G(d,1,1,()=>{d=null}),Pe()),(!y||A[0]&2)&&ce(h,"displayable",a[1]!==""),a[5]===!0?b?(b.p(a,A),A[0]&32&&j(b,1)):(b=mt(a),b.c(),j(b,1),b.m(t,R)):b&&(ze(),G(b,1,1,()=>{b=null}),Pe()),E&&E.p&&(!y||A[1]&2097152)&&zt(E,B,a,a[52],y?It(B,a[52],A,null):Pt(a[52]),null);let ie=T;T=x(a),T===ie?~T&&w[T].p(a,A):(L&&(ze(),G(w[ie],1,1,()=>{w[ie]=null}),Pe()),~T?(L=w[T],L?L.p(a,A):(L=w[T]=g[T](a),L.c()),j(L,1),L.m(e,null)):L=null),(!y||A[0]&4&&W!==(W=nt(a[2])+" svelte-1r7dvt7"))&&o(e,"class",W),(!y||A[0]&22)&&ce(e,"can-collapse",a[4]&&a[1]==="")},i(a){y||(j(l.$$.fragment,a),j(m.$$.fragment,a),j(d),j(b),j(E,a),j(L),y=!0)},o(a){G(l.$$.fragment,a),G(m.$$.fragment,a),G(d),G(b),G(E,a),G(L),y=!1},d(a){a&&z(e),le(l),n[55](null),le(m),d&&d.d(),b&&b.d(),E&&E.d(a),~T&&w[T].d(),F=!1,ne(O)}}}function bn(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 _t(n){let e=[...n];return e[2]<e[0]&&(e[2]+=360),e}function wn(n,e,t){let r,{$$slots:l={},$$scope:u}=e,{class:s=void 0}=e,{apiKey:f}=e,{bbox:h=void 0}=e,{clearButtonTitle:c="clear"}=e,{clearOnBlur:m=!1}=e,{collapsed:v=!1}=e,{country:_=void 0}=e,{debounceSearch:R=200}=e,{enableReverse:I=!1}=e,{errorMessage:T="Something went wrong…"}=e,{filter:L=()=>!0}=e,{flyTo:W=!0}=e,{fuzzyMatch:y=!0}=e,{language:F=void 0}=e,{limit:O=void 0}=e,{mapController:d=void 0}=e,{minLength:b=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:E="Search"}=e,{proximity:g=void 0}=e,{reverseActive:w=I==="always"}=e,{reverseButtonTitle:x="toggle reverse geocoding"}=e,{searchValue:a=""}=e,{showFullGeometry:A=!0}=e,{showPlaceType:ie="ifNeeded"}=e,{showResultsWhileTyping:_e=!0}=e,{types:ye=void 0}=e,{zoom:Ae=16}=e,{maxZoom:Ee=18}=e,{apiUrl:Ge="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Qe={}}=e,{iconsBaseUrl:wt="https://cdn.maptiler.com/maptiler-geocoding-control/v0.0.100-rc.2/icons/"}=e;const vt=i=>{};function Tn(){$.focus()}function Mn(){$.blur()}function kt(i,N=!0){t(1,a=i),N?(t(14,Z=-1),Tt()):(Ve(),setTimeout(()=>{$.focus(),$.select()}))}let pe=!1,C,D,p,pt="",$,Z=-1,ee,Ue=[],be,Te,je,qe,Ce;const Ln=new Set,ue=Nt();Zt(()=>{d&&(d.setEventHandler(void 0),d.indicateReverse(!1),d.setSelectedMarker(-1),d.setMarkers(void 0,void 0))});function Tt(i){if(Te&&(clearTimeout(Te),Te=void 0),Z>-1&&C)t(49,p=C[Z]),t(1,a=p.place_name.replace(/,.*/,"")),t(17,ee=void 0),t(48,D=void 0),t(14,Z=-1);else if(a){const N=i||!Mt();De(a,{exact:!0}).then(()=>{t(48,D=C),t(49,p=void 0),N&&Rn()}).catch(te=>t(17,ee=te))}}function Mt(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(a)}async function De(i,{byId:N=!1,exact:te=!1}={}){t(17,ee=void 0),be==null||be.abort();const ae=new AbortController;t(18,be=ae);try{const Y=Mt(),K=new URLSearchParams;if(F!=null&&K.set("language",Array.isArray(F)?F.join(","):F),ye&&K.set("types",ye.join(",")),h&&K.set("bbox",h.map(Je=>Je.toFixed(6)).join(",")),_&&K.set("country",Array.isArray(_)?_.join(","):_),!N&&!Y){async function Je(){const Me=d==null?void 0:d.getCenterAndZoom();for(const J of g??[])if(!(Me&&(J.minZoom!=null&&J.minZoom>Me[0]||J.maxZoom!=null&&J.maxZoom<Me[0]))){if(J.type==="fixed")return J.coordinates.join(",");e:if(J.type==="client-geolocation"){if(Ce&&J.cachedLocationExpiry&&Ce.time+J.cachedLocationExpiry>Date.now()){if(!Ce.coords)break e;return Ce.coords}let Xe;try{return Xe=await new Promise((Gn,Bt)=>{ae.signal.addEventListener("abort",()=>{Bt(Error("aborted"))}),navigator.geolocation.getCurrentPosition(We=>{Gn([We.coords.longitude,We.coords.latitude].map(Qn=>Qn.toFixed(6)).join(","))},We=>{Bt(We)},J)}),Xe}catch{}finally{J.cachedLocationExpiry&&(Ce={time:Date.now(),coords:Xe})}if(ae.signal.aborted)return}if(J.type==="server-geolocation")return"ip";if(Me&&J.type==="map-center")return Me[1].toFixed(6)+","+Me[2].toFixed(6)}}const Rt=await Je();Rt&&K.set("proximity",Rt),(te||!_e)&&K.set("autocomplete","false"),K.set("fuzzyMatch",String(y))}O!==void 0&&(!Y||(ye==null?void 0:ye.length)===1)&&K.set("limit",String(O)),K.set("key",f),vt(K);const Q=Ge+"/"+encodeURIComponent(i)+".json?"+K.toString();if(Q===pt){N?(t(13,C=void 0),t(49,p=Ue[0])):t(13,C=Ue);return}pt=Q;const Lt=await fetch(Q,{signal:ae.signal,...Qe});if(!Lt.ok)throw new Error;const He=await Lt.json();ue("response",{url:Q,featureCollection:He}),N?(t(13,C=void 0),t(49,p=He.features[0]),Ue=[p]):(t(13,C=He.features.filter(L)),Ue=C,Y&&$.focus())}catch(Y){if(Y&&typeof Y=="object"&&"name"in Y&&Y.name==="AbortError")return;throw Y}finally{ae===be&&t(18,be=void 0)}}function Rn(){var te,ae,Y,K;if(!(D!=null&&D.length)||!W)return;const i=[180,90,-180,-90],N=!D.some(Q=>!Q.matching_text);for(const Q of D)(N||!Q.matching_text)&&(i[0]=Math.min(i[0],((te=Q.bbox)==null?void 0:te[0])??Q.center[0]),i[1]=Math.min(i[1],((ae=Q.bbox)==null?void 0:ae[1])??Q.center[1]),i[2]=Math.max(i[2],((Y=Q.bbox)==null?void 0:Y[2])??Q.center[0]),i[3]=Math.max(i[3],((K=Q.bbox)==null?void 0:K[3])??Q.center[1]));d&&D.length>0&&(p&&i[0]===i[2]&&i[1]===i[3]?d.flyTo(p.center,Ae):d.fitBounds(_t(i),50,Ee))}function Bn(i){t(0,w=I==="always"),kt(bn(i[0],[-180,180],!0).toFixed(6)+","+i[1].toFixed(6))}function En(i){if(!C)return;let N=i.key==="ArrowDown"?1:i.key==="ArrowUp"?-1:0;N?(Z===-1&&N===-1&&t(14,Z=C.length),t(14,Z+=N),Z>=C.length&&t(14,Z=-1),i.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(i.key)&&t(14,Z=-1)}function Ve(i=!0){if(t(17,ee=void 0),_e){if(Te&&clearTimeout(Te),a.length<b)return;const N=a;Te=window.setTimeout(()=>{De(N).catch(te=>t(17,ee=te))},i?R:0)}else t(13,C=void 0),t(17,ee=void 0)}function Ke(i){t(49,p=i),t(1,a=i.place_name),t(14,Z=-1)}const Cn=()=>$.focus();function Sn(i){Ze[i?"unshift":"push"](()=>{$=i,t(16,$)})}function In(){a=this.value,t(1,a),t(12,pe),t(26,m)}const zn=()=>t(12,pe=!0),Pn=()=>t(12,pe=!1),An=()=>Ve(),Un=()=>{t(1,a=""),$.focus()},jn=()=>t(0,w=!w),Wn=()=>t(17,ee=void 0),Zn=i=>t(14,Z=i),Nn=i=>Ke(i),Fn=()=>t(14,Z=-1),On=()=>{};return n.$$set=i=>{"class"in i&&t(2,s=i.class),"apiKey"in i&&t(24,f=i.apiKey),"bbox"in i&&t(25,h=i.bbox),"clearButtonTitle"in i&&t(3,c=i.clearButtonTitle),"clearOnBlur"in i&&t(26,m=i.clearOnBlur),"collapsed"in i&&t(4,v=i.collapsed),"country"in i&&t(27,_=i.country),"debounceSearch"in i&&t(28,R=i.debounceSearch),"enableReverse"in i&&t(5,I=i.enableReverse),"errorMessage"in i&&t(6,T=i.errorMessage),"filter"in i&&t(29,L=i.filter),"flyTo"in i&&t(30,W=i.flyTo),"fuzzyMatch"in i&&t(31,y=i.fuzzyMatch),"language"in i&&t(32,F=i.language),"limit"in i&&t(33,O=i.limit),"mapController"in i&&t(34,d=i.mapController),"minLength"in i&&t(35,b=i.minLength),"noResultsMessage"in i&&t(7,B=i.noResultsMessage),"placeholder"in i&&t(8,E=i.placeholder),"proximity"in i&&t(36,g=i.proximity),"reverseActive"in i&&t(0,w=i.reverseActive),"reverseButtonTitle"in i&&t(9,x=i.reverseButtonTitle),"searchValue"in i&&t(1,a=i.searchValue),"showFullGeometry"in i&&t(37,A=i.showFullGeometry),"showPlaceType"in i&&t(10,ie=i.showPlaceType),"showResultsWhileTyping"in i&&t(38,_e=i.showResultsWhileTyping),"types"in i&&t(39,ye=i.types),"zoom"in i&&t(40,Ae=i.zoom),"maxZoom"in i&&t(41,Ee=i.maxZoom),"apiUrl"in i&&t(42,Ge=i.apiUrl),"fetchParameters"in i&&t(43,Qe=i.fetchParameters),"iconsBaseUrl"in i&&t(11,wt=i.iconsBaseUrl),"$$scope"in i&&t(52,u=i.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&67112960&&setTimeout(()=>{t(15,je=pe),m&&!pe&&t(1,a="")}),n.$$.dirty[0]&8194|n.$$.dirty[1]&16&&a.length<b&&(t(49,p=void 0),t(13,C=void 0),t(17,ee=void 0),t(48,D=C)),n.$$.dirty[1]&262208&&A&&p&&!p.address&&p.geometry.type==="Point"&&De(p.id,{byId:!0}).catch(i=>t(17,ee=i)),n.$$.dirty[0]&1073741824|n.$$.dirty[1]&787976&&(d&&p&&p.id!==qe&&W&&(!p.bbox||p.bbox[0]===p.bbox[2]&&p.bbox[1]===p.bbox[3]?d.flyTo(p.center,p.id.startsWith("poi.")||p.id.startsWith("address.")?Ee:Ae):d.fitBounds(_t(p.bbox),50,Ee),t(13,C=void 0),t(48,D=void 0),t(14,Z=-1)),t(50,qe=p==null?void 0:p.id)),n.$$.dirty[0]&8192|n.$$.dirty[1]&131072&&D!==C&&t(48,D=void 0),n.$$.dirty[1]&393224&&d&&d.setMarkers(D,p),n.$$.dirty[0]&2&&t(14,Z=-1),n.$$.dirty[0]&40961|n.$$.dirty[1]&8&&d&&d.setEventHandler(i=>{switch(i.type){case"mapClick":w&&Bn(i.coordinates);break;case"markerClick":{const N=C==null?void 0:C.find(te=>te.id===i.id);N&&Ke(N)}break;case"markerMouseEnter":t(14,Z=je?(C==null?void 0:C.findIndex(N=>N.id===i.id))??-1:-1);break;case"markerMouseLeave":t(14,Z=-1);break}}),n.$$.dirty[0]&16384|n.$$.dirty[1]&8&&(d==null||d.setSelectedMarker(Z)),n.$$.dirty[0]&24576&&t(51,r=C==null?void 0:C[Z]),n.$$.dirty[0]&2|n.$$.dirty[1]&8){const i=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(a);d==null||d.setReverseMarker(i?[Number(i[1]),Number(i[2])]:void 0)}n.$$.dirty[1]&1048576&&ue("select",r),n.$$.dirty[1]&262144&&ue("pick",p),n.$$.dirty[0]&40960&&ue("optionsVisibilityChange",je&&!!C),n.$$.dirty[0]&8192&&ue("featuresListed",C),n.$$.dirty[1]&131072&&ue("featuresMarked",D),n.$$.dirty[0]&1&&ue("reverseToggle",w),n.$$.dirty[0]&2&&ue("queryChange",a),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&d&&d.indicateReverse(w)},[w,a,s,c,v,I,T,B,E,x,ie,wt,pe,C,Z,je,$,ee,be,Ln,Tt,En,Ve,Ke,f,h,m,_,R,L,W,y,F,O,d,b,g,A,_e,ye,Ae,Ee,Ge,Qe,vt,Tn,Mn,kt,D,p,qe,r,u,l,Cn,Sn,In,zn,Pn,An,Un,jn,Wn,Zn,Nn,Fn,On]}class vn extends ge{constructor(e){super(),me(this,e,wn,yn,de,{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,adjustQuery:44,focus:45,blur:46,setQuery:47},null,[-1,-1,-1])}get adjustQuery(){return this.$$.ctx[44]}get focus(){return this.$$.ctx[45]}get blur(){return this.$$.ctx[46]}get setQuery(){return this.$$.ctx[47]}}const yt=["featuresListed","featuresMarked","optionsVisibilityChange","pick","queryChange","response","reverseToggle","select"],kn=["apiKey","bbox","clearButtonTitle","clearOnBlur","collapsed","country","debounceSearch","enableReverse","reverseActive","errorMessage","filter","fuzzyMatch","language","limit","minLength","noResultsMessage","placeholder","proximity","reverseButtonTitle","showFullGeometry","showPlaceType","showResultsWhileTyping","adjustQuery","types","zoom","mapController"];function bt(n){return"on"+n[0].toUpperCase()+n.slice(1)}const pn=U.forwardRef(function(e,t){const r=U.useRef(),l=U.useRef(),u={...e};for(const s of yt)delete u[bt(s)];U.useEffect(()=>{if(!r.current)throw new Error;const s=new vn({target:r.current,props:u});return l.current=s,()=>s.$destroy()},[]);for(const s of kn)U.useEffect(()=>{l.current&&e[s]!==void 0&&l.current.$set({[s]:e[s]})},[e[s]]);for(const s of yt){const f=e[bt(s)];U.useEffect(()=>{var h;return f&&((h=l.current)==null?void 0:h.$on(s,c=>{f(c.detail)}))},[f])}return U.useImperativeHandle(t,()=>({setQuery:(s,f=!0)=>{var h;return(h=l.current)==null?void 0:h.setQuery(s,f)},focus:()=>{var s;return(s=l.current)==null?void 0:s.focus()},blur:()=>{var s;return(s=l.current)==null?void 0:s.blur()}})),U.createElement("div",{ref:r})});H.GeocodingControl=pn,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(H,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],U):(H=typeof globalThis<"u"?globalThis:H||self,U(H.reactMaptilerGeocoder={},H.React))})(this,function(H,U){"use strict";var qn=Object.defineProperty;var Dn=(H,U,M)=>U in H?qn(H,U,{enumerable:!0,configurable:!0,writable:!0,value:M}):H[U]=M;var Ye=(H,U,M)=>(Dn(H,typeof U!="symbol"?U+"":U,M),M);function M(){}function Et(n,e){for(const t in e)n[t]=e[t];return n}function xe(n){return n()}function $e(){return Object.create(null)}function ne(n){n.forEach(xe)}function et(n){return typeof n=="function"}function de(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Se;function V(n,e){return n===e?!0:(Se||(Se=document.createElement("a")),Se.href=e,n===Se.href)}function Ct(n){return Object.keys(n).length===0}function St(n,e,t,r){if(n){const l=tt(n,e,t,r);return n[0](l)}}function tt(n,e,t,r){return n[1]&&r?Et(t.ctx.slice(),n[1](r(e))):t.ctx}function It(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=[],s=Math.max(e.dirty.length,l.length);for(let f=0;f<s;f+=1)u[f]=e.dirty[f]|l[f];return u}return e.dirty|l}return e.dirty}function zt(n,e,t,r,l,u){if(l){const s=tt(e,t,r,u);n.p(s,l)}}function Pt(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 nt(n){return n??""}function k(n,e){n.appendChild(e)}function P(n,e,t){n.insertBefore(e,t||null)}function z(n){n.parentNode&&n.parentNode.removeChild(n)}function S(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 At(){return oe("")}function q(n,e,t,r){return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}function Ut(n){return function(e){return e.preventDefault(),n.call(this,e)}}function o(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function jt(n){return Array.from(n.childNodes)}function Le(n,e){e=""+e,n.data!==e&&(n.data=e)}function rt(n,e){n.value=e??""}function ce(n,e,t){n.classList.toggle(e,!!t)}function Wt(n,e,{bubbles:t=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:r})}let Re;function Be(n){Re=n}function lt(){if(!Re)throw new Error("Function called outside component initialization");return Re}function Zt(n){lt().$$.on_destroy.push(n)}function Nt(){const n=lt();return(e,t,{cancelable:r=!1}={})=>{const l=n.$$.callbacks[e];if(l){const u=Wt(e,t,{cancelable:r});return l.slice().forEach(s=>{s.call(n,u)}),!u.defaultPrevented}return!0}}function it(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(r=>r.call(this,e))}const we=[],Ze=[];let ve=[];const st=[],Ft=Promise.resolve();let Ne=!1;function Ot(){Ne||(Ne=!0,Ft.then(ot))}function Fe(n){ve.push(n)}const Oe=new Set;let ke=0;function ot(){if(ke!==0)return;const n=Re;do{try{for(;ke<we.length;){const e=we[ke];ke++,Be(e),Gt(e.$$)}}catch(e){throw we.length=0,ke=0,e}for(Be(null),we.length=0,ke=0;Ze.length;)Ze.pop()();for(let e=0;e<ve.length;e+=1){const t=ve[e];Oe.has(t)||(Oe.add(t),t())}ve.length=0}while(we.length);for(;st.length;)st.pop()();Ne=!1,Oe.clear(),Be(n)}function Gt(n){if(n.fragment!==null){n.update(),ne(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Fe)}}function Qt(n){const e=[],t=[];ve.forEach(r=>n.indexOf(r)===-1?e.push(r):t.push(r)),t.forEach(r=>r()),ve=e}const Ie=new Set;let he;function ze(){he={r:0,c:[],p:he}}function Pe(){he.r||ne(he.c),he=he.p}function j(n,e){n&&n.i&&(Ie.delete(n),n.i(e))}function G(n,e,t,r){if(n&&n.o){if(Ie.has(n))return;Ie.add(n),he.c.push(()=>{Ie.delete(n),r&&(t&&n.d(1),r())}),n.o(e)}else r&&r()}function ct(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function qt(n,e){G(n,1,1,()=>{e.delete(n.key)})}function Dt(n,e,t,r,l,u,s,f,h,c,m,v){let _=n.length,R=u.length,I=_;const T={};for(;I--;)T[n[I].key]=I;const L=[],W=new Map,y=new Map,F=[];for(I=R;I--;){const B=v(l,u,I),E=t(B);let g=s.get(E);g?r&&F.push(()=>g.p(B,e)):(g=c(E,B),g.c()),W.set(E,L[I]=g),E in T&&y.set(E,Math.abs(I-T[E]))}const O=new Set,d=new Set;function b(B){j(B,1),B.m(f,m),s.set(B.key,B),m=B.first,R--}for(;_&&R;){const B=L[R-1],E=n[_-1],g=B.key,w=E.key;B===E?(m=B.first,_--,R--):W.has(w)?!s.has(g)||O.has(g)?b(B):d.has(w)?_--:y.get(g)>y.get(w)?(d.add(g),b(B)):(O.add(w),_--):(h(E,s),_--)}for(;_--;){const B=n[_];W.has(B.key)||h(B,s)}for(;R;)b(L[R-1]);return ne(F),L}function fe(n){n&&n.c()}function re(n,e,t){const{fragment:r,after_update:l}=n.$$;r&&r.m(e,t),Fe(()=>{const u=n.$$.on_mount.map(xe).filter(et);n.$$.on_destroy?n.$$.on_destroy.push(...u):ne(u),n.$$.on_mount=[]}),l.forEach(Fe)}function le(n,e){const t=n.$$;t.fragment!==null&&(Qt(t.after_update),ne(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Vt(n,e){n.$$.dirty[0]===-1&&(we.push(n),Ot(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function me(n,e,t,r,l,u,s=null,f=[-1]){const h=Re;Be(n);const c=n.$$={fragment:null,ctx:[],props:u,update:M,not_equal:l,bound:$e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(h?h.$$.context:[])),callbacks:$e(),dirty:f,skip_bound:!1,root:e.target||h.$$.root};s&&s(c.root);let m=!1;if(c.ctx=t?t(n,e.props||{},(v,_,...R)=>{const I=R.length?R[0]:_;return c.ctx&&l(c.ctx[v],c.ctx[v]=I)&&(!c.skip_bound&&c.bound[v]&&c.bound[v](I),m&&Vt(n,v)),_}):[],c.update(),m=!0,ne(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){const v=jt(e.target);c.fragment&&c.fragment.l(v),v.forEach(z)}else c.fragment&&c.fragment.c();e.intro&&j(n.$$.fragment),re(n,e.target,e.anchor),ot()}Be(h)}class ge{constructor(){Ye(this,"$$");Ye(this,"$$set")}$destroy(){le(this,1),this.$destroy=M}$on(e,t){if(!et(t))return M;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&&!Ct(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Kt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Kt);const Vn="";function Ht(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"viewBox","0 0 14 14"),o(e,"width","13"),o(e,"height","13"),o(e,"class","svelte-en2qvf")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class ft extends ge{constructor(e){super(),me(this,e,null,Ht,de,{})}}const Kn="";function Jt(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"viewBox","0 0 30 30"),o(e,"fill","none"),o(e,"xmlns","http://www.w3.org/2000/svg"),o(e,"class","svelte-d2loi5")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class ut extends ge{constructor(e){super(),me(this,e,null,Jt,de,{})}}const Hn="";function Xt(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"area.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"area.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function Yt(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"poi.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"poi.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function xt(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"postal_code.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"postal_code.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function $t(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"street.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"street.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function en(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"road.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"road.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function tn(n){let e,t;return{c(){e=S("img"),V(e.src,t=n[3]+"housenumber.svg")||o(e,"src",t),o(e,"alt",n[6]),o(e,"class","svelte-ltkwvy")},m(r,l){P(r,e,l)},p(r,l){l&8&&!V(e.src,t=r[3]+"housenumber.svg")&&o(e,"src",t),l&64&&o(e,"alt",r[6])},d(r){r&&z(e)}}}function nn(n){let e,t,r,l;return{c(){e=S("img"),V(e.src,t=n[5])||o(e,"src",t),o(e,"alt",n[4]),o(e,"class","svelte-ltkwvy")},m(u,s){P(u,e,s),r||(l=q(e,"error",n[12]),r=!0)},p(u,s){s&32&&!V(e.src,t=u[5])&&o(e,"src",t),s&16&&o(e,"alt",u[4])},d(u){u&&z(e),r=!1,l()}}}function at(n){let e,t;return{c(){e=S("span"),t=oe(n[6]),o(e,"class","secondary svelte-ltkwvy")},m(r,l){P(r,e,l),k(e,t)},p(r,l){l&64&&Le(t,r[6])},d(r){r&&z(e)}}}function rn(n){var B,E;let e,t,r,l,u,s,f,h,c=n[0].place_name.replace(/,.*/,"")+"",m,v,_=n[2]==="always"||n[2]&&!n[0].address&&((B=n[0].properties)==null?void 0:B.kind)!=="road"&&((E=n[0].properties)==null?void 0:E.kind)!=="road_relation"&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5]),R,I,T=n[0].place_name.replace(/[^,]*,?\s*/,"")+"",L,W,y;function F(g,w){var x,a;return w&1&&(t=null),w&1&&(r=null),w&1&&(l=null),g[5]?nn:g[0].address?tn:((x=g[0].properties)==null?void 0:x.kind)==="road"||((a=g[0].properties)==null?void 0:a.kind)==="road_relation"?en:(t==null&&(t=!!g[0].id.startsWith("address.")),t?$t:(r==null&&(r=!!g[0].id.startsWith("postal_code.")),r?xt:(l==null&&(l=!!g[0].id.startsWith("poi.")),l?Yt:Xt)))}let O=F(n,-1),d=O(n),b=_&&at(n);return{c(){e=S("li"),d.c(),u=X(),s=S("span"),f=S("span"),h=S("span"),m=oe(c),v=X(),b&&b.c(),R=X(),I=S("span"),L=oe(T),o(h,"class","primary svelte-ltkwvy"),o(f,"class","svelte-ltkwvy"),o(I,"class","line2 svelte-ltkwvy"),o(s,"class","texts svelte-ltkwvy"),o(e,"tabindex","0"),o(e,"data-selected",n[1]),o(e,"class","svelte-ltkwvy"),ce(e,"selected",n[1])},m(g,w){P(g,e,w),d.m(e,null),k(e,u),k(e,s),k(s,f),k(f,h),k(h,m),k(f,v),b&&b.m(f,null),k(s,R),k(s,I),k(I,L),W||(y=[q(e,"mouseenter",n[10]),q(e,"focus",n[11])],W=!0)},p(g,[w]){var x,a;O===(O=F(g,w))&&d?d.p(g,w):(d.d(1),d=O(g),d&&(d.c(),d.m(e,u))),w&1&&c!==(c=g[0].place_name.replace(/,.*/,"")+"")&&Le(m,c),w&37&&(_=g[2]==="always"||g[2]&&!g[0].address&&((x=g[0].properties)==null?void 0:x.kind)!=="road"&&((a=g[0].properties)==null?void 0:a.kind)!=="road_relation"&&!g[0].id.startsWith("address.")&&!g[0].id.startsWith("postal_code.")&&(!g[0].id.startsWith("poi.")||!g[5])),_?b?b.p(g,w):(b=at(g),b.c(),b.m(f,null)):b&&(b.d(1),b=null),w&1&&T!==(T=g[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Le(L,T),w&2&&o(e,"data-selected",g[1]),w&2&&ce(e,"selected",g[1])},i:M,o:M,d(g){g&&z(e),d.d(),b&&b.d(),W=!1,ne(y)}}}function ln(n,e,t){var W;let r,l,{feature:u}=e,{selected:s=!1}=e,{showPlaceType:f}=e,{missingIconsCache:h}=e,{iconsBaseUrl:c}=e;const m=(W=u.properties)==null?void 0:W.categories;let v,_;function R(y){_&&h.add(_),t(9,r--,r)}function I(y){it.call(this,n,y)}function T(y){it.call(this,n,y)}const L=y=>R(y.currentTarget);return n.$$set=y=>{"feature"in y&&t(0,u=y.feature),"selected"in y&&t(1,s=y.selected),"showPlaceType"in y&&t(2,f=y.showPlaceType),"missingIconsCache"in y&&t(8,h=y.missingIconsCache),"iconsBaseUrl"in y&&t(3,c=y.iconsBaseUrl)},n.$$.update=()=>{var y,F,O,d;if(n.$$.dirty&824)do t(9,r--,r),t(4,v=m==null?void 0:m[r]),t(5,_=v?c+v.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!_||h.has(_)));n.$$.dirty&1&&t(6,l=u.id.startsWith("poi.")?(F=(y=u.properties)==null?void 0:y.categories)==null?void 0:F.join(", "):((d=(O=u.properties)==null?void 0:O.place_type_name)==null?void 0:d[0])??u.place_type[0])},t(9,r=(m==null?void 0:m.length)??0),[u,s,f,c,v,_,l,R,h,r,I,T,L]}class sn extends ge{constructor(e){super(),me(this,e,ln,rn,de,{feature:0,selected:1,showPlaceType:2,missingIconsCache:8,iconsBaseUrl:3})}}const Jn="";function on(n){let e;return{c(){e=S("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>',o(e,"class","svelte-7cmwmc")},m(t,r){P(t,e,r)},p:M,i:M,o:M,d(t){t&&z(e)}}}class cn extends ge{constructor(e){super(),me(this,e,null,on,de,{})}}const Xn="";function fn(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"viewBox","0 0 60.006 21.412"),o(e,"width","14"),o(e,"height","20"),o(e,"class","svelte-en2qvf")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class un extends ge{constructor(e){super(),me(this,e,null,fn,de,{})}}const Yn="";function an(n){let e,t;return{c(){e=se("svg"),t=se("path"),o(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"),o(e,"width","14"),o(e,"height","14"),o(e,"viewBox","0 0 15 15"),o(e,"class","svelte-en2qvf")},m(r,l){P(r,e,l),k(e,t)},p:M,i:M,o:M,d(r){r&&z(e)}}}class dn extends ge{constructor(e){super(),me(this,e,null,an,de,{})}}const xn="";function dt(n,e,t){const r=n.slice();return r[76]=e[t],r[78]=t,r}function ht(n){let e,t;return e=new cn({}),{c(){fe(e.$$.fragment)},m(r,l){re(e,r,l),t=!0},i(r){t||(j(e.$$.fragment,r),t=!0)},o(r){G(e.$$.fragment,r),t=!1},d(r){le(e,r)}}}function mt(n){let e,t,r,l,u;return t=new un({}),{c(){e=S("button"),fe(t.$$.fragment),o(e,"type","button"),o(e,"title",n[9]),o(e,"class","svelte-1r7dvt7"),ce(e,"active",n[0])},m(s,f){P(s,e,f),re(t,e,null),r=!0,l||(u=q(e,"click",n[61]),l=!0)},p(s,f){(!r||f[0]&512)&&o(e,"title",s[9]),(!r||f[0]&1)&&ce(e,"active",s[0])},i(s){r||(j(t.$$.fragment,s),r=!0)},o(s){G(t.$$.fragment,s),r=!1},d(s){s&&z(e),le(t),l=!1,u()}}}function hn(n){let e,t=[],r=new Map,l,u,s,f=ct(n[13]);const h=c=>c[76].id+(c[76].address?","+c[76].address:"");for(let c=0;c<f.length;c+=1){let m=dt(n,f,c),v=h(m);r.set(v,t[c]=gt(v,m))}return{c(){e=S("ul");for(let c=0;c<t.length;c+=1)t[c].c();o(e,"class","svelte-1r7dvt7")},m(c,m){P(c,e,m);for(let v=0;v<t.length;v+=1)t[v]&&t[v].m(e,null);l=!0,u||(s=[q(e,"mouseleave",n[65]),q(e,"blur",n[66])],u=!0)},p(c,m){m[0]&8940544&&(f=ct(c[13]),ze(),t=Dt(t,m,h,1,c,f,r,e,qt,gt,null,dt),Pe())},i(c){if(!l){for(let m=0;m<f.length;m+=1)j(t[m]);l=!0}},o(c){for(let m=0;m<t.length;m+=1)G(t[m]);l=!1},d(c){c&&z(e);for(let m=0;m<t.length;m+=1)t[m].d();u=!1,ne(s)}}}function mn(n){let e,t,r,l,u,s;return t=new ut({}),{c(){e=S("div"),fe(t.$$.fragment),r=X(),l=S("div"),u=oe(n[7]),o(l,"class","svelte-1r7dvt7"),o(e,"class","no-results svelte-1r7dvt7")},m(f,h){P(f,e,h),re(t,e,null),k(e,r),k(e,l),k(l,u),s=!0},p(f,h){(!s||h[0]&128)&&Le(u,f[7])},i(f){s||(j(t.$$.fragment,f),s=!0)},o(f){G(t.$$.fragment,f),s=!1},d(f){f&&z(e),le(t)}}}function gn(n){let e="",t;return{c(){t=oe(e)},m(r,l){P(r,t,l)},p:M,i:M,o:M,d(r){r&&z(t)}}}function _n(n){let e,t,r,l,u,s,f,h,c,m,v;return t=new ut({}),h=new ft({}),{c(){e=S("div"),fe(t.$$.fragment),r=X(),l=S("div"),u=oe(n[6]),s=X(),f=S("button"),fe(h.$$.fragment),o(l,"class","svelte-1r7dvt7"),o(f,"class","svelte-1r7dvt7"),o(e,"class","error svelte-1r7dvt7")},m(_,R){P(_,e,R),re(t,e,null),k(e,r),k(e,l),k(l,u),k(e,s),k(e,f),re(h,f,null),c=!0,m||(v=q(f,"click",n[62]),m=!0)},p(_,R){(!c||R[0]&64)&&Le(u,_[6])},i(_){c||(j(t.$$.fragment,_),j(h.$$.fragment,_),c=!0)},o(_){G(t.$$.fragment,_),G(h.$$.fragment,_),c=!1},d(_){_&&z(e),le(t),le(h),m=!1,v()}}}function gt(n,e){let t,r,l;function u(){return e[63](e[78])}function s(){return e[64](e[76])}return r=new sn({props:{feature:e[76],showPlaceType:e[10],selected:e[14]===e[78],missingIconsCache:e[19],iconsBaseUrl:e[11]}}),r.$on("mouseenter",u),r.$on("focus",s),{key:n,first:null,c(){t=At(),fe(r.$$.fragment),this.first=t},m(f,h){P(f,t,h),re(r,f,h),l=!0},p(f,h){e=f;const c={};h[0]&8192&&(c.feature=e[76]),h[0]&1024&&(c.showPlaceType=e[10]),h[0]&24576&&(c.selected=e[14]===e[78]),h[0]&2048&&(c.iconsBaseUrl=e[11]),r.$set(c)},i(f){l||(j(r.$$.fragment,f),l=!0)},o(f){G(r.$$.fragment,f),l=!1},d(f){f&&z(t),le(r,f)}}}function yn(n){let e,t,r,l,u,s,f,h,c,m,v,_,R,I,T,L,W,y,F,O;l=new dn({}),m=new ft({});let d=n[18]&&ht(),b=n[5]===!0&&mt(n);const B=n[53].default,E=St(B,n,n[52],null),g=[_n,gn,mn,hn],w=[];function x(a,A){var ie,_e;return a[17]?0:a[15]?((ie=a[13])==null?void 0:ie.length)===0?2:a[15]&&((_e=a[13])!=null&&_e.length)?3:-1:1}return~(T=x(n))&&(L=w[T]=g[T](n)),{c(){e=S("form"),t=S("div"),r=S("button"),fe(l.$$.fragment),u=X(),s=S("input"),f=X(),h=S("div"),c=S("button"),fe(m.$$.fragment),v=X(),d&&d.c(),_=X(),b&&b.c(),R=X(),E&&E.c(),I=X(),L&&L.c(),o(r,"class","search-button svelte-1r7dvt7"),o(r,"type","button"),o(s,"placeholder",n[8]),o(s,"aria-label",n[8]),o(s,"class","svelte-1r7dvt7"),o(c,"type","button"),o(c,"title",n[3]),o(c,"class","svelte-1r7dvt7"),o(h,"class","clear-button-container svelte-1r7dvt7"),ce(h,"displayable",n[1]!==""),o(t,"class","input-group svelte-1r7dvt7"),o(e,"tabindex","0"),o(e,"class",W=nt(n[2])+" svelte-1r7dvt7"),ce(e,"can-collapse",n[4]&&n[1]==="")},m(a,A){P(a,e,A),k(e,t),k(t,r),re(l,r,null),k(t,u),k(t,s),n[55](s),rt(s,n[1]),k(t,f),k(t,h),k(h,c),re(m,c,null),k(h,v),d&&d.m(h,null),k(t,_),b&&b.m(t,null),k(t,R),E&&E.m(t,null),k(e,I),~T&&w[T].m(e,null),y=!0,F||(O=[q(r,"click",n[54]),q(s,"input",n[56]),q(s,"focus",n[57]),q(s,"blur",n[58]),q(s,"keydown",n[21]),q(s,"input",n[59]),q(c,"click",n[60]),q(e,"submit",Ut(n[20]))],F=!0)},p(a,A){(!y||A[0]&256)&&o(s,"placeholder",a[8]),(!y||A[0]&256)&&o(s,"aria-label",a[8]),A[0]&2&&s.value!==a[1]&&rt(s,a[1]),(!y||A[0]&8)&&o(c,"title",a[3]),a[18]?d?A[0]&262144&&j(d,1):(d=ht(),d.c(),j(d,1),d.m(h,null)):d&&(ze(),G(d,1,1,()=>{d=null}),Pe()),(!y||A[0]&2)&&ce(h,"displayable",a[1]!==""),a[5]===!0?b?(b.p(a,A),A[0]&32&&j(b,1)):(b=mt(a),b.c(),j(b,1),b.m(t,R)):b&&(ze(),G(b,1,1,()=>{b=null}),Pe()),E&&E.p&&(!y||A[1]&2097152)&&zt(E,B,a,a[52],y?It(B,a[52],A,null):Pt(a[52]),null);let ie=T;T=x(a),T===ie?~T&&w[T].p(a,A):(L&&(ze(),G(w[ie],1,1,()=>{w[ie]=null}),Pe()),~T?(L=w[T],L?L.p(a,A):(L=w[T]=g[T](a),L.c()),j(L,1),L.m(e,null)):L=null),(!y||A[0]&4&&W!==(W=nt(a[2])+" svelte-1r7dvt7"))&&o(e,"class",W),(!y||A[0]&22)&&ce(e,"can-collapse",a[4]&&a[1]==="")},i(a){y||(j(l.$$.fragment,a),j(m.$$.fragment,a),j(d),j(b),j(E,a),j(L),y=!0)},o(a){G(l.$$.fragment,a),G(m.$$.fragment,a),G(d),G(b),G(E,a),G(L),y=!1},d(a){a&&z(e),le(l),n[55](null),le(m),d&&d.d(),b&&b.d(),E&&E.d(a),~T&&w[T].d(),F=!1,ne(O)}}}function bn(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 _t(n){let e=[...n];return e[2]<e[0]&&(e[2]+=360),e}function wn(n,e,t){let r,{$$slots:l={},$$scope:u}=e,{class:s=void 0}=e,{apiKey:f}=e,{bbox:h=void 0}=e,{clearButtonTitle:c="clear"}=e,{clearOnBlur:m=!1}=e,{collapsed:v=!1}=e,{country:_=void 0}=e,{debounceSearch:R=200}=e,{enableReverse:I=!1}=e,{errorMessage:T="Something went wrong…"}=e,{filter:L=()=>!0}=e,{flyTo:W=!0}=e,{fuzzyMatch:y=!0}=e,{language:F=void 0}=e,{limit:O=void 0}=e,{mapController:d=void 0}=e,{minLength:b=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:E="Search"}=e,{proximity:g=[{type:"server-geolocation"}]}=e,{reverseActive:w=I==="always"}=e,{reverseButtonTitle:x="toggle reverse geocoding"}=e,{searchValue:a=""}=e,{showFullGeometry:A=!0}=e,{showPlaceType:ie="ifNeeded"}=e,{showResultsWhileTyping:_e=!0}=e,{types:ye=void 0}=e,{zoom:Ae=16}=e,{maxZoom:Ee=18}=e,{apiUrl:Ge="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Qe={}}=e,{iconsBaseUrl:wt="https://cdn.maptiler.com/maptiler-geocoding-control/v1.0.0-rc.1/icons/"}=e;const vt=i=>{};function Tn(){$.focus()}function Mn(){$.blur()}function kt(i,N=!0){t(1,a=i),N?(t(14,Z=-1),Tt()):(Ve(),setTimeout(()=>{$.focus(),$.select()}))}let pe=!1,C,D,p,pt="",$,Z=-1,ee,Ue=[],be,Te,je,qe,Ce;const Ln=new Set,ue=Nt();Zt(()=>{d&&(d.setEventHandler(void 0),d.indicateReverse(!1),d.setSelectedMarker(-1),d.setMarkers(void 0,void 0))});function Tt(i){if(Te&&(clearTimeout(Te),Te=void 0),Z>-1&&C)t(49,p=C[Z]),t(1,a=p.place_name.replace(/,.*/,"")),t(17,ee=void 0),t(48,D=void 0),t(14,Z=-1);else if(a){const N=i||!Mt();De(a,{exact:!0}).then(()=>{t(48,D=C),t(49,p=void 0),N&&Rn()}).catch(te=>t(17,ee=te))}}function Mt(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(a)}async function De(i,{byId:N=!1,exact:te=!1}={}){t(17,ee=void 0),be==null||be.abort();const ae=new AbortController;t(18,be=ae);try{const Y=Mt(),K=new URLSearchParams;if(F!=null&&K.set("language",Array.isArray(F)?F.join(","):F),ye&&K.set("types",ye.join(",")),h&&K.set("bbox",h.map(Je=>Je.toFixed(6)).join(",")),_&&K.set("country",Array.isArray(_)?_.join(","):_),!N&&!Y){async function Je(){const Me=d==null?void 0:d.getCenterAndZoom();for(const J of g??[])if(!(Me&&(J.minZoom!=null&&J.minZoom>Me[0]||J.maxZoom!=null&&J.maxZoom<Me[0]))){if(J.type==="fixed")return J.coordinates.join(",");e:if(J.type==="client-geolocation"){if(Ce&&J.cachedLocationExpiry&&Ce.time+J.cachedLocationExpiry>Date.now()){if(!Ce.coords)break e;return Ce.coords}let Xe;try{return Xe=await new Promise((Gn,Bt)=>{ae.signal.addEventListener("abort",()=>{Bt(Error("aborted"))}),navigator.geolocation.getCurrentPosition(We=>{Gn([We.coords.longitude,We.coords.latitude].map(Qn=>Qn.toFixed(6)).join(","))},We=>{Bt(We)},J)}),Xe}catch{}finally{J.cachedLocationExpiry&&(Ce={time:Date.now(),coords:Xe})}if(ae.signal.aborted)return}if(J.type==="server-geolocation")return"ip";if(Me&&J.type==="map-center")return Me[1].toFixed(6)+","+Me[2].toFixed(6)}}const Rt=await Je();Rt&&K.set("proximity",Rt),(te||!_e)&&K.set("autocomplete","false"),K.set("fuzzyMatch",String(y))}O!==void 0&&(!Y||(ye==null?void 0:ye.length)===1)&&K.set("limit",String(O)),K.set("key",f),vt(K);const Q=Ge+"/"+encodeURIComponent(i)+".json?"+K.toString();if(Q===pt){N?(t(13,C=void 0),t(49,p=Ue[0])):t(13,C=Ue);return}pt=Q;const Lt=await fetch(Q,{signal:ae.signal,...Qe});if(!Lt.ok)throw new Error;const He=await Lt.json();ue("response",{url:Q,featureCollection:He}),N?(t(13,C=void 0),t(49,p=He.features[0]),Ue=[p]):(t(13,C=He.features.filter(L)),Ue=C,Y&&$.focus())}catch(Y){if(Y&&typeof Y=="object"&&"name"in Y&&Y.name==="AbortError")return;throw Y}finally{ae===be&&t(18,be=void 0)}}function Rn(){var te,ae,Y,K;if(!(D!=null&&D.length)||!W)return;const i=[180,90,-180,-90],N=!D.some(Q=>!Q.matching_text);for(const Q of D)(N||!Q.matching_text)&&(i[0]=Math.min(i[0],((te=Q.bbox)==null?void 0:te[0])??Q.center[0]),i[1]=Math.min(i[1],((ae=Q.bbox)==null?void 0:ae[1])??Q.center[1]),i[2]=Math.max(i[2],((Y=Q.bbox)==null?void 0:Y[2])??Q.center[0]),i[3]=Math.max(i[3],((K=Q.bbox)==null?void 0:K[3])??Q.center[1]));d&&D.length>0&&(p&&i[0]===i[2]&&i[1]===i[3]?d.flyTo(p.center,Ae):d.fitBounds(_t(i),50,Ee))}function Bn(i){t(0,w=I==="always"),kt(bn(i[0],[-180,180],!0).toFixed(6)+","+i[1].toFixed(6))}function En(i){if(!C)return;let N=i.key==="ArrowDown"?1:i.key==="ArrowUp"?-1:0;N?(Z===-1&&N===-1&&t(14,Z=C.length),t(14,Z+=N),Z>=C.length&&t(14,Z=-1),i.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(i.key)&&t(14,Z=-1)}function Ve(i=!0){if(t(17,ee=void 0),_e){if(Te&&clearTimeout(Te),a.length<b)return;const N=a;Te=window.setTimeout(()=>{De(N).catch(te=>t(17,ee=te))},i?R:0)}else t(13,C=void 0),t(17,ee=void 0)}function Ke(i){t(49,p=i),t(1,a=i.place_name),t(14,Z=-1)}const Cn=()=>$.focus();function Sn(i){Ze[i?"unshift":"push"](()=>{$=i,t(16,$)})}function In(){a=this.value,t(1,a),t(12,pe),t(26,m)}const zn=()=>t(12,pe=!0),Pn=()=>t(12,pe=!1),An=()=>Ve(),Un=()=>{t(1,a=""),$.focus()},jn=()=>t(0,w=!w),Wn=()=>t(17,ee=void 0),Zn=i=>t(14,Z=i),Nn=i=>Ke(i),Fn=()=>t(14,Z=-1),On=()=>{};return n.$$set=i=>{"class"in i&&t(2,s=i.class),"apiKey"in i&&t(24,f=i.apiKey),"bbox"in i&&t(25,h=i.bbox),"clearButtonTitle"in i&&t(3,c=i.clearButtonTitle),"clearOnBlur"in i&&t(26,m=i.clearOnBlur),"collapsed"in i&&t(4,v=i.collapsed),"country"in i&&t(27,_=i.country),"debounceSearch"in i&&t(28,R=i.debounceSearch),"enableReverse"in i&&t(5,I=i.enableReverse),"errorMessage"in i&&t(6,T=i.errorMessage),"filter"in i&&t(29,L=i.filter),"flyTo"in i&&t(30,W=i.flyTo),"fuzzyMatch"in i&&t(31,y=i.fuzzyMatch),"language"in i&&t(32,F=i.language),"limit"in i&&t(33,O=i.limit),"mapController"in i&&t(34,d=i.mapController),"minLength"in i&&t(35,b=i.minLength),"noResultsMessage"in i&&t(7,B=i.noResultsMessage),"placeholder"in i&&t(8,E=i.placeholder),"proximity"in i&&t(36,g=i.proximity),"reverseActive"in i&&t(0,w=i.reverseActive),"reverseButtonTitle"in i&&t(9,x=i.reverseButtonTitle),"searchValue"in i&&t(1,a=i.searchValue),"showFullGeometry"in i&&t(37,A=i.showFullGeometry),"showPlaceType"in i&&t(10,ie=i.showPlaceType),"showResultsWhileTyping"in i&&t(38,_e=i.showResultsWhileTyping),"types"in i&&t(39,ye=i.types),"zoom"in i&&t(40,Ae=i.zoom),"maxZoom"in i&&t(41,Ee=i.maxZoom),"apiUrl"in i&&t(42,Ge=i.apiUrl),"fetchParameters"in i&&t(43,Qe=i.fetchParameters),"iconsBaseUrl"in i&&t(11,wt=i.iconsBaseUrl),"$$scope"in i&&t(52,u=i.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&67112960&&setTimeout(()=>{t(15,je=pe),m&&!pe&&t(1,a="")}),n.$$.dirty[0]&8194|n.$$.dirty[1]&16&&a.length<b&&(t(49,p=void 0),t(13,C=void 0),t(17,ee=void 0),t(48,D=C)),n.$$.dirty[1]&262208&&A&&p&&!p.address&&p.geometry.type==="Point"&&De(p.id,{byId:!0}).catch(i=>t(17,ee=i)),n.$$.dirty[0]&1073741824|n.$$.dirty[1]&787976&&(d&&p&&p.id!==qe&&W&&(!p.bbox||p.bbox[0]===p.bbox[2]&&p.bbox[1]===p.bbox[3]?d.flyTo(p.center,p.id.startsWith("poi.")||p.id.startsWith("address.")?Ee:Ae):d.fitBounds(_t(p.bbox),50,Ee),t(13,C=void 0),t(48,D=void 0),t(14,Z=-1)),t(50,qe=p==null?void 0:p.id)),n.$$.dirty[0]&8192|n.$$.dirty[1]&131072&&D!==C&&t(48,D=void 0),n.$$.dirty[1]&393224&&d&&d.setMarkers(D,p),n.$$.dirty[0]&2&&t(14,Z=-1),n.$$.dirty[0]&40961|n.$$.dirty[1]&8&&d&&d.setEventHandler(i=>{switch(i.type){case"mapClick":w&&Bn(i.coordinates);break;case"markerClick":{const N=C==null?void 0:C.find(te=>te.id===i.id);N&&Ke(N)}break;case"markerMouseEnter":t(14,Z=je?(C==null?void 0:C.findIndex(N=>N.id===i.id))??-1:-1);break;case"markerMouseLeave":t(14,Z=-1);break}}),n.$$.dirty[0]&16384|n.$$.dirty[1]&8&&(d==null||d.setSelectedMarker(Z)),n.$$.dirty[0]&24576&&t(51,r=C==null?void 0:C[Z]),n.$$.dirty[0]&2|n.$$.dirty[1]&8){const i=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(a);d==null||d.setReverseMarker(i?[Number(i[1]),Number(i[2])]:void 0)}n.$$.dirty[1]&1048576&&ue("select",r),n.$$.dirty[1]&262144&&ue("pick",p),n.$$.dirty[0]&40960&&ue("optionsVisibilityChange",je&&!!C),n.$$.dirty[0]&8192&&ue("featuresListed",C),n.$$.dirty[1]&131072&&ue("featuresMarked",D),n.$$.dirty[0]&1&&ue("reverseToggle",w),n.$$.dirty[0]&2&&ue("queryChange",a),n.$$.dirty[0]&1|n.$$.dirty[1]&8&&d&&d.indicateReverse(w)},[w,a,s,c,v,I,T,B,E,x,ie,wt,pe,C,Z,je,$,ee,be,Ln,Tt,En,Ve,Ke,f,h,m,_,R,L,W,y,F,O,d,b,g,A,_e,ye,Ae,Ee,Ge,Qe,vt,Tn,Mn,kt,D,p,qe,r,u,l,Cn,Sn,In,zn,Pn,An,Un,jn,Wn,Zn,Nn,Fn,On]}class vn extends ge{constructor(e){super(),me(this,e,wn,yn,de,{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,adjustQuery:44,focus:45,blur:46,setQuery:47},null,[-1,-1,-1])}get adjustQuery(){return this.$$.ctx[44]}get focus(){return this.$$.ctx[45]}get blur(){return this.$$.ctx[46]}get setQuery(){return this.$$.ctx[47]}}const yt=["featuresListed","featuresMarked","optionsVisibilityChange","pick","queryChange","response","reverseToggle","select"],kn=["apiKey","bbox","clearButtonTitle","clearOnBlur","collapsed","country","debounceSearch","enableReverse","reverseActive","errorMessage","filter","fuzzyMatch","language","limit","minLength","noResultsMessage","placeholder","proximity","reverseButtonTitle","showFullGeometry","showPlaceType","showResultsWhileTyping","adjustQuery","types","zoom","mapController"];function bt(n){return"on"+n[0].toUpperCase()+n.slice(1)}const pn=U.forwardRef(function(e,t){const r=U.useRef(),l=U.useRef(),u={...e};for(const s of yt)delete u[bt(s)];U.useEffect(()=>{if(!r.current)throw new Error;const s=new vn({target:r.current,props:u});return l.current=s,()=>s.$destroy()},[]);for(const s of kn)U.useEffect(()=>{l.current&&e[s]!==void 0&&l.current.$set({[s]:e[s]})},[e[s]]);for(const s of yt){const f=e[bt(s)];U.useEffect(()=>{var h;return f&&((h=l.current)==null?void 0:h.$on(s,c=>{f(c.detail)}))},[f])}return U.useImperativeHandle(t,()=>({setQuery:(s,f=!0)=>{var h;return(h=l.current)==null?void 0:h.setQuery(s,f)},focus:()=>{var s;return(s=l.current)==null?void 0:s.focus()},blur:()=>{var s;return(s=l.current)==null?void 0:s.blur()}})),U.createElement("div",{ref:r})});H.GeocodingControl=pn,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=react.umd.cjs.map
|