From 5114adb014fa92c9cf5fd284f93de72dcec7e9de Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 13 Dec 2025 11:49:20 +0100 Subject: [PATCH] Rebundle latest version --- dist/build/bundle.js | 10 +++++----- dist/build/bundle.js.map | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/build/bundle.js b/dist/build/bundle.js index 56d8732..947f39f 100644 --- a/dist/build/bundle.js +++ b/dist/build/bundle.js @@ -1,25 +1,25 @@ -var app=function(){"use strict";var t=!1,e=Array.isArray,i=Array.prototype.indexOf,n=Array.from,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,a=Object.prototype,l=Array.prototype,c=Object.getPrototypeOf,h=Object.isExtensible;const u=()=>{};function d(t){return t()}function p(t){for(var e=0;e{t=i,e=n})),resolve:t,reject:e}}const _=16,m=32,g=64,v=128,y=512,b=1024,w=2048,x=4096,P=8192,T=16384,k=32768,M=65536,C=1<<17,E=1<<18,A=1<<19,S=32768,O=1<<21,z=1<<23,I=Symbol("$state"),D=Symbol("legacy props"),N=Symbol(""),B=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};const Z=Symbol();function j(t){return t===this.v}function R(t){return e=t,i=this.v,!(e!=e?i==i:e!==i||null!==e&&"object"==typeof e||"function"==typeof e);var e,i}let $=!1;let F=null;function q(t){F=t}function H(t,e=!1,i){F={p:F,i:!1,c:null,e:null,s:t,x:null,l:$&&!e?{s:null,u:null,$:[]}:null}}function W(t){var e=F,i=e.e;if(null!==i)for(var n of(e.e=null,i))oe(n);return e.i=!0,F=e.p,{}}function U(){return!$||null!==F&&null===F.l}let V=[];function K(){var t=V;V=[],p(t)}function G(t){if(0===V.length&&!rt){var e=V;queueMicrotask((()=>{e===V&&K()}))}V.push(t)}function Y(){for(;V.length>0;)K()}function X(t){var e=Ce;if(null===e)return Te.f|=z,t;if(0===(e.f&k)){if(0===(e.f&v))throw t;e.b.error(t)}else J(t,e)}function J(t,e){for(;null!==e;){if(0!==(e.f&v))try{return void e.b.error(t)}catch(e){t=e}e=e.parent}throw t}const Q=new Set;let tt=null,et=null,it=null,nt=[],ot=null,st=!1,rt=!1;class at{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#i=0;#n=0;#o=null;#s=[];#r=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(t){nt=[],et=null,this.apply();var e={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of t)this.#a(i,e);this.is_fork||this.#l(),this.is_deferred()?(this.#c(e.effects),this.#c(e.render_effects),this.#c(e.block_effects)):(et=this,tt=null,ut(e.render_effects),ut(e.effects),et=null,this.#o?.resolve()),it=null}#a(t,e){t.f^=b;for(var i=t.first;null!==i;){var n=i.f,o=!!(96&n),s=o&&0!==(n&b)||0!==(n&P)||this.skipped_effects.has(i);if(0!==(i.f&v)&&i.b?.is_pending()&&(e={parent:e,effect:i,effects:[],render_effects:[],block_effects:[]}),!s&&null!==i.fn){o?i.f^=b:4&n?e.effects.push(i):Re(i)&&(0!==(i.f&_)&&e.block_effects.push(i),We(i));var r=i.first;if(null!==r){i=r;continue}}var a=i.parent;for(i=i.next;null===i&&null!==a;)a===e.effect&&(this.#c(e.effects),this.#c(e.render_effects),this.#c(e.block_effects),e=e.parent),i=a.next,a=a.parent}}#c(t){for(const e of t){(0!==(e.f&w)?this.#s:this.#r).push(e),this.#h(e.deps),Je(e,b)}}#h(t){if(null!==t)for(const e of t)2&e.f&&0!==(e.f&S)&&(e.f^=S,this.#h(e.deps))}capture(t,e){this.previous.has(t)||this.previous.set(t,e),0===(t.f&z)&&(this.current.set(t,t.v),it?.set(t,t.v))}activate(){tt=this,this.apply()}deactivate(){tt===this&&(tt=null,it=null)}flush(){if(this.activate(),nt.length>0){if(lt(),null!==tt&&tt!==this)return}else 0===this.#i&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#l(){if(0===this.#n){for(const t of this.#t)t();this.#t.clear()}0===this.#i&&this.#u()}#u(){if(Q.size>1){this.previous.clear();var t=it,e=!0,i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const t of Q){if(t===this){e=!1;continue}const o=[];for(const[i,n]of this.current){if(t.current.has(i)){if(!e||n===t.current.get(i))continue;t.current.set(i,n)}o.push(i)}if(0===o.length)continue;const s=[...t.current.keys()].filter((t=>!this.current.has(t)));if(s.length>0){var n=nt;nt=[];const e=new Set,r=new Map;for(const t of o)dt(t,s,e,r);if(nt.length>0){tt=t,t.apply();for(const e of nt)t.#a(e,i);t.deactivate()}nt=n}}tt=null,it=t}this.committed=!0,Q.delete(this)}increment(t){this.#i+=1,t&&(this.#n+=1)}decrement(t){this.#i-=1,t&&(this.#n-=1),this.revive()}revive(){for(const t of this.#s)Je(t,w),ft(t);for(const t of this.#r)Je(t,x),ft(t);this.#s=[],this.#r=[],this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#o??=f()).promise}static ensure(){if(null===tt){const t=tt=new at;Q.add(tt),rt||at.enqueue((()=>{tt===t&&t.flush()}))}return tt}static enqueue(t){G(t)}apply(){}}function lt(){var e=we;st=!0;try{var i=0;for(xe(!0);nt.length>0;){var n=at.ensure();if(i++>1e3)t,ct();n.process(nt),At.clear()}}finally{st=!1,xe(e),ot=null}}function ct(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){J(t,ot)}}let ht=null;function ut(t){var e=t.length;if(0!==e){for(var i=0;i0)){At.clear();for(const t of ht){if(24576&t.f)continue;const e=[t];let i=t.parent;for(;null!==i;)ht.has(i)&&(ht.delete(i),e.push(i)),i=i.parent;for(let t=e.length-1;t>=0;t--){const i=e[t];24576&i.f||We(i)}}ht.clear()}}ht=null}}function dt(t,e,i,n){if(!i.has(t)&&(i.add(t),null!==t.reactions))for(const o of t.reactions){const t=o.f;2&t?dt(o,e,i,n):4194320&t&&0===(t&w)&&pt(o,e,n)&&(Je(o,w),ft(o))}}function pt(t,e,i){const n=i.get(t);if(void 0!==n)return n;if(null!==t.deps)for(const n of t.deps){if(e.includes(n))return!0;if(2&n.f&&pt(n,e,i))return i.set(n,!0),!0}return i.set(t,!1),!1}function ft(t){for(var e=ot=t;null!==e.parent;){var i=(e=e.parent).f;if(st&&e===Ce&&0!==(i&_)&&0===(i&E))return;if(96&i){if(0===(i&b))return;e.f^=b}}nt.push(e)}class _t{parent;#i=!1;#d;#p=null;#f;#_;#m;#g=null;#v=null;#y=null;#b=null;#w=null;#x=0;#L=0;#P=!1;#T=null;#k=function(t){let e,i=0,n=Ot(0);return()=>{ee()&&(Ve(n),re((()=>(0===i&&(e=Ye((()=>t((()=>Nt(n)))))),i+=1,()=>{G((()=>{i-=1,0===i&&(e?.(),e=void 0,Nt(n))}))}))))}}((()=>(this.#T=Ot(this.#x),()=>{this.#T=null})));constructor(t,e,i){this.#d=t,this.#f=e,this.#_=i,this.parent=Ce.b,this.#i=!!this.#f.pending,this.#m=le((()=>{Ce.b=this;var t=this.#M();try{this.#g=ce((()=>i(t)))}catch(t){this.error(t)}return this.#L>0?this.#C():this.#i=!1,()=>{this.#w?.remove()}}),589952)}#E(){try{this.#g=ce((()=>this.#_(this.#d)))}catch(t){this.error(t)}this.#i=!1}#A(){const t=this.#f.pending;t&&(this.#v=ce((()=>t(this.#d))),at.enqueue((()=>{var t=this.#M();this.#g=this.#S((()=>(at.ensure(),ce((()=>this.#_(t)))))),this.#L>0?this.#C():(_e(this.#v,(()=>{this.#v=null})),this.#i=!1)})))}#M(){var t=this.#d;return this.#i&&(this.#w=Ht(),this.#d.before(this.#w),t=this.#w),t}is_pending(){return this.#i||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#f.pending}#S(t){var e=Ce,i=Te,n=F;Ee(this.#m),Me(this.#m),q(this.#m.ctx);try{return t()}catch(t){return X(t),null}finally{Ee(e),Me(i),q(n)}}#C(){const t=this.#f.pending;null!==this.#g&&(this.#b=document.createDocumentFragment(),this.#b.append(this.#w),be(this.#g,this.#b)),null===this.#v&&(this.#v=ce((()=>t(this.#d))))}#O(t){this.has_pending_snippet()?(this.#L+=t,0===this.#L&&(this.#i=!1,this.#v&&_e(this.#v,(()=>{this.#v=null})),this.#b&&(this.#d.before(this.#b),this.#b=null))):this.parent&&this.parent.#O(t)}update_pending_count(t){this.#O(t),this.#x+=t,this.#T&&Dt(this.#T,this.#x)}get_effect_pending(){return this.#k(),Ve(this.#T)}error(t){var e=this.#f.onerror;let i=this.#f.failed;if(this.#P||!e&&!i)throw t;this.#g&&(de(this.#g),this.#g=null),this.#v&&(de(this.#v),this.#v=null),this.#y&&(de(this.#y),this.#y=null);var n=!1,o=!1;const s=()=>{n?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(n=!0,o&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),at.ensure(),this.#x=0,null!==this.#y&&_e(this.#y,(()=>{this.#y=null})),this.#i=this.has_pending_snippet(),this.#g=this.#S((()=>(this.#P=!1,ce((()=>this.#_(this.#d)))))),this.#L>0?this.#C():this.#i=!1)};var r=Te;try{Me(null),o=!0,e?.(t,s),o=!1}catch(t){J(t,this.#m&&this.#m.parent)}finally{Me(r)}i&&G((()=>{this.#y=this.#S((()=>{at.ensure(),this.#P=!0;try{return ce((()=>{i(this.#d,(()=>t),(()=>s))}))}catch(t){return J(t,this.#m.parent),null}finally{this.#P=!1}}))}))}}function mt(t,e){return e}function gt(t,i,o,s,r,a=null){var l=t,c=new Map,h=null,u=!!(1&i),d=!!(2&i);!(4&i)||(l=t.appendChild(Ht()));var p,f=null,_=Tt((()=>{var t=o();return e(t)?t:null==t?[]:n(t)})),m=!0;function g(){!function(t,e,i,o,s){var r,a,l,c,h,u=!!(8&o),d=e.length,p=t.items,f=t.first,_=null,m=[],g=[];if(u)for(h=0;h0){var k=4&o&&0===d?i:null;if(u){for(h=0;h{var s=0===n.length&&null!==i;if(s){var r=i,a=r.parentNode;a.textContent="",a.append(r),t.items.clear(),bt(t,e[0].prev,e[o-1].next)}for(var l=0;l{if(void 0!==a)for(c of a)c.a?.apply()}))}(y,p,l,i,s),null!==f&&(0===p.length?(f.fragment?(l.before(f.fragment),f.fragment=null):ve(f.effect),v.first=f.effect):_e(f.effect,(()=>{f=null})))}var v=le((()=>{for(var t=(p=Ve(_)).length,e=new Set,n=null,v=0;va(l)))};else{var x=document.createDocumentFragment(),L=Ht();x.append(L),f={fragment:x,effect:ce((()=>a(L)))}}m||g(),Ve(_)})),y={effect:v,items:c,first:h};m=!1}function vt(t,e,i,n,o,s,r,a){var l=!!(1&r)?!(16&r)?function(t,e=!1,i=!0){const n=Ot(t);e||(n.equals=R);$&&i&&null!==F&&null!==F.l&&(F.l.s??=[]).push(n);return n}(i,!1,!1):Ot(i):i,c=2&r?Ot(o):o,h={i:c,v:l,k:n,a:null,e:null,o:!1,prev:e,next:null};try{if(null===t)document.createDocumentFragment().append(t=Ht());return h.e=ce((()=>s(t,l,c,a))),null!==e&&(e.next=h),h}finally{}}function yt(t,e,i){for(var n=t.next?t.next.e.nodes_start:i,o=e?e.e.nodes_start:i,s=t.e.nodes_start;null!==s&&s!==n;){var r=Ut(s);o.before(s),s=r}}function bt(t,e,i){null===e?(t.first=i,t.effect.first=i&&i.e):(e.e.next&&(e.e.next.prev=null),e.next=i,e.e.next=i&&i.e),null===i?t.effect.last=e&&e.e:(i.e.prev&&(i.e.prev.next=null),i.prev=e,i.e.prev=e&&e.e)}function wt(t,e,i,n){const o=U()?Lt:Tt;if(0!==i.length||0!==t.length){var s=tt,r=Ce,a=function(){var t=Ce,e=Te,i=F,n=tt;return function(o=!0){Ee(t),Me(e),q(i),o&&n?.activate()}}();t.length>0?Promise.all(t).then((()=>{a();try{return l()}finally{s?.deactivate(),xt()}})):l()}else n(e.map(o));function l(){Promise.all(i.map((t=>function(t){let e=Ce;null===e&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=e.b,n=void 0,o=Ot(Z),s=!Te,r=new Map;return function(t){te(4718592,t,!0)}((()=>{var e=f();n=e.promise;try{Promise.resolve(t()).then(e.resolve,e.reject).then((()=>{a===tt&&a.committed&&a.deactivate(),xt()}))}catch(t){e.reject(t),xt()}var a=tt;if(s){var l=!i.is_pending();i.update_pending_count(1),a.increment(l),r.get(a)?.reject(B),r.delete(a),r.set(a,e)}const c=(t,e=void 0)=>{if(a.activate(),e)e!==B&&(o.f|=z,Dt(o,e));else{0!==(o.f&z)&&(o.f^=z),Dt(o,t);for(const[t,e]of r){if(r.delete(t),t===a)break;e.reject(B)}}s&&(i.update_pending_count(-1),a.decrement(l))};e.promise.then(c,(t=>c(null,t||"unknown")))})),ie((()=>{for(const t of r.values())t.reject(B)})),new Promise((t=>{function e(i){function s(){i===n?t(o):e(n)}i.then(s,s)}e(n)}))}(t)))).then((t=>{a();try{n([...e.map(o),...t])}catch(t){0===(r.f&T)&&J(t,r)}s?.deactivate(),xt()})).catch((t=>{J(t,r)}))}}function xt(){Ee(null),Me(null),q(null)}function Lt(t){var e=null!==Te&&2&Te.f?Te:null;null!==Ce&&(Ce.f|=A);return{ctx:F,deps:null,effects:null,equals:j,f:2050,fn:t,reactions:null,rv:0,v:Z,wv:0,parent:e??Ce,ac:null}}function Pt(t){const e=Lt(t);return Se(e),e}function Tt(t){const e=Lt(t);return e.equals=R,e}function kt(t){var e=t.effects;if(null!==e){t.effects=null;for(var i=0;i0&&!St&&function(){St=!1;var t=we;xe(!0);const e=Array.from(Et);try{for(const t of e)0!==(t.f&b)&&Je(t,x),Re(t)&&We(t)}finally{xe(t)}Et.clear()}()}return e}function Nt(t){It(t,t.v+1)}function Bt(t,e){var i=t.reactions;if(null!==i)for(var n=U(),o=i.length,s=0;s{if(Be===h)return t();var e=Te,i=Be;Me(null),Ze(h);var n=t();return Me(e),Ze(i),n};return o&&n.set("length",zt(t.length)),new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var o=n.get(e);return void 0===o?o=u((()=>{var t=zt(i.value);return n.set(e,t),t})):It(o,i.value,!0),!0},deleteProperty(t,e){var i=n.get(e);if(void 0===i){if(e in t){const t=u((()=>zt(Z)));n.set(e,t),Nt(r)}}else It(i,Z),Nt(r);return!0},get(e,i,o){if(i===I)return t;var r=n.get(i),a=i in e;if(void 0!==r||a&&!s(e,i)?.writable||(r=u((()=>zt(Zt(a?e[i]:Z)))),n.set(i,r)),void 0!==r){var l=Ve(r);return l===Z?void 0:l}return Reflect.get(e,i,o)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i&&"value"in i){var o=n.get(e);o&&(i.value=Ve(o))}else if(void 0===i){var s=n.get(e),r=s?.v;if(void 0!==s&&r!==Z)return{enumerable:!0,configurable:!0,value:r,writable:!0}}return i},has(t,e){if(e===I)return!0;var i=n.get(e),o=void 0!==i&&i.v!==Z||Reflect.has(t,e);if((void 0!==i||null!==Ce&&(!o||s(t,e)?.writable))&&(void 0===i&&(i=u((()=>zt(o?Zt(t[e]):Z))),n.set(e,i)),Ve(i)===Z))return!1;return o},set(t,e,i,a){var l=n.get(e),c=e in t;if(o&&"length"===e)for(var h=i;hzt(Z))),n.set(h+"",d))}void 0===l?c&&!s(t,e)?.writable||(It(l=u((()=>zt(void 0))),Zt(i)),n.set(e,l)):(c=l.v!==Z,It(l,u((()=>Zt(i)))));var p=Reflect.getOwnPropertyDescriptor(t,e);if(p?.set&&p.set.call(a,i),!c){if(o&&"string"==typeof e){var f=n.get("length"),_=Number(e);Number.isInteger(_)&&_>=f.v&&It(f,_+1)}Nt(r)}return!0},ownKeys(t){Ve(r);var e=Reflect.ownKeys(t).filter((t=>{var e=n.get(t);return void 0===e||e.v!==Z}));for(var[i,o]of n)o.v===Z||i in t||e.push(i);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function jt(t){try{if(null!==t&&"object"==typeof t&&I in t)return t[I]}catch{}return t}var Rt,$t,Ft,qt;function Ht(t=""){return document.createTextNode(t)}function Wt(t){return Ft.call(t)}function Ut(t){return qt.call(t)}function Vt(t,e){return Wt(t)}function Kt(t,e=!1){var i=Wt(t);return i instanceof Comment&&""===i.data?Ut(i):i}function Gt(t,e=1,i=!1){let n=t;for(;e--;)n=Ut(n);return n}let Yt=!1;function Xt(t){var e=Te,i=Ce;Me(null),Ee(null);try{return t()}finally{Me(e),Ee(i)}}function Jt(t,e,i,n=i){t.addEventListener(e,(()=>Xt(i)));const o=t.__on_r;t.__on_r=o?()=>{o(),n(!0)}:()=>n(!0),Yt||(Yt=!0,document.addEventListener("reset",(t=>{Promise.resolve().then((()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()}))}),{capture:!0}))}function Qt(t){null===Ce&&(null===Te&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),Le&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function te(t,e,i){var n=Ce;null!==n&&0!==(n.f&P)&&(t|=P);var o={ctx:F,deps:null,nodes_start:null,nodes_end:null,f:t|w|y,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(i)try{We(o),o.f|=k}catch(s){throw de(o),s}else null!==e&&ft(o);var s=o;if(i&&null===s.deps&&null===s.teardown&&null===s.nodes_start&&s.first===s.last&&0===(s.f&A)&&(s=s.first,0!==(t&_)&&0!==(t&M)&&null!==s&&(s.f|=M)),null!==s&&(s.parent=n,null!==n&&function(t,e){var i=e.last;null===i?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}(s,n),null!==Te&&2&Te.f&&0===(t&g))){var r=Te;(r.effects??=[]).push(s)}return o}function ee(){return null!==Te&&!ke}function ie(t){const e=te(8,null,!1);return Je(e,b),e.teardown=t,e}function ne(t){Qt();var e=Ce.f;if(!(!Te&&0!==(e&m)&&0===(e&k)))return oe(t);var i=F;(i.e??=[]).push(t)}function oe(t){return te(1048580,t,!1)}function se(t){return te(4,t,!1)}function re(t,e=0){return te(8|e,t,!0)}function ae(t,e=[],i=[],n=[]){wt(n,e,i,(e=>{te(8,(()=>t(...e.map(Ve))),!0)}))}function le(t,e=0){return te(_|e,t,!0)}function ce(t){return te(524320,t,!0)}function he(t){var e=t.teardown;if(null!==e){const t=Le,i=Te;Pe(!0),Me(null);try{e.call(null)}finally{Pe(t),Me(i)}}}function ue(t,e=!1){var i=t.first;for(t.first=t.last=null;null!==i;){const t=i.ac;null!==t&&Xt((()=>{t.abort(B)}));var n=i.next;0!==(i.f&g)?i.parent=null:de(i,e),i=n}}function de(t,e=!0){var i=!1;!e&&0===(t.f&E)||null===t.nodes_start||null===t.nodes_end||(pe(t.nodes_start,t.nodes_end),i=!0),ue(t,e&&!i),He(t,0),Je(t,T);var n=t.transitions;if(null!==n)for(const t of n)t.stop();he(t);var o=t.parent;null!==o&&null!==o.first&&fe(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function pe(t,e){for(;null!==t;){var i=t===e?null:Ut(t);t.remove(),t=i}}function fe(t){var e=t.parent,i=t.prev,n=t.next;null!==i&&(i.next=n),null!==n&&(n.prev=i),null!==e&&(e.first===t&&(e.first=n),e.last===t&&(e.last=i))}function _e(t,e,i=!0){var n=[];ge(t,n,!0),me(n,(()=>{i&&de(t),e&&e()}))}function me(t,e){var i=t.length;if(i>0){var n=()=>--i||e();for(var o of t)o.out(n)}else e()}function ge(t,e,i){if(0===(t.f&P)){if(t.f^=P,null!==t.transitions)for(const n of t.transitions)(n.is_global||i)&&e.push(n);for(var n=t.first;null!==n;){var o=n.next;ge(n,e,!!(0!==(n.f&M)||0!==(n.f&m)&&0!==(t.f&_))&&i),n=o}}}function ve(t){ye(t,!0)}function ye(t,e){if(0!==(t.f&P)){t.f^=P,0===(t.f&b)&&(Je(t,w),ft(t));for(var i=t.first;null!==i;){var n=i.next;ye(i,!!(0!==(i.f&M)||0!==(i.f&m))&&e),i=n}if(null!==t.transitions)for(const i of t.transitions)(i.is_global||e)&&i.in()}}function be(t,e){for(var i=t.nodes_start,n=t.nodes_end;null!==i;){var o=i===n?null:Ut(i);e.append(i),i=o}}let we=!1;function xe(t){we=t}let Le=!1;function Pe(t){Le=t}let Te=null,ke=!1;function Me(t){Te=t}let Ce=null;function Ee(t){Ce=t}let Ae=null;function Se(t){null!==Te&&(null===Ae?Ae=[t]:Ae.push(t))}let Oe=null,ze=0,Ie=null;let De=1,Ne=0,Be=Ne;function Ze(t){Be=t}function je(){return++De}function Re(t){var e=t.f;if(0!==(e&w))return!0;if(2&e&&(t.f&=-32769),0!==(e&x)){var i=t.deps;if(null!==i)for(var n=i.length,o=0;ot.wv)return!0}0!==(e&y)&&null===it&&Je(t,b)}return!1}function $e(t,e,i=!0){var n=t.reactions;if(null!==n&&!Ae?.includes(t))for(var o=0;o{t.ac.abort(B)})),t.ac=null);try{t.f|=O;var h=(0,t.fn)(),u=t.deps;if(null!==Oe){var d;if(He(t,ze),null!==u&&ze>0)for(u.length=ze+Oe.length,d=0;di?.call(this,t)))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?G((()=>{e.addEventListener(t,o,n)})):e.addEventListener(t,o,n),o}(t,e,i,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ie((()=>{e.removeEventListener(t,r,s)}))}function si(t){for(var e=0;er||i});var u=Te,d=Ce;Me(null),Ee(null);try{for(var p,f=[];null!==r;){var _=r.assignedSlot||r.parentNode||r.host||null;try{var m=r["__"+n];null==m||r.disabled&&t.target!==r||m.call(r,t)}catch(t){p?f.push(t):p=t}if(t.cancelBubble||_===e||null===_)break;r=_}if(p){for(let t of f)queueMicrotask((()=>{throw t}));throw p}}finally{t.__root=e,delete t.currentTarget,Me(u),Ee(d)}}}function li(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("","\x3c!----\x3e"),e.content}function ci(t,e){var i=Ce;null===i.nodes_start&&(i.nodes_start=t,i.nodes_end=e)}function hi(t,e){var i,n=!!(1&e),o=!!(2&e),s=!t.startsWith("");return()=>{void 0===i&&(i=li(s?t:""+t),n||(i=Wt(i)));var e=o||$t?document.importNode(i,!0):i.cloneNode(!0);n?ci(Wt(e),e.lastChild):ci(e,e);return e}}function ui(t=""){var e=Ht(t+"");return ci(e,e),e}function di(){var t=document.createDocumentFragment(),e=document.createComment(""),i=Ht();return t.append(e,i),ci(e,i),t}function pi(t,e){null!==t&&t.before(e)}function fi(t,e){var i=null==e?"":"object"==typeof e?e+"":e;i!==(t.__t??=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}const _i=new Map;let mi=new WeakMap;class gi{anchor;#z=new Map;#I=new Map;#D=new Map;#N=new Set;#B=!0;constructor(t,e=!0){this.anchor=t,this.#B=e}#u=()=>{var t=tt;if(this.#z.has(t)){var e=this.#z.get(t),i=this.#I.get(e);if(i)ve(i),this.#N.delete(e);else{var n=this.#D.get(e);n&&(this.#I.set(e,n.effect),this.#D.delete(e),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[e,i]of this.#z){if(this.#z.delete(e),e===t)break;const n=this.#D.get(i);n&&(de(n.effect),this.#D.delete(i))}for(const[t,n]of this.#I){if(t===e||this.#N.has(t))continue;const o=()=>{if(Array.from(this.#z.values()).includes(t)){var e=document.createDocumentFragment();be(n,e),e.append(Ht()),this.#D.set(t,{effect:n,fragment:e})}else de(n);this.#N.delete(t),this.#I.delete(t)};this.#B||!i?(this.#N.add(t),_e(n,o,!1)):o()}}};#Z=t=>{this.#z.delete(t);const e=Array.from(this.#z.values());for(const[t,i]of this.#D)e.includes(t)||(de(i.effect),this.#D.delete(t))};ensure(t,e){var i=tt;!e||this.#I.has(t)||this.#D.has(t)||this.#I.set(t,ce((()=>e(this.anchor))));this.#z.set(i,t),this.#u()}}function vi(t,e,i=!1){var n=new gi(t);function o(t,e){n.ensure(t,e)}le((()=>{var t=!1;e(((e,i=!0)=>{t=!0,o(i,e)})),t||o(!1,null)}),i?M:0)}function yi(t,e,...i){var n=new gi(t);le((()=>{const t=e()??null;n.ensure(t,t&&(e=>t(e,...i)))}),M)}function bi(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e=0;){var a=r+s;0!==r&&!xi.includes(n[r-1])||a!==n.length&&!xi.includes(n[a])?r=a:n=(0===r?"":n.substring(0,r))+n.substring(a+1)}return""===n?null:n}(i,n,s);null==a?t.removeAttribute("class"):t.className=a,t.__className=i}else if(s&&o!==s)for(var l in s){var c=!!s[l];null!=o&&c===!!o[l]||t.classList.toggle(l,c)}return s}function Ti(t,e={},i,n){for(var o in i){var s=i[o];e[o]!==s&&(null==i[o]?t.style.removeProperty(o):t.style.setProperty(o,s,n))}}function ki(t,e,i,n){if(t.__style!==e){var o=function(t,e){if(e){var i,n,o="";return Array.isArray(e)?(i=e[0],n=e[1]):i=e,i&&(o+=Li(i)),n&&(o+=Li(n,!0)),""===(o=o.trim())?null:o}return String(t)}(e,n);null==o?t.removeAttribute("style"):t.style.cssText=o,t.__style=e}else n&&(Array.isArray(n)?(Ti(t,i?.[0],n[0]),Ti(t,i?.[1],n[1],"important")):Ti(t,i,n));return n}function Mi(t,i,n=!1){if(t.multiple){if(null==i)return;if(!e(i))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var o of t.options)o.selected=i.includes(Ei(o))}else{for(o of t.options){var s=Ei(o);if(r=s,a=i,Object.is(jt(r),jt(a)))return void(o.selected=!0)}var r,a;n&&void 0===i||(t.selectedIndex=-1)}}function Ci(t,e,i=e){var n=new WeakSet,o=!0;Jt(t,"change",(e=>{var o,s=e?"[selected]":":checked";if(t.multiple)o=[].map.call(t.querySelectorAll(s),Ei);else{var r=t.querySelector(s)??t.querySelector("option:not([disabled])");o=r&&Ei(r)}i(o),null!==tt&&n.add(tt)})),se((()=>{var s=e();if(t===document.activeElement){var r=et??tt;if(n.has(r))return}if(Mi(t,s,o),o&&void 0===s){var a=t.querySelector(":checked");null!==a&&(s=Ei(a),i(s))}t.__value=s,o=!1})),function(t){var e=new MutationObserver((()=>{Mi(t,t.__value)}));e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ie((()=>{e.disconnect()}))}(t)}function Ei(t){return"__value"in t?t.__value:t.value}const Ai=Symbol("is custom element"),Si=Symbol("is html");function Oi(t,e){var i=Di(t);i.value!==(i.value=e??void 0)&&(t.value!==e||0===e&&"PROGRESS"===t.nodeName)&&(t.value=e??"")}function zi(t,e){var i=Di(t);i.checked!==(i.checked=e??void 0)&&(t.checked=e)}function Ii(t,e,i,n){var o=Di(t);o[e]!==(o[e]=i)&&("loading"===e&&(t[N]=i),null==i?t.removeAttribute(e):"string"!=typeof i&&function(t){var e,i=t.getAttribute("is")||t.nodeName,n=Ni.get(i);if(n)return n;Ni.set(i,n=[]);var o=t,s=Element.prototype;for(;s!==o;){for(var a in e=r(o))e[a].set&&n.push(a);o=c(o)}return n}(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Di(t){return t.__attributes??={[Ai]:t.nodeName.includes("-"),[Si]:"http://www.w3.org/1999/xhtml"===t.namespaceURI}}var Ni=new Map;function Bi(t,e,i=e){var n=new WeakSet;Jt(t,"input",(async o=>{var s=o?t.defaultValue:t.value;if(s=Zi(t)?ji(s):s,i(s),null!==tt&&n.add(tt),await Ue(),s!==(s=e())){var r=t.selectionStart,a=t.selectionEnd,l=t.value.length;if(t.value=s??"",null!==a){var c=t.value.length;r===a&&a===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=r,t.selectionEnd=Math.min(a,c))}}})),null==Ye(e)&&t.value&&(i(Zi(t)?ji(t.value):t.value),null!==tt&&n.add(tt)),re((()=>{var i=e();if(t===document.activeElement){var o=et??tt;if(n.has(o))return}Zi(t)&&i===ji(t.value)||("date"!==t.type||i||t.value)&&i!==t.value&&(t.value=i??"")}))}function Zi(t){var e=t.type;return"number"===e||"range"===e}function ji(t){return""===t?null:+t}function Ri(t=!1){const e=F,i=e.l.u;if(!i)return;let n=()=>function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(I in t)Qe(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];"object"==typeof i&&i&&I in i&&Qe(i)}}(e.s);if(t){let t=0,i={};const o=Lt((()=>{let n=!1;const o=e.s;for(const t in o)o[t]!==i[t]&&(i[t]=o[t],n=!0);return n&&t++,t}));n=()=>Ve(o)}var o;i.b.length&&(o=()=>{$i(e,n),p(i.b)},Qt(),te(1048584,o,!0)),ne((()=>{const t=Ye((()=>i.m.map(d)));return()=>{for(const e of t)"function"==typeof e&&e()}})),i.a.length&&ne((()=>{$i(e,n),p(i.a)}))}function $i(t,e){if(t.l.s)for(const e of t.l.s)Ve(e);e()}let Fi=!1;function qi(t,e,i,n){var o,r,a=!$||!!(2&i),l=!!(8&i),c=!!(16&i),h=n,u=!0,d=()=>(u&&(u=!1,h=c?Ye(n):n),h);if(l){var p=I in t||D in t;o=s(t,e)?.set??(p&&e in t?i=>t[e]=i:void 0)}var f,_=!1;if(l?[r,_]=function(t){var e=Fi;try{return Fi=!1,[t(),Fi]}finally{Fi=e}}((()=>t[e])):r=t[e],void 0===r&&void 0!==n&&(r=d(),o&&(a&&function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),o(r))),f=a?()=>{var i=t[e];return void 0===i?d():(u=!0,i)}:()=>{var i=t[e];return void 0!==i&&(h=void 0),void 0===i?h:i},a&&!(4&i))return f;if(o){var m=t.$$legacy;return function(t,e){return arguments.length>0?(a&&e&&!m&&!_||o(e?f():t),t):f()}}var g=!1,v=(1&i?Lt:Tt)((()=>(g=!1,f())));l&&Ve(v);var y=Ce;return function(t,e){if(arguments.length>0){const i=e?Ve(v):a&&l?Zt(t):t;return It(v,i),g=!0,void 0!==h&&(h=i),t}return Le&&g||0!==(y.f&T)?v.v:Ve(v)}}function Hi(t){var e,i;null===F&&function(){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}(),$&&null!==F.l?(e=F,i=e.l,i.u??={a:[],b:[],m:[]}).m.push(t):ne((()=>{const e=Ye(t);if("function"==typeof e)return e}))}function Wi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5"),$=!0;var Ui,Vi={exports:{}}; +var app=function(){"use strict";var t=!1,e=Array.isArray,i=Array.prototype.indexOf,n=Array.from,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,a=Object.prototype,l=Array.prototype,c=Object.getPrototypeOf,h=Object.isExtensible;const u=()=>{};function d(t){return t()}function p(t){for(var e=0;e{t=i,e=n})),resolve:t,reject:e}}const _=16,m=32,g=64,v=128,y=512,b=1024,w=2048,x=4096,P=8192,T=16384,k=32768,M=65536,C=1<<17,E=1<<18,A=1<<19,S=1<<25,O=32768,z=1<<21,I=1<<23,D=Symbol("$state"),N=Symbol("legacy props"),B=Symbol(""),Z=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};const j=Symbol();function R(t){return t===this.v}function $(t){return e=t,i=this.v,!(e!=e?i==i:e!==i||null!==e&&"object"==typeof e||"function"==typeof e);var e,i}let F=!1;let q=null;function H(t){q=t}function W(t,e=!1,i){q={p:q,i:!1,c:null,e:null,s:t,x:null,l:F&&!e?{s:null,u:null,$:[]}:null}}function U(t){var e=q,i=e.e;if(null!==i)for(var n of(e.e=null,i))te(n);return e.i=!0,q=e.p,{}}function V(){return!F||null!==q&&null===q.l}let K=[];function G(){var t=K;K=[],p(t)}function Y(t){if(0===K.length&&!at){var e=K;queueMicrotask((()=>{e===K&&G()}))}K.push(t)}function X(){for(;K.length>0;)G()}function J(t){var e=Le;if(null===e)return be.f|=I,t;if(0===(e.f&k)){if(0===(e.f&v))throw t;e.b.error(t)}else Q(t,e)}function Q(t,e){for(;null!==e;){if(0!==(e.f&v))try{return void e.b.error(t)}catch(e){t=e}e=e.parent}throw t}const tt=new Set;let et=null,it=null,nt=null,ot=[],st=null,rt=!1,at=!1;class lt{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#i=0;#n=0;#o=null;#s=new Set;#r=new Set;skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(t){ot=[],it=null,this.apply();var e={parent:null,effect:null,effects:[],render_effects:[]};for(const i of t)this.#a(i,e);this.is_fork||this.#l(),this.is_deferred()?(this.#c(e.effects),this.#c(e.render_effects)):(it=this,et=null,dt(e.render_effects),dt(e.effects),it=null,this.#o?.resolve()),nt=null}#a(t,e){t.f^=b;for(var i=t.first;null!==i;){var n=i.f,o=!!(96&n),s=o&&0!==(n&b)||0!==(n&P)||this.skipped_effects.has(i);if(0!==(i.f&v)&&i.b?.is_pending()&&(e={parent:e,effect:i,effects:[],render_effects:[]}),!s&&null!==i.fn){o?i.f^=b:4&n?e.effects.push(i):De(i)&&(0!==(i.f&_)&&this.#s.add(i),Re(i));var r=i.first;if(null!==r){i=r;continue}}var a=i.parent;for(i=i.next;null===i&&null!==a;)a===e.effect&&(this.#c(e.effects),this.#c(e.render_effects),e=e.parent),i=a.next,a=a.parent}}#c(t){for(const e of t)0!==(e.f&w)?this.#s.add(e):0!==(e.f&x)&&this.#r.add(e),this.#h(e.deps),Ve(e,b)}#h(t){if(null!==t)for(const e of t)2&e.f&&0!==(e.f&O)&&(e.f^=O,this.#h(e.deps))}capture(t,e){this.previous.has(t)||this.previous.set(t,e),0===(t.f&I)&&(this.current.set(t,t.v),nt?.set(t,t.v))}activate(){et=this,this.apply()}deactivate(){et===this&&(et=null,nt=null)}flush(){if(this.activate(),ot.length>0){if(ct(),null!==et&&et!==this)return}else 0===this.#i&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#l(){if(0===this.#n){for(const t of this.#t)t();this.#t.clear()}0===this.#i&&this.#u()}#u(){if(tt.size>1){this.previous.clear();var t=nt,e=!0,i={parent:null,effect:null,effects:[],render_effects:[]};for(const t of tt){if(t===this){e=!1;continue}const o=[];for(const[i,n]of this.current){if(t.current.has(i)){if(!e||n===t.current.get(i))continue;t.current.set(i,n)}o.push(i)}if(0===o.length)continue;const s=[...t.current.keys()].filter((t=>!this.current.has(t)));if(s.length>0){var n=ot;ot=[];const e=new Set,r=new Map;for(const t of o)pt(t,s,e,r);if(ot.length>0){et=t,t.apply();for(const e of ot)t.#a(e,i);t.deactivate()}ot=n}}et=null,nt=t}this.committed=!0,tt.delete(this)}increment(t){this.#i+=1,t&&(this.#n+=1)}decrement(t){this.#i-=1,t&&(this.#n-=1),this.revive()}revive(){for(const t of this.#s)this.#r.delete(t),Ve(t,w),_t(t);for(const t of this.#r)Ve(t,x),_t(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#o??=f()).promise}static ensure(){if(null===et){const t=et=new lt;tt.add(et),at||lt.enqueue((()=>{et===t&&t.flush()}))}return et}static enqueue(t){Y(t)}apply(){}}function ct(){var e=me;rt=!0;try{var i=0;for(ge(!0);ot.length>0;){var n=lt.ensure();if(i++>1e3)t,ht();n.process(ot),kt.clear()}}finally{rt=!1,ge(e),st=null}}function ht(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){Q(t,st)}}let ut=null;function dt(t){var e=t.length;if(0!==e){for(var i=0;i0)){kt.clear();for(const t of ut){if(24576&t.f)continue;const e=[t];let i=t.parent;for(;null!==i;)ut.has(i)&&(ut.delete(i),e.push(i)),i=i.parent;for(let t=e.length-1;t>=0;t--){const i=e[t];24576&i.f||Re(i)}}ut.clear()}}ut=null}}function pt(t,e,i,n){if(!i.has(t)&&(i.add(t),null!==t.reactions))for(const o of t.reactions){const t=o.f;2&t?pt(o,e,i,n):4194320&t&&0===(t&w)&&ft(o,e,n)&&(Ve(o,w),_t(o))}}function ft(t,e,i){const n=i.get(t);if(void 0!==n)return n;if(null!==t.deps)for(const n of t.deps){if(e.includes(n))return!0;if(2&n.f&&ft(n,e,i))return i.set(n,!0),!0}return i.set(t,!1),!1}function _t(t){for(var e=st=t;null!==e.parent;){var i=(e=e.parent).f;if(rt&&e===Le&&0!==(i&_)&&0===(i&E))return;if(96&i){if(0===(i&b))return;e.f^=b}}ot.push(e)}class mt{parent;#i=!1;#d;#p=null;#f;#_;#m;#g=null;#v=null;#y=null;#b=null;#w=null;#x=0;#L=0;#P=!1;#T=null;#k=function(t){let e,i=0,n=Ct(0);return()=>{Xt()&&(Fe(n),ie((()=>(0===i&&(e=We((()=>t((()=>Ot(n)))))),i+=1,()=>{Y((()=>{i-=1,0===i&&(e?.(),e=void 0,Ot(n))}))}))))}}((()=>(this.#T=Ct(this.#x),()=>{this.#T=null})));constructor(t,e,i){this.#d=t,this.#f=e,this.#_=i,this.parent=Le.b,this.#i=!!this.#f.pending,this.#m=oe((()=>{Le.b=this;var t=this.#M();try{this.#g=se((()=>i(t)))}catch(t){this.error(t)}return this.#L>0?this.#C():this.#i=!1,()=>{this.#w?.remove()}}),589952)}#E(){try{this.#g=se((()=>this.#_(this.#d)))}catch(t){this.error(t)}this.#i=!1}#A(){const t=this.#f.pending;t&&(this.#v=se((()=>t(this.#d))),lt.enqueue((()=>{var t=this.#M();this.#g=this.#S((()=>(lt.ensure(),se((()=>this.#_(t)))))),this.#L>0?this.#C():(ue(this.#v,(()=>{this.#v=null})),this.#i=!1)})))}#M(){var t=this.#d;return this.#i&&(this.#w=Rt(),this.#d.before(this.#w),t=this.#w),t}is_pending(){return this.#i||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#f.pending}#S(t){var e=Le,i=be,n=q;Pe(this.#m),xe(this.#m),H(this.#m.ctx);try{return t()}catch(t){return J(t),null}finally{Pe(e),xe(i),H(n)}}#C(){const t=this.#f.pending;null!==this.#g&&(this.#b=document.createDocumentFragment(),this.#b.append(this.#w),_e(this.#g,this.#b)),null===this.#v&&(this.#v=se((()=>t(this.#d))))}#O(t){this.has_pending_snippet()?(this.#L+=t,0===this.#L&&(this.#i=!1,this.#v&&ue(this.#v,(()=>{this.#v=null})),this.#b&&(this.#d.before(this.#b),this.#b=null))):this.parent&&this.parent.#O(t)}update_pending_count(t){this.#O(t),this.#x+=t,this.#T&&St(this.#T,this.#x)}get_effect_pending(){return this.#k(),Fe(this.#T)}error(t){var e=this.#f.onerror;let i=this.#f.failed;if(this.#P||!e&&!i)throw t;this.#g&&(le(this.#g),this.#g=null),this.#v&&(le(this.#v),this.#v=null),this.#y&&(le(this.#y),this.#y=null);var n=!1,o=!1;const s=()=>{n?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(n=!0,o&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),lt.ensure(),this.#x=0,null!==this.#y&&ue(this.#y,(()=>{this.#y=null})),this.#i=this.has_pending_snippet(),this.#g=this.#S((()=>(this.#P=!1,se((()=>this.#_(this.#d)))))),this.#L>0?this.#C():this.#i=!1)};var r=be;try{xe(null),o=!0,e?.(t,s),o=!1}catch(t){Q(t,this.#m&&this.#m.parent)}finally{xe(r)}i&&Y((()=>{this.#y=this.#S((()=>{lt.ensure(),this.#P=!0;try{return se((()=>{i(this.#d,(()=>t),(()=>s))}))}catch(t){return Q(t,this.#m.parent),null}finally{this.#P=!1}}))}))}}function gt(t,e,i,n){const o=V()?yt:wt;if(0!==i.length||0!==t.length){var s=et,r=Le,a=function(){var t=Le,e=be,i=q,n=et;return function(o=!0){Pe(t),xe(e),H(i),o&&n?.activate()}}();t.length>0?Promise.all(t).then((()=>{a();try{return l()}finally{s?.deactivate(),vt()}})):l()}else n(e.map(o));function l(){Promise.all(i.map((t=>function(t){let e=Le;null===e&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=e.b,n=void 0,o=Ct(j),s=!be,r=new Map;return function(t){Yt(4718592,t,!0)}((()=>{var e=f();n=e.promise;try{Promise.resolve(t()).then(e.resolve,e.reject).then((()=>{a===et&&a.committed&&a.deactivate(),vt()}))}catch(t){e.reject(t),vt()}var a=et;if(s){var l=!i.is_pending();i.update_pending_count(1),a.increment(l),r.get(a)?.reject(Z),r.delete(a),r.set(a,e)}const c=(t,e=void 0)=>{if(a.activate(),e)e!==Z&&(o.f|=I,St(o,e));else{0!==(o.f&I)&&(o.f^=I),St(o,t);for(const[t,e]of r){if(r.delete(t),t===a)break;e.reject(Z)}}s&&(i.update_pending_count(-1),a.decrement(l))};e.promise.then(c,(t=>c(null,t||"unknown")))})),Jt((()=>{for(const t of r.values())t.reject(Z)})),new Promise((t=>{function e(i){function s(){i===n?t(o):e(n)}i.then(s,s)}e(n)}))}(t)))).then((t=>{a();try{n([...e.map(o),...t])}catch(t){0===(r.f&T)&&Q(t,r)}s?.deactivate(),vt()})).catch((t=>{Q(t,r)}))}}function vt(){Pe(null),xe(null),H(null)}function yt(t){var e=null!==be&&2&be.f?be:null;null!==Le&&(Le.f|=A);return{ctx:q,deps:null,effects:null,equals:R,f:2050,fn:t,reactions:null,rv:0,v:j,wv:0,parent:e??Le,ac:null}}function bt(t){const e=yt(t);return ke(e),e}function wt(t){const e=yt(t);return e.equals=$,e}function xt(t){var e=t.effects;if(null!==e){t.effects=null;for(var i=0;i0&&!Mt&&function(){Mt=!1;var t=me;ge(!0);const e=Array.from(Tt);try{for(const t of e)0!==(t.f&b)&&Ve(t,x),De(t)&&Re(t)}finally{ge(t)}Tt.clear()}()}return e}function Ot(t){At(t,t.v+1)}function zt(t,e){var i=t.reactions;if(null!==i)for(var n=V(),o=i.length,s=0;s{if(Oe===h)return t();var e=be,i=Oe;xe(null),ze(h);var n=t();return xe(e),ze(i),n};return o&&n.set("length",Et(t.length)),new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var o=n.get(e);return void 0===o?o=u((()=>{var t=Et(i.value);return n.set(e,t),t})):At(o,i.value,!0),!0},deleteProperty(t,e){var i=n.get(e);if(void 0===i){if(e in t){const t=u((()=>Et(j)));n.set(e,t),Ot(r)}}else At(i,j),Ot(r);return!0},get(e,i,o){if(i===D)return t;var r=n.get(i),a=i in e;if(void 0!==r||a&&!s(e,i)?.writable||(r=u((()=>Et(It(a?e[i]:j)))),n.set(i,r)),void 0!==r){var l=Fe(r);return l===j?void 0:l}return Reflect.get(e,i,o)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i&&"value"in i){var o=n.get(e);o&&(i.value=Fe(o))}else if(void 0===i){var s=n.get(e),r=s?.v;if(void 0!==s&&r!==j)return{enumerable:!0,configurable:!0,value:r,writable:!0}}return i},has(t,e){if(e===D)return!0;var i=n.get(e),o=void 0!==i&&i.v!==j||Reflect.has(t,e);if((void 0!==i||null!==Le&&(!o||s(t,e)?.writable))&&(void 0===i&&(i=u((()=>Et(o?It(t[e]):j))),n.set(e,i)),Fe(i)===j))return!1;return o},set(t,e,i,a){var l=n.get(e),c=e in t;if(o&&"length"===e)for(var h=i;hEt(j))),n.set(h+"",d))}void 0===l?c&&!s(t,e)?.writable||(At(l=u((()=>Et(void 0))),It(i)),n.set(e,l)):(c=l.v!==j,At(l,u((()=>It(i)))));var p=Reflect.getOwnPropertyDescriptor(t,e);if(p?.set&&p.set.call(a,i),!c){if(o&&"string"==typeof e){var f=n.get("length"),_=Number(e);Number.isInteger(_)&&_>=f.v&&At(f,_+1)}Ot(r)}return!0},ownKeys(t){Fe(r);var e=Reflect.ownKeys(t).filter((t=>{var e=n.get(t);return void 0===e||e.v!==j}));for(var[i,o]of n)o.v===j||i in t||e.push(i);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function Dt(t){try{if(null!==t&&"object"==typeof t&&D in t)return t[D]}catch{}return t}var Nt,Bt,Zt,jt;function Rt(t=""){return document.createTextNode(t)}function $t(t){return Zt.call(t)}function Ft(t){return jt.call(t)}function qt(t,e){return $t(t)}function Ht(t,e=!1){var i=$t(t);return i instanceof Comment&&""===i.data?Ft(i):i}function Wt(t,e=1,i=!1){let n=t;for(;e--;)n=Ft(n);return n}let Ut=!1;function Vt(t){var e=be,i=Le;xe(null),Pe(null);try{return t()}finally{xe(e),Pe(i)}}function Kt(t,e,i,n=i){t.addEventListener(e,(()=>Vt(i)));const o=t.__on_r;t.__on_r=o?()=>{o(),n(!0)}:()=>n(!0),Ut||(Ut=!0,document.addEventListener("reset",(t=>{Promise.resolve().then((()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()}))}),{capture:!0}))}function Gt(t){null===Le&&(null===be&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),ve&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function Yt(t,e,i){var n=Le;null!==n&&0!==(n.f&P)&&(t|=P);var o={ctx:q,deps:null,nodes:null,f:t|w|y,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(i)try{Re(o),o.f|=k}catch(s){throw le(o),s}else null!==e&&_t(o);var s=o;if(i&&null===s.deps&&null===s.teardown&&null===s.nodes&&s.first===s.last&&0===(s.f&A)&&(s=s.first,0!==(t&_)&&0!==(t&M)&&null!==s&&(s.f|=M)),null!==s&&(s.parent=n,null!==n&&function(t,e){var i=e.last;null===i?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}(s,n),null!==be&&2&be.f&&0===(t&g))){var r=be;(r.effects??=[]).push(s)}return o}function Xt(){return null!==be&&!we}function Jt(t){const e=Yt(8,null,!1);return Ve(e,b),e.teardown=t,e}function Qt(t){Gt();var e=Le.f;if(!(!be&&0!==(e&m)&&0===(e&k)))return te(t);var i=q;(i.e??=[]).push(t)}function te(t){return Yt(1048580,t,!1)}function ee(t){return Yt(4,t,!1)}function ie(t,e=0){return Yt(8|e,t,!0)}function ne(t,e=[],i=[],n=[]){gt(n,e,i,(e=>{Yt(8,(()=>t(...e.map(Fe))),!0)}))}function oe(t,e=0){return Yt(_|e,t,!0)}function se(t){return Yt(524320,t,!0)}function re(t){var e=t.teardown;if(null!==e){const t=ve,i=be;ye(!0),xe(null);try{e.call(null)}finally{ye(t),xe(i)}}}function ae(t,e=!1){var i=t.first;for(t.first=t.last=null;null!==i;){const t=i.ac;null!==t&&Vt((()=>{t.abort(Z)}));var n=i.next;0!==(i.f&g)?i.parent=null:le(i,e),i=n}}function le(t,e=!0){var i=!1;!e&&0===(t.f&E)||null===t.nodes||null===t.nodes.end||(ce(t.nodes.start,t.nodes.end),i=!0),ae(t,e&&!i),je(t,0),Ve(t,T);var n=t.nodes&&t.nodes.t;if(null!==n)for(const t of n)t.stop();re(t);var o=t.parent;null!==o&&null!==o.first&&he(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function ce(t,e){for(;null!==t;){var i=t===e?null:Ft(t);t.remove(),t=i}}function he(t){var e=t.parent,i=t.prev,n=t.next;null!==i&&(i.next=n),null!==n&&(n.prev=i),null!==e&&(e.first===t&&(e.first=n),e.last===t&&(e.last=i))}function ue(t,e,i=!0){var n=[];de(t,n,!0);var o=()=>{i&&le(t),e&&e()},s=n.length;if(s>0){var r=()=>--s||o();for(var a of n)a.out(r)}else o()}function de(t,e,i){if(0===(t.f&P)){t.f^=P;var n=t.nodes&&t.nodes.t;if(null!==n)for(const t of n)(t.is_global||i)&&e.push(t);for(var o=t.first;null!==o;){var s=o.next;de(o,e,!!(0!==(o.f&M)||0!==(o.f&m)&&0!==(t.f&_))&&i),o=s}}}function pe(t){fe(t,!0)}function fe(t,e){if(0!==(t.f&P)){t.f^=P,0===(t.f&b)&&(Ve(t,w),_t(t));for(var i=t.first;null!==i;){var n=i.next;fe(i,!!(0!==(i.f&M)||0!==(i.f&m))&&e),i=n}var o=t.nodes&&t.nodes.t;if(null!==o)for(const t of o)(t.is_global||e)&&t.in()}}function _e(t,e){if(t.nodes)for(var i=t.nodes.start,n=t.nodes.end;null!==i;){var o=i===n?null:Ft(i);e.append(i),i=o}}let me=!1;function ge(t){me=t}let ve=!1;function ye(t){ve=t}let be=null,we=!1;function xe(t){be=t}let Le=null;function Pe(t){Le=t}let Te=null;function ke(t){null!==be&&(null===Te?Te=[t]:Te.push(t))}let Me=null,Ce=0,Ee=null;let Ae=1,Se=0,Oe=Se;function ze(t){Oe=t}function Ie(){return++Ae}function De(t){var e=t.f;if(0!==(e&w))return!0;if(2&e&&(t.f&=-32769),0!==(e&x)){var i=t.deps;if(null!==i)for(var n=i.length,o=0;ot.wv)return!0}0!==(e&y)&&null===nt&&Ve(t,b)}return!1}function Ne(t,e,i=!0){var n=t.reactions;if(null!==n&&!Te?.includes(t))for(var o=0;o{t.ac.abort(Z)})),t.ac=null);try{t.f|=z;var h=(0,t.fn)(),u=t.deps;if(null!==Me){var d;if(je(t,Ce),null!==u&&Ce>0)for(u.length=Ce+Me.length,d=0;di?.call(this,t)))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?Y((()=>{e.addEventListener(t,o,n)})):e.addEventListener(t,o,n),o}(t,e,i,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Jt((()=>{e.removeEventListener(t,r,s)}))}function ti(t){for(var e=0;er||i});var u=be,d=Le;xe(null),Pe(null);try{for(var p,f=[];null!==r;){var _=r.assignedSlot||r.parentNode||r.host||null;try{var m=r["__"+n];null==m||r.disabled&&t.target!==r||m.call(r,t)}catch(t){p?f.push(t):p=t}if(t.cancelBubble||_===e||null===_)break;r=_}if(p){for(let t of f)queueMicrotask((()=>{throw t}));throw p}}finally{t.__root=e,delete t.currentTarget,xe(u),Pe(d)}}}function ni(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("","\x3c!----\x3e"),e.content}function oi(t,e){var i=Le;null===i.nodes&&(i.nodes={start:t,end:e,a:null,t:null})}function si(t,e){var i,n=!!(1&e),o=!!(2&e),s=!t.startsWith("");return()=>{void 0===i&&(i=ni(s?t:""+t),n||(i=$t(i)));var e=o||Bt?document.importNode(i,!0):i.cloneNode(!0);n?oi($t(e),e.lastChild):oi(e,e);return e}}function ri(t=""){var e=Rt(t+"");return oi(e,e),e}function ai(){var t=document.createDocumentFragment(),e=document.createComment(""),i=Rt();return t.append(e,i),oi(e,i),t}function li(t,e){null!==t&&t.before(e)}function ci(t,e){var i=null==e?"":"object"==typeof e?e+"":e;i!==(t.__t??=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}const hi=new Map;let ui=new WeakMap;class di{anchor;#z=new Map;#I=new Map;#D=new Map;#N=new Set;#B=!0;constructor(t,e=!0){this.anchor=t,this.#B=e}#u=()=>{var t=et;if(this.#z.has(t)){var e=this.#z.get(t),i=this.#I.get(e);if(i)pe(i),this.#N.delete(e);else{var n=this.#D.get(e);n&&(this.#I.set(e,n.effect),this.#D.delete(e),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[e,i]of this.#z){if(this.#z.delete(e),e===t)break;const n=this.#D.get(i);n&&(le(n.effect),this.#D.delete(i))}for(const[t,n]of this.#I){if(t===e||this.#N.has(t))continue;const o=()=>{if(Array.from(this.#z.values()).includes(t)){var e=document.createDocumentFragment();_e(n,e),e.append(Rt()),this.#D.set(t,{effect:n,fragment:e})}else le(n);this.#N.delete(t),this.#I.delete(t)};this.#B||!i?(this.#N.add(t),ue(n,o,!1)):o()}}};#Z=t=>{this.#z.delete(t);const e=Array.from(this.#z.values());for(const[t,i]of this.#D)e.includes(t)||(le(i.effect),this.#D.delete(t))};ensure(t,e){var i=et;!e||this.#I.has(t)||this.#D.has(t)||this.#I.set(t,se((()=>e(this.anchor))));this.#z.set(i,t),this.#u()}}function pi(t,e,i=!1){var n=new di(t);function o(t,e){n.ensure(t,e)}oe((()=>{var t=!1;e(((e,i=!0)=>{t=!0,o(i,e)})),t||o(!1,null)}),i?M:0)}function fi(t,e){return e}function _i(t,e=!0){for(var i=0;i{var t=o();return e(t)?t:null==t?[]:n(t)})),p=!0;function f(){m.fallback=u,function(t,e,i,o,s){var r,a,l,c,h,u=!!(8&o),d=e.length,p=t.items,f=t.effect.first,_=null,m=[],g=[];if(u)for(h=0;h0){var k=4&o&&0===d?i:null;if(u){for(h=0;h{if(o){if(o.pending.delete(i),o.done.add(i),0===o.pending.size){var e=t.outrogroups;_i(n(o.done)),e.delete(o),0===e.size&&(t.outrogroups=null)}}else r-=1}),!1)}if(0===r){var l=null!==i;if(l){var c=i,h=c.parentNode;h.textContent="",h.append(c),t.items.clear()}_i(e,!l)}else o={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(o)}(t,L,k)}}u&&Y((()=>{if(void 0!==a)for(c of a)c.nodes?.a?.apply()}))}(m,h,l,i,s),null!==u&&(0===h.length?0===(u.f&S)?pe(u):(u.f^=S,yi(u,null,l)):ue(u,(()=>{u=null})))}var _=oe((()=>{for(var t=(h=Fe(d)).length,e=new Set,n=0;na(l))):(u=se((()=>a(mi??=Rt())))).f|=S),p||f(),Fe(d)})),m={effect:_,items:c,outrogroups:null,fallback:u};p=!1}function vi(t,e,i,n,o,s,r,a){var l=1&r?16&r?Ct(i):function(t,e=!1,i=!0){const n=Ct(t);return e||(n.equals=$),F&&i&&null!==q&&null!==q.l&&(q.l.s??=[]).push(n),n}(i,!1,!1):null,c=2&r?Ct(o):null;return{v:l,i:c,e:se((()=>(s(e,l??i,c??o,a),()=>{t.delete(n)})))}}function yi(t,e,i){if(t.nodes)for(var n=t.nodes.start,o=t.nodes.end,s=e&&0===(e.f&S)?e.nodes.start:i;null!==n;){var r=Ft(n);if(s.before(n),n===o)return;n=r}}function bi(t,e,i){null===e?t.effect.first=i:e.next=i,null===i?t.effect.last=e:i.prev=e}function wi(t,e,...i){var n=new di(t);oe((()=>{const t=e()??null;n.ensure(t,t&&(e=>t(e,...i)))}),M)}function xi(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e=0;){var a=r+s;0!==r&&!Pi.includes(n[r-1])||a!==n.length&&!Pi.includes(n[a])?r=a:n=(0===r?"":n.substring(0,r))+n.substring(a+1)}return""===n?null:n}(i,n,s);null==a?t.removeAttribute("class"):t.className=a,t.__className=i}else if(s&&o!==s)for(var l in s){var c=!!s[l];null!=o&&c===!!o[l]||t.classList.toggle(l,c)}return s}function Mi(t,e={},i,n){for(var o in i){var s=i[o];e[o]!==s&&(null==i[o]?t.style.removeProperty(o):t.style.setProperty(o,s,n))}}function Ci(t,e,i,n){if(t.__style!==e){var o=function(t,e){if(e){var i,n,o="";return Array.isArray(e)?(i=e[0],n=e[1]):i=e,i&&(o+=Ti(i)),n&&(o+=Ti(n,!0)),""===(o=o.trim())?null:o}return String(t)}(e,n);null==o?t.removeAttribute("style"):t.style.cssText=o,t.__style=e}else n&&(Array.isArray(n)?(Mi(t,i?.[0],n[0]),Mi(t,i?.[1],n[1],"important")):Mi(t,i,n));return n}function Ei(t,i,n=!1){if(t.multiple){if(null==i)return;if(!e(i))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var o of t.options)o.selected=i.includes(Si(o))}else{for(o of t.options){var s=Si(o);if(r=s,a=i,Object.is(Dt(r),Dt(a)))return void(o.selected=!0)}var r,a;n&&void 0===i||(t.selectedIndex=-1)}}function Ai(t,e,i=e){var n=new WeakSet,o=!0;Kt(t,"change",(e=>{var o,s=e?"[selected]":":checked";if(t.multiple)o=[].map.call(t.querySelectorAll(s),Si);else{var r=t.querySelector(s)??t.querySelector("option:not([disabled])");o=r&&Si(r)}i(o),null!==et&&n.add(et)})),ee((()=>{var s=e();if(t===document.activeElement){var r=it??et;if(n.has(r))return}if(Ei(t,s,o),o&&void 0===s){var a=t.querySelector(":checked");null!==a&&(s=Si(a),i(s))}t.__value=s,o=!1})),function(t){var e=new MutationObserver((()=>{Ei(t,t.__value)}));e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Jt((()=>{e.disconnect()}))}(t)}function Si(t){return"__value"in t?t.__value:t.value}const Oi=Symbol("is custom element"),zi=Symbol("is html");function Ii(t,e){var i=Bi(t);i.value!==(i.value=e??void 0)&&(t.value!==e||0===e&&"PROGRESS"===t.nodeName)&&(t.value=e??"")}function Di(t,e){var i=Bi(t);i.checked!==(i.checked=e??void 0)&&(t.checked=e)}function Ni(t,e,i,n){var o=Bi(t);o[e]!==(o[e]=i)&&("loading"===e&&(t[B]=i),null==i?t.removeAttribute(e):"string"!=typeof i&&function(t){var e,i=t.getAttribute("is")||t.nodeName,n=Zi.get(i);if(n)return n;Zi.set(i,n=[]);var o=t,s=Element.prototype;for(;s!==o;){for(var a in e=r(o))e[a].set&&n.push(a);o=c(o)}return n}(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Bi(t){return t.__attributes??={[Oi]:t.nodeName.includes("-"),[zi]:"http://www.w3.org/1999/xhtml"===t.namespaceURI}}var Zi=new Map;function ji(t,e,i=e){var n=new WeakSet;Kt(t,"input",(async o=>{var s=o?t.defaultValue:t.value;if(s=Ri(t)?$i(s):s,i(s),null!==et&&n.add(et),await $e(),s!==(s=e())){var r=t.selectionStart,a=t.selectionEnd,l=t.value.length;if(t.value=s??"",null!==a){var c=t.value.length;r===a&&a===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=r,t.selectionEnd=Math.min(a,c))}}})),null==We(e)&&t.value&&(i(Ri(t)?$i(t.value):t.value),null!==et&&n.add(et)),ie((()=>{var i=e();if(t===document.activeElement){var o=it??et;if(n.has(o))return}Ri(t)&&i===$i(t.value)||("date"!==t.type||i||t.value)&&i!==t.value&&(t.value=i??"")}))}function Ri(t){var e=t.type;return"number"===e||"range"===e}function $i(t){return""===t?null:+t}function Fi(t=!1){const e=q,i=e.l.u;if(!i)return;let n=()=>function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(D in t)Ke(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];"object"==typeof i&&i&&D in i&&Ke(i)}}(e.s);if(t){let t=0,i={};const o=yt((()=>{let n=!1;const o=e.s;for(const t in o)o[t]!==i[t]&&(i[t]=o[t],n=!0);return n&&t++,t}));n=()=>Fe(o)}var o;i.b.length&&(o=()=>{qi(e,n),p(i.b)},Gt(),Yt(1048584,o,!0)),Qt((()=>{const t=We((()=>i.m.map(d)));return()=>{for(const e of t)"function"==typeof e&&e()}})),i.a.length&&Qt((()=>{qi(e,n),p(i.a)}))}function qi(t,e){if(t.l.s)for(const e of t.l.s)Fe(e);e()}let Hi=!1;function Wi(t,e,i,n){var o,r,a=!F||!!(2&i),l=!!(8&i),c=!!(16&i),h=n,u=!0,d=()=>(u&&(u=!1,h=c?We(n):n),h);if(l){var p=D in t||N in t;o=s(t,e)?.set??(p&&e in t?i=>t[e]=i:void 0)}var f,_=!1;if(l?[r,_]=function(t){var e=Hi;try{return Hi=!1,[t(),Hi]}finally{Hi=e}}((()=>t[e])):r=t[e],void 0===r&&void 0!==n&&(r=d(),o&&(a&&function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),o(r))),f=a?()=>{var i=t[e];return void 0===i?d():(u=!0,i)}:()=>{var i=t[e];return void 0!==i&&(h=void 0),void 0===i?h:i},a&&!(4&i))return f;if(o){var m=t.$$legacy;return function(t,e){return arguments.length>0?(a&&e&&!m&&!_||o(e?f():t),t):f()}}var g=!1,v=(1&i?yt:wt)((()=>(g=!1,f())));l&&Fe(v);var y=Le;return function(t,e){if(arguments.length>0){const i=e?Fe(v):a&&l?It(t):t;return At(v,i),g=!0,void 0!==h&&(h=i),t}return ve&&g||0!==(y.f&T)?v.v:Fe(v)}}function Ui(t){var e,i;null===q&&function(){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}(),F&&null!==q.l?(e=q,i=e.l,i.u??={a:[],b:[],m:[]}).m.push(t):Qt((()=>{const e=We(t);if("function"==typeof e)return e}))}function Vi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5"),F=!0;var Ki,Gi={exports:{}}; /*! * Bootstrap v5.3.8 (https://getbootstrap.com/) * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */Ui||(Ui=1,Vi.exports=function(){const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const o=t.get(e);o.has(i)||0===o.size?o.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i=1e6,n=1e3,o="transitionend",s=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),r=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),a=t=>{do{t+=Math.floor(Math.random()*i)}while(document.getElementById(t));return t},l=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const o=Number.parseFloat(e),s=Number.parseFloat(i);return o||s?(e=e.split(",")[0],i=i.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(i))*n):0},c=t=>{t.dispatchEvent(new Event(o))},h=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),u=t=>h(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(s(t)):null,d=t=>{if(!h(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},p=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),f=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?f(t.parentNode):null},_=()=>{},m=t=>{t.offsetHeight},g=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,v=[],y=t=>{"loading"===document.readyState?(v.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of v)t()})),v.push(t)):t()},b=()=>"rtl"===document.documentElement.dir,w=t=>{y((()=>{const e=g();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}}))},x=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,L=(t,e,i=!0)=>{if(!i)return void x(t);const n=5,s=l(e)+n;let r=!1;const a=({target:i})=>{i===e&&(r=!0,e.removeEventListener(o,a),x(t))};e.addEventListener(o,a),setTimeout((()=>{r||c(e)}),s)},P=(t,e,i,n)=>{const o=t.length;let s=t.indexOf(e);return-1===s?!i&&n?t[o-1]:t[0]:(s+=i?1:-1,n&&(s=(s+o)%o),t[Math.max(0,Math.min(s,o-1))])},T=/[^.]*(?=\..*)\.|.*/,k=/\..*/,M=/::\d+$/,C={};let E=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},S=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function z(t){const e=O(t);return t.uidEvent=e,C[e]=C[e]||{},C[e]}function I(t,e){return function i(n){return q(n,{delegateTarget:t}),i.oneOff&&F.off(t,n.type,e),e.apply(t,[n])}}function D(t,e,i){return function n(o){const s=t.querySelectorAll(e);for(let{target:r}=o;r&&r!==this;r=r.parentNode)for(const a of s)if(a===r)return q(o,{delegateTarget:r}),n.oneOff&&F.off(t,o.type,e,i),i.apply(r,[o])}}function N(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function B(t,e,i){const n="string"==typeof e,o=n?i:e||i;let s=$(t);return S.has(s)||(s=t),[n,o,s]}function Z(t,e,i,n,o){if("string"!=typeof e||!t)return;let[s,r,a]=B(e,i,n);if(e in A){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=z(t),c=l[a]||(l[a]={}),h=N(c,r,s?i:null);if(h)return void(h.oneOff=h.oneOff&&o);const u=O(r,e.replace(T,"")),d=s?D(t,i,r):I(t,r);d.delegationSelector=s?i:null,d.callable=r,d.oneOff=o,d.uidEvent=u,c[u]=d,t.addEventListener(a,d,s)}function j(t,e,i,n,o){const s=N(e[i],n,o);s&&(t.removeEventListener(i,s,Boolean(o)),delete e[i][s.uidEvent])}function R(t,e,i,n){const o=e[i]||{};for(const[s,r]of Object.entries(o))s.includes(n)&&j(t,e,i,r.callable,r.delegationSelector)}function $(t){return t=t.replace(k,""),A[t]||t}const F={on(t,e,i,n){Z(t,e,i,n,!1)},one(t,e,i,n){Z(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[o,s,r]=B(e,i,n),a=r!==e,l=z(t),c=l[r]||{},h=e.startsWith(".");if(void 0===s){if(h)for(const i of Object.keys(l))R(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const o=i.replace(M,"");a&&!e.includes(o)||j(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;j(t,l,r,s,o?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=g();let o=null,s=!0,r=!0,a=!1;e!==$(e)&&n&&(o=n.Event(e,i),n(t).trigger(o),s=!o.isPropagationStopped(),r=!o.isImmediatePropagationStopped(),a=o.isDefaultPrevented());const l=q(new Event(e,{bubbles:s,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&o&&o.preventDefault(),l}};function q(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function H(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function W(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const U={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${W(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${W(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=H(t.dataset[n])}return e},getDataAttribute:(t,e)=>H(t.getAttribute(`data-bs-${W(e)}`))};class V{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=h(e)?U.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...h(e)?U.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,n]of Object.entries(e)){const e=t[i],o=h(e)?"element":r(e);if(!new RegExp(n).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${o}" but expected type "${n}".`)}}}const K="5.3.8";class G extends V{constructor(t,i){super(),(t=u(t))&&(this._element=t,this._config=this._getConfig(i),e.set(this._element,this.constructor.DATA_KEY,this))}dispose(){e.remove(this._element,this.constructor.DATA_KEY),F.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){L(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return e.get(u(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return K}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const Y=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map((t=>s(t))).join(","):null},X={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!p(t)&&d(t)))},getSelectorFromElement(t){const e=Y(t);return e&&X.findOne(e)?e:null},getElementFromSelector(t){const e=Y(t);return e?X.findOne(e):null},getMultipleElementsFromSelector(t){const e=Y(t);return e?X.find(e):[]}},J=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;F.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),p(this))return;const o=X.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(o)[e]()}))},Q="alert",tt=".bs.alert",et=`close${tt}`,it=`closed${tt}`,nt="fade",ot="show";class st extends G{static get NAME(){return Q}close(){if(F.trigger(this._element,et).defaultPrevented)return;this._element.classList.remove(ot);const t=this._element.classList.contains(nt);this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),F.trigger(this._element,it),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=st.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}J(st,"close"),w(st);const rt="button",at="active",lt='[data-bs-toggle="button"]',ct="click.bs.button.data-api";class ht extends G{static get NAME(){return rt}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(at))}static jQueryInterface(t){return this.each((function(){const e=ht.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}F.on(document,ct,lt,(t=>{t.preventDefault();const e=t.target.closest(lt);ht.getOrCreateInstance(e).toggle()})),w(ht);const ut="swipe",dt=".bs.swipe",pt=`touchstart${dt}`,ft=`touchmove${dt}`,_t=`touchend${dt}`,mt=`pointerdown${dt}`,gt=`pointerup${dt}`,vt="touch",yt="pen",bt="pointer-event",wt=40,xt={endCallback:null,leftCallback:null,rightCallback:null},Lt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Pt extends V{constructor(t,e){super(),this._element=t,t&&Pt.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return xt}static get DefaultType(){return Lt}static get NAME(){return ut}dispose(){F.off(this._element,dt)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),x(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=wt)return;const e=t/this._deltaX;this._deltaX=0,e&&x(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(F.on(this._element,mt,(t=>this._start(t))),F.on(this._element,gt,(t=>this._end(t))),this._element.classList.add(bt)):(F.on(this._element,pt,(t=>this._start(t))),F.on(this._element,ft,(t=>this._move(t))),F.on(this._element,_t,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&(t.pointerType===yt||t.pointerType===vt)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Tt="carousel",kt=".bs.carousel",Mt=".data-api",Ct="ArrowLeft",Et="ArrowRight",At=500,St="next",Ot="prev",zt="left",It="right",Dt=`slide${kt}`,Nt=`slid${kt}`,Bt=`keydown${kt}`,Zt=`mouseenter${kt}`,jt=`mouseleave${kt}`,Rt=`dragstart${kt}`,$t=`load${kt}${Mt}`,Ft=`click${kt}${Mt}`,qt="carousel",Ht="active",Wt="slide",Ut="carousel-item-end",Vt="carousel-item-start",Kt="carousel-item-next",Gt="carousel-item-prev",Yt=".active",Xt=".carousel-item",Jt=Yt+Xt,Qt=".carousel-item img",te=".carousel-indicators",ee="[data-bs-slide], [data-bs-slide-to]",ie='[data-bs-ride="carousel"]',ne={[Ct]:It,[Et]:zt},oe={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},se={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class re extends G{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=X.findOne(te,this._element),this._addEventListeners(),this._config.ride===qt&&this.cycle()}static get Default(){return oe}static get DefaultType(){return se}static get NAME(){return Tt}next(){this._slide(St)}nextWhenVisible(){!document.hidden&&d(this._element)&&this.next()}prev(){this._slide(Ot)}pause(){this._isSliding&&c(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?F.one(this._element,Nt,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void F.one(this._element,Nt,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?St:Ot;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&F.on(this._element,Bt,(t=>this._keydown(t))),"hover"===this._config.pause&&(F.on(this._element,Zt,(()=>this.pause())),F.on(this._element,jt,(()=>this._maybeEnableCycle()))),this._config.touch&&Pt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of X.find(Qt,this._element))F.on(t,Rt,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(zt)),rightCallback:()=>this._slide(this._directionToOrder(It)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),At+this._config.interval))}};this._swipeHelper=new Pt(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=ne[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=X.findOne(Yt,this._indicatorsElement);e.classList.remove(Ht),e.removeAttribute("aria-current");const i=X.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(Ht),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===St,o=e||P(this._getItems(),i,n,this._config.wrap);if(o===i)return;const s=this._getItemIndex(o),r=e=>F.trigger(this._element,e,{relatedTarget:o,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:s});if(r(Dt).defaultPrevented)return;if(!i||!o)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;const l=n?Vt:Ut,c=n?Kt:Gt;o.classList.add(c),m(o),i.classList.add(l),o.classList.add(l);const h=()=>{o.classList.remove(l,c),o.classList.add(Ht),i.classList.remove(Ht,c,l),this._isSliding=!1,r(Nt)};this._queueCallback(h,i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains(Wt)}_getActive(){return X.findOne(Jt,this._element)}_getItems(){return X.find(Xt,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return b()?t===zt?Ot:St:t===zt?St:Ot}_orderToDirection(t){return b()?t===Ot?zt:It:t===Ot?It:zt}static jQueryInterface(t){return this.each((function(){const e=re.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}F.on(document,Ft,ee,(function(t){const e=X.getElementFromSelector(this);if(!e||!e.classList.contains(qt))return;t.preventDefault();const i=re.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===U.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),F.on(window,$t,(()=>{const t=X.find(ie);for(const e of t)re.getOrCreateInstance(e)})),w(re);const ae="collapse",le=".bs.collapse",ce=`show${le}`,he=`shown${le}`,ue=`hide${le}`,de=`hidden${le}`,pe=`click${le}.data-api`,fe="show",_e="collapse",me="collapsing",ge="collapsed",ve=`:scope .${_e} .${_e}`,ye="collapse-horizontal",be="width",we="height",xe=".collapse.show, .collapse.collapsing",Le='[data-bs-toggle="collapse"]',Pe={parent:null,toggle:!0},Te={parent:"(null|element)",toggle:"boolean"};class ke extends G{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=X.find(Le);for(const t of i){const e=X.getSelectorFromElement(t),i=X.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Pe}static get DefaultType(){return Te}static get NAME(){return ae}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(xe).filter((t=>t!==this._element)).map((t=>ke.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(F.trigger(this._element,ce).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(_e),this._element.classList.add(me),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(me),this._element.classList.add(_e,fe),this._element.style[e]="",F.trigger(this._element,he)},n=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(i,this._element,!0),this._element.style[e]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(F.trigger(this._element,ue).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,m(this._element),this._element.classList.add(me),this._element.classList.remove(_e,fe);for(const t of this._triggerArray){const e=X.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;const e=()=>{this._isTransitioning=!1,this._element.classList.remove(me),this._element.classList.add(_e),F.trigger(this._element,de)};this._element.style[t]="",this._queueCallback(e,this._element,!0)}_isShown(t=this._element){return t.classList.contains(fe)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=u(t.parent),t}_getDimension(){return this._element.classList.contains(ye)?be:we}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Le);for(const e of t){const t=X.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=X.find(ve,this._config.parent);return X.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle(ge,!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=ke.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}F.on(document,pe,Le,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of X.getMultipleElementsFromSelector(this))ke.getOrCreateInstance(t,{toggle:!1}).toggle()})),w(ke);var Me="top",Ce="bottom",Ee="right",Ae="left",Se="auto",Oe=[Me,Ce,Ee,Ae],ze="start",Ie="end",De="clippingParents",Ne="viewport",Be="popper",Ze="reference",je=Oe.reduce((function(t,e){return t.concat([e+"-"+ze,e+"-"+Ie])}),[]),Re=[].concat(Oe,[Se]).reduce((function(t,e){return t.concat([e,e+"-"+ze,e+"-"+Ie])}),[]),$e="beforeRead",Fe="read",qe="afterRead",He="beforeMain",We="main",Ue="afterMain",Ve="beforeWrite",Ke="write",Ge="afterWrite",Ye=[$e,Fe,qe,He,We,Ue,Ve,Ke,Ge];function Xe(t){return t?(t.nodeName||"").toLowerCase():null}function Je(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Qe(t){return t instanceof Je(t).Element||t instanceof Element}function ti(t){return t instanceof Je(t).HTMLElement||t instanceof HTMLElement}function ei(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Je(t).ShadowRoot||t instanceof ShadowRoot)}function ii(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];ti(o)&&Xe(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))}function ni(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],o=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});ti(n)&&Xe(n)&&(Object.assign(n.style,s),Object.keys(o).forEach((function(t){n.removeAttribute(t)})))}))}}const oi={name:"applyStyles",enabled:!0,phase:"write",fn:ii,effect:ni,requires:["computeStyles"]};function si(t){return t.split("-")[0]}var ri=Math.max,ai=Math.min,li=Math.round;function ci(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function hi(){return!/^((?!chrome|android).)*safari/i.test(ci())}function ui(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&ti(t)&&(o=t.offsetWidth>0&&li(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&li(n.height)/t.offsetHeight||1);var r=(Qe(t)?Je(t):window).visualViewport,a=!hi()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/o,c=(n.top+(a&&r?r.offsetTop:0))/s,h=n.width/o,u=n.height/s;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function di(t){var e=ui(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function pi(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ei(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function fi(t){return Je(t).getComputedStyle(t)}function _i(t){return["table","td","th"].indexOf(Xe(t))>=0}function mi(t){return((Qe(t)?t.ownerDocument:t.document)||window.document).documentElement}function gi(t){return"html"===Xe(t)?t:t.assignedSlot||t.parentNode||(ei(t)?t.host:null)||mi(t)}function vi(t){return ti(t)&&"fixed"!==fi(t).position?t.offsetParent:null}function yi(t){var e=/firefox/i.test(ci());if(/Trident/i.test(ci())&&ti(t)&&"fixed"===fi(t).position)return null;var i=gi(t);for(ei(i)&&(i=i.host);ti(i)&&["html","body"].indexOf(Xe(i))<0;){var n=fi(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function bi(t){for(var e=Je(t),i=vi(t);i&&_i(i)&&"static"===fi(i).position;)i=vi(i);return i&&("html"===Xe(i)||"body"===Xe(i)&&"static"===fi(i).position)?e:i||yi(t)||e}function wi(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xi(t,e,i){return ri(t,ai(e,i))}function Li(t,e,i){var n=xi(t,e,i);return n>i?i:n}function Pi(){return{top:0,right:0,bottom:0,left:0}}function Ti(t){return Object.assign({},Pi(),t)}function ki(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var Mi=function(t,e){return Ti("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ki(t,Oe))};function Ci(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,r=i.modifiersData.popperOffsets,a=si(i.placement),l=wi(a),c=[Ae,Ee].indexOf(a)>=0?"height":"width";if(s&&r){var h=Mi(o.padding,i),u=di(s),d="y"===l?Me:Ae,p="y"===l?Ce:Ee,f=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],_=r[l]-i.rects.reference[l],m=bi(s),g=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=f/2-_/2,y=h[d],b=g-u[c]-h[p],w=g/2-u[c]/2+v,x=xi(y,w,b),L=l;i.modifiersData[n]=((e={})[L]=x,e.centerOffset=x-w,e)}}function Ei(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&pi(e.elements.popper,n)&&(e.elements.arrow=n)}const Ai={name:"arrow",enabled:!0,phase:"main",fn:Ci,effect:Ei,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Si(t){return t.split("-")[1]}var Oi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zi(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:li(i*o)/o||0,y:li(n*o)/o||0}}function Ii(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,u=t.isFixed,d=r.x,p=void 0===d?0:d,f=r.y,_=void 0===f?0:f,m="function"==typeof h?h({x:p,y:_}):{x:p,y:_};p=m.x,_=m.y;var g=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=Ae,b=Me,w=window;if(c){var x=bi(i),L="clientHeight",P="clientWidth";x===Je(i)&&"static"!==fi(x=mi(i)).position&&"absolute"===a&&(L="scrollHeight",P="scrollWidth"),(o===Me||(o===Ae||o===Ee)&&s===Ie)&&(b=Ce,_-=(u&&x===w&&w.visualViewport?w.visualViewport.height:x[L])-n.height,_*=l?1:-1),o!==Ae&&(o!==Me&&o!==Ce||s!==Ie)||(y=Ee,p-=(u&&x===w&&w.visualViewport?w.visualViewport.width:x[P])-n.width,p*=l?1:-1)}var T,k=Object.assign({position:a},c&&Oi),M=!0===h?zi({x:p,y:_},Je(i)):{x:p,y:_};return p=M.x,_=M.y,l?Object.assign({},k,((T={})[b]=v?"0":"",T[y]=g?"0":"",T.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+_+"px)":"translate3d("+p+"px, "+_+"px, 0)",T)):Object.assign({},k,((e={})[b]=v?_+"px":"",e[y]=g?p+"px":"",e.transform="",e))}function Di(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=void 0===n||n,s=i.adaptive,r=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:si(e.placement),variation:Si(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ii(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ii(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Ni={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Di,data:{}};var Bi={passive:!0};function Zi(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=void 0===o||o,r=n.resize,a=void 0===r||r,l=Je(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",i.update,Bi)})),a&&l.addEventListener("resize",i.update,Bi),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",i.update,Bi)})),a&&l.removeEventListener("resize",i.update,Bi)}}const ji={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zi,data:{}};var Ri={left:"right",right:"left",bottom:"top",top:"bottom"};function $i(t){return t.replace(/left|right|bottom|top/g,(function(t){return Ri[t]}))}var Fi={start:"end",end:"start"};function qi(t){return t.replace(/start|end/g,(function(t){return Fi[t]}))}function Hi(t){var e=Je(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wi(t){return ui(mi(t)).left+Hi(t).scrollLeft}function Ui(t,e){var i=Je(t),n=mi(t),o=i.visualViewport,s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;var c=hi();(c||!c&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a+Wi(t),y:l}}function Vi(t){var e,i=mi(t),n=Hi(t),o=null==(e=t.ownerDocument)?void 0:e.body,s=ri(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=ri(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Wi(t),l=-n.scrollTop;return"rtl"===fi(o||i).direction&&(a+=ri(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:r,x:a,y:l}}function Ki(t){var e=fi(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function Gi(t){return["html","body","#document"].indexOf(Xe(t))>=0?t.ownerDocument.body:ti(t)&&Ki(t)?t:Gi(gi(t))}function Yi(t,e){var i;void 0===e&&(e=[]);var n=Gi(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),s=Je(n),r=o?[s].concat(s.visualViewport||[],Ki(n)?n:[]):n,a=e.concat(r);return o?a:a.concat(Yi(gi(r)))}function Xi(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ji(t,e){var i=ui(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Qi(t,e,i){return e===Ne?Xi(Ui(t,i)):Qe(e)?Ji(e,i):Xi(Vi(mi(t)))}function tn(t){var e=Yi(gi(t)),i=["absolute","fixed"].indexOf(fi(t).position)>=0&&ti(t)?bi(t):t;return Qe(i)?e.filter((function(t){return Qe(t)&&pi(t,i)&&"body"!==Xe(t)})):[]}function en(t,e,i,n){var o="clippingParents"===e?tn(t):[].concat(e),s=[].concat(o,[i]),r=s[0],a=s.reduce((function(e,i){var o=Qi(t,i,n);return e.top=ri(o.top,e.top),e.right=ai(o.right,e.right),e.bottom=ai(o.bottom,e.bottom),e.left=ri(o.left,e.left),e}),Qi(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function nn(t){var e,i=t.reference,n=t.element,o=t.placement,s=o?si(o):null,r=o?Si(o):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case Me:e={x:a,y:i.y-n.height};break;case Ce:e={x:a,y:i.y+i.height};break;case Ee:e={x:i.x+i.width,y:l};break;case Ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=s?wi(s):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case ze:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Ie:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function on(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=void 0===n?t.placement:n,s=i.strategy,r=void 0===s?t.strategy:s,a=i.boundary,l=void 0===a?De:a,c=i.rootBoundary,h=void 0===c?Ne:c,u=i.elementContext,d=void 0===u?Be:u,p=i.altBoundary,f=void 0!==p&&p,_=i.padding,m=void 0===_?0:_,g=Ti("number"!=typeof m?m:ki(m,Oe)),v=d===Be?Ze:Be,y=t.rects.popper,b=t.elements[f?v:d],w=en(Qe(b)?b:b.contextElement||mi(t.elements.popper),l,h,r),x=ui(t.elements.reference),L=nn({reference:x,element:y,placement:o}),P=Xi(Object.assign({},y,L)),T=d===Be?P:x,k={top:w.top-T.top+g.top,bottom:T.bottom-w.bottom+g.bottom,left:w.left-T.left+g.left,right:T.right-w.right+g.right},M=t.modifiersData.offset;if(d===Be&&M){var C=M[o];Object.keys(k).forEach((function(t){var e=[Ee,Ce].indexOf(t)>=0?1:-1,i=[Me,Ce].indexOf(t)>=0?"y":"x";k[t]+=C[i]*e}))}return k}function sn(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Re:l,h=Si(n),u=h?a?je:je.filter((function(t){return Si(t)===h})):Oe,d=u.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=u);var p=d.reduce((function(e,i){return e[i]=on(t,{placement:i,boundary:o,rootBoundary:s,padding:r})[si(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}function rn(t){if(si(t)===Se)return[];var e=$i(t);return[qi(t),e,qi(e)]}function an(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=i.mainAxis,s=void 0===o||o,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,u=i.rootBoundary,d=i.altBoundary,p=i.flipVariations,f=void 0===p||p,_=i.allowedAutoPlacements,m=e.options.placement,g=si(m),v=l||(g!==m&&f?rn(m):[$i(m)]),y=[m].concat(v).reduce((function(t,i){return t.concat(si(i)===Se?sn(e,{placement:i,boundary:h,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:_}):i)}),[]),b=e.rects.reference,w=e.rects.popper,x=new Map,L=!0,P=y[0],T=0;T=0,A=E?"width":"height",S=on(e,{placement:k,boundary:h,rootBoundary:u,altBoundary:d,padding:c}),O=E?C?Ee:Ae:C?Ce:Me;b[A]>w[A]&&(O=$i(O));var z=$i(O),I=[];if(s&&I.push(S[M]<=0),a&&I.push(S[O]<=0,S[z]<=0),I.every((function(t){return t}))){P=k,L=!1;break}x.set(k,I)}if(L)for(var D=function(t){var e=y.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return P=e,"break"},N=f?3:1;N>0&&"break"!==D(N);N--);e.placement!==P&&(e.modifiersData[n]._skip=!0,e.placement=P,e.reset=!0)}}const ln={name:"flip",enabled:!0,phase:"main",fn:an,requiresIfExists:["offset"],data:{_skip:!1}};function cn(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function hn(t){return[Me,Ee,Ce,Ae].some((function(e){return t[e]>=0}))}function un(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,r=on(e,{elementContext:"reference"}),a=on(e,{altBoundary:!0}),l=cn(r,n),c=cn(a,o,s),h=hn(l),u=hn(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const dn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:un};function pn(t,e,i){var n=si(t),o=[Ae,Me].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=s[0],a=s[1];return r=r||0,a=(a||0)*o,[Ae,Ee].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}function fn(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=void 0===o?[0,0]:o,r=Re.reduce((function(t,i){return t[i]=pn(i,e.rects,s),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}const _n={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:fn};function mn(t){var e=t.state,i=t.name;e.modifiersData[i]=nn({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const gn={name:"popperOffsets",enabled:!0,phase:"read",fn:mn,data:{}};function vn(t){return"x"===t?"y":"x"}function yn(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=void 0===o||o,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,u=i.padding,d=i.tether,p=void 0===d||d,f=i.tetherOffset,_=void 0===f?0:f,m=on(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),g=si(e.placement),v=Si(e.placement),y=!v,b=wi(g),w=vn(b),x=e.modifiersData.popperOffsets,L=e.rects.reference,P=e.rects.popper,T="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,k="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(x){if(s){var E,A="y"===b?Me:Ae,S="y"===b?Ce:Ee,O="y"===b?"height":"width",z=x[b],I=z+m[A],D=z-m[S],N=p?-P[O]/2:0,B=v===ze?L[O]:P[O],Z=v===ze?-P[O]:-L[O],j=e.elements.arrow,R=p&&j?di(j):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Pi(),F=$[A],q=$[S],H=xi(0,L[O],R[O]),W=y?L[O]/2-N-H-F-k.mainAxis:B-H-F-k.mainAxis,U=y?-L[O]/2+N+H+q+k.mainAxis:Z+H+q+k.mainAxis,V=e.elements.arrow&&bi(e.elements.arrow),K=V?"y"===b?V.clientTop||0:V.clientLeft||0:0,G=null!=(E=null==M?void 0:M[b])?E:0,Y=z+U-G,X=xi(p?ai(I,z+W-G-K):I,z,p?ri(D,Y):D);x[b]=X,C[b]=X-z}if(a){var J,Q="x"===b?Me:Ae,tt="x"===b?Ce:Ee,et=x[w],it="y"===w?"height":"width",nt=et+m[Q],ot=et-m[tt],st=-1!==[Me,Ae].indexOf(g),rt=null!=(J=null==M?void 0:M[w])?J:0,at=st?nt:et-L[it]-P[it]-rt+k.altAxis,lt=st?et+L[it]+P[it]-rt-k.altAxis:ot,ct=p&&st?Li(at,et,lt):xi(p?at:nt,et,p?lt:ot);x[w]=ct,C[w]=ct-et}e.modifiersData[n]=C}}const bn={name:"preventOverflow",enabled:!0,phase:"main",fn:yn,requiresIfExists:["offset"]};function wn(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function xn(t){return t!==Je(t)&&ti(t)?wn(t):Hi(t)}function Ln(t){var e=t.getBoundingClientRect(),i=li(e.width)/t.offsetWidth||1,n=li(e.height)/t.offsetHeight||1;return 1!==i||1!==n}function Pn(t,e,i){void 0===i&&(i=!1);var n=ti(e),o=ti(e)&&Ln(e),s=mi(e),r=ui(t,o,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==Xe(e)||Ki(s))&&(a=xn(e)),ti(e)?((l=ui(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Wi(s))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Tn(t){var e=new Map,i=new Set,n=[];function o(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&o(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||o(t)})),n}function kn(t){var e=Tn(t);return Ye.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Mn(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Cn(t){var e=t.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var En={placement:"bottom",modifiers:[],strategy:"absolute"};function An(){for(var t=arguments.length,e=new Array(t),i=0;iNumber.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(U.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...x(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=X.find(lo,this._menu).filter((t=>d(t)));i.length&&P(i,e,t===Fn,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=bo.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(t.button===qn||"keyup"===t.type&&t.key!==Rn)return;const e=X.find(oo);for(const i of e){const e=bo.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),o=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!o||"outside"===e._config.autoClose&&o)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&t.key===Rn||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const s={relatedTarget:e._element};"click"===t.type&&(s.clickEvent=t),e._completeHide(s)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i=t.key===jn,n=[$n,Fn].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const o=this.matches(no)?this:X.prev(this,no)[0]||X.next(this,no)[0]||X.findOne(no,t.delegateTarget.parentNode),s=bo.getOrCreateInstance(o);if(n)return t.stopPropagation(),s.show(),void s._selectMenuItem(t);s._isShown()&&(t.stopPropagation(),s.hide(),o.focus())}}F.on(document,Gn,no,bo.dataApiKeydownHandler),F.on(document,Gn,so,bo.dataApiKeydownHandler),F.on(document,Kn,bo.clearMenus),F.on(document,Yn,bo.clearMenus),F.on(document,Kn,no,(function(t){t.preventDefault(),bo.getOrCreateInstance(this).toggle()})),w(bo);const wo="backdrop",xo="fade",Lo="show",Po=`mousedown.bs.${wo}`,To={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},ko={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Mo extends V{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return To}static get DefaultType(){return ko}static get NAME(){return wo}show(t){if(!this._config.isVisible)return void x(t);this._append();const e=this._getElement();this._config.isAnimated&&m(e),e.classList.add(Lo),this._emulateAnimation((()=>{x(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Lo),this._emulateAnimation((()=>{this.dispose(),x(t)}))):x(t)}dispose(){this._isAppended&&(F.off(this._element,Po),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add(xo),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=u(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),F.on(t,Po,(()=>{x(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){L(t,this._getElement(),this._config.isAnimated)}}const Co="focustrap",Eo=".bs.focustrap",Ao=`focusin${Eo}`,So=`keydown.tab${Eo}`,Oo="Tab",zo="forward",Io="backward",Do={autofocus:!0,trapElement:null},No={autofocus:"boolean",trapElement:"element"};class Bo extends V{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Do}static get DefaultType(){return No}static get NAME(){return Co}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),F.off(document,Eo),F.on(document,Ao,(t=>this._handleFocusin(t))),F.on(document,So,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,F.off(document,Eo))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=X.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===Io?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){t.key===Oo&&(this._lastTabNavDirection=t.shiftKey?Io:zo)}}const Zo=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",jo=".sticky-top",Ro="padding-right",$o="margin-right";class Fo{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ro,(e=>e+t)),this._setElementAttributes(Zo,Ro,(e=>e+t)),this._setElementAttributes(jo,$o,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ro),this._resetElementAttributes(Zo,Ro),this._resetElementAttributes(jo,$o)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth(),o=t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const o=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(o))}px`)};this._applyManipulationCallback(t,o)}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&U.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){const i=t=>{const i=U.getDataAttribute(t,e);null!==i?(U.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)};this._applyManipulationCallback(t,i)}_applyManipulationCallback(t,e){if(h(t))e(t);else for(const i of X.find(t,this._element))e(i)}}const qo="modal",Ho=".bs.modal",Wo="Escape",Uo=`hide${Ho}`,Vo=`hidePrevented${Ho}`,Ko=`hidden${Ho}`,Go=`show${Ho}`,Yo=`shown${Ho}`,Xo=`resize${Ho}`,Jo=`click.dismiss${Ho}`,Qo=`mousedown.dismiss${Ho}`,ts=`keydown.dismiss${Ho}`,es=`click${Ho}.data-api`,is="modal-open",ns="fade",os="show",ss="modal-static",rs=".modal.show",as=".modal-dialog",ls=".modal-body",cs='[data-bs-toggle="modal"]',hs={backdrop:!0,focus:!0,keyboard:!0},us={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class ds extends G{constructor(t,e){super(t,e),this._dialog=X.findOne(as,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Fo,this._addEventListeners()}static get Default(){return hs}static get DefaultType(){return us}static get NAME(){return qo}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||F.trigger(this._element,Go,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(is),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(F.trigger(this._element,Uo).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(os),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){F.off(window,Ho),F.off(this._dialog,Ho),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Mo({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Bo({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=X.findOne(ls,this._dialog);e&&(e.scrollTop=0),m(this._element),this._element.classList.add(os);const i=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,F.trigger(this._element,Yo,{relatedTarget:t})};this._queueCallback(i,this._dialog,this._isAnimated())}_addEventListeners(){F.on(this._element,ts,(t=>{t.key===Wo&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),F.on(window,Xo,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),F.on(this._element,Qo,(t=>{F.one(this._element,Jo,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(is),this._resetAdjustments(),this._scrollBar.reset(),F.trigger(this._element,Ko)}))}_isAnimated(){return this._element.classList.contains(ns)}_triggerBackdropTransition(){if(F.trigger(this._element,Vo).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(ss)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(ss),this._queueCallback((()=>{this._element.classList.remove(ss),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=b()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=b()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=ds.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}F.on(document,es,cs,(function(t){const e=X.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),F.one(e,Go,(t=>{t.defaultPrevented||F.one(e,Ko,(()=>{d(this)&&this.focus()}))}));const i=X.findOne(rs);i&&ds.getInstance(i).hide(),ds.getOrCreateInstance(e).toggle(this)})),J(ds),w(ds);const ps="offcanvas",fs=".bs.offcanvas",_s=".data-api",ms=`load${fs}${_s}`,gs="Escape",vs="show",ys="showing",bs="hiding",ws="offcanvas-backdrop",xs=".offcanvas.show",Ls=`show${fs}`,Ps=`shown${fs}`,Ts=`hide${fs}`,ks=`hidePrevented${fs}`,Ms=`hidden${fs}`,Cs=`resize${fs}`,Es=`click${fs}${_s}`,As=`keydown.dismiss${fs}`,Ss='[data-bs-toggle="offcanvas"]',Os={backdrop:!0,keyboard:!0,scroll:!1},zs={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Is extends G{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Os}static get DefaultType(){return zs}static get NAME(){return ps}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(F.trigger(this._element,Ls,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Fo).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ys);const e=()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(vs),this._element.classList.remove(ys),F.trigger(this._element,Ps,{relatedTarget:t})};this._queueCallback(e,this._element,!0)}hide(){if(!this._isShown)return;if(F.trigger(this._element,Ts).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(bs),this._backdrop.hide();const t=()=>{this._element.classList.remove(vs,bs),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Fo).reset(),F.trigger(this._element,Ms)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=()=>{"static"!==this._config.backdrop?this.hide():F.trigger(this._element,ks)},e=Boolean(this._config.backdrop);return new Mo({className:ws,isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?t:null})}_initializeFocusTrap(){return new Bo({trapElement:this._element})}_addEventListeners(){F.on(this._element,As,(t=>{t.key===gs&&(this._config.keyboard?this.hide():F.trigger(this._element,ks))}))}static jQueryInterface(t){return this.each((function(){const e=Is.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}F.on(document,Es,Ss,(function(t){const e=X.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),p(this))return;F.one(e,Ms,(()=>{d(this)&&this.focus()}));const i=X.findOne(xs);i&&i!==e&&Is.getInstance(i).hide(),Is.getOrCreateInstance(e).toggle(this)})),F.on(window,ms,(()=>{for(const t of X.find(xs))Is.getOrCreateInstance(t).show()})),F.on(window,Cs,(()=>{for(const t of X.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Is.getOrCreateInstance(t).hide()})),J(Is),w(Is);const Ds={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ns=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Bs=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Zs=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Ns.has(i)||Boolean(Bs.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))};function js(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),o=[].concat(...n.body.querySelectorAll("*"));for(const t of o){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),o=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Zs(e,o)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}const Rs="TemplateFactory",$s={allowList:Ds,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Fs={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},qs={entry:"(string|element|function|null)",selector:"(string|element)"};class Hs extends V{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return $s}static get DefaultType(){return Fs}static get NAME(){return Rs}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},qs)}_setContent(t,e,i){const n=X.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?h(e)?this._putElementInTemplate(u(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?js(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return x(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Ws="tooltip",Us=new Set(["sanitize","allowList","sanitizeFn"]),Vs="fade",Ks="show",Gs=".tooltip-inner",Ys=".modal",Xs="hide.bs.modal",Js="hover",Qs="focus",tr="click",er="manual",ir="hide",nr="hidden",or="show",sr="shown",rr="inserted",ar="click",lr="focusin",cr="focusout",hr="mouseenter",ur="mouseleave",dr={AUTO:"auto",TOP:"top",RIGHT:b()?"left":"right",BOTTOM:"bottom",LEFT:b()?"right":"left"},pr={allowList:Ds,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},fr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class _r extends G{constructor(t,e){if(void 0===Dn)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return pr}static get DefaultType(){return fr}static get NAME(){return Ws}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),F.off(this._element.closest(Ys),Xs,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=F.trigger(this._element,this.constructor.eventName(or)),e=(f(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),F.trigger(this._element,this.constructor.eventName(rr))),this._popper=this._createPopper(i),i.classList.add(Ks),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))F.on(t,"mouseover",_);const o=()=>{F.trigger(this._element,this.constructor.eventName(sr)),!1===this._isHovered&&this._leave(),this._isHovered=!1};this._queueCallback(o,this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(F.trigger(this._element,this.constructor.eventName(ir)).defaultPrevented)return;if(this._getTipElement().classList.remove(Ks),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))F.off(t,"mouseover",_);this._activeTrigger[tr]=!1,this._activeTrigger[Qs]=!1,this._activeTrigger[Js]=!1,this._isHovered=null;const t=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),F.trigger(this._element,this.constructor.eventName(nr)))};this._queueCallback(t,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(Vs,Ks),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=a(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(Vs),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Hs({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Gs]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Vs)}_isShown(){return this.tip&&this.tip.classList.contains(Ks)}_createPopper(t){const e=x(this._config.placement,[this,t,this._element]),i=dr[e.toUpperCase()];return In(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return x(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...x(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)F.on(this._element,this.constructor.eventName(ar),this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[tr]=!(e._isShown()&&e._activeTrigger[tr]),e.toggle()}));else if(e!==er){const t=e===Js?this.constructor.eventName(hr):this.constructor.eventName(lr),i=e===Js?this.constructor.eventName(ur):this.constructor.eventName(cr);F.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Qs:Js]=!0,e._enter()})),F.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Qs:Js]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},F.on(this._element.closest(Ys),Xs,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=U.getDataAttributes(this._element);for(const t of Object.keys(e))Us.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:u(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=_r.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}w(_r);const mr="popover",gr=".popover-header",vr=".popover-body",yr={..._r.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},br={..._r.DefaultType,content:"(null|string|element|function)"};class wr extends _r{static get Default(){return yr}static get DefaultType(){return br}static get NAME(){return mr}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[gr]:this._getTitle(),[vr]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=wr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}w(wr);const xr="scrollspy",Lr=".bs.scrollspy",Pr=`activate${Lr}`,Tr=`click${Lr}`,kr=`load${Lr}.data-api`,Mr="dropdown-item",Cr="active",Er='[data-bs-spy="scroll"]',Ar="[href]",Sr=".nav, .list-group",Or=".nav-link",zr=`${Or}, .nav-item > ${Or}, .list-group-item`,Ir=".dropdown",Dr=".dropdown-toggle",Nr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Br={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Zr extends G{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Nr}static get DefaultType(){return Br}static get NAME(){return xr}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=u(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(F.off(this._config.target,Tr),F.on(this._config.target,Tr,Ar,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,o=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of t){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(s));continue}const t=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&t){if(i(s),!n)return}else o||t||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=X.find(Ar,this._config.target);for(const e of t){if(!e.hash||p(e))continue;const t=X.findOne(decodeURI(e.hash),this._element);d(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Cr),this._activateParents(t),F.trigger(this._element,Pr,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains(Mr))X.findOne(Dr,t.closest(Ir)).classList.add(Cr);else for(const e of X.parents(t,Sr))for(const t of X.prev(e,zr))t.classList.add(Cr)}_clearActiveClass(t){t.classList.remove(Cr);const e=X.find(`${Ar}.${Cr}`,t);for(const t of e)t.classList.remove(Cr)}static jQueryInterface(t){return this.each((function(){const e=Zr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}F.on(window,kr,(()=>{for(const t of X.find(Er))Zr.getOrCreateInstance(t)})),w(Zr);const jr="tab",Rr=".bs.tab",$r=`hide${Rr}`,Fr=`hidden${Rr}`,qr=`show${Rr}`,Hr=`shown${Rr}`,Wr=`click${Rr}`,Ur=`keydown${Rr}`,Vr=`load${Rr}`,Kr="ArrowLeft",Gr="ArrowRight",Yr="ArrowUp",Xr="ArrowDown",Jr="Home",Qr="End",ta="active",ea="fade",ia="show",na="dropdown",oa=".dropdown-toggle",sa=".dropdown-menu",ra=`:not(${oa})`,aa='.list-group, .nav, [role="tablist"]',la=".nav-item, .list-group-item",ca='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ha=`.nav-link${ra}, .list-group-item${ra}, [role="tab"]${ra}, ${ca}`,ua=`.${ta}[data-bs-toggle="tab"], .${ta}[data-bs-toggle="pill"], .${ta}[data-bs-toggle="list"]`;class da extends G{constructor(t){super(t),this._parent=this._element.closest(aa),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),F.on(this._element,Ur,(t=>this._keydown(t))))}static get NAME(){return jr}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?F.trigger(e,$r,{relatedTarget:t}):null;F.trigger(t,qr,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(ta),this._activate(X.getElementFromSelector(t));const i=()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),F.trigger(t,Hr,{relatedTarget:e})):t.classList.add(ia)};this._queueCallback(i,t,t.classList.contains(ea))}_deactivate(t,e){if(!t)return;t.classList.remove(ta),t.blur(),this._deactivate(X.getElementFromSelector(t));const i=()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),F.trigger(t,Fr,{relatedTarget:e})):t.classList.remove(ia)};this._queueCallback(i,t,t.classList.contains(ea))}_keydown(t){if(![Kr,Gr,Yr,Xr,Jr,Qr].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!p(t)));let i;if([Jr,Qr].includes(t.key))i=e[t.key===Jr?0:e.length-1];else{const n=[Gr,Xr].includes(t.key);i=P(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),da.getOrCreateInstance(i).show())}_getChildren(){return X.find(ha,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=X.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains(na))return;const n=(t,n)=>{const o=X.findOne(t,i);o&&o.classList.toggle(n,e)};n(oa,ta),n(sa,ia),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(ta)}_getInnerElement(t){return t.matches(ha)?t:X.findOne(ha,t)}_getOuterElement(t){return t.closest(la)||t}static jQueryInterface(t){return this.each((function(){const e=da.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}F.on(document,Wr,ca,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),p(this)||da.getOrCreateInstance(this).show()})),F.on(window,Vr,(()=>{for(const t of X.find(ua))da.getOrCreateInstance(t)})),w(da);const pa="toast",fa=".bs.toast",_a=`mouseover${fa}`,ma=`mouseout${fa}`,ga=`focusin${fa}`,va=`focusout${fa}`,ya=`hide${fa}`,ba=`hidden${fa}`,wa=`show${fa}`,xa=`shown${fa}`,La="fade",Pa="hide",Ta="show",ka="showing",Ma={animation:"boolean",autohide:"boolean",delay:"number"},Ca={animation:!0,autohide:!0,delay:5e3};class Ea extends G{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Ca}static get DefaultType(){return Ma}static get NAME(){return pa}show(){if(F.trigger(this._element,wa).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(La);const t=()=>{this._element.classList.remove(ka),F.trigger(this._element,xa),this._maybeScheduleHide()};this._element.classList.remove(Pa),m(this._element),this._element.classList.add(Ta,ka),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown())return;if(F.trigger(this._element,ya).defaultPrevented)return;const t=()=>{this._element.classList.add(Pa),this._element.classList.remove(ka,Ta),F.trigger(this._element,ba)};this._element.classList.add(ka),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ta),super.dispose()}isShown(){return this._element.classList.contains(Ta)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){F.on(this._element,_a,(t=>this._onInteraction(t,!0))),F.on(this._element,ma,(t=>this._onInteraction(t,!1))),F.on(this._element,ga,(t=>this._onInteraction(t,!0))),F.on(this._element,va,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Ea.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return J(Ea),w(Ea),{Alert:st,Button:ht,Carousel:re,Collapse:ke,Dropdown:bo,Modal:ds,Offcanvas:Is,Popover:wr,ScrollSpy:Zr,Tab:da,Toast:Ea,Tooltip:_r}}());var Ki,Gi,Yi={};async function Xi(t,e){if(window.location.protocol.match(/^http/))if(Yi[t])e.innerHTML=Yi[t];else try{await fetch(t).then((t=>t.text())).then((i=>{i=i.replace("Nominatim_API_Endpoint",Ji()),e.innerHTML=i,Yi[t]=i}))}catch(i){e.innerHTML=`Error fetching content from ${t} (${i})`}else e.innerHTML=`Cannot display data from ${t} here. Browser security prevents loading content from file:// URLs.`}function Ji(t){var e=Nominatim_Config.Nominatim_API_Endpoint;return"function"==typeof e?e(t):t?e+t:e}function Qi(t,e){return 1===e.dedupe&&delete e.dedupe,function(t,e){for(var i=Object.keys(e),n=0;nencodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}function tn(t){document.title=[t,Nominatim_Config.Page_Title].filter((t=>t&&t.length>1)).join(" | ")} + */Ki||(Ki=1,Gi.exports=function(){const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const o=t.get(e);o.has(i)||0===o.size?o.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i=1e6,n=1e3,o="transitionend",s=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),r=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),a=t=>{do{t+=Math.floor(Math.random()*i)}while(document.getElementById(t));return t},l=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const o=Number.parseFloat(e),s=Number.parseFloat(i);return o||s?(e=e.split(",")[0],i=i.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(i))*n):0},c=t=>{t.dispatchEvent(new Event(o))},h=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),u=t=>h(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(s(t)):null,d=t=>{if(!h(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},p=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),f=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?f(t.parentNode):null},_=()=>{},m=t=>{t.offsetHeight},g=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,v=[],y=t=>{"loading"===document.readyState?(v.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of v)t()})),v.push(t)):t()},b=()=>"rtl"===document.documentElement.dir,w=t=>{y((()=>{const e=g();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}}))},x=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,L=(t,e,i=!0)=>{if(!i)return void x(t);const n=5,s=l(e)+n;let r=!1;const a=({target:i})=>{i===e&&(r=!0,e.removeEventListener(o,a),x(t))};e.addEventListener(o,a),setTimeout((()=>{r||c(e)}),s)},P=(t,e,i,n)=>{const o=t.length;let s=t.indexOf(e);return-1===s?!i&&n?t[o-1]:t[0]:(s+=i?1:-1,n&&(s=(s+o)%o),t[Math.max(0,Math.min(s,o-1))])},T=/[^.]*(?=\..*)\.|.*/,k=/\..*/,M=/::\d+$/,C={};let E=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},S=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function z(t){const e=O(t);return t.uidEvent=e,C[e]=C[e]||{},C[e]}function I(t,e){return function i(n){return q(n,{delegateTarget:t}),i.oneOff&&F.off(t,n.type,e),e.apply(t,[n])}}function D(t,e,i){return function n(o){const s=t.querySelectorAll(e);for(let{target:r}=o;r&&r!==this;r=r.parentNode)for(const a of s)if(a===r)return q(o,{delegateTarget:r}),n.oneOff&&F.off(t,o.type,e,i),i.apply(r,[o])}}function N(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function B(t,e,i){const n="string"==typeof e,o=n?i:e||i;let s=$(t);return S.has(s)||(s=t),[n,o,s]}function Z(t,e,i,n,o){if("string"!=typeof e||!t)return;let[s,r,a]=B(e,i,n);if(e in A){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=z(t),c=l[a]||(l[a]={}),h=N(c,r,s?i:null);if(h)return void(h.oneOff=h.oneOff&&o);const u=O(r,e.replace(T,"")),d=s?D(t,i,r):I(t,r);d.delegationSelector=s?i:null,d.callable=r,d.oneOff=o,d.uidEvent=u,c[u]=d,t.addEventListener(a,d,s)}function j(t,e,i,n,o){const s=N(e[i],n,o);s&&(t.removeEventListener(i,s,Boolean(o)),delete e[i][s.uidEvent])}function R(t,e,i,n){const o=e[i]||{};for(const[s,r]of Object.entries(o))s.includes(n)&&j(t,e,i,r.callable,r.delegationSelector)}function $(t){return t=t.replace(k,""),A[t]||t}const F={on(t,e,i,n){Z(t,e,i,n,!1)},one(t,e,i,n){Z(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[o,s,r]=B(e,i,n),a=r!==e,l=z(t),c=l[r]||{},h=e.startsWith(".");if(void 0===s){if(h)for(const i of Object.keys(l))R(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const o=i.replace(M,"");a&&!e.includes(o)||j(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;j(t,l,r,s,o?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=g();let o=null,s=!0,r=!0,a=!1;e!==$(e)&&n&&(o=n.Event(e,i),n(t).trigger(o),s=!o.isPropagationStopped(),r=!o.isImmediatePropagationStopped(),a=o.isDefaultPrevented());const l=q(new Event(e,{bubbles:s,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&o&&o.preventDefault(),l}};function q(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function H(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function W(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const U={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${W(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${W(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=H(t.dataset[n])}return e},getDataAttribute:(t,e)=>H(t.getAttribute(`data-bs-${W(e)}`))};class V{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=h(e)?U.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...h(e)?U.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,n]of Object.entries(e)){const e=t[i],o=h(e)?"element":r(e);if(!new RegExp(n).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${o}" but expected type "${n}".`)}}}const K="5.3.8";class G extends V{constructor(t,i){super(),(t=u(t))&&(this._element=t,this._config=this._getConfig(i),e.set(this._element,this.constructor.DATA_KEY,this))}dispose(){e.remove(this._element,this.constructor.DATA_KEY),F.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){L(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return e.get(u(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return K}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const Y=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map((t=>s(t))).join(","):null},X={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!p(t)&&d(t)))},getSelectorFromElement(t){const e=Y(t);return e&&X.findOne(e)?e:null},getElementFromSelector(t){const e=Y(t);return e?X.findOne(e):null},getMultipleElementsFromSelector(t){const e=Y(t);return e?X.find(e):[]}},J=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;F.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),p(this))return;const o=X.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(o)[e]()}))},Q="alert",tt=".bs.alert",et=`close${tt}`,it=`closed${tt}`,nt="fade",ot="show";class st extends G{static get NAME(){return Q}close(){if(F.trigger(this._element,et).defaultPrevented)return;this._element.classList.remove(ot);const t=this._element.classList.contains(nt);this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),F.trigger(this._element,it),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=st.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}J(st,"close"),w(st);const rt="button",at="active",lt='[data-bs-toggle="button"]',ct="click.bs.button.data-api";class ht extends G{static get NAME(){return rt}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(at))}static jQueryInterface(t){return this.each((function(){const e=ht.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}F.on(document,ct,lt,(t=>{t.preventDefault();const e=t.target.closest(lt);ht.getOrCreateInstance(e).toggle()})),w(ht);const ut="swipe",dt=".bs.swipe",pt=`touchstart${dt}`,ft=`touchmove${dt}`,_t=`touchend${dt}`,mt=`pointerdown${dt}`,gt=`pointerup${dt}`,vt="touch",yt="pen",bt="pointer-event",wt=40,xt={endCallback:null,leftCallback:null,rightCallback:null},Lt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Pt extends V{constructor(t,e){super(),this._element=t,t&&Pt.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return xt}static get DefaultType(){return Lt}static get NAME(){return ut}dispose(){F.off(this._element,dt)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),x(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=wt)return;const e=t/this._deltaX;this._deltaX=0,e&&x(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(F.on(this._element,mt,(t=>this._start(t))),F.on(this._element,gt,(t=>this._end(t))),this._element.classList.add(bt)):(F.on(this._element,pt,(t=>this._start(t))),F.on(this._element,ft,(t=>this._move(t))),F.on(this._element,_t,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&(t.pointerType===yt||t.pointerType===vt)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Tt="carousel",kt=".bs.carousel",Mt=".data-api",Ct="ArrowLeft",Et="ArrowRight",At=500,St="next",Ot="prev",zt="left",It="right",Dt=`slide${kt}`,Nt=`slid${kt}`,Bt=`keydown${kt}`,Zt=`mouseenter${kt}`,jt=`mouseleave${kt}`,Rt=`dragstart${kt}`,$t=`load${kt}${Mt}`,Ft=`click${kt}${Mt}`,qt="carousel",Ht="active",Wt="slide",Ut="carousel-item-end",Vt="carousel-item-start",Kt="carousel-item-next",Gt="carousel-item-prev",Yt=".active",Xt=".carousel-item",Jt=Yt+Xt,Qt=".carousel-item img",te=".carousel-indicators",ee="[data-bs-slide], [data-bs-slide-to]",ie='[data-bs-ride="carousel"]',ne={[Ct]:It,[Et]:zt},oe={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},se={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class re extends G{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=X.findOne(te,this._element),this._addEventListeners(),this._config.ride===qt&&this.cycle()}static get Default(){return oe}static get DefaultType(){return se}static get NAME(){return Tt}next(){this._slide(St)}nextWhenVisible(){!document.hidden&&d(this._element)&&this.next()}prev(){this._slide(Ot)}pause(){this._isSliding&&c(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?F.one(this._element,Nt,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void F.one(this._element,Nt,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?St:Ot;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&F.on(this._element,Bt,(t=>this._keydown(t))),"hover"===this._config.pause&&(F.on(this._element,Zt,(()=>this.pause())),F.on(this._element,jt,(()=>this._maybeEnableCycle()))),this._config.touch&&Pt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of X.find(Qt,this._element))F.on(t,Rt,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(zt)),rightCallback:()=>this._slide(this._directionToOrder(It)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),At+this._config.interval))}};this._swipeHelper=new Pt(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=ne[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=X.findOne(Yt,this._indicatorsElement);e.classList.remove(Ht),e.removeAttribute("aria-current");const i=X.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(Ht),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===St,o=e||P(this._getItems(),i,n,this._config.wrap);if(o===i)return;const s=this._getItemIndex(o),r=e=>F.trigger(this._element,e,{relatedTarget:o,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:s});if(r(Dt).defaultPrevented)return;if(!i||!o)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;const l=n?Vt:Ut,c=n?Kt:Gt;o.classList.add(c),m(o),i.classList.add(l),o.classList.add(l);const h=()=>{o.classList.remove(l,c),o.classList.add(Ht),i.classList.remove(Ht,c,l),this._isSliding=!1,r(Nt)};this._queueCallback(h,i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains(Wt)}_getActive(){return X.findOne(Jt,this._element)}_getItems(){return X.find(Xt,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return b()?t===zt?Ot:St:t===zt?St:Ot}_orderToDirection(t){return b()?t===Ot?zt:It:t===Ot?It:zt}static jQueryInterface(t){return this.each((function(){const e=re.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}F.on(document,Ft,ee,(function(t){const e=X.getElementFromSelector(this);if(!e||!e.classList.contains(qt))return;t.preventDefault();const i=re.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===U.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),F.on(window,$t,(()=>{const t=X.find(ie);for(const e of t)re.getOrCreateInstance(e)})),w(re);const ae="collapse",le=".bs.collapse",ce=`show${le}`,he=`shown${le}`,ue=`hide${le}`,de=`hidden${le}`,pe=`click${le}.data-api`,fe="show",_e="collapse",me="collapsing",ge="collapsed",ve=`:scope .${_e} .${_e}`,ye="collapse-horizontal",be="width",we="height",xe=".collapse.show, .collapse.collapsing",Le='[data-bs-toggle="collapse"]',Pe={parent:null,toggle:!0},Te={parent:"(null|element)",toggle:"boolean"};class ke extends G{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=X.find(Le);for(const t of i){const e=X.getSelectorFromElement(t),i=X.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Pe}static get DefaultType(){return Te}static get NAME(){return ae}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(xe).filter((t=>t!==this._element)).map((t=>ke.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(F.trigger(this._element,ce).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(_e),this._element.classList.add(me),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(me),this._element.classList.add(_e,fe),this._element.style[e]="",F.trigger(this._element,he)},n=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(i,this._element,!0),this._element.style[e]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(F.trigger(this._element,ue).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,m(this._element),this._element.classList.add(me),this._element.classList.remove(_e,fe);for(const t of this._triggerArray){const e=X.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;const e=()=>{this._isTransitioning=!1,this._element.classList.remove(me),this._element.classList.add(_e),F.trigger(this._element,de)};this._element.style[t]="",this._queueCallback(e,this._element,!0)}_isShown(t=this._element){return t.classList.contains(fe)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=u(t.parent),t}_getDimension(){return this._element.classList.contains(ye)?be:we}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Le);for(const e of t){const t=X.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=X.find(ve,this._config.parent);return X.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle(ge,!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=ke.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}F.on(document,pe,Le,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of X.getMultipleElementsFromSelector(this))ke.getOrCreateInstance(t,{toggle:!1}).toggle()})),w(ke);var Me="top",Ce="bottom",Ee="right",Ae="left",Se="auto",Oe=[Me,Ce,Ee,Ae],ze="start",Ie="end",De="clippingParents",Ne="viewport",Be="popper",Ze="reference",je=Oe.reduce((function(t,e){return t.concat([e+"-"+ze,e+"-"+Ie])}),[]),Re=[].concat(Oe,[Se]).reduce((function(t,e){return t.concat([e,e+"-"+ze,e+"-"+Ie])}),[]),$e="beforeRead",Fe="read",qe="afterRead",He="beforeMain",We="main",Ue="afterMain",Ve="beforeWrite",Ke="write",Ge="afterWrite",Ye=[$e,Fe,qe,He,We,Ue,Ve,Ke,Ge];function Xe(t){return t?(t.nodeName||"").toLowerCase():null}function Je(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Qe(t){return t instanceof Je(t).Element||t instanceof Element}function ti(t){return t instanceof Je(t).HTMLElement||t instanceof HTMLElement}function ei(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Je(t).ShadowRoot||t instanceof ShadowRoot)}function ii(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];ti(o)&&Xe(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))}function ni(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],o=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});ti(n)&&Xe(n)&&(Object.assign(n.style,s),Object.keys(o).forEach((function(t){n.removeAttribute(t)})))}))}}const oi={name:"applyStyles",enabled:!0,phase:"write",fn:ii,effect:ni,requires:["computeStyles"]};function si(t){return t.split("-")[0]}var ri=Math.max,ai=Math.min,li=Math.round;function ci(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function hi(){return!/^((?!chrome|android).)*safari/i.test(ci())}function ui(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&ti(t)&&(o=t.offsetWidth>0&&li(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&li(n.height)/t.offsetHeight||1);var r=(Qe(t)?Je(t):window).visualViewport,a=!hi()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/o,c=(n.top+(a&&r?r.offsetTop:0))/s,h=n.width/o,u=n.height/s;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function di(t){var e=ui(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function pi(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ei(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function fi(t){return Je(t).getComputedStyle(t)}function _i(t){return["table","td","th"].indexOf(Xe(t))>=0}function mi(t){return((Qe(t)?t.ownerDocument:t.document)||window.document).documentElement}function gi(t){return"html"===Xe(t)?t:t.assignedSlot||t.parentNode||(ei(t)?t.host:null)||mi(t)}function vi(t){return ti(t)&&"fixed"!==fi(t).position?t.offsetParent:null}function yi(t){var e=/firefox/i.test(ci());if(/Trident/i.test(ci())&&ti(t)&&"fixed"===fi(t).position)return null;var i=gi(t);for(ei(i)&&(i=i.host);ti(i)&&["html","body"].indexOf(Xe(i))<0;){var n=fi(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}function bi(t){for(var e=Je(t),i=vi(t);i&&_i(i)&&"static"===fi(i).position;)i=vi(i);return i&&("html"===Xe(i)||"body"===Xe(i)&&"static"===fi(i).position)?e:i||yi(t)||e}function wi(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xi(t,e,i){return ri(t,ai(e,i))}function Li(t,e,i){var n=xi(t,e,i);return n>i?i:n}function Pi(){return{top:0,right:0,bottom:0,left:0}}function Ti(t){return Object.assign({},Pi(),t)}function ki(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var Mi=function(t,e){return Ti("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ki(t,Oe))};function Ci(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,r=i.modifiersData.popperOffsets,a=si(i.placement),l=wi(a),c=[Ae,Ee].indexOf(a)>=0?"height":"width";if(s&&r){var h=Mi(o.padding,i),u=di(s),d="y"===l?Me:Ae,p="y"===l?Ce:Ee,f=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],_=r[l]-i.rects.reference[l],m=bi(s),g=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=f/2-_/2,y=h[d],b=g-u[c]-h[p],w=g/2-u[c]/2+v,x=xi(y,w,b),L=l;i.modifiersData[n]=((e={})[L]=x,e.centerOffset=x-w,e)}}function Ei(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&pi(e.elements.popper,n)&&(e.elements.arrow=n)}const Ai={name:"arrow",enabled:!0,phase:"main",fn:Ci,effect:Ei,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Si(t){return t.split("-")[1]}var Oi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zi(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:li(i*o)/o||0,y:li(n*o)/o||0}}function Ii(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,u=t.isFixed,d=r.x,p=void 0===d?0:d,f=r.y,_=void 0===f?0:f,m="function"==typeof h?h({x:p,y:_}):{x:p,y:_};p=m.x,_=m.y;var g=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=Ae,b=Me,w=window;if(c){var x=bi(i),L="clientHeight",P="clientWidth";x===Je(i)&&"static"!==fi(x=mi(i)).position&&"absolute"===a&&(L="scrollHeight",P="scrollWidth"),(o===Me||(o===Ae||o===Ee)&&s===Ie)&&(b=Ce,_-=(u&&x===w&&w.visualViewport?w.visualViewport.height:x[L])-n.height,_*=l?1:-1),o!==Ae&&(o!==Me&&o!==Ce||s!==Ie)||(y=Ee,p-=(u&&x===w&&w.visualViewport?w.visualViewport.width:x[P])-n.width,p*=l?1:-1)}var T,k=Object.assign({position:a},c&&Oi),M=!0===h?zi({x:p,y:_},Je(i)):{x:p,y:_};return p=M.x,_=M.y,l?Object.assign({},k,((T={})[b]=v?"0":"",T[y]=g?"0":"",T.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+_+"px)":"translate3d("+p+"px, "+_+"px, 0)",T)):Object.assign({},k,((e={})[b]=v?_+"px":"",e[y]=g?p+"px":"",e.transform="",e))}function Di(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=void 0===n||n,s=i.adaptive,r=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:si(e.placement),variation:Si(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ii(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ii(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Ni={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Di,data:{}};var Bi={passive:!0};function Zi(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=void 0===o||o,r=n.resize,a=void 0===r||r,l=Je(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",i.update,Bi)})),a&&l.addEventListener("resize",i.update,Bi),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",i.update,Bi)})),a&&l.removeEventListener("resize",i.update,Bi)}}const ji={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Zi,data:{}};var Ri={left:"right",right:"left",bottom:"top",top:"bottom"};function $i(t){return t.replace(/left|right|bottom|top/g,(function(t){return Ri[t]}))}var Fi={start:"end",end:"start"};function qi(t){return t.replace(/start|end/g,(function(t){return Fi[t]}))}function Hi(t){var e=Je(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wi(t){return ui(mi(t)).left+Hi(t).scrollLeft}function Ui(t,e){var i=Je(t),n=mi(t),o=i.visualViewport,s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;var c=hi();(c||!c&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a+Wi(t),y:l}}function Vi(t){var e,i=mi(t),n=Hi(t),o=null==(e=t.ownerDocument)?void 0:e.body,s=ri(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=ri(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Wi(t),l=-n.scrollTop;return"rtl"===fi(o||i).direction&&(a+=ri(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:r,x:a,y:l}}function Ki(t){var e=fi(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function Gi(t){return["html","body","#document"].indexOf(Xe(t))>=0?t.ownerDocument.body:ti(t)&&Ki(t)?t:Gi(gi(t))}function Yi(t,e){var i;void 0===e&&(e=[]);var n=Gi(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),s=Je(n),r=o?[s].concat(s.visualViewport||[],Ki(n)?n:[]):n,a=e.concat(r);return o?a:a.concat(Yi(gi(r)))}function Xi(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ji(t,e){var i=ui(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Qi(t,e,i){return e===Ne?Xi(Ui(t,i)):Qe(e)?Ji(e,i):Xi(Vi(mi(t)))}function tn(t){var e=Yi(gi(t)),i=["absolute","fixed"].indexOf(fi(t).position)>=0&&ti(t)?bi(t):t;return Qe(i)?e.filter((function(t){return Qe(t)&&pi(t,i)&&"body"!==Xe(t)})):[]}function en(t,e,i,n){var o="clippingParents"===e?tn(t):[].concat(e),s=[].concat(o,[i]),r=s[0],a=s.reduce((function(e,i){var o=Qi(t,i,n);return e.top=ri(o.top,e.top),e.right=ai(o.right,e.right),e.bottom=ai(o.bottom,e.bottom),e.left=ri(o.left,e.left),e}),Qi(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function nn(t){var e,i=t.reference,n=t.element,o=t.placement,s=o?si(o):null,r=o?Si(o):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case Me:e={x:a,y:i.y-n.height};break;case Ce:e={x:a,y:i.y+i.height};break;case Ee:e={x:i.x+i.width,y:l};break;case Ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=s?wi(s):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case ze:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Ie:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function on(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=void 0===n?t.placement:n,s=i.strategy,r=void 0===s?t.strategy:s,a=i.boundary,l=void 0===a?De:a,c=i.rootBoundary,h=void 0===c?Ne:c,u=i.elementContext,d=void 0===u?Be:u,p=i.altBoundary,f=void 0!==p&&p,_=i.padding,m=void 0===_?0:_,g=Ti("number"!=typeof m?m:ki(m,Oe)),v=d===Be?Ze:Be,y=t.rects.popper,b=t.elements[f?v:d],w=en(Qe(b)?b:b.contextElement||mi(t.elements.popper),l,h,r),x=ui(t.elements.reference),L=nn({reference:x,element:y,placement:o}),P=Xi(Object.assign({},y,L)),T=d===Be?P:x,k={top:w.top-T.top+g.top,bottom:T.bottom-w.bottom+g.bottom,left:w.left-T.left+g.left,right:T.right-w.right+g.right},M=t.modifiersData.offset;if(d===Be&&M){var C=M[o];Object.keys(k).forEach((function(t){var e=[Ee,Ce].indexOf(t)>=0?1:-1,i=[Me,Ce].indexOf(t)>=0?"y":"x";k[t]+=C[i]*e}))}return k}function sn(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Re:l,h=Si(n),u=h?a?je:je.filter((function(t){return Si(t)===h})):Oe,d=u.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=u);var p=d.reduce((function(e,i){return e[i]=on(t,{placement:i,boundary:o,rootBoundary:s,padding:r})[si(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}function rn(t){if(si(t)===Se)return[];var e=$i(t);return[qi(t),e,qi(e)]}function an(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=i.mainAxis,s=void 0===o||o,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,u=i.rootBoundary,d=i.altBoundary,p=i.flipVariations,f=void 0===p||p,_=i.allowedAutoPlacements,m=e.options.placement,g=si(m),v=l||(g!==m&&f?rn(m):[$i(m)]),y=[m].concat(v).reduce((function(t,i){return t.concat(si(i)===Se?sn(e,{placement:i,boundary:h,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:_}):i)}),[]),b=e.rects.reference,w=e.rects.popper,x=new Map,L=!0,P=y[0],T=0;T=0,A=E?"width":"height",S=on(e,{placement:k,boundary:h,rootBoundary:u,altBoundary:d,padding:c}),O=E?C?Ee:Ae:C?Ce:Me;b[A]>w[A]&&(O=$i(O));var z=$i(O),I=[];if(s&&I.push(S[M]<=0),a&&I.push(S[O]<=0,S[z]<=0),I.every((function(t){return t}))){P=k,L=!1;break}x.set(k,I)}if(L)for(var D=function(t){var e=y.find((function(e){var i=x.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return P=e,"break"},N=f?3:1;N>0&&"break"!==D(N);N--);e.placement!==P&&(e.modifiersData[n]._skip=!0,e.placement=P,e.reset=!0)}}const ln={name:"flip",enabled:!0,phase:"main",fn:an,requiresIfExists:["offset"],data:{_skip:!1}};function cn(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function hn(t){return[Me,Ee,Ce,Ae].some((function(e){return t[e]>=0}))}function un(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,r=on(e,{elementContext:"reference"}),a=on(e,{altBoundary:!0}),l=cn(r,n),c=cn(a,o,s),h=hn(l),u=hn(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const dn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:un};function pn(t,e,i){var n=si(t),o=[Ae,Me].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=s[0],a=s[1];return r=r||0,a=(a||0)*o,[Ae,Ee].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}function fn(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=void 0===o?[0,0]:o,r=Re.reduce((function(t,i){return t[i]=pn(i,e.rects,s),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}const _n={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:fn};function mn(t){var e=t.state,i=t.name;e.modifiersData[i]=nn({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const gn={name:"popperOffsets",enabled:!0,phase:"read",fn:mn,data:{}};function vn(t){return"x"===t?"y":"x"}function yn(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=void 0===o||o,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,u=i.padding,d=i.tether,p=void 0===d||d,f=i.tetherOffset,_=void 0===f?0:f,m=on(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),g=si(e.placement),v=Si(e.placement),y=!v,b=wi(g),w=vn(b),x=e.modifiersData.popperOffsets,L=e.rects.reference,P=e.rects.popper,T="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,k="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(x){if(s){var E,A="y"===b?Me:Ae,S="y"===b?Ce:Ee,O="y"===b?"height":"width",z=x[b],I=z+m[A],D=z-m[S],N=p?-P[O]/2:0,B=v===ze?L[O]:P[O],Z=v===ze?-P[O]:-L[O],j=e.elements.arrow,R=p&&j?di(j):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Pi(),F=$[A],q=$[S],H=xi(0,L[O],R[O]),W=y?L[O]/2-N-H-F-k.mainAxis:B-H-F-k.mainAxis,U=y?-L[O]/2+N+H+q+k.mainAxis:Z+H+q+k.mainAxis,V=e.elements.arrow&&bi(e.elements.arrow),K=V?"y"===b?V.clientTop||0:V.clientLeft||0:0,G=null!=(E=null==M?void 0:M[b])?E:0,Y=z+U-G,X=xi(p?ai(I,z+W-G-K):I,z,p?ri(D,Y):D);x[b]=X,C[b]=X-z}if(a){var J,Q="x"===b?Me:Ae,tt="x"===b?Ce:Ee,et=x[w],it="y"===w?"height":"width",nt=et+m[Q],ot=et-m[tt],st=-1!==[Me,Ae].indexOf(g),rt=null!=(J=null==M?void 0:M[w])?J:0,at=st?nt:et-L[it]-P[it]-rt+k.altAxis,lt=st?et+L[it]+P[it]-rt-k.altAxis:ot,ct=p&&st?Li(at,et,lt):xi(p?at:nt,et,p?lt:ot);x[w]=ct,C[w]=ct-et}e.modifiersData[n]=C}}const bn={name:"preventOverflow",enabled:!0,phase:"main",fn:yn,requiresIfExists:["offset"]};function wn(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function xn(t){return t!==Je(t)&&ti(t)?wn(t):Hi(t)}function Ln(t){var e=t.getBoundingClientRect(),i=li(e.width)/t.offsetWidth||1,n=li(e.height)/t.offsetHeight||1;return 1!==i||1!==n}function Pn(t,e,i){void 0===i&&(i=!1);var n=ti(e),o=ti(e)&&Ln(e),s=mi(e),r=ui(t,o,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&(("body"!==Xe(e)||Ki(s))&&(a=xn(e)),ti(e)?((l=ui(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Wi(s))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Tn(t){var e=new Map,i=new Set,n=[];function o(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&o(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||o(t)})),n}function kn(t){var e=Tn(t);return Ye.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}function Mn(t){var e;return function(){return e||(e=new Promise((function(i){Promise.resolve().then((function(){e=void 0,i(t())}))}))),e}}function Cn(t){var e=t.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}var En={placement:"bottom",modifiers:[],strategy:"absolute"};function An(){for(var t=arguments.length,e=new Array(t),i=0;iNumber.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(U.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...x(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=X.find(lo,this._menu).filter((t=>d(t)));i.length&&P(i,e,t===Fn,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=bo.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(t.button===qn||"keyup"===t.type&&t.key!==Rn)return;const e=X.find(oo);for(const i of e){const e=bo.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),o=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!o||"outside"===e._config.autoClose&&o)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&t.key===Rn||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const s={relatedTarget:e._element};"click"===t.type&&(s.clickEvent=t),e._completeHide(s)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i=t.key===jn,n=[$n,Fn].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const o=this.matches(no)?this:X.prev(this,no)[0]||X.next(this,no)[0]||X.findOne(no,t.delegateTarget.parentNode),s=bo.getOrCreateInstance(o);if(n)return t.stopPropagation(),s.show(),void s._selectMenuItem(t);s._isShown()&&(t.stopPropagation(),s.hide(),o.focus())}}F.on(document,Gn,no,bo.dataApiKeydownHandler),F.on(document,Gn,so,bo.dataApiKeydownHandler),F.on(document,Kn,bo.clearMenus),F.on(document,Yn,bo.clearMenus),F.on(document,Kn,no,(function(t){t.preventDefault(),bo.getOrCreateInstance(this).toggle()})),w(bo);const wo="backdrop",xo="fade",Lo="show",Po=`mousedown.bs.${wo}`,To={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},ko={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Mo extends V{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return To}static get DefaultType(){return ko}static get NAME(){return wo}show(t){if(!this._config.isVisible)return void x(t);this._append();const e=this._getElement();this._config.isAnimated&&m(e),e.classList.add(Lo),this._emulateAnimation((()=>{x(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Lo),this._emulateAnimation((()=>{this.dispose(),x(t)}))):x(t)}dispose(){this._isAppended&&(F.off(this._element,Po),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add(xo),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=u(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),F.on(t,Po,(()=>{x(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){L(t,this._getElement(),this._config.isAnimated)}}const Co="focustrap",Eo=".bs.focustrap",Ao=`focusin${Eo}`,So=`keydown.tab${Eo}`,Oo="Tab",zo="forward",Io="backward",Do={autofocus:!0,trapElement:null},No={autofocus:"boolean",trapElement:"element"};class Bo extends V{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Do}static get DefaultType(){return No}static get NAME(){return Co}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),F.off(document,Eo),F.on(document,Ao,(t=>this._handleFocusin(t))),F.on(document,So,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,F.off(document,Eo))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=X.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===Io?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){t.key===Oo&&(this._lastTabNavDirection=t.shiftKey?Io:zo)}}const Zo=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",jo=".sticky-top",Ro="padding-right",$o="margin-right";class Fo{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ro,(e=>e+t)),this._setElementAttributes(Zo,Ro,(e=>e+t)),this._setElementAttributes(jo,$o,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ro),this._resetElementAttributes(Zo,Ro),this._resetElementAttributes(jo,$o)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth(),o=t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const o=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(o))}px`)};this._applyManipulationCallback(t,o)}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&U.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){const i=t=>{const i=U.getDataAttribute(t,e);null!==i?(U.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)};this._applyManipulationCallback(t,i)}_applyManipulationCallback(t,e){if(h(t))e(t);else for(const i of X.find(t,this._element))e(i)}}const qo="modal",Ho=".bs.modal",Wo="Escape",Uo=`hide${Ho}`,Vo=`hidePrevented${Ho}`,Ko=`hidden${Ho}`,Go=`show${Ho}`,Yo=`shown${Ho}`,Xo=`resize${Ho}`,Jo=`click.dismiss${Ho}`,Qo=`mousedown.dismiss${Ho}`,ts=`keydown.dismiss${Ho}`,es=`click${Ho}.data-api`,is="modal-open",ns="fade",os="show",ss="modal-static",rs=".modal.show",as=".modal-dialog",ls=".modal-body",cs='[data-bs-toggle="modal"]',hs={backdrop:!0,focus:!0,keyboard:!0},us={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class ds extends G{constructor(t,e){super(t,e),this._dialog=X.findOne(as,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Fo,this._addEventListeners()}static get Default(){return hs}static get DefaultType(){return us}static get NAME(){return qo}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||F.trigger(this._element,Go,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(is),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(F.trigger(this._element,Uo).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(os),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){F.off(window,Ho),F.off(this._dialog,Ho),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Mo({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Bo({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=X.findOne(ls,this._dialog);e&&(e.scrollTop=0),m(this._element),this._element.classList.add(os);const i=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,F.trigger(this._element,Yo,{relatedTarget:t})};this._queueCallback(i,this._dialog,this._isAnimated())}_addEventListeners(){F.on(this._element,ts,(t=>{t.key===Wo&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),F.on(window,Xo,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),F.on(this._element,Qo,(t=>{F.one(this._element,Jo,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(is),this._resetAdjustments(),this._scrollBar.reset(),F.trigger(this._element,Ko)}))}_isAnimated(){return this._element.classList.contains(ns)}_triggerBackdropTransition(){if(F.trigger(this._element,Vo).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(ss)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(ss),this._queueCallback((()=>{this._element.classList.remove(ss),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=b()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=b()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=ds.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}F.on(document,es,cs,(function(t){const e=X.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),F.one(e,Go,(t=>{t.defaultPrevented||F.one(e,Ko,(()=>{d(this)&&this.focus()}))}));const i=X.findOne(rs);i&&ds.getInstance(i).hide(),ds.getOrCreateInstance(e).toggle(this)})),J(ds),w(ds);const ps="offcanvas",fs=".bs.offcanvas",_s=".data-api",ms=`load${fs}${_s}`,gs="Escape",vs="show",ys="showing",bs="hiding",ws="offcanvas-backdrop",xs=".offcanvas.show",Ls=`show${fs}`,Ps=`shown${fs}`,Ts=`hide${fs}`,ks=`hidePrevented${fs}`,Ms=`hidden${fs}`,Cs=`resize${fs}`,Es=`click${fs}${_s}`,As=`keydown.dismiss${fs}`,Ss='[data-bs-toggle="offcanvas"]',Os={backdrop:!0,keyboard:!0,scroll:!1},zs={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Is extends G{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Os}static get DefaultType(){return zs}static get NAME(){return ps}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(F.trigger(this._element,Ls,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Fo).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ys);const e=()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(vs),this._element.classList.remove(ys),F.trigger(this._element,Ps,{relatedTarget:t})};this._queueCallback(e,this._element,!0)}hide(){if(!this._isShown)return;if(F.trigger(this._element,Ts).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(bs),this._backdrop.hide();const t=()=>{this._element.classList.remove(vs,bs),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Fo).reset(),F.trigger(this._element,Ms)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=()=>{"static"!==this._config.backdrop?this.hide():F.trigger(this._element,ks)},e=Boolean(this._config.backdrop);return new Mo({className:ws,isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?t:null})}_initializeFocusTrap(){return new Bo({trapElement:this._element})}_addEventListeners(){F.on(this._element,As,(t=>{t.key===gs&&(this._config.keyboard?this.hide():F.trigger(this._element,ks))}))}static jQueryInterface(t){return this.each((function(){const e=Is.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}F.on(document,Es,Ss,(function(t){const e=X.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),p(this))return;F.one(e,Ms,(()=>{d(this)&&this.focus()}));const i=X.findOne(xs);i&&i!==e&&Is.getInstance(i).hide(),Is.getOrCreateInstance(e).toggle(this)})),F.on(window,ms,(()=>{for(const t of X.find(xs))Is.getOrCreateInstance(t).show()})),F.on(window,Cs,(()=>{for(const t of X.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Is.getOrCreateInstance(t).hide()})),J(Is),w(Is);const Ds={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ns=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Bs=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Zs=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Ns.has(i)||Boolean(Bs.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))};function js(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),o=[].concat(...n.body.querySelectorAll("*"));for(const t of o){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),o=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Zs(e,o)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}const Rs="TemplateFactory",$s={allowList:Ds,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Fs={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},qs={entry:"(string|element|function|null)",selector:"(string|element)"};class Hs extends V{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return $s}static get DefaultType(){return Fs}static get NAME(){return Rs}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},qs)}_setContent(t,e,i){const n=X.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?h(e)?this._putElementInTemplate(u(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?js(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return x(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Ws="tooltip",Us=new Set(["sanitize","allowList","sanitizeFn"]),Vs="fade",Ks="show",Gs=".tooltip-inner",Ys=".modal",Xs="hide.bs.modal",Js="hover",Qs="focus",tr="click",er="manual",ir="hide",nr="hidden",or="show",sr="shown",rr="inserted",ar="click",lr="focusin",cr="focusout",hr="mouseenter",ur="mouseleave",dr={AUTO:"auto",TOP:"top",RIGHT:b()?"left":"right",BOTTOM:"bottom",LEFT:b()?"right":"left"},pr={allowList:Ds,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},fr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class _r extends G{constructor(t,e){if(void 0===Dn)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return pr}static get DefaultType(){return fr}static get NAME(){return Ws}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),F.off(this._element.closest(Ys),Xs,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=F.trigger(this._element,this.constructor.eventName(or)),e=(f(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),F.trigger(this._element,this.constructor.eventName(rr))),this._popper=this._createPopper(i),i.classList.add(Ks),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))F.on(t,"mouseover",_);const o=()=>{F.trigger(this._element,this.constructor.eventName(sr)),!1===this._isHovered&&this._leave(),this._isHovered=!1};this._queueCallback(o,this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(F.trigger(this._element,this.constructor.eventName(ir)).defaultPrevented)return;if(this._getTipElement().classList.remove(Ks),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))F.off(t,"mouseover",_);this._activeTrigger[tr]=!1,this._activeTrigger[Qs]=!1,this._activeTrigger[Js]=!1,this._isHovered=null;const t=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),F.trigger(this._element,this.constructor.eventName(nr)))};this._queueCallback(t,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(Vs,Ks),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=a(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(Vs),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Hs({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Gs]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Vs)}_isShown(){return this.tip&&this.tip.classList.contains(Ks)}_createPopper(t){const e=x(this._config.placement,[this,t,this._element]),i=dr[e.toUpperCase()];return In(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return x(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...x(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)F.on(this._element,this.constructor.eventName(ar),this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[tr]=!(e._isShown()&&e._activeTrigger[tr]),e.toggle()}));else if(e!==er){const t=e===Js?this.constructor.eventName(hr):this.constructor.eventName(lr),i=e===Js?this.constructor.eventName(ur):this.constructor.eventName(cr);F.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Qs:Js]=!0,e._enter()})),F.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Qs:Js]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},F.on(this._element.closest(Ys),Xs,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=U.getDataAttributes(this._element);for(const t of Object.keys(e))Us.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:u(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=_r.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}w(_r);const mr="popover",gr=".popover-header",vr=".popover-body",yr={..._r.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},br={..._r.DefaultType,content:"(null|string|element|function)"};class wr extends _r{static get Default(){return yr}static get DefaultType(){return br}static get NAME(){return mr}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[gr]:this._getTitle(),[vr]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=wr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}w(wr);const xr="scrollspy",Lr=".bs.scrollspy",Pr=`activate${Lr}`,Tr=`click${Lr}`,kr=`load${Lr}.data-api`,Mr="dropdown-item",Cr="active",Er='[data-bs-spy="scroll"]',Ar="[href]",Sr=".nav, .list-group",Or=".nav-link",zr=`${Or}, .nav-item > ${Or}, .list-group-item`,Ir=".dropdown",Dr=".dropdown-toggle",Nr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Br={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Zr extends G{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Nr}static get DefaultType(){return Br}static get NAME(){return xr}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=u(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(F.off(this._config.target,Tr),F.on(this._config.target,Tr,Ar,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,o=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of t){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(s));continue}const t=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&t){if(i(s),!n)return}else o||t||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=X.find(Ar,this._config.target);for(const e of t){if(!e.hash||p(e))continue;const t=X.findOne(decodeURI(e.hash),this._element);d(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Cr),this._activateParents(t),F.trigger(this._element,Pr,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains(Mr))X.findOne(Dr,t.closest(Ir)).classList.add(Cr);else for(const e of X.parents(t,Sr))for(const t of X.prev(e,zr))t.classList.add(Cr)}_clearActiveClass(t){t.classList.remove(Cr);const e=X.find(`${Ar}.${Cr}`,t);for(const t of e)t.classList.remove(Cr)}static jQueryInterface(t){return this.each((function(){const e=Zr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}F.on(window,kr,(()=>{for(const t of X.find(Er))Zr.getOrCreateInstance(t)})),w(Zr);const jr="tab",Rr=".bs.tab",$r=`hide${Rr}`,Fr=`hidden${Rr}`,qr=`show${Rr}`,Hr=`shown${Rr}`,Wr=`click${Rr}`,Ur=`keydown${Rr}`,Vr=`load${Rr}`,Kr="ArrowLeft",Gr="ArrowRight",Yr="ArrowUp",Xr="ArrowDown",Jr="Home",Qr="End",ta="active",ea="fade",ia="show",na="dropdown",oa=".dropdown-toggle",sa=".dropdown-menu",ra=`:not(${oa})`,aa='.list-group, .nav, [role="tablist"]',la=".nav-item, .list-group-item",ca='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ha=`.nav-link${ra}, .list-group-item${ra}, [role="tab"]${ra}, ${ca}`,ua=`.${ta}[data-bs-toggle="tab"], .${ta}[data-bs-toggle="pill"], .${ta}[data-bs-toggle="list"]`;class da extends G{constructor(t){super(t),this._parent=this._element.closest(aa),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),F.on(this._element,Ur,(t=>this._keydown(t))))}static get NAME(){return jr}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?F.trigger(e,$r,{relatedTarget:t}):null;F.trigger(t,qr,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(ta),this._activate(X.getElementFromSelector(t));const i=()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),F.trigger(t,Hr,{relatedTarget:e})):t.classList.add(ia)};this._queueCallback(i,t,t.classList.contains(ea))}_deactivate(t,e){if(!t)return;t.classList.remove(ta),t.blur(),this._deactivate(X.getElementFromSelector(t));const i=()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),F.trigger(t,Fr,{relatedTarget:e})):t.classList.remove(ia)};this._queueCallback(i,t,t.classList.contains(ea))}_keydown(t){if(![Kr,Gr,Yr,Xr,Jr,Qr].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!p(t)));let i;if([Jr,Qr].includes(t.key))i=e[t.key===Jr?0:e.length-1];else{const n=[Gr,Xr].includes(t.key);i=P(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),da.getOrCreateInstance(i).show())}_getChildren(){return X.find(ha,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=X.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains(na))return;const n=(t,n)=>{const o=X.findOne(t,i);o&&o.classList.toggle(n,e)};n(oa,ta),n(sa,ia),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(ta)}_getInnerElement(t){return t.matches(ha)?t:X.findOne(ha,t)}_getOuterElement(t){return t.closest(la)||t}static jQueryInterface(t){return this.each((function(){const e=da.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}F.on(document,Wr,ca,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),p(this)||da.getOrCreateInstance(this).show()})),F.on(window,Vr,(()=>{for(const t of X.find(ua))da.getOrCreateInstance(t)})),w(da);const pa="toast",fa=".bs.toast",_a=`mouseover${fa}`,ma=`mouseout${fa}`,ga=`focusin${fa}`,va=`focusout${fa}`,ya=`hide${fa}`,ba=`hidden${fa}`,wa=`show${fa}`,xa=`shown${fa}`,La="fade",Pa="hide",Ta="show",ka="showing",Ma={animation:"boolean",autohide:"boolean",delay:"number"},Ca={animation:!0,autohide:!0,delay:5e3};class Ea extends G{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Ca}static get DefaultType(){return Ma}static get NAME(){return pa}show(){if(F.trigger(this._element,wa).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(La);const t=()=>{this._element.classList.remove(ka),F.trigger(this._element,xa),this._maybeScheduleHide()};this._element.classList.remove(Pa),m(this._element),this._element.classList.add(Ta,ka),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown())return;if(F.trigger(this._element,ya).defaultPrevented)return;const t=()=>{this._element.classList.add(Pa),this._element.classList.remove(ka,Ta),F.trigger(this._element,ba)};this._element.classList.add(ka),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ta),super.dispose()}isShown(){return this._element.classList.contains(Ta)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){F.on(this._element,_a,(t=>this._onInteraction(t,!0))),F.on(this._element,ma,(t=>this._onInteraction(t,!1))),F.on(this._element,ga,(t=>this._onInteraction(t,!0))),F.on(this._element,va,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Ea.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return J(Ea),w(Ea),{Alert:st,Button:ht,Carousel:re,Collapse:ke,Dropdown:bo,Modal:ds,Offcanvas:Is,Popover:wr,ScrollSpy:Zr,Tab:da,Toast:Ea,Tooltip:_r}}());var Yi,Xi,Ji={};async function Qi(t,e){if(window.location.protocol.match(/^http/))if(Ji[t])e.innerHTML=Ji[t];else try{await fetch(t).then((t=>t.text())).then((i=>{i=i.replace("Nominatim_API_Endpoint",tn()),e.innerHTML=i,Ji[t]=i}))}catch(i){e.innerHTML=`Error fetching content from ${t} (${i})`}else e.innerHTML=`Cannot display data from ${t} here. Browser security prevents loading content from file:// URLs.`}function tn(t){var e=Nominatim_Config.Nominatim_API_Endpoint;return"function"==typeof e?e(t):t?e+t:e}function en(t,e){return 1===e.dedupe&&delete e.dedupe,function(t,e){for(var i=Object.keys(e),n=0;nencodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}function nn(t){document.title=[t,Nominatim_Config.Page_Title].filter((t=>t&&t.length>1)).join(" | ")} /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed - */var en=function(){if(Gi)return Ki;Gi=1;var t=/["'&<>]/;return Ki=function(e){var i,n=""+e,o=t.exec(n);if(!o)return n;var s="",r=0,a=0;for(r=o.index;r{this.page?.tab!==t&&this.#q&&(this.#q.abort(),this.#q=void 0),this.page={tab:t,params:e},this.lastApiRequestURL=null,this.errorMessage=null}))}async fetchFromApi(t,e,i){const n=Qi(t,e),o=new URLSearchParams(window.location.search).get("mock_api_error"),s={};this.requestProgress="start","status"!==t&&(this.lastApiRequestURL=null,this.#q?.abort(),this.#q=new AbortController,s.signal=this.#q.signal),Nominatim_Config.Nominatim_API_Endpoint_Headers&&(s.headers=Nominatim_Config.Nominatim_API_Endpoint_Headers);try{await fetch(n,s).then((async t=>{if((t.status>=200&&t.status<300||404===t.status)&&"fetch"!==o){var e;try{e="parse"===o?JSON.parse("{"):await t.json()}catch(t){return void(this.errorMessage=`Error parsing JSON data from ${n} (${t})`)}return e}this.errorMessage=`Error fetching data from ${n} (${t.statusText})`})).then((t=>{t&&(t.error&&(this.errorMessage=t.error.message),i(t)),this.requestProgress="finish"}))}catch(t){"AbortError"!==t.name&&(this.errorMessage=`Error fetching data from ${n} (${t})`,this.requestProgress="finish")}"status"!==t&&(this.lastApiRequestURL=n)}};var hn=hi('

Addresses and postcodes are approximate.\n Blue circle is the result.\n In case of reverse geocoding the smaller red circle is at the search position.

');var un=hi("");function dn(t,e){H(e,!0);let i=qi(e,"params_hash",19,(()=>({}))),n=qi(e,"extra_classes",3,"");const o=Pt((()=>{const t=new URLSearchParams(i()).toString();return e.page+".html"+(t?"?":"")+t}));var s=un();s.__click=function(t){t.preventDefault(),t.stopPropagation(),cn.refreshPage(e.page,new URLSearchParams(i()))};var r=Vt(s),a=t=>{var i=di();yi(Kt(i),(()=>e.text_snippet)),pi(t,i)},l=t=>{var i=ui();ae((()=>fi(i,e.text))),pi(t,i)};vi(r,(t=>{e.text_snippet?t(a):t(l,!1)})),ae((()=>{Ii(s,"href",Ve(o)),Pi(s,0,wi(n()))})),pi(t,s),W()}si(["click"]);var pn=hi(" ");si(["click"]);var fn=["second","minute","hour","day","week","month","year"];var _n=["秒","分钟","小时","天","周","个月","年"];var mn={},gn=function(t,e){mn[t]=e},vn=[60,60,24,7,365/7/12,12];function yn(t,e){var i;return(+new Date-+((i=t)instanceof Date?i:!isNaN(i)||/^\d+$/.test(i)?new Date(parseInt(i)):(i=(i||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(i))))/1e3}var bn=function(t,e,i){return function(t,e){for(var i=t<0?1:0,n=t=Math.abs(t),o=0;t>=vn[o]&&o(0==(o*=2)?9:1)&&(o+=1),e(t,o,n)[i].replace("%s",t.toString())}(yn(t),function(t){return mn[t]||mn.en_US}(e))};gn("en_US",(function(t,e){if(0===e)return["just now","right now"];var i=fn[Math.floor(e/2)];return t>1&&(i+="s"),[t+" "+i+" ago","in "+t+" "+i]})),gn("zh_CN",(function(t,e){if(0===e)return["刚刚","片刻后"];var i=_n[~~(e/2)];return[t+" "+i+"前",t+" "+i+"后"]}));var wn=hi(''),xn=hi('Data last updated: ',1),Ln=hi('
Loading data from API ...
()
');var Pn,Tn,kn=(Pn=()=>cn,Tn=Ot(0),function(){return 1===arguments.length?(It(Tn,Ve(Tn)+1),arguments[0]):(Ve(Tn),Pn())}),Mn=hi('
');si(["click"]);const Cn=new class{#H=zt();get center(){return Ve(this.#H)}set center(t){It(this.#H,t,!0)}#W=zt();get zoom(){return Ve(this.#W)}set zoom(t){It(this.#W,t,!0)}#U=zt();get viewboxStr(){return Ve(this.#U)}set viewboxStr(t){It(this.#U,t,!0)}#V=zt();get lastClick(){return Ve(this.#V)}set lastClick(t){It(this.#V,t,!0)}#K=zt();get mousePos(){return Ve(this.#K)}set mousePos(t){It(this.#K,t,!0)}reset(){this.center=void 0,this.zoom=void 0,this.viewboxStr="",this.lastClick=void 0,this.mousePos=void 0}}; + */var on=function(){if(Xi)return Yi;Xi=1;var t=/["'&<>]/;return Yi=function(e){var i,n=""+e,o=t.exec(n);if(!o)return n;var s="",r=0,a=0;for(r=o.index;r{this.page?.tab!==t&&this.#q&&(this.#q.abort(),this.#q=void 0),this.page={tab:t,params:e},this.lastApiRequestURL=null,this.errorMessage=null}))}async fetchFromApi(t,e,i){const n=en(t,e),o=new URLSearchParams(window.location.search).get("mock_api_error"),s={};this.requestProgress="start","status"!==t&&(this.lastApiRequestURL=null,this.#q?.abort(),this.#q=new AbortController,s.signal=this.#q.signal),Nominatim_Config.Nominatim_API_Endpoint_Headers&&(s.headers=Nominatim_Config.Nominatim_API_Endpoint_Headers);try{await fetch(n,s).then((async t=>{if((t.status>=200&&t.status<300||404===t.status)&&"fetch"!==o){var e;try{e="parse"===o?JSON.parse("{"):await t.json()}catch(t){return void(this.errorMessage=`Error parsing JSON data from ${n} (${t})`)}return e}this.errorMessage=`Error fetching data from ${n} (${t.statusText})`})).then((t=>{t&&(t.error&&(this.errorMessage=t.error.message),i(t)),this.requestProgress="finish"}))}catch(t){"AbortError"!==t.name&&(this.errorMessage=`Error fetching data from ${n} (${t})`,this.requestProgress="finish")}"status"!==t&&(this.lastApiRequestURL=n)}};var dn=si('

Addresses and postcodes are approximate.\n Blue circle is the result.\n In case of reverse geocoding the smaller red circle is at the search position.

');var pn=si("");function fn(t,e){W(e,!0);let i=Wi(e,"params_hash",19,(()=>({}))),n=Wi(e,"extra_classes",3,"");const o=bt((()=>{const t=new URLSearchParams(i()).toString();return e.page+".html"+(t?"?":"")+t}));var s=pn();s.__click=function(t){t.preventDefault(),t.stopPropagation(),un.refreshPage(e.page,new URLSearchParams(i()))};var r=qt(s),a=t=>{var i=ai();wi(Ht(i),(()=>e.text_snippet)),li(t,i)},l=t=>{var i=ri();ne((()=>ci(i,e.text))),li(t,i)};pi(r,(t=>{e.text_snippet?t(a):t(l,!1)})),ne((()=>{Ni(s,"href",Fe(o)),ki(s,0,Li(n()))})),li(t,s),U()}ti(["click"]);var _n=si(" ");ti(["click"]);var mn=["second","minute","hour","day","week","month","year"];var gn=["秒","分钟","小时","天","周","个月","年"];var vn={},yn=function(t,e){vn[t]=e},bn=[60,60,24,7,365/7/12,12];function wn(t,e){var i;return(+new Date-+((i=t)instanceof Date?i:!isNaN(i)||/^\d+$/.test(i)?new Date(parseInt(i)):(i=(i||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(i))))/1e3}var xn=function(t,e,i){return function(t,e){for(var i=t<0?1:0,n=t=Math.abs(t),o=0;t>=bn[o]&&o(0==(o*=2)?9:1)&&(o+=1),e(t,o,n)[i].replace("%s",t.toString())}(wn(t),function(t){return vn[t]||vn.en_US}(e))};yn("en_US",(function(t,e){if(0===e)return["just now","right now"];var i=mn[Math.floor(e/2)];return t>1&&(i+="s"),[t+" "+i+" ago","in "+t+" "+i]})),yn("zh_CN",(function(t,e){if(0===e)return["刚刚","片刻后"];var i=gn[~~(e/2)];return[t+" "+i+"前",t+" "+i+"后"]}));var Ln=si(''),Pn=si('Data last updated: ',1),Tn=si('
Loading data from API ...
()
');var kn,Mn,Cn=(kn=()=>un,Mn=Ct(0),function(){return 1===arguments.length?(At(Mn,Fe(Mn)+1),arguments[0]):(Fe(Mn),kn())}),En=si('
');ti(["click"]);const An=new class{#H=Et();get center(){return Fe(this.#H)}set center(t){At(this.#H,t,!0)}#W=Et();get zoom(){return Fe(this.#W)}set zoom(t){At(this.#W,t,!0)}#U=Et();get viewboxStr(){return Fe(this.#U)}set viewboxStr(t){At(this.#U,t,!0)}#V=Et();get lastClick(){return Fe(this.#V)}set lastClick(t){At(this.#V,t,!0)}#K=Et();get mousePos(){return Fe(this.#K)}set mousePos(t){At(this.#K,t,!0)}reset(){this.center=void 0,this.zoom=void 0,this.viewboxStr="",this.lastClick=void 0,this.mousePos=void 0}}; /*! * https://getbootstrap.com/docs/5.3/customize/color-modes/#javascript * * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) * Copyright 2011-2025 The Bootstrap Authors * Licensed under the Creative Commons Attribution 3.0 Unported License. - */function En(){const t=()=>localStorage.getItem("theme"),e=()=>{const e=t();return e||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")},i=t=>{"auto"===t?document.documentElement.setAttribute("data-bs-theme",window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"):document.documentElement.setAttribute("data-bs-theme",t)};i(e());const n=(t,e=!1)=>{const i=document.querySelector("#bd-theme");if(!i)return;const n=document.querySelector("#bd-theme-text"),o=document.querySelector(`[data-bs-theme-value="${t}"]`);document.querySelectorAll("[data-bs-theme-value]").forEach((t=>{t.classList.remove("active"),t.setAttribute("aria-pressed","false")})),o.classList.add("active"),o.setAttribute("aria-pressed","true");const s=`${n.textContent} (${o.dataset.bsThemeValue})`;i.setAttribute("aria-label",s),e&&i.focus()};window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{const n=t();"light"!==n&&"dark"!==n&&i(e())})),n(e()),document.querySelectorAll("[data-bs-theme-value]").forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-bs-theme-value");(t=>{localStorage.setItem("theme",t)})(e),i(e),n(e,!0)}))}))}var An=hi('

',1),Sn=hi(''),On=hi('

',1);function zn(t,e){H(e,!0);const i=t=>{var e=An(),i=Vt(Gt(Kt(e),2));ae((()=>fi(i,n))),pi(t,e)},n=Nominatim_Config.Page_Title,o=Nominatim_Config.Reverse_Only;let s=Pt((()=>cn.page.tab));Hi(En);var r=On(),a=Kt(r),l=Vt(a),c=Vt(l),h=Vt(c),d=Vt(h);{let t=Pt((()=>o?"reverse":"search"));dn(d,{get text_snippet(){return i},get page(){return Ve(t)}})}var p=Gt(h,4),f=Vt(p),_=Vt(f),m=t=>{var e=Sn(),i=Vt(e);{let t=Pt((()=>"search"===Ve(s)?"active":""));dn(i,{page:"search",text:"Search",get extra_classes(){return`nav-link ${Ve(t)??""}`}})}pi(t,e)};vi(_,(t=>{o||t(m)}));var g=Gt(_,2),v=Vt(g);{let t=Pt((()=>Cn.center?.lat)),e=Pt((()=>Cn.center?.lng)),i=Pt((()=>"reverse"===Ve(s)?"active":""));!function(t,e){H(e,!0);let i=qi(e,"lat",3,null),n=qi(e,"lon",3,null),o=qi(e,"zoom",3,null),s=qi(e,"extra_classes",3,"");const r=Pt((()=>{const t={};return i()&&n()&&(t.lat=i(),t.lon=n(),o()&&t.set("zoom",o())),new URLSearchParams(t)})),a=Pt((()=>{let t=Ve(r).toString();return"reverse.html"+(t?"?":"")+t}));var l=pn();l.__click=function(t){t.preventDefault(),t.stopPropagation(),cn.refreshPage("reverse",Ve(r))};var c=Vt(l);ae((()=>{Ii(l,"href",Ve(a)),Pi(l,0,wi(s())),fi(c,e.text)})),pi(t,l),W()}(v,{get lat(){return Ve(t)},get lon(){return Ve(e)},text:"Reverse",get extra_classes(){return`nav-link ${Ve(i)??""}`}})}var y=Vt(Gt(g,2));{let t=Pt((()=>"details"===Ve(s)?"active":""));dn(y,{page:"details",text:"Search By ID",get extra_classes(){return`nav-link ${Ve(t)??""}`}})}var b=Gt(p,2),w=Gt(Vt(b),2),x=Vt(w);{let t=Pt((()=>"about"===Ve(s)?"active":""));dn(x,{page:"about",text:"About & Help",get extra_classes(){return`nav-link ${Ve(t)??""}`}})}var L=Gt(a,2),P=Vt(L),T=Vt(P),k=Gt(L,2);yi(Vt(k),(()=>e.subheader??u));var M=Gt(k,2);!function(t,e){H(e,!1),Ri();var i=di(),n=Kt(i),o=t=>{var e=Mn(),i=Vt(e);Gt(i).__click=()=>kn(kn().errorMessage=null),ae((()=>fi(i,`${kn().errorMessage??""} `))),pi(t,e)};vi(n,(t=>{kn().errorMessage&&t(o)})),pi(t,i),W()}(M,{}),function(t,e){H(e,!0);let i=zt(void 0),n=Pt((()=>{const t=cn.lastApiRequestURL;if(t){const e=new URL(t,window.location.origin);return e.searchParams.delete("polygon_geojson"),e.toString()}}));Hi((()=>{cn.fetchFromApi("status",{format:"json"},(function(t){It(i,t.data_updated,!0)}))}));var o=Ln(),s=Vt(o);let r;var a=Vt(Gt(s,2)),l=Vt(a),c=t=>{var e=wn(),i=Gt(Vt(e)),o=Gt(i,2),s=Gt(Vt(o));ae((()=>{Ii(i,"href",Ve(n)),Ii(s,"href",`${Ve(n)??""}&debug=1`)})),pi(t,e)};vi(l,(t=>{Ve(n)&&t(c)}));var h=Vt(Gt(a,2)),u=t=>{var e=xn(),n=Gt(Kt(e)),o=Vt(n);ae((t=>{Ii(n,"title",`${Ve(i)??""} (UTC timezone)`),fi(o,t)}),[()=>bn(new Date(Ve(i)))]),pi(t,e)};vi(h,(t=>{Ve(i)&&t(u)})),dn(Gt(h,2),{page:"status",text:"Details"}),ae((()=>r=ki(s,"",r,{display:"start"===cn.requestProgress?"block":"none"}))),pi(t,o),W()}(Gt(M,2),{}),ae((()=>fi(T,Ve(s)))),pi(t,r),W()}const In=Symbol();class Dn extends URLSearchParams{#G=zt(0);#Y=function(){return Nn}();#X=!1;#J(){if(!this.#Y||this.#X)return;this.#X=!0;const t=this.toString();this.#Y.search=t&&`?${t}`,this.#X=!1}[In](t){if(!this.#X){this.#X=!0;for(const t of[...super.keys()])super.delete(t);for(const[e,i]of t)super.append(e,i);Nt(this.#G),this.#X=!1}}append(t,e){super.append(t,e),this.#J(),Nt(this.#G)}delete(t,e){var i=super.has(t,e);super.delete(t,e),i&&(this.#J(),Nt(this.#G))}get(t){return Ve(this.#G),super.get(t)}getAll(t){return Ve(this.#G),super.getAll(t)}has(t,e){return Ve(this.#G),super.has(t,e)}keys(){return Ve(this.#G),super.keys()}set(t,e){var i=super.getAll(t).join("");super.set(t,e),i!==super.getAll(t).join("")&&(this.#J(),Nt(this.#G))}sort(){super.sort(),this.#J(),Nt(this.#G)}toString(){return Ve(this.#G),super.toString()}values(){return Ve(this.#G),super.values()}entries(){return Ve(this.#G),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return Ve(this.#G),super.size}}let Nn=null;var Bn=hi('');function Zn(t,e){H(e,!0);var i=Bn(),n=Vt(i);yi(Vt(n),(()=>e.content??u)),oi("submit",i,(function(t){t.preventDefault();let i=t.target,n=!0;Array.prototype.slice.call(i.elements).forEach((function(t){(function(t){return!("hidden"===t.type&&t.value.length&&t.pattern&&!t.value.match(t.pattern))&&t.checkValidity()})(t)||(alert("Invalid input in "+t.name),n=!1)})),n&&cn.refreshPage(e.page,function(t){var e=new Dn;return Array.prototype.slice.call(t.elements).forEach((function(t){!t.name||t.disabled||["submit","button"].indexOf(t.type)>-1||["checkbox","radio"].indexOf(t.type)>-1&&!t.checked||void 0!==t.value&&""!==t.value&&("dedupe"!==t.name||1!==t.value&&"1"!==t.value)&&e.set(t.name,t.value)})),e}(i))})),pi(t,i),W()}var jn=hi('Unless languages is set, your browser is using "" (details).');function Rn(t){var e=jn();Gt(Vt(e)).textContent=navigator.language,pi(t,e)}var $n=hi('
'),Fn=hi('
',1),qn=hi('
',1),Hn=hi('
Advanced options
',1);si(["change"]);var Wn=hi(" ");function Un(t,e){H(e,!0);let i=qi(e,"text",3,"details"),n=qi(e,"extra_classes",3,""),o=qi(e,"feature",3,null);const s=Pt((()=>{const t={};var e;return null!==o()&&(o().osm_type?(1===o().osm_type.length?t.osmtype=o().osm_type:t.osmtype="node"===(e=o().osm_type)?"N":"way"===e?"W":"relation"===e?"R":"",t.osmid=o().osm_id,o().class?t.class=o().class:o().category&&(t.class=o().category)):o().place_id&&(t.place_id=o().place_id)),new URLSearchParams(t)})),r=Pt((()=>{const t=Ve(s).toString();return"details.html"+(t?"?":"")+t}));var a=Wn();a.__click=function(t){t.preventDefault(),t.stopPropagation(),cn.refreshPage("details",Ve(s))};var l=Vt(a);ae((()=>{Ii(a,"href",Ve(r)),Pi(a,0,wi(n())),fi(l,i())})),pi(t,a),W()}si(["click"]);var Vn=hi('
');var Kn=hi('');function Gn(t,e){H(e,!0);const i=Pt((()=>{return t=e.aPlace.category,i=e.aPlace.type,{"boundary:administrative":"poi_boundary_administrative","place:city":"poi_place_city","place:town":"poi_place_town","place:village":"poi_place_village","place:hamlet":"poi_place_village","place:suburb":"poi_place_village","place:locality":"poi_place_village","place:airport":"transport_airport2","aeroway:aerodrome":"transport_airport2","railway:station":"transport_train_station2","amenity:place_of_worship":"place_of_worship_unknown3","amenity:pub":"food_pub","amenity:bar":"food_bar","amenity:university":"education_university","tourism:museum":"tourist_museum","amenity:arts_centre":"tourist_art_gallery2","tourism:zoo":"tourist_zoo","tourism:theme_park":"poi_point_of_interest","tourism:attraction":"poi_point_of_interest","leisure:golf_course":"sport_golf","historic:castle":"tourist_castle","amenity:hospital":"health_hospital","amenity:school":"education_school","amenity:theatre":"tourist_theatre","amenity:library":"amenity_library","amenity:fire_station":"amenity_firestation3","amenity:police":"amenity_police2","amenity:bank":"money_bank2","amenity:post_office":"amenity_post_office","tourism:hotel":"accommodation_hotel2","amenity:cinema":"tourist_cinema","tourism:artwork":"tourist_art_gallery2","historic:archaeological_site":"tourist_archaeological2","amenity:doctors":"health_doctors","leisure:sports_centre":"sport_leisure_centre","leisure:swimming_pool":"sport_swimming_outdoor","shop:supermarket":"shopping_supermarket","shop:convenience":"shopping_convenience","amenity:restaurant":"food_restaurant","amenity:fast_food":"food_fastfood","amenity:cafe":"food_cafe","tourism:guest_house":"accommodation_bed_and_breakfast","amenity:pharmacy":"health_pharmacy_dispensing","amenity:fuel":"transport_fuel","natural:peak":"poi_peak","natural:wood":"landuse_coniferous_and_deciduous","shop:bicycle":"shopping_bicycle","shop:clothes":"shopping_clothes","shop:hairdresser":"shopping_hairdresser","shop:doityourself":"shopping_diy","shop:estate_agent":"shopping_estateagent2","shop:car":"shopping_car","shop:garden_centre":"shopping_garden_centre","shop:car_repair":"shopping_car_repair","shop:bakery":"shopping_bakery","shop:butcher":"shopping_butcher","shop:apparel":"shopping_clothes","shop:laundry":"shopping_laundrette","shop:beverages":"shopping_alcohol","shop:alcohol":"shopping_alcohol","shop:optician":"health_opticians","shop:chemist":"health_pharmacy","shop:gallery":"tourist_art_gallery2","shop:jewelry":"shopping_jewelry","tourism:information":"amenity_information","historic:ruins":"tourist_ruin","amenity:college":"education_school","historic:monument":"tourist_monument","historic:memorial":"tourist_monument","historic:mine":"poi_mine","tourism:caravan_site":"accommodation_caravan_park","amenity:bus_station":"transport_bus_station","amenity:atm":"money_atm2","tourism:viewpoint":"tourist_view_point","tourism:guesthouse":"accommodation_bed_and_breakfast","railway:tram":"transport_tram_stop","amenity:courthouse":"amenity_court","amenity:recycling":"amenity_recycling","amenity:dentist":"health_dentist","natural:beach":"tourist_beach","railway:tram_stop":"transport_tram_stop","amenity:prison":"amenity_prison","highway:bus_stop":"transport_bus_stop2"}[t+":"+i];var t,i})),n=Pt((()=>"icon for "+e.aPlace.category+" "+e.aPlace.type)),o=Pt((()=>Nominatim_Config.Images_Base_Url+Ve(i)+".p.20.png"));var s=di(),r=Kt(s),a=t=>{var e=Kn();ae((()=>{Ii(e,"src",Ve(o)),Ii(e,"alt",Ve(n))})),pi(t,e)};vi(r,(t=>{Ve(i)&&t(a)})),pi(t,s),W()}var Yn=hi('

'),Xn=hi(''),Jn=hi('
'),Qn=hi(''),to=hi('
No search results found
');function eo(t,e){H(e,!0);let i=qi(e,"reverse_search",3,!1),n=qi(e,"current_result",15),o=zt(void 0),s=Pt((()=>{const t=new URLSearchParams(window.location.search),i=e.results;let n=[];t.has("exclude_place_ids")&&(n=t.get("exclude_place_ids").split(","));for(var o=0;o{e.results&&It(o,0)})),ne((()=>{n(e.results&&e.results.length>Ve(o)?e.results[Ve(o)]:null)}));var a=di(),l=Kt(a),c=t=>{var n=Jn(),a=Vt(n);gt(a,17,(()=>e.results),mt,((t,e,i)=>{var n=Yn();let s;Ii(n,"data-position",i),n.__click=r;var a=Vt(n);Gn(Vt(a),{get aPlace(){return Ve(e)}});var l=Gt(a,2),c=Vt(l),h=Gt(l,2),u=Vt(h),d=Gt(h,2),p=Vt(d);Un(Gt(d,2),{extra_classes:"btn btn-outline-secondary btn-sm",get feature(){return Ve(e)}}),ae((t=>{s=Pi(n,0,"result svelte-3u0x56",null,s,{highlight:i===Ve(o)}),fi(c,Ve(e).display_name),fi(u,t),fi(p,`${Ve(e).lat??""},${Ve(e).lon??""}`)}),[()=>function(t){if(t.label)return t.label;function e(t){return t&&t[0].toUpperCase()+t.slice(1)}return t.type&&"yes"===t.type&&t.category?e(t.category.replace(/_/g," ")):t.type?e(t.type.replace(/_/g," ")):""}(Ve(e))]),oi("keypress",n,r),pi(t,n)}));var l=Gt(a,2),c=t=>{var e=Xn(),i=Vt(e);ae((()=>Ii(i,"href",Ve(s)))),pi(t,e)};vi(l,(t=>{Ve(s)&&!i()&&t(c)})),pi(t,n)},h=t=>{var n=di(),o=Kt(n),s=t=>{var e=di(),n=Kt(e),o=t=>{pi(t,Qn())},s=t=>{pi(t,to())};vi(n,(t=>{i()?t(o):t(s,!1)})),pi(t,e)},r=t=>{!function(t,e){H(e,!1),Hi((()=>{Xi("theme/welcome.html",document.getElementById("welcome"))})),Ri(),pi(t,Vn()),W()}(t,{})};vi(o,(t=>{e.results?t(s):t(r,!1)}),!0),pi(t,n)};vi(l,(t=>{e.results&&e.results.length>0?t(c):t(h,!1)})),pi(t,a),W()}si(["click"]);var io,no={exports:{}}; + */function Sn(){const t=()=>localStorage.getItem("theme"),e=()=>{const e=t();return e||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")},i=t=>{"auto"===t?document.documentElement.setAttribute("data-bs-theme",window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"):document.documentElement.setAttribute("data-bs-theme",t)};i(e());const n=(t,e=!1)=>{const i=document.querySelector("#bd-theme");if(!i)return;const n=document.querySelector("#bd-theme-text"),o=document.querySelector(`[data-bs-theme-value="${t}"]`);document.querySelectorAll("[data-bs-theme-value]").forEach((t=>{t.classList.remove("active"),t.setAttribute("aria-pressed","false")})),o.classList.add("active"),o.setAttribute("aria-pressed","true");const s=`${n.textContent} (${o.dataset.bsThemeValue})`;i.setAttribute("aria-label",s),e&&i.focus()};window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{const n=t();"light"!==n&&"dark"!==n&&i(e())})),n(e()),document.querySelectorAll("[data-bs-theme-value]").forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-bs-theme-value");(t=>{localStorage.setItem("theme",t)})(e),i(e),n(e,!0)}))}))}var On=si('

',1),zn=si(''),In=si('

',1);function Dn(t,e){W(e,!0);const i=t=>{var e=On(),i=qt(Wt(Ht(e),2));ne((()=>ci(i,n))),li(t,e)},n=Nominatim_Config.Page_Title,o=Nominatim_Config.Reverse_Only;let s=bt((()=>un.page.tab));Ui(Sn);var r=In(),a=Ht(r),l=qt(a),c=qt(l),h=qt(c),d=qt(h);{let t=bt((()=>o?"reverse":"search"));fn(d,{get text_snippet(){return i},get page(){return Fe(t)}})}var p=Wt(h,4),f=qt(p),_=qt(f),m=t=>{var e=zn(),i=qt(e);{let t=bt((()=>"search"===Fe(s)?"active":""));fn(i,{page:"search",text:"Search",get extra_classes(){return`nav-link ${Fe(t)??""}`}})}li(t,e)};pi(_,(t=>{o||t(m)}));var g=Wt(_,2),v=qt(g);{let t=bt((()=>An.center?.lat)),e=bt((()=>An.center?.lng)),i=bt((()=>"reverse"===Fe(s)?"active":""));!function(t,e){W(e,!0);let i=Wi(e,"lat",3,null),n=Wi(e,"lon",3,null),o=Wi(e,"zoom",3,null),s=Wi(e,"extra_classes",3,"");const r=bt((()=>{const t={};return i()&&n()&&(t.lat=i(),t.lon=n(),o()&&t.set("zoom",o())),new URLSearchParams(t)})),a=bt((()=>{let t=Fe(r).toString();return"reverse.html"+(t?"?":"")+t}));var l=_n();l.__click=function(t){t.preventDefault(),t.stopPropagation(),un.refreshPage("reverse",Fe(r))};var c=qt(l);ne((()=>{Ni(l,"href",Fe(a)),ki(l,0,Li(s())),ci(c,e.text)})),li(t,l),U()}(v,{get lat(){return Fe(t)},get lon(){return Fe(e)},text:"Reverse",get extra_classes(){return`nav-link ${Fe(i)??""}`}})}var y=qt(Wt(g,2));{let t=bt((()=>"details"===Fe(s)?"active":""));fn(y,{page:"details",text:"Search By ID",get extra_classes(){return`nav-link ${Fe(t)??""}`}})}var b=Wt(p,2),w=Wt(qt(b),2),x=qt(w);{let t=bt((()=>"about"===Fe(s)?"active":""));fn(x,{page:"about",text:"About & Help",get extra_classes(){return`nav-link ${Fe(t)??""}`}})}var L=Wt(a,2),P=qt(L),T=qt(P),k=Wt(L,2);wi(qt(k),(()=>e.subheader??u));var M=Wt(k,2);!function(t,e){W(e,!1),Fi();var i=ai(),n=Ht(i),o=t=>{var e=En(),i=qt(e);Wt(i).__click=()=>Cn(Cn().errorMessage=null),ne((()=>ci(i,`${Cn().errorMessage??""} `))),li(t,e)};pi(n,(t=>{Cn().errorMessage&&t(o)})),li(t,i),U()}(M,{}),function(t,e){W(e,!0);let i=Et(void 0),n=bt((()=>{const t=un.lastApiRequestURL;if(t){const e=new URL(t,window.location.origin);return e.searchParams.delete("polygon_geojson"),e.toString()}}));Ui((()=>{un.fetchFromApi("status",{format:"json"},(function(t){At(i,t.data_updated,!0)}))}));var o=Tn(),s=qt(o);let r;var a=qt(Wt(s,2)),l=qt(a),c=t=>{var e=Ln(),i=Wt(qt(e)),o=Wt(i,2),s=Wt(qt(o));ne((()=>{Ni(i,"href",Fe(n)),Ni(s,"href",`${Fe(n)??""}&debug=1`)})),li(t,e)};pi(l,(t=>{Fe(n)&&t(c)}));var h=qt(Wt(a,2)),u=t=>{var e=Pn(),n=Wt(Ht(e)),o=qt(n);ne((t=>{Ni(n,"title",`${Fe(i)??""} (UTC timezone)`),ci(o,t)}),[()=>xn(new Date(Fe(i)))]),li(t,e)};pi(h,(t=>{Fe(i)&&t(u)})),fn(Wt(h,2),{page:"status",text:"Details"}),ne((()=>r=Ci(s,"",r,{display:"start"===un.requestProgress?"block":"none"}))),li(t,o),U()}(Wt(M,2),{}),ne((()=>ci(T,Fe(s)))),li(t,r),U()}const Nn=Symbol();class Bn extends URLSearchParams{#G=Et(0);#Y=function(){return Zn}();#X=!1;#J(){if(!this.#Y||this.#X)return;this.#X=!0;const t=this.toString();this.#Y.search=t&&`?${t}`,this.#X=!1}[Nn](t){if(!this.#X){this.#X=!0;for(const t of[...super.keys()])super.delete(t);for(const[e,i]of t)super.append(e,i);Ot(this.#G),this.#X=!1}}append(t,e){super.append(t,e),this.#J(),Ot(this.#G)}delete(t,e){var i=super.has(t,e);super.delete(t,e),i&&(this.#J(),Ot(this.#G))}get(t){return Fe(this.#G),super.get(t)}getAll(t){return Fe(this.#G),super.getAll(t)}has(t,e){return Fe(this.#G),super.has(t,e)}keys(){return Fe(this.#G),super.keys()}set(t,e){var i=super.getAll(t).join("");super.set(t,e),i!==super.getAll(t).join("")&&(this.#J(),Ot(this.#G))}sort(){super.sort(),this.#J(),Ot(this.#G)}toString(){return Fe(this.#G),super.toString()}values(){return Fe(this.#G),super.values()}entries(){return Fe(this.#G),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return Fe(this.#G),super.size}}let Zn=null;var jn=si('');function Rn(t,e){W(e,!0);var i=jn(),n=qt(i);wi(qt(n),(()=>e.content??u)),Qe("submit",i,(function(t){t.preventDefault();let i=t.target,n=!0;Array.prototype.slice.call(i.elements).forEach((function(t){(function(t){return!("hidden"===t.type&&t.value.length&&t.pattern&&!t.value.match(t.pattern))&&t.checkValidity()})(t)||(alert("Invalid input in "+t.name),n=!1)})),n&&un.refreshPage(e.page,function(t){var e=new Bn;return Array.prototype.slice.call(t.elements).forEach((function(t){!t.name||t.disabled||["submit","button"].indexOf(t.type)>-1||["checkbox","radio"].indexOf(t.type)>-1&&!t.checked||void 0!==t.value&&""!==t.value&&("dedupe"!==t.name||1!==t.value&&"1"!==t.value)&&e.set(t.name,t.value)})),e}(i))})),li(t,i),U()}var $n=si('Unless languages is set, your browser is using "" (details).');function Fn(t){var e=$n();Wt(qt(e)).textContent=navigator.language,li(t,e)}var qn=si('
'),Hn=si('
',1),Wn=si('
',1),Un=si('
Advanced options
',1);ti(["change"]);var Vn=si(" ");function Kn(t,e){W(e,!0);let i=Wi(e,"text",3,"details"),n=Wi(e,"extra_classes",3,""),o=Wi(e,"feature",3,null);const s=bt((()=>{const t={};var e;return null!==o()&&(o().osm_type?(1===o().osm_type.length?t.osmtype=o().osm_type:t.osmtype="node"===(e=o().osm_type)?"N":"way"===e?"W":"relation"===e?"R":"",t.osmid=o().osm_id,o().class?t.class=o().class:o().category&&(t.class=o().category)):o().place_id&&(t.place_id=o().place_id)),new URLSearchParams(t)})),r=bt((()=>{const t=Fe(s).toString();return"details.html"+(t?"?":"")+t}));var a=Vn();a.__click=function(t){t.preventDefault(),t.stopPropagation(),un.refreshPage("details",Fe(s))};var l=qt(a);ne((()=>{Ni(a,"href",Fe(r)),ki(a,0,Li(n())),ci(l,i())})),li(t,a),U()}ti(["click"]);var Gn=si('
');var Yn=si('');function Xn(t,e){W(e,!0);const i=bt((()=>{return t=e.aPlace.category,i=e.aPlace.type,{"boundary:administrative":"poi_boundary_administrative","place:city":"poi_place_city","place:town":"poi_place_town","place:village":"poi_place_village","place:hamlet":"poi_place_village","place:suburb":"poi_place_village","place:locality":"poi_place_village","place:airport":"transport_airport2","aeroway:aerodrome":"transport_airport2","railway:station":"transport_train_station2","amenity:place_of_worship":"place_of_worship_unknown3","amenity:pub":"food_pub","amenity:bar":"food_bar","amenity:university":"education_university","tourism:museum":"tourist_museum","amenity:arts_centre":"tourist_art_gallery2","tourism:zoo":"tourist_zoo","tourism:theme_park":"poi_point_of_interest","tourism:attraction":"poi_point_of_interest","leisure:golf_course":"sport_golf","historic:castle":"tourist_castle","amenity:hospital":"health_hospital","amenity:school":"education_school","amenity:theatre":"tourist_theatre","amenity:library":"amenity_library","amenity:fire_station":"amenity_firestation3","amenity:police":"amenity_police2","amenity:bank":"money_bank2","amenity:post_office":"amenity_post_office","tourism:hotel":"accommodation_hotel2","amenity:cinema":"tourist_cinema","tourism:artwork":"tourist_art_gallery2","historic:archaeological_site":"tourist_archaeological2","amenity:doctors":"health_doctors","leisure:sports_centre":"sport_leisure_centre","leisure:swimming_pool":"sport_swimming_outdoor","shop:supermarket":"shopping_supermarket","shop:convenience":"shopping_convenience","amenity:restaurant":"food_restaurant","amenity:fast_food":"food_fastfood","amenity:cafe":"food_cafe","tourism:guest_house":"accommodation_bed_and_breakfast","amenity:pharmacy":"health_pharmacy_dispensing","amenity:fuel":"transport_fuel","natural:peak":"poi_peak","natural:wood":"landuse_coniferous_and_deciduous","shop:bicycle":"shopping_bicycle","shop:clothes":"shopping_clothes","shop:hairdresser":"shopping_hairdresser","shop:doityourself":"shopping_diy","shop:estate_agent":"shopping_estateagent2","shop:car":"shopping_car","shop:garden_centre":"shopping_garden_centre","shop:car_repair":"shopping_car_repair","shop:bakery":"shopping_bakery","shop:butcher":"shopping_butcher","shop:apparel":"shopping_clothes","shop:laundry":"shopping_laundrette","shop:beverages":"shopping_alcohol","shop:alcohol":"shopping_alcohol","shop:optician":"health_opticians","shop:chemist":"health_pharmacy","shop:gallery":"tourist_art_gallery2","shop:jewelry":"shopping_jewelry","tourism:information":"amenity_information","historic:ruins":"tourist_ruin","amenity:college":"education_school","historic:monument":"tourist_monument","historic:memorial":"tourist_monument","historic:mine":"poi_mine","tourism:caravan_site":"accommodation_caravan_park","amenity:bus_station":"transport_bus_station","amenity:atm":"money_atm2","tourism:viewpoint":"tourist_view_point","tourism:guesthouse":"accommodation_bed_and_breakfast","railway:tram":"transport_tram_stop","amenity:courthouse":"amenity_court","amenity:recycling":"amenity_recycling","amenity:dentist":"health_dentist","natural:beach":"tourist_beach","railway:tram_stop":"transport_tram_stop","amenity:prison":"amenity_prison","highway:bus_stop":"transport_bus_stop2"}[t+":"+i];var t,i})),n=bt((()=>"icon for "+e.aPlace.category+" "+e.aPlace.type)),o=bt((()=>Nominatim_Config.Images_Base_Url+Fe(i)+".p.20.png"));var s=ai(),r=Ht(s),a=t=>{var e=Yn();ne((()=>{Ni(e,"src",Fe(o)),Ni(e,"alt",Fe(n))})),li(t,e)};pi(r,(t=>{Fe(i)&&t(a)})),li(t,s),U()}var Jn=si('

'),Qn=si(''),to=si('
'),eo=si(''),io=si('
No search results found
');function no(t,e){W(e,!0);let i=Wi(e,"reverse_search",3,!1),n=Wi(e,"current_result",15),o=Et(void 0),s=bt((()=>{const t=new URLSearchParams(window.location.search),i=e.results;let n=[];t.has("exclude_place_ids")&&(n=t.get("exclude_place_ids").split(","));for(var o=0;o{e.results&&At(o,0)})),Qt((()=>{n(e.results&&e.results.length>Fe(o)?e.results[Fe(o)]:null)}));var a=ai(),l=Ht(a),c=t=>{var n=to(),a=qt(n);gi(a,17,(()=>e.results),fi,((t,e,i)=>{var n=Jn();let s;Ni(n,"data-position",i),n.__click=r;var a=qt(n);Xn(qt(a),{get aPlace(){return Fe(e)}});var l=Wt(a,2),c=qt(l),h=Wt(l,2),u=qt(h),d=Wt(h,2),p=qt(d);Kn(Wt(d,2),{extra_classes:"btn btn-outline-secondary btn-sm",get feature(){return Fe(e)}}),ne((t=>{s=ki(n,0,"result svelte-3u0x56",null,s,{highlight:i===Fe(o)}),ci(c,Fe(e).display_name),ci(u,t),ci(p,`${Fe(e).lat??""},${Fe(e).lon??""}`)}),[()=>function(t){if(t.label)return t.label;function e(t){return t&&t[0].toUpperCase()+t.slice(1)}return t.type&&"yes"===t.type&&t.category?e(t.category.replace(/_/g," ")):t.type?e(t.type.replace(/_/g," ")):""}(Fe(e))]),Qe("keypress",n,r),li(t,n)}));var l=Wt(a,2),c=t=>{var e=Qn(),i=qt(e);ne((()=>Ni(i,"href",Fe(s)))),li(t,e)};pi(l,(t=>{Fe(s)&&!i()&&t(c)})),li(t,n)},h=t=>{var n=ai(),o=Ht(n),s=t=>{var e=ai(),n=Ht(e),o=t=>{li(t,eo())},s=t=>{li(t,io())};pi(n,(t=>{i()?t(o):t(s,!1)})),li(t,e)},r=t=>{!function(t,e){W(e,!1),Ui((()=>{Qi("theme/welcome.html",document.getElementById("welcome"))})),Fi(),li(t,Gn()),U()}(t,{})};pi(o,(t=>{e.results?t(s):t(r,!1)}),!0),li(t,n)};pi(l,(t=>{e.results&&e.results.length>0?t(c):t(h,!1)})),li(t,a),U()}ti(["click"]);var oo,so={exports:{}}; /* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */function oo(){return io||(io=1,function(t){var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof z?t:g(t)?new z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new z(t.x,t.y):new z(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,At=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(t){}return t}(),St=!!document.createElement("canvas").getContext,Ot=!(!document.createElementNS||!X("svg").createSVGRect),zt=!!Ot&&((Q=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),It=!Ot&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Dt=0===navigator.platform.indexOf("Mac"),Nt=0===navigator.platform.indexOf("Linux");function Bt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Zt={ie:et,ielt9:it,edge:nt,webkit:ot,android:st,android23:rt,androidStock:lt,opera:ct,chrome:ht,gecko:ut,safari:dt,phantom:pt,opera12:ft,win:_t,ie3d:mt,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:wt,mobileWebkit3d:xt,msPointer:Lt,pointer:Pt,touch:kt,touchNative:Tt,mobileOpera:Mt,mobileGecko:Ct,retina:Et,passiveEvents:At,canvas:St,svg:Ot,vml:It,inlineSvg:zt,mac:Dt,linux:Nt},jt=Zt.msPointer?"MSPointerDown":"pointerdown",Rt=Zt.msPointer?"MSPointerMove":"pointermove",$t=Zt.msPointer?"MSPointerUp":"pointerup",Ft=Zt.msPointer?"MSPointerCancel":"pointercancel",qt={touchstart:jt,touchmove:Rt,touchend:$t,touchcancel:Ft},Ht={touchstart:te,touchmove:Qt,touchend:Qt,touchcancel:Qt},Wt={},Ut=!1;function Vt(t,e,i){return"touchstart"===e&&Jt(),Ht[e]?(i=Ht[e].bind(this,i),t.addEventListener(qt[e],i,!1),i):(console.warn("wrong event specified:",e),c)}function Kt(t,e,i){qt[e]?t.removeEventListener(qt[e],i,!1):console.warn("wrong event specified:",e)}function Gt(t){Wt[t.pointerId]=t}function Yt(t){Wt[t.pointerId]&&(Wt[t.pointerId]=t)}function Xt(t){delete Wt[t.pointerId]}function Jt(){Ut||(document.addEventListener(jt,Gt,!0),document.addEventListener(Rt,Yt,!0),document.addEventListener($t,Xt,!0),document.addEventListener(Ft,Xt,!0),Ut=!0)}function Qt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Wt)e.touches.push(Wt[i]);e.changedTouches=[e],t(e)}}function te(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ge(e),Qt(t,e)}function ee(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ie=200;function ne(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=Xe(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var s=Date.now();s-n<=ie?2===++i&&e(ee(t)):i=1,n=s}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function oe(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var se,re,ae,le,ce,he=Me(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ue=Me(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ue||"OTransition"===ue?ue+"End":"transitionend";function pe(t){return"string"==typeof t?document.getElementById(t):t}function fe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function _e(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function me(t){var e=t.parentNode;e&&e.removeChild(t)}function ge(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ve(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ye(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function be(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Pe(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function we(t,e){if(void 0!==t.classList)for(var i=d(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function ti(t){return Zt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Qe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ei(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var ii={__proto__:null,on:je,off:$e,stopPropagation:Ue,disableScrollPropagation:Ve,disableClickPropagation:Ke,preventDefault:Ge,stop:Ye,getPropagationPath:Xe,getMousePosition:Je,getWheelDelta:ti,isExternalTarget:ei,addListener:je,removeListener:$e},ni=O.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ae(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,j(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=B([r.min.add(i),r.max.subtract(n)]),l=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var c=s.subtract(a.getCenter()),h=a.extend(s).getSize().subtract(l);o.x+=c.x<0?-h.x:h.x,o.y+=c.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=e.divideBy(2).round(),r=n.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new R(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),me(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)me(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=_e("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new Z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=j(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),c=B(this.project(a,n),this.project(r,n)).getSize(),h=Zt.any3d?this.options.zoomSnap:1,u=l.x/c.x,d=l.y/c.y,p=e?Math.max(u,d):Math.min(u,d);return n=this.getScaleZoom(p,n),h&&(n=Math.round(n/(h/100))*(h/100),n=e?Math.ceil(n/h)*h:Math.floor(n/h)*h),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint($(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project($(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng($(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance($(t),$(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint($(t)))},mouseEventToContainerPoint:function(t){return Je(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");je(e,"scroll",this._onScroll,this),this._containerId=r(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Zt.any3d,we(t,"leaflet-container"+(Zt.touch?" leaflet-touch":"")+(Zt.retina?" leaflet-retina":"")+(Zt.ielt9?" leaflet-oldie":"")+(Zt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=fe(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ee(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(we(t.markerPane,"leaflet-zoom-hide"),we(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Ee(this._mapPane,new z(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ee(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[r(this._container)]=this;var e=t?$e:je;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Zt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=k((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[r(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ei(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Ie(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var s=this._findEventTargets(t,e);if(n){for(var r=[],a=0;a0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Zt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){xe(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=_e("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=he,i=this._proxy.style[e];Ce(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){me(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ce(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(k((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,we(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&xe(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function si(t,e){return new oi(t,e)}var ri=E.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return we(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(me(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ai=function(t){return new ri(t)};oi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=_e("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=_e("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)me(this._controlCorners[t]);me(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var li=ri.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+r(this),n),this._layerControlInputs.push(e),e.layerId=r(t.layer),je(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ne.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,je(t,"click",Ge),this.expand();var e=this;setTimeout((function(){$e(t,"click",Ge),e._preventClick=!1}))}}),ci=function(t,e,i){return new li(t,e,i)},hi=ri.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=_e("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=_e("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ke(s),je(s,"click",Ye),je(s,"click",o,this),je(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";xe(this._zoomInButton,e),xe(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(we(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(we(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new hi,this.addControl(this.zoomControl))}));var ui=function(t){return new hi(t)},di=ri.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=_e("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=_e("div",e,i)),t.imperial&&(this._iScale=_e("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(t){return new di(t)},fi='',_i=ri.extend({options:{position:"bottomright",prefix:''+(Zt.inlineSvg?fi+" ":"")+"Leaflet"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=_e("div","leaflet-control-attribution"),Ke(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook((function(){this.options.attributionControl&&(new _i).addTo(this)}));var mi=function(t){return new _i(t)};ri.Layers=li,ri.Zoom=hi,ri.Scale=di,ri.Attribution=_i,ai.layers=ci,ai.zoom=ui,ai.scale=pi,ai.attribution=mi;var gi=E.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});gi.addTo=function(t,e){return t.addHandler(e,this),this};var vi={Events:S},yi=Zt.touch?"touchstart mousedown":"mousedown",bi=O.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){p(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(je(this._dragStartTarget,yi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bi._dragging===this&&this.finishDrag(!0),$e(this._dragStartTarget,yi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!be(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)bi._dragging===this&&this.finishDrag();else if(!(bi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bi._dragging=this,this._preventOutline&&Ie(this._element),Oe(),se(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Ne(this._element);this._startPoint=new z(e.clientX,e.clientY),this._startPos=Ae(this._element),this._parentScale=Be(i);var n="mousedown"===t.type;je(document,n?"mousemove":"touchmove",this._onMove,this),je(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)l&&(s=r,l=a);l>i&&(e[s]=1,Ai(t,e,i,n,s),Ai(t,e,i,s,o))}function Si(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Di(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ni(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,c=a*a+l*l;return c>0&&((o=((t.x-s)*a+(t.y-r)*l)/c)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new z(s,r)}function Bi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Bi(t)}function ji(t,e){var i,n,o,s,r,a,l,c;if(!t||0===t.length)throw new Error("latlngs not passed");Bi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=$([0,0]),u=j(t);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(h=Li(t));var d=t.length,p=[];for(i=0;in){l=(s-n)/o,c=[a.x-l*(a.x-r.x),a.y-l*(a.y-r.y)];break}var _=e.unproject(D(c));return $([_.lat+h.lat,_.lng+h.lng])}var Ri={__proto__:null,simplify:ki,pointToSegmentDistance:Mi,closestPointOnSegment:Ci,clipSegment:Oi,_getEdgeIntersection:zi,_getBitCode:Ii,_sqClosestPointOnSegment:Ni,isFlat:Bi,_flat:Zi,polylineCenter:ji},$i={project:function(t){return new z(t.lng,t.lat)},unproject:function(t){return new R(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Fi={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=c=Math.PI/2-2*Math.atan(r*e)-a;return new R(a*i,t.x*i/n)}},qi={__proto__:null,LonLat:$i,Mercator:Fi,SphericalMercator:U},Hi=i({},H,{code:"EPSG:3395",projection:Fi,transformation:function(){var t=.5/(Math.PI*Fi.R);return K(t,.5,-t,.5)}()}),Wi=i({},H,{code:"EPSG:4326",projection:$i,transformation:K(1/180,1,-1/180,.5)}),Ui=i({},q,{projection:$i,transformation:K(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});q.Earth=H,q.EPSG3395=Hi,q.EPSG3857=G,q.EPSG900913=Y,q.EPSG4326=Wi,q.Simple=Ui;var Vi=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof R&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){hn.prototype._setLatLngs.call(this,t),Bi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Bi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new z(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(c=!c);return c||hn.prototype._containsPoint.call(this,t,!0)}});function pn(t,e){return new dn(t,e)}var fn=Yi.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=g(t)?t:t.features;if(o){for(e=0,i=o.length;e0&&o.push(o[0].slice()),o}function wn(t,e){return t.feature?i({},t.feature,{geometry:e}):xn(e)}function xn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ln={toGeoJSON:function(t){return wn(this,{type:"Point",coordinates:yn(this.getLatLng(),t)})}};function Pn(t,e){return new fn(t,e)}nn.include(Ln),ln.include(Ln),rn.include(Ln),hn.include({toGeoJSON:function(t){var e=!Bi(this._latlngs);return wn(this,{type:(e?"Multi":"")+"LineString",coordinates:bn(this._latlngs,e?1:0,!1,t)})}}),dn.include({toGeoJSON:function(t){var e=!Bi(this._latlngs),i=e&&!Bi(this._latlngs[0]),n=bn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),wn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Ki.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),wn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=xn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?wn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Tn=Pn,kn=Vi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=j(e),p(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(we(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){me(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ve(this._image),this},bringToBack:function(){return this._map&&ye(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:_e("img");we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ce(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ee(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Te(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Mn=function(t,e,i){return new kn(t,e,i)},Cn=kn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:_e("video");if(we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],s=0;s0?n:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var r=0;ro?(e.height=o+"px",we(t,s)):xe(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ee(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(fe(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new z(this._containerLeft,-i-this._containerBottom);o._add(Ae(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),c=t.getSize(),h=0,u=0;s.x+n+l.x>c.x&&(h=s.x+n-c.x+l.x),s.x-h-a.x<0&&(h=s.x-a.x),s.y+i+l.y>c.y&&(u=s.y+i-c.y+l.y),s.y-u-a.y<0&&(u=s.y-a.y),(h||u)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,u]))}},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),In=function(t,e){return new zn(t,e)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(t,e,i){return this._initOverlay(zn,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(zn,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Yi||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Ye(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof sn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Dn=On.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){On.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){On.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=On.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=_e("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+r(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,l=o.offsetWidth,c=o.offsetHeight,h=D(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=c):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=c/2):"right"===a?(e=0,i=c/2):"left"===a?(e=l,i=c/2):r.xthis.options.maxZoom||in&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new z(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,i);else{for(var u=o.min.y;u<=o.max.y;u++)for(var d=o.min.x;d<=o.max.x;d++){var p=new z(d,u);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var _=document.createDocumentFragment();for(d=0;di.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new Z(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(me(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){we(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,Zt.ielt9&&this.options.opacity<1&&Te(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&k(o(this._tileReady,this,t,null,s)),Ee(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Te(i.el,0),M(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(we(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Zt.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new z(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Rn(t){return new jn(t)}var $n=jn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Zt.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return je(i,"load",o(this._tileOnLoad,this,e,i)),je(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Zt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return m(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Zt.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,!e.complete)){e.src=y;var i=this._tiles[t].coords;me(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),jn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return jn.prototype._tileReady.call(this,t,e,i)}});function Fn(t,e){return new $n(t,e)}var qn=$n.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=p(this,e)).detectRetina&&Zt.retina?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,$n.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=B(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Wi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=$n.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Hn(t,e){return new qn(t,e)}$n.WMS=qn,Fn.wms=Hn;var Wn=Vi.extend({options:{padding:.1},initialize:function(t){p(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),we(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Zt.any3d?Ce(this._container,s,i):Ee(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Un=Wn.extend({options:{tolerance:0},getEvents:function(){var t=Wn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");je(t,"mousemove",this._onMouseMove,this),je(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),je(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,me(this._container),$e(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Zt.retina?2:1;Ee(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Zt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Wn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[r(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Gn={_initContainer:function(){this._container=_e("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Kn("shape");we(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Kn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;me(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Kn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Kn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ve(t._container)},_bringToBack:function(t){ye(t._container)}},Yn=Zt.vml?Kn:X,Xn=Wn.extend({_initContainer:function(){this._container=Yn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){me(this._container),$e(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ee(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Yn("path");t.options.className&&we(e,t.options.className),t.options.interactive&&we(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){me(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,J(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ve(t._path)},_bringToBack:function(t){ye(t._path)}});function Jn(t){return Zt.svg||Zt.vml?new Xn(t):null}Zt.vml&&Xn.include(Gn),oi.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Vn(t)||Jn(t)}});var Qn=dn.extend({initialize:function(t,e){dn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function to(t,e){return new Qn(t,e)}Xn.create=Yn,Xn.pointsToPath=J,fn.geometryToLayer=_n,fn.coordsToLatLng=gn,fn.coordsToLatLngs=vn,fn.latLngToCoords=yn,fn.latLngsToCoords=bn,fn.getFeature=wn,fn.asFeature=xn,oi.mergeOptions({boxZoom:!0});var eo=gi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){$e(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){me(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),se(),Oe(),this._startPoint=this._map.mouseEventToContainerPoint(t),je(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=_e("div","leaflet-zoom-box",this._container),we(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ee(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(me(this._box),xe(this._container,"leaflet-crosshair")),re(),ze(),$e(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",eo),oi.mergeOptions({doubleClickZoom:!0});var io=gi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});oi.addInitHook("addHandler","doubleClickZoom",io),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var no=gi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}we(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){xe(this._map._container,"leaflet-grab"),xe(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=B(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});oi.addInitHook("addHandler","scrollWheelZoom",so);var ro=600;oi.mergeOptions({tapHold:Zt.touchNative&&Zt.safari&&Zt.mobile,tapTolerance:15});var ao=gi.extend({addHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){$e(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new z(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(je(document,"touchend",Ge),je(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),ro),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){$e(document,"touchend",Ge),$e(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),$e(document,"touchend touchcancel contextmenu",this._cancel,this),$e(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new z(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});oi.addInitHook("addHandler","tapHold",ao),oi.mergeOptions({touchZoom:Zt.touch,bounceAtZoomLimits:!0});var lo=gi.extend({addHooks:function(){we(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){xe(this._map._container,"leaflet-touch-zoom"),$e(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),Ge(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(a,this,!0),Ge(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),$e(document,"touchmove",this._onTouchMove,this),$e(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});oi.addInitHook("addHandler","touchZoom",lo),oi.BoxZoom=eo,oi.DoubleClickZoom=io,oi.Drag=no,oi.Keyboard=oo,oi.ScrollWheelZoom=so,oi.TapHold=ao,oi.TouchZoom=lo,t.Bounds=N,t.Browser=Zt,t.CRS=q,t.Canvas=Un,t.Circle=ln,t.CircleMarker=rn,t.Class=E,t.Control=ri,t.DivIcon=Bn,t.DivOverlay=On,t.DomEvent=ii,t.DomUtil=Ze,t.Draggable=bi,t.Evented=O,t.FeatureGroup=Yi,t.GeoJSON=fn,t.GridLayer=jn,t.Handler=gi,t.Icon=Ji,t.ImageOverlay=kn,t.LatLng=R,t.LatLngBounds=Z,t.Layer=Vi,t.LayerGroup=Ki,t.LineUtil=Ri,t.Map=oi,t.Marker=nn,t.Mixin=vi,t.Path=sn,t.Point=z,t.PolyUtil=Ti,t.Polygon=dn,t.Polyline=hn,t.Popup=zn,t.PosAnimation=ni,t.Projection=qi,t.Rectangle=Qn,t.Renderer=Wn,t.SVG=Xn,t.SVGOverlay=An,t.TileLayer=$n,t.Tooltip=Dn,t.Transformation=V,t.Util=C,t.VideoOverlay=Cn,t.bind=o,t.bounds=B,t.canvas=Vn,t.circle=cn,t.circleMarker=an,t.control=ai,t.divIcon=Zn,t.extend=i,t.featureGroup=Xi,t.geoJSON=Pn,t.geoJson=Tn,t.gridLayer=Rn,t.icon=Qi,t.imageOverlay=Mn,t.latLng=$,t.latLngBounds=j,t.layerGroup=Gi,t.map=si,t.marker=on,t.point=D,t.polygon=pn,t.polyline=un,t.popup=In,t.rectangle=to,t.setOptions=p,t.stamp=r,t.svg=Jn,t.svgOverlay=Sn,t.tileLayer=Fn,t.tooltip=Nn,t.transformation=K,t.version=e,t.videoOverlay=En;var co=window.L;t.noConflict=function(){return window.L=co,this},window.L=t}(no.exports)),no.exports}var so,ro,ao=oo(),lo={exports:{}};so||(so=1,ro=lo,function(t,e){ro.exports=t(oo()),void 0!==e&&e.L&&(e.L.Control.MiniMap=t(L),e.L.control.minimap=function(t,i){return new e.L.Control.MiniMap(t,i)})}((function(t){var e=t.Control.extend({includes:t.Evented?t.Evented.prototype:t.Mixin.Events,options:{position:"bottomright",toggleDisplay:!1,zoomLevelOffset:-5,zoomLevelFixed:!1,centerFixed:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,clickable:!1},shadowRectOptions:{color:"#000000",weight:1,clickable:!1,opacity:0,fillOpacity:0},strings:{hideText:"Hide MiniMap",showText:"Show MiniMap"},mapOptions:{}},initialize:function(e,i){t.Util.setOptions(this,i),this.options.aimingRectOptions.clickable=!1,this.options.shadowRectOptions.clickable=!1,this._layer=e},onAdd:function(e){this._mainMap=e,this._container=t.DomUtil.create("div","leaflet-control-minimap"),this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",t.DomEvent.disableClickPropagation(this._container),t.DomEvent.on(this._container,"mousewheel",t.DomEvent.stopPropagation);var i={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:!1,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:e.options.crs};return i=t.Util.extend(this.options.mapOptions,i),this._miniMap=new t.Map(this._container,i),this._miniMap.addLayer(this._layer),this._mainMapMoving=!1,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(t.Util.bind((function(){this._aimingRect=t.rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=t.rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._miniMap),this._mainMap.on("moveend",this._onMainMapMoved,this),this._mainMap.on("move",this._onMainMapMoving,this),this._miniMap.on("movestart",this._onMiniMapMoveStarted,this),this._miniMap.on("move",this._onMiniMapMoving,this),this._miniMap.on("moveend",this._onMiniMapMoved,this)}),this)),this._container},addTo:function(e){t.Control.prototype.addTo.call(this,e);var i=this.options.centerFixed||this._mainMap.getCenter();return this._miniMap.setView(i,this._decideZoom(!0)),this._setDisplay(this.options.minimized),this},onRemove:function(t){this._mainMap.off("moveend",this._onMainMapMoved,this),this._mainMap.off("move",this._onMainMapMoving,this),this._miniMap.off("moveend",this._onMiniMapMoved,this),this._miniMap.removeLayer(this._layer)},changeLayer:function(t){this._miniMap.removeLayer(this._layer),this._layer=t,this._miniMap.addLayer(this._layer)},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText:function(){return this.options.minimized?this.options.strings.showText:this.options.strings.hideText},_createButton:function(e,i,n,o,s,r){var a=t.DomUtil.create("a",n,o);a.innerHTML=e,a.href="#",a.title=i;var l=t.DomEvent.stopPropagation;return t.DomEvent.on(a,"click",l).on(a,"mousedown",l).on(a,"dblclick",l).on(a,"click",t.DomEvent.preventDefault).on(a,"click",s,r),a},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_setDisplay:function(t){t!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore:function(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMainMapMoved:function(t){if(this._miniMapMoving)this._miniMapMoving=!1;else{var e=this.options.centerFixed||this._mainMap.getCenter();this._mainMapMoving=!0,this._miniMap.setView(e,this._decideZoom(!0)),this._setDisplay(this._decideMinimized())}this._aimingRect.setBounds(this._mainMap.getBounds())},_onMainMapMoving:function(t){this._aimingRect.setBounds(this._mainMap.getBounds())},_onMiniMapMoveStarted:function(t){if(!this.options.centerFixed){var e=this._aimingRect.getBounds(),i=this._miniMap.latLngToContainerPoint(e.getSouthWest()),n=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:i,ne:n}}},_onMiniMapMoving:function(e){this.options.centerFixed||!this._mainMapMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new t.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){this._mainMapMoving?this._mainMapMoving=!1:(this._miniMapMoving=!0,this._mainMap.setView(this._miniMap.getCenter(),this._decideZoom(!1)),this._shadowRect.setStyle({opacity:0,fillOpacity:0}))},_isZoomLevelFixed:function(){var t=this.options.zoomLevelFixed;return this._isDefined(t)&&this._isInteger(t)},_decideZoom:function(t){if(this._isZoomLevelFixed())return t?this.options.zoomLevelFixed:this._mainMap.getZoom();if(t)return this._mainMap.getZoom()+this.options.zoomLevelOffset;var e,i=this._miniMap.getZoom()-this._mainMap.getZoom(),n=this._miniMap.getZoom()-this.options.zoomLevelOffset;return i>this.options.zoomLevelOffset&&this._mainMap.getZoom()this._lastMiniMapZoom?(e=this._mainMap.getZoom()+1,this._miniMap.setZoom(this._miniMap.getZoom()-1)):e=this._mainMap.getZoom():e=n,this._lastMiniMapZoom=this._miniMap.getZoom(),e},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._mainMap.getBounds().contains(this._miniMap.getBounds()):this._minimized},_isInteger:function(t){return"number"==typeof t},_isDefined:function(t){return void 0!==t},_onToggle:function(){t.Util.requestAnimFrame((function(){t.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),t.Browser.any3d||t.Util.requestAnimFrame(this._fireToggleEvents,this)}),this)},_fireToggleEvents:function(){t.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this);var e={minimized:this._minimized};this.fire(this._minimized?"minimize":"restore",e),this.fire("toggle",e)}});return t.Map.mergeOptions({miniMapControl:!1}),t.Map.addInitHook((function(){this.options.miniMapControl&&(this.miniMapControl=(new e).addTo(this))})),e}),window));var co=hi(' ',1),ho=hi(''),uo=hi('
');si(["click"]);var po=hi('
',1);function fo(t,e){H(e,!0);let i,n=qi(e,"display_minimap",3,!1),o=qi(e,"current_result",3,null),s=qi(e,"position_marker",3,null),r=[];function a(){Cn.viewboxStr=function(t){var e=t.getBounds(),i=e.getWest(),n=e.getEast();return n-i>=360&&(i=t.getCenter().lng-179.999,n=t.getCenter().lng+179.999),n=ao.latLng(77,n).wrap().lng,[(i=ao.latLng(77,i).wrap().lng).toFixed(5),e.getNorth().toFixed(5),n.toFixed(5),e.getSouth().toFixed(5)].join(",")}(i),Cn.center=i.getCenter(),Cn.zoom=i.getZoom()}function l(t){return function(t){const e=Nominatim_Config.Map_Tile_Attribution;if(i=new ao.map(t,{attributionControl:!1,scrollWheelZoom:!0,touchZoom:!1,center:ao.latLng(Nominatim_Config.Map_Default_Lat,Nominatim_Config.Map_Default_Lon),zoom:Nominatim_Config.Map_Default_Zoom}),void 0!==Nominatim_Config.Map_Default_Bounds&&Nominatim_Config.Map_Default_Bounds&&i.fitBounds(Nominatim_Config.Map_Default_Bounds),e&&e.length&&ao.control.attribution({prefix:'Leaflet'}).addTo(i),a(),ao.control.scale().addTo(i),ao.tileLayer(Nominatim_Config.Map_Tile_URL,{attribution:e}).addTo(i),n()){let t=new ao.TileLayer(Nominatim_Config.Map_Tile_URL,{minZoom:0,maxZoom:13,attribution:e});new ao.Control.MiniMap(t,{toggleDisplay:!0}).addTo(i)}i.on("move",a),i.on("mousemove",(t=>{Cn.mousePos=t.latlng})),i.on("click",(t=>{Cn.lastClick=t.latlng}))}(t),c(s(),o()),{destroy:()=>{Cn.reset(),i.remove()}}}function c(t,e){if(!i)return;if(i&&r.forEach((function(t){i.removeLayer(t)})),t){let e=ao.circleMarker(t,{radius:5,weight:2,fillColor:"#ff7800",color:"red",opacity:.75,zIndexOffset:100,clickable:!1});e.bindTooltip(`Search (${t[0]},${t[1]})`).openTooltip(),e.addTo(i),r.push(e)}var n=new URLSearchParams(window.location.search).get("viewbox");if(n){let t=n.split(","),o=ao.latLngBounds([t[1],t[0]],[t[3],t[2]]),s=ao.rectangle(o,{color:"#69d53e",weight:3,dashArray:"5 5",opacity:.8,fill:!1,interactive:!1});i.addLayer(s),r.push(s),e||i.fitBounds(o)}if(!e)return;let o=e.centroid?e.centroid.coordinates[1]:e.lat,s=e.centroid?e.centroid.coordinates[0]:e.lon,a=e.geometry||e.geojson,l=e.entrances;if(o&&s){let e=ao.circleMarker([o,s],{radius:10,weight:2,fillColor:"#ff7800",color:"blue",opacity:.75});t&&e.bindTooltip("Result").openTooltip(),i.addLayer(e),r.push(e)}if(a){var c=ao.geoJson({type:"FeatureCollection",features:[{type:"Feature",geometry:a,properties:{}}]},{style:()=>({interactive:!1,color:"blue"})});i.addLayer(c),r.push(c),i.fitBounds(c.getBounds())}else o&&s&&t?i.fitBounds([[o,s],t],{padding:[50,50]}):o&&s&&i.setView([o,s],10);l&&l.forEach(((t,e)=>{let n=ao.circleMarker([t.lat,t.lon],{radius:5,weight:2,fillColor:"#ff7800",color:"red",opacity:.75});n.bindTooltip(`Entrance ${e+1} (type=${t.type})`).openTooltip(),i.addLayer(n),r.push(n)}))}ne((()=>{c(s(),o())}));var h=po(),u=Kt(h);!function(t,e,i){se((()=>{var n=Ye((()=>e(t,i?.())||{}));if(n?.destroy)return()=>n.destroy()}))}(u,(t=>l?.(t))),function(t,e){H(e,!0);let i=zt(!1);const n=Pt((()=>`https://openstreetmap.org/#map=${Cn.zoom}/${Cn.center.lat.toFixed(5)}/${Cn.center.lng.toFixed(5)}`)),o=Pt((()=>`https://overpass-turbo.eu/?lat=${Cn.center.lat.toFixed(5)}&lon=${Cn.center.lng.toFixed(5)}`));function s(t){return t?`${t.lat.toFixed(5)},${t.lng.toFixed(5)}`:"-"}var r=uo(),a=Vt(r),l=t=>{var e=co(),r=Kt(e),a=Vt(r),l=Gt(a),c=Gt(l,2),h=Gt(c,3),u=Gt(h,2),d=Gt(u,2),p=Gt(d,2);Vt(Gt(r,2)).__click=()=>It(i,!1),ae(((t,e,i)=>{fi(a,`map center: ${t??""} `),Ii(l,"href",Ve(n)),Ii(c,"href",Ve(o)),fi(h,` map zoom: ${Cn.zoom??""} `),fi(u,` viewbox: ${Cn.viewboxStr??""} `),fi(d,` last click: ${e??""} `),fi(p,` mouse position: ${i??""}`)}),[()=>s(Cn.center),()=>s(Cn.lastClick),()=>s(Cn.mousePos)]),pi(t,e)},c=t=>{var e=ho();e.__click=()=>It(i,!0),pi(t,e)};vi(a,(t=>{Ve(i)?t(l):t(c,!1)})),pi(t,r),W()}(Gt(u,2),{}),pi(t,h),W()}var _o=hi('
',1);function mo(t,e){H(e,!0);const i=t=>{!function(t,e){H(e,!0);const i=t=>{var e=$n(),i=Gt(Vt(e),2),n=Gt(i,2),o=Gt(n,2),s=Gt(o,2),l=Gt(s,2);Ii(l,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$");var c=Gt(l,2),h=Gt(c,2),u=Gt(h,2);ae((()=>{Oi(i,Ve(a)?Cn.viewboxStr:""),Oi(n,0===r().dedupe?0:1),Oi(o,r().bounded?1:""),Oi(s,r()["accept-language"]||""),Oi(l,r().countrycodes||""),Oi(c,r().limit||""),Oi(h,r().polygon_threshold||""),Oi(u,r().layer||"")})),pi(t,e)},n=t=>{var e=Fn(),n=Kt(e),o=Vt(n),s=Gt(n,2);i(s),ae((()=>Oi(o,r().q||""))),pi(t,e)},o=t=>{var e=qn(),n=Kt(e),o=Vt(n),s=Gt(n,2),a=Vt(s),l=Gt(s,2),c=Vt(l),h=Gt(l,2),u=Vt(h),d=Gt(h,2),p=Vt(d),f=Gt(d,2),_=Vt(f),m=Gt(f,2),g=Vt(m),v=Gt(m,2);i(v),ae((()=>{Oi(o,r().amenity||""),Oi(a,r().street||""),Oi(c,r().city||""),Oi(u,r().county||""),Oi(p,r().state||""),Oi(_,r().country||""),Oi(g,r().postalcode||"")})),pi(t,e)};let s=qi(e,"bStructuredSearch",3,!1),r=qi(e,"api_request_params",19,(()=>({}))),a=zt(Zt(r().viewbox||!1));function l(t){document.querySelector("input[name="+t.target.dataset.apiParam+"]").value=t.target.value}var c=Hn(),h=Kt(c),u=Vt(h),d=Vt(u);let p;var f=Vt(Gt(u,2));let _;var m=Gt(h,2),g=Vt(m);let v;Zn(Vt(g),{page:"search",get content(){return n}});var y=Gt(g,2);let b;Zn(Vt(y),{page:"search",get content(){return o}});var w=Gt(m,2),x=Gt(Vt(w),2),L=Vt(x),P=Vt(L),T=Gt(Vt(P),2);T.__change=()=>It(a,!Ve(a));var k=Gt(L,2),M=Vt(k),C=Gt(Vt(M),2);C.__change=function(t){document.querySelector("input[name=bounded]").value=t.target.checked?1:""};var E=Gt(k,2),A=Vt(E),S=Gt(Vt(A),2);S.__change=function(t){document.querySelector("input[name=dedupe]").value=t.target.checked?1:0};var O=Gt(E,2),z=Gt(Vt(O),2);z.__change=l;var I=Gt(O,2),D=Gt(Vt(I),2);D.__change=l;var N=Gt(I,2),B=Gt(Vt(N),2);B.__change=l;var Z=Gt(N,2),j=Gt(Vt(Z),2);Ii(j,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$"),j.__change=l;var R=Gt(Z,2),$=Gt(Vt(R),2);$.__change=l,Rn(Gt(x,2)),ae((()=>{p=Pi(d,0,"nav-link svelte-1c3z3yb",null,p,{active:!s()}),_=Pi(f,0,"nav-link svelte-1c3z3yb",null,_,{active:s()}),v=Pi(g,0,"tab-pane",null,v,{active:!s()}),b=Pi(y,0,"tab-pane",null,b,{active:s()}),zi(T,r().viewbox),zi(C,!!r().bounded),zi(S,0===r().dedupe?0:1),Oi(z,r().limit||""),Oi(D,r().polygon_threshold||""),Oi(B,r()["accept-language"]||""),Oi(j,r().countrycodes||""),Oi($,r().layer||"")})),pi(t,c),W()}(t,{get api_request_params(){return Ve(s)},bStructuredSearch:n})};let n,o=zt(void 0),s=zt(void 0),r=zt(void 0);ne((()=>{if("search"===cn.page.tab){const t=cn.page.params;Ye((()=>function(t){tn(),It(s,{q:t.get("q"),amenity:t.get("amenity"),street:t.get("street"),city:t.get("city"),county:t.get("county"),state:t.get("state"),country:t.get("country"),postalcode:t.get("postalcode"),polygon_geojson:Nominatim_Config.Search_AreaPolygons?1:0,viewbox:t.get("viewbox"),bounded:t.get("bounded"),dedupe:t.has("dedupe")&&"1"!==t.get("dedupe")?0:1,"accept-language":t.get("accept-language"),countrycodes:t.get("countrycodes"),layer:t.get("layer"),limit:t.get("limit"),polygon_threshold:t.get("polygon_threshold"),exclude_place_ids:t.get("exclude_place_ids"),format:"jsonv2"});let e=Ve(s).amenity||Ve(s).street||Ve(s).city||Ve(s).county||Ve(s).state||Ve(s).country||Ve(s).postalcode;Ve(s).q||e?cn.fetchFromApi("search",Ve(s),(function(t){It(o,t,!0),e?(tn("Result for "+[Ve(s).amenity,Ve(s).street,Ve(s).city,Ve(s).county,Ve(s).state,Ve(s).country,Ve(s).postalcode].filter((t=>t&&t.length>1)).join(", ")),document.querySelector(".nav-tabs a[href='#structured']").click(),document.querySelector("input[name=street]").focus()):(tn("Result for "+Ve(s).q),document.querySelector("input[name=q]").focus())})):It(o,void 0)}(t)))}}));var a=_o(),l=Kt(a);zn(l,{get subheader(){return i}});var c=Vt(Gt(l,2));eo(Vt(c),{get results(){return Ve(o)},reverse_search:!1,get current_result(){return Ve(r)},set current_result(t){It(r,t,!0)}}),fo(Vt(Gt(c,2)),{get current_result(){return Ve(r)},display_minimap:!0}),pi(t,a),W()}var go=hi(""),vo=hi('
',1),yo=hi('
Advanced options
',1);si(["change","click"]);var bo=hi('
',1);function wo(t,e){H(e,!0);const i=t=>{{let e=Pt((()=>Ve(o)?.lat)),i=Pt((()=>Ve(o)?.lon)),n=Pt((()=>Ve(o)?.zoom));!function(t,e){H(e,!0);const i=t=>{var e=vo(),i=Gt(Kt(e),2),l=Vt(i);l.__change=a;var h=Gt(i,2);Vt(h).__click=c;var u=Gt(h,4),d=Vt(u),p=Gt(u,4),f=Vt(p),_=Vt(f);_.value=_.__value="",gt(Gt(_),17,rn,mt,((t,e,i)=>{var n=go(),o=Vt(n);n.value=n.__value=i,ae((()=>fi(o,`${i} - ${Ve(e)??""}`))),pi(t,n)}));var m=Gt(p,2),g=Gt(m,2),v=Gt(g,2);ae((()=>{Oi(m,r().layer||""),Oi(g,r().polygon_threshold||""),Oi(v,r()["accept-language"]||"")})),Bi(l,n),Bi(d,o),Ci(f,s),pi(t,e)};let n=qi(e,"lat",7,""),o=qi(e,"lon",7,""),s=qi(e,"zoom",7,""),r=qi(e,"api_request_params",19,(()=>({})));function a(t){var e=t.target.value.split(/,|%2C/);2===e.length&&(document.querySelector("input[name=lat]").value=L.Util.trim(e[0]),document.querySelector("input[name=lon]").value=L.Util.trim(e[1]))}function l(t){document.querySelector("input[name="+t.target.dataset.apiParam+"]").value=t.target.value}function c(t){t.preventDefault(),t.stopPropagation(),cn.refreshPage("reverse",new URLSearchParams({lat:o()||"",lon:n()||"",zoom:s()}))}ne((()=>{const t=Cn.lastClick,e=Number(n())!==t?.lat,i=Number(o())!==t?.lng;if(t&&(e||i)){const e=new Dn(cn.page?.params||{});e.set("lat",t.lat),e.set("lon",t.lng),s()?e.set("zoom",s()):e.delete("zoom"),cn.refreshPage("reverse",e)}}));var h=yo(),u=Kt(h);Zn(u,{page:"reverse",get content(){return i}});var d=Gt(u,2),p=Gt(Vt(d),2),f=Vt(p),_=Gt(Vt(f),2);_.__change=l;var m=Gt(f,2),g=Gt(Vt(m),2);g.__change=l;var v=Gt(m,2),y=Gt(Vt(v),2);y.__change=l,Rn(Gt(p,2)),ae((()=>{Oi(_,r().layer||""),Oi(g,r().polygon_threshold||""),Oi(y,r()["accept-language"]||"")})),pi(t,h),W()}(t,{get lat(){return Ve(e)},get lon(){return Ve(i)},get zoom(){return Ve(n)},get api_request_params(){return Ve(o)}})}};let n=zt(void 0),o=zt(void 0),s=zt(void 0),r=zt(void 0);ne((()=>{if("reverse"===cn.page.tab){const t=cn.page.params;Ye((()=>{return e=t,tn(),It(o,{lat:e.get("lat"),lon:e.get("lon"),zoom:e.get("zoom")>1?Number(e.get("zoom")):Number(Nominatim_Config.Reverse_Default_Search_Zoom),polygon_geojson:Nominatim_Config.Search_AreaPolygons?1:0,layer:e.get("layer"),polygon_threshold:e.get("polygon_threshold"),"accept-language":e.get("accept-language"),format:"jsonv2"}),void(Ve(o).lat&&Ve(o).lon?(It(r,[Ve(o).lat,Ve(o).lon],!0),cn.fetchFromApi("reverse",Ve(o),(function(t){t&&!t.error?It(n,[t]):It(n,[]),tn("Reverse result for "+Ve(o).lat+","+Ve(o).lon),document.querySelector("input[name=lat]").focus()}))):It(n,void 0));var e}))}}));var a=bo(),l=Kt(a);zn(l,{get subheader(){return i}});var c=Vt(Gt(l,2));eo(Vt(c),{get results(){return Ve(n)},reverse_search:!0,get current_result(){return Ve(s)},set current_result(t){It(s,t,!0)}}),fo(Vt(Gt(c,2)),{get current_result(){return Ve(s)},get position_marker(){return Ve(r)},display_minimap:!0}),pi(t,a),W()}var xo=hi('
OSM type+id (N123, n123, W123, w123, R123, r123),\n Place id (1234) or\n URL (https://openstreetmap.org/way/123)',1);var Lo=hi("Local nameTypeOSMAddress rankAdmin levelDistance");function Po(t){pi(t,Lo())}var To=hi(" ");function ko(t,e){H(e,!0);const i=Pt((()=>on(e.osmType,!1))),n=Pt((()=>`https://www.openstreetmap.org/${Ve(i)}/${e.osmId}`));var o=di(),s=Kt(o),r=t=>{var o=To(),s=Vt(o);ae((()=>{Ii(o,"href",Ve(n)),fi(s,`${Ve(i)??""} ${e.osmId??""}`)})),pi(t,o)};vi(s,(t=>{Ve(i)&&t(r)})),pi(t,o),W()}var Mo=hi('No Name'),Co=hi(' ');function Eo(t,e){H(e,!0);let i=qi(e,"bMarkUnusedLines",3,!1);const n=Pt((()=>e.addressLine.isaddress)),o=Pt((()=>Nominatim_Config.Reverse_Only));var s=Co();let r;var a=Vt(s),l=Vt(a),c=t=>{var i=ui();ae((()=>fi(i,e.addressLine.localname))),pi(t,i)},h=t=>{pi(t,Mo())};vi(l,(t=>{e.addressLine.localname?t(c):t(h,!1)}));var u=Gt(a),d=Vt(u),p=Gt(u);ko(Vt(p),{get osmType(){return e.addressLine.osm_type},get osmId(){return e.addressLine.osm_id}});var f=Gt(p),_=Vt(f),m=Gt(f),g=Vt(m),v=Gt(m);!function(t,e,i=!1,n=!1){var o=t,s="";ae((()=>{var t=Ce;if(s!==(s=e()??"")&&(null!==t.nodes_start&&(pe(t.nodes_start,t.nodes_end),t.nodes_start=t.nodes_end=null),""!==s)){var r=s+"";i?r=`${r}`:n&&(r=`${r}`);var a=li(r);if((i||n)&&(a=Wt(a)),ci(Wt(a),a.lastChild),i||n)for(;Wt(a);)o.before(Wt(a));else o.before(a)}}))}(Vt(v),(()=>{return t=e.addressLine.distance,e.bDistanceInMeters?t<1?"0":'~'+(t>=1e3?Math.round(t/1e3,1)+" km":Math.round(t,0)+" m")+"":0===t?"0":'~'+Math.round(1e3*t,4)/1e3+"";var t}));var y=Vt(Gt(v)),b=t=>{Un(t,{get feature(){return e.addressLine}})},w=t=>{var i=di(),n=Kt(i),s=t=>{{let i=Pt((()=>({country:e.addressLine.localname})));dn(t,{page:"search",text:"search by name",get params_hash(){return Ve(i)}})}},r=t=>{var i=di(),n=Kt(i),s=t=>{{let i=Pt((()=>({postalcode:e.addressLine.localname,country:e.sCountryCode})));dn(t,{page:"search",text:"search by name",get params_hash(){return Ve(i)}})}};vi(n,(t=>{Ve(o)||"postcode"!==e.addressLine.type||t(s)}),!0),pi(t,i)};vi(n,(t=>{!Ve(o)&&e.addressLine.type.match(/^country/)?t(s):t(r,!1)}),!0),pi(t,i)};vi(y,(t=>{e.addressLine.osm_id?t(b):t(w,!1)})),ae(((t,o)=>{r=Pi(s,0,"svelte-1xlslzu",null,r,{notused:i()&&!Ve(n)}),fi(d,t),fi(_,e.addressLine.rank_address),fi(g,o)}),[()=>{return t=e.addressLine,i=t.class+":"+t.type,t.type&&"administrative"===t.type&&t.place_type&&(i=i+" ("+t.place_type+")"),nn(i);var t,i},()=>{return(t=e.addressLine.admin_level)&&t<15?t:"";var t}]),pi(t,s),W()}var Ao=hi('

Additionally supplemented by Ordnance Survey Code-Point® Open data. UK Postcode data for Nominatim

'),So=hi("

Additionally supplemented by data derived from US Census (TIGER) data.

"),Oo=hi('(how?)

Nightly calculated from nearby places having this postcode. Documentation.

You can search for those with an Overpass Turbo query.

How Nominatim uses postcodes.

',1);si(["click"]);var zo=hi('
');function Io(t,e){H(e,!0);var i=di();gt(Kt(i),17,(()=>Object.keys(e.items)),mt,((t,i)=>{var n=zo(),o=Vt(n),s=Vt(o),r=Gt(o);ae((()=>{fi(s,e.items[Ve(i)]),fi(r,` (${Ve(i)??""})`)})),pi(t,n)})),pi(t,i),W()}var Do=hi(' ');var No=hi('No Name'),Bo=hi('Admin Level '),Zo=hi('Importance '),jo=hi('Wikipedia Calculated'),Ro=hi(" ",1),$o=hi('

Name
Type
Last Updated
Search Rank
Address Rank
Coverage
Centre Point (lat,lon)
OSM
Place Id on this server)
Computed Postcode
Address Tags
Extra Tags
',1),Fo=hi('
'),qo=hi('
'),Ho=hi(' '),Wo=hi('
Entrance TypeOSMExtra Tags
'),Uo=hi("

Place does not have entrances

"),Vo=hi(" "),Ko=hi(" "),Go=hi(" "),Yo=hi('

Address Keywords

',1),Xo=hi('

Name Keywords

',1),Jo=hi("

Place has no keywords

"),Qo=hi('display keywords'),ts=hi('

Keywords

',1),es=hi('

',1),is=hi("

There are more child objects which are not shown.

"),ns=hi(" ",1),os=hi("

Place is not parent of other places

"),ss=hi('display child places'),rs=hi('

Address

Linked Places

Entrances

Parent Of

'),as=hi('
',1);function ls(t,e){H(e,!0);const i=t=>{!function(t,e){H(e,!0);let i=qi(e,"api_request_params",19,(()=>({})));var n=xo(),o=Kt(n),s=Vt(o),r=Vt(s),a=Vt(r);ae((()=>Oi(a,(i().osmtype||"")+(i().osmid||"")+(i().place_id||"")))),oi("submit",o,(function(t){t.preventDefault();let e=t.target.querySelector("input[type=edit]").value.trim(),i=e.match(/^\s*([NWR])(-?\d+)\s*$/i)||e.match(/\/(relation|way|node)\/(-?\d+)\s*$/);const n={};if(i)n.osmtype=i[1].charAt(0).toUpperCase(),n.osmid=i[2];else{if(!e.match(/^\d+$/))return void alert("invalid input");n.place_id=e}cn.refreshPage("details",new URLSearchParams(n))})),pi(t,n),W()}(t,{get api_request_params(){return Ve(s)}})};let n=zt(void 0),o=zt(void 0),s=zt(void 0),r=zt(!1);ne((()=>{if("details"===cn.page.tab){const t=cn.page.params;Ye((()=>{var e;It(s,{place_id:(e=t).get("place_id"),osmtype:e.get("osmtype"),osmid:e.get("osmid"),class:e.get("class"),keywords:e.get("keywords"),addressdetails:1,entrances:1,hierarchy:"1"===e.get("hierarchy")?1:0,group_hierarchy:1,polygon_geojson:1,format:"json"}),It(r,!1),Ve(s).place_id||Ve(s).osmtype&&Ve(s).osmid?(Ve(s).place_id?tn("Details for "+Ve(s).place_id):tn("Details for "+Ve(s).osmtype+Ve(s).osmid),cn.fetchFromApi("details",Ve(s),(function(t){window.scrollTo(0,0),It(r,!0),It(n,t&&!t.error?t:void 0,!0)}))):It(n,void 0),It(o,window.location.search,!0)}))}}));const a=Nominatim_Config.Reverse_Only;var l=as(),c=Kt(l);zn(c,{get subheader(){return i}});var h=Vt(Gt(c,2)),u=t=>{var e=$o(),i=Kt(e),o=Vt(i),s=Vt(o),r=Vt(s);Un(Vt(Gt(r)),{get feature(){return Ve(n)},text:"link to this page"}),Gn(Vt(Gt(o,2)),{get aPlace(){return Ve(n)}});var a=Vt(Gt(i,2)),l=Vt(a),c=Vt(l),h=Vt(c),u=Gt(Vt(h)),d=Vt(u),p=t=>{Io(t,{get items(){return Ve(n).names}})},f=t=>{pi(t,No())};vi(d,(t=>{Ve(n).names&&"object"==typeof Ve(n).names&&Object.keys(Ve(n).names).length?t(p):t(f,!1)}));var _=Gt(h),m=Gt(Vt(_)),g=Vt(m),v=Gt(_),y=Gt(Vt(v)),b=Vt(y),w=Gt(v),x=t=>{var e=Bo(),i=Gt(Vt(e)),o=Vt(i);ae((()=>fi(o,Ve(n).admin_level))),pi(t,e)};vi(w,(t=>{(function(t){return"boundary"===t.category&&"administrative"===t.type})(Ve(n))&&t(x)}));var L=Gt(w),P=Gt(Vt(L)),T=Vt(P),k=Gt(L),M=Gt(Vt(k)),C=Vt(M),E=Gt(k),A=t=>{var e=Zo(),i=Gt(Vt(e)),o=Vt(i),s=Gt(o),r=t=>{pi(t,ui("(estimated)"))};vi(s,(t=>{Ve(n).importance||t(r)})),ae((()=>fi(o,`${Ve(n).calculated_importance??""} `))),pi(t,e)};vi(E,(t=>{Ve(n).calculated_importance&&t(A)}));var S=Gt(E),O=Gt(Vt(S)),z=Vt(O),I=Gt(S),D=Gt(Vt(I)),N=Vt(D),B=Gt(I),Z=Gt(Vt(B));ko(Vt(Z),{get osmType(){return Ve(n).osm_type},get osmId(){return Ve(n).osm_id}});var j=Gt(B),R=Gt(Vt(j)),$=Vt(R),F=Gt(j),q=t=>{var e=jo(),i=Gt(Vt(e));!function(t,e){H(e,!0);const i=Pt((()=>e.wikipedia?e.wikipedia.split(":",2):null)),n=Pt((()=>`https://${nn(Ve(i)[0])}.wikipedia.org/wiki/${nn(Ve(i)[1])}`));var o=di(),s=Kt(o),r=t=>{var i=Do(),o=Vt(i);ae((()=>{Ii(i,"href",Ve(n)),fi(o,e.wikipedia)})),pi(t,i)};vi(s,(t=>{e.wikipedia&&t(r)})),pi(t,o),W()}(Vt(i),{get wikipedia(){return Ve(n).calculated_wikipedia}}),pi(t,e)};vi(F,(t=>{Ve(n).calculated_wikipedia&&t(q)}));var U=Gt(F),V=Gt(Vt(U)),K=Vt(V),G=t=>{var e=Ro(),i=Kt(e),o=Gt(i);{let t=Pt((()=>Ve(n).calculated_postcode||Ve(n).names.ref));!function(t,e){H(e,!0);const i=Pt((()=>`\n // Based on the map bounds, you can zoom out and rerun the query\n\n [timeout:30]; // in seconds\n\n // we define a shortcut\n // https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Turbo_Queries\n {{postcode=${e.postcode}}}\n\n (\n node["addr:postcode"="{{postcode}}"]({{bbox}});\n way["addr:postcode"="{{postcode}}"]({{bbox}});\n relation["addr:postcode"="{{postcode}}"]({{bbox}});\n\n node["postal_code"="{{postcode}}"]({{bbox}});\n way["postal_code"="{{postcode}}"]({{bbox}});\n relation["postal_code"="{{postcode}}"]({{bbox}});\n );\n\n out body;\n >;\n out skel qt;\n `.replace(/^ {4}/gm,""))),n=Pt((()=>"https://overpass-turbo.eu/?Q="+encodeURIComponent(Ve(i))+"&C="+encodeURIComponent([e.lat,e.lon,15].join(";"))+"&R"));var o=Oo(),s=Gt(Kt(o));s.__click=function(t){t.preventDefault(),t.stopPropagation(),document.getElementById("postcode-hint").style.display="block"};var r=Vt(Gt(s,2));r.__click=function(t){t.stopPropagation(),document.getElementById("postcode-hint").style.display="none"};var a=Gt(r,4),l=Gt(Vt(a)),c=Gt(a,4),h=t=>{pi(t,Ao())};vi(c,(t=>{"gb"===e.country_code&&t(h)}));var u=Gt(c,2),d=t=>{pi(t,So())};vi(u,(t=>{"us"===e.country_code&&t(d)})),ae((()=>Ii(l,"href",Ve(n)))),pi(t,o),W()}(o,{get postcode(){return Ve(t)},get lat(){return Ve(n).centroid.coordinates[1]},get lon(){return Ve(n).centroid.coordinates[0]},get country_code(){return Ve(n).country_code}})}ae((()=>fi(i,`${(Ve(n).calculated_postcode||Ve(n).names.ref)??""} `))),pi(t,e)};vi(K,(t=>{!Ve(n).calculated_postcode&&"postcode"!==Ve(n).type&&Ve(n).osm_id||t(G)}));var Y=Gt(U),X=Gt(Vt(Y));Io(Vt(X),{get items(){return Ve(n).addresstags}});var J=Gt(Y),Q=Gt(Vt(J));Io(Vt(Q),{get items(){return Ve(n).extratags}});var tt=Vt(Gt(a,2));fo(Vt(tt),{get current_result(){return Ve(n)}}),ae(((t,e,i)=>{fi(r,`${t??""} `),fi(g,`${Ve(n).category??""}:${Ve(n).type??""}`),fi(b,Ve(n).indexed_date),fi(T,Ve(n).rank_search),fi(C,`${Ve(n).rank_address??""} (${e??""})`),fi(z,i),fi(N,`${Ve(n).centroid.coordinates[1]??""},${Ve(n).centroid.coordinates[0]??""}`),fi($,`${Ve(n).place_id??""}\n (`)}),[()=>Ve(n).localname||`${on(Ve(n).osm_type)} ${Ve(n).osm_id}`,()=>{return(t=Ve(n).rank_address)<4?"other":t<6?"country":t<8?"region":t<10?"state":t<12?"state district":t<14?"county":t<16?"municipality":t<18?"city / town / village":t<20?"city / village district":t<22?"suburb / hamlet":t<24?"neighbourhood":t<26?"city block / square":26===t?"major street":27===t?"minory street / path":t<=30?"house / building":"other";var t},()=>function(t){return t.isarea?"Polygon":"Point"}(Ve(n))]),pi(t,e)},d=t=>{var e=di(),i=Kt(e),n=t=>{pi(t,ui("No such place found."))};vi(i,(t=>{""!==window.location.search&&Ve(r)&&t(n)}),!0),pi(t,e)};vi(h,(t=>{Ve(n)?t(u):t(d,!1)}));var p=Gt(h,2),f=t=>{var e=rs(),i=Vt(e),r=Gt(Vt(i),2),l=t=>{var e=Fo(),i=Vt(e);Po(i),gt(Gt(i),21,(()=>Ve(n).address),mt,((t,e)=>{{let i=Pt((()=>function(t){let e=t.address.find((t=>"country_code"===t.type));return e?e.localname:null}(Ve(n))));Eo(t,{get addressLine(){return Ve(e)},bMarkUnusedLines:!0,bDistanceInMeters:!1,get sCountryCode(){return Ve(i)}})}})),pi(t,e)};vi(r,(t=>{Ve(n).address&&t(l)}));var c=Gt(r,4),h=t=>{var e=qo(),i=Vt(e);Po(i),gt(Gt(i),21,(()=>Ve(n).linked_places),mt,((t,e)=>{Eo(t,{get addressLine(){return Ve(e)},bMarkUnusedLines:!0,bDistanceInMeters:!0})})),pi(t,e)};vi(c,(t=>{Ve(n).linked_places&&t(h)}));var u=Gt(c,4),d=t=>{var e=Wo();gt(Gt(Vt(e)),21,(()=>Ve(n).entrances),mt,((t,e,i)=>{var n=Ho(),o=Vt(n);o.textContent=i+1;var s=Gt(o),r=Vt(s),a=Gt(s);ko(Vt(a),{osmType:"N",get osmId(){return Ve(e).osm_id}});var l=Vt(Gt(a));{let t=Pt((()=>Ve(e).extratags||{}));Io(l,{get items(){return Ve(t)}})}ae((()=>fi(r,Ve(e).type))),pi(t,n)})),pi(t,e)},p=t=>{pi(t,Uo())};vi(u,(t=>{Ve(n).entrances&&Ve(n).entrances.length?t(d):t(p,!1)}));var f=Gt(u,2),_=t=>{var e=ts(),i=Gt(Kt(e),2),r=t=>{var e=di(),i=Kt(e),o=t=>{var e=Xo(),i=Gt(Kt(e),2);gt(Vt(i),21,(()=>Ve(n).keywords.name),mt,((t,e)=>{var i=Ko(),n=Vt(i),o=Vt(n),s=Gt(n),r=t=>{var i=Vo(),n=Vt(i);ae((()=>fi(n,`word id: ${Ve(e).id??""}`))),pi(t,i)};vi(s,(t=>{Ve(e).id&&t(r)})),ae((t=>fi(o,t)),[()=>sn(Ve(e).token)]),pi(t,i)}));var o=Gt(i,2),s=t=>{var e=Yo();gt(Vt(Gt(Kt(e),2)),21,(()=>Ve(n).keywords.address),mt,((t,e)=>{var i=Go(),n=Vt(i),o=Vt(n),s=Vt(Gt(n));ae((t=>{fi(o,t),fi(s,`word id: ${(Ve(e).id||"?")??""}`)}),[()=>sn(Ve(e).token)]),pi(t,i)})),pi(t,e)};vi(o,(t=>{Ve(n).keywords.address&&t(s)})),pi(t,e)},s=t=>{pi(t,Jo())};vi(i,(t=>{var e;(e=Ve(n)).keywords&&e.keywords.name&&e.keywords.address&&(e.keywords.name.length>0||e.keywords.address.length>0)?t(o):t(s,!1)})),pi(t,e)},a=t=>{var e=Qo();ae((()=>Ii(e,"href",`${Ve(o)??""}&keywords=1`))),pi(t,e)};vi(i,(t=>{Ve(s).keywords?t(r):t(a,!1)})),pi(t,e)};vi(f,(t=>{a||t(_)}));var m=Gt(f,4),g=t=>{var e=di(),i=Kt(e),o=t=>{var e=ns(),i=Kt(e);gt(i,17,(()=>Object.keys(Ve(n).hierarchy)),mt,((t,e)=>{var i=es(),o=Kt(i),s=Vt(o),r=Vt(Gt(o,2));Po(r),gt(Gt(r),21,(()=>Ve(n).hierarchy[Ve(e)]),mt,((t,e)=>{Eo(t,{get addressLine(){return Ve(e)},bDistanceInMeters:!0})})),ae((()=>fi(s,Ve(e)))),pi(t,i)}));var o=Gt(i,2),s=t=>{pi(t,is())};vi(o,(t=>{Object.keys(Ve(n).hierarchy)>500&&t(s)})),pi(t,e)},s=t=>{pi(t,os())};vi(i,(t=>{Ve(n).hierarchy&&"object"==typeof Ve(n).hierarchy&&Object.keys(Ve(n).hierarchy).length?t(o):t(s,!1)})),pi(t,e)},v=t=>{var e=ss();ae((()=>Ii(e,"href",`${Ve(o)??""}&hierarchy=1`))),pi(t,e)};vi(m,(t=>{Ve(s).hierarchy?t(g):t(v,!1)})),pi(t,e)};vi(p,(t=>{Ve(n)&&t(f)})),pi(t,l),W()}var cs=hi(' josm'),hs=hi('

Broken polygons

OSM objectClassTypeNameCountry CodeError messageUpdated
',1);var us=hi(" "),ds=hi('

Deletable

Place idCountry CodeNameOSM objectClassType
',1);var ps=hi('

Server status

API Endpoint
Software version
Database version
Data last updated
',1);var fs=hi('
',1);var _s=hi(" ",1);const ms=(gs=function(t,e){H(e,!1),Ri();var i=_s();oi("popstate",Rt,(()=>cn.refreshPage()));var n=Kt(i),o=t=>{mo(t,{})},s=t=>{var e=di(),i=Kt(e),n=t=>{wo(t,{})},o=t=>{var e=di(),i=Kt(e),n=t=>{ls(t,{})},o=t=>{var e=di(),i=Kt(e),n=t=>{!function(t,e){H(e,!0);let i=zt(Zt([]));Hi((function(){cn.fetchFromApi("deletable",{format:"json"},(function(t){It(i,t,!0)})),tn("Deletable objects")}));var n=ds(),o=Kt(n);zn(o,{});var s=Vt(Gt(o,2)),r=Vt(s),a=Gt(Vt(r),2),l=Vt(a),c=Gt(a,2);gt(Gt(Vt(c)),21,(()=>Ve(i)),mt,((t,e)=>{var i=us(),n=Vt(i);Un(Vt(n),{get feature(){return Ve(e)},get text(){return Ve(e).place_id}});var o=Gt(n),s=Vt(o),r=Gt(o),a=Vt(r),l=Gt(r);ko(Vt(l),{get osmType(){return Ve(e).osm_type},get osmId(){return Ve(e).osm_id}});var c=Gt(l),h=Vt(c),u=Vt(Gt(c));ae((()=>{fi(s,Ve(e).country_code),fi(a,Ve(e).name),fi(h,Ve(e).class),fi(u,Ve(e).type)})),pi(t,i)})),ae((()=>fi(l,`${Ve(i).length??""} objects have been deleted in OSM but\n are still in the Nominatim database.`))),pi(t,n),W()}(t,{})},o=t=>{var e=di(),i=Kt(e),n=t=>{!function(t,e){H(e,!0);let i=zt(Zt([]));Hi((function(){cn.fetchFromApi("polygons",{format:"json"},(function(t){It(i,t,!0)})),tn("Broken polygons")}));var n=hs(),o=Kt(n);zn(o,{});var s=Vt(Gt(o,2)),r=Vt(s),a=Gt(Vt(r),2),l=Vt(a),c=Gt(a,2);gt(Gt(Vt(c)),21,(()=>Ve(i)),mt,((t,e)=>{var i=cs(),n=Vt(i);ko(Vt(n),{osmType:"(polygon.osm_type}",get osmId(){return Ve(e).osm_id}});var o=Gt(n),s=Vt(o),r=Gt(o),a=Vt(r),l=Gt(r),c=Vt(l),h=Gt(l),u=Vt(h),d=Gt(h),p=Vt(d),f=Gt(d),_=Vt(f),m=Vt(Gt(f));ae((t=>{fi(s,Ve(e).class),fi(a,Ve(e).type),fi(c,Ve(e).name),fi(u,Ve(e).country_code||""),fi(p,Ve(e).errormessage),fi(_,Ve(e).updated),Ii(m,"href",`http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/${t??""}/${Ve(e).osm_id??""}/full`)}),[()=>on(Ve(e).osm_type)]),pi(t,i)})),ae((()=>fi(l,`Total number of broken polygons: ${Ve(i).length??""}.`))),pi(t,n),W()}(t,{})},o=t=>{var e=di(),i=Kt(e),n=t=>{!function(t,e){H(e,!0);let i=zt(Zt({}));const n=Nominatim_Config,o="function"==typeof n.Nominatim_API_Endpoint?n.Nominatim_API_Endpoint():n.Nominatim_API_Endpoint;Hi((function(){cn.fetchFromApi("status",{format:"json"},(function(t){It(i,t,!0)})),tn("Server status")})),Hi((()=>{Xi("theme/status-help.html",document.getElementById("status-help"))}));var s=ps(),r=Kt(s);zn(r,{});var a=Vt(Gt(r,2)),l=Vt(a),c=Gt(Vt(l),4),h=Gt(Vt(c),2),u=Vt(h),d=Vt(u),p=Gt(h,4),f=Vt(p),_=Gt(p,4),m=Vt(_),g=Vt(Gt(_,4));ae((()=>{Ii(u,"href",o),fi(d,o),fi(f,Ve(i).software_version),fi(m,Ve(i).database_version),fi(g,Ve(i).data_updated)})),pi(t,s),W()}(t,{})},o=t=>{var e=di(),i=Kt(e),n=t=>{!function(t,e){H(e,!1),Hi((()=>{Xi("theme/about-help.html",document.getElementById("about-help"))})),Ri();var i=fs();zn(Kt(i),{}),pi(t,i),W()}(t,{})};vi(i,(t=>{"about"===cn.page.tab&&t(n)}),!0),pi(t,e)};vi(i,(t=>{"status"===cn.page.tab?t(n):t(o,!1)}),!0),pi(t,e)};vi(i,(t=>{"polygons"===cn.page.tab?t(n):t(o,!1)}),!0),pi(t,e)};vi(i,(t=>{"deletable"===cn.page.tab?t(n):t(o,!1)}),!0),pi(t,e)};vi(i,(t=>{"details"===cn.page.tab?t(n):t(o,!1)}),!0),pi(t,e)};vi(i,(t=>{"reverse"===cn.page.tab?t(n):t(o,!1)}),!0),pi(t,e)};vi(n,(t=>{"search"===cn.page.tab?t(o):t(s,!1)})),function(t){pi(t,hn())}(Gt(n,2)),pi(t,i),W()},vs={target:document.body},function(t,{target:e,anchor:i,props:o={},events:r,context:a,intro:l=!0}){!function(){if(void 0===Rt){Rt=window,$t=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;Ft=s(e,"firstChild").get,qt=s(e,"nextSibling").get,h(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),h(i)&&(i.__t=void 0)}}();var c=new Set,u=t=>{for(var i=0;inew Promise((i=>{t.outro?_e(e,(()=>{de(e),i(void 0)})):(de(e),i(void 0))}))}((()=>{var n=i??e.appendChild(Ht());return function(t,e,i){new _t(t,e,i)}(n,{pending:()=>{}},(e=>{a&&(H({}),F.c=a),r&&(o.$$events=r),d=t(e,o)||{},a&&W()})),()=>{for(var t of c){e.removeEventListener(t,ai);var o=_i.get(t);0===--o?(document.removeEventListener(t,ai),_i.delete(t)):_i.set(t,o)}ni.delete(u),n!==i&&n.parentNode?.removeChild(n)}}));return mi.set(d,p),d}(gs,vs));var gs,vs;return ms}(); + */function ro(){return oo||(oo=1,function(t){var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof z?t:g(t)?new z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new z(t.x,t.y):new z(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=B(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=j(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,At=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(t){}return t}(),St=!!document.createElement("canvas").getContext,Ot=!(!document.createElementNS||!X("svg").createSVGRect),zt=!!Ot&&((Q=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),It=!Ot&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Dt=0===navigator.platform.indexOf("Mac"),Nt=0===navigator.platform.indexOf("Linux");function Bt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Zt={ie:et,ielt9:it,edge:nt,webkit:ot,android:st,android23:rt,androidStock:lt,opera:ct,chrome:ht,gecko:ut,safari:dt,phantom:pt,opera12:ft,win:_t,ie3d:mt,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:wt,mobileWebkit3d:xt,msPointer:Lt,pointer:Pt,touch:kt,touchNative:Tt,mobileOpera:Mt,mobileGecko:Ct,retina:Et,passiveEvents:At,canvas:St,svg:Ot,vml:It,inlineSvg:zt,mac:Dt,linux:Nt},jt=Zt.msPointer?"MSPointerDown":"pointerdown",Rt=Zt.msPointer?"MSPointerMove":"pointermove",$t=Zt.msPointer?"MSPointerUp":"pointerup",Ft=Zt.msPointer?"MSPointerCancel":"pointercancel",qt={touchstart:jt,touchmove:Rt,touchend:$t,touchcancel:Ft},Ht={touchstart:te,touchmove:Qt,touchend:Qt,touchcancel:Qt},Wt={},Ut=!1;function Vt(t,e,i){return"touchstart"===e&&Jt(),Ht[e]?(i=Ht[e].bind(this,i),t.addEventListener(qt[e],i,!1),i):(console.warn("wrong event specified:",e),c)}function Kt(t,e,i){qt[e]?t.removeEventListener(qt[e],i,!1):console.warn("wrong event specified:",e)}function Gt(t){Wt[t.pointerId]=t}function Yt(t){Wt[t.pointerId]&&(Wt[t.pointerId]=t)}function Xt(t){delete Wt[t.pointerId]}function Jt(){Ut||(document.addEventListener(jt,Gt,!0),document.addEventListener(Rt,Yt,!0),document.addEventListener($t,Xt,!0),document.addEventListener(Ft,Xt,!0),Ut=!0)}function Qt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Wt)e.touches.push(Wt[i]);e.changedTouches=[e],t(e)}}function te(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ge(e),Qt(t,e)}function ee(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ie=200;function ne(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=Xe(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var s=Date.now();s-n<=ie?2===++i&&e(ee(t)):i=1,n=s}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function oe(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var se,re,ae,le,ce,he=Me(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ue=Me(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ue||"OTransition"===ue?ue+"End":"transitionend";function pe(t){return"string"==typeof t?document.getElementById(t):t}function fe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function _e(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function me(t){var e=t.parentNode;e&&e.removeChild(t)}function ge(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ve(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ye(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function be(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Pe(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function we(t,e){if(void 0!==t.classList)for(var i=d(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function ti(t){return Zt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Qe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ei(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var ii={__proto__:null,on:je,off:$e,stopPropagation:Ue,disableScrollPropagation:Ve,disableClickPropagation:Ke,preventDefault:Ge,stop:Ye,getPropagationPath:Xe,getMousePosition:Je,getWheelDelta:ti,isExternalTarget:ei,addListener:je,removeListener:$e},ni=O.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ae(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,j(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=B([r.min.add(i),r.max.subtract(n)]),l=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var c=s.subtract(a.getCenter()),h=a.extend(s).getSize().subtract(l);o.x+=c.x<0?-h.x:h.x,o.y+=c.y<0?-h.y:h.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=e.divideBy(2).round(),r=n.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new R(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),me(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)me(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=_e("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new Z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=j(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),c=B(this.project(a,n),this.project(r,n)).getSize(),h=Zt.any3d?this.options.zoomSnap:1,u=l.x/c.x,d=l.y/c.y,p=e?Math.max(u,d):Math.min(u,d);return n=this.getScaleZoom(p,n),h&&(n=Math.round(n/(h/100))*(h/100),n=e?Math.ceil(n/h)*h:Math.floor(n/h)*h),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint($(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project($(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng($(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(j(t))},distance:function(t,e){return this.options.crs.distance($(t),$(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint($(t)))},mouseEventToContainerPoint:function(t){return Je(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");je(e,"scroll",this._onScroll,this),this._containerId=r(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Zt.any3d,we(t,"leaflet-container"+(Zt.touch?" leaflet-touch":"")+(Zt.retina?" leaflet-retina":"")+(Zt.ielt9?" leaflet-oldie":"")+(Zt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=fe(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ee(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(we(t.markerPane,"leaflet-zoom-hide"),we(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Ee(this._mapPane,new z(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ee(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[r(this._container)]=this;var e=t?$e:je;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Zt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=k((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[r(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ei(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Ie(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var s=this._findEventTargets(t,e);if(n){for(var r=[],a=0;a0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Zt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){xe(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=_e("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=he,i=this._proxy.style[e];Ce(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){me(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ce(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(k((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,we(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&xe(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function si(t,e){return new oi(t,e)}var ri=E.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return we(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(me(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ai=function(t){return new ri(t)};oi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=_e("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=_e("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)me(this._controlCorners[t]);me(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var li=ri.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+r(this),n),this._layerControlInputs.push(e),e.layerId=r(t.layer),je(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ne.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,je(t,"click",Ge),this.expand();var e=this;setTimeout((function(){$e(t,"click",Ge),e._preventClick=!1}))}}),ci=function(t,e,i){return new li(t,e,i)},hi=ri.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=_e("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=_e("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ke(s),je(s,"click",Ye),je(s,"click",o,this),je(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";xe(this._zoomInButton,e),xe(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(we(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(we(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new hi,this.addControl(this.zoomControl))}));var ui=function(t){return new hi(t)},di=ri.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=_e("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=_e("div",e,i)),t.imperial&&(this._iScale=_e("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(t){return new di(t)},fi='',_i=ri.extend({options:{position:"bottomright",prefix:''+(Zt.inlineSvg?fi+" ":"")+"Leaflet"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=_e("div","leaflet-control-attribution"),Ke(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook((function(){this.options.attributionControl&&(new _i).addTo(this)}));var mi=function(t){return new _i(t)};ri.Layers=li,ri.Zoom=hi,ri.Scale=di,ri.Attribution=_i,ai.layers=ci,ai.zoom=ui,ai.scale=pi,ai.attribution=mi;var gi=E.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});gi.addTo=function(t,e){return t.addHandler(e,this),this};var vi={Events:S},yi=Zt.touch?"touchstart mousedown":"mousedown",bi=O.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){p(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(je(this._dragStartTarget,yi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bi._dragging===this&&this.finishDrag(!0),$e(this._dragStartTarget,yi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!be(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)bi._dragging===this&&this.finishDrag();else if(!(bi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bi._dragging=this,this._preventOutline&&Ie(this._element),Oe(),se(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Ne(this._element);this._startPoint=new z(e.clientX,e.clientY),this._startPos=Ae(this._element),this._parentScale=Be(i);var n="mousedown"===t.type;je(document,n?"mousemove":"touchmove",this._onMove,this),je(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)l&&(s=r,l=a);l>i&&(e[s]=1,Ai(t,e,i,n,s),Ai(t,e,i,s,o))}function Si(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Di(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ni(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,c=a*a+l*l;return c>0&&((o=((t.x-s)*a+(t.y-r)*l)/c)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new z(s,r)}function Bi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Bi(t)}function ji(t,e){var i,n,o,s,r,a,l,c;if(!t||0===t.length)throw new Error("latlngs not passed");Bi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=$([0,0]),u=j(t);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(h=Li(t));var d=t.length,p=[];for(i=0;in){l=(s-n)/o,c=[a.x-l*(a.x-r.x),a.y-l*(a.y-r.y)];break}var _=e.unproject(D(c));return $([_.lat+h.lat,_.lng+h.lng])}var Ri={__proto__:null,simplify:ki,pointToSegmentDistance:Mi,closestPointOnSegment:Ci,clipSegment:Oi,_getEdgeIntersection:zi,_getBitCode:Ii,_sqClosestPointOnSegment:Ni,isFlat:Bi,_flat:Zi,polylineCenter:ji},$i={project:function(t){return new z(t.lng,t.lat)},unproject:function(t){return new R(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Fi={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=c=Math.PI/2-2*Math.atan(r*e)-a;return new R(a*i,t.x*i/n)}},qi={__proto__:null,LonLat:$i,Mercator:Fi,SphericalMercator:U},Hi=i({},H,{code:"EPSG:3395",projection:Fi,transformation:function(){var t=.5/(Math.PI*Fi.R);return K(t,.5,-t,.5)}()}),Wi=i({},H,{code:"EPSG:4326",projection:$i,transformation:K(1/180,1,-1/180,.5)}),Ui=i({},q,{projection:$i,transformation:K(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});q.Earth=H,q.EPSG3395=Hi,q.EPSG3857=G,q.EPSG900913=Y,q.EPSG4326=Wi,q.Simple=Ui;var Vi=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof R&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){hn.prototype._setLatLngs.call(this,t),Bi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Bi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new z(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(c=!c);return c||hn.prototype._containsPoint.call(this,t,!0)}});function pn(t,e){return new dn(t,e)}var fn=Yi.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=g(t)?t:t.features;if(o){for(e=0,i=o.length;e0&&o.push(o[0].slice()),o}function wn(t,e){return t.feature?i({},t.feature,{geometry:e}):xn(e)}function xn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ln={toGeoJSON:function(t){return wn(this,{type:"Point",coordinates:yn(this.getLatLng(),t)})}};function Pn(t,e){return new fn(t,e)}nn.include(Ln),ln.include(Ln),rn.include(Ln),hn.include({toGeoJSON:function(t){var e=!Bi(this._latlngs);return wn(this,{type:(e?"Multi":"")+"LineString",coordinates:bn(this._latlngs,e?1:0,!1,t)})}}),dn.include({toGeoJSON:function(t){var e=!Bi(this._latlngs),i=e&&!Bi(this._latlngs[0]),n=bn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),wn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Ki.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),wn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=xn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?wn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Tn=Pn,kn=Vi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=j(e),p(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(we(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){me(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ve(this._image),this},bringToBack:function(){return this._map&&ye(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=j(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:_e("img");we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ce(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ee(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Te(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Mn=function(t,e,i){return new kn(t,e,i)},Cn=kn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:_e("video");if(we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],s=0;s0?n:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var r=0;ro?(e.height=o+"px",we(t,s)):xe(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ee(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(fe(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new z(this._containerLeft,-i-this._containerBottom);o._add(Ae(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),c=t.getSize(),h=0,u=0;s.x+n+l.x>c.x&&(h=s.x+n-c.x+l.x),s.x-h-a.x<0&&(h=s.x-a.x),s.y+i+l.y>c.y&&(u=s.y+i-c.y+l.y),s.y-u-a.y<0&&(u=s.y-a.y),(h||u)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([h,u]))}},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),In=function(t,e){return new zn(t,e)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(t,e,i){return this._initOverlay(zn,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Vi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(zn,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Yi||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Ye(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof sn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Dn=On.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){On.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){On.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=On.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=_e("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+r(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,l=o.offsetWidth,c=o.offsetHeight,h=D(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=c):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=c/2):"right"===a?(e=0,i=c/2):"left"===a?(e=l,i=c/2):r.xthis.options.maxZoom||in&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new z(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,i);else{for(var u=o.min.y;u<=o.max.y;u++)for(var d=o.min.x;d<=o.max.x;d++){var p=new z(d,u);if(p.z=this._tileZoom,this._isValidTile(p)){var f=this._tiles[this._tileCoordsToKey(p)];f?f.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var _=document.createDocumentFragment();for(d=0;di.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return j(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new Z(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(me(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){we(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,Zt.ielt9&&this.options.opacity<1&&Te(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&k(o(this._tileReady,this,t,null,s)),Ee(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Te(i.el,0),M(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(we(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Zt.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new z(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Rn(t){return new jn(t)}var $n=jn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Zt.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return je(i,"load",o(this._tileOnLoad,this,e,i)),je(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Zt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return m(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Zt.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,!e.complete)){e.src=y;var i=this._tiles[t].coords;me(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),jn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return jn.prototype._tileReady.call(this,t,e,i)}});function Fn(t,e){return new $n(t,e)}var qn=$n.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=p(this,e)).detectRetina&&Zt.retina?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,$n.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=B(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Wi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=$n.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Hn(t,e){return new qn(t,e)}$n.WMS=qn,Fn.wms=Hn;var Wn=Vi.extend({options:{padding:.1},initialize:function(t){p(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),we(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Zt.any3d?Ce(this._container,s,i):Ee(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Un=Wn.extend({options:{tolerance:0},getEvents:function(){var t=Wn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");je(t,"mousemove",this._onMouseMove,this),je(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),je(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,me(this._container),$e(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Zt.retina?2:1;Ee(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Zt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Wn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[r(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Gn={_initContainer:function(){this._container=_e("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Kn("shape");we(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Kn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;me(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Kn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Kn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ve(t._container)},_bringToBack:function(t){ye(t._container)}},Yn=Zt.vml?Kn:X,Xn=Wn.extend({_initContainer:function(){this._container=Yn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){me(this._container),$e(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ee(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Yn("path");t.options.className&&we(e,t.options.className),t.options.interactive&&we(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){me(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,J(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ve(t._path)},_bringToBack:function(t){ye(t._path)}});function Jn(t){return Zt.svg||Zt.vml?new Xn(t):null}Zt.vml&&Xn.include(Gn),oi.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Vn(t)||Jn(t)}});var Qn=dn.extend({initialize:function(t,e){dn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=j(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function to(t,e){return new Qn(t,e)}Xn.create=Yn,Xn.pointsToPath=J,fn.geometryToLayer=_n,fn.coordsToLatLng=gn,fn.coordsToLatLngs=vn,fn.latLngToCoords=yn,fn.latLngsToCoords=bn,fn.getFeature=wn,fn.asFeature=xn,oi.mergeOptions({boxZoom:!0});var eo=gi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){$e(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){me(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),se(),Oe(),this._startPoint=this._map.mouseEventToContainerPoint(t),je(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=_e("div","leaflet-zoom-box",this._container),we(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ee(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(me(this._box),xe(this._container,"leaflet-crosshair")),re(),ze(),$e(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",eo),oi.mergeOptions({doubleClickZoom:!0});var io=gi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});oi.addInitHook("addHandler","doubleClickZoom",io),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var no=gi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}we(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){xe(this._map._container,"leaflet-grab"),xe(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=j(this._map.options.maxBounds);this._offsetLimit=B(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});oi.addInitHook("addHandler","scrollWheelZoom",so);var ro=600;oi.mergeOptions({tapHold:Zt.touchNative&&Zt.safari&&Zt.mobile,tapTolerance:15});var ao=gi.extend({addHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){$e(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new z(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(je(document,"touchend",Ge),je(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),ro),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){$e(document,"touchend",Ge),$e(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),$e(document,"touchend touchcancel contextmenu",this._cancel,this),$e(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new z(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});oi.addInitHook("addHandler","tapHold",ao),oi.mergeOptions({touchZoom:Zt.touch,bounceAtZoomLimits:!0});var lo=gi.extend({addHooks:function(){we(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){xe(this._map._container,"leaflet-touch-zoom"),$e(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),Ge(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(a,this,!0),Ge(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),$e(document,"touchmove",this._onTouchMove,this),$e(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});oi.addInitHook("addHandler","touchZoom",lo),oi.BoxZoom=eo,oi.DoubleClickZoom=io,oi.Drag=no,oi.Keyboard=oo,oi.ScrollWheelZoom=so,oi.TapHold=ao,oi.TouchZoom=lo,t.Bounds=N,t.Browser=Zt,t.CRS=q,t.Canvas=Un,t.Circle=ln,t.CircleMarker=rn,t.Class=E,t.Control=ri,t.DivIcon=Bn,t.DivOverlay=On,t.DomEvent=ii,t.DomUtil=Ze,t.Draggable=bi,t.Evented=O,t.FeatureGroup=Yi,t.GeoJSON=fn,t.GridLayer=jn,t.Handler=gi,t.Icon=Ji,t.ImageOverlay=kn,t.LatLng=R,t.LatLngBounds=Z,t.Layer=Vi,t.LayerGroup=Ki,t.LineUtil=Ri,t.Map=oi,t.Marker=nn,t.Mixin=vi,t.Path=sn,t.Point=z,t.PolyUtil=Ti,t.Polygon=dn,t.Polyline=hn,t.Popup=zn,t.PosAnimation=ni,t.Projection=qi,t.Rectangle=Qn,t.Renderer=Wn,t.SVG=Xn,t.SVGOverlay=An,t.TileLayer=$n,t.Tooltip=Dn,t.Transformation=V,t.Util=C,t.VideoOverlay=Cn,t.bind=o,t.bounds=B,t.canvas=Vn,t.circle=cn,t.circleMarker=an,t.control=ai,t.divIcon=Zn,t.extend=i,t.featureGroup=Xi,t.geoJSON=Pn,t.geoJson=Tn,t.gridLayer=Rn,t.icon=Qi,t.imageOverlay=Mn,t.latLng=$,t.latLngBounds=j,t.layerGroup=Gi,t.map=si,t.marker=on,t.point=D,t.polygon=pn,t.polyline=un,t.popup=In,t.rectangle=to,t.setOptions=p,t.stamp=r,t.svg=Jn,t.svgOverlay=Sn,t.tileLayer=Fn,t.tooltip=Nn,t.transformation=K,t.version=e,t.videoOverlay=En;var co=window.L;t.noConflict=function(){return window.L=co,this},window.L=t}(so.exports)),so.exports}var ao,lo,co=ro(),ho={exports:{}};ao||(ao=1,lo=ho,function(t,e){lo.exports=t(ro()),void 0!==e&&e.L&&(e.L.Control.MiniMap=t(L),e.L.control.minimap=function(t,i){return new e.L.Control.MiniMap(t,i)})}((function(t){var e=t.Control.extend({includes:t.Evented?t.Evented.prototype:t.Mixin.Events,options:{position:"bottomright",toggleDisplay:!1,zoomLevelOffset:-5,zoomLevelFixed:!1,centerFixed:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,clickable:!1},shadowRectOptions:{color:"#000000",weight:1,clickable:!1,opacity:0,fillOpacity:0},strings:{hideText:"Hide MiniMap",showText:"Show MiniMap"},mapOptions:{}},initialize:function(e,i){t.Util.setOptions(this,i),this.options.aimingRectOptions.clickable=!1,this.options.shadowRectOptions.clickable=!1,this._layer=e},onAdd:function(e){this._mainMap=e,this._container=t.DomUtil.create("div","leaflet-control-minimap"),this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",t.DomEvent.disableClickPropagation(this._container),t.DomEvent.on(this._container,"mousewheel",t.DomEvent.stopPropagation);var i={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:!1,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:e.options.crs};return i=t.Util.extend(this.options.mapOptions,i),this._miniMap=new t.Map(this._container,i),this._miniMap.addLayer(this._layer),this._mainMapMoving=!1,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(t.Util.bind((function(){this._aimingRect=t.rectangle(this._mainMap.getBounds(),this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=t.rectangle(this._mainMap.getBounds(),this.options.shadowRectOptions).addTo(this._miniMap),this._mainMap.on("moveend",this._onMainMapMoved,this),this._mainMap.on("move",this._onMainMapMoving,this),this._miniMap.on("movestart",this._onMiniMapMoveStarted,this),this._miniMap.on("move",this._onMiniMapMoving,this),this._miniMap.on("moveend",this._onMiniMapMoved,this)}),this)),this._container},addTo:function(e){t.Control.prototype.addTo.call(this,e);var i=this.options.centerFixed||this._mainMap.getCenter();return this._miniMap.setView(i,this._decideZoom(!0)),this._setDisplay(this.options.minimized),this},onRemove:function(t){this._mainMap.off("moveend",this._onMainMapMoved,this),this._mainMap.off("move",this._onMainMapMoving,this),this._miniMap.off("moveend",this._onMiniMapMoved,this),this._miniMap.removeLayer(this._layer)},changeLayer:function(t){this._miniMap.removeLayer(this._layer),this._layer=t,this._miniMap.addLayer(this._layer)},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText:function(){return this.options.minimized?this.options.strings.showText:this.options.strings.hideText},_createButton:function(e,i,n,o,s,r){var a=t.DomUtil.create("a",n,o);a.innerHTML=e,a.href="#",a.title=i;var l=t.DomEvent.stopPropagation;return t.DomEvent.on(a,"click",l).on(a,"mousedown",l).on(a,"dblclick",l).on(a,"click",t.DomEvent.preventDefault).on(a,"click",s,r),a},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_setDisplay:function(t){t!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore:function(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMainMapMoved:function(t){if(this._miniMapMoving)this._miniMapMoving=!1;else{var e=this.options.centerFixed||this._mainMap.getCenter();this._mainMapMoving=!0,this._miniMap.setView(e,this._decideZoom(!0)),this._setDisplay(this._decideMinimized())}this._aimingRect.setBounds(this._mainMap.getBounds())},_onMainMapMoving:function(t){this._aimingRect.setBounds(this._mainMap.getBounds())},_onMiniMapMoveStarted:function(t){if(!this.options.centerFixed){var e=this._aimingRect.getBounds(),i=this._miniMap.latLngToContainerPoint(e.getSouthWest()),n=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:i,ne:n}}},_onMiniMapMoving:function(e){this.options.centerFixed||!this._mainMapMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new t.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){this._mainMapMoving?this._mainMapMoving=!1:(this._miniMapMoving=!0,this._mainMap.setView(this._miniMap.getCenter(),this._decideZoom(!1)),this._shadowRect.setStyle({opacity:0,fillOpacity:0}))},_isZoomLevelFixed:function(){var t=this.options.zoomLevelFixed;return this._isDefined(t)&&this._isInteger(t)},_decideZoom:function(t){if(this._isZoomLevelFixed())return t?this.options.zoomLevelFixed:this._mainMap.getZoom();if(t)return this._mainMap.getZoom()+this.options.zoomLevelOffset;var e,i=this._miniMap.getZoom()-this._mainMap.getZoom(),n=this._miniMap.getZoom()-this.options.zoomLevelOffset;return i>this.options.zoomLevelOffset&&this._mainMap.getZoom()this._lastMiniMapZoom?(e=this._mainMap.getZoom()+1,this._miniMap.setZoom(this._miniMap.getZoom()-1)):e=this._mainMap.getZoom():e=n,this._lastMiniMapZoom=this._miniMap.getZoom(),e},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._mainMap.getBounds().contains(this._miniMap.getBounds()):this._minimized},_isInteger:function(t){return"number"==typeof t},_isDefined:function(t){return void 0!==t},_onToggle:function(){t.Util.requestAnimFrame((function(){t.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),t.Browser.any3d||t.Util.requestAnimFrame(this._fireToggleEvents,this)}),this)},_fireToggleEvents:function(){t.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this);var e={minimized:this._minimized};this.fire(this._minimized?"minimize":"restore",e),this.fire("toggle",e)}});return t.Map.mergeOptions({miniMapControl:!1}),t.Map.addInitHook((function(){this.options.miniMapControl&&(this.miniMapControl=(new e).addTo(this))})),e}),window));var uo=si(' ',1),po=si(''),fo=si('
');ti(["click"]);var _o=si('
',1);function mo(t,e){W(e,!0);let i,n=Wi(e,"display_minimap",3,!1),o=Wi(e,"current_result",3,null),s=Wi(e,"position_marker",3,null),r=[];function a(){An.viewboxStr=function(t){var e=t.getBounds(),i=e.getWest(),n=e.getEast();return n-i>=360&&(i=t.getCenter().lng-179.999,n=t.getCenter().lng+179.999),n=co.latLng(77,n).wrap().lng,[(i=co.latLng(77,i).wrap().lng).toFixed(5),e.getNorth().toFixed(5),n.toFixed(5),e.getSouth().toFixed(5)].join(",")}(i),An.center=i.getCenter(),An.zoom=i.getZoom()}function l(t){return function(t){const e=Nominatim_Config.Map_Tile_Attribution;if(i=new co.map(t,{attributionControl:!1,scrollWheelZoom:!0,touchZoom:!1,center:co.latLng(Nominatim_Config.Map_Default_Lat,Nominatim_Config.Map_Default_Lon),zoom:Nominatim_Config.Map_Default_Zoom}),void 0!==Nominatim_Config.Map_Default_Bounds&&Nominatim_Config.Map_Default_Bounds&&i.fitBounds(Nominatim_Config.Map_Default_Bounds),e&&e.length&&co.control.attribution({prefix:'Leaflet'}).addTo(i),a(),co.control.scale().addTo(i),co.tileLayer(Nominatim_Config.Map_Tile_URL,{attribution:e}).addTo(i),n()){let t=new co.TileLayer(Nominatim_Config.Map_Tile_URL,{minZoom:0,maxZoom:13,attribution:e});new co.Control.MiniMap(t,{toggleDisplay:!0}).addTo(i)}i.on("move",a),i.on("mousemove",(t=>{An.mousePos=t.latlng})),i.on("click",(t=>{An.lastClick=t.latlng}))}(t),c(s(),o()),{destroy:()=>{An.reset(),i.remove()}}}function c(t,e){if(!i)return;if(i&&r.forEach((function(t){i.removeLayer(t)})),t){let e=co.circleMarker(t,{radius:5,weight:2,fillColor:"#ff7800",color:"red",opacity:.75,zIndexOffset:100,clickable:!1});e.bindTooltip(`Search (${t[0]},${t[1]})`).openTooltip(),e.addTo(i),r.push(e)}var n=new URLSearchParams(window.location.search).get("viewbox");if(n){let t=n.split(","),o=co.latLngBounds([t[1],t[0]],[t[3],t[2]]),s=co.rectangle(o,{color:"#69d53e",weight:3,dashArray:"5 5",opacity:.8,fill:!1,interactive:!1});i.addLayer(s),r.push(s),e||i.fitBounds(o)}if(!e)return;let o=e.centroid?e.centroid.coordinates[1]:e.lat,s=e.centroid?e.centroid.coordinates[0]:e.lon,a=e.geometry||e.geojson,l=e.entrances;if(o&&s){let e=co.circleMarker([o,s],{radius:10,weight:2,fillColor:"#ff7800",color:"blue",opacity:.75});t&&e.bindTooltip("Result").openTooltip(),i.addLayer(e),r.push(e)}if(a){var c=co.geoJson({type:"FeatureCollection",features:[{type:"Feature",geometry:a,properties:{}}]},{style:()=>({interactive:!1,color:"blue"})});i.addLayer(c),r.push(c),i.fitBounds(c.getBounds())}else o&&s&&t?i.fitBounds([[o,s],t],{padding:[50,50]}):o&&s&&i.setView([o,s],10);l&&l.forEach(((t,e)=>{let n=co.circleMarker([t.lat,t.lon],{radius:5,weight:2,fillColor:"#ff7800",color:"red",opacity:.75});n.bindTooltip(`Entrance ${e+1} (type=${t.type})`).openTooltip(),i.addLayer(n),r.push(n)}))}Qt((()=>{c(s(),o())}));var h=_o(),u=Ht(h);!function(t,e,i){ee((()=>{var n=We((()=>e(t,i?.())||{}));if(n?.destroy)return()=>n.destroy()}))}(u,(t=>l?.(t))),function(t,e){W(e,!0);let i=Et(!1);const n=bt((()=>`https://openstreetmap.org/#map=${An.zoom}/${An.center.lat.toFixed(5)}/${An.center.lng.toFixed(5)}`)),o=bt((()=>`https://overpass-turbo.eu/?lat=${An.center.lat.toFixed(5)}&lon=${An.center.lng.toFixed(5)}`));function s(t){return t?`${t.lat.toFixed(5)},${t.lng.toFixed(5)}`:"-"}var r=fo(),a=qt(r),l=t=>{var e=uo(),r=Ht(e),a=qt(r),l=Wt(a),c=Wt(l,2),h=Wt(c,3),u=Wt(h,2),d=Wt(u,2),p=Wt(d,2);qt(Wt(r,2)).__click=()=>At(i,!1),ne(((t,e,i)=>{ci(a,`map center: ${t??""} `),Ni(l,"href",Fe(n)),Ni(c,"href",Fe(o)),ci(h,` map zoom: ${An.zoom??""} `),ci(u,` viewbox: ${An.viewboxStr??""} `),ci(d,` last click: ${e??""} `),ci(p,` mouse position: ${i??""}`)}),[()=>s(An.center),()=>s(An.lastClick),()=>s(An.mousePos)]),li(t,e)},c=t=>{var e=po();e.__click=()=>At(i,!0),li(t,e)};pi(a,(t=>{Fe(i)?t(l):t(c,!1)})),li(t,r),U()}(Wt(u,2),{}),li(t,h),U()}var go=si('
',1);function vo(t,e){W(e,!0);const i=t=>{!function(t,e){W(e,!0);const i=t=>{var e=qn(),i=Wt(qt(e),2),n=Wt(i,2),o=Wt(n,2),s=Wt(o,2),l=Wt(s,2);Ni(l,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$");var c=Wt(l,2),h=Wt(c,2),u=Wt(h,2);ne((()=>{Ii(i,Fe(a)?An.viewboxStr:""),Ii(n,0===r().dedupe?0:1),Ii(o,r().bounded?1:""),Ii(s,r()["accept-language"]||""),Ii(l,r().countrycodes||""),Ii(c,r().limit||""),Ii(h,r().polygon_threshold||""),Ii(u,r().layer||"")})),li(t,e)},n=t=>{var e=Hn(),n=Ht(e),o=qt(n),s=Wt(n,2);i(s),ne((()=>Ii(o,r().q||""))),li(t,e)},o=t=>{var e=Wn(),n=Ht(e),o=qt(n),s=Wt(n,2),a=qt(s),l=Wt(s,2),c=qt(l),h=Wt(l,2),u=qt(h),d=Wt(h,2),p=qt(d),f=Wt(d,2),_=qt(f),m=Wt(f,2),g=qt(m),v=Wt(m,2);i(v),ne((()=>{Ii(o,r().amenity||""),Ii(a,r().street||""),Ii(c,r().city||""),Ii(u,r().county||""),Ii(p,r().state||""),Ii(_,r().country||""),Ii(g,r().postalcode||"")})),li(t,e)};let s=Wi(e,"bStructuredSearch",3,!1),r=Wi(e,"api_request_params",19,(()=>({}))),a=Et(It(r().viewbox||!1));function l(t){document.querySelector("input[name="+t.target.dataset.apiParam+"]").value=t.target.value}var c=Un(),h=Ht(c),u=qt(h),d=qt(u);let p;var f=qt(Wt(u,2));let _;var m=Wt(h,2),g=qt(m);let v;Rn(qt(g),{page:"search",get content(){return n}});var y=Wt(g,2);let b;Rn(qt(y),{page:"search",get content(){return o}});var w=Wt(m,2),x=Wt(qt(w),2),L=qt(x),P=qt(L),T=Wt(qt(P),2);T.__change=()=>At(a,!Fe(a));var k=Wt(L,2),M=qt(k),C=Wt(qt(M),2);C.__change=function(t){document.querySelector("input[name=bounded]").value=t.target.checked?1:""};var E=Wt(k,2),A=qt(E),S=Wt(qt(A),2);S.__change=function(t){document.querySelector("input[name=dedupe]").value=t.target.checked?1:0};var O=Wt(E,2),z=Wt(qt(O),2);z.__change=l;var I=Wt(O,2),D=Wt(qt(I),2);D.__change=l;var N=Wt(I,2),B=Wt(qt(N),2);B.__change=l;var Z=Wt(N,2),j=Wt(qt(Z),2);Ni(j,"pattern","^[a-zA-Z]{2}(,[a-zA-Z]{2})*$"),j.__change=l;var R=Wt(Z,2),$=Wt(qt(R),2);$.__change=l,Fn(Wt(x,2)),ne((()=>{p=ki(d,0,"nav-link svelte-1c3z3yb",null,p,{active:!s()}),_=ki(f,0,"nav-link svelte-1c3z3yb",null,_,{active:s()}),v=ki(g,0,"tab-pane",null,v,{active:!s()}),b=ki(y,0,"tab-pane",null,b,{active:s()}),Di(T,r().viewbox),Di(C,!!r().bounded),Di(S,0===r().dedupe?0:1),Ii(z,r().limit||""),Ii(D,r().polygon_threshold||""),Ii(B,r()["accept-language"]||""),Ii(j,r().countrycodes||""),Ii($,r().layer||"")})),li(t,c),U()}(t,{get api_request_params(){return Fe(s)},bStructuredSearch:n})};let n,o=Et(void 0),s=Et(void 0),r=Et(void 0);Qt((()=>{if("search"===un.page.tab){const t=un.page.params;We((()=>function(t){nn(),At(s,{q:t.get("q"),amenity:t.get("amenity"),street:t.get("street"),city:t.get("city"),county:t.get("county"),state:t.get("state"),country:t.get("country"),postalcode:t.get("postalcode"),polygon_geojson:Nominatim_Config.Search_AreaPolygons?1:0,viewbox:t.get("viewbox"),bounded:t.get("bounded"),dedupe:t.has("dedupe")&&"1"!==t.get("dedupe")?0:1,"accept-language":t.get("accept-language"),countrycodes:t.get("countrycodes"),layer:t.get("layer"),limit:t.get("limit"),polygon_threshold:t.get("polygon_threshold"),exclude_place_ids:t.get("exclude_place_ids"),format:"jsonv2"});let e=Fe(s).amenity||Fe(s).street||Fe(s).city||Fe(s).county||Fe(s).state||Fe(s).country||Fe(s).postalcode;Fe(s).q||e?un.fetchFromApi("search",Fe(s),(function(t){At(o,t,!0),e?(nn("Result for "+[Fe(s).amenity,Fe(s).street,Fe(s).city,Fe(s).county,Fe(s).state,Fe(s).country,Fe(s).postalcode].filter((t=>t&&t.length>1)).join(", ")),document.querySelector(".nav-tabs a[href='#structured']").click(),document.querySelector("input[name=street]").focus()):(nn("Result for "+Fe(s).q),document.querySelector("input[name=q]").focus())})):At(o,void 0)}(t)))}}));var a=go(),l=Ht(a);Dn(l,{get subheader(){return i}});var c=qt(Wt(l,2));no(qt(c),{get results(){return Fe(o)},reverse_search:!1,get current_result(){return Fe(r)},set current_result(t){At(r,t,!0)}}),mo(qt(Wt(c,2)),{get current_result(){return Fe(r)},display_minimap:!0}),li(t,a),U()}var yo=si(""),bo=si('
',1),wo=si('
Advanced options
',1);ti(["change","click"]);var xo=si('
',1);function Lo(t,e){W(e,!0);const i=t=>{{let e=bt((()=>Fe(o)?.lat)),i=bt((()=>Fe(o)?.lon)),n=bt((()=>Fe(o)?.zoom));!function(t,e){W(e,!0);const i=t=>{var e=bo(),i=Wt(Ht(e),2),l=qt(i);l.__change=a;var h=Wt(i,2);qt(h).__click=c;var u=Wt(h,4),d=qt(u),p=Wt(u,4),f=qt(p),_=qt(f);_.value=_.__value="",gi(Wt(_),17,ln,fi,((t,e,i)=>{var n=yo(),o=qt(n);n.value=n.__value=i,ne((()=>ci(o,`${i} - ${Fe(e)??""}`))),li(t,n)}));var m=Wt(p,2),g=Wt(m,2),v=Wt(g,2);ne((()=>{Ii(m,r().layer||""),Ii(g,r().polygon_threshold||""),Ii(v,r()["accept-language"]||"")})),ji(l,n),ji(d,o),Ai(f,s),li(t,e)};let n=Wi(e,"lat",7,""),o=Wi(e,"lon",7,""),s=Wi(e,"zoom",7,""),r=Wi(e,"api_request_params",19,(()=>({})));function a(t){var e=t.target.value.split(/,|%2C/);2===e.length&&(document.querySelector("input[name=lat]").value=L.Util.trim(e[0]),document.querySelector("input[name=lon]").value=L.Util.trim(e[1]))}function l(t){document.querySelector("input[name="+t.target.dataset.apiParam+"]").value=t.target.value}function c(t){t.preventDefault(),t.stopPropagation(),un.refreshPage("reverse",new URLSearchParams({lat:o()||"",lon:n()||"",zoom:s()}))}Qt((()=>{const t=An.lastClick,e=Number(n())!==t?.lat,i=Number(o())!==t?.lng;if(t&&(e||i)){const e=new Bn(un.page?.params||{});e.set("lat",t.lat),e.set("lon",t.lng),s()?e.set("zoom",s()):e.delete("zoom"),un.refreshPage("reverse",e)}}));var h=wo(),u=Ht(h);Rn(u,{page:"reverse",get content(){return i}});var d=Wt(u,2),p=Wt(qt(d),2),f=qt(p),_=Wt(qt(f),2);_.__change=l;var m=Wt(f,2),g=Wt(qt(m),2);g.__change=l;var v=Wt(m,2),y=Wt(qt(v),2);y.__change=l,Fn(Wt(p,2)),ne((()=>{Ii(_,r().layer||""),Ii(g,r().polygon_threshold||""),Ii(y,r()["accept-language"]||"")})),li(t,h),U()}(t,{get lat(){return Fe(e)},get lon(){return Fe(i)},get zoom(){return Fe(n)},get api_request_params(){return Fe(o)}})}};let n=Et(void 0),o=Et(void 0),s=Et(void 0),r=Et(void 0);Qt((()=>{if("reverse"===un.page.tab){const t=un.page.params;We((()=>{return e=t,nn(),At(o,{lat:e.get("lat"),lon:e.get("lon"),zoom:e.get("zoom")>1?Number(e.get("zoom")):Number(Nominatim_Config.Reverse_Default_Search_Zoom),polygon_geojson:Nominatim_Config.Search_AreaPolygons?1:0,layer:e.get("layer"),polygon_threshold:e.get("polygon_threshold"),"accept-language":e.get("accept-language"),format:"jsonv2"}),void(Fe(o).lat&&Fe(o).lon?(At(r,[Fe(o).lat,Fe(o).lon],!0),un.fetchFromApi("reverse",Fe(o),(function(t){t&&!t.error?At(n,[t]):At(n,[]),nn("Reverse result for "+Fe(o).lat+","+Fe(o).lon),document.querySelector("input[name=lat]").focus()}))):At(n,void 0));var e}))}}));var a=xo(),l=Ht(a);Dn(l,{get subheader(){return i}});var c=qt(Wt(l,2));no(qt(c),{get results(){return Fe(n)},reverse_search:!0,get current_result(){return Fe(s)},set current_result(t){At(s,t,!0)}}),mo(qt(Wt(c,2)),{get current_result(){return Fe(s)},get position_marker(){return Fe(r)},display_minimap:!0}),li(t,a),U()}var Po=si('
OSM type+id (N123, n123, W123, w123, R123, r123),\n Place id (1234) or\n URL (https://openstreetmap.org/way/123)',1);var To=si("Local nameTypeOSMAddress rankAdmin levelDistance");function ko(t){li(t,To())}var Mo=si(" ");function Co(t,e){W(e,!0);const i=bt((()=>rn(e.osmType,!1))),n=bt((()=>`https://www.openstreetmap.org/${Fe(i)}/${e.osmId}`));var o=ai(),s=Ht(o),r=t=>{var o=Mo(),s=qt(o);ne((()=>{Ni(o,"href",Fe(n)),ci(s,`${Fe(i)??""} ${e.osmId??""}`)})),li(t,o)};pi(s,(t=>{Fe(i)&&t(r)})),li(t,o),U()}var Eo=si('No Name'),Ao=si(' ');function So(t,e){W(e,!0);let i=Wi(e,"bMarkUnusedLines",3,!1);const n=bt((()=>e.addressLine.isaddress)),o=bt((()=>Nominatim_Config.Reverse_Only));var s=Ao();let r;var a=qt(s),l=qt(a),c=t=>{var i=ri();ne((()=>ci(i,e.addressLine.localname))),li(t,i)},h=t=>{li(t,Eo())};pi(l,(t=>{e.addressLine.localname?t(c):t(h,!1)}));var u=Wt(a),d=qt(u),p=Wt(u);Co(qt(p),{get osmType(){return e.addressLine.osm_type},get osmId(){return e.addressLine.osm_id}});var f=Wt(p),_=qt(f),m=Wt(f),g=qt(m),v=Wt(m);!function(t,e,i=!1,n=!1){var o=t,s="";ne((()=>{var t=Le;if(s!==(s=e()??"")&&(null!==t.nodes&&(ce(t.nodes.start,t.nodes.end),t.nodes=null),""!==s)){var r=s+"";i?r=`${r}`:n&&(r=`${r}`);var a=ni(r);if((i||n)&&(a=$t(a)),oi($t(a),a.lastChild),i||n)for(;$t(a);)o.before($t(a));else o.before(a)}}))}(qt(v),(()=>{return t=e.addressLine.distance,e.bDistanceInMeters?t<1?"0":'~'+(t>=1e3?Math.round(t/1e3,1)+" km":Math.round(t,0)+" m")+"":0===t?"0":'~'+Math.round(1e3*t,4)/1e3+"";var t}));var y=qt(Wt(v)),b=t=>{Kn(t,{get feature(){return e.addressLine}})},w=t=>{var i=ai(),n=Ht(i),s=t=>{{let i=bt((()=>({country:e.addressLine.localname})));fn(t,{page:"search",text:"search by name",get params_hash(){return Fe(i)}})}},r=t=>{var i=ai(),n=Ht(i),s=t=>{{let i=bt((()=>({postalcode:e.addressLine.localname,country:e.sCountryCode})));fn(t,{page:"search",text:"search by name",get params_hash(){return Fe(i)}})}};pi(n,(t=>{Fe(o)||"postcode"!==e.addressLine.type||t(s)}),!0),li(t,i)};pi(n,(t=>{!Fe(o)&&e.addressLine.type.match(/^country/)?t(s):t(r,!1)}),!0),li(t,i)};pi(y,(t=>{e.addressLine.osm_id?t(b):t(w,!1)})),ne(((t,o)=>{r=ki(s,0,"svelte-1xlslzu",null,r,{notused:i()&&!Fe(n)}),ci(d,t),ci(_,e.addressLine.rank_address),ci(g,o)}),[()=>{return t=e.addressLine,i=t.class+":"+t.type,t.type&&"administrative"===t.type&&t.place_type&&(i=i+" ("+t.place_type+")"),sn(i);var t,i},()=>{return(t=e.addressLine.admin_level)&&t<15?t:"";var t}]),li(t,s),U()}var Oo=si('

Additionally supplemented by Ordnance Survey Code-Point® Open data. UK Postcode data for Nominatim

'),zo=si("

Additionally supplemented by data derived from US Census (TIGER) data.

"),Io=si('(how?)

Nightly calculated from nearby places having this postcode. Documentation.

You can search for those with an Overpass Turbo query.

How Nominatim uses postcodes.

',1);ti(["click"]);var Do=si('
');function No(t,e){W(e,!0);var i=ai();gi(Ht(i),17,(()=>Object.keys(e.items)),fi,((t,i)=>{var n=Do(),o=qt(n),s=qt(o),r=Wt(o);ne((()=>{ci(s,e.items[Fe(i)]),ci(r,` (${Fe(i)??""})`)})),li(t,n)})),li(t,i),U()}var Bo=si(' ');var Zo=si('No Name'),jo=si('Admin Level '),Ro=si('Importance '),$o=si('Wikipedia Calculated'),Fo=si(" ",1),qo=si('

Name
Type
Last Updated
Search Rank
Address Rank
Coverage
Centre Point (lat,lon)
OSM
Place Id on this server)
Computed Postcode
Address Tags
Extra Tags
',1),Ho=si('
'),Wo=si('
'),Uo=si(' '),Vo=si('
Entrance TypeOSMExtra Tags
'),Ko=si("

Place does not have entrances

"),Go=si(" "),Yo=si(" "),Xo=si(" "),Jo=si('

Address Keywords

',1),Qo=si('

Name Keywords

',1),ts=si("

Place has no keywords

"),es=si('display keywords'),is=si('

Keywords

',1),ns=si('

',1),os=si("

There are more child objects which are not shown.

"),ss=si(" ",1),rs=si("

Place is not parent of other places

"),as=si('display child places'),ls=si('

Address

Linked Places

Entrances

Parent Of

'),cs=si('
',1);function hs(t,e){W(e,!0);const i=t=>{!function(t,e){W(e,!0);let i=Wi(e,"api_request_params",19,(()=>({})));var n=Po(),o=Ht(n),s=qt(o),r=qt(s),a=qt(r);ne((()=>Ii(a,(i().osmtype||"")+(i().osmid||"")+(i().place_id||"")))),Qe("submit",o,(function(t){t.preventDefault();let e=t.target.querySelector("input[type=edit]").value.trim(),i=e.match(/^\s*([NWR])(-?\d+)\s*$/i)||e.match(/\/(relation|way|node)\/(-?\d+)\s*$/);const n={};if(i)n.osmtype=i[1].charAt(0).toUpperCase(),n.osmid=i[2];else{if(!e.match(/^\d+$/))return void alert("invalid input");n.place_id=e}un.refreshPage("details",new URLSearchParams(n))})),li(t,n),U()}(t,{get api_request_params(){return Fe(s)}})};let n=Et(void 0),o=Et(void 0),s=Et(void 0),r=Et(!1);Qt((()=>{if("details"===un.page.tab){const t=un.page.params;We((()=>{var e;At(s,{place_id:(e=t).get("place_id"),osmtype:e.get("osmtype"),osmid:e.get("osmid"),class:e.get("class"),keywords:e.get("keywords"),addressdetails:1,entrances:1,hierarchy:"1"===e.get("hierarchy")?1:0,group_hierarchy:1,polygon_geojson:1,format:"json"}),At(r,!1),Fe(s).place_id||Fe(s).osmtype&&Fe(s).osmid?(Fe(s).place_id?nn("Details for "+Fe(s).place_id):nn("Details for "+Fe(s).osmtype+Fe(s).osmid),un.fetchFromApi("details",Fe(s),(function(t){window.scrollTo(0,0),At(r,!0),At(n,t&&!t.error?t:void 0,!0)}))):At(n,void 0),At(o,window.location.search,!0)}))}}));const a=Nominatim_Config.Reverse_Only;var l=cs(),c=Ht(l);Dn(c,{get subheader(){return i}});var h=qt(Wt(c,2)),u=t=>{var e=qo(),i=Ht(e),o=qt(i),s=qt(o),r=qt(s);Kn(qt(Wt(r)),{get feature(){return Fe(n)},text:"link to this page"}),Xn(qt(Wt(o,2)),{get aPlace(){return Fe(n)}});var a=qt(Wt(i,2)),l=qt(a),c=qt(l),h=qt(c),u=Wt(qt(h)),d=qt(u),p=t=>{No(t,{get items(){return Fe(n).names}})},f=t=>{li(t,Zo())};pi(d,(t=>{Fe(n).names&&"object"==typeof Fe(n).names&&Object.keys(Fe(n).names).length?t(p):t(f,!1)}));var _=Wt(h),m=Wt(qt(_)),g=qt(m),v=Wt(_),y=Wt(qt(v)),b=qt(y),w=Wt(v),x=t=>{var e=jo(),i=Wt(qt(e)),o=qt(i);ne((()=>ci(o,Fe(n).admin_level))),li(t,e)};pi(w,(t=>{(function(t){return"boundary"===t.category&&"administrative"===t.type})(Fe(n))&&t(x)}));var L=Wt(w),P=Wt(qt(L)),T=qt(P),k=Wt(L),M=Wt(qt(k)),C=qt(M),E=Wt(k),A=t=>{var e=Ro(),i=Wt(qt(e)),o=qt(i),s=Wt(o),r=t=>{li(t,ri("(estimated)"))};pi(s,(t=>{Fe(n).importance||t(r)})),ne((()=>ci(o,`${Fe(n).calculated_importance??""} `))),li(t,e)};pi(E,(t=>{Fe(n).calculated_importance&&t(A)}));var S=Wt(E),O=Wt(qt(S)),z=qt(O),I=Wt(S),D=Wt(qt(I)),N=qt(D),B=Wt(I),Z=Wt(qt(B));Co(qt(Z),{get osmType(){return Fe(n).osm_type},get osmId(){return Fe(n).osm_id}});var j=Wt(B),R=Wt(qt(j)),$=qt(R),F=Wt(j),q=t=>{var e=$o(),i=Wt(qt(e));!function(t,e){W(e,!0);const i=bt((()=>e.wikipedia?e.wikipedia.split(":",2):null)),n=bt((()=>String(Fe(i)[0]).toLowerCase().replace(/[^a-z0-9-]/g,""))),o=bt((()=>`https://${Fe(n)||"en"}.wikipedia.org/wiki/${encodeURIComponent(Fe(i)[1])}`));var s=ai(),r=Ht(s),a=t=>{var i=Bo(),n=qt(i);ne((()=>{Ni(i,"href",Fe(o)),ci(n,e.wikipedia)})),li(t,i)};pi(r,(t=>{e.wikipedia&&t(a)})),li(t,s),U()}(qt(i),{get wikipedia(){return Fe(n).calculated_wikipedia}}),li(t,e)};pi(F,(t=>{Fe(n).calculated_wikipedia&&t(q)}));var H=Wt(F),V=Wt(qt(H)),K=qt(V),G=t=>{var e=Fo(),i=Ht(e),o=Wt(i);{let t=bt((()=>Fe(n).calculated_postcode||Fe(n).names.ref));!function(t,e){W(e,!0);const i=bt((()=>`\n // Based on the map bounds, you can zoom out and rerun the query\n\n [timeout:30]; // in seconds\n\n // we define a shortcut\n // https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Turbo_Queries\n {{postcode=${e.postcode}}}\n\n (\n node["addr:postcode"="{{postcode}}"]({{bbox}});\n way["addr:postcode"="{{postcode}}"]({{bbox}});\n relation["addr:postcode"="{{postcode}}"]({{bbox}});\n\n node["postal_code"="{{postcode}}"]({{bbox}});\n way["postal_code"="{{postcode}}"]({{bbox}});\n relation["postal_code"="{{postcode}}"]({{bbox}});\n );\n\n out body;\n >;\n out skel qt;\n `.replace(/^ {4}/gm,""))),n=bt((()=>"https://overpass-turbo.eu/?Q="+encodeURIComponent(Fe(i))+"&C="+encodeURIComponent([e.lat,e.lon,15].join(";"))+"&R"));var o=Io(),s=Wt(Ht(o));s.__click=function(t){t.preventDefault(),t.stopPropagation(),document.getElementById("postcode-hint").style.display="block"};var r=qt(Wt(s,2));r.__click=function(t){t.stopPropagation(),document.getElementById("postcode-hint").style.display="none"};var a=Wt(r,4),l=Wt(qt(a)),c=Wt(a,4),h=t=>{li(t,Oo())};pi(c,(t=>{"gb"===e.country_code&&t(h)}));var u=Wt(c,2),d=t=>{li(t,zo())};pi(u,(t=>{"us"===e.country_code&&t(d)})),ne((()=>Ni(l,"href",Fe(n)))),li(t,o),U()}(o,{get postcode(){return Fe(t)},get lat(){return Fe(n).centroid.coordinates[1]},get lon(){return Fe(n).centroid.coordinates[0]},get country_code(){return Fe(n).country_code}})}ne((()=>ci(i,`${(Fe(n).calculated_postcode||Fe(n).names.ref)??""} `))),li(t,e)};pi(K,(t=>{!Fe(n).calculated_postcode&&"postcode"!==Fe(n).type&&Fe(n).osm_id||t(G)}));var Y=Wt(H),X=Wt(qt(Y));No(qt(X),{get items(){return Fe(n).addresstags}});var J=Wt(Y),Q=Wt(qt(J));No(qt(Q),{get items(){return Fe(n).extratags}});var tt=qt(Wt(a,2));mo(qt(tt),{get current_result(){return Fe(n)}}),ne(((t,e,i)=>{ci(r,`${t??""} `),ci(g,`${Fe(n).category??""}:${Fe(n).type??""}`),ci(b,Fe(n).indexed_date),ci(T,Fe(n).rank_search),ci(C,`${Fe(n).rank_address??""} (${e??""})`),ci(z,i),ci(N,`${Fe(n).centroid.coordinates[1]??""},${Fe(n).centroid.coordinates[0]??""}`),ci($,`${Fe(n).place_id??""}\n (`)}),[()=>Fe(n).localname||`${rn(Fe(n).osm_type)} ${Fe(n).osm_id}`,()=>{return(t=Fe(n).rank_address)<4?"other":t<6?"country":t<8?"region":t<10?"state":t<12?"state district":t<14?"county":t<16?"municipality":t<18?"city / town / village":t<20?"city / village district":t<22?"suburb / hamlet":t<24?"neighbourhood":t<26?"city block / square":26===t?"major street":27===t?"minory street / path":t<=30?"house / building":"other";var t},()=>function(t){return t.isarea?"Polygon":"Point"}(Fe(n))]),li(t,e)},d=t=>{var e=ai(),i=Ht(e),n=t=>{li(t,ri("No such place found."))};pi(i,(t=>{""!==window.location.search&&Fe(r)&&t(n)}),!0),li(t,e)};pi(h,(t=>{Fe(n)?t(u):t(d,!1)}));var p=Wt(h,2),f=t=>{var e=ls(),i=qt(e),r=Wt(qt(i),2),l=t=>{var e=Ho(),i=qt(e);ko(i),gi(Wt(i),21,(()=>Fe(n).address),fi,((t,e)=>{{let i=bt((()=>function(t){let e=t.address.find((t=>"country_code"===t.type));return e?e.localname:null}(Fe(n))));So(t,{get addressLine(){return Fe(e)},bMarkUnusedLines:!0,bDistanceInMeters:!1,get sCountryCode(){return Fe(i)}})}})),li(t,e)};pi(r,(t=>{Fe(n).address&&t(l)}));var c=Wt(r,4),h=t=>{var e=Wo(),i=qt(e);ko(i),gi(Wt(i),21,(()=>Fe(n).linked_places),fi,((t,e)=>{So(t,{get addressLine(){return Fe(e)},bMarkUnusedLines:!0,bDistanceInMeters:!0})})),li(t,e)};pi(c,(t=>{Fe(n).linked_places&&t(h)}));var u=Wt(c,4),d=t=>{var e=Vo();gi(Wt(qt(e)),21,(()=>Fe(n).entrances),fi,((t,e,i)=>{var n=Uo(),o=qt(n);o.textContent=i+1;var s=Wt(o),r=qt(s),a=Wt(s);Co(qt(a),{osmType:"N",get osmId(){return Fe(e).osm_id}});var l=qt(Wt(a));{let t=bt((()=>Fe(e).extratags||{}));No(l,{get items(){return Fe(t)}})}ne((()=>ci(r,Fe(e).type))),li(t,n)})),li(t,e)},p=t=>{li(t,Ko())};pi(u,(t=>{Fe(n).entrances&&Fe(n).entrances.length?t(d):t(p,!1)}));var f=Wt(u,2),_=t=>{var e=is(),i=Wt(Ht(e),2),r=t=>{var e=ai(),i=Ht(e),o=t=>{var e=Qo(),i=Wt(Ht(e),2);gi(qt(i),21,(()=>Fe(n).keywords.name),fi,((t,e)=>{var i=Yo(),n=qt(i),o=qt(n),s=Wt(n),r=t=>{var i=Go(),n=qt(i);ne((()=>ci(n,`word id: ${Fe(e).id??""}`))),li(t,i)};pi(s,(t=>{Fe(e).id&&t(r)})),ne((t=>ci(o,t)),[()=>an(Fe(e).token)]),li(t,i)}));var o=Wt(i,2),s=t=>{var e=Jo();gi(qt(Wt(Ht(e),2)),21,(()=>Fe(n).keywords.address),fi,((t,e)=>{var i=Xo(),n=qt(i),o=qt(n),s=qt(Wt(n));ne((t=>{ci(o,t),ci(s,`word id: ${(Fe(e).id||"?")??""}`)}),[()=>an(Fe(e).token)]),li(t,i)})),li(t,e)};pi(o,(t=>{Fe(n).keywords.address&&t(s)})),li(t,e)},s=t=>{li(t,ts())};pi(i,(t=>{var e;(e=Fe(n)).keywords&&e.keywords.name&&e.keywords.address&&(e.keywords.name.length>0||e.keywords.address.length>0)?t(o):t(s,!1)})),li(t,e)},a=t=>{var e=es();ne((()=>Ni(e,"href",`${Fe(o)??""}&keywords=1`))),li(t,e)};pi(i,(t=>{Fe(s).keywords?t(r):t(a,!1)})),li(t,e)};pi(f,(t=>{a||t(_)}));var m=Wt(f,4),g=t=>{var e=ai(),i=Ht(e),o=t=>{var e=ss(),i=Ht(e);gi(i,17,(()=>Object.keys(Fe(n).hierarchy)),fi,((t,e)=>{var i=ns(),o=Ht(i),s=qt(o),r=qt(Wt(o,2));ko(r),gi(Wt(r),21,(()=>Fe(n).hierarchy[Fe(e)]),fi,((t,e)=>{So(t,{get addressLine(){return Fe(e)},bDistanceInMeters:!0})})),ne((()=>ci(s,Fe(e)))),li(t,i)}));var o=Wt(i,2),s=t=>{li(t,os())};pi(o,(t=>{Object.keys(Fe(n).hierarchy)>500&&t(s)})),li(t,e)},s=t=>{li(t,rs())};pi(i,(t=>{Fe(n).hierarchy&&"object"==typeof Fe(n).hierarchy&&Object.keys(Fe(n).hierarchy).length?t(o):t(s,!1)})),li(t,e)},v=t=>{var e=as();ne((()=>Ni(e,"href",`${Fe(o)??""}&hierarchy=1`))),li(t,e)};pi(m,(t=>{Fe(s).hierarchy?t(g):t(v,!1)})),li(t,e)};pi(p,(t=>{Fe(n)&&t(f)})),li(t,l),U()}var us=si(' josm'),ds=si('

Broken polygons

OSM objectClassTypeNameCountry CodeError messageUpdated
',1);var ps=si(" "),fs=si('

Deletable

Place idCountry CodeNameOSM objectClassType
',1);var _s=si('

Server status

API Endpoint
Software version
Database version
Data last updated
',1);var ms=si('
',1);var gs=si(" ",1);const vs=(ys=function(t,e){W(e,!1),Fi();var i=gs();Qe("popstate",Nt,(()=>un.refreshPage()));var n=Ht(i),o=t=>{vo(t,{})},s=t=>{var e=ai(),i=Ht(e),n=t=>{Lo(t,{})},o=t=>{var e=ai(),i=Ht(e),n=t=>{hs(t,{})},o=t=>{var e=ai(),i=Ht(e),n=t=>{!function(t,e){W(e,!0);let i=Et(It([]));Ui((function(){un.fetchFromApi("deletable",{format:"json"},(function(t){At(i,t,!0)})),nn("Deletable objects")}));var n=fs(),o=Ht(n);Dn(o,{});var s=qt(Wt(o,2)),r=qt(s),a=Wt(qt(r),2),l=qt(a),c=Wt(a,2);gi(Wt(qt(c)),21,(()=>Fe(i)),fi,((t,e)=>{var i=ps(),n=qt(i);Kn(qt(n),{get feature(){return Fe(e)},get text(){return Fe(e).place_id}});var o=Wt(n),s=qt(o),r=Wt(o),a=qt(r),l=Wt(r);Co(qt(l),{get osmType(){return Fe(e).osm_type},get osmId(){return Fe(e).osm_id}});var c=Wt(l),h=qt(c),u=qt(Wt(c));ne((()=>{ci(s,Fe(e).country_code),ci(a,Fe(e).name),ci(h,Fe(e).class),ci(u,Fe(e).type)})),li(t,i)})),ne((()=>ci(l,`${Fe(i).length??""} objects have been deleted in OSM but\n are still in the Nominatim database.`))),li(t,n),U()}(t,{})},o=t=>{var e=ai(),i=Ht(e),n=t=>{!function(t,e){W(e,!0);let i=Et(It([]));Ui((function(){un.fetchFromApi("polygons",{format:"json"},(function(t){At(i,t,!0)})),nn("Broken polygons")}));var n=ds(),o=Ht(n);Dn(o,{});var s=qt(Wt(o,2)),r=qt(s),a=Wt(qt(r),2),l=qt(a),c=Wt(a,2);gi(Wt(qt(c)),21,(()=>Fe(i)),fi,((t,e)=>{var i=us(),n=qt(i);Co(qt(n),{osmType:"(polygon.osm_type}",get osmId(){return Fe(e).osm_id}});var o=Wt(n),s=qt(o),r=Wt(o),a=qt(r),l=Wt(r),c=qt(l),h=Wt(l),u=qt(h),d=Wt(h),p=qt(d),f=Wt(d),_=qt(f),m=qt(Wt(f));ne((t=>{ci(s,Fe(e).class),ci(a,Fe(e).type),ci(c,Fe(e).name),ci(u,Fe(e).country_code||""),ci(p,Fe(e).errormessage),ci(_,Fe(e).updated),Ni(m,"href",`http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/${t??""}/${Fe(e).osm_id??""}/full`)}),[()=>rn(Fe(e).osm_type)]),li(t,i)})),ne((()=>ci(l,`Total number of broken polygons: ${Fe(i).length??""}.`))),li(t,n),U()}(t,{})},o=t=>{var e=ai(),i=Ht(e),n=t=>{!function(t,e){W(e,!0);let i=Et(It({}));const n=Nominatim_Config,o="function"==typeof n.Nominatim_API_Endpoint?n.Nominatim_API_Endpoint():n.Nominatim_API_Endpoint;Ui((function(){un.fetchFromApi("status",{format:"json"},(function(t){At(i,t,!0)})),nn("Server status")})),Ui((()=>{Qi("theme/status-help.html",document.getElementById("status-help"))}));var s=_s(),r=Ht(s);Dn(r,{});var a=qt(Wt(r,2)),l=qt(a),c=Wt(qt(l),4),h=Wt(qt(c),2),u=qt(h),d=qt(u),p=Wt(h,4),f=qt(p),_=Wt(p,4),m=qt(_),g=qt(Wt(_,4));ne((()=>{Ni(u,"href",o),ci(d,o),ci(f,Fe(i).software_version),ci(m,Fe(i).database_version),ci(g,Fe(i).data_updated)})),li(t,s),U()}(t,{})},o=t=>{var e=ai(),i=Ht(e),n=t=>{!function(t,e){W(e,!1),Ui((()=>{Qi("theme/about-help.html",document.getElementById("about-help"))})),Fi();var i=ms();Dn(Ht(i),{}),li(t,i),U()}(t,{})};pi(i,(t=>{"about"===un.page.tab&&t(n)}),!0),li(t,e)};pi(i,(t=>{"status"===un.page.tab?t(n):t(o,!1)}),!0),li(t,e)};pi(i,(t=>{"polygons"===un.page.tab?t(n):t(o,!1)}),!0),li(t,e)};pi(i,(t=>{"deletable"===un.page.tab?t(n):t(o,!1)}),!0),li(t,e)};pi(i,(t=>{"details"===un.page.tab?t(n):t(o,!1)}),!0),li(t,e)};pi(i,(t=>{"reverse"===un.page.tab?t(n):t(o,!1)}),!0),li(t,e)};pi(n,(t=>{"search"===un.page.tab?t(o):t(s,!1)})),function(t){li(t,dn())}(Wt(n,2)),li(t,i),U()},bs={target:document.body},function(t,{target:e,anchor:i,props:o={},events:r,context:a,intro:l=!0}){!function(){if(void 0===Nt){Nt=window,Bt=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;Zt=s(e,"firstChild").get,jt=s(e,"nextSibling").get,h(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),h(i)&&(i.__t=void 0)}}();var c=new Set,u=t=>{for(var i=0;inew Promise((i=>{t.outro?ue(e,(()=>{le(e),i(void 0)})):(le(e),i(void 0))}))}((()=>{var n=i??e.appendChild(Rt());return function(t,e,i){new mt(t,e,i)}(n,{pending:()=>{}},(e=>{a&&(W({}),q.c=a),r&&(o.$$events=r),d=t(e,o)||{},a&&U()})),()=>{for(var t of c){e.removeEventListener(t,ii);var o=hi.get(t);0===--o?(document.removeEventListener(t,ii),hi.delete(t)):hi.set(t,o)}Je.delete(u),n!==i&&n.parentNode?.removeChild(n)}}));return ui.set(d,p),d}(ys,bs));var ys,bs;return vs}(); //# sourceMappingURL=bundle.js.map diff --git a/dist/build/bundle.js.map b/dist/build/bundle.js.map index 063d7f6..d93f86e 100644 --- a/dist/build/bundle.js.map +++ b/dist/build/bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.js","sources":["../../../../../.yarn/berry/cache/esm-env-npm-1.2.2-c6981cc52f-10c0.zip/node_modules/esm-env/false.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/shared/utils.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/constants.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/constants.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/equality.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/flags/index.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/context.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/task.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/error-handling.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/batch.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/errors.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/blocks/boundary.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/reactivity/create-subscriber.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/warnings.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/blocks/each.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/operations.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/sources.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/async.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/effects.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/runtime.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/proxy.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/misc.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/utils.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/events.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/reconciler.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/template.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/render.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/blocks/branches.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/blocks/if.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../../../../.yarn/berry/cache/clsx-npm-2.1.1-96125b98be-10c0.zip/node_modules/clsx/dist/clsx.mjs","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/shared/attributes.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/class.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/style.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/bindings/select.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/bindings/input.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/store.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/reactivity/props.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/index-client.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/shared/errors.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/disclose-version.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/version.js","../../.yarn/__virtual__/bootstrap-virtual-911818faff/4/.yarn/berry/cache/bootstrap-npm-5.3.8-b7bef82d06-10c0.zip/node_modules/bootstrap/dist/js/bootstrap.bundle.js","../../src/lib/api_utils.js","../../../../../.yarn/berry/cache/escape-html-npm-1.0.3-376c22ee74-10c0.zip/node_modules/escape-html/index.js","../../src/lib/helpers.js","../../src/state/AppState.svelte.js","../../src/components/PageLink.svelte","../../../../../.yarn/berry/cache/timeago.js-npm-4.0.2-e87d64f9a3-10c0.zip/node_modules/timeago.js/esm/lang/en_US.js","../../../../../.yarn/berry/cache/timeago.js-npm-4.0.2-e87d64f9a3-10c0.zip/node_modules/timeago.js/esm/lang/zh_CN.js","../../../../../.yarn/berry/cache/timeago.js-npm-4.0.2-e87d64f9a3-10c0.zip/node_modules/timeago.js/esm/register.js","../../../../../.yarn/berry/cache/timeago.js-npm-4.0.2-e87d64f9a3-10c0.zip/node_modules/timeago.js/esm/utils/date.js","../../../../../.yarn/berry/cache/timeago.js-npm-4.0.2-e87d64f9a3-10c0.zip/node_modules/timeago.js/esm/format.js","../../../../../.yarn/berry/cache/timeago.js-npm-4.0.2-e87d64f9a3-10c0.zip/node_modules/timeago.js/esm/index.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/legacy/misc.js","../../src/state/MapState.svelte.js","../../src/color-mode-toggler.js","../../src/components/Header.svelte","../../src/components/ReverseLink.svelte","../../src/components/Error.svelte","../../src/components/LastUpdated.svelte","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/reactivity/url-search-params.js","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/reactivity/url.js","../../src/components/UrlSubmitForm.svelte","../../src/components/DefaultLanguage.svelte","../../src/components/DetailsLink.svelte","../../src/components/MapIcon.svelte","../../src/components/ResultsList.svelte","../../src/components/Welcome.svelte","../../../../../.yarn/berry/cache/leaflet-npm-1.9.4-8d372b0fe6-10c0.zip/node_modules/leaflet/dist/leaflet-src.js","../../../../../.yarn/berry/cache/leaflet-minimap-npm-3.6.1-945fa818a3-10c0.zip/node_modules/leaflet-minimap/dist/Control.MiniMap.min.js","../../src/components/Map.svelte","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/elements/actions.js","../../src/components/MapPosition.svelte","../../src/components/SearchSection.svelte","../../src/pages/SearchPage.svelte","../../src/pages/ReversePage.svelte","../../src/components/SearchSectionReverse.svelte","../../src/components/OsmLink.svelte","../../src/components/DetailsOneRow.svelte","../../../../../.yarn/berry/cache/svelte-npm-5.43.14-469a69ee77-10c0.zip/node_modules/svelte/src/internal/client/dom/blocks/html.js","../../src/components/DetailsInfoRowList.svelte","../../src/components/SearchSectionDetails.svelte","../../src/pages/DetailsPage.svelte","../../src/components/WikipediaLink.svelte","../../src/components/DetailsPostcodeHint.svelte","../../src/main.js","../../src/App.svelte","../../src/pages/DeletablePage.svelte","../../src/pages/PolygonsPage.svelte","../../src/pages/StatusPage.svelte","../../src/pages/AboutPage.svelte"],"sourcesContent":["export default false;\n","// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\nexport var is_extensible = Object.isExtensible;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template T\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n\n/**\n * When encountering a situation like `let [a, b, c] = $derived(blah())`,\n * we need to stash an intermediate value that `a`, `b`, and `c` derive\n * from, in case it's an iterable\n * @template T\n * @param {ArrayLike | Iterable} value\n * @param {number} [n]\n * @returns {Array}\n */\nexport function to_array(value, n) {\n\t// return arrays unchanged\n\tif (Array.isArray(value)) {\n\t\treturn value;\n\t}\n\n\t// if value is not iterable, or `n` is unspecified (indicates a rest\n\t// element, which means we're not concerned about unbounded iterables)\n\t// convert to an array with `Array.from`\n\tif (n === undefined || !(Symbol.iterator in value)) {\n\t\treturn Array.from(value);\n\t}\n\n\t// otherwise, populate an array with `n` values\n\n\t/** @type {T[]} */\n\tconst array = [];\n\n\tfor (const element of value) {\n\t\tarray.push(element);\n\t\tif (array.length === n) break;\n\t}\n\n\treturn array;\n}\n","// General flags\nexport const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\n/**\n * Indicates that a reaction is connected to an effect root — either it is an effect,\n * or it is a derived that is depended on by at least one effect. If a derived has\n * no dependents, we can disconnect it from the graph, allowing it to either be\n * GC'd or reconnected later if an effect comes to depend on it again\n */\nexport const CONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\n\n// Flags exclusive to effects\n/** Set once an effect that should run synchronously has run */\nexport const EFFECT_RAN = 1 << 15;\n/**\n * 'Transparent' effects do not create a transition boundary.\n * This is on a block effect 99% of the time but may also be on a branch effect if its parent block effect was pruned\n */\nexport const EFFECT_TRANSPARENT = 1 << 16;\nexport const EAGER_EFFECT = 1 << 17;\nexport const HEAD_EFFECT = 1 << 18;\nexport const EFFECT_PRESERVED = 1 << 19;\nexport const USER_EFFECT = 1 << 20;\n\n// Flags exclusive to deriveds\n/**\n * Tells that we marked this derived and its reactions as visited during the \"mark as (maybe) dirty\"-phase.\n * Will be lifted during execution of the derived and during checking its dirty state (both are necessary\n * because a derived might be checked but not executed).\n */\nexport const WAS_MARKED = 1 << 15;\n\n// Flags used for async\nexport const REACTION_IS_UPDATING = 1 << 21;\nexport const ASYNC = 1 << 22;\n\nexport const ERROR_VALUE = 1 << 23;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\nexport const PROXY_PATH_SYMBOL = Symbol('proxy path');\n\n/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */\nexport const STALE_REACTION = new (class StaleReactionError extends Error {\n\tname = 'StaleReactionError';\n\tmessage = 'The reaction that called `getAbortSignal()` was re-run or destroyed';\n})();\n\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const COMMENT_NODE = 8;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\nexport const TEMPLATE_USE_SVG = 1 << 2;\nexport const TEMPLATE_USE_MATHML = 1 << 3;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\nexport const ELEMENT_IS_INPUT = 1 << 2;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'await_waterfall',\n\t'await_reactivity_loss',\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n\nexport const ATTACHMENT_KEY = '@attach';\n","/** @import { Equals } from '#client' */\n\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","/** True if experimental.async=true */\nexport let async_mode_flag = false;\n/** True if we're not certain that we only have Svelte 5 code in the compilation */\nexport let legacy_mode_flag = false;\n/** True if $inspect.trace is used */\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport * as e from './errors.js';\nimport { active_effect, active_reaction } from './runtime.js';\nimport { create_user_effect } from './reactivity/effects.js';\nimport { async_mode_flag, legacy_mode_flag } from '../flags/index.js';\nimport { FILENAME } from '../../constants.js';\nimport { BRANCH_EFFECT, EFFECT_RAN } from './constants.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/** @type {DevStackEntry | null} */\nexport let dev_stack = null;\n\n/** @param {DevStackEntry | null} stack */\nexport function set_dev_stack(stack) {\n\tdev_stack = stack;\n}\n\n/**\n * Execute a callback with a new dev stack entry\n * @param {() => any} callback - Function to execute\n * @param {DevStackEntry['type']} type - Type of block/component\n * @param {any} component - Component function\n * @param {number} line - Line number\n * @param {number} column - Column number\n * @param {Record} [additional] - Any additional properties to add to the dev stack entry\n * @returns {any}\n */\nexport function add_svelte_meta(callback, type, component, line, column, additional) {\n\tconst parent = dev_stack;\n\n\tdev_stack = {\n\t\ttype,\n\t\tfile: component[FILENAME],\n\t\tline,\n\t\tcolumn,\n\t\tparent,\n\t\t...additional\n\t};\n\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tdev_stack = parent;\n\t}\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * \n * \n * \n * \n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Returns a `[get, set]` pair of functions for working with context in a type-safe way.\n *\n * `get` will throw an error if no parent component called `set`.\n *\n * @template T\n * @returns {[() => T, (context: T) => T]}\n * @since 5.40.0\n */\nexport function createContext() {\n\tconst key = {};\n\n\treturn [\n\t\t() => {\n\t\t\tif (!hasContext(key)) {\n\t\t\t\te.missing_context();\n\t\t\t}\n\n\t\t\treturn getContext(key);\n\t\t},\n\t\t(context) => setContext(key, context)\n\t];\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (async_mode_flag) {\n\t\tvar flags = /** @type {Effect} */ (active_effect).f;\n\t\tvar valid =\n\t\t\t!active_reaction &&\n\t\t\t(flags & BRANCH_EFFECT) !== 0 &&\n\t\t\t// pop() runs synchronously, so this indicates we're setting context after an await\n\t\t\t!(/** @type {ComponentContext} */ (component_context).i);\n\n\t\tif (!valid) {\n\t\t\te.set_context_after_init();\n\t\t}\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map} [T=Map]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\ti: false,\n\t\tc: null,\n\t\te: null,\n\t\ts: props,\n\t\tx: null,\n\t\tl: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null\n\t};\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tvar context = /** @type {ComponentContext} */ (component_context);\n\tvar effects = context.e;\n\n\tif (effects !== null) {\n\t\tcontext.e = null;\n\n\t\tfor (var fn of effects) {\n\t\t\tcreate_user_effect(fn);\n\t\t}\n\t}\n\n\tif (component !== undefined) {\n\t\tcontext.x = component;\n\t}\n\n\tcontext.i = true;\n\n\tcomponent_context = context.p;\n\n\tif (DEV) {\n\t\tdev_current_component_function = component_context?.function ?? null;\n\t}\n\n\treturn component ?? /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","import { run_all } from '../../shared/utils.js';\nimport { is_flushing_sync } from '../reactivity/batch.js';\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0 && !is_flushing_sync) {\n\t\tvar tasks = micro_tasks;\n\t\tqueueMicrotask(() => {\n\t\t\t// If this is false, a flushSync happened in the meantime. Do _not_ run new scheduled microtasks in that case\n\t\t\t// as the ordering of microtasks would be broken at that point - consider this case:\n\t\t\t// - queue_micro_task schedules microtask A to flush task X\n\t\t\t// - synchronously after, flushSync runs, processing task X\n\t\t\t// - synchronously after, some other microtask B is scheduled, but not through queue_micro_task but for example a Promise.resolve() in user code\n\t\t\t// - synchronously after, queue_micro_task schedules microtask C to flush task Y\n\t\t\t// - one tick later, microtask A now resolves, flushing task Y before microtask B, which is incorrect\n\t\t\t// This if check prevents that race condition (that realistically will only happen in tests)\n\t\t\tif (tasks === micro_tasks) run_micro_tasks();\n\t\t});\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\twhile (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n}\n","/** @import { Derived, Effect } from '#client' */\n/** @import { Boundary } from './dom/blocks/boundary.js' */\nimport { DEV } from 'esm-env';\nimport { FILENAME } from '../../constants.js';\nimport { is_firefox } from './dom/operations.js';\nimport { ERROR_VALUE, BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';\nimport { define_property, get_descriptor } from '../shared/utils.js';\nimport { active_effect, active_reaction } from './runtime.js';\n\nconst adjustments = new WeakMap();\n\n/**\n * @param {unknown} error\n */\nexport function handle_error(error) {\n\tvar effect = active_effect;\n\n\t// for unowned deriveds, don't throw until we read the value\n\tif (effect === null) {\n\t\t/** @type {Derived} */ (active_reaction).f |= ERROR_VALUE;\n\t\treturn error;\n\t}\n\n\tif (DEV && error instanceof Error && !adjustments.has(error)) {\n\t\tadjustments.set(error, get_adjustments(error, effect));\n\t}\n\n\tif ((effect.f & EFFECT_RAN) === 0) {\n\t\t// if the error occurred while creating this subtree, we let it\n\t\t// bubble up until it hits a boundary that can handle it\n\t\tif ((effect.f & BOUNDARY_EFFECT) === 0) {\n\t\t\tif (DEV && !effect.parent && error instanceof Error) {\n\t\t\t\tapply_adjustments(error);\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t} else {\n\t\t// otherwise we bubble up the effect tree ourselves\n\t\tinvoke_error_boundary(error, effect);\n\t}\n}\n\n/**\n * @param {unknown} error\n * @param {Effect | null} effect\n */\nexport function invoke_error_boundary(error, effect) {\n\twhile (effect !== null) {\n\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.parent;\n\t}\n\n\tif (DEV && error instanceof Error) {\n\t\tapply_adjustments(error);\n\t}\n\n\tthrow error;\n}\n\n/**\n * Add useful information to the error message/stack in development\n * @param {Error} error\n * @param {Effect} effect\n */\nfunction get_adjustments(error, effect) {\n\tconst message_descriptor = get_descriptor(error, 'message');\n\n\t// if the message was already changed and it's not configurable we can't change it\n\t// or it will throw a different error swallowing the original error\n\tif (message_descriptor && !message_descriptor.configurable) return;\n\n\tvar indent = is_firefox ? ' ' : '\\t';\n\tvar component_stack = `\\n${indent}in ${effect.fn?.name || ''}`;\n\tvar context = effect.ctx;\n\n\twhile (context !== null) {\n\t\tcomponent_stack += `\\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;\n\t\tcontext = context.p;\n\t}\n\n\treturn {\n\t\tmessage: error.message + `\\n${component_stack}\\n`,\n\t\tstack: error.stack\n\t\t\t?.split('\\n')\n\t\t\t.filter((line) => !line.includes('svelte/src/internal'))\n\t\t\t.join('\\n')\n\t};\n}\n\n/**\n * @param {Error} error\n */\nfunction apply_adjustments(error) {\n\tconst adjusted = adjustments.get(error);\n\n\tif (adjusted) {\n\t\tdefine_property(error, 'message', {\n\t\t\tvalue: adjusted.message\n\t\t});\n\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: adjusted.stack\n\t\t});\n\t}\n}\n","/** @import { Fork } from 'svelte' */\n/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\nimport {\n\tBLOCK_EFFECT,\n\tBRANCH_EFFECT,\n\tCLEAN,\n\tDESTROYED,\n\tDIRTY,\n\tEFFECT,\n\tASYNC,\n\tINERT,\n\tRENDER_EFFECT,\n\tROOT_EFFECT,\n\tMAYBE_DIRTY,\n\tDERIVED,\n\tBOUNDARY_EFFECT,\n\tEAGER_EFFECT,\n\tHEAD_EFFECT,\n\tERROR_VALUE,\n\tWAS_MARKED\n} from '#client/constants';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { deferred, define_property } from '../../shared/utils.js';\nimport {\n\tactive_effect,\n\tget,\n\tis_dirty,\n\tis_updating_effect,\n\tset_is_updating_effect,\n\tset_signal_status,\n\tupdate_effect\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { flush_tasks, queue_micro_task } from '../dom/task.js';\nimport { DEV } from 'esm-env';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport { flush_eager_effects, old_values, set_eager_effects, source, update } from './sources.js';\nimport { eager_effect, unlink_effect } from './effects.js';\n\n/**\n * @typedef {{\n * parent: EffectTarget | null;\n * effect: Effect | null;\n * effects: Effect[];\n * render_effects: Effect[];\n * block_effects: Effect[];\n * }} EffectTarget\n */\n\n/** @type {Set} */\nconst batches = new Set();\n\n/** @type {Batch | null} */\nexport let current_batch = null;\n\n/**\n * This is needed to avoid overwriting inputs in non-async mode\n * TODO 6.0 remove this, as non-async mode will go away\n * @type {Batch | null}\n */\nexport let previous_batch = null;\n\n/**\n * When time travelling (i.e. working in one batch, while other batches\n * still have ongoing work), we ignore the real values of affected\n * signals in favour of their values within the batch\n * @type {Map | null}\n */\nexport let batch_values = null;\n\n// TODO this should really be a property of `batch`\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_flushing = false;\nexport let is_flushing_sync = false;\n\nexport class Batch {\n\tcommitted = false;\n\n\t/**\n\t * The current values of any sources that are updated in this batch\n\t * They keys of this map are identical to `this.#previous`\n\t * @type {Map}\n\t */\n\tcurrent = new Map();\n\n\t/**\n\t * The values of any sources that are updated in this batch _before_ those updates took place.\n\t * They keys of this map are identical to `this.#current`\n\t * @type {Map}\n\t */\n\tprevious = new Map();\n\n\t/**\n\t * When the batch is committed (and the DOM is updated), we need to remove old branches\n\t * and append new ones by calling the functions added inside (if/each/key/etc) blocks\n\t * @type {Set<() => void>}\n\t */\n\t#commit_callbacks = new Set();\n\n\t/**\n\t * If a fork is discarded, we need to destroy any effects that are no longer needed\n\t * @type {Set<(batch: Batch) => void>}\n\t */\n\t#discard_callbacks = new Set();\n\n\t/**\n\t * The number of async effects that are currently in flight\n\t */\n\t#pending = 0;\n\n\t/**\n\t * The number of async effects that are currently in flight, _not_ inside a pending boundary\n\t */\n\t#blocking_pending = 0;\n\n\t/**\n\t * A deferred that resolves when the batch is committed, used with `settled()`\n\t * TODO replace with Promise.withResolvers once supported widely enough\n\t * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}\n\t */\n\t#deferred = null;\n\n\t/**\n\t * Deferred effects (which run after async work has completed) that are DIRTY\n\t * @type {Effect[]}\n\t */\n\t#dirty_effects = [];\n\n\t/**\n\t * Deferred effects that are MAYBE_DIRTY\n\t * @type {Effect[]}\n\t */\n\t#maybe_dirty_effects = [];\n\n\t/**\n\t * A set of branches that still exist, but will be destroyed when this batch\n\t * is committed — we skip over these during `process`\n\t * @type {Set}\n\t */\n\tskipped_effects = new Set();\n\n\tis_fork = false;\n\n\tis_deferred() {\n\t\treturn this.is_fork || this.#blocking_pending > 0;\n\t}\n\n\t/**\n\t *\n\t * @param {Effect[]} root_effects\n\t */\n\tprocess(root_effects) {\n\t\tqueued_root_effects = [];\n\n\t\tprevious_batch = null;\n\n\t\tthis.apply();\n\n\t\t/** @type {EffectTarget} */\n\t\tvar target = {\n\t\t\tparent: null,\n\t\t\teffect: null,\n\t\t\teffects: [],\n\t\t\trender_effects: [],\n\t\t\tblock_effects: []\n\t\t};\n\n\t\tfor (const root of root_effects) {\n\t\t\tthis.#traverse_effect_tree(root, target);\n\t\t\t// Note: #traverse_effect_tree runs block effects eagerly, which can schedule effects,\n\t\t\t// which means queued_root_effects now may be filled again.\n\t\t}\n\n\t\tif (!this.is_fork) {\n\t\t\tthis.#resolve();\n\t\t}\n\n\t\tif (this.is_deferred()) {\n\t\t\tthis.#defer_effects(target.effects);\n\t\t\tthis.#defer_effects(target.render_effects);\n\t\t\tthis.#defer_effects(target.block_effects);\n\t\t} else {\n\t\t\t// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with\n\t\t\t// newly updated sources, which could lead to infinite loops when effects run over and over again.\n\t\t\tprevious_batch = this;\n\t\t\tcurrent_batch = null;\n\n\t\t\tflush_queued_effects(target.render_effects);\n\t\t\tflush_queued_effects(target.effects);\n\n\t\t\tprevious_batch = null;\n\n\t\t\tthis.#deferred?.resolve();\n\t\t}\n\n\t\tbatch_values = null;\n\t}\n\n\t/**\n\t * Traverse the effect tree, executing effects or stashing\n\t * them for later execution as appropriate\n\t * @param {Effect} root\n\t * @param {EffectTarget} target\n\t */\n\t#traverse_effect_tree(root, target) {\n\t\troot.f ^= CLEAN;\n\n\t\tvar effect = root.first;\n\n\t\twhile (effect !== null) {\n\t\t\tvar flags = effect.f;\n\t\t\tvar is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;\n\t\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\t\tvar skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);\n\n\t\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0 && effect.b?.is_pending()) {\n\t\t\t\ttarget = {\n\t\t\t\t\tparent: target,\n\t\t\t\t\teffect,\n\t\t\t\t\teffects: [],\n\t\t\t\t\trender_effects: [],\n\t\t\t\t\tblock_effects: []\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!skip && effect.fn !== null) {\n\t\t\t\tif (is_branch) {\n\t\t\t\t\teffect.f ^= CLEAN;\n\t\t\t\t} else if ((flags & EFFECT) !== 0) {\n\t\t\t\t\ttarget.effects.push(effect);\n\t\t\t\t} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {\n\t\t\t\t\ttarget.render_effects.push(effect);\n\t\t\t\t} else if (is_dirty(effect)) {\n\t\t\t\t\tif ((effect.f & BLOCK_EFFECT) !== 0) target.block_effects.push(effect);\n\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t}\n\n\t\t\t\tvar child = effect.first;\n\n\t\t\t\tif (child !== null) {\n\t\t\t\t\teffect = child;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar parent = effect.parent;\n\t\t\teffect = effect.next;\n\n\t\t\twhile (effect === null && parent !== null) {\n\t\t\t\tif (parent === target.effect) {\n\t\t\t\t\t// TODO rather than traversing into pending boundaries and deferring the effects,\n\t\t\t\t\t// could we just attach the effects _to_ the pending boundary and schedule them\n\t\t\t\t\t// once the boundary is ready?\n\t\t\t\t\tthis.#defer_effects(target.effects);\n\t\t\t\t\tthis.#defer_effects(target.render_effects);\n\t\t\t\t\tthis.#defer_effects(target.block_effects);\n\n\t\t\t\t\ttarget = /** @type {EffectTarget} */ (target.parent);\n\t\t\t\t}\n\n\t\t\t\teffect = parent.next;\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Effect[]} effects\n\t */\n\t#defer_effects(effects) {\n\t\tfor (const e of effects) {\n\t\t\tconst target = (e.f & DIRTY) !== 0 ? this.#dirty_effects : this.#maybe_dirty_effects;\n\t\t\ttarget.push(e);\n\n\t\t\t// Since we're not executing these effects now, we need to clear any WAS_MARKED flags\n\t\t\t// so that other batches can correctly reach these effects during their own traversal\n\t\t\tthis.#clear_marked(e.deps);\n\n\t\t\t// mark as clean so they get scheduled if they depend on pending async state\n\t\t\tset_signal_status(e, CLEAN);\n\t\t}\n\t}\n\n\t/**\n\t * @param {Value[] | null} deps\n\t */\n\t#clear_marked(deps) {\n\t\tif (deps === null) return;\n\n\t\tfor (const dep of deps) {\n\t\t\tif ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdep.f ^= WAS_MARKED;\n\n\t\t\tthis.#clear_marked(/** @type {Derived} */ (dep).deps);\n\t\t}\n\t}\n\n\t/**\n\t * Associate a change to a given source with the current\n\t * batch, noting its previous and current values\n\t * @param {Source} source\n\t * @param {any} value\n\t */\n\tcapture(source, value) {\n\t\tif (!this.previous.has(source)) {\n\t\t\tthis.previous.set(source, value);\n\t\t}\n\n\t\t// Don't save errors in `batch_values`, or they won't be thrown in `runtime.js#get`\n\t\tif ((source.f & ERROR_VALUE) === 0) {\n\t\t\tthis.current.set(source, source.v);\n\t\t\tbatch_values?.set(source, source.v);\n\t\t}\n\t}\n\n\tactivate() {\n\t\tcurrent_batch = this;\n\t\tthis.apply();\n\t}\n\n\tdeactivate() {\n\t\t// If we're not the current batch, don't deactivate,\n\t\t// else we could create zombie batches that are never flushed\n\t\tif (current_batch !== this) return;\n\n\t\tcurrent_batch = null;\n\t\tbatch_values = null;\n\t}\n\n\tflush() {\n\t\tthis.activate();\n\n\t\tif (queued_root_effects.length > 0) {\n\t\t\tflush_effects();\n\n\t\t\tif (current_batch !== null && current_batch !== this) {\n\t\t\t\t// this can happen if a new batch was created during `flush_effects()`\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (this.#pending === 0) {\n\t\t\tthis.process([]); // TODO this feels awkward\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\tdiscard() {\n\t\tfor (const fn of this.#discard_callbacks) fn(this);\n\t\tthis.#discard_callbacks.clear();\n\t}\n\n\t#resolve() {\n\t\tif (this.#blocking_pending === 0) {\n\t\t\t// append/remove branches\n\t\t\tfor (const fn of this.#commit_callbacks) fn();\n\t\t\tthis.#commit_callbacks.clear();\n\t\t}\n\n\t\tif (this.#pending === 0) {\n\t\t\tthis.#commit();\n\t\t}\n\t}\n\n\t#commit() {\n\t\t// If there are other pending batches, they now need to be 'rebased' —\n\t\t// in other words, we re-run block/async effects with the newly\n\t\t// committed state, unless the batch in question has a more\n\t\t// recent value for a given source\n\t\tif (batches.size > 1) {\n\t\t\tthis.previous.clear();\n\n\t\t\tvar previous_batch_values = batch_values;\n\t\t\tvar is_earlier = true;\n\n\t\t\t/** @type {EffectTarget} */\n\t\t\tvar dummy_target = {\n\t\t\t\tparent: null,\n\t\t\t\teffect: null,\n\t\t\t\teffects: [],\n\t\t\t\trender_effects: [],\n\t\t\t\tblock_effects: []\n\t\t\t};\n\n\t\t\tfor (const batch of batches) {\n\t\t\t\tif (batch === this) {\n\t\t\t\t\tis_earlier = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/** @type {Source[]} */\n\t\t\t\tconst sources = [];\n\n\t\t\t\tfor (const [source, value] of this.current) {\n\t\t\t\t\tif (batch.current.has(source)) {\n\t\t\t\t\t\tif (is_earlier && value !== batch.current.get(source)) {\n\t\t\t\t\t\t\t// bring the value up to date\n\t\t\t\t\t\t\tbatch.current.set(source, value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// same value or later batch has more recent value,\n\t\t\t\t\t\t\t// no need to re-run these effects\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsources.push(source);\n\t\t\t\t}\n\n\t\t\t\tif (sources.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Re-run async/block effects that depend on distinct values changed in both batches\n\t\t\t\tconst others = [...batch.current.keys()].filter((s) => !this.current.has(s));\n\t\t\t\tif (others.length > 0) {\n\t\t\t\t\t// Avoid running queued root effects on the wrong branch\n\t\t\t\t\tvar prev_queued_root_effects = queued_root_effects;\n\t\t\t\t\tqueued_root_effects = [];\n\n\t\t\t\t\t/** @type {Set} */\n\t\t\t\t\tconst marked = new Set();\n\t\t\t\t\t/** @type {Map} */\n\t\t\t\t\tconst checked = new Map();\n\t\t\t\t\tfor (const source of sources) {\n\t\t\t\t\t\tmark_effects(source, others, marked, checked);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (queued_root_effects.length > 0) {\n\t\t\t\t\t\tcurrent_batch = batch;\n\t\t\t\t\t\tbatch.apply();\n\n\t\t\t\t\t\tfor (const root of queued_root_effects) {\n\t\t\t\t\t\t\tbatch.#traverse_effect_tree(root, dummy_target);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// TODO do we need to do anything with `target`? defer block effects?\n\n\t\t\t\t\t\tbatch.deactivate();\n\t\t\t\t\t}\n\n\t\t\t\t\tqueued_root_effects = prev_queued_root_effects;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent_batch = null;\n\t\t\tbatch_values = previous_batch_values;\n\t\t}\n\n\t\tthis.committed = true;\n\t\tbatches.delete(this);\n\t}\n\n\t/**\n\t *\n\t * @param {boolean} blocking\n\t */\n\tincrement(blocking) {\n\t\tthis.#pending += 1;\n\t\tif (blocking) this.#blocking_pending += 1;\n\t}\n\n\t/**\n\t *\n\t * @param {boolean} blocking\n\t */\n\tdecrement(blocking) {\n\t\tthis.#pending -= 1;\n\t\tif (blocking) this.#blocking_pending -= 1;\n\n\t\tthis.revive();\n\t}\n\n\trevive() {\n\t\tfor (const e of this.#dirty_effects) {\n\t\t\tset_signal_status(e, DIRTY);\n\t\t\tschedule_effect(e);\n\t\t}\n\n\t\tfor (const e of this.#maybe_dirty_effects) {\n\t\t\tset_signal_status(e, MAYBE_DIRTY);\n\t\t\tschedule_effect(e);\n\t\t}\n\n\t\tthis.#dirty_effects = [];\n\t\tthis.#maybe_dirty_effects = [];\n\n\t\tthis.flush();\n\t}\n\n\t/** @param {() => void} fn */\n\toncommit(fn) {\n\t\tthis.#commit_callbacks.add(fn);\n\t}\n\n\t/** @param {(batch: Batch) => void} fn */\n\tondiscard(fn) {\n\t\tthis.#discard_callbacks.add(fn);\n\t}\n\n\tsettled() {\n\t\treturn (this.#deferred ??= deferred()).promise;\n\t}\n\n\tstatic ensure() {\n\t\tif (current_batch === null) {\n\t\t\tconst batch = (current_batch = new Batch());\n\t\t\tbatches.add(current_batch);\n\n\t\t\tif (!is_flushing_sync) {\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tif (current_batch !== batch) {\n\t\t\t\t\t\t// a flushSync happened in the meantime\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbatch.flush();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current_batch;\n\t}\n\n\t/** @param {() => void} task */\n\tstatic enqueue(task) {\n\t\tqueue_micro_task(task);\n\t}\n\n\tapply() {\n\t\tif (!async_mode_flag || (!this.is_fork && batches.size === 1)) return;\n\n\t\t// if there are multiple batches, we are 'time travelling' —\n\t\t// we need to override values with the ones in this batch...\n\t\tbatch_values = new Map(this.current);\n\n\t\t// ...and undo changes belonging to other batches\n\t\tfor (const batch of batches) {\n\t\t\tif (batch === this) continue;\n\n\t\t\tfor (const [source, previous] of batch.previous) {\n\t\t\t\tif (!batch_values.has(source)) {\n\t\t\t\t\tbatch_values.set(source, previous);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tif (async_mode_flag && active_effect !== null) {\n\t\t// We disallow this because it creates super-hard to reason about stack trace and because it's generally a bad idea\n\t\te.flush_sync_in_effect();\n\t}\n\n\tvar was_flushing_sync = is_flushing_sync;\n\tis_flushing_sync = true;\n\n\ttry {\n\t\tvar result;\n\n\t\tif (fn) {\n\t\t\tif (current_batch !== null) {\n\t\t\t\tflush_effects();\n\t\t\t}\n\n\t\t\tresult = fn();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tflush_tasks();\n\n\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\tcurrent_batch?.flush();\n\n\t\t\t\t// we need to check again, in case we just updated an `$effect.pending()`\n\t\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\t\t// this would be reset in `flush_effects()` but since we are early returning here,\n\t\t\t\t\t// we need to reset it here as well in case the first time there's 0 queued root effects\n\t\t\t\t\tlast_scheduled_effect = null;\n\n\t\t\t\t\treturn /** @type {T} */ (result);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_effects();\n\t\t}\n\t} finally {\n\t\tis_flushing_sync = was_flushing_sync;\n\t}\n}\n\nfunction flush_effects() {\n\tvar was_updating_effect = is_updating_effect;\n\tis_flushing = true;\n\n\tvar source_stacks = DEV ? new Set() : null;\n\n\ttry {\n\t\tvar flush_count = 0;\n\t\tset_is_updating_effect(true);\n\n\t\twhile (queued_root_effects.length > 0) {\n\t\t\tvar batch = Batch.ensure();\n\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tif (DEV) {\n\t\t\t\t\tvar updates = new Map();\n\n\t\t\t\t\tfor (const source of batch.current.keys()) {\n\t\t\t\t\t\tfor (const [stack, update] of source.updated ?? []) {\n\t\t\t\t\t\t\tvar entry = updates.get(stack);\n\n\t\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\t\tentry = { error: update.error, count: 0 };\n\t\t\t\t\t\t\t\tupdates.set(stack, entry);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tentry.count += update.count;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const update of updates.values()) {\n\t\t\t\t\t\tif (update.error) {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\tconsole.error(update.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tinfinite_loop_guard();\n\t\t\t}\n\n\t\t\tbatch.process(queued_root_effects);\n\t\t\told_values.clear();\n\n\t\t\tif (DEV) {\n\t\t\t\tfor (const source of batch.current.keys()) {\n\t\t\t\t\t/** @type {Set} */ (source_stacks).add(source);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_flushing = false;\n\t\tset_is_updating_effect(was_updating_effect);\n\n\t\tlast_scheduled_effect = null;\n\n\t\tif (DEV) {\n\t\t\tfor (const source of /** @type {Set} */ (source_stacks)) {\n\t\t\t\tsource.updated = null;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack contains no useful information, replace it\n\t\t\tdefine_property(error, 'stack', { value: '' });\n\t\t}\n\n\t\t// Best effort: invoke the boundary nearest the most recent\n\t\t// effect and hope that it's relevant to the infinite loop\n\t\tinvoke_error_boundary(error, last_scheduled_effect);\n\t}\n}\n\n/** @type {Set | null} */\nexport let eager_block_effects = null;\n\n/**\n * @param {Array} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tvar i = 0;\n\n\twhile (i < length) {\n\t\tvar effect = effects[i++];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {\n\t\t\teager_block_effects = new Set();\n\n\t\t\tupdate_effect(effect);\n\n\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t// immediate effects.\n\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t// if there's no teardown or abort controller we completely unlink\n\t\t\t\t// the effect from the graph\n\t\t\t\tif (effect.teardown === null && effect.ac === null) {\n\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t} else {\n\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\teffect.fn = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If update_effect() has a flushSync() in it, we may have flushed another flush_queued_effects(),\n\t\t\t// which already handled this logic and did set eager_block_effects to null.\n\t\t\tif (eager_block_effects?.size > 0) {\n\t\t\t\told_values.clear();\n\n\t\t\t\tfor (const e of eager_block_effects) {\n\t\t\t\t\t// Skip eager effects that have already been unmounted\n\t\t\t\t\tif ((e.f & (DESTROYED | INERT)) !== 0) continue;\n\n\t\t\t\t\t// Run effects in order from ancestor to descendant, else we could run into nullpointers\n\t\t\t\t\t/** @type {Effect[]} */\n\t\t\t\t\tconst ordered_effects = [e];\n\t\t\t\t\tlet ancestor = e.parent;\n\t\t\t\t\twhile (ancestor !== null) {\n\t\t\t\t\t\tif (eager_block_effects.has(ancestor)) {\n\t\t\t\t\t\t\teager_block_effects.delete(ancestor);\n\t\t\t\t\t\t\tordered_effects.push(ancestor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tancestor = ancestor.parent;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let j = ordered_effects.length - 1; j >= 0; j--) {\n\t\t\t\t\t\tconst e = ordered_effects[j];\n\t\t\t\t\t\t// Skip eager effects that have already been unmounted\n\t\t\t\t\t\tif ((e.f & (DESTROYED | INERT)) !== 0) continue;\n\t\t\t\t\t\tupdate_effect(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\teager_block_effects.clear();\n\t\t\t}\n\t\t}\n\t}\n\n\teager_block_effects = null;\n}\n\n/**\n * This is similar to `mark_reactions`, but it only marks async/block effects\n * depending on `value` and at least one of the other `sources`, so that\n * these effects can re-run after another batch has been committed\n * @param {Value} value\n * @param {Source[]} sources\n * @param {Set} marked\n * @param {Map} checked\n */\nfunction mark_effects(value, sources, marked, checked) {\n\tif (marked.has(value)) return;\n\tmarked.add(value);\n\n\tif (value.reactions !== null) {\n\t\tfor (const reaction of value.reactions) {\n\t\t\tconst flags = reaction.f;\n\n\t\t\tif ((flags & DERIVED) !== 0) {\n\t\t\t\tmark_effects(/** @type {Derived} */ (reaction), sources, marked, checked);\n\t\t\t} else if (\n\t\t\t\t(flags & (ASYNC | BLOCK_EFFECT)) !== 0 &&\n\t\t\t\t(flags & DIRTY) === 0 && // we may have scheduled this one already\n\t\t\t\tdepends_on(reaction, sources, checked)\n\t\t\t) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * When committing a fork, we need to trigger eager effects so that\n * any `$state.eager(...)` expressions update immediately. This\n * function allows us to discover them\n * @param {Value} value\n * @param {Set} effects\n */\nfunction mark_eager_effects(value, effects) {\n\tif (value.reactions === null) return;\n\n\tfor (const reaction of value.reactions) {\n\t\tconst flags = reaction.f;\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tmark_eager_effects(/** @type {Derived} */ (reaction), effects);\n\t\t} else if ((flags & EAGER_EFFECT) !== 0) {\n\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\teffects.add(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/**\n * @param {Reaction} reaction\n * @param {Source[]} sources\n * @param {Map} checked\n */\nfunction depends_on(reaction, sources, checked) {\n\tconst depends = checked.get(reaction);\n\tif (depends !== undefined) return depends;\n\n\tif (reaction.deps !== null) {\n\t\tfor (const dep of reaction.deps) {\n\t\t\tif (sources.includes(dep)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ((dep.f & DERIVED) !== 0 && depends_on(/** @type {Derived} */ (dep), sources, checked)) {\n\t\t\t\tchecked.set(/** @type {Derived} */ (dep), true);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tchecked.set(reaction, false);\n\n\treturn false;\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\t// if the effect is being scheduled because a parent (each/await/etc) block\n\t\t// updated an internal source, bail out or we'll cause a second flush\n\t\tif (\n\t\t\tis_flushing &&\n\t\t\teffect === active_effect &&\n\t\t\t(flags & BLOCK_EFFECT) !== 0 &&\n\t\t\t(flags & HEAD_EFFECT) === 0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\n/** @type {Source[]} */\nlet eager_versions = [];\n\nfunction eager_flush() {\n\ttry {\n\t\tflushSync(() => {\n\t\t\tfor (const version of eager_versions) {\n\t\t\t\tupdate(version);\n\t\t\t}\n\t\t});\n\t} finally {\n\t\teager_versions = [];\n\t}\n}\n\n/**\n * Implementation of `$state.eager(fn())`\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function eager(fn) {\n\tvar version = source(0);\n\tvar initial = true;\n\tvar value = /** @type {T} */ (undefined);\n\n\tget(version);\n\n\teager_effect(() => {\n\t\tif (initial) {\n\t\t\t// the first time this runs, we create an eager effect\n\t\t\t// that will run eagerly whenever the expression changes\n\t\t\tvar previous_batch_values = batch_values;\n\n\t\t\ttry {\n\t\t\t\tbatch_values = null;\n\t\t\t\tvalue = fn();\n\t\t\t} finally {\n\t\t\t\tbatch_values = previous_batch_values;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// the second time this effect runs, it's to schedule a\n\t\t// `version` update. since this will recreate the effect,\n\t\t// we don't need to evaluate the expression here\n\t\tif (eager_versions.length === 0) {\n\t\t\tqueue_micro_task(eager_flush);\n\t\t}\n\n\t\teager_versions.push(version);\n\t});\n\n\tinitial = false;\n\n\treturn value;\n}\n\n/**\n * Creates a 'fork', in which state changes are evaluated but not applied to the DOM.\n * This is useful for speculatively loading data (for example) when you suspect that\n * the user is about to take some action.\n *\n * Frameworks like SvelteKit can use this to preload data when the user touches or\n * hovers over a link, making any subsequent navigation feel instantaneous.\n *\n * The `fn` parameter is a synchronous function that modifies some state. The\n * state changes will be reverted after the fork is initialised, then reapplied\n * if and when the fork is eventually committed.\n *\n * When it becomes clear that a fork will _not_ be committed (e.g. because the\n * user navigated elsewhere), it must be discarded to avoid leaking memory.\n *\n * @param {() => void} fn\n * @returns {Fork}\n * @since 5.42\n */\nexport function fork(fn) {\n\tif (!async_mode_flag) {\n\t\te.experimental_async_fork();\n\t}\n\n\tif (current_batch !== null) {\n\t\te.fork_timing();\n\t}\n\n\tvar batch = Batch.ensure();\n\tbatch.is_fork = true;\n\n\tvar committed = false;\n\tvar settled = batch.settled();\n\n\tflushSync(fn);\n\n\t// revert state changes\n\tfor (var [source, value] of batch.previous) {\n\t\tsource.v = value;\n\t}\n\n\treturn {\n\t\tcommit: async () => {\n\t\t\tif (committed) {\n\t\t\t\tawait settled;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!batches.has(batch)) {\n\t\t\t\te.fork_discarded();\n\t\t\t}\n\n\t\t\tcommitted = true;\n\n\t\t\tbatch.is_fork = false;\n\n\t\t\t// apply changes\n\t\t\tfor (var [source, value] of batch.current) {\n\t\t\t\tsource.v = value;\n\t\t\t}\n\n\t\t\t// trigger any `$state.eager(...)` expressions with the new state.\n\t\t\t// eager effects don't get scheduled like other effects, so we\n\t\t\t// can't just encounter them during traversal, we need to\n\t\t\t// proactively flush them\n\t\t\t// TODO maybe there's a better implementation?\n\t\t\tflushSync(() => {\n\t\t\t\t/** @type {Set} */\n\t\t\t\tvar eager_effects = new Set();\n\n\t\t\t\tfor (var source of batch.current.keys()) {\n\t\t\t\t\tmark_eager_effects(source, eager_effects);\n\t\t\t\t}\n\n\t\t\t\tset_eager_effects(eager_effects);\n\t\t\t\tflush_eager_effects();\n\t\t\t});\n\n\t\t\tbatch.revive();\n\t\t\tawait settled;\n\t\t},\n\t\tdiscard: () => {\n\t\t\tif (!committed && batches.has(batch)) {\n\t\t\t\tbatches.delete(batch);\n\t\t\t\tbatch.discard();\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Forcibly remove all current batches, to prevent cross-talk between tests\n */\nexport function clear() {\n\tbatches.clear();\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nexport * from '../shared/errors.js';\n\n/**\n * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree\n * @returns {never}\n */\nexport function async_derived_orphan() {\n\tif (DEV) {\n\t\tconst error = new Error(`async_derived_orphan\\nCannot create a \\`$derived(...)\\` with an \\`await\\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/async_derived_orphan`);\n\t}\n}\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${component} has an export named \\`${key}\\` that a consumer component is trying to access using \\`bind:${key}\\`, which is disallowed. Instead, use \\`bind:this\\` (e.g. \\`<${name} bind:this={component} />\\`) and then access the property on the bound component instance (e.g. \\`component.${key}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA component is attempting to bind to a non-bindable property \\`${key}\\` belonging to ${component} (i.e. \\`<${name} bind:${key}={...}>\\`). To mark a property as bindable: \\`let { ${key} = $bindable() } = $props()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * Calling `%method%` on a component instance (of %component%) is no longer valid in Svelte 5\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\nCalling \\`${method}\\` on a component instance (of ${component}) is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted to instantiate ${component} with \\`new ${name}\\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \\`compatibility.componentApi\\` compiler option to \\`4\\` to keep it working.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value\n\t\t\t? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}`\n\t\t\t: `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * `$effect.pending()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function effect_pending_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_pending_outside_reaction\\n\\`$effect.pending()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/effect_pending_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_pending_outside_reaction`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Cannot use `fork(...)` unless the `experimental.async` compiler option is `true`\n * @returns {never}\n */\nexport function experimental_async_fork() {\n\tif (DEV) {\n\t\tconst error = new Error(`experimental_async_fork\\nCannot use \\`fork(...)\\` unless the \\`experimental.async\\` compiler option is \\`true\\`\\nhttps://svelte.dev/e/experimental_async_fork`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/experimental_async_fork`);\n\t}\n}\n\n/**\n * Cannot use `flushSync` inside an effect\n * @returns {never}\n */\nexport function flush_sync_in_effect() {\n\tif (DEV) {\n\t\tconst error = new Error(`flush_sync_in_effect\\nCannot use \\`flushSync\\` inside an effect\\nhttps://svelte.dev/e/flush_sync_in_effect`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/flush_sync_in_effect`);\n\t}\n}\n\n/**\n * Cannot commit a fork that was already discarded\n * @returns {never}\n */\nexport function fork_discarded() {\n\tif (DEV) {\n\t\tconst error = new Error(`fork_discarded\\nCannot commit a fork that was already discarded\\nhttps://svelte.dev/e/fork_discarded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/fork_discarded`);\n\t}\n}\n\n/**\n * Cannot create a fork inside an effect or when state changes are pending\n * @returns {never}\n */\nexport function fork_timing() {\n\tif (DEV) {\n\t\tconst error = new Error(`fork_timing\\nCannot create a fork inside an effect or when state changes are pending\\nhttps://svelte.dev/e/fork_timing`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/fork_timing`);\n\t}\n}\n\n/**\n * `getAbortSignal()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function get_abort_signal_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`get_abort_signal_outside_reaction\\n\\`getAbortSignal()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/get_abort_signal_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\n * @returns {never}\n */\nexport function set_context_after_init() {\n\tif (DEV) {\n\t\tconst error = new Error(`set_context_after_init\\n\\`setContext\\` must be called when a component first initializes, not in a subsequent effect or after an \\`await\\` expression\\nhttps://svelte.dev/e/set_context_after_init`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/set_context_after_init`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside \\`$derived(...)\\`, \\`$inspect(...)\\` or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}\n\n/**\n * A `` `reset` function cannot be called while an error is still being handled\n * @returns {never}\n */\nexport function svelte_boundary_reset_onerror() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_boundary_reset_onerror\\nA \\`\\` \\`reset\\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);\n\t}\n}","/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tCOMMENT_NODE,\n\tEFFECT_PRESERVED,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport { HYDRATION_START_ELSE } from '../../../../constants.js';\nimport { component_context, set_component_context } from '../../context.js';\nimport { handle_error, invoke_error_boundary } from '../../error-handling.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect\n} from '../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tnext,\n\tskip_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport * as e from '../../errors.js';\nimport * as w from '../../warnings.js';\nimport { DEV } from 'esm-env';\nimport { Batch } from '../../reactivity/batch.js';\nimport { internal_set, source } from '../../reactivity/sources.js';\nimport { tag } from '../../dev/tracing.js';\nimport { createSubscriber } from '../../../../reactivity/create-subscriber.js';\nimport { create_text } from '../operations.js';\n\n/**\n * @typedef {{\n * \t onerror?: (error: unknown, reset: () => void) => void;\n * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;\n * pending?: (anchor: Node) => void;\n * }} BoundaryProps\n */\n\nvar flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;\n\n/**\n * @param {TemplateNode} node\n * @param {BoundaryProps} props\n * @param {((anchor: Node) => void)} children\n * @returns {void}\n */\nexport function boundary(node, props, children) {\n\tnew Boundary(node, props, children);\n}\n\nexport class Boundary {\n\t/** @type {Boundary | null} */\n\tparent;\n\n\t#pending = false;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode | null} */\n\t#hydrate_open = hydrating ? hydrate_node : null;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) => void)} */\n\t#children;\n\n\t/** @type {Effect} */\n\t#effect;\n\n\t/** @type {Effect | null} */\n\t#main_effect = null;\n\n\t/** @type {Effect | null} */\n\t#pending_effect = null;\n\n\t/** @type {Effect | null} */\n\t#failed_effect = null;\n\n\t/** @type {DocumentFragment | null} */\n\t#offscreen_fragment = null;\n\n\t/** @type {TemplateNode | null} */\n\t#pending_anchor = null;\n\n\t#local_pending_count = 0;\n\t#pending_count = 0;\n\n\t#is_creating_fallback = false;\n\n\t/**\n\t * A source containing the number of pending async deriveds/expressions.\n\t * Only created if `$effect.pending()` is used inside the boundary,\n\t * otherwise updating the source results in needless `Batch.ensure()`\n\t * calls followed by no-op flushes\n\t * @type {Source | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_subscriber = createSubscriber(() => {\n\t\tthis.#effect_pending = source(this.#local_pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis.#effect_pending = null;\n\t\t};\n\t});\n\n\t/**\n\t * @param {TemplateNode} node\n\t * @param {BoundaryProps} props\n\t * @param {((anchor: Node) => void)} children\n\t */\n\tconstructor(node, props, children) {\n\t\tthis.#anchor = node;\n\t\tthis.#props = props;\n\t\tthis.#children = children;\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\tthis.#pending = !!this.#props.pending;\n\n\t\tthis.#effect = block(() => {\n\t\t\t/** @type {Effect} */ (active_effect).b = this;\n\n\t\t\tif (hydrating) {\n\t\t\t\tconst comment = this.#hydrate_open;\n\t\t\t\thydrate_next();\n\n\t\t\t\tconst server_rendered_pending =\n\t\t\t\t\t/** @type {Comment} */ (comment).nodeType === COMMENT_NODE &&\n\t\t\t\t\t/** @type {Comment} */ (comment).data === HYDRATION_START_ELSE;\n\n\t\t\t\tif (server_rendered_pending) {\n\t\t\t\t\tthis.#hydrate_pending_content();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#hydrate_resolved_content();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar anchor = this.#get_anchor();\n\n\t\t\t\ttry {\n\t\t\t\t\tthis.#main_effect = branch(() => children(anchor));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.error(error);\n\t\t\t\t}\n\n\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#pending = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tthis.#pending_anchor?.remove();\n\t\t\t};\n\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\t#hydrate_resolved_content() {\n\t\ttry {\n\t\t\tthis.#main_effect = branch(() => this.#children(this.#anchor));\n\t\t} catch (error) {\n\t\t\tthis.error(error);\n\t\t}\n\n\t\t// Since server rendered resolved content, we never show pending state\n\t\t// Even if client-side async operations are still running, the content is already displayed\n\t\tthis.#pending = false;\n\t}\n\n\t#hydrate_pending_content() {\n\t\tconst pending = this.#props.pending;\n\t\tif (!pending) {\n\t\t\treturn;\n\t\t}\n\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\n\t\tBatch.enqueue(() => {\n\t\t\tvar anchor = this.#get_anchor();\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tBatch.ensure();\n\t\t\t\treturn branch(() => this.#children(anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\n\t\t\t\tthis.#pending = false;\n\t\t\t}\n\t\t});\n\t}\n\n\t#get_anchor() {\n\t\tvar anchor = this.#anchor;\n\n\t\tif (this.#pending) {\n\t\t\tthis.#pending_anchor = create_text();\n\t\t\tthis.#anchor.before(this.#pending_anchor);\n\n\t\t\tanchor = this.#pending_anchor;\n\t\t}\n\n\t\treturn anchor;\n\t}\n\n\t/**\n\t * Returns `true` if the effect exists inside a boundary whose pending snippet is shown\n\t * @returns {boolean}\n\t */\n\tis_pending() {\n\t\treturn this.#pending || (!!this.parent && this.parent.is_pending());\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @param {() => Effect | null} fn\n\t */\n\t#run(fn) {\n\t\tvar previous_effect = active_effect;\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_ctx = component_context;\n\n\t\tset_active_effect(this.#effect);\n\t\tset_active_reaction(this.#effect);\n\t\tset_component_context(this.#effect.ctx);\n\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (e) {\n\t\t\thandle_error(e);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tset_active_effect(previous_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_component_context(previous_ctx);\n\t\t}\n\t}\n\n\t#show_pending_snippet() {\n\t\tconst pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);\n\n\t\tif (this.#main_effect !== null) {\n\t\t\tthis.#offscreen_fragment = document.createDocumentFragment();\n\t\t\tthis.#offscreen_fragment.append(/** @type {TemplateNode} */ (this.#pending_anchor));\n\t\t\tmove_effect(this.#main_effect, this.#offscreen_fragment);\n\t\t}\n\n\t\tif (this.#pending_effect === null) {\n\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\t\t}\n\t}\n\n\t/**\n\t * Updates the pending count associated with the currently visible pending snippet,\n\t * if any, such that we can replace the snippet with content once work is done\n\t * @param {1 | -1} d\n\t */\n\t#update_pending_count(d) {\n\t\tif (!this.has_pending_snippet()) {\n\t\t\tif (this.parent) {\n\t\t\t\tthis.parent.#update_pending_count(d);\n\t\t\t}\n\n\t\t\t// if there's no parent, we're in a scope with no pending snippet\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#pending_count += d;\n\n\t\tif (this.#pending_count === 0) {\n\t\t\tthis.#pending = false;\n\n\t\t\tif (this.#pending_effect) {\n\t\t\t\tpause_effect(this.#pending_effect, () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.#offscreen_fragment) {\n\t\t\t\tthis.#anchor.before(this.#offscreen_fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Update the source that powers `$effect.pending()` inside this boundary,\n\t * and controls when the current `pending` snippet (if any) is removed.\n\t * Do not call from inside the class\n\t * @param {1 | -1} d\n\t */\n\tupdate_pending_count(d) {\n\t\tthis.#update_pending_count(d);\n\n\t\tthis.#local_pending_count += d;\n\n\t\tif (this.#effect_pending) {\n\t\t\tinternal_set(this.#effect_pending, this.#local_pending_count);\n\t\t}\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source} */ (this.#effect_pending));\n\t}\n\n\t/** @param {unknown} error */\n\terror(error) {\n\t\tvar onerror = this.#props.onerror;\n\t\tlet failed = this.#props.failed;\n\n\t\t// If we have nothing to capture the error, or if we hit an error while\n\t\t// rendering the fallback, re-throw for another boundary to handle\n\t\tif (this.#is_creating_fallback || (!onerror && !failed)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this.#main_effect) {\n\t\t\tdestroy_effect(this.#main_effect);\n\t\t\tthis.#main_effect = null;\n\t\t}\n\n\t\tif (this.#pending_effect) {\n\t\t\tdestroy_effect(this.#pending_effect);\n\t\t\tthis.#pending_effect = null;\n\t\t}\n\n\t\tif (this.#failed_effect) {\n\t\t\tdestroy_effect(this.#failed_effect);\n\t\t\tthis.#failed_effect = null;\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tset_hydrate_node(/** @type {TemplateNode} */ (this.#hydrate_open));\n\t\t\tnext();\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () => {\n\t\t\tif (did_reset) {\n\t\t\t\tw.svelte_boundary_reset_noop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdid_reset = true;\n\n\t\t\tif (calling_on_error) {\n\t\t\t\te.svelte_boundary_reset_onerror();\n\t\t\t}\n\n\t\t\t// If the failure happened while flushing effects, current_batch can be null\n\t\t\tBatch.ensure();\n\n\t\t\tthis.#local_pending_count = 0;\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () => {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// we intentionally do not try to find the nearest pending boundary. If this boundary has one, we'll render it on reset\n\t\t\t// but it would be really weird to show the parent's boundary on a child reset.\n\t\t\tthis.#pending = this.has_pending_snippet();\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tthis.#pending = false;\n\t\t\t}\n\t\t};\n\n\t\tvar previous_reaction = active_reaction;\n\n\t\ttry {\n\t\t\tset_active_reaction(null);\n\t\t\tcalling_on_error = true;\n\t\t\tonerror?.(error, reset);\n\t\t\tcalling_on_error = false;\n\t\t} catch (error) {\n\t\t\tinvoke_error_boundary(error, this.#effect && this.#effect.parent);\n\t\t} finally {\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\n\t\tif (failed) {\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tthis.#failed_effect = this.#run(() => {\n\t\t\t\t\tBatch.ensure();\n\t\t\t\t\tthis.#is_creating_fallback = true;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn branch(() => {\n\t\t\t\t\t\t\tfailed(\n\t\t\t\t\t\t\t\tthis.#anchor,\n\t\t\t\t\t\t\t\t() => error,\n\t\t\t\t\t\t\t\t() => reset\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, /** @type {Effect} */ (this.#effect.parent));\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function get_boundary() {\n\treturn /** @type {Boundary} */ (/** @type {Effect} */ (active_effect).b);\n}\n\nexport function pending() {\n\tif (active_effect === null) {\n\t\te.effect_pending_outside_reaction();\n\t}\n\n\tvar boundary = active_effect.b;\n\n\tif (boundary === null) {\n\t\treturn 0; // TODO eventually we will need this to be global\n\t}\n\n\treturn boundary.get_effect_pending();\n}\n","import { get, tick, untrack } from '../internal/client/runtime.js';\nimport { effect_tracking, render_effect } from '../internal/client/reactivity/effects.js';\nimport { source, increment } from '../internal/client/reactivity/sources.js';\nimport { tag } from '../internal/client/dev/tracing.js';\nimport { DEV } from 'esm-env';\nimport { queue_micro_task } from '../internal/client/dom/task.js';\n\n/**\n * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.\n * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.\n *\n * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),\n * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.\n *\n * If `start` returns a cleanup function, it will be called when the effect is destroyed.\n *\n * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects\n * are active, and the returned teardown function will only be called when all effects are destroyed.\n *\n * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):\n *\n * ```js\n * import { createSubscriber } from 'svelte/reactivity';\n * import { on } from 'svelte/events';\n *\n * export class MediaQuery {\n * \t#query;\n * \t#subscribe;\n *\n * \tconstructor(query) {\n * \t\tthis.#query = window.matchMedia(`(${query})`);\n *\n * \t\tthis.#subscribe = createSubscriber((update) => {\n * \t\t\t// when the `change` event occurs, re-run any effects that read `this.current`\n * \t\t\tconst off = on(this.#query, 'change', update);\n *\n * \t\t\t// stop listening when all the effects are destroyed\n * \t\t\treturn () => off();\n * \t\t});\n * \t}\n *\n * \tget current() {\n * \t\t// This makes the getter reactive, if read in an effect\n * \t\tthis.#subscribe();\n *\n * \t\t// Return the current state of the query, whether or not we're in an effect\n * \t\treturn this.#query.matches;\n * \t}\n * }\n * ```\n * @param {(update: () => void) => (() => void) | void} start\n * @since 5.7.0\n */\nexport function createSubscriber(start) {\n\tlet subscribers = 0;\n\tlet version = source(0);\n\t/** @type {(() => void) | void} */\n\tlet stop;\n\n\tif (DEV) {\n\t\ttag(version, 'createSubscriber version');\n\t}\n\n\treturn () => {\n\t\tif (effect_tracking()) {\n\t\t\tget(version);\n\n\t\t\trender_effect(() => {\n\t\t\t\tif (subscribers === 0) {\n\t\t\t\t\tstop = untrack(() => start(() => increment(version)));\n\t\t\t\t}\n\n\t\t\t\tsubscribers += 1;\n\n\t\t\t\treturn () => {\n\t\t\t\t\tqueue_micro_task(() => {\n\t\t\t\t\t\t// Only count down after a microtask, else we would reach 0 before our own render effect reruns,\n\t\t\t\t\t\t// but reach 1 again when the tick callback of the prior teardown runs. That would mean we\n\t\t\t\t\t\t// re-subcribe unnecessarily and create a memory leak because the old subscription is never cleaned up.\n\t\t\t\t\t\tsubscribers -= 1;\n\n\t\t\t\t\t\tif (subscribers === 0) {\n\t\t\t\t\t\t\tstop?.();\n\t\t\t\t\t\t\tstop = undefined;\n\t\t\t\t\t\t\t// Increment the version to ensure any dependent deriveds are marked dirty when the subscription is picked up again later.\n\t\t\t\t\t\t\t// If we didn't do this then the comparison of write versions would determine that the derived has a later version than\n\t\t\t\t\t\t\t// the subscriber, and it would not be re-run.\n\t\t\t\t\t\t\tincrement(version);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t};\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * Assignment to `%property%` property (%location%) will evaluate to the right-hand side, not the value of `%property%` following the assignment. This may result in unexpected behaviour.\n * @param {string} property\n * @param {string} location\n */\nexport function assignment_value_stale(property, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] assignment_value_stale\\n%cAssignment to \\`${property}\\` property (${location}) will evaluate to the right-hand side, not the value of \\`${property}\\` following the assignment. This may result in unexpected behaviour.\\nhttps://svelte.dev/e/assignment_value_stale`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/assignment_value_stale`);\n\t}\n}\n\n/**\n * Detected reactivity loss when reading `%name%`. This happens when state is read in an async function after an earlier `await`\n * @param {string} name\n */\nexport function await_reactivity_loss(name) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_reactivity_loss\\n%cDetected reactivity loss when reading \\`${name}\\`. This happens when state is read in an async function after an earlier \\`await\\`\\nhttps://svelte.dev/e/await_reactivity_loss`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_reactivity_loss`);\n\t}\n}\n\n/**\n * An async derived, `%name%` (%location%) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\n * @param {string} name\n * @param {string} location\n */\nexport function await_waterfall(name, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_waterfall\\n%cAn async derived, \\`${name}\\` (${location}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\\nhttps://svelte.dev/e/await_waterfall`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_waterfall`);\n\t}\n}\n\n/**\n * `%binding%` (%location%) is binding to a non-reactive property\n * @param {string} binding\n * @param {string | undefined | null} [location]\n */\nexport function binding_property_non_reactive(binding, location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] binding_property_non_reactive\\n%c${location\n\t\t\t\t? `\\`${binding}\\` (${location}) is binding to a non-reactive property`\n\t\t\t\t: `\\`${binding}\\` is binding to a non-reactive property`}\\nhttps://svelte.dev/e/binding_property_non_reactive`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/binding_property_non_reactive`);\n\t}\n}\n\n/**\n * Your `console.%method%` contained `$state` proxies. Consider using `$inspect(...)` or `$state.snapshot(...)` instead\n * @param {string} method\n */\nexport function console_log_state(method) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] console_log_state\\n%cYour \\`console.${method}\\` contained \\`$state\\` proxies. Consider using \\`$inspect(...)\\` or \\`$state.snapshot(...)\\` instead\\nhttps://svelte.dev/e/console_log_state`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/console_log_state`);\n\t}\n}\n\n/**\n * %handler% should be a function. Did you mean to %suggestion%?\n * @param {string} handler\n * @param {string} suggestion\n */\nexport function event_handler_invalid(handler, suggestion) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] event_handler_invalid\\n%c${handler} should be a function. Did you mean to ${suggestion}?\\nhttps://svelte.dev/e/event_handler_invalid`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/event_handler_invalid`);\n\t}\n}\n\n/**\n * The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value\n * @param {string} attribute\n * @param {string} html\n * @param {string} value\n */\nexport function hydration_attribute_changed(attribute, html, value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_attribute_changed\\n%cThe \\`${attribute}\\` attribute on \\`${html}\\` changed its value between server and client renders. The client value, \\`${value}\\`, will be ignored in favour of the server value\\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_attribute_changed`);\n\t}\n}\n\n/**\n * The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value\n * @param {string | undefined | null} [location]\n */\nexport function hydration_html_changed(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_html_changed\\n%c${location\n\t\t\t\t? `The value of an \\`{@html ...}\\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value`\n\t\t\t\t: 'The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value'}\\nhttps://svelte.dev/e/hydration_html_changed`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_html_changed`);\n\t}\n}\n\n/**\n * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%\n * @param {string | undefined | null} [location]\n */\nexport function hydration_mismatch(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_mismatch\\n%c${location\n\t\t\t\t? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`\n\t\t\t\t: 'Hydration failed because the initial UI does not match what was rendered on the server'}\\nhttps://svelte.dev/e/hydration_mismatch`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_mismatch`);\n\t}\n}\n\n/**\n * The `render` function passed to `createRawSnippet` should return HTML for a single element\n */\nexport function invalid_raw_snippet_render() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] invalid_raw_snippet_render\\n%cThe \\`render\\` function passed to \\`createRawSnippet\\` should return HTML for a single element\\nhttps://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);\n\t}\n}\n\n/**\n * Detected a migrated `$:` reactive block in `%filename%` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.\n * @param {string} filename\n */\nexport function legacy_recursive_reactive_block(filename) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] legacy_recursive_reactive_block\\n%cDetected a migrated \\`$:\\` reactive block in \\`${filename}\\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \\`$effect\\`.\\nhttps://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);\n\t}\n}\n\n/**\n * Tried to unmount a component that was not mounted\n */\nexport function lifecycle_double_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] lifecycle_double_unmount\\n%cTried to unmount a component that was not mounted\\nhttps://svelte.dev/e/lifecycle_double_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/lifecycle_double_unmount`);\n\t}\n}\n\n/**\n * %parent% passed property `%prop%` to %child% with `bind:`, but its parent component %owner% did not declare `%prop%` as a binding. Consider creating a binding between %owner% and %parent% (e.g. `bind:%prop%={...}` instead of `%prop%={...}`)\n * @param {string} parent\n * @param {string} prop\n * @param {string} child\n * @param {string} owner\n */\nexport function ownership_invalid_binding(parent, prop, child, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_binding\\n%c${parent} passed property \\`${prop}\\` to ${child} with \\`bind:\\`, but its parent component ${owner} did not declare \\`${prop}\\` as a binding. Consider creating a binding between ${owner} and ${parent} (e.g. \\`bind:${prop}={...}\\` instead of \\`${prop}={...}\\`)\\nhttps://svelte.dev/e/ownership_invalid_binding`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_binding`);\n\t}\n}\n\n/**\n * Mutating unbound props (`%name%`, at %location%) is strongly discouraged. Consider using `bind:%prop%={...}` in %parent% (or using a callback) instead\n * @param {string} name\n * @param {string} location\n * @param {string} prop\n * @param {string} parent\n */\nexport function ownership_invalid_mutation(name, location, prop, parent) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_mutation\\n%cMutating unbound props (\\`${name}\\`, at ${location}) is strongly discouraged. Consider using \\`bind:${prop}={...}\\` in ${parent} (or using a callback) instead\\nhttps://svelte.dev/e/ownership_invalid_mutation`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_mutation`);\n\t}\n}\n\n/**\n * The `value` property of a `\\` element should be an array, but it received a non-array value. The selection will be kept as is.\\nhttps://svelte.dev/e/select_multiple_invalid_value`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/select_multiple_invalid_value`);\n\t}\n}\n\n/**\n * Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results\n * @param {string} operator\n */\nexport function state_proxy_equality_mismatch(operator) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_equality_mismatch\\n%cReactive \\`$state(...)\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\`${operator}\\` will produce unexpected results\\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);\n\t}\n}\n\n/**\n * Tried to unmount a state proxy, rather than a component\n */\nexport function state_proxy_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_unmount\\n%cTried to unmount a state proxy, rather than a component\\nhttps://svelte.dev/e/state_proxy_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_unmount`);\n\t}\n}\n\n/**\n * A `` `reset` function only resets the boundary the first time it is called\n */\nexport function svelte_boundary_reset_noop() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] svelte_boundary_reset_noop\\n%cA \\`\\` \\`reset\\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);\n\t}\n}\n\n/**\n * The `slide` transition does not work correctly for elements with `display: %value%`\n * @param {string} value\n */\nexport function transition_slide_display(value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] transition_slide_display\\n%cThe \\`slide\\` transition does not work correctly for elements with \\`display: ${value}\\`\\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/transition_slide_display`);\n\t}\n}","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tshould_defer_append\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { COMMENT_NODE, INERT } from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} to_destroy\n * @param {null | Node} controlled_anchor\n */\nfunction pause_effects(state, to_destroy, controlled_anchor) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = to_destroy.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(to_destroy[i].e, transitions, true);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\t// If we're in a controlled each block (i.e. the block is the only child of an\n\t\t// element), and we are removing all items, _and_ there are no out transitions,\n\t\t// we can use the fast path — emptying the element and replacing the anchor\n\t\tvar fast_path = transitions.length === 0 && controlled_anchor !== null;\n\n\t\t// TODO only destroy effects if no pending batch needs them. otherwise,\n\t\t// just set `item.o` back to `false`\n\n\t\tif (fast_path) {\n\t\t\tvar anchor = /** @type {Element} */ (controlled_anchor);\n\t\t\tvar parent_node = /** @type {Element} */ (anchor.parentNode);\n\n\t\t\tclear_text_content(parent_node);\n\t\t\tparent_node.append(anchor);\n\n\t\t\tstate.items.clear();\n\t\t\tlink(state, to_destroy[0].prev, to_destroy[length - 1].next);\n\t\t}\n\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = to_destroy[i];\n\n\t\t\tif (!fast_path) {\n\t\t\t\tstate.items.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\n\t\t\tdestroy_effect(item.e, !fast_path);\n\t\t}\n\n\t\tif (state.first === to_destroy[0]) {\n\t\t\tstate.first = to_destroy[0].prev;\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource, index: MaybeSource) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {Map} */\n\tvar items = new Map();\n\n\t/** @type {EachItem | null} */\n\tvar first = null;\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\tvar is_reactive_value = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar is_reactive_index = (flags & EACH_INDEX_REACTIVE) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {{ fragment: DocumentFragment | null, effect: Effect } | null} */\n\tvar fallback = null;\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\t/** @type {V[]} */\n\tvar array;\n\n\tvar first_run = true;\n\n\tfunction commit() {\n\t\treconcile(state, array, anchor, flags, get_key);\n\n\t\tif (fallback !== null) {\n\t\t\tif (array.length === 0) {\n\t\t\t\tif (fallback.fragment) {\n\t\t\t\t\tanchor.before(fallback.fragment);\n\t\t\t\t\tfallback.fragment = null;\n\t\t\t\t} else {\n\t\t\t\t\tresume_effect(fallback.effect);\n\t\t\t\t}\n\n\t\t\t\teffect.first = fallback.effect;\n\t\t\t} else {\n\t\t\t\tpause_effect(fallback.effect, () => {\n\t\t\t\t\t// TODO only null out if no pending batch needs it,\n\t\t\t\t\t// otherwise re-add `fallback.fragment` and move the\n\t\t\t\t\t// effect into it\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tvar effect = block(() => {\n\t\tarray = /** @type {V[]} */ (get(each_array));\n\t\tvar length = array.length;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = skip_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tvar keys = new Set();\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar prev = null;\n\t\tvar defer = should_defer_append();\n\n\t\tfor (var i = 0; i < length; i += 1) {\n\t\t\tif (\n\t\t\t\thydrating &&\n\t\t\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t) {\n\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\tmismatch = true;\n\t\t\t\tset_hydrating(false);\n\t\t\t}\n\n\t\t\tvar value = array[i];\n\t\t\tvar key = get_key(value, i);\n\n\t\t\tvar item = first_run ? null : items.get(key);\n\n\t\t\tif (item) {\n\t\t\t\t// update before reconciliation, to trigger any async updates\n\t\t\t\tif (is_reactive_value) {\n\t\t\t\t\tinternal_set(item.v, value);\n\t\t\t\t}\n\n\t\t\t\tif (is_reactive_index) {\n\t\t\t\t\tinternal_set(/** @type {Value} */ (item.i), i);\n\t\t\t\t} else {\n\t\t\t\t\titem.i = i;\n\t\t\t\t}\n\n\t\t\t\tif (defer) {\n\t\t\t\t\tbatch.skipped_effects.delete(item.e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titem = create_item(\n\t\t\t\t\tfirst_run ? anchor : null,\n\t\t\t\t\tprev,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\n\t\t\t\tif (first_run) {\n\t\t\t\t\titem.o = true;\n\n\t\t\t\t\tif (prev === null) {\n\t\t\t\t\t\tfirst = item;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprev.next = item;\n\t\t\t\t\t}\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\titems.set(key, item);\n\t\t\t}\n\n\t\t\tkeys.add(key);\n\t\t}\n\n\t\tif (length === 0 && fallback_fn && !fallback) {\n\t\t\tif (first_run) {\n\t\t\t\tfallback = {\n\t\t\t\t\tfragment: null,\n\t\t\t\t\teffect: branch(() => fallback_fn(anchor))\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tvar target = create_text();\n\t\t\t\tfragment.append(target);\n\n\t\t\t\tfallback = {\n\t\t\t\t\tfragment,\n\t\t\t\t\teffect: branch(() => fallback_fn(target))\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// remove excess nodes\n\t\tif (hydrating && length > 0) {\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tif (!first_run) {\n\t\t\tif (defer) {\n\t\t\t\tfor (const [key, item] of items) {\n\t\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\t\tbatch.skipped_effects.add(item.e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.oncommit(commit);\n\t\t\t\tbatch.ondiscard(() => {\n\t\t\t\t\t// TODO presumably we need to do something here?\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcommit();\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\t/** @type {EachState} */\n\tvar state = { effect, flags, items, first };\n\n\tfirst_run = false;\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {EachState} state\n * @param {Array} array\n * @param {Element | Comment | Text} anchor\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @returns {void}\n */\nfunction reconcile(state, array, anchor, flags, get_key) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar current = state.first;\n\n\t/** @type {undefined | Set} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = /** @type {EachItem} */ (items.get(key));\n\n\t\t\titem.a?.measure();\n\t\t\t(to_animate ??= new Set()).add(item);\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\n\t\titem = /** @type {EachItem} */ (items.get(key));\n\n\t\tstate.first ??= item;\n\n\t\tif (!item.o) {\n\t\t\titem.o = true;\n\n\t\t\tvar next = prev ? prev.next : current;\n\n\t\t\tlink(state, prev, item);\n\t\t\tlink(state, item, next);\n\n\t\t\tmove(item, next, anchor);\n\t\t\tprev = item;\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @template V\n * @param {Node | null} anchor\n * @param {EachItem | null} prev\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source, index: number | Value, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @returns {EachItem}\n */\nfunction create_item(anchor, prev, value, key, index, render_fn, flags, get_collection) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value, false, false) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).trace = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\to: false,\n\t\tprev,\n\t\tnext: null\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\tif (anchor === null) {\n\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\tfragment.append((anchor = create_text()));\n\t\t}\n\n\t\titem.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection));\n\n\t\tif (prev !== null) {\n\t\t\t// we only need to set `prev.next = item`, because\n\t\t\t// `item.prev = prev` was set on initialization.\n\t\t\t// the effects themselves are already linked\n\t\t\tprev.next = item;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== null && node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t\tstate.effect.first = next && next.e;\n\t} else {\n\t\tif (prev.e.next) {\n\t\t\tprev.e.next.prev = null;\n\t\t}\n\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next === null) {\n\t\tstate.effect.last = prev && prev.e;\n\t} else {\n\t\tif (next.e.prev) {\n\t\t\tnext.e.prev.next = null;\n\t\t}\n\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor, is_extensible } from '../../shared/utils.js';\nimport { active_effect } from '../runtime.js';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { TEXT_NODE, EFFECT_RAN } from '#client/constants';\nimport { eager_block_effects } from '../reactivity/batch.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\tvar text_prototype = Text.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\tif (is_extensible(element_prototype)) {\n\t\t// the following assignments improve perf of lookups on DOM nodes\n\t\t// @ts-expect-error\n\t\telement_prototype.__click = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__className = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__attributes = null;\n\t\t// @ts-expect-error\n\t\telement_prototype.__style = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__e = undefined;\n\t}\n\n\tif (is_extensible(text_prototype)) {\n\t\t// @ts-expect-error\n\t\ttext_prototype.__t = undefined;\n\t}\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `

{text}

`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode | TemplateNode[]} fragment\n * @param {boolean} [is_text]\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text = false) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && next_sibling?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n\n/**\n * Returns `true` if we're updating the current block, for example `condition` in\n * an `{#if condition}` block just changed. In this case, the branch should be\n * appended (or removed) at the same time as other updates within the\n * current ``\n */\nexport function should_defer_append() {\n\tif (!async_mode_flag) return false;\n\tif (eager_block_effects !== null) return false;\n\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\treturn (flags & EFFECT_RAN) !== 0;\n}\n\n/**\n *\n * @param {string} tag\n * @param {string} [namespace]\n * @param {string} [is]\n * @returns\n */\nexport function create_element(tag, namespace, is) {\n\tlet options = is ? { is } : undefined;\n\tif (namespace) {\n\t\treturn document.createElementNS(namespace, tag, options);\n\t}\n\treturn document.createElement(tag, options);\n}\n\nexport function create_fragment() {\n\treturn document.createDocumentFragment();\n}\n\n/**\n * @param {string} data\n * @returns\n */\nexport function create_comment(data = '') {\n\treturn document.createComment(data);\n}\n\n/**\n * @param {Element} element\n * @param {string} key\n * @param {string} value\n * @returns\n */\nexport function set_attribute(element, key, value = '') {\n\tif (key.startsWith('xlink:')) {\n\t\telement.setAttributeNS('http://www.w3.org/1999/xlink', key, value);\n\t\treturn;\n\t}\n\treturn element.setAttribute(key, value);\n}\n","/** @import { Derived, Effect, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tcurrent_sources,\n\tis_dirty,\n\tuntracking,\n\tis_destroying_effect,\n\tpush_reaction_value,\n\tset_is_updating_effect,\n\tis_updating_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tEAGER_EFFECT,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tASYNC,\n\tWAS_MARKED,\n\tCONNECTED\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { get_stack, tag_proxy } from '../dev/tracing.js';\nimport { component_context, is_runes } from '../context.js';\nimport { Batch, batch_values, eager_block_effects, schedule_effect } from './batch.js';\nimport { proxy } from '../proxy.js';\nimport { execute_derived } from './deriveds.js';\n\n/** @type {Set} */\nexport let eager_effects = new Set();\n\n/** @type {Map} */\nexport const old_values = new Map();\n\n/**\n * @param {Set} v\n */\nexport function set_eager_effects(v) {\n\teager_effects = v;\n}\n\nlet eager_effects_deferred = false;\n\nexport function set_eager_effects_deferred() {\n\teager_effects_deferred = true;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source}\n */\n// TODO rename this to `state` throughout the codebase\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_stack('created at');\n\t\tsignal.updated = null;\n\t\tsignal.set_during_effect = false;\n\t\tsignal.trace = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function state(v, stack) {\n\tconst s = source(v, stack);\n\n\tpush_reaction_value(s);\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false, trackable = true) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @param {boolean} [should_proxy]\n * @returns {V}\n */\nexport function set(source, value, should_proxy = false) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t// since we are untracking the function inside `$inspect.with` we need to add this check\n\t\t// to ensure we error if state is set inside an inspect effect\n\t\t(!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 &&\n\t\t!current_sources?.includes(source)\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\tlet new_value = should_proxy ? proxy(value) : value;\n\n\tif (DEV) {\n\t\ttag_proxy(new_value, /** @type {string} */ (source.label));\n\t}\n\n\treturn internal_set(source, new_value);\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\n\t\tif (is_destroying_effect) {\n\t\t\told_values.set(source, value);\n\t\t} else {\n\t\t\told_values.set(source, old_value);\n\t\t}\n\n\t\tsource.v = value;\n\n\t\tvar batch = Batch.ensure();\n\t\tbatch.capture(source, old_value);\n\n\t\tif (DEV) {\n\t\t\tif (tracing_mode_flag || active_effect !== null) {\n\t\t\t\tsource.updated ??= new Map();\n\n\t\t\t\t// For performance reasons, when not using $inspect.trace, we only start collecting stack traces\n\t\t\t\t// after the same source has been updated more than 5 times in the same flush cycle.\n\t\t\t\tconst count = (source.updated.get('')?.count ?? 0) + 1;\n\t\t\t\tsource.updated.set('', { error: /** @type {any} */ (null), count });\n\n\t\t\t\tif (tracing_mode_flag || count > 5) {\n\t\t\t\t\tconst error = get_stack('updated at');\n\n\t\t\t\t\tif (error !== null) {\n\t\t\t\t\t\tlet entry = source.updated.get(error.stack);\n\n\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\tentry = { error, count: 0 };\n\t\t\t\t\t\t\tsource.updated.set(error.stack, entry);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tentry.count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (active_effect !== null) {\n\t\t\t\tsource.set_during_effect = true;\n\t\t\t}\n\t\t}\n\n\t\tif ((source.f & DERIVED) !== 0) {\n\t\t\t// if we are assigning to a dirty derived we set it to clean/maybe dirty but we also eagerly execute it to track the dependencies\n\t\t\tif ((source.f & DIRTY) !== 0) {\n\t\t\t\texecute_derived(/** @type {Derived} */ (source));\n\t\t\t}\n\n\t\t\tset_signal_status(source, (source.f & CONNECTED) !== 0 ? CLEAN : MAYBE_DIRTY);\n\t\t}\n\n\t\tsource.wv = increment_write_version();\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {\n\t\t\tflush_eager_effects();\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport function flush_eager_effects() {\n\teager_effects_deferred = false;\n\tvar prev_is_updating_effect = is_updating_effect;\n\tset_is_updating_effect(true);\n\n\tconst inspects = Array.from(eager_effects);\n\n\ttry {\n\t\tfor (const effect of inspects) {\n\t\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tset_is_updating_effect(prev_is_updating_effect);\n\t}\n\n\teager_effects.clear();\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * Silently (without using `get`) increment a source\n * @param {Source} source\n */\nexport function increment(source) {\n\tset(source, source.v + 1);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & EAGER_EFFECT) !== 0) {\n\t\t\teager_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar not_dirty = (flags & DIRTY) === 0;\n\n\t\t// don't set a DIRTY reaction to MAYBE_DIRTY\n\t\tif (not_dirty) {\n\t\t\tset_signal_status(reaction, status);\n\t\t}\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\n\t\t\tbatch_values?.delete(derived);\n\n\t\t\tif ((flags & WAS_MARKED) === 0) {\n\t\t\t\t// Only connected deriveds can be reliably unmarked right away\n\t\t\t\tif (flags & CONNECTED) {\n\t\t\t\t\treaction.f |= WAS_MARKED;\n\t\t\t\t}\n\n\t\t\t\tmark_reactions(derived, MAYBE_DIRTY);\n\t\t\t}\n\t\t} else if (not_dirty) {\n\t\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\t\tif (eager_block_effects !== null) {\n\t\t\t\t\teager_block_effects.add(/** @type {Effect} */ (reaction));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n","/** @import { Effect, TemplateNode, Value } from '#client' */\nimport { DESTROYED, STALE_REACTION } from '#client/constants';\nimport { DEV } from 'esm-env';\nimport {\n\tcomponent_context,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_stack\n} from '../context.js';\nimport { get_boundary } from '../dom/blocks/boundary.js';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../runtime.js';\nimport { Batch, current_batch } from './batch.js';\nimport {\n\tasync_derived,\n\tcurrent_async_effect,\n\tderived,\n\tderived_safe_equal,\n\tset_from_async_derived\n} from './deriveds.js';\nimport { aborted } from './effects.js';\nimport { hydrate_next, hydrating, set_hydrate_node, skip_nodes } from '../dom/hydration.js';\nimport { current_each_item, set_current_each_item } from '../dom/blocks/each.js';\n\n/**\n * @param {Array>} blockers\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {(values: Value[]) => any} fn\n */\nexport function flatten(blockers, sync, async, fn) {\n\tconst d = is_runes() ? derived : derived_safe_equal;\n\n\tif (async.length === 0 && blockers.length === 0) {\n\t\tfn(sync.map(d));\n\t\treturn;\n\t}\n\n\tvar batch = current_batch;\n\tvar parent = /** @type {Effect} */ (active_effect);\n\n\tvar restore = capture();\n\n\tfunction run() {\n\t\tPromise.all(async.map((expression) => async_derived(expression)))\n\t\t\t.then((result) => {\n\t\t\t\trestore();\n\n\t\t\t\ttry {\n\t\t\t\t\tfn([...sync.map(d), ...result]);\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// ignore errors in blocks that have already been destroyed\n\t\t\t\t\tif ((parent.f & DESTROYED) === 0) {\n\t\t\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch?.deactivate();\n\t\t\t\tunset_context();\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t});\n\t}\n\n\tif (blockers.length > 0) {\n\t\tPromise.all(blockers).then(() => {\n\t\t\trestore();\n\n\t\t\ttry {\n\t\t\t\treturn run();\n\t\t\t} finally {\n\t\t\t\tbatch?.deactivate();\n\t\t\t\tunset_context();\n\t\t\t}\n\t\t});\n\t} else {\n\t\trun();\n\t}\n}\n\n/**\n * @param {Array>} blockers\n * @param {(values: Value[]) => any} fn\n */\nexport function run_after_blockers(blockers, fn) {\n\tvar each_item = current_each_item; // TODO should this be part of capture?\n\tflatten(blockers, [], [], (v) => {\n\t\tset_current_each_item(each_item);\n\t\tfn(v);\n\t});\n}\n\n/**\n * Captures the current effect context so that we can restore it after\n * some asynchronous work has happened (so that e.g. `await a + b`\n * causes `b` to be registered as a dependency).\n */\nexport function capture() {\n\tvar previous_effect = active_effect;\n\tvar previous_reaction = active_reaction;\n\tvar previous_component_context = component_context;\n\tvar previous_batch = current_batch;\n\n\tif (DEV) {\n\t\tvar previous_dev_stack = dev_stack;\n\t}\n\n\treturn function restore(activate_batch = true) {\n\t\tset_active_effect(previous_effect);\n\t\tset_active_reaction(previous_reaction);\n\t\tset_component_context(previous_component_context);\n\t\tif (activate_batch) previous_batch?.activate();\n\n\t\tif (DEV) {\n\t\t\tset_from_async_derived(null);\n\t\t\tset_dev_stack(previous_dev_stack);\n\t\t}\n\t};\n}\n\n/**\n * Wraps an `await` expression in such a way that the effect context that was\n * active before the expression evaluated can be reapplied afterwards —\n * `await a + b` becomes `(await $.save(a))() + b`\n * @template T\n * @param {Promise} promise\n * @returns {Promise<() => T>}\n */\nexport async function save(promise) {\n\tvar restore = capture();\n\tvar value = await promise;\n\n\treturn () => {\n\t\trestore();\n\t\treturn value;\n\t};\n}\n\n/**\n * Reset `current_async_effect` after the `promise` resolves, so\n * that we can emit `await_reactivity_loss` warnings\n * @template T\n * @param {Promise} promise\n * @returns {Promise<() => T>}\n */\nexport async function track_reactivity_loss(promise) {\n\tvar previous_async_effect = current_async_effect;\n\tvar value = await promise;\n\n\treturn () => {\n\t\tset_from_async_derived(previous_async_effect);\n\t\treturn value;\n\t};\n}\n\n/**\n * Used in `for await` loops in DEV, so\n * that we can emit `await_reactivity_loss` warnings\n * after each `async_iterator` result resolves and\n * after the `async_iterator` return resolves (if it runs)\n * @template T\n * @template TReturn\n * @param {Iterable | AsyncIterable} iterable\n * @returns {AsyncGenerator}\n */\nexport async function* for_await_track_reactivity_loss(iterable) {\n\t// This is based on the algorithms described in ECMA-262:\n\t// ForIn/OfBodyEvaluation\n\t// https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset\n\t// AsyncIteratorClose\n\t// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-asynciteratorclose\n\n\t/** @type {AsyncIterator} */\n\t// @ts-ignore\n\tconst iterator = iterable[Symbol.asyncIterator]?.() ?? iterable[Symbol.iterator]?.();\n\n\tif (iterator === undefined) {\n\t\tthrow new TypeError('value is not async iterable');\n\t}\n\n\t/** Whether the completion of the iterator was \"normal\", meaning it wasn't ended via `break` or a similar method */\n\tlet normal_completion = false;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = (await track_reactivity_loss(iterator.next()))();\n\t\t\tif (done) {\n\t\t\t\tnormal_completion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tyield value;\n\t\t}\n\t} finally {\n\t\t// If the iterator had a normal completion and `return` is defined on the iterator, call it and return the value\n\t\tif (normal_completion && iterator.return !== undefined) {\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn /** @type {TReturn} */ ((await track_reactivity_loss(iterator.return()))().value);\n\t\t}\n\t}\n}\n\nexport function unset_context() {\n\tset_active_effect(null);\n\tset_active_reaction(null);\n\tset_component_context(null);\n\n\tif (DEV) {\n\t\tset_from_async_derived(null);\n\t\tset_dev_stack(null);\n\t}\n}\n\n/**\n * @param {TemplateNode} anchor\n * @param {(target: TemplateNode) => Promise} fn\n */\nexport async function async_body(anchor, fn) {\n\tvar boundary = get_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar blocking = !boundary.is_pending();\n\n\tboundary.update_pending_count(1);\n\tbatch.increment(blocking);\n\n\tvar active = /** @type {Effect} */ (active_effect);\n\n\tvar was_hydrating = hydrating;\n\tvar next_hydrate_node = undefined;\n\n\tif (was_hydrating) {\n\t\thydrate_next();\n\t\tnext_hydrate_node = skip_nodes(false);\n\t}\n\n\ttry {\n\t\tvar promise = fn(anchor);\n\t} finally {\n\t\tif (next_hydrate_node) {\n\t\t\tset_hydrate_node(next_hydrate_node);\n\t\t\thydrate_next();\n\t\t}\n\t}\n\n\ttry {\n\t\tawait promise;\n\t} catch (error) {\n\t\tif (!aborted(active)) {\n\t\t\tinvoke_error_boundary(error, active);\n\t\t}\n\t} finally {\n\t\tboundary.update_pending_count(-1);\n\t\tbatch.decrement(blocking);\n\n\t\tunset_context();\n\t}\n}\n\n/**\n * @param {Array<() => void | Promise>} thunks\n */\nexport function run(thunks) {\n\tconst restore = capture();\n\n\tvar boundary = get_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar blocking = !boundary.is_pending();\n\n\tboundary.update_pending_count(1);\n\tbatch.increment(blocking);\n\n\tvar active = /** @type {Effect} */ (active_effect);\n\n\t/** @type {null | { error: any }} */\n\tvar errored = null;\n\n\t/** @param {any} error */\n\tconst handle_error = (error) => {\n\t\terrored = { error }; // wrap in object in case a promise rejects with a falsy value\n\n\t\tif (!aborted(active)) {\n\t\t\tinvoke_error_boundary(error, active);\n\t\t}\n\t};\n\n\tvar promise = Promise.resolve(thunks[0]()).catch(handle_error);\n\n\tvar promises = [promise];\n\n\tfor (const fn of thunks.slice(1)) {\n\t\tpromise = promise\n\t\t\t.then(() => {\n\t\t\t\tif (errored) {\n\t\t\t\t\tthrow errored.error;\n\t\t\t\t}\n\n\t\t\t\tif (aborted(active)) {\n\t\t\t\t\tthrow STALE_REACTION;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\trestore();\n\t\t\t\t\treturn fn();\n\t\t\t\t} finally {\n\t\t\t\t\t// TODO do we need it here as well as below?\n\t\t\t\t\tunset_context();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(handle_error)\n\t\t\t.finally(() => {\n\t\t\t\tunset_context();\n\t\t\t});\n\n\t\tpromises.push(promise);\n\t}\n\n\tpromise\n\t\t// wait one more tick, so that template effects are\n\t\t// guaranteed to run before `$effect(...)`\n\t\t.then(() => Promise.resolve())\n\t\t.finally(() => {\n\t\t\tboundary.update_pending_count(-1);\n\t\t\tbatch.decrement(blocking);\n\t\t});\n\n\treturn promises;\n}\n","/** @import { Derived, Effect, Source } from '#client' */\n/** @import { Batch } from './batch.js'; */\nimport { DEV } from 'esm-env';\nimport {\n\tERROR_VALUE,\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tEFFECT_PRESERVED,\n\tMAYBE_DIRTY,\n\tSTALE_REACTION,\n\tASYNC,\n\tWAS_MARKED,\n\tCONNECTED,\n\tDESTROYED\n} from '#client/constants';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect,\n\tpush_reaction_value,\n\tis_destroying_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport * as w from '../warnings.js';\nimport { async_effect, destroy_effect, effect_tracking, teardown } from './effects.js';\nimport { eager_effects, internal_set, set_eager_effects, source } from './sources.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { async_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { Boundary } from '../dom/blocks/boundary.js';\nimport { component_context } from '../context.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { batch_values, current_batch } from './batch.js';\nimport { unset_context } from './async.js';\nimport { deferred } from '../../shared/utils.js';\n\n/** @type {Effect | null} */\nexport let current_async_effect = null;\n\n/** @param {Effect | null} v */\nexport function set_from_async_derived(v) {\n\tcurrent_async_effect = v;\n}\n\nexport const recent_async_deriveds = new Set();\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect !== null) {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_PRESERVED;\n\t}\n\n\t/** @type {Derived} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (UNINITIALIZED),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect,\n\t\tac: null\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_stack('created at');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V | Promise} fn\n * @param {string} [location] If provided, print a warning if the value is not read immediately after update\n * @returns {Promise>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function async_derived(fn, location) {\n\tlet parent = /** @type {Effect | null} */ (active_effect);\n\n\tif (parent === null) {\n\t\te.async_derived_orphan();\n\t}\n\n\tvar boundary = /** @type {Boundary} */ (parent.b);\n\n\tvar promise = /** @type {Promise} */ (/** @type {unknown} */ (undefined));\n\tvar signal = source(/** @type {V} */ (UNINITIALIZED));\n\n\t// only suspend in async deriveds created on initialisation\n\tvar should_suspend = !active_reaction;\n\n\t/** @type {Map>>} */\n\tvar deferreds = new Map();\n\n\tasync_effect(() => {\n\t\tif (DEV) current_async_effect = active_effect;\n\n\t\t/** @type {ReturnType>} */\n\t\tvar d = deferred();\n\t\tpromise = d.promise;\n\n\t\ttry {\n\t\t\t// If this code is changed at some point, make sure to still access the then property\n\t\t\t// of fn() to read any signals it might access, so that we track them as dependencies.\n\t\t\t// We call `unset_context` to undo any `save` calls that happen inside `fn()`\n\t\t\tPromise.resolve(fn())\n\t\t\t\t.then(d.resolve, d.reject)\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (batch === current_batch && batch.committed) {\n\t\t\t\t\t\t// if the batch was rejected as stale, we need to cleanup\n\t\t\t\t\t\t// after any `$.save(...)` calls inside `fn()`\n\t\t\t\t\t\tbatch.deactivate();\n\t\t\t\t\t}\n\n\t\t\t\t\tunset_context();\n\t\t\t\t});\n\t\t} catch (error) {\n\t\t\td.reject(error);\n\t\t\tunset_context();\n\t\t}\n\n\t\tif (DEV) current_async_effect = null;\n\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\tif (should_suspend) {\n\t\t\tvar blocking = !boundary.is_pending();\n\n\t\t\tboundary.update_pending_count(1);\n\t\t\tbatch.increment(blocking);\n\n\t\t\tdeferreds.get(batch)?.reject(STALE_REACTION);\n\t\t\tdeferreds.delete(batch); // delete to ensure correct order in Map iteration below\n\t\t\tdeferreds.set(batch, d);\n\t\t}\n\n\t\t/**\n\t\t * @param {any} value\n\t\t * @param {unknown} error\n\t\t */\n\t\tconst handler = (value, error = undefined) => {\n\t\t\tcurrent_async_effect = null;\n\n\t\t\tbatch.activate();\n\n\t\t\tif (error) {\n\t\t\t\tif (error !== STALE_REACTION) {\n\t\t\t\t\tsignal.f |= ERROR_VALUE;\n\n\t\t\t\t\t// @ts-expect-error the error is the wrong type, but we don't care\n\t\t\t\t\tinternal_set(signal, error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\t\t\t\tsignal.f ^= ERROR_VALUE;\n\t\t\t\t}\n\n\t\t\t\tinternal_set(signal, value);\n\n\t\t\t\t// All prior async derived runs are now stale\n\t\t\t\tfor (const [b, d] of deferreds) {\n\t\t\t\t\tdeferreds.delete(b);\n\t\t\t\t\tif (b === batch) break;\n\t\t\t\t\td.reject(STALE_REACTION);\n\t\t\t\t}\n\n\t\t\t\tif (DEV && location !== undefined) {\n\t\t\t\t\trecent_async_deriveds.add(signal);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (recent_async_deriveds.has(signal)) {\n\t\t\t\t\t\t\tw.await_waterfall(/** @type {string} */ (signal.label), location);\n\t\t\t\t\t\t\trecent_async_deriveds.delete(signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (should_suspend) {\n\t\t\t\tboundary.update_pending_count(-1);\n\t\t\t\tbatch.decrement(blocking);\n\t\t\t}\n\t\t};\n\n\t\td.promise.then(handler, (e) => handler(null, e || 'unknown'));\n\t});\n\n\tteardown(() => {\n\t\tfor (const d of deferreds.values()) {\n\t\t\td.reject(STALE_REACTION);\n\t\t}\n\t});\n\n\tif (DEV) {\n\t\t// add a flag that lets this be printed as a derived\n\t\t// when using `$inspect.trace()`\n\t\tsignal.f |= ASYNC;\n\t}\n\n\treturn new Promise((fulfil) => {\n\t\t/** @param {Promise} p */\n\t\tfunction next(p) {\n\t\t\tfunction go() {\n\t\t\t\tif (p === promise) {\n\t\t\t\t\tfulfil(signal);\n\t\t\t\t} else {\n\t\t\t\t\t// if the effect re-runs before the initial promise\n\t\t\t\t\t// resolves, delay resolution until we have a value\n\t\t\t\t\tnext(promise);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp.then(go, go);\n\t\t}\n\n\t\tnext(promise);\n\t});\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function user_derived(fn) {\n\tconst d = derived(fn);\n\n\tif (!async_mode_flag) push_reaction_value(d);\n\n\treturn d;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\t// The original parent effect might've been destroyed but the derived\n\t\t\t// is used elsewhere now - do not return the destroyed effect in that case\n\t\t\treturn (parent.f & DESTROYED) === 0 ? /** @type {Effect} */ (parent) : null;\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nexport function execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_eager_effects = eager_effects;\n\t\tset_eager_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tderived.f &= ~WAS_MARKED;\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_eager_effects(prev_eager_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tderived.f &= ~WAS_MARKED;\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\n\tif (!derived.equals(value)) {\n\t\t// in a fork, we don't update the underlying value, just `batch_values`.\n\t\t// the underlying value will be updated when the fork is committed.\n\t\t// otherwise, the next time we get here after a 'real world' state\n\t\t// change, `derived.equals` may incorrectly return `true`\n\t\tif (!current_batch?.is_fork) {\n\t\t\tderived.v = value;\n\t\t}\n\n\t\tderived.wv = increment_write_version();\n\t}\n\n\t// don't mark derived clean if we're reading it inside a\n\t// cleanup function, or it will cache a stale value\n\tif (is_destroying_effect) {\n\t\treturn;\n\t}\n\n\t// During time traveling we don't want to reset the status so that\n\t// traversal of the graph in the other batches still happens\n\tif (batch_values !== null) {\n\t\t// only cache the value if we're in a tracking context, otherwise we won't\n\t\t// clear the cache in `mark_reactions` when dependencies are updated\n\t\tif (effect_tracking()) {\n\t\t\tbatch_values.set(derived, value);\n\t\t}\n\t} else {\n\t\tvar status = (derived.f & CONNECTED) === 0 ? MAYBE_DIRTY : CLEAN;\n\t\tset_signal_status(derived, status);\n\t}\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tis_dirty,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tCLEAN,\n\tEAGER_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tUSER_EFFECT,\n\tASYNC,\n\tCONNECTED\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { component_context, dev_current_component_function, dev_stack } from '../context.js';\nimport { Batch, current_batch, schedule_effect } from './batch.js';\nimport { flatten } from './async.js';\nimport { without_reactive_context } from '../dom/elements/bindings/shared.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null) {\n\t\tif (active_reaction === null) {\n\t\t\te.effect_orphan(rune);\n\t\t}\n\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync) {\n\tvar parent = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent !== null && (parent.f & EAGER_EFFECT) !== 0) {\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\tif (parent !== null && (parent.f & INERT) !== 0) {\n\t\ttype |= INERT;\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY | CONNECTED,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent,\n\t\tb: parent && parent.b,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0,\n\t\tac: null\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t/** @type {Effect | null} */\n\tvar e = effect;\n\n\t// if an effect has already ran and doesn't need to be kept in the tree\n\t// (because it won't re-run, has no DOM, and has no teardown etc)\n\t// then we skip it and go to its child (if any)\n\tif (\n\t\tsync &&\n\t\te.deps === null &&\n\t\te.teardown === null &&\n\t\te.nodes_start === null &&\n\t\te.first === e.last && // either `null`, or a singular child\n\t\t(e.f & EFFECT_PRESERVED) === 0\n\t) {\n\t\te = e.first;\n\t\tif ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {\n\t\t\te.f |= EFFECT_TRANSPARENT;\n\t\t}\n\t}\n\n\tif (e !== null) {\n\t\te.parent = parent;\n\n\t\tif (parent !== null) {\n\t\t\tpush_effect(e, parent);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (\n\t\t\tactive_reaction !== null &&\n\t\t\t(active_reaction.f & DERIVED) !== 0 &&\n\t\t\t(type & ROOT_EFFECT) === 0\n\t\t) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(e);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\tvar defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\tif (defer) {\n\t\t// Top-level `$effect(...)` in an unmounted component — defer until mount\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push(fn);\n\t} else {\n\t\t// Everything else — create immediately\n\t\treturn create_user_effect(fn);\n\t}\n}\n\n/**\n * @param {() => void | (() => void)} fn\n */\nexport function create_user_effect(fn) {\n\treturn create_effect(EFFECT | USER_EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn create_effect(RENDER_EFFECT | USER_EFFECT, fn, true);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function eager_effect(fn) {\n\treturn create_effect(EAGER_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise}\n */\nexport function component_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean, deps: () => any }} */\n\tvar token = { effect: null, ran: false, deps };\n\n\tcontext.l.$.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.$) {\n\t\t\ttoken.deps();\n\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function async_effect(fn) {\n\treturn create_effect(ASYNC | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {Array>} blockers\n */\nexport function template_effect(fn, sync = [], async = [], blockers = []) {\n\tflatten(blockers, sync, async, (values) => {\n\t\tcreate_effect(RENDER_EFFECT, () => fn(...values.map(get)), true);\n\t});\n}\n\n/**\n * Like `template_effect`, but with an effect which is deferred until the batch commits\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {Array>} blockers\n */\nexport function deferred_template_effect(fn, sync = [], async = [], blockers = []) {\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar is_async = async.length > 0 || blockers.length > 0;\n\n\tif (is_async) batch.increment(true);\n\n\tflatten(blockers, sync, async, (values) => {\n\t\tcreate_effect(EFFECT, () => fn(...values.map(get)), false);\n\t\tif (is_async) batch.decrement(true);\n\t});\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\tvar effect = create_effect(BLOCK_EFFECT | flags, fn, true);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n */\nexport function branch(fn) {\n\treturn create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tconst controller = effect.ac;\n\n\t\tif (controller !== null) {\n\t\t\twithout_reactive_context(() => {\n\t\t\t\tcontroller.abort(STALE_REACTION);\n\t\t\t});\n\t\t}\n\n\t\tvar next = effect.next;\n\n\t\tif ((effect.f & ROOT_EFFECT) !== 0) {\n\t\t\t// this is now an independent root\n\t\t\teffect.parent = null;\n\t\t} else {\n\t\t\tdestroy_effect(effect, remove_dom);\n\t\t}\n\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif (\n\t\t(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&\n\t\teffect.nodes_start !== null &&\n\t\teffect.nodes_end !== null\n\t) {\n\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\teffect.ac =\n\t\t\tnull;\n}\n\n/**\n *\n * @param {TemplateNode | null} node\n * @param {TemplateNode} end\n */\nexport function remove_effect_dom(node, end) {\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n * @param {boolean} [destroy]\n */\nexport function pause_effect(effect, callback, destroy = true) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tif (destroy) destroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent =\n\t\t\t(child.f & EFFECT_TRANSPARENT) !== 0 ||\n\t\t\t// If this is a branch effect without a block effect parent,\n\t\t\t// it means the parent block effect was pruned. In that case,\n\t\t\t// transparency information was transferred to the branch effect.\n\t\t\t((child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0);\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update. we don't use `is_dirty`\n\t// here because we don't want to eagerly recompute a derived like\n\t// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined\n\tif ((effect.f & CLEAN) === 0) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function aborted(effect = /** @type {Effect} */ (active_effect)) {\n\treturn (effect.f & DESTROYED) !== 0;\n}\n\n/**\n * @param {Effect} effect\n * @param {DocumentFragment} fragment\n */\nexport function move_effect(effect, fragment) {\n\tvar node = effect.nodes_start;\n\tvar end = effect.nodes_end;\n\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tfragment.append(node);\n\t\tnode = next;\n\t}\n}\n","/** @import { Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\teffect_tracking,\n\texecute_effect_teardown\n} from './reactivity/effects.js';\nimport {\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tDESTROYED,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tCONNECTED,\n\tREACTION_IS_UPDATING,\n\tSTALE_REACTION,\n\tERROR_VALUE,\n\tWAS_MARKED\n} from './constants.js';\nimport { old_values } from './reactivity/sources.js';\nimport {\n\tdestroy_derived_effects,\n\texecute_derived,\n\tcurrent_async_effect,\n\trecent_async_deriveds,\n\tupdate_derived\n} from './reactivity/deriveds.js';\nimport { async_mode_flag, tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions, get_stack } from './dev/tracing.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function,\n\tset_dev_stack\n} from './context.js';\nimport * as w from './warnings.js';\nimport { Batch, batch_values, flushSync, schedule_effect } from './reactivity/batch.js';\nimport { handle_error } from './error-handling.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport { captured_signals } from './legacy.js';\nimport { without_reactive_context } from './dom/elements/bindings/shared.js';\n\nexport let is_updating_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_updating_effect(value) {\n\tis_updating_effect = value;\n}\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a reaction, reading and writing\n * them within that reaction should not cause a re-run\n * @type {null | Source[]}\n */\nexport let current_sources = null;\n\n/** @param {Value} value */\nexport function push_reaction_value(value) {\n\tif (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {\n\t\tif (current_sources === null) {\n\t\t\tcurrent_sources = [value];\n\t\t} else {\n\t\t\tcurrent_sources.push(value);\n\t\t}\n\t}\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nexport let write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\nexport let update_version = read_version;\n\n/** @param {number} value */\nexport function set_update_version(value) {\n\tupdate_version = value;\n}\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function is_dirty(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif (flags & DERIVED) {\n\t\treaction.f &= ~WAS_MARKED;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar length = dependencies.length;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tvar dependency = dependencies[i];\n\n\t\t\t\tif (is_dirty(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t(flags & CONNECTED) !== 0 &&\n\t\t\t// During time traveling we don't want to reset the status so that\n\t\t\t// traversal of the graph in the other batches still happens\n\t\t\tbatch_values === null\n\t\t) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tif (!async_mode_flag && current_sources?.includes(signal)) {\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/** @param {Reaction} reaction */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_sources = current_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar previous_update_version = update_version;\n\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tcurrent_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tupdate_version = ++read_version;\n\n\tif (reaction.ac !== null) {\n\t\twithout_reactive_context(() => {\n\t\t\t/** @type {AbortController} */ (reaction.ac).abort(STALE_REACTION);\n\t\t});\n\n\t\treaction.ac = null;\n\t}\n\n\ttry {\n\t\treaction.f |= REACTION_IS_UPDATING;\n\t\tvar fn = /** @type {Function} */ (reaction.fn);\n\t\tvar result = fn();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (is_updating_effect && effect_tracking() && (reaction.f & CONNECTED) !== 0) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null && previous_reaction !== reaction) {\n\t\t\tread_version++;\n\n\t\t\tif (untracked_writes !== null) {\n\t\t\t\tif (previous_untracked_writes === null) {\n\t\t\t\t\tprevious_untracked_writes = untracked_writes;\n\t\t\t\t} else {\n\t\t\t\t\tprevious_untracked_writes.push(.../** @type {Source[]} */ (untracked_writes));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((reaction.f & ERROR_VALUE) !== 0) {\n\t\t\treaction.f ^= ERROR_VALUE;\n\t\t}\n\n\t\treturn result;\n\t} catch (error) {\n\t\treturn handle_error(error);\n\t} finally {\n\t\treaction.f ^= REACTION_IS_UPDATING;\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tcurrent_sources = previous_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t\tupdate_version = previous_update_version;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected and remove the mark flag, as it cannot be reliably removed otherwise\n\t\tif ((dependency.f & CONNECTED) !== 0) {\n\t\t\tdependency.f ^= CONNECTED;\n\t\t\tdependency.f &= ~WAS_MARKED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t\tvar previous_stack = /** @type {any} */ (dev_stack);\n\t\t// only block effects have a dev stack, keep the current one otherwise\n\t\tset_dev_stack(effect.dev_stack ?? dev_stack);\n\t}\n\n\ttry {\n\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\t// In DEV, increment versions of any sources that were written to during the effect,\n\t\t// so that they are correctly marked as dirty when the effect re-runs\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {\n\t\t\tfor (var dep of effect.deps) {\n\t\t\t\tif (dep.set_during_effect) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.set_during_effect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t\tset_dev_stack(previous_stack);\n\t\t}\n\t}\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise}\n */\nexport async function tick() {\n\tif (async_mode_flag) {\n\t\treturn new Promise((f) => {\n\t\t\t// Race them against each other - in almost all cases requestAnimationFrame will fire first,\n\t\t\t// but e.g. in case the window is not focused or a view transition happens, requestAnimationFrame\n\t\t\t// will be delayed and setTimeout helps us resolve fast enough in that case\n\t\t\trequestAnimationFrame(() => f());\n\t\t\tsetTimeout(() => f());\n\t\t});\n\t}\n\n\tawait Promise.resolve();\n\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,\n * have resolved and the DOM has been updated\n * @returns {Promise}\n * @since 5.36\n */\nexport function settled() {\n\treturn Batch.ensure().settled();\n}\n\n/**\n * @template V\n * @param {Value} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tcaptured_signals?.add(signal);\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\t// if we're in a derived that is being read inside an _async_ derived,\n\t\t// it's possible that the effect was already destroyed. In this case,\n\t\t// we don't add the dependency, because that would create a memory leak\n\t\tvar destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;\n\n\t\tif (!destroyed && !current_sources?.includes(signal)) {\n\t\t\tvar deps = active_reaction.deps;\n\n\t\t\tif ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {\n\t\t\t\t// we're in the effect init/update cycle\n\t\t\t\tif (signal.rv < read_version) {\n\t\t\t\t\tsignal.rv = read_version;\n\n\t\t\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\t\t\tskipped_deps++;\n\t\t\t\t\t} else if (new_deps === null) {\n\t\t\t\t\t\tnew_deps = [signal];\n\t\t\t\t\t} else if (!new_deps.includes(signal)) {\n\t\t\t\t\t\tnew_deps.push(signal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we're adding a dependency outside the init/update cycle\n\t\t\t\t// (i.e. after an `await`)\n\t\t\t\t(active_reaction.deps ??= []).push(signal);\n\n\t\t\t\tvar reactions = signal.reactions;\n\n\t\t\t\tif (reactions === null) {\n\t\t\t\t\tsignal.reactions = [active_reaction];\n\t\t\t\t} else if (!reactions.includes(active_reaction)) {\n\t\t\t\t\treactions.push(active_reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (DEV) {\n\t\t// TODO reinstate this, but make it actually work\n\t\t// if (current_async_effect) {\n\t\t// \tvar tracking = (current_async_effect.f & REACTION_IS_UPDATING) !== 0;\n\t\t// \tvar was_read = current_async_effect.deps?.includes(signal);\n\n\t\t// \tif (!tracking && !untracking && !was_read) {\n\t\t// \t\tw.await_reactivity_loss(/** @type {string} */ (signal.label));\n\n\t\t// \t\tvar trace = get_stack('traced at');\n\t\t// \t\t// eslint-disable-next-line no-console\n\t\t// \t\tif (trace) console.warn(trace);\n\t\t// \t}\n\t\t// }\n\n\t\trecent_async_deriveds.delete(signal);\n\n\t\tif (\n\t\t\ttracing_mode_flag &&\n\t\t\t!untracking &&\n\t\t\ttracing_expressions !== null &&\n\t\t\tactive_reaction !== null &&\n\t\t\ttracing_expressions.reaction === active_reaction\n\t\t) {\n\t\t\t// Used when mapping state between special blocks like `each`\n\t\t\tif (signal.trace) {\n\t\t\t\tsignal.trace();\n\t\t\t} else {\n\t\t\t\tvar trace = get_stack('traced at');\n\n\t\t\t\tif (trace) {\n\t\t\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\t\t\tif (entry === undefined) {\n\t\t\t\t\t\tentry = { traces: [] };\n\t\t\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar last = entry.traces[entry.traces.length - 1];\n\n\t\t\t\t\t// traces can be duplicated, e.g. by `snapshot` invoking both\n\t\t\t\t\t// both `getOwnPropertyDescriptor` and `get` traps at once\n\t\t\t\t\tif (trace.stack !== last?.stack) {\n\t\t\t\t\t\tentry.traces.push(trace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_destroying_effect) {\n\t\tif (old_values.has(signal)) {\n\t\t\treturn old_values.get(signal);\n\t\t}\n\n\t\tif (is_derived) {\n\t\t\tvar derived = /** @type {Derived} */ (signal);\n\n\t\t\tvar value = derived.v;\n\n\t\t\t// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute\n\t\t\t// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)\n\t\t\tif (\n\t\t\t\t((derived.f & CLEAN) === 0 && derived.reactions !== null) ||\n\t\t\t\tdepends_on_old_values(derived)\n\t\t\t) {\n\t\t\t\tvalue = execute_derived(derived);\n\t\t\t}\n\n\t\t\told_values.set(derived, value);\n\n\t\t\treturn value;\n\t\t}\n\t} else if (is_derived && !batch_values?.has(signal)) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (is_dirty(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\n\t\tif (is_updating_effect && effect_tracking() && (derived.f & CONNECTED) === 0) {\n\t\t\treconnect(derived);\n\t\t}\n\t}\n\n\tif (batch_values?.has(signal)) {\n\t\treturn batch_values.get(signal);\n\t}\n\n\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\tthrow signal.v;\n\t}\n\n\treturn signal.v;\n}\n\n/**\n * (Re)connect a disconnected derived, so that it is notified\n * of changes in `mark_reactions`\n * @param {Derived} derived\n */\nfunction reconnect(derived) {\n\tif (derived.deps === null) return;\n\n\tderived.f ^= CONNECTED;\n\n\tfor (const dep of derived.deps) {\n\t\t(dep.reactions ??= []).push(derived);\n\n\t\tif ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {\n\t\t\treconnect(/** @type {Derived} */ (dep));\n\t\t}\n\t}\n}\n\n/** @param {Derived} derived */\nfunction depends_on_old_values(derived) {\n\tif (derived.v === UNINITIALIZED) return true; // we don't know, so assume the worst\n\tif (derived.deps === null) return false;\n\n\tfor (const dep of derived.deps) {\n\t\tif (old_values.has(dep)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && depends_on_old_values(/** @type {Derived} */ (dep))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record} obj\n * @param {Array} keys\n * @returns {Record}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\tfor (var symbol of Object.getOwnPropertySymbols(obj)) {\n\t\tif (Object.propertyIsEnumerable.call(obj, symbol) && !keys.includes(symbol)) {\n\t\t\tresult[symbol] = obj[symbol];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tget,\n\tactive_effect,\n\tupdate_version,\n\tactive_reaction,\n\tset_update_version,\n\tset_active_reaction\n} from './runtime.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport {\n\tstate as source,\n\tset,\n\tincrement,\n\tflush_eager_effects,\n\tset_eager_effects_deferred\n} from './reactivity/sources.js';\nimport { PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { get_stack, tag } from './dev/tracing.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n// TODO move all regexes into shared module?\nconst regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/**\n * @template T\n * @param {T} value\n * @returns {T}\n */\nexport function proxy(value) {\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tvar stack = DEV && tracing_mode_flag ? get_stack('created at') : null;\n\tvar parent_version = update_version;\n\n\t/**\n\t * Executes the proxy in the context of the reaction it was originally created in, if any\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\tvar with_parent = (fn) => {\n\t\tif (update_version === parent_version) {\n\t\t\treturn fn();\n\t\t}\n\n\t\t// child source is being created after the initial proxy —\n\t\t// prevent it from being associated with the current reaction\n\t\tvar reaction = active_reaction;\n\t\tvar version = update_version;\n\n\t\tset_active_reaction(null);\n\t\tset_update_version(parent_version);\n\n\t\tvar result = fn();\n\n\t\tset_active_reaction(reaction);\n\t\tset_update_version(version);\n\n\t\treturn result;\n\t};\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t\tif (DEV) {\n\t\t\tvalue = /** @type {any} */ (inspectable_array(/** @type {any[]} */ (value)));\n\t\t}\n\t}\n\n\t/** Used in dev for $inspect.trace() */\n\tvar path = '';\n\tlet updating = false;\n\t/** @param {string} new_path */\n\tfunction update_path(new_path) {\n\t\tif (updating) return;\n\t\tupdating = true;\n\t\tpath = new_path;\n\n\t\ttag(version, `${path} version`);\n\n\t\t// rename all child sources and child proxies\n\t\tfor (const [prop, source] of sources) {\n\t\t\ttag(source, get_label(path, prop));\n\t\t}\n\t\tupdating = false;\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\t\t\tvar s = sources.get(prop);\n\t\t\tif (s === undefined) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar s = source(descriptor.value, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tif (DEV && typeof prop === 'string') {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tset(s, descriptor.value, true);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tincrement(version);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (DEV && prop === PROXY_PATH_SYMBOL) {\n\t\t\t\treturn update_path;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar p = proxy(exists ? target[prop] : UNINITIALIZED);\n\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = with_parent(() => {\n\t\t\t\t\t\tvar p = has ? proxy(target[prop]) : UNINITIALIZED;\n\t\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create an uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(other_s, get_label(path, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = with_parent(() => source(undefined, stack));\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\tset(s, proxy(value));\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\n\t\t\t\tvar p = with_parent(() => proxy(value));\n\t\t\t\tset(s, p);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {string} path\n * @param {string | symbol} prop\n */\nfunction get_label(path, prop) {\n\tif (typeof prop === 'symbol') return `${path}[Symbol(${prop.description ?? ''})]`;\n\tif (regex_is_valid_identifier.test(prop)) return `${path}.${prop}`;\n\treturn /^\\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\ttry {\n\t\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\t\treturn value[STATE_SYMBOL];\n\t\t}\n\t} catch {\n\t\t// the above if check can throw an error if the value in question\n\t\t// is the contentWindow of an iframe on another domain, in which\n\t\t// case we want to just return the value (because it's definitely\n\t\t// not a proxied value) so we don't break any JavaScript interacting\n\t\t// with that iframe (such as various payment companies client side\n\t\t// JavaScript libraries interacting with their iframes on the same\n\t\t// domain)\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n\nconst ARRAY_MUTATING_METHODS = new Set([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift'\n]);\n\n/**\n * Wrap array mutating methods so $inspect is triggered only once and\n * to prevent logging an array in intermediate state (e.g. with an empty slot)\n * @param {any[]} array\n */\nfunction inspectable_array(array) {\n\treturn new Proxy(array, {\n\t\tget(target, prop, receiver) {\n\t\t\tvar value = Reflect.get(target, prop, receiver);\n\t\t\tif (!ARRAY_MUTATING_METHODS.has(/** @type {string} */ (prop))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @this {any[]}\n\t\t\t * @param {any[]} args\n\t\t\t */\n\t\t\treturn function (...args) {\n\t\t\t\tset_eager_effects_deferred();\n\t\t\t\tvar result = value.apply(this, args);\n\t\t\t\tflush_eager_effects();\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t});\n}\n","import { hydrating } from '../hydration.js';\nimport { clear_text_content, get_first_child } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\n\n/**\n * @param {HTMLElement} dom\n * @param {boolean} value\n * @returns {void}\n */\nexport function autofocus(dom, value) {\n\tif (value) {\n\t\tconst body = document.body;\n\t\tdom.autofocus = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (document.activeElement === body) {\n\t\t\t\tdom.focus();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * The child of a textarea actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLTextAreaElement} dom\n * @returns {void}\n */\nexport function remove_textarea_child(dom) {\n\tif (hydrating && get_first_child(dom) !== null) {\n\t\tclear_text_content(dom);\n\t}\n}\n\nlet listening_to_form_reset = false;\n\nexport function add_form_reset_listener() {\n\tif (!listening_to_form_reset) {\n\t\tlistening_to_form_reset = true;\n\t\tdocument.addEventListener(\n\t\t\t'reset',\n\t\t\t(evt) => {\n\t\t\t\t// Needs to happen one tick later or else the dom properties of the form\n\t\t\t\t// elements have not updated to their reset values yet\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tif (!evt.defaultPrevented) {\n\t\t\t\t\t\tfor (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {\n\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\te.__on_r?.();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)\n\t\t\t{ capture: true }\n\t\t);\n\t}\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function can_delegate_event(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst STATE_CREATION_RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$derived',\n\t'$derived.by'\n]);\n\nconst RUNES = /** @type {const} */ ([\n\t...STATE_CREATION_RUNES,\n\t'$state.eager',\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$effect.pending',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/** @typedef {typeof RUNES[number]} RuneName */\n\n/**\n * @param {string} name\n * @returns {name is RuneName}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RuneName} */ (name));\n}\n\n/** @typedef {typeof STATE_CREATION_RUNES[number]} StateCreationRuneName */\n\n/**\n * @param {string} name\n * @returns {name is StateCreationRuneName}\n */\nexport function is_state_creation_rune(name) {\n\treturn STATE_CREATION_RUNES.includes(/** @type {StateCreationRuneName} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {typeof RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @template {string | undefined} T\n * @param {T} location\n * @returns {T};\n */\nexport function sanitize_location(location) {\n\treturn /** @type {T} */ (location?.replace(/\\//g, '/\\u200b'));\n}\n","import { teardown } from '../../reactivity/effects.js';\nimport { define_property } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tdom.removeAttribute('onload');\n\tdom.removeAttribute('onerror');\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\tif (\n\t\tdom === document.body ||\n\t\t// @ts-ignore\n\t\tdom === window ||\n\t\t// @ts-ignore\n\t\tdom === document ||\n\t\t// Firefox has quirky behavior, it can happen that we still get \"canplay\" events when the element is already removed\n\t\tdom instanceof HTMLMediaElement\n\t) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n// used to store the reference to the currently propagated event\n// to prevent garbage collection between microtasks in Firefox\n// If the event object is GCed too early, the expando __root property\n// set on the event object is lost, causing the event delegation\n// to process the event twice\nlet last_propagated_event = null;\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\tlast_propagated_event = event;\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// the `last_propagated_event === event` check is redundant, but\n\t// without it the variable will be DCE'd and things will\n\t// fail mysteriously in Firefox\n\t// @ts-expect-error is added below\n\tvar handled_at = last_propagated_event === event && event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated != null &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler !== 'function' && (has_side_effects || handler != null || error)) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\t\tconst phase = args[0]?.eventPhase < Event.BUBBLING_PHASE ? 'capture' : '';\n\t\tconst event_name = args[0]?.type + phase;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\thandler?.apply(element, args);\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html.replaceAll('', ''); // XHTML compliance\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { TemplateStructure } from './types' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport {\n\tcreate_text,\n\tget_first_child,\n\tis_firefox,\n\tcreate_element,\n\tcreate_fragment,\n\tcreate_comment,\n\tset_attribute\n} from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport {\n\tNAMESPACE_MATHML,\n\tNAMESPACE_SVG,\n\tTEMPLATE_FRAGMENT,\n\tTEMPLATE_USE_IMPORT_NODE,\n\tTEMPLATE_USE_MATHML,\n\tTEMPLATE_USE_SVG\n} from '../../../constants.js';\nimport { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, EFFECT_RAN, TEXT_NODE } from '#client/constants';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_html(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction from_namespace(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '' + content}`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_svg(content, flags) {\n\treturn from_namespace(content, flags, 'svg');\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_mathml(content, flags) {\n\treturn from_namespace(content, flags, 'math');\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {typeof NAMESPACE_SVG | typeof NAMESPACE_MATHML | undefined} [ns]\n */\nfunction fragment_from_tree(structure, ns) {\n\tvar fragment = create_fragment();\n\n\tfor (var item of structure) {\n\t\tif (typeof item === 'string') {\n\t\t\tfragment.append(create_text(item));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if `preserveComments === true`, comments are represented as `['// ']`\n\t\tif (item === undefined || item[0][0] === '/') {\n\t\t\tfragment.append(create_comment(item ? item[0].slice(3) : ''));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [name, attributes, ...children] = item;\n\n\t\tconst namespace = name === 'svg' ? NAMESPACE_SVG : name === 'math' ? NAMESPACE_MATHML : ns;\n\n\t\tvar element = create_element(name, namespace, attributes?.is);\n\n\t\tfor (var key in attributes) {\n\t\t\tset_attribute(element, key, attributes[key]);\n\t\t}\n\n\t\tif (children.length > 0) {\n\t\t\tvar target =\n\t\t\t\telement.tagName === 'TEMPLATE'\n\t\t\t\t\t? /** @type {HTMLTemplateElement} */ (element).content\n\t\t\t\t\t: element;\n\n\t\t\ttarget.append(\n\t\t\t\tfragment_from_tree(children, element.tagName === 'foreignObject' ? undefined : namespace)\n\t\t\t);\n\t\t}\n\n\t\tfragment.append(element);\n\t}\n\n\treturn fragment;\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_tree(structure, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tconst ns =\n\t\t\t\t(flags & TEMPLATE_USE_SVG) !== 0\n\t\t\t\t\t? NAMESPACE_SVG\n\t\t\t\t\t: (flags & TEMPLATE_USE_MATHML) !== 0\n\t\t\t\t\t\t? NAMESPACE_MATHML\n\t\t\t\t\t\t: undefined;\n\n\t\t\tnode = fragment_from_tree(structure, ns);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {() => Element | DocumentFragment} fn\n */\nexport function with_script(fn) {\n\treturn () => run_scripts(fn());\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== TEXT_NODE) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\n/**\n * @returns {TemplateNode | DocumentFragment}\n */\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\tvar effect = /** @type {Effect} */ (active_effect);\n\t\t// When hydrating and outer component and an inner component is async, i.e. blocked on a promise,\n\t\t// then by the time the inner resolves we have already advanced to the end of the hydrated nodes\n\t\t// of the parent component. Check for defined for that reason to avoid rewinding the parent's end marker.\n\t\tif ((effect.f & EFFECT_RAN) === 0 || effect.nodes_end === null) {\n\t\t\teffect.nodes_end = hydrate_node;\n\t\t}\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\thydrate_node.textContent?.startsWith(`$`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root } from './reactivity/effects.js';\nimport { hydrate_node, hydrating, set_hydrate_node, set_hydrating } from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\nimport { COMMENT_NODE, STATE_SYMBOL } from './constants.js';\nimport { boundary } from './dom/blocks/boundary.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\t// re-throw Svelte errors - they are certainly not related to hydration\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.split('\\n').some((line) => line.startsWith('https://svelte.dev/e/'))\n\t\t) {\n\t\t\tthrow error;\n\t\t}\n\t\tif (error !== HYDRATION_ERROR) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('Failed to hydrate: ', error);\n\t\t}\n\n\t\tif (options.recover === false) {\n\t\t\te.hydration_failed();\n\t\t}\n\n\t\t// If an error occurred above, the operations might not yet have been initialised.\n\t\tinit_operations();\n\t\tclear_text_content(target);\n\n\t\tset_hydrating(false);\n\t\treturn mount(component, options);\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t}\n}\n\n/** @type {Map} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record} Exports\n * @param {ComponentType> | Component} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\t/** @type {Set} */\n\tvar registered_events = new Set();\n\n\t/** @param {Array} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tboundary(\n\t\t\t/** @type {TemplateNode} */ (anchor_node),\n\t\t\t{\n\t\t\t\tpending: () => {}\n\t\t\t},\n\t\t\t(anchor_node) => {\n\t\t\t\tif (context) {\n\t\t\t\t\tpush({});\n\t\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\t\tctx.c = context;\n\t\t\t\t}\n\n\t\t\t\tif (events) {\n\t\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t\t}\n\n\t\t\t\tif (hydrating) {\n\t\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t\t}\n\n\t\t\t\tshould_intro = intro;\n\t\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\t\tshould_intro = true;\n\n\t\t\t\tif (hydrating) {\n\t\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\thydrate_node === null ||\n\t\t\t\t\t\thydrate_node.nodeType !== COMMENT_NODE ||\n\t\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t\t\t\t) {\n\t\t\t\t\t\tw.hydration_mismatch();\n\t\t\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (context) {\n\t\t\t\t\tpop();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tif (STATE_SYMBOL in component) {\n\t\t\tw.state_proxy_unmount();\n\t\t} else {\n\t\t\tw.lifecycle_double_unmount();\n\t\t}\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { Batch, current_batch } from '../../reactivity/batch.js';\nimport {\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { hydrate_node, hydrating } from '../hydration.js';\nimport { create_text, should_defer_append } from '../operations.js';\n\n/**\n * @typedef {{ effect: Effect, fragment: DocumentFragment }} Branch\n */\n\n/**\n * @template Key\n */\nexport class BranchManager {\n\t/** @type {TemplateNode} */\n\tanchor;\n\n\t/** @type {Map} */\n\t#batches = new Map();\n\n\t/**\n\t * Map of keys to effects that are currently rendered in the DOM.\n\t * These effects are visible and actively part of the document tree.\n\t * Example:\n\t * ```\n\t * {#if condition}\n\t * \tfoo\n\t * {:else}\n\t * \tbar\n\t * {/if}\n\t * ```\n\t * Can result in the entries `true->Effect` and `false->Effect`\n\t * @type {Map}\n\t */\n\t#onscreen = new Map();\n\n\t/**\n\t * Similar to #onscreen with respect to the keys, but contains branches that are not yet\n\t * in the DOM, because their insertion is deferred.\n\t * @type {Map}\n\t */\n\t#offscreen = new Map();\n\n\t/**\n\t * Keys of effects that are currently outroing\n\t * @type {Set}\n\t */\n\t#outroing = new Set();\n\n\t/**\n\t * Whether to pause (i.e. outro) on change, or destroy immediately.\n\t * This is necessary for ``\n\t */\n\t#transition = true;\n\n\t/**\n\t * @param {TemplateNode} anchor\n\t * @param {boolean} transition\n\t */\n\tconstructor(anchor, transition = true) {\n\t\tthis.anchor = anchor;\n\t\tthis.#transition = transition;\n\t}\n\n\t#commit = () => {\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t// if this batch was made obsolete, bail\n\t\tif (!this.#batches.has(batch)) return;\n\n\t\tvar key = /** @type {Key} */ (this.#batches.get(batch));\n\n\t\tvar onscreen = this.#onscreen.get(key);\n\n\t\tif (onscreen) {\n\t\t\t// effect is already in the DOM — abort any current outro\n\t\t\tresume_effect(onscreen);\n\t\t\tthis.#outroing.delete(key);\n\t\t} else {\n\t\t\t// effect is currently offscreen. put it in the DOM\n\t\t\tvar offscreen = this.#offscreen.get(key);\n\n\t\t\tif (offscreen) {\n\t\t\t\tthis.#onscreen.set(key, offscreen.effect);\n\t\t\t\tthis.#offscreen.delete(key);\n\n\t\t\t\t// remove the anchor...\n\t\t\t\t/** @type {TemplateNode} */ (offscreen.fragment.lastChild).remove();\n\n\t\t\t\t// ...and append the fragment\n\t\t\t\tthis.anchor.before(offscreen.fragment);\n\t\t\t\tonscreen = offscreen.effect;\n\t\t\t}\n\t\t}\n\n\t\tfor (const [b, k] of this.#batches) {\n\t\t\tthis.#batches.delete(b);\n\n\t\t\tif (b === batch) {\n\t\t\t\t// keep values for newer batches\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst offscreen = this.#offscreen.get(k);\n\n\t\t\tif (offscreen) {\n\t\t\t\t// for older batches, destroy offscreen effects\n\t\t\t\t// as they will never be committed\n\t\t\t\tdestroy_effect(offscreen.effect);\n\t\t\t\tthis.#offscreen.delete(k);\n\t\t\t}\n\t\t}\n\n\t\t// outro/destroy all onscreen effects...\n\t\tfor (const [k, effect] of this.#onscreen) {\n\t\t\t// ...except the one that was just committed\n\t\t\t// or those that are already outroing (else the transition is aborted and the effect destroyed right away)\n\t\t\tif (k === key || this.#outroing.has(k)) continue;\n\n\t\t\tconst on_destroy = () => {\n\t\t\t\tconst keys = Array.from(this.#batches.values());\n\n\t\t\t\tif (keys.includes(k)) {\n\t\t\t\t\t// keep the effect offscreen, as another batch will need it\n\t\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\t\tmove_effect(effect, fragment);\n\n\t\t\t\t\tfragment.append(create_text()); // TODO can we avoid this?\n\n\t\t\t\t\tthis.#offscreen.set(k, { effect, fragment });\n\t\t\t\t} else {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t}\n\n\t\t\t\tthis.#outroing.delete(k);\n\t\t\t\tthis.#onscreen.delete(k);\n\t\t\t};\n\n\t\t\tif (this.#transition || !onscreen) {\n\t\t\t\tthis.#outroing.add(k);\n\t\t\t\tpause_effect(effect, on_destroy, false);\n\t\t\t} else {\n\t\t\t\ton_destroy();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\t#discard = (batch) => {\n\t\tthis.#batches.delete(batch);\n\n\t\tconst keys = Array.from(this.#batches.values());\n\n\t\tfor (const [k, branch] of this.#offscreen) {\n\t\t\tif (!keys.includes(k)) {\n\t\t\t\tdestroy_effect(branch.effect);\n\t\t\t\tthis.#offscreen.delete(k);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t *\n\t * @param {any} key\n\t * @param {null | ((target: TemplateNode) => void)} fn\n\t */\n\tensure(key, fn) {\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar defer = should_defer_append();\n\n\t\tif (fn && !this.#onscreen.has(key) && !this.#offscreen.has(key)) {\n\t\t\tif (defer) {\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tvar target = create_text();\n\n\t\t\t\tfragment.append(target);\n\n\t\t\t\tthis.#offscreen.set(key, {\n\t\t\t\t\teffect: branch(() => fn(target)),\n\t\t\t\t\tfragment\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.#onscreen.set(\n\t\t\t\t\tkey,\n\t\t\t\t\tbranch(() => fn(this.anchor))\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.#batches.set(batch, key);\n\n\t\tif (defer) {\n\t\t\tfor (const [k, effect] of this.#onscreen) {\n\t\t\t\tif (k === key) {\n\t\t\t\t\tbatch.skipped_effects.delete(effect);\n\t\t\t\t} else {\n\t\t\t\t\tbatch.skipped_effects.add(effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const [k, branch] of this.#offscreen) {\n\t\t\t\tif (k === key) {\n\t\t\t\t\tbatch.skipped_effects.delete(branch.effect);\n\t\t\t\t} else {\n\t\t\t\t\tbatch.skipped_effects.add(branch.effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch.oncommit(this.#commit);\n\t\t\tbatch.ondiscard(this.#discard);\n\t\t} else {\n\t\t\tif (hydrating) {\n\t\t\t\tthis.anchor = hydrate_node;\n\t\t\t}\n\n\t\t\tthis.#commit();\n\t\t}\n\t}\n}\n","/** @import { TemplateNode } from '#client' */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport {\n\thydrate_next,\n\thydrating,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block } from '../../reactivity/effects.js';\nimport { HYDRATION_START_ELSE } from '../../../../constants.js';\nimport { BranchManager } from './branches.js';\n\n// TODO reinstate https://github.com/sveltejs/svelte/pull/15250\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, flag?: boolean) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar branches = new BranchManager(node);\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\t/**\n\t * @param {boolean} condition,\n\t * @param {null | ((anchor: Node) => void)} fn\n\t */\n\tfunction update_branch(condition, fn) {\n\t\tif (hydrating) {\n\t\t\tconst is_else = read_hydration_instruction(node) === HYDRATION_START_ELSE;\n\n\t\t\tif (condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tvar anchor = skip_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tbranches.anchor = anchor;\n\n\t\t\t\tset_hydrating(false);\n\t\t\t\tbranches.ensure(condition, fn);\n\t\t\t\tset_hydrating(true);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tbranches.ensure(condition, fn);\n\t}\n\n\tblock(() => {\n\t\tvar has_branch = false;\n\n\t\tfn((fn, flag = true) => {\n\t\t\thas_branch = true;\n\t\t\tupdate_branch(flag, fn);\n\t\t});\n\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(false, null);\n\t\t}\n\t}, flags);\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { block, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { prevent_snippet_stringification } from '../../../shared/validate.js';\nimport { BranchManager } from './branches.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar branches = new BranchManager(node);\n\n\tblock(() => {\n\t\tconst snippet = get_snippet() ?? null;\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tbranches.ensure(snippet, snippet && ((anchor) => snippet(anchor, ...args)));\n\t}, EFFECT_TRANSPARENT);\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\tconst snippet = (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n\n\tprevent_snippet_stringification(snippet);\n\n\treturn snippet;\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== ELEMENT_NODE)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t` should be rendered as `
` and _not_\n * `
`, which is equivalent to `
`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\t// attribute hidden for values other than \"until-found\" behaves like a boolean attribute\n\tif (name === 'hidden' && value !== 'until-found') {\n\t\tis_boolean = true;\n\t}\n\tif (value == null || (!value && is_boolean)) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n\n/**\n *\n * @param {Record} styles\n * @param {boolean} important\n */\nfunction append_styles(styles, important = false) {\n\tvar separator = important ? ' !important;' : ';';\n\tvar css = '';\n\n\tfor (var key in styles) {\n\t\tvar value = styles[key];\n\t\tif (value != null && value !== '') {\n\t\t\tcss += ' ' + key + ': ' + value + separator;\n\t\t}\n\t}\n\n\treturn css;\n}\n\n/**\n * @param {string} name\n * @returns {string}\n */\nfunction to_css_name(name) {\n\tif (name[0] !== '-' || name[1] !== '-') {\n\t\treturn name.toLowerCase();\n\t}\n\treturn name;\n}\n\n/**\n * @param {any} value\n * @param {Record | [Record, Record]} [styles]\n * @returns {string | null}\n */\nexport function to_style(value, styles) {\n\tif (styles) {\n\t\tvar new_style = '';\n\n\t\t/** @type {Record | undefined} */\n\t\tvar normal_styles;\n\n\t\t/** @type {Record | undefined} */\n\t\tvar important_styles;\n\n\t\tif (Array.isArray(styles)) {\n\t\t\tnormal_styles = styles[0];\n\t\t\timportant_styles = styles[1];\n\t\t} else {\n\t\t\tnormal_styles = styles;\n\t\t}\n\n\t\tif (value) {\n\t\t\tvalue = String(value)\n\t\t\t\t.replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g, '')\n\t\t\t\t.trim();\n\n\t\t\t/** @type {boolean | '\"' | \"'\"} */\n\t\t\tvar in_str = false;\n\t\t\tvar in_apo = 0;\n\t\t\tvar in_comment = false;\n\n\t\t\tvar reserved_names = [];\n\n\t\t\tif (normal_styles) {\n\t\t\t\treserved_names.push(...Object.keys(normal_styles).map(to_css_name));\n\t\t\t}\n\t\t\tif (important_styles) {\n\t\t\t\treserved_names.push(...Object.keys(important_styles).map(to_css_name));\n\t\t\t}\n\n\t\t\tvar start_index = 0;\n\t\t\tvar name_index = -1;\n\n\t\t\tconst len = value.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar c = value[i];\n\n\t\t\t\tif (in_comment) {\n\t\t\t\t\tif (c === '/' && value[i - 1] === '*') {\n\t\t\t\t\t\tin_comment = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (in_str) {\n\t\t\t\t\tif (in_str === c) {\n\t\t\t\t\t\tin_str = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (c === '/' && value[i + 1] === '*') {\n\t\t\t\t\tin_comment = true;\n\t\t\t\t} else if (c === '\"' || c === \"'\") {\n\t\t\t\t\tin_str = c;\n\t\t\t\t} else if (c === '(') {\n\t\t\t\t\tin_apo++;\n\t\t\t\t} else if (c === ')') {\n\t\t\t\t\tin_apo--;\n\t\t\t\t}\n\n\t\t\t\tif (!in_comment && in_str === false && in_apo === 0) {\n\t\t\t\t\tif (c === ':' && name_index === -1) {\n\t\t\t\t\t\tname_index = i;\n\t\t\t\t\t} else if (c === ';' || i === len - 1) {\n\t\t\t\t\t\tif (name_index !== -1) {\n\t\t\t\t\t\t\tvar name = to_css_name(value.substring(start_index, name_index).trim());\n\n\t\t\t\t\t\t\tif (!reserved_names.includes(name)) {\n\t\t\t\t\t\t\t\tif (c !== ';') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar property = value.substring(start_index, i).trim();\n\t\t\t\t\t\t\t\tnew_style += ' ' + property + ';';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart_index = i + 1;\n\t\t\t\t\t\tname_index = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (normal_styles) {\n\t\t\tnew_style += append_styles(normal_styles);\n\t\t}\n\n\t\tif (important_styles) {\n\t\t\tnew_style += append_styles(important_styles, true);\n\t\t}\n\n\t\tnew_style = new_style.trim();\n\t\treturn new_style === '' ? null : new_style;\n\t}\n\n\treturn value == null ? null : String(value);\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record} [prev_classes]\n * @param {Record} [next_classes]\n * @returns {Record | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (\n\t\thydrating ||\n\t\tprev !== value ||\n\t\tprev === undefined // for edge case of `class={undefined}`\n\t) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes && prev_classes !== next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { to_style } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {Record} prev\n * @param {Record} next\n * @param {string} [priority]\n */\nfunction update_styles(dom, prev = {}, next, priority) {\n\tfor (var key in next) {\n\t\tvar value = next[key];\n\n\t\tif (prev[key] !== value) {\n\t\t\tif (next[key] == null) {\n\t\t\t\tdom.style.removeProperty(key);\n\t\t\t} else {\n\t\t\t\tdom.style.setProperty(key, value, priority);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {string | null} value\n * @param {Record | [Record, Record]} [prev_styles]\n * @param {Record | [Record, Record]} [next_styles]\n */\nexport function set_style(dom, value, prev_styles, next_styles) {\n\t// @ts-expect-error\n\tvar prev = dom.__style;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_style_attr = to_style(value, next_styles);\n\n\t\tif (!hydrating || next_style_attr !== dom.getAttribute('style')) {\n\t\t\tif (next_style_attr == null) {\n\t\t\t\tdom.removeAttribute('style');\n\t\t\t} else {\n\t\t\t\tdom.style.cssText = next_style_attr;\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error\n\t\tdom.__style = value;\n\t} else if (next_styles) {\n\t\tif (Array.isArray(next_styles)) {\n\t\t\tupdate_styles(dom, prev_styles?.[0], next_styles[0]);\n\t\t\tupdate_styles(dom, prev_styles?.[1], next_styles[1], 'important');\n\t\t} else {\n\t\t\tupdate_styles(dom, prev_styles, next_styles);\n\t\t}\n\t}\n\n\treturn next_styles;\n}\n","import { effect, teardown } from '../../../reactivity/effects.js';\nimport { listen_to_event_and_reset_event } from './shared.js';\nimport { is } from '../../../proxy.js';\nimport { is_array } from '../../../../shared/utils.js';\nimport * as w from '../../../warnings.js';\nimport { Batch, current_batch, previous_batch } from '../../../reactivity/batch.js';\n\n/**\n * Selects the correct option(s) (depending on whether this is a multiple select)\n * @template V\n * @param {HTMLSelectElement} select\n * @param {V} value\n * @param {boolean} mounting\n */\nexport function select_option(select, value, mounting = false) {\n\tif (select.multiple) {\n\t\t// If value is null or undefined, keep the selection as is\n\t\tif (value == undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not an array, warn and keep the selection as is\n\t\tif (!is_array(value)) {\n\t\t\treturn w.select_multiple_invalid_value();\n\t\t}\n\n\t\t// Otherwise, update the selection\n\t\tfor (var option of select.options) {\n\t\t\toption.selected = value.includes(get_option_value(option));\n\t\t}\n\n\t\treturn;\n\t}\n\n\tfor (option of select.options) {\n\t\tvar option_value = get_option_value(option);\n\t\tif (is(option_value, value)) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * Selects the correct option(s) if `value` is given,\n * and then sets up a mutation observer to sync the\n * current selection to the dom when it changes. Such\n * changes could for example occur when options are\n * inside an `#each` block.\n * @param {HTMLSelectElement} select\n */\nexport function init_select(select) {\n\tvar observer = new MutationObserver(() => {\n\t\t// @ts-ignore\n\t\tselect_option(select, select.__value);\n\t\t// Deliberately don't update the potential binding value,\n\t\t// the model should be preserved unless explicitly changed\n\t});\n\n\tobserver.observe(select, {\n\t\t// Listen to option element changes\n\t\tchildList: true,\n\t\tsubtree: true, // because of \n\t\t// Listen to option element value attribute changes\n\t\t// (doesn't get notified of select value changes,\n\t\t// because that property is not reflected as an attribute)\n\t\tattributes: true,\n\t\tattributeFilter: ['value']\n\t});\n\n\tteardown(() => {\n\t\tobserver.disconnect();\n\t});\n}\n\n/**\n * @param {HTMLSelectElement} select\n * @param {() => unknown} get\n * @param {(value: unknown) => void} set\n * @returns {void}\n */\nexport function bind_select_value(select, get, set = get) {\n\tvar batches = new WeakSet();\n\tvar mounting = true;\n\n\tlisten_to_event_and_reset_event(select, 'change', (is_reset) => {\n\t\tvar query = is_reset ? '[selected]' : ':checked';\n\t\t/** @type {unknown} */\n\t\tvar value;\n\n\t\tif (select.multiple) {\n\t\t\tvalue = [].map.call(select.querySelectorAll(query), get_option_value);\n\t\t} else {\n\t\t\t/** @type {HTMLOptionElement | null} */\n\t\t\tvar selected_option =\n\t\t\t\tselect.querySelector(query) ??\n\t\t\t\t// will fall back to first non-disabled option if no option is selected\n\t\t\t\tselect.querySelector('option:not([disabled])');\n\t\t\tvalue = selected_option && get_option_value(selected_option);\n\t\t}\n\n\t\tset(value);\n\n\t\tif (current_batch !== null) {\n\t\t\tbatches.add(current_batch);\n\t\t}\n\t});\n\n\t// Needs to be an effect, not a render_effect, so that in case of each loops the logic runs after the each block has updated\n\teffect(() => {\n\t\tvar value = get();\n\n\t\tif (select === document.activeElement) {\n\t\t\t// we need both, because in non-async mode, render effects run before previous_batch is set\n\t\t\tvar batch = /** @type {Batch} */ (previous_batch ?? current_batch);\n\n\t\t\t// Don't update the ...\n\t\t\t//

{await find(selected)}

\n\t\t\tif (batches.has(batch)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tselect_option(select, value, mounting);\n\n\t\t// Mounting and value undefined -> take selection from dom\n\t\tif (mounting && value === undefined) {\n\t\t\t/** @type {HTMLOptionElement | null} */\n\t\t\tvar selected_option = select.querySelector(':checked');\n\t\t\tif (selected_option !== null) {\n\t\t\t\tvalue = get_option_value(selected_option);\n\t\t\t\tset(value);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-ignore\n\t\tselect.__value = value;\n\t\tmounting = false;\n\t});\n\n\tinit_select(select);\n}\n\n/** @param {HTMLOptionElement} option */\nfunction get_option_value(option) {\n\t// __value only exists if the