@nyaruka/temba-components 0.102.2 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/temba-components.js +137 -35
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/contacts/ContactChat.js +1 -1
- package/out-tsc/src/contacts/ContactChat.js.map +1 -1
- package/out-tsc/src/contacts/ContactFields.js +5 -0
- package/out-tsc/src/contacts/ContactFields.js.map +1 -1
- package/out-tsc/src/contacts/ContactNotepad.js +129 -0
- package/out-tsc/src/contacts/ContactNotepad.js.map +1 -0
- package/out-tsc/src/contacts/ContactPending.js +7 -2
- package/out-tsc/src/contacts/ContactPending.js.map +1 -1
- package/out-tsc/src/contacts/ContactStoreElement.js +11 -2
- package/out-tsc/src/contacts/ContactStoreElement.js.map +1 -1
- package/out-tsc/src/contacts/ContactTickets.js +7 -2
- package/out-tsc/src/contacts/ContactTickets.js.map +1 -1
- package/out-tsc/src/contacts/helpers.js +3 -0
- package/out-tsc/src/contacts/helpers.js.map +1 -1
- package/out-tsc/src/fields/FieldManager.js +2 -2
- package/out-tsc/src/fields/FieldManager.js.map +1 -1
- package/out-tsc/src/flow/FlowStoreElement.js +2 -2
- package/out-tsc/src/flow/FlowStoreElement.js.map +1 -1
- package/out-tsc/src/interfaces.js +1 -0
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/list/TembaMenu.js +10 -0
- package/out-tsc/src/list/TembaMenu.js.map +1 -1
- package/out-tsc/src/store/{StoreElement.js → EndpointMonitorElement.js} +5 -5
- package/out-tsc/src/store/EndpointMonitorElement.js.map +1 -0
- package/out-tsc/src/store/Store.js +22 -0
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/store/StoreMonitorElement.js +22 -0
- package/out-tsc/src/store/StoreMonitorElement.js.map +1 -1
- package/out-tsc/src/tabpane/Tab.js +33 -0
- package/out-tsc/src/tabpane/Tab.js.map +1 -1
- package/out-tsc/src/tabpane/TabPane.js +53 -15
- package/out-tsc/src/tabpane/TabPane.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +1 -0
- package/out-tsc/src/vectoricon/index.js.map +1 -1
- package/out-tsc/temba-modules.js +2 -0
- package/out-tsc/temba-modules.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/compose/attachments-and-send-button.png +0 -0
- package/screenshots/truth/compose/attachments-no-send-button.png +0 -0
- package/screenshots/truth/compose/attachments-with-all-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/attachments-with-all-files.png +0 -0
- package/screenshots/truth/compose/attachments-with-failure-files.png +0 -0
- package/screenshots/truth/compose/attachments-with-success-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/attachments-with-success-files.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-no-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-attachments-no-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-no-counter-and-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-no-counter-no-send-button.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-failure-files.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-spaces.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-and-url.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-no-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-failure-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-click-send.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-hit-enter.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text-no-spaces.png +0 -0
- package/screenshots/truth/compose/chatbox-with-text.png +0 -0
- package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
- package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
- package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
- package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
- package/screenshots/truth/contacts/contact-active-default.png +0 -0
- package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
- package/src/contacts/ContactChat.ts +1 -2
- package/src/contacts/ContactFields.ts +7 -0
- package/src/contacts/ContactNotepad.ts +133 -0
- package/src/contacts/ContactPending.ts +8 -2
- package/src/contacts/ContactStoreElement.ts +12 -2
- package/src/contacts/ContactTickets.ts +9 -2
- package/src/contacts/helpers.ts +5 -1
- package/src/fields/FieldManager.ts +2 -2
- package/src/flow/FlowStoreElement.ts +2 -2
- package/src/interfaces.ts +13 -1
- package/src/list/TembaMenu.ts +12 -0
- package/src/store/{StoreElement.ts → EndpointMonitorElement.ts} +1 -4
- package/src/store/Store.ts +31 -0
- package/src/store/StoreMonitorElement.ts +24 -0
- package/src/tabpane/Tab.ts +29 -0
- package/src/tabpane/TabPane.ts +54 -15
- package/src/vectoricon/index.ts +1 -0
- package/temba-modules.ts +2 -0
- package/out-tsc/src/store/StoreElement.js.map +0 -1
- package/screenshots/truth/contacts/history.png +0 -0
package/dist/temba-components.js
CHANGED
|
@@ -58,7 +58,7 @@ let lt=class extends w{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
58
58
|
* @license
|
|
59
59
|
* Copyright 2017 Google LLC
|
|
60
60
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
61
|
-
*/function ge(t){return(e,i)=>"object"==typeof i?me(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}class fe extends ue{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}fe.formAssociated=!0,t([ge({type:String})],fe.prototype,"name",void 0),t([ge({type:String,attribute:"help_text"})],fe.prototype,"helpText",void 0),t([ge({type:Boolean,attribute:"help_always"})],fe.prototype,"helpAlways",void 0),t([ge({type:Boolean,attribute:"widget_only"})],fe.prototype,"widgetOnly",void 0),t([ge({type:Boolean,attribute:"hide_label"})],fe.prototype,"hideLabel",void 0),t([ge({type:String})],fe.prototype,"label",void 0),t([ge({type:Array})],fe.prototype,"errors",void 0),t([ge({type:String})],fe.prototype,"value",void 0),t([ge({attribute:!1})],fe.prototype,"inputRoot",void 0),t([ge({type:Boolean})],fe.prototype,"disabled",void 0);var ve;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add="plus",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.branding="brush-02",t.branding_hostname="server-05",t.branding_notifications="mail-01",t.branding_styling="palette",t.branding_raw="pencil-01",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.close="x",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_export="download-cloud-01",t.contact_import="upload-cloud-01",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.definitions_export="download-cloud-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.export="download-cloud-01",t.expressions="at-sign",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_exclude="users-x",t.group_include="users-check",t.group_smart="atom-01",t.help="help-circle",t.hide="eye-off",t.home="settings-02",t.image="image-01",t.import="upload-cloud-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.integrations="layers-three-01",t.info="user-square",t.issue="alert-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.message_export="download-cloud-01",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notification="bell-01",t.number="hash-01",t.optin_requested="message-notification-circle",t.optin="message-check-circle",t.optout="message-x-circle",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.quick_replies="dotpoints-01",t.recording="microphone-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.results_export="download-cloud-01",t.retry="refresh-cw-05",t.revisions="clock-rewind",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.send="send-03",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.show="eye",t.simulator="phone-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.submit="check",t.success="check",t.template_approved="check-circle",t.template_pending="hourglass-01",t.template_rejected="alert-circle",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_export="download-cloud-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.trigger_keyword="message-check-square",t.trigger_catch_all="message-question-square",t.trigger_inbound_call="phone-incoming-01",t.trigger_missed_call="phone-hang-up",t.trigger_schedule="calendar",t.trigger_new_conversation="message-chat-square",t.trigger_referral="user-right-01",t.trigger_closed_ticket="agent",t.trigger_opt_in="message-check-circle",t.trigger_opt_out="message-x-circle",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.upload_image="camera-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.video="video-recorder",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.channel_a="channel-android",t.channel_ac="zap",t.channel_at="zap",t.channel_bs="zap",t.channel_bw="zap",t.channel_cs="zap",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_d3c="channel-whatsapp",t.channel_da="zap",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_hm="zap",t.channel_ib="zap",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mt="channel-mtarget",t.channel_mtn="zap",t.channel_nx="channel-vonage",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sq="zap",t.channel_st="zap",t.channel_sw="channel-signalwire",t.channel_t="channel-twilio",t.channel_tg="channel-telegram",t.channel_tms="channel-twilio",t.channel_tq="channel-thinq",t.channel_tw="zap",t.channel_twa="channel-whatsapp",t.channel_twc="zap",t.channel_twt="channel-twitter",t.channel_vk="channel-vk",t.channel_vp="channel-viber",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_wc="channel-wechat",t.channel_yo="zap",t.channel_zvw="channel-whatsapp",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ve||(ve={}));class be extends fe{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
|
|
61
|
+
*/function ge(t){return(e,i)=>"object"==typeof i?me(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}class fe extends ue{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}fe.formAssociated=!0,t([ge({type:String})],fe.prototype,"name",void 0),t([ge({type:String,attribute:"help_text"})],fe.prototype,"helpText",void 0),t([ge({type:Boolean,attribute:"help_always"})],fe.prototype,"helpAlways",void 0),t([ge({type:Boolean,attribute:"widget_only"})],fe.prototype,"widgetOnly",void 0),t([ge({type:Boolean,attribute:"hide_label"})],fe.prototype,"hideLabel",void 0),t([ge({type:String})],fe.prototype,"label",void 0),t([ge({type:Array})],fe.prototype,"errors",void 0),t([ge({type:String})],fe.prototype,"value",void 0),t([ge({attribute:!1})],fe.prototype,"inputRoot",void 0),t([ge({type:Boolean})],fe.prototype,"disabled",void 0);var ve;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add="plus",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.branding="brush-02",t.branding_hostname="server-05",t.branding_notifications="mail-01",t.branding_styling="palette",t.branding_raw="pencil-01",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.close="x",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_export="download-cloud-01",t.contact_import="upload-cloud-01",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.definitions_export="download-cloud-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.export="download-cloud-01",t.expressions="at-sign",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_exclude="users-x",t.group_include="users-check",t.group_smart="atom-01",t.help="help-circle",t.hide="eye-off",t.home="settings-02",t.image="image-01",t.import="upload-cloud-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.integrations="layers-three-01",t.info="user-square",t.issue="alert-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.message_export="download-cloud-01",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notes="edit-03",t.notification="bell-01",t.number="hash-01",t.optin_requested="message-notification-circle",t.optin="message-check-circle",t.optout="message-x-circle",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.quick_replies="dotpoints-01",t.recording="microphone-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.results_export="download-cloud-01",t.retry="refresh-cw-05",t.revisions="clock-rewind",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.send="send-03",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.show="eye",t.simulator="phone-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.submit="check",t.success="check",t.template_approved="check-circle",t.template_pending="hourglass-01",t.template_rejected="alert-circle",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_export="download-cloud-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.trigger_keyword="message-check-square",t.trigger_catch_all="message-question-square",t.trigger_inbound_call="phone-incoming-01",t.trigger_missed_call="phone-hang-up",t.trigger_schedule="calendar",t.trigger_new_conversation="message-chat-square",t.trigger_referral="user-right-01",t.trigger_closed_ticket="agent",t.trigger_opt_in="message-check-circle",t.trigger_opt_out="message-x-circle",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.upload_image="camera-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.video="video-recorder",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.channel_a="channel-android",t.channel_ac="zap",t.channel_at="zap",t.channel_bs="zap",t.channel_bw="zap",t.channel_cs="zap",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_d3c="channel-whatsapp",t.channel_da="zap",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_hm="zap",t.channel_ib="zap",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mt="channel-mtarget",t.channel_mtn="zap",t.channel_nx="channel-vonage",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sq="zap",t.channel_st="zap",t.channel_sw="channel-signalwire",t.channel_t="channel-twilio",t.channel_tg="channel-telegram",t.channel_tms="channel-twilio",t.channel_tq="channel-thinq",t.channel_tw="zap",t.channel_twa="channel-whatsapp",t.channel_twc="zap",t.channel_twt="channel-twitter",t.channel_vk="channel-vk",t.channel_vp="channel-viber",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_wc="channel-wechat",t.channel_yo="zap",t.channel_zvw="channel-whatsapp",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ve||(ve={}));class be extends fe{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
|
|
62
62
|
:host {
|
|
63
63
|
color: var(--color-text);
|
|
64
64
|
display: inline-block;
|
|
@@ -315,7 +315,7 @@ const ye=t=>t??H
|
|
|
315
315
|
<slot></slot>
|
|
316
316
|
</div>
|
|
317
317
|
</temba-field>
|
|
318
|
-
`}}t([ge({type:Boolean})],Me.prototype,"textarea",void 0),t([ge({type:String})],Me.prototype,"placeholder",void 0),t([ge({type:Boolean})],Me.prototype,"password",void 0),t([ge({type:Number})],Me.prototype,"maxlength",void 0),t([ge({type:Object})],Me.prototype,"inputElement",void 0),t([ge({type:Boolean})],Me.prototype,"clearable",void 0),t([ge({type:Boolean})],Me.prototype,"gsm",void 0),t([ge({type:String})],Me.prototype,"counter",void 0),t([ge({type:Boolean})],Me.prototype,"loading",void 0),t([ge({type:Boolean})],Me.prototype,"submitOnEnter",void 0),t([ge()],Me.prototype,"onBlur",void 0),t([ge({type:Boolean})],Me.prototype,"autogrow",void 0),t([ge({type:String})],Me.prototype,"type",void 0),function(t){t.DayFirst="day_first",t.MonthFirst="month_first",t.YearFirst="year_first"}(Te||(Te={})),function(t){t.CampaignEvent="campaign_event",t.ScheduledBroadcast="scheduled_broadcast",t.ScheduledTrigger="scheduled_trigger"}($e||($e={})),function(t){t.Open="open",t.Closed="closed"}(Oe||(Oe={})),function(t){t.Loaded="temba-loaded",t.Loading="temba-loading",t.Canceled="temba-canceled",t.CursorChanged="temba-cursor-changed",t.Refreshed="temba-refreshed",t.Selection="temba-selection",t.ButtonClicked="temba-button-clicked",t.DialogHidden="temba-dialog-hidden",t.ScrollThreshold="temba-scroll-threshold",t.ContentChanged="temba-content-changed",t.ContextChanged="temba-context-changed",t.FetchComplete="temba-fetch-complete",t.MessageSent="temba-message-sent",t.Submitted="temba-submitted",t.Redirected="temba-redirected",t.NoPath="temba-no-path",t.StoreUpdated="temba-store-updated",t.Ready="temba-ready",t.OrderChanged="temba-order-changed",t.DragStart="temba-drag-start",t.DragStop="temba-drag-stop",t.Resized="temba-resized"}(Le||(Le={}));
|
|
318
|
+
`}}t([ge({type:Boolean})],Me.prototype,"textarea",void 0),t([ge({type:String})],Me.prototype,"placeholder",void 0),t([ge({type:Boolean})],Me.prototype,"password",void 0),t([ge({type:Number})],Me.prototype,"maxlength",void 0),t([ge({type:Object})],Me.prototype,"inputElement",void 0),t([ge({type:Boolean})],Me.prototype,"clearable",void 0),t([ge({type:Boolean})],Me.prototype,"gsm",void 0),t([ge({type:String})],Me.prototype,"counter",void 0),t([ge({type:Boolean})],Me.prototype,"loading",void 0),t([ge({type:Boolean})],Me.prototype,"submitOnEnter",void 0),t([ge()],Me.prototype,"onBlur",void 0),t([ge({type:Boolean})],Me.prototype,"autogrow",void 0),t([ge({type:String})],Me.prototype,"type",void 0),function(t){t.DayFirst="day_first",t.MonthFirst="month_first",t.YearFirst="year_first"}(Te||(Te={})),function(t){t.CampaignEvent="campaign_event",t.ScheduledBroadcast="scheduled_broadcast",t.ScheduledTrigger="scheduled_trigger"}($e||($e={})),function(t){t.Open="open",t.Closed="closed"}(Oe||(Oe={})),function(t){t.Loaded="temba-loaded",t.Loading="temba-loading",t.Canceled="temba-canceled",t.CursorChanged="temba-cursor-changed",t.Refreshed="temba-refreshed",t.Selection="temba-selection",t.ButtonClicked="temba-button-clicked",t.DialogHidden="temba-dialog-hidden",t.ScrollThreshold="temba-scroll-threshold",t.ContentChanged="temba-content-changed",t.ContextChanged="temba-context-changed",t.FetchComplete="temba-fetch-complete",t.MessageSent="temba-message-sent",t.Submitted="temba-submitted",t.Redirected="temba-redirected",t.NoPath="temba-no-path",t.StoreUpdated="temba-store-updated",t.Ready="temba-ready",t.OrderChanged="temba-order-changed",t.DragStart="temba-drag-start",t.DragStop="temba-drag-stop",t.Resized="temba-resized",t.DetailsChanged="temba-details-changed"}(Le||(Le={}));
|
|
319
319
|
/**
|
|
320
320
|
* tiny-lru
|
|
321
321
|
*
|
|
@@ -361,7 +361,7 @@ const Bs="",Rs="h",qs="s";function Us(t,e){return(e?Rs:qs)+function(t){let e=0,
|
|
|
361
361
|
* Copyright 2020 Google LLC
|
|
362
362
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
363
363
|
*/
|
|
364
|
-
let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)throw new Error("lit-localize can only be configured once");ir=t,or=!0}(((t,e)=>js(Ys,t,e))),Ks=Ws=t.sourceLocale,Gs=new Set(t.targetLocales),Gs.add(t.sourceLocale),Qs=t.loadLocale,{getLocale:tr,setLocale:er}))({sourceLocale:"en",targetLocales:nr,loadLocale:t=>import(`./locales/${t}.js`)});class rr extends ue{constructor(){super(...arguments),this.settings={},this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.languages={},this.featuredFields=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
|
|
364
|
+
let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)throw new Error("lit-localize can only be configured once");ir=t,or=!0}(((t,e)=>js(Ys,t,e))),Ks=Ws=t.sourceLocale,Gs=new Set(t.targetLocales),Gs.add(t.sourceLocale),Qs=t.loadLocale,{getLocale:tr,setLocale:er}))({sourceLocale:"en",targetLocales:nr,loadLocale:t=>import(`./locales/${t}.js`)});class rr extends ue{constructor(){super(...arguments),this.settings={},this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.languages={},this.featuredFields=[],this.dirtyElements=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
|
|
365
365
|
:host {
|
|
366
366
|
position: fixed;
|
|
367
367
|
z-index: 1000;
|
|
@@ -372,7 +372,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
372
372
|
width: 100%;
|
|
373
373
|
top: 0.5em;
|
|
374
374
|
}
|
|
375
|
-
`}getLocale(){return this.locale[0]}clearCache(){this.cache=Ie(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(oe("settings")||"{}");const t=[];this.completionEndpoint&&t.push(jt(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(Qt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(Qt(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(Qt(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(jt(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(Qt(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}getUser(t){return this.users.find((e=>e.email===t))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){Qt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return Qt(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent(Le.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||Ms.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=Ms.fromISO(t),o=e?Ms.fromISO(e):Ms.now();return this.getShortDuration(i,o)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=nr.find((e=>e===t));e&&sr(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return e||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return Ms.fromISO(t).setLocale(this.getLocale()).toLocaleString(Ms.DATETIME_SHORT)}postJSON(t,e=""){return Kt(t,e)}postForm(t,e,i={}){return((t,e,i={})=>{const o=new FormData;return Object.keys(e).forEach((t=>{o.append(t,e[t])})),Jt(t,o,i)})(t,e,i)}postUrl(t,e="",i={},o=null){return Yt(t,e,i,o)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):jt(t,e.controller,e.headers||{}).then((e=>new Promise(((i,o)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):o("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,o=this.cache.get(i);return!e.force&&o?new Promise((t=>{t(o)})):new Promise((e=>{const o=this.pendingResolves[t]||[];o.push(e),this.pendingResolves[t]=o,o.length<=1&&Wt(t).then((e=>{this.cache.set(i,e);const o=this.pendingResolves[t]||[];for(;o.length>0;){o.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(Le.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],o=(new Date).getTime();if(i&&o-i<500)return;this.fetching[t]=o,e=e||{};const n=this.cache.get(t);n&&!e.force?this.fireCustomEvent(Le.StoreUpdated,{url:t,data:n}):Wt(t).then((i=>{i?(i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(Le.StoreUpdated,{url:t,data:i}),delete this.fetching[t]):delete this.fetching[t]}))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return j`<temba-loading size="10" units="8"></temba-loading>`}}t([ge({type:Number})],rr.prototype,"ttl",void 0),t([ge({type:Number})],rr.prototype,"max",void 0),t([ge({type:Boolean})],rr.prototype,"ready",void 0),t([ge({type:Boolean})],rr.prototype,"loader",void 0),t([ge({type:String,attribute:"completion"})],rr.prototype,"completionEndpoint",void 0),t([ge({type:String,attribute:"fields"})],rr.prototype,"fieldsEndpoint",void 0),t([ge({type:String,attribute:"groups"})],rr.prototype,"groupsEndpoint",void 0),t([ge({type:String,attribute:"globals"})],rr.prototype,"globalsEndpoint",void 0),t([ge({type:String,attribute:"languages"})],rr.prototype,"languagesEndpoint",void 0),t([ge({type:String,attribute:"workspace"})],rr.prototype,"workspaceEndpoint",void 0),t([ge({type:String,attribute:"users"})],rr.prototype,"usersEndpoint",void 0),t([ge({type:Object,attribute:!1})],rr.prototype,"schema",void 0),t([ge({type:Object,attribute:!1})],rr.prototype,"fnOptions",void 0),t([ge({type:Object,attribute:!1})],rr.prototype,"keyedAssets",void 0);class ar extends ue{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.internalFocusDisabled=!1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=ee((function(t){this.internalFocusDisabled||t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
|
|
375
|
+
`}markDirty(t){this.dirtyElements.includes(t)||this.dirtyElements.push(t)}cleanAll(){this.dirtyElements.forEach((t=>t.markClean())),this.dirtyElements=[]}markClean(t){this.dirtyElements=this.dirtyElements.filter((e=>e!==t))}getDirtyMessage(){if(this.dirtyElements.length>0)return this.dirtyElements[0].dirtyMessage||"You have unsaved changes, are you sure you want to continue?"}getLocale(){return this.locale[0]}clearCache(){this.cache=Ie(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(oe("settings")||"{}");const t=[];this.completionEndpoint&&t.push(jt(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(Qt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(Qt(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(Qt(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(jt(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(Qt(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}getUser(t){return this.users.find((e=>e.email===t))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){Qt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return Qt(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent(Le.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||Ms.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=Ms.fromISO(t),o=e?Ms.fromISO(e):Ms.now();return this.getShortDuration(i,o)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=nr.find((e=>e===t));e&&sr(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return e||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return Ms.fromISO(t).setLocale(this.getLocale()).toLocaleString(Ms.DATETIME_SHORT)}postJSON(t,e=""){return Kt(t,e)}postForm(t,e,i={}){return((t,e,i={})=>{const o=new FormData;return Object.keys(e).forEach((t=>{o.append(t,e[t])})),Jt(t,o,i)})(t,e,i)}postUrl(t,e="",i={},o=null){return Yt(t,e,i,o)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):jt(t,e.controller,e.headers||{}).then((e=>new Promise(((i,o)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):o("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,o=this.cache.get(i);return!e.force&&o?new Promise((t=>{t(o)})):new Promise((e=>{const o=this.pendingResolves[t]||[];o.push(e),this.pendingResolves[t]=o,o.length<=1&&Wt(t).then((e=>{this.cache.set(i,e);const o=this.pendingResolves[t]||[];for(;o.length>0;){o.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(Le.StoreUpdated,{url:t,data:e})}removeFromCache(t){this.cache.delete(t)}makeRequest(t,e){const i=this.fetching[t],o=(new Date).getTime();if(i&&o-i<500)return;this.fetching[t]=o,e=e||{};const n=this.cache.get(t);n&&!e.force?this.fireCustomEvent(Le.StoreUpdated,{url:t,data:n}):Wt(t).then((i=>{i?(i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(Le.StoreUpdated,{url:t,data:i}),delete this.fetching[t]):delete this.fetching[t]}))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return j`<temba-loading size="10" units="8"></temba-loading>`}}t([ge({type:Number})],rr.prototype,"ttl",void 0),t([ge({type:Number})],rr.prototype,"max",void 0),t([ge({type:Boolean})],rr.prototype,"ready",void 0),t([ge({type:Boolean})],rr.prototype,"loader",void 0),t([ge({type:String,attribute:"completion"})],rr.prototype,"completionEndpoint",void 0),t([ge({type:String,attribute:"fields"})],rr.prototype,"fieldsEndpoint",void 0),t([ge({type:String,attribute:"groups"})],rr.prototype,"groupsEndpoint",void 0),t([ge({type:String,attribute:"globals"})],rr.prototype,"globalsEndpoint",void 0),t([ge({type:String,attribute:"languages"})],rr.prototype,"languagesEndpoint",void 0),t([ge({type:String,attribute:"workspace"})],rr.prototype,"workspaceEndpoint",void 0),t([ge({type:String,attribute:"users"})],rr.prototype,"usersEndpoint",void 0),t([ge({type:Object,attribute:!1})],rr.prototype,"schema",void 0),t([ge({type:Object,attribute:!1})],rr.prototype,"fnOptions",void 0),t([ge({type:Object,attribute:!1})],rr.prototype,"keyedAssets",void 0);class ar extends ue{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.internalFocusDisabled=!1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=ee((function(t){this.internalFocusDisabled||t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
|
|
376
376
|
.options-container {
|
|
377
377
|
background: var(--color-options-bg);
|
|
378
378
|
user-select: none;
|
|
@@ -1872,7 +1872,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
1872
1872
|
</div>`:null;return j`<div class="counter${i?" attention":""}"><div class="counts">${this.count}${this.segments>1||t?j`<div class="segments">
|
|
1873
1873
|
/ ${this.segments}${t?j`+`:null}
|
|
1874
1874
|
<div></div>
|
|
1875
|
-
</div>`:null}</div> ${o}</div></div>`}}t([ge({type:String})],ul.prototype,"text",void 0),t([ge({type:Number})],ul.prototype,"count",void 0),t([ge({type:Number,attribute:!1})],ul.prototype,"segments",void 0),t([ge({type:Object,attribute:!1})],ul.prototype,"extended",void 0);class pl extends ue{constructor(){super(...arguments),this.showLoading=!1}handleStoreUpdated(t){this.store.initialHttpComplete.then((()=>{this.storeUpdated(t)}))}storeUpdated(t){}updated(t){super.updated(t)}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.store&&this.store.addEventListener(Le.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&this.store.removeEventListener(Le.StoreUpdated,this.handleStoreUpdated)}render(){if(!this.store.ready&&this.showLoading)return j`<temba-loading></temba-loading>`}}t([ge({type:String})],pl.prototype,"url",void 0),t([ge({type:Boolean})],pl.prototype,"showLoading",void 0);class ml extends pl{constructor(){super(...arguments),this.showLoading=!1}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}storeUpdated(t){if(t.detail.url===this.url){const e=this.data;this.data=t.detail.data,this.fireCustomEvent(Le.Refreshed,{data:t.detail.data,previous:e})}}updated(t){super.updated(t),t.has("url")&&(this.url?this.store.makeRequest(this.url,{prepareData:this.prepareData}):this.data=null)}connectedCallback(){super.connectedCallback(),this.prepareData=this.prepareData.bind(this)}}t([ge({type:String})],ml.prototype,"url",void 0),t([ge({type:Boolean})],ml.prototype,"showLoading",void 0),t([ge({type:Object,attribute:!1})],ml.prototype,"data",void 0);class gl extends ml{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}setContact(t){this.data=this.prepareData([t]),this.store.updateCache(`${this.endpoint}${this.contact}`,this.data)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([ge({type:String})],gl.prototype,"contact",void 0),t([ge({type:Object,attribute:!1})],gl.prototype,"data",void 0),t([ge({type:String})],gl.prototype,"endpoint",void 0);let fl=[];const vl=(t,e,i,o=void 0,n=void 0)=>(t&&(fl.forEach((t=>{t.abort()})),fl=[]),new Promise((t=>{const s=new AbortController;fl.push(s);let r=e;o&&(r+=`&before=${o}`),n&&(r+=`&after=${n}`),i&&(r+=`&ticket=${i}`),jt(r,s).then((e=>{fl=fl.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),bl=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody",yl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkRtZKfHl57+Xl98e939pn73P32XuftS4AJE8fLi8FlgIgmSfgB3o401eFR9Cx/QAGeIABpgAwWempvkHuwUAkLzcXerrICfyL3gwBSPy+ZejpT6eD/0/SrFS+AADIX8TmbE46S8T5Ik7KFKSK7TMipsYkihlGiZkvSlDEcmKOW+Sln30W2VHM7GQeW8TinFPZyWwx94h4e4aQI2LER8QFGVxOpohvi1gzSZjMFfFbcWwyh5kOAIoktgs4rHgRm4iYxA8OdBHxcgBwpLgvOOYLFnCyBOJDuaSkZvO5cfECui5Lj25qbc2ge3IykzgCgaE/k5XI5LPpLinJqUxeNgCLZ/4sGXFt6aIiW5paW1oamhmZflGo/7r4Ny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7N5wCgRZbEXBdzc4R8U+NMTdQu6DtE2CfG5sqYa2PcOAfAgcg3vF0fMytCvqFxpmZqG/QdqhX7B2KuiZmezwHAID0Xc0PMF+q2It9d7YO+Q4Q93w9wQUy+HJ9fUDM2BgB2ty0mv/fkpph7I+RFhLCYoPcXcT8hNpfG/FHMtHwOgK43L+bWmFsi4sXdYF1k0HeIsPfEJj/qdlHMH8QcHwNA91gYc3vMbTGPlbIaH0jRQe+vuiSfn2fPl+XPjzkjphaP7QEwaL0xT8TcF5NfzTonIp7PFa9rgr67CHx+5O28mPxNb2+OOTUmr+gBqI8csWdjvhfz3ZiHIuD50bOu07VB310Efkps8str8pfDvCHmjTGnxLi5DqAz5JvZXoj5cczTMf8vJq/AV8W26wn6PkTkJ8TmtTGvq+bEmPzM+9R+MylmfL8ZF2OlD7BvOT5bY7bE5MfF8nZdzIp+k58NfzlmbjW/iHhvji17SOn/A6bddTBuigQoAAAAAElFTkSuQmCC",_l=36e5;var xl;!function(t){t.Inline="inline",t.Error="error",t.Collapse="collapse",t.Note="note",t.MsgIn="msg_in",t.MsgOut="msg_out"}(xl||(xl={}));const wl={hour:"numeric",minute:"2-digit"},kl={weekday:void 0,year:void 0,month:"short",day:"numeric",hour:"numeric",minute:"2-digit"};class Al extends ue{constructor(){super(...arguments),this.messageGroups=[],this.fetching=!1,this.hideTopScroll=!0,this.hideBottomScroll=!0,this.defaultAvatar=yl,this.agent=!1,this.msgMap=new Map}static get styles(){return r`
|
|
1875
|
+
</div>`:null}</div> ${o}</div></div>`}}t([ge({type:String})],ul.prototype,"text",void 0),t([ge({type:Number})],ul.prototype,"count",void 0),t([ge({type:Number,attribute:!1})],ul.prototype,"segments",void 0),t([ge({type:Object,attribute:!1})],ul.prototype,"extended",void 0);class pl extends ue{constructor(){super(...arguments),this.showLoading=!1,this.dirty=!1}markDirty(){this.dirty=!0,this.store.markDirty(this),this.fireCustomEvent(Le.DetailsChanged,{dirty:!0})}markClean(){this.dirty=!1,this.store.markClean(this),this.fireCustomEvent(Le.DetailsChanged,{dirty:!1})}handleStoreUpdated(t){this.store.initialHttpComplete.then((()=>{this.storeUpdated(t)}))}storeUpdated(t){}updated(t){super.updated(t)}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.store&&this.store.addEventListener(Le.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&(this.store.removeEventListener(Le.StoreUpdated,this.handleStoreUpdated),this.store.markClean(this))}render(){if(!this.store.ready&&this.showLoading)return j`<temba-loading></temba-loading>`}}t([ge({type:String})],pl.prototype,"url",void 0),t([ge({type:Boolean})],pl.prototype,"showLoading",void 0),t([ge({type:Boolean})],pl.prototype,"dirty",void 0),t([ge({type:String})],pl.prototype,"dirtyMessage",void 0);class ml extends pl{constructor(){super(...arguments),this.showLoading=!1}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}storeUpdated(t){if(t.detail.url===this.url){const e=this.data;this.data=t.detail.data,this.fireCustomEvent(Le.Refreshed,{data:t.detail.data,previous:e})}}updated(t){super.updated(t),t.has("url")&&(this.url?this.store.makeRequest(this.url,{prepareData:this.prepareData}):this.data=null)}connectedCallback(){super.connectedCallback(),this.prepareData=this.prepareData.bind(this)}}t([ge({type:String})],ml.prototype,"url",void 0),t([ge({type:Boolean})],ml.prototype,"showLoading",void 0),t([ge({type:Object,attribute:!1})],ml.prototype,"data",void 0);class gl extends ml{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}postChanges(t){return this.store.removeFromCache(`${this.endpoint}${this.contact}`),this.store.postJSON(`${this.endpoint}${this.contact}`,t).then((t=>{this.setContact(t.json)}))}setContact(t){this.data=this.prepareData([t]),this.store.updateCache(`${this.endpoint}${this.contact}`,this.data)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([ge({type:String})],gl.prototype,"contact",void 0),t([ge({type:Object,attribute:!1})],gl.prototype,"data",void 0),t([ge({type:String})],gl.prototype,"endpoint",void 0);let fl=[];const vl=(t,e,i,o=void 0,n=void 0)=>(t&&(fl.forEach((t=>{t.abort()})),fl=[]),new Promise((t=>{const s=new AbortController;fl.push(s);let r=e;o&&(r+=`&before=${o}`),n&&(r+=`&after=${n}`),i&&(r+=`&ticket=${i}`),jt(r,s).then((e=>{fl=fl.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),bl=t=>t?t.name?t.name:t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody",yl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkRtZKfHl57+Xl98e939pn73P32XuftS4AJE8fLi8FlgIgmSfgB3o401eFR9Cx/QAGeIABpgAwWempvkHuwUAkLzcXerrICfyL3gwBSPy+ZejpT6eD/0/SrFS+AADIX8TmbE46S8T5Ik7KFKSK7TMipsYkihlGiZkvSlDEcmKOW+Sln30W2VHM7GQeW8TinFPZyWwx94h4e4aQI2LER8QFGVxOpohvi1gzSZjMFfFbcWwyh5kOAIoktgs4rHgRm4iYxA8OdBHxcgBwpLgvOOYLFnCyBOJDuaSkZvO5cfECui5Lj25qbc2ge3IykzgCgaE/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xe/kfk39OyYP4xZkM8BQBvl1uTmnFOHmGe1WKH3F6v1g2NzWczHYo7N5wCgRZbEXBdzc4R8U+NMTdQu6DtE2CfG5sqYa2PcOAfAgcg3vF0fMytCvqFxpmZqG/QdqhX7B2KuiZmezwHAID0Xc0PMF+q2It9d7YO+Q4Q93w9wQUy+HJ9fUDM2BgB2ty0mv/fkpph7I+RFhLCYoPcXcT8hNpfG/FHMtHwOgK43L+bWmFsi4sXdYF1k0HeIsPfEJj/qdlHMH8QcHwNA91gYc3vMbTGPlbIaH0jRQe+vuiSfn2fPl+XPjzkjphaP7QEwaL0xT8TcF5NfzTonIp7PFa9rgr67CHx+5O28mPxNb2+OOTUmr+gBqI8csWdjvhfz3ZiHIuD50bOu07VB310Efkps8str8pfDvCHmjTGnxLi5DqAz5JvZXoj5cczTMf8vJq/AV8W26wn6PkTkJ8TmtTGvq+bEmPzM+9R+MylmfL8ZF2OlD7BvOT5bY7bE5MfF8nZdzIp+k58NfzlmbjW/iHhvji17SOn/A6bddTBuigQoAAAAAElFTkSuQmCC",_l=36e5;var xl;!function(t){t.Inline="inline",t.Error="error",t.Collapse="collapse",t.Note="note",t.MsgIn="msg_in",t.MsgOut="msg_out"}(xl||(xl={}));const wl={hour:"numeric",minute:"2-digit"},kl={weekday:void 0,year:void 0,month:"short",day:"numeric",hour:"numeric",minute:"2-digit"};class Al extends ue{constructor(){super(...arguments),this.messageGroups=[],this.fetching=!1,this.hideTopScroll=!0,this.hideBottomScroll=!0,this.defaultAvatar=yl,this.agent=!1,this.msgMap=new Map}static get styles(){return r`
|
|
1876
1876
|
:host {
|
|
1877
1877
|
display: flex;
|
|
1878
1878
|
flex-direction: column;
|
|
@@ -2419,7 +2419,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2419
2419
|
}
|
|
2420
2420
|
`}constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.currentTicket=null,this.currentContact=null,this.agent="",this.blockFetching=!1,this.avatar=yl,this.ticket=null,this.lastEventTime=null,this.newestEventTime=null,this.refreshId=null,this.polling=!1}firstUpdated(t){super.firstUpdated(t)}connectedCallback(){super.connectedCallback(),this.chat=this.shadowRoot.querySelector("temba-chat")}disconnectedCallback(){this.refreshId&&clearInterval(this.refreshId)}updated(t){super.updated(t),(t.has("data")||t.has("currentContact"))&&(this.currentContact=this.data),t.has("currentContact")&&(this.chat=this.shadowRoot.querySelector("temba-chat"),this.reset(),this.fetchPreviousMessages())}reset(){this.chat&&this.chat.reset(),this.blockFetching=!1,this.ticket=null,this.lastEventTime=null,this.newestEventTime=null,this.refreshId=null,this.polling=!1}refresh(){this.checkForNewMessages()}handleSend(t){const e=t.detail.name;if("Send"===e){const i={contact:this.currentContact.uuid},o=t.currentTarget;if(o){const t=o.currentText;t&&t.length>0&&(i.text=t);const e=o.currentAttachments;if(e&&e.length>0){const t=e.map((t=>t.uuid));i.attachments=t}}this.currentTicket&&(i.ticket=this.currentTicket.uuid);const n=e+" failed, please try again.";Kt("/api/v2/messages.json",i).then((t=>{if(t.status<400)this.checkForNewMessages(),o.reset(),this.fireCustomEvent(Le.MessageSent,{msg:i});else if(t.status<500)if(t.json.text&&t.json.text.length>0&&t.json.text[0].length>0){let e=t.json.text[0];e=e.replace("Ensure this field has no more than","Maximum allowed text is"),o.buttonError=e}else if(t.json.attachments&&t.json.attachments.length>0&&t.json.attachments[0].length>0){let e=t.json.attachments[0];e=e.replace("Ensure this field has no more than","Maximum allowed attachments is").replace("elements","files"),o.buttonError=e}else o.buttonError=n;else o.buttonError=n})).catch((t=>{console.error(t),o.buttonError=n}))}}render(){const t=this.currentContact?this.getTembaContactHistory():null,e=this.currentContact?this.getTembaChatbox():null,i=j`
|
|
2421
2421
|
<div class="chat-wrapper">${t} ${e}</div>
|
|
2422
|
-
`;return j`${i}`}getEndpoint(){return`/contact/history/${this.
|
|
2422
|
+
`;return j`${i}`}getEndpoint(){return`/contact/history/${this.contact}/?_format=json`}scheduleRefresh(){let t=(new Date).getTime()-this.newestEventTime/1e3-5e3;this.refreshId&&(clearTimeout(this.refreshId),this.refreshId=null),t=Math.min(t,15e3),t=Math.max(t,2e3),this.refreshId=setTimeout((()=>{this.checkForNewMessages()}),t)}getEventMessage(t){let e=null;switch(t.type){case Sl.ERROR:case Sl.FAILURE:e={type:xl.Inline,text:`Error during flow: ${i=t.text,i.charAt(0).toUpperCase()+i.slice(1)}`};break;case Sl.TICKET_OPENED:e={type:xl.Inline,text:Dl(t,"opened")};break;case Sl.TICKET_ASSIGNED:e={type:xl.Inline,text:Nl(t)};break;case Sl.TICKET_REOPENED:e={type:xl.Inline,text:Dl(t,"reopened")};break;case Sl.TICKET_CLOSED:e={type:xl.Inline,text:Dl(t,"closed")};break;case Sl.TICKET_TOPIC_CHANGED:e={type:xl.Inline,text:`Topic changed to **${t.topic.name}**`};break;case Sl.FLOW_ENTERED:case Sl.FLOW_EXITED:e={type:xl.Inline,text:$l(t)};break;case Sl.RUN_RESULT_CHANGED:e={type:xl.Inline,text:Ol(t)};break;case Sl.CONTACT_FIELD_CHANGED:e={type:xl.Inline,text:Ll(t)};break;case Sl.CONTACT_NAME_CHANGED:e={type:xl.Inline,text:Ml(t)};break;case Sl.CONTACT_URNS_CHANGED:e={type:xl.Inline,text:zl(t)};break;case Sl.EMAIL_SENT:e={type:xl.Inline,text:Il(t)};break;case Sl.INPUT_LABELS_ADDED:e={type:xl.Inline,text:Pl(t)};break;case Sl.CONTACT_GROUPS_CHANGED:e={type:xl.Inline,text:Bl(t)};break;case Sl.WEBHOOK_CALLED:e={type:xl.Inline,text:ql(t)};break;case Sl.AIRTIME_TRANSFERRED:e={type:xl.Inline,text:Ul(t)};break;case Sl.CALL_STARTED:e={type:xl.Inline,text:"Call Started"};break;case Sl.CAMPAIGN_FIRED:e={type:xl.Inline,text:Rl(t)};break;case Sl.CHANNEL_EVENT:e={type:xl.Inline,text:Tl(t)};break;case Sl.CONTACT_LANGUAGE_CHANGED:e={type:xl.Inline,text:Fl(t)};break;case Sl.OPTIN_REQUESTED:e={type:xl.Inline,text:Zl(t)}}var i;return e&&t.created_on?e.date=new Date(t.created_on):console.error("Unknown event type",t),e}getUserForEvent(t){let e=null;if(t.created_by){const i=this.store.getUser(t.created_by.email);i&&(e={email:t.created_by.email,name:[i.first_name,i.last_name].join(" "),avatar:i.avatar})}else"msg_received"===t.type&&(e={name:this.currentContact.name});return e}createMessages(t){if(t.events){let e=t.events.map((t=>{const e=1e3*new Date(t.created_on).getTime();if(e>this.newestEventTime&&(this.newestEventTime=e),"ticket_note_added"===t.type){const e=t;return{type:xl.Note,id:t.created_on+t.type,user:this.getUserForEvent(e),date:new Date(e.created_on),text:e.note}}if("msg_created"===t.type||"msg_received"===t.type||"broadcast_created"===t.type){const e=t;return{type:"msg_received"===e.type?"msg_in":"msg_out",id:e.msg.id+"",user:this.getUserForEvent(e),date:new Date(e.created_on),attachments:e.msg.attachments,text:e.msg.text,sendError:"E"===e.status||"F"===e.status,popup:j`<div
|
|
2423
2423
|
style="display: flex; flex-direction: row; align-items:center; justify-content: space-between;font-size:0.9em;line-height:1em;min-width:10em"
|
|
2424
2424
|
>
|
|
2425
2425
|
<div style="justify-content:left;text-align:left">
|
|
@@ -3806,7 +3806,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
3806
3806
|
</div>
|
|
3807
3807
|
</div>
|
|
3808
3808
|
</temba-dropdown>
|
|
3809
|
-
`:a},this.doRefresh=this.doRefresh.bind(this),this.addEventListener("blur",(()=>{this.shadowRoot.querySelectorAll("temba-list, temba-notification-list").forEach((t=>{t.scrollToTop()}))}))}setBubble(t,e){const i=nh(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait?this.fireCustomEvent(Le.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e),this.shadowRoot.querySelectorAll("temba-notification-list").forEach((t=>{t.refresh()}))}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=Wt(t.endpoint).then((i=>{if(i.forEach((e=>{if(!e.items){const i=(t.items||[]).find((t=>t.id==e.id));i&&i.items&&(e.items=i.items)}})),i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.submenu&&0==this.selection.length){const t=this.getMenuItemForSelection([this.submenu]);this.handleItemClicked(e,t)}this.wait||(this.fireCustomEvent(Le.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){if(i&&i.popup){const o=this.shadowRoot.querySelector("temba-dropdown");return o&&o.blur(),void(t&&this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if("modax-button"!==e.type){if(t&&t.metaKey&&e.href)return t.preventDefault(),t.stopPropagation(),void window.open(e.href,"_blank");if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&!this.isMobile()&&(this.collapsed=!1),this.isMobile()&&(this.collapsed=!0),e.trigger||e.event)this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else{if(e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint){if(this.loadItems(e,t),!e.href)return}else this.requestUpdate();e.href?this.dispatchEvent(new Event("change")):this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}else this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,o=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(o=nh(i,t).item,!o)break;i=o.items}return o}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!nh(this.root.items,e[0]).item)return}const i=[];let o=this.root;for(;e.length>0;){const t=e.shift();t&&(o.items||(this.loadItems(o),await this.httpComplete),o=nh(o.items,t).item,o?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[],i=this.isMobile()?ve.menu:ve.menu_collapse;e.push(j`<div class="level level-0 ${this.submenu?"hidden":""}">
|
|
3809
|
+
`:a},this.doRefresh=this.doRefresh.bind(this),this.addEventListener("blur",(()=>{this.shadowRoot.querySelectorAll("temba-list, temba-notification-list").forEach((t=>{t.scrollToTop()}))}))}setBubble(t,e){const i=nh(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait?this.fireCustomEvent(Le.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e),this.shadowRoot.querySelectorAll("temba-notification-list").forEach((t=>{t.refresh()}))}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=Wt(t.endpoint).then((i=>{if(i.forEach((e=>{if(!e.items){const i=(t.items||[]).find((t=>t.id==e.id));i&&i.items&&(e.items=i.items)}})),i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.submenu&&0==this.selection.length){const t=this.getMenuItemForSelection([this.submenu]);this.handleItemClicked(e,t)}this.wait||(this.fireCustomEvent(Le.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){const o=document.querySelector("temba-store");if(o){const t=o.getDirtyMessage();if(t&&!confirm(t))return;o.cleanAll()}if(i&&i.popup){const o=this.shadowRoot.querySelector("temba-dropdown");return o&&o.blur(),void(t&&this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if("modax-button"!==e.type){if(t&&t.metaKey&&e.href)return t.preventDefault(),t.stopPropagation(),void window.open(e.href,"_blank");if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&!this.isMobile()&&(this.collapsed=!1),this.isMobile()&&(this.collapsed=!0),e.trigger||e.event)this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else{if(e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint){if(this.loadItems(e,t),!e.href)return}else this.requestUpdate();e.href?this.dispatchEvent(new Event("change")):this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}else this.fireCustomEvent(Le.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,o=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(o=nh(i,t).item,!o)break;i=o.items}return o}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!nh(this.root.items,e[0]).item)return}const i=[];let o=this.root;for(;e.length>0;){const t=e.shift();t&&(o.items||(this.loadItems(o),await this.httpComplete),o=nh(o.items,t).item,o?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[],i=this.isMobile()?ve.menu:ve.menu_collapse;e.push(j`<div class="level level-0 ${this.submenu?"hidden":""}">
|
|
3810
3810
|
<div class="top">
|
|
3811
3811
|
<div class="expand-icon" @click=${this.handleExpand}>
|
|
3812
3812
|
<temba-icon
|
|
@@ -3971,12 +3971,14 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
3971
3971
|
margin: 0em 0em;
|
|
3972
3972
|
cursor: pointer;
|
|
3973
3973
|
display: flex;
|
|
3974
|
-
font-size: 1.
|
|
3974
|
+
font-size: 1.1em;
|
|
3975
3975
|
align-items: center;
|
|
3976
|
+
border: 1px inset transparent;
|
|
3977
|
+
border-bottom: 0px;
|
|
3976
3978
|
border-radius: var(--curvature);
|
|
3977
3979
|
border-bottom-right-radius: 0px;
|
|
3978
3980
|
border-bottom-left-radius: 0px;
|
|
3979
|
-
|
|
3981
|
+
|
|
3980
3982
|
color: var(--color-text-dark);
|
|
3981
3983
|
--icon-color: var(--color-text-dark);
|
|
3982
3984
|
white-space: nowrap;
|
|
@@ -4040,9 +4042,9 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4040
4042
|
}
|
|
4041
4043
|
|
|
4042
4044
|
.tab {
|
|
4043
|
-
transform: scale(0.9)
|
|
4044
|
-
--icon-color:
|
|
4045
|
-
color:
|
|
4045
|
+
transform: scale(0.9) translateY(0em);
|
|
4046
|
+
--icon-color: rgba(0, 0, 0, 0.5);
|
|
4047
|
+
color: rgba(0, 0, 0, 0.5);
|
|
4046
4048
|
}
|
|
4047
4049
|
|
|
4048
4050
|
.tab.selected {
|
|
@@ -4052,10 +4054,22 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4052
4054
|
.tab.selected:hover {
|
|
4053
4055
|
cursor: default;
|
|
4054
4056
|
box-shadow: 0px -3px 3px 1px rgba(0, 0, 0, 0.02);
|
|
4057
|
+
|
|
4055
4058
|
background: var(--focused-tab-color, #fff);
|
|
4056
|
-
transform: scale(1) translateY(
|
|
4059
|
+
transform: scale(1) translateY(1px);
|
|
4057
4060
|
--icon-color: #666;
|
|
4058
4061
|
color: #666;
|
|
4062
|
+
border: 1px inset rgba(0, 0, 0, 0.15);
|
|
4063
|
+
border-bottom: 0px;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
.embedded .tab.selected {
|
|
4067
|
+
border: none;
|
|
4068
|
+
transform: none;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
.tab.selected .dot {
|
|
4072
|
+
display: none;
|
|
4059
4073
|
}
|
|
4060
4074
|
|
|
4061
4075
|
.bottom .tab.selected {
|
|
@@ -4075,6 +4089,10 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4075
4089
|
background: rgba(0, 0, 0, 0.02);
|
|
4076
4090
|
}
|
|
4077
4091
|
|
|
4092
|
+
.tab.dirty {
|
|
4093
|
+
font-weight: 500;
|
|
4094
|
+
}
|
|
4095
|
+
|
|
4078
4096
|
.pane {
|
|
4079
4097
|
display: flex;
|
|
4080
4098
|
flex-direction: column;
|
|
@@ -4099,15 +4117,22 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4099
4117
|
|
|
4100
4118
|
.count {
|
|
4101
4119
|
border-radius: 99px;
|
|
4102
|
-
background: rgba(0, 0, 0, 0.
|
|
4120
|
+
background: rgba(0, 0, 0, 0.1);
|
|
4103
4121
|
color: rgba(0, 0, 0, 0.5);
|
|
4104
|
-
font-size: 0.
|
|
4105
|
-
font-weight:
|
|
4106
|
-
|
|
4107
|
-
min-width: 1em;
|
|
4122
|
+
font-size: 0.7em;
|
|
4123
|
+
font-weight: 500;
|
|
4124
|
+
min-width: 1.5em;
|
|
4108
4125
|
text-align: center;
|
|
4109
4126
|
}
|
|
4110
4127
|
|
|
4128
|
+
.dot {
|
|
4129
|
+
height: 0.5em;
|
|
4130
|
+
width: 0.5em;
|
|
4131
|
+
margin-left: 0.2em;
|
|
4132
|
+
background: var(--color-primary-dark);
|
|
4133
|
+
border-radius: 99px;
|
|
4134
|
+
}
|
|
4135
|
+
|
|
4111
4136
|
.notify .count {
|
|
4112
4137
|
background: var(--color-alert);
|
|
4113
4138
|
color: #fff;
|
|
@@ -4161,7 +4186,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4161
4186
|
.pane {
|
|
4162
4187
|
display: flex;
|
|
4163
4188
|
}
|
|
4164
|
-
`}handleTabClick(t){const e=parseInt(t.currentTarget.dataset.index);this.unselect&&this.index===e?this.index=-1:this.index=e,t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}handleSlotChange(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}this.tabs=t}firstUpdated(t){super.firstUpdated(t),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){if(super.updated(t),(t.has("index")||t.has("tabs"))&&(this.tabs.forEach(((t,e)=>{t.selected=e==this.index})),this.fireEvent(Le.ContextChanged)),this.index>this.tabs.length){const t=this.tabs[this.index];if(t&&t.hidden)for(let t=0;t<this.tabs.length;t++){const e=this.tabs[t];if(e&&!e.hidden)return void(this.index=t)}}}setTabDetails(t,e){if(t<this.tabs.length){const i=this.tabs[t];i.count=e.count,i.hidden=e.hidden,this.requestUpdate()}else setTimeout((()=>{this.setTabDetails(t,e)}),100)}getCurrentTab(){return this.tabs[this.index]}getTab(t){return this.tabs[t]}handleTabContentChanged(){this.requestUpdate()}render(){return j`
|
|
4189
|
+
`}handleTabClick(t){const e=parseInt(t.currentTarget.dataset.index);this.unselect&&this.index===e?this.index=-1:this.index=e,t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}handleSlotChange(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}this.tabs=t}firstUpdated(t){super.firstUpdated(t),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){if(super.updated(t),(t.has("index")||t.has("tabs"))&&(this.tabs.forEach(((t,e)=>{t.selected=e==this.index})),this.fireEvent(Le.ContextChanged)),this.index>this.tabs.length){const t=this.tabs[this.index];if(t&&t.hidden)for(let t=0;t<this.tabs.length;t++){const e=this.tabs[t];if(e&&!e.hidden)return void(this.index=t)}}}setTabDetails(t,e){if(t<this.tabs.length){const i=this.tabs[t];i.count=e.count,i.hidden=e.hidden,this.requestUpdate()}else setTimeout((()=>{this.setTabDetails(t,e)}),100)}getCurrentTab(){return this.tabs[this.index]}getTab(t){return this.tabs[t]}handleTabContentChanged(){this.requestUpdate()}handleTabDetailsChanged(){this.requestUpdate()}render(){const t=this.tabs[this.index];return j`
|
|
4165
4190
|
${this.bottom?j`<div
|
|
4166
4191
|
class="pane ${Vt({first:0==this.index,embedded:this.embedded,bottom:this.bottom})}"
|
|
4167
4192
|
>
|
|
@@ -4175,16 +4200,20 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4175
4200
|
<div
|
|
4176
4201
|
@click=${this.handleTabClick}
|
|
4177
4202
|
data-index=${e}
|
|
4178
|
-
class="${Vt({tab:!0,first:0==e,selected:e==this.index,hidden:t.hidden,notify:t.notify,alert:t.alert})}"
|
|
4203
|
+
class="${Vt({tab:!0,first:0==e,selected:e==this.index,hidden:t.hidden,notify:t.notify,alert:t.alert,dirty:t.dirty})}"
|
|
4179
4204
|
style="${t.selectionColor&&e==this.index?`color:${t.selectionColor};--icon-color:${t.selectionColor};`:""} ${t.selectionBackground&&e==this.index?`background-color:${t.selectionBackground};`:""}"
|
|
4180
4205
|
>
|
|
4181
4206
|
${t.icon?j`<temba-icon name=${t.icon} />`:null}
|
|
4182
|
-
<div class="name">${t.name}</div>
|
|
4207
|
+
<div class="name">${t.name} ${t.dirty?" *":""}</div>
|
|
4183
4208
|
${t.hasBadge()?j`
|
|
4184
4209
|
<div class="badge">
|
|
4185
|
-
${t.count>0?j`<div class="count">
|
|
4186
|
-
${t.count.toLocaleString()}
|
|
4210
|
+
${t.count>0&&!t.activity?j`<div class="count">
|
|
4211
|
+
${t.activity?"":t.count.toLocaleString()}
|
|
4187
4212
|
</div>`:null}
|
|
4213
|
+
${t.activity&&t.count>0&&!t.dirty?j`<div
|
|
4214
|
+
class="dot"
|
|
4215
|
+
style="background:${t.activityColor}"
|
|
4216
|
+
></div>`:null}
|
|
4188
4217
|
</div>
|
|
4189
4218
|
`:null}
|
|
4190
4219
|
${t.checked&&!t.alert?j`<temba-icon class="check" name="check"></temba-icon>`:null}
|
|
@@ -4197,11 +4226,13 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4197
4226
|
</div>
|
|
4198
4227
|
</div>
|
|
4199
4228
|
${this.bottom?null:j`<div
|
|
4229
|
+
@temba-details-changed=${this.handleTabDetailsChanged}
|
|
4230
|
+
style="border: 1px solid ${null==t?void 0:t.borderColor};background:${null==t?void 0:t.selectionBackground}"
|
|
4200
4231
|
class="pane ${Vt({first:0==this.index,embedded:this.embedded,bottom:this.bottom})}"
|
|
4201
4232
|
>
|
|
4202
4233
|
<slot></slot>
|
|
4203
4234
|
</div>`}
|
|
4204
|
-
`}}t([ge({type:Boolean})],lh.prototype,"embedded",void 0),t([ge({type:Boolean})],lh.prototype,"collapses",void 0),t([ge({type:Boolean})],lh.prototype,"bottom",void 0),t([ge({type:Boolean})],lh.prototype,"unselect",void 0),t([ge({type:Boolean})],lh.prototype,"focusedName",void 0),t([ge({type:Number})],lh.prototype,"index",void 0),t([ge({type:String})],lh.prototype,"refresh",void 0),t([ge({type:Array,attribute:!1})],lh.prototype,"tabs",void 0);class hh extends ue{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.alert=!1,this.hidden=!1,this.count=0,this.checked=!1}static get styles(){return r`
|
|
4235
|
+
`}}t([ge({type:Boolean})],lh.prototype,"embedded",void 0),t([ge({type:Boolean})],lh.prototype,"collapses",void 0),t([ge({type:Boolean})],lh.prototype,"bottom",void 0),t([ge({type:Boolean})],lh.prototype,"unselect",void 0),t([ge({type:Boolean})],lh.prototype,"focusedName",void 0),t([ge({type:Number})],lh.prototype,"index",void 0),t([ge({type:String})],lh.prototype,"refresh",void 0),t([ge({type:Array,attribute:!1})],lh.prototype,"tabs",void 0);class hh extends ue{constructor(){super(...arguments),this.borderColor="var(--color-widget-border)",this.activityColor="var(--color-link-primary)",this.selected=!1,this.notify=!1,this.alert=!1,this.hidden=!1,this.hideEmpty=!1,this.activity=!1,this.count=0,this.checked=!1,this.dirty=!1}static get styles(){return r`
|
|
4205
4236
|
:host {
|
|
4206
4237
|
display: none;
|
|
4207
4238
|
flex-direction: column;
|
|
@@ -4212,9 +4243,10 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4212
4243
|
display: flex;
|
|
4213
4244
|
flex-grow: 1;
|
|
4214
4245
|
}
|
|
4215
|
-
`}updated(t){super.updated(t),t.has("selected")&&this.classList.toggle("selected",this.selected)}hasBadge(){return this.count>0}render(){return j`<slot
|
|
4246
|
+
`}updated(t){super.updated(t),t.has("selected")&&this.classList.toggle("selected",this.selected)}hasBadge(){return this.count>0}handleDetailsChanged(t){"dirty"in t.detail&&(this.dirty=t.detail.dirty),"count"in t.detail&&(this.count=t.detail.count,this.hideEmpty&&(this.hidden=0===this.count))}render(){return j`<slot
|
|
4247
|
+
@temba-details-changed=${this.handleDetailsChanged}
|
|
4216
4248
|
class="${Vt({selected:this.selected})}"
|
|
4217
|
-
></slot> `}}t([ge({type:String})],hh.prototype,"name",void 0),t([ge({type:String})],hh.prototype,"icon",void 0),t([ge({type:String})],hh.prototype,"selectionColor",void 0),t([ge({type:String})],hh.prototype,"selectionBackground",void 0),t([ge({type:Boolean})],hh.prototype,"selected",void 0),t([ge({type:Boolean})],hh.prototype,"notify",void 0),t([ge({type:Boolean})],hh.prototype,"alert",void 0),t([ge({type:Boolean})],hh.prototype,"hidden",void 0),t([ge({type:Number})],hh.prototype,"count",void 0),t([ge({type:Boolean})],hh.prototype,"checked",void 0);class ch extends lt{static get styles(){return r`
|
|
4249
|
+
></slot> `}}t([ge({type:String})],hh.prototype,"name",void 0),t([ge({type:String})],hh.prototype,"icon",void 0),t([ge({type:String})],hh.prototype,"selectionColor",void 0),t([ge({type:String})],hh.prototype,"selectionBackground",void 0),t([ge({type:String})],hh.prototype,"borderColor",void 0),t([ge({type:String})],hh.prototype,"activityColor",void 0),t([ge({type:Boolean})],hh.prototype,"selected",void 0),t([ge({type:Boolean})],hh.prototype,"notify",void 0),t([ge({type:Boolean})],hh.prototype,"alert",void 0),t([ge({type:Boolean})],hh.prototype,"hidden",void 0),t([ge({type:Boolean})],hh.prototype,"hideEmpty",void 0),t([ge({type:Boolean})],hh.prototype,"activity",void 0),t([ge({type:Number})],hh.prototype,"count",void 0),t([ge({type:Boolean})],hh.prototype,"checked",void 0),t([ge({type:Boolean})],hh.prototype,"dirty",void 0);class ch extends lt{static get styles(){return r`
|
|
4218
4250
|
:host {
|
|
4219
4251
|
display: inline-block;
|
|
4220
4252
|
}
|
|
@@ -4407,7 +4439,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
4407
4439
|
.disabled .toggle {
|
|
4408
4440
|
display: none;
|
|
4409
4441
|
}
|
|
4410
|
-
`}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}isAgent(){return"T"===this.role}updated(t){super.updated(t),t.has("data")&&Object.keys(this.data.fields).length<=10&&(this.showAll=!0)}handleFieldChanged(t){const e=t.currentTarget,i=e.value;Kt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{e.handleResponse(t),this.setContact(t.json)})).catch((t=>{e.handleResponse(t)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).sort(((t,e)=>{const[i]=t,[o]=e,n=this.store.getContactField(i),s=this.store.getContactField(o);if("ward"===n.type)return 1;if("ward"===s.type)return-1;if("district"===n.type&&"ward"!==s.type&&"district"!==s.type)return 1;if("district"===s.type&&"ward"!==n.type&&"district"!==n.type)return-1;if("state"===n.type&&"ward"!==s.type&&"district"!==s.type&&"state"!==s.type)return 1;if("state"===s.type&&"ward"!==n.type&&"district"!==n.type&&"state"!==n.type)return-1;if(n.featured&&!s.featured)return-1;if(s.featured&&!n.featured)return 1;const r=s.priority-n.priority;return 0!==r?r:i.localeCompare(o)}));if(0==t.length)return j`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,o=this.store.getContactField(e);return j`<temba-contact-field
|
|
4442
|
+
`}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}isAgent(){return"T"===this.role}updated(t){super.updated(t),t.has("data")&&(Object.keys(this.data.fields).length<=10&&(this.showAll=!0),this.fireCustomEvent(Le.DetailsChanged,{count:Object.values(this.data.fields).filter((t=>!!t)).length}))}handleFieldChanged(t){const e=t.currentTarget,i=e.value;Kt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{e.handleResponse(t),this.setContact(t.json)})).catch((t=>{e.handleResponse(t)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).sort(((t,e)=>{const[i]=t,[o]=e,n=this.store.getContactField(i),s=this.store.getContactField(o);if("ward"===n.type)return 1;if("ward"===s.type)return-1;if("district"===n.type&&"ward"!==s.type&&"district"!==s.type)return 1;if("district"===s.type&&"ward"!==n.type&&"district"!==n.type)return-1;if("state"===n.type&&"ward"!==s.type&&"district"!==s.type&&"state"!==s.type)return 1;if("state"===s.type&&"ward"!==n.type&&"district"!==n.type&&"state"!==n.type)return-1;if(n.featured&&!s.featured)return-1;if(s.featured&&!n.featured)return 1;const r=s.priority-n.priority;return 0!==r?r:i.localeCompare(o)}));if(0==t.length)return j`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,o=this.store.getContactField(e);return j`<temba-contact-field
|
|
4411
4443
|
class=${Vt({set:!!i,unset:!i,featured:o.featured})}
|
|
4412
4444
|
key=${o.key}
|
|
4413
4445
|
name=${o.label}
|
|
@@ -5035,7 +5067,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
5035
5067
|
.scheduled-by .name {
|
|
5036
5068
|
flex-grow: 1;
|
|
5037
5069
|
}
|
|
5038
|
-
`}constructor(){super(),this.lang_weekly="Weekly",this.lang_daily="Daily",this.lang_once="Once",this.REPEAT_PERIOD={O:this.lang_once,D:this.lang_daily,W:this.lang_weekly},this.handleEventClicked=this.handleEventClicked.bind(this)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/contact/scheduled/${this.contact}/`:this.url=null)}handleEventClicked(t){this.fireCustomEvent(Le.Selection,t)}renderEvent(t){return j`
|
|
5070
|
+
`}constructor(){super(),this.lang_weekly="Weekly",this.lang_daily="Daily",this.lang_once="Once",this.REPEAT_PERIOD={O:this.lang_once,D:this.lang_daily,W:this.lang_weekly},this.handleEventClicked=this.handleEventClicked.bind(this)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/contact/scheduled/${this.contact}/`:this.url=null),t.has("data")&&this.fireCustomEvent(Le.DetailsChanged,{count:this.data.length})}handleEventClicked(t){this.fireCustomEvent(Le.Selection,t)}renderEvent(t){return j`
|
|
5039
5071
|
<div
|
|
5040
5072
|
class="event ${t.type}"
|
|
5041
5073
|
@click="${()=>this.handleEventClicked(t)}"
|
|
@@ -5245,7 +5277,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
5245
5277
|
.details .toggle {
|
|
5246
5278
|
padding-right: 0.5em;
|
|
5247
5279
|
}
|
|
5248
|
-
`}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==Oe.Open&&e.status==Oe.Closed?-1:e.status==Oe.Open&&t.status==Oe.Closed?1:t.status==Oe.Closed&&e.status==Oe.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),(t.has("contact")||t.has("ticket"))&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}${this.ticket?"&ticket="+this.ticket:""}`:this.url=null)}handleClose(t){Kt("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleReopen(t){Kt("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleTicketAssignment(t,e){const i=this.data.find((e=>e.uuid===t));if(!i.assignee||i.assignee.email!==e)return this.blur(),Kt("/api/v2/ticket_actions.json",{tickets:[t],action:"assign",assignee:e}).then((()=>{this.refresh()})).catch((t=>{console.error(t)})),!0}renderTicket(t){const e=t.opened_on,i=this.store.getAssignableUsers().find((t=>t.email===this.agent));return j`
|
|
5280
|
+
`}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==Oe.Open&&e.status==Oe.Closed?-1:e.status==Oe.Open&&t.status==Oe.Closed?1:t.status==Oe.Closed&&e.status==Oe.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),t.has("data")&&this.fireCustomEvent(Le.DetailsChanged,{count:this.data.length}),(t.has("contact")||t.has("ticket"))&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}${this.ticket?"&ticket="+this.ticket:""}`:this.url=null)}handleClose(t){Kt("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleReopen(t){Kt("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleTicketAssignment(t,e){const i=this.data.find((e=>e.uuid===t));if(!i.assignee||i.assignee.email!==e)return this.blur(),Kt("/api/v2/ticket_actions.json",{tickets:[t],action:"assign",assignee:e}).then((()=>{this.refresh()})).catch((t=>{console.error(t)})),!0}renderTicket(t){const e=t.opened_on,i=this.store.getAssignableUsers().find((t=>t.email===this.agent));return j`
|
|
5249
5281
|
<div
|
|
5250
5282
|
@click=${()=>{this.clickable?this.fireCustomEvent(Le.ButtonClicked,{ticket:t}):this.expandable&&(this.expanded=!this.expanded)}}
|
|
5251
5283
|
class="ticket ${t.status} ${Vt({clickable:this.clickable,expandable:this.expandable,expanded:this.expanded})}"
|
|
@@ -7827,7 +7859,77 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7827
7859
|
${this.renderUploader()}
|
|
7828
7860
|
</div>
|
|
7829
7861
|
</div>
|
|
7830
|
-
</div>`}}
|
|
7862
|
+
</div>`}}t([ge({type:String,attribute:!1})],hc.prototype,"endpoint",void 0),t([ge({type:Boolean})],hc.prototype,"pendingDrop",void 0),t([ge({type:String})],hc.prototype,"icon",void 0),t([ge({type:String})],hc.prototype,"accept",void 0),t([ge({type:Number})],hc.prototype,"max",void 0),t([ge({type:Array})],hc.prototype,"attachments",void 0),t([ge({type:Boolean,attribute:!1})],hc.prototype,"uploading",void 0);class cc extends gl{constructor(){super(...arguments),this.dirtyMessage="You have unsaved changes to the contact notepad. Are you sure you want to contiunue?"}static get styles(){return r`
|
|
7863
|
+
:host {
|
|
7864
|
+
height: 100%;
|
|
7865
|
+
display: flex;
|
|
7866
|
+
}
|
|
7867
|
+
|
|
7868
|
+
.wrapper {
|
|
7869
|
+
flex-grow: 1;
|
|
7870
|
+
--color-widget-bg: transparent;
|
|
7871
|
+
--color-widget-bg-focused: transparent;
|
|
7872
|
+
outline: none;
|
|
7873
|
+
border-radius: var(--curvature);
|
|
7874
|
+
display: flex;
|
|
7875
|
+
flex-direction: column;
|
|
7876
|
+
}
|
|
7877
|
+
|
|
7878
|
+
.notepad {
|
|
7879
|
+
flex-grow: 1;
|
|
7880
|
+
padding: 1.25rem;
|
|
7881
|
+
overflow-y: auto;
|
|
7882
|
+
background: transparent;
|
|
7883
|
+
border: none;
|
|
7884
|
+
outline: none;
|
|
7885
|
+
resize: none;
|
|
7886
|
+
font-family: monospace;
|
|
7887
|
+
}
|
|
7888
|
+
|
|
7889
|
+
.notepad:focus {
|
|
7890
|
+
outline: none;
|
|
7891
|
+
}
|
|
7892
|
+
|
|
7893
|
+
.toolbar {
|
|
7894
|
+
background: rgba(0, 0, 0, 0.03);
|
|
7895
|
+
padding: 0.25em 0.5em;
|
|
7896
|
+
display: flex;
|
|
7897
|
+
min-height: 2em;
|
|
7898
|
+
align-items: center;
|
|
7899
|
+
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
7900
|
+
}
|
|
7901
|
+
|
|
7902
|
+
.toolbar temba-button {
|
|
7903
|
+
margin-right: 0.5em;
|
|
7904
|
+
}
|
|
7905
|
+
|
|
7906
|
+
.updated {
|
|
7907
|
+
font-size: 0.9em;
|
|
7908
|
+
flex-grow: 1;
|
|
7909
|
+
margin-left: 0.5em;
|
|
7910
|
+
}
|
|
7911
|
+
`}handleChange(){this.markDirty()}submitChanges(){const t=this.shadowRoot.querySelector(".notepad").value;this.postChanges({note:t}).then((()=>{this.markClean()}))}updated(t){var e;super.updated(t),t.has("data")&&(this.note=(null===(e=this.data)||void 0===e?void 0:e.notes.length)>0?{...this.data.notes[this.data.notes.length-1]}:null,this.fireCustomEvent(Le.DetailsChanged,{count:this.note&&this.note.text.length>0?1:0}),this.markClean())}render(){return this.data?j`
|
|
7912
|
+
<div class="wrapper">
|
|
7913
|
+
<!-- prettier-ignore -->
|
|
7914
|
+
<textarea class="notepad" @input=${this.handleChange} .value=${this.note?this.note.text:""}></textarea>
|
|
7915
|
+
<div class="toolbar">
|
|
7916
|
+
<div class="updated">
|
|
7917
|
+
${this.note?j`Last updated by ${bl(this.note.created_by)}
|
|
7918
|
+
<temba-date
|
|
7919
|
+
value="${this.note.created_on}"
|
|
7920
|
+
display="duration"
|
|
7921
|
+
></temba-date>`:null}
|
|
7922
|
+
</div>
|
|
7923
|
+
${this.dirty?j`
|
|
7924
|
+
<temba-button
|
|
7925
|
+
name="Save"
|
|
7926
|
+
small
|
|
7927
|
+
@click=${this.submitChanges}
|
|
7928
|
+
></temba-button>
|
|
7929
|
+
`:null}
|
|
7930
|
+
</div>
|
|
7931
|
+
</div>
|
|
7932
|
+
`:super.render()}}function dc(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([ge({type:Object,attribute:!1})],cc.prototype,"note",void 0),t([ge({type:String})],cc.prototype,"dirtyMessage",void 0),dc("temba-anchor",rh),dc("temba-alert",Ql),dc("temba-store",rr),dc("temba-textinput",Me),dc("temba-datepicker",Sh),dc("temba-date",Ph),dc("temba-completion",Ya),dc("temba-checkbox",be),dc("temba-select",Qa),dc("temba-options",ar),dc("temba-loading",ol),dc("temba-lightbox",qh),dc("temba-button",el),dc("temba-omnibox",th),dc("temba-tip",oh),dc("temba-contact-name",dh),dc("temba-contact-name-fetch",Ch),dc("temba-contact-field",gh),dc("temba-contact-fields",ph),dc("temba-field-manager",$h),dc("temba-urn",uh),dc("temba-content-menu",zh),dc("temba-field",il),dc("temba-dialog",Xa),dc("temba-modax",tl),dc("temba-charcount",ul),dc("temba-contact-chat",jl),dc("temba-contact-details",class extends gl{static get styles(){return r`
|
|
7831
7933
|
.urn {
|
|
7832
7934
|
display: flex;
|
|
7833
7935
|
padding: 0.4em 1em 0.8em 1em;
|
|
@@ -7903,7 +8005,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7903
8005
|
disabled
|
|
7904
8006
|
></temba-contact-field>
|
|
7905
8007
|
</div>
|
|
7906
|
-
`}}),
|
|
8008
|
+
`}}),dc("temba-ticket-list",Hl),dc("temba-notification-list",class extends Vl{static get styles(){return r`
|
|
7907
8009
|
:host {
|
|
7908
8010
|
--option-hover-bg: #f9f9f9;
|
|
7909
8011
|
}
|
|
@@ -7946,7 +8048,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7946
8048
|
</div>`}}renderHeader(){return j`<div class="header">
|
|
7947
8049
|
<temba-icon name="notification"></temba-icon>
|
|
7948
8050
|
<div class="title">Notifications</div>
|
|
7949
|
-
</div>`}handleSelection(t){super.handleSelected(t)}scrollToTop(){window.setTimeout((()=>{this.shadowRoot.querySelector("temba-options").scrollToTop()}),1e3)}}),
|
|
8051
|
+
</div>`}handleSelection(t){super.handleSelected(t)}scrollToTop(){window.setTimeout((()=>{this.shadowRoot.querySelector("temba-options").scrollToTop()}),1e3)}}),dc("temba-list",Vl),dc("temba-sortable-list",Oh),dc("temba-run-list",kh),dc("temba-flow-details",Ah),dc("temba-label",ch),dc("temba-menu",sh),dc("temba-remote",Bh),dc("temba-contact-search",Yl),dc("temba-icon",Kl),dc("temba-dropdown",ah),dc("temba-tabs",lh),dc("temba-tab",hh),dc("temba-contact-badges",vh),dc("temba-contact-pending",yh),dc("temba-contact-tickets",_h),dc("temba-slider",xh),dc("temba-content-menu",zh),dc("temba-compose",Rh),dc("temba-color-picker",Uh),dc("temba-resizer",Fh),dc("temba-thumbnail",jh),dc("temba-webchat",Wh),dc("temba-image-picker",Qh),dc("temba-mask",Yh),dc("temba-user",Kh),dc("temba-template-editor",Jh),dc("temba-toast",ac),dc("temba-chat",Al),dc("temba-media-picker",hc),dc("temba-contact-notepad",cc);class uc extends lt{static get styles(){return r`
|
|
7950
8052
|
:host {
|
|
7951
8053
|
line-height: normal;
|
|
7952
8054
|
}
|
|
@@ -8154,7 +8256,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
8154
8256
|
></temba-textinput>
|
|
8155
8257
|
</div>
|
|
8156
8258
|
</temba-dialog>
|
|
8157
|
-
`}}t([ge({type:Array,attribute:!1})],dc.prototype,"path",void 0),t([ge()],dc.prototype,"endpoint",void 0),t([ge()],dc.prototype,"osmId",void 0),t([ge({type:Object})],dc.prototype,"hovered",void 0),t([ge({type:Object})],dc.prototype,"editFeature",void 0),t([ge({type:String,attribute:!1})],dc.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var uc={exports:{}};(function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function o(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}Object.freeze=function(t){return t};var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var o,n,s,r;return r=function(){o=!1,n&&(s.apply(i,n),n=!1)},s=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(r,e),o=!0)},s}function h(t,e,i){var o=e[1],n=e[0],s=o-n;return t===o&&i?t:((t-n)%s+s)%s+n}function c(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function g(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var f=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(f,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var A=window.requestAnimationFrame||x("RequestAnimationFrame")||k,C=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function S(t,e,i){if(!i||A!==k)return A.call(window,s(t,e));t.call(e)}function E(t){t&&C.call(window,t)}var T=(Object.freeze||Object)({freeze:i,extend:o,create:n,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:g,template:v,isArray:b,indexOf:y,emptyImageUrl:_,requestFn:A,cancelFn:C,requestAnimFrame:S,cancelAnimFrame:E});function $(){}function O(t){if("undefined"!=typeof L&&L&&L.Mixin){t=b(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}$.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=n(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(o(e,t.statics),delete t.statics),t.includes&&(O(t.includes),o.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=o(n(s.options),t.options)),o(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},$.include=function(t){return o(this.prototype,t),this},$.mergeOptions=function(t){return o(this.prototype.options,t),this},$.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var M={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(o=[],this._events[t]=o),i===this&&(i=void 0);for(var n={fn:e,ctx:i},s=o,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(n)},_off:function(t,e,i){var o,n,s;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,s=o.length;n<s;n++){var r=o[n];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,s=o.length;n<s;n++)o[n].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=o({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var n=s((function(){this.off(t,e,i).off(t,n,i)}),this);return this.on(t,e,i).on(t,n,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,o({layer:t.target,propagatedFrom:t.target},t),!0)}};M.addEventListener=M.on,M.removeEventListener=M.clearAllEventListeners=M.off,M.addOneTimeEventListener=M.once,M.fireEvent=M.fire,M.hasEventListeners=M.listens;var z=$.extend(M);function I(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var P=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof I?t:b(t)?new I(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new I(t.x,t.y):new I(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function B(t,e){return!t||t instanceof N?t:new N(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function q(t,e){return t instanceof R?t:new R(t,e)}function U(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof U?t:b(t)&&"object"!=typeof t[0]?3===t.length?new U(t[0],t[1],t[2]):2===t.length?new U(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new U(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new U(t,e,i)}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new I(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new I(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=P(this.x),this.y=P(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new I(this.min.x,this.max.y)},getTopRight:function(){return new I(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof I?D(t):B(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=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,o=t.min,n=t.max,s=n.x>=e.x&&o.x<=i.x,r=n.y>=e.y&&o.y<=i.y;return s&&r},overlaps:function(t){t=B(t);var e=this.min,i=this.max,o=t.min,n=t.max,s=n.x>e.x&&o.x<i.x,r=n.y>e.y&&o.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof U)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(F(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new U(e.lat,e.lng),this._northEast=new U(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new U(e.lat-o,e.lng-n),new U(i.lat+o,i.lng+n))},getCenter:function(){return new U((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof U||"lat"in t?F(t):q(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>=e.lat&&o.lat<=i.lat,r=n.lng>=e.lng&&o.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>e.lat&&o.lat<i.lat,r=n.lng>e.lng&&o.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},U.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return j.distance(this,F(t))},wrap:function(){return j.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return q([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new U(this.lat,this.lng,this.alt)}};var Z={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new U(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new R(new U(s.lat-o,s.lng-n),new U(r.lat-o,r.lng-n))}},j=o({},Z,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(o)*Math.cos(n)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),V=6378137,H={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new I(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new U((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=V*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,o){if(b(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function G(t,e,i,o){return new W(t,e,i,o)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new I((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var Q=o({},j,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),Y=o({},Q,{code:"EPSG:900913"});function K(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function J(t,e){var i,o,n,s,r,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,s=(r=t[i]).length;o<s;o++)l+=(o?"L":"M")+(a=r[o]).x+" "+a.y;l+=e?$t?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=Lt("webkit"),nt=Lt("android"),st=Lt("android 2")||Lt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&Lt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=Lt("chrome"),ct=Lt("gecko")&&!ot&&!lt&&!tt,dt=!ht&&Lt("safari"),ut=Lt("phantom"),pt="OTransition"in X,mt=0===navigator.platform.indexOf("Win"),gt=tt&&"transition"in X,ft="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in X,bt=!window.L_DISABLE_3D&&(gt||ft||vt)&&!pt&&!ut,yt="undefined"!=typeof orientation||Lt("mobile"),_t=yt&&ot,xt=yt&&ft,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),At=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=yt&<,St=yt&&ct,Et=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Tt=!!document.createElement("canvas").getContext,$t=!(!document.createElementNS||!K("svg").createSVGRect),Ot=!$t&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Lt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Mt=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:gt,webkit3d:ft,gecko3d:vt,any3d:bt,mobile:yt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:At,mobileOpera:Ct,mobileGecko:St,retina:Et,canvas:Tt,svg:$t,vml:Ot}),zt=wt?"MSPointerDown":"pointerdown",It=wt?"MSPointerMove":"pointermove",Pt=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Bt={},Rt=!1,qt=0;function Ut(t,e,i,o){return"touchstart"===e?Zt(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Qt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(It,o,!1):"touchend"===e&&(t.removeEventListener(Pt,o,!1),t.removeEventListener(Dt,o,!1)),this}function Zt(t,e,i){var o=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Ze(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Rt||(document.documentElement.addEventListener(zt,jt,!0),document.documentElement.addEventListener(It,Vt,!0),document.documentElement.addEventListener(Pt,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Rt=!0)}function jt(t){Bt[t.pointerId]=t,qt++}function Vt(t){Bt[t.pointerId]&&(Bt[t.pointerId]=t)}function Ht(t){delete Bt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Bt)t.touches.push(Bt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(It,o,!1)}function Qt(t,e,i){var o=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Pt,o,!1),t.addEventListener(Dt,o,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Kt=wt?"MSPointerUp":kt?"pointerup":"touchend",Jt="_leaflet_";function Xt(t,e,i){var o,n,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(o||i);n=t.touches?t.touches[0]:t,s=a>0&&a<=r,o=i}}function l(t){if(s&&!n.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in n)i=n[r],a[r]=i&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Jt+Yt+i]=a,t[Jt+Kt+i]=l,t[Jt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Kt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Jt+Yt+e],o=t[Jt+Kt+e],n=t[Jt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Kt,o,!1),it||t.removeEventListener("dblclick",n,!1),this}var ee,ie,oe,ne,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function de(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function fe(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!fe(t,e)){var s=_e(t);ye(t,(s?s+" ":"")+e)}}function be(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Ae(t,e,i){var o=e||new I(0,0);t.style[re]=(gt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Ce(t,e){t._leaflet_pos=e,bt?Ae(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Se(t){return t._leaflet_pos||new I(0,0)}if("onselectstart"in document)ee=function(){Pe(window,"selectstart",Ze)},ie=function(){Ne(window,"selectstart",Ze)};else{var Ee=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Ee){var t=document.documentElement.style;oe=t[Ee],t[Ee]="none"}},ie=function(){Ee&&(document.documentElement.style[Ee]=oe,oe=void 0)}}function Te(){Pe(window,"dragstart",Ze)}function $e(){Ne(window,"dragstart",Ze)}function Oe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Le(),ne=t,se=t.style.outline,t.style.outline="none",Pe(window,"keydown",Le))}function Le(){ne&&(ne.style.outline=se,ne=void 0,se=void 0,Ne(window,"keydown",Le))}function Me(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ie=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:ge,hasClass:fe,addClass:ve,removeClass:be,setClass:ye,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Ae,setPosition:Ce,getPosition:Se,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Te,enableImageDrag:$e,preventOutline:Oe,restoreOutline:Le,getSizedParentNode:Me,getScale:ze});function Pe(t,e,i,o){if("object"==typeof e)for(var n in e)Be(t,n,e[n],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,o);return this}var De="_leaflet_events";function Ne(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,o);else{for(var a in t[De])Re(t,a,t[De][a]);delete t[De]}return this}function Be(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):"");if(t[De]&&t[De][n])return this;var s=function(e){return i.call(o||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Ut(t,e,s,n):!At||"dblclick"!==e||!Xt||kt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Je(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&nt&&(s=function(t){Xe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Xt(t,s,n),t[De]=t[De]||{},t[De][n]=s}function Re(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):""),s=t[De]&&t[De][n];if(!s)return this;kt&&0===e.indexOf("touch")?Ft(t,e,n):!At||"dblclick"!==e||!te||kt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,n),t[De][n]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Ke(t),this}function Ue(t){return Be(t,"mousewheel",qe),this}function Fe(t){return Pe(t,"mousedown touchstart dblclick",qe),Be(t,"click",Ye),this}function Ze(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function je(t){return Ze(t),qe(t),this}function Ve(t,e){if(!e)return new I(t.clientX,t.clientY);var i=ze(e),o=i.boundingClientRect;return new I((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var He=mt&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He: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}var Ge,Qe={};function Ye(t){Qe[t.type]=!0}function Ke(t){var e=Qe[t.type];return Qe[t.type]=!1,e}function Je(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}function Xe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,o=Ge&&i-Ge;o&&o>100&&o<500||t.target._simulatedClick&&!t._simulated?je(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Pe,off:Ne,stopPropagation:qe,disableScrollPropagation:Ue,disableClickPropagation:Fe,preventDefault:Ze,stop:je,getMousePosition:Ve,getWheelDelta:We,fakeStop:Ye,skipped:Ke,isExternalTarget:Je,addListener:Pe,removeListener:Ne}),ei=z.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Se(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=S(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ce(this._el,i),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=z.extend({options:{crs:Q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&bt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Pe(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=o({animate:i.animate},i.zoom),i.pan=o({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),s=(t instanceof I?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),r=this.containerPointToLatLng(n.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),o=D(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var s=o.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(r.add(a).divideBy(2).add(s),n),zoom:n}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!bt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=n.distanceTo(o)||1,c=1.42,d=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*h*h)/(2*(t?l:a)*d*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function g(t){return p(t)/m(t)}var f=u(0);function v(t){return a*(m(f)/m(f+c*t))}function b(t){return a*(m(f)*g(f+c*t)-p(f))/d}function y(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-f)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=y(i)*x;i<=1?(this._flyToFrame=S(k,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(b(s)/h)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,q(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=D(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),s=this.project(n),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=B([a.min.add(i),a.max.subtract(o)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=D(r.x+c.x,r.y+c.y);(r.x<h.min.x||r.x>h.max.x)&&(d.x=s.x-c.x,c.x>0?d.x+=l.x-i.x:d.x-=l.x-o.x),(r.y<h.min.y||r.y>h.max.y)&&(d.y=s.y-c.y,c.y>0?d.y+=l.y-i.y:d.y-=l.y-o.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),r=i.divideBy(2).round(),a=n.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(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):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=o({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,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){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){var e=new U(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}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._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(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("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:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new R(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=q(t),i=D(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=B(this.project(a,o),this.project(r,o)).getSize(),c=bt?this.options.zoomSnap:1,d=l.x/h.x,u=l.y/h.y,p=e?Math.max(d,u):Math.min(d,u);return o=this.getScaleZoom(p,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(s,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new I(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 o=i.zoom(t*i.scale(e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(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(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(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(F(t)))},mouseEventToContainerPoint:function(t){return Ve(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=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Pe(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&bt,ve(t,"leaflet-container"+(At?" leaflet-touch":"")+(Et?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(dt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ce(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==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),Ce(this._mapPane,new I(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ce(this._mapPane,new I(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ce(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[a(this._container)]=this;var e=t?Ne:Pe;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),bt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=S((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,o=[],n="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(n&&!Je(s,t))break;if(o.push(i),n)break}if(s===this._container)break;s=s.parentNode}return o.length||r||n||!Je(s,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Ke(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Oe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=o({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Ze(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Se(this._mapPane)||new I(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return B([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),s=new N(o.subtract(n),o.add(n)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(o.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=B(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),s=o.max.subtract(t.max);return new I(this._rebound(n.x,-s.x),this._rebound(n.y,-s.y))},_rebound:function(t,e){return t+e>0?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(),o=bt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){be(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=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Ae(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",(function(){var t=this.getCenter(),e=this.getZoom();Ae(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_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 o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(S((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&be(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),S((function(){this._moveEnd(!0)}),this))}});function oi(t,e){return new ii(t,e)}var ni=$.extend({options:{position:"topright"},initialize:function(t){m(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(),o=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(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()}}),si=function(t){return new ni(t)};ii.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=de("div",e+"control-container",this._container);function o(o,n){var s=e+o+" "+e+n;t[o+n]=de("div",s,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=ni.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ni.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):be(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return be(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Fe(e),Ue(e);var o=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||Pe(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=de("a",t+"-toggle",e);n.href="#",n.title="Layers",At?(Pe(n,"click",je),Pe(n,"click",this.expand,this)):Pe(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",o),this._separator=de("div",t+"-separator",o),this._overlaysList=de("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)o=this._layers[i],this._addItem(o),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(t=t&&n>1,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(a(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='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+a(this),o),this._layerControlInputs.push(e),e.layerId=a(t.layer),Pe(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])&&this._map.removeLayer(n[s]);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])||this._map.addLayer(o[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)t=i[n],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=ni.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.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._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var s=de("a",i,o);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Fe(s),Pe(s,"click",je),Pe(s,"click",n,this),Pe(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";be(this._zoomInButton,e),be(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var hi=function(t){return new li(t)},ci=ni.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.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=de("div",e,i)),t.imperial&&(this._iScale=de("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,o,n=3.2808399*t;n>5280?(e=n/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_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)}}),di=function(t){return new ci(t)},ui=ni.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),Fe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},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(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};ni.Layers=ri,ni.Zoom=li,ni.Scale=ci,ni.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=$.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}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var gi,fi={Events:M},vi=At?"touchstart mousedown":"mousedown",bi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){m(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Pe(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!fe(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Oe(this._element),Te(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Me(this._element);this._startPoint=new I(e.clientX,e.clientY),this._parentScale=ze(i),Pe(document,yi[t.type],this._onMove,this),Pe(document,bi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&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 I(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ze(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Se(this._element).subtract(i),ve(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ve(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,E(this._animRequest),this._lastEvent=t,this._animRequest=S(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ce(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in be(document.body,"leaflet-dragging"),this._lastTarget&&(be(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yi)Ne(document,yi[t],this._onMove,this),Ne(document,bi[t],this._onUp,this);$e(),ie(),this._moved&&this._moving&&(E(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Ai(t=Si(t,i),i)}function wi(t,e,i){return Math.sqrt(Li(t,e,i,!0))}function ki(t,e,i){return Li(t,e,i)}function Ai(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Ci(t,o,e,0,i-1);var n,s=[];for(n=0;n<i;n++)o[n]&&s.push(t[n]);return s}function Ci(t,e,i,o,n){var s,r,a,l=0;for(r=o+1;r<=n-1;r++)(a=Li(t[r],t[o],t[n],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ci(t,e,i,o,s),Ci(t,e,i,s,n))}function Si(t,e){for(var i=[t[0]],o=1,n=0,s=t.length;o<s;o++)Oi(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<s-1&&i.push(t[s-1]),i}function Ei(t,e,i,o,n){var s,r,a,l=o?gi:$i(t,i),h=$i(e,i);for(gi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=$i(r=Ti(t,e,s=l||h,i,n),i),s===l?(t=r,l=a):(e=r,h=a)}}function Ti(t,e,i,o,n){var s,r,a=e.x-t.x,l=e.y-t.y,h=o.min,c=o.max;return 8&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):4&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):2&i?(s=c.x,r=t.y+l*(c.x-t.x)/a):1&i&&(s=h.x,r=t.y+l*(h.x-t.x)/a),new I(s,r,n)}function $i(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Oi(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Li(t,e,i,o){var n,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((n=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):n>0&&(s+=a*n,r+=l*n)),a=t.x-s,l=t.y-r,o?a*a+l*l:new I(s,r)}function Mi(t){return!b(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."),Mi(t)}var Ii=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ei,_getEdgeIntersection:Ti,_getBitCode:$i,_sqClosestPointOnSegment:Li,isFlat:Mi,_flat:zi});function Pi(t,e,i){var o,n,s,r,a,l,h,c,d,u=[1,4,2,8];for(n=0,h=t.length;n<h;n++)t[n]._code=$i(t[n],e);for(r=0;r<4;r++){for(c=u[r],o=[],n=0,s=(h=t.length)-1;n<h;s=n++)a=t[n],l=t[s],a._code&c?l._code&c||((d=Ti(l,a,c,e,i))._code=$i(d,e),o.push(d)):(l._code&c&&((d=Ti(l,a,c,e,i))._code=$i(d,e),o.push(d)),o.push(a));t=o}return t}var Di=(Object.freeze||Object)({clipPolygon:Pi}),Ni={project:function(t){return new I(t.lng,t.lat)},unproject:function(t){return new U(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Bi={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,o=t.lat*e,n=this.R_MINOR/i,s=Math.sqrt(1-n*n),r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-r)/(1+r),s/2);return o=-i*Math.log(Math.max(a,1e-10)),new I(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,s=Math.sqrt(1-n*n),r=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=h=Math.PI/2-2*Math.atan(r*e)-a;return new U(a*i,t.x*i/o)}},Ri=(Object.freeze||Object)({LonLat:Ni,Mercator:Bi,SphericalMercator:H}),qi=o({},j,{code:"EPSG:3395",projection:Bi,transformation:function(){var t=.5/(Math.PI*Bi.R);return G(t,.5,-t,.5)}()}),Ui=o({},j,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Fi=o({},Z,{projection:Ni,transformation:G(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,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});Z.Earth=j,Z.EPSG3395=qi,Z.EPSG3857=Q,Z.EPSG900913=Y,Z.EPSG4326=Ui,Z.Simple=Fi;var Zi=z.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[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(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.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(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=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),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!!t&&a(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?b(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var ji=Zi.extend({initialize:function(t,e){var i,o;if(m(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),Vi=function(t,e){return new ji(t,e)},Hi=ji.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ji.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),ji.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new R;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Hi(t)},Gi=$.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=D(o),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Et&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Qi(t){return new Gi(t)}var Yi=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ki=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&be(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,s=Se(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=B(r.min._subtract(a).add(n),r.max._subtract(a).subtract(n));if(!l.contains(s)){var h=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(o);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ce(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=S(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=S(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Se(e._icon),n=e._map.layerPointToLatLng(o);i&&Ce(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ji=Zi.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),s=!1;n!==this._shadow&&(this._removeShadow(),s=!0),n&&(ve(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Ce(this._icon,t),this._shadow&&Ce(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ki)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ki(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Ji(t,e)}var to=Zi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),eo=to.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=F(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return to.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new N(this._point.subtract(o),this._point.add(o))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function io(t,e){return new eo(t,e)}var oo=eo.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=o({},i,{radius:e})),m(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new R(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:to.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===j.distance){var n=Math.PI/180,s=this._mRadius/j.R/n,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(s*n)-Math.sin(e*n)*Math.sin(h*n))/(Math.cos(e*n)*Math.cos(h*n)))/n;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-r.y}else{var d=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function no(t,e,i){return new oo(t,e,i)}var so=to.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,s=Li,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],h=1,c=l.length;h<c;h++){var d=s(t,e=l[h-1],i=l[h],!0);d<o&&(o=d,n=s(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<l-1;t++)if(n=a[t],s=a[t+1],(o+=i=n.distanceTo(s))>e)return r=(o-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-n.x),s.y-r*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new R,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Mi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Mi(t),o=0,n=t.length;o<n;o++)i?(e[o]=F(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new I(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,s=t[0]instanceof U,r=t.length;if(s){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,s,r,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ei(a[i],a[i+1],t,i,!0))&&(l[o]=l[o]||[],l[o].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[o].push(r[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(o=0,n=(r=(a=this._parts[i]).length)-1;o<r;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new so(t,e)}so._flat=zi;var ao=so.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,s,r,a,l,h=this._rings[0],c=h.length;if(!c)return null;for(s=r=a=0,t=0,e=c-1;t<c;e=t++)i=h[t],o=h[e],n=i.y*o.x-o.y*i.x,r+=(i.x+o.x)*n,a+=(i.y+o.y)*n,s+=3*n;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=so.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof U&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){so.prototype._setLatLngs.call(this,t),Mi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new I(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 o,n=0,s=this._rings.length;n<s;n++)(o=Pi(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=0,r=(l=(e=this._parts[n]).length)-1;s<l;r=s++)i=e[s],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(h=!h);return h||so.prototype._containsPoint.call(this,t,!0)}});function lo(t,e){return new ao(t,e)}var ho=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=b(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=co(t,s);return r?(r.feature=vo(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=o({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function co(t,e){var i,o,n,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Ji(i);case"MultiPoint":for(n=0,s=a.length;n<s;n++)i=c(a[n]),l.push(h?h(t,i):new Ji(i));return new Hi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===r.type?0:1,c),new so(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===r.type?1:2,c),new ao(o,e);case"GeometryCollection":for(n=0,s=r.geometries.length;n<s;n++){var d=co({geometry:r.geometries[n],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function uo(t){return new U(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],s=0,r=t.length;s<r;s++)o=e?po(t[s],e-1,i):(i||uo)(t[s]),n.push(o);return n}function mo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function go(t,e,i,o){for(var n=[],s=0,r=t.length;s<r;s++)n.push(e?go(t[s],e-1,i,o):mo(t[s],o));return!e&&i&&n.push(n[0]),n}function fo(t,e){return t.feature?o({},t.feature,{geometry:e}):vo(e)}function vo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var bo={toGeoJSON:function(t){return fo(this,{type:"Point",coordinates:mo(this.getLatLng(),t)})}};function yo(t,e){return new ho(t,e)}Ji.include(bo),oo.include(bo),eo.include(bo),so.include({toGeoJSON:function(t){var e=!Mi(this._latlngs);return fo(this,{type:(e?"Multi":"")+"LineString",coordinates:go(this._latlngs,e?1:0,!1,t)})}}),ao.include({toGeoJSON:function(t){var e=!Mi(this._latlngs),i=e&&!Mi(this._latlngs[0]),o=go(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),fo(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),ji.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),fo(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,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var s=vo(n);"FeatureCollection"===s.type?o.push.apply(o,s.features):o.push(s)}}})),i?fo(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var _o=yo,xo=Zi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(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&&me(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(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:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(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;Ae(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();Ce(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(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)}}),wo=function(t,e,i){return new xo(t,e,i)},ko=xo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],n=0;n<i.length;n++)o.push(i[n].src);this._url=i.length>0?o:[e.src]}else{b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=de("source");a.src=this._url[r],e.appendChild(a)}}}});function Ao(t,e,i){return new ko(t,e,i)}var Co=xo.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=c,t.onmousemove=c}});function So(t,e,i){return new Co(t,e,i)}var Eo=Zi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){m(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(xe(this._container,0),this._removeTimeout=setTimeout(s(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Zi||(i=e,e=t),e instanceof Hi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ce(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),To=Eo.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Eo.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof to||this._source.on("preclick",qe))},onRemove:function(t){Eo.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof to||this._source.off("preclick",qe))},getEvents:function(){var t=Eo.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=de("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=de("div",t+"-content-wrapper",e);if(this._contentNode=de("div",t+"-content",i),Fe(i),Ue(this._contentNode),Pe(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=de("a",t+"-close-button",e);o.href="#close",o.innerHTML="×",Pe(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,n=this.options.maxHeight,s="leaflet-popup-scrolled";n&&o>n?(e.height=n+"px",ve(t,s)):be(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ce(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new I(this._containerLeft,-i-this._containerBottom);n._add(Se(this._container));var s=t.layerPointToContainerPoint(n),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+o+l.x>h.x&&(c=s.x+o-h.x+l.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+l.y>h.y&&(d=s.y+i-h.y+l.y),s.y-d-a.y<0&&(d=s.y-a.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),je(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),$o=function(t,e){return new To(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof To||(t=new To(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Zi.include({bindPopup:function(t,e){return t instanceof To?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new To(e,this)),this._popup.setContent(t)),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,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),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){var e=t.layer||t.target;this._popup&&this._map&&(je(t),e instanceof to?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Oo=Eo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Eo.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Eo.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Eo.prototype.getEvents.call(this);return At&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,o=e.latLngToContainerPoint(e.getCenter()),n=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&n.x<o.x?(s="right",t=t.add(D(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+h.x-l.x,a/2-h.y-l.y,!0))),be(i,"leaflet-tooltip-right"),be(i,"leaflet-tooltip-left"),be(i,"leaflet-tooltip-top"),be(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ce(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Lo=function(t,e){return new Oo(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Oo||(t=new Oo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Zi.include({bindTooltip:function(t,e){return t instanceof Oo?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Oo(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),At&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(be(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Mo=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=D(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zo(t){return new Mo(t)}Gi.Default=Yi;var Io=Zi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof I?t:new I(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,s=i.length;n<s;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var s=Math.min(1,(t-n.loaded)/200);xe(n.el,s),s<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(E(this._fadeFrame),this._fadeFrame=S(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),c(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new I(+n,+s);a.z=+r;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),r>o&&this._retainParent(n,s,r,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var s=2*e;s<2*e+2;s++){var r=new I(n,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+1<o&&this._retainChildren(n,s,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom)&&(n=void 0);var s=this.options.updateWhenZooming&&n!==this._tileZoom;o&&!s||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();bt?Ae(t.el,n,o):Ce(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*o);return new N(n.subtract(s),n.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),s=n.getCenter(),r=[],a=this.options.keepBuffer,l=new N(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new I(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=n.min.y;d<=n.max.y;d++)for(var u=n.min.x;u<=n.max.x;u++){var p=new I(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.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 g=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],g);this._level.el.appendChild(g)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new R(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 I(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(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,et&&this.options.opacity<1&&xe(t,this.options.opacity),nt&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),n=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(n),this.createTile.length<2&&S(s(this._tileReady,this,t,null,n)),Ce(n,i),this._tiles[o]={el:n,coords:t,current:!0},e.appendChild(n),this.fire("tileloadstart",{tile:n,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),E(this._fadeFrame),this._fadeFrame=S(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ve(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?S(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new I(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(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 Po(t){return new Io(t)}var Do=Io.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Et&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||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 Pe(i,"load",s(this._tileOnLoad,this,e,i)),Pe(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Et?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,o(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),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)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Io.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Io.prototype._tileReady.call(this,t,e,i)}});function No(t,e){return new Do(t,e)}var Bo=Do.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 i=o({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);var s=(e=m(this,e)).detectRetina&&Et?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},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,Do.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=B(i.project(e[0]),i.project(e[1])),n=o.min,s=o.max,r=(this._wmsVersion>=1.3&&this._crs===Ui?[n.y,n.x,s.y,s.x]:[n.x,n.y,s.x,s.y]).join(","),a=Do.prototype.getTileUrl.call(this,t);return a+g(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return o(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new Bo(t,e)}Do.WMS=Bo,No.wms=Ro;var qo=Zi.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(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),o=Se(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=n.multiplyBy(-i).add(o).add(n).subtract(r);bt?Ae(this._container,a,i):Ce(this._container,a)},_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()}}),Uo=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Pe(t,"mousemove",l(this._onMouseMove,32,this),this),Pe(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Pe(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,ue(this._container),Ne(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){qo.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=Et?2:1;Ce(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Et&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(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,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(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,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||S(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=r[i].length;o<n;o++)s=r[i][o],l[o?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(be(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,o,n=this._drawFirst;n;n=n.next)(i=n.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(ve(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fo(t){return Tt?new Uo(t):null}var Zo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),jo={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qo.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Zo("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Zo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(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;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Zo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,o.dashArray?e.dashStyle=b(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Zo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){ge(t._container)}},Vo=Ot?Zo:K,Ho=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qo.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)),Ce(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=Vo("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(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),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){ge(t._path)}});function Wo(t){return $t||Ot?new Ho(t):null}Ot&&Ho.include(jo),ii.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&&Fo(t)||Wo(t)}});var Go=ao.extend({initialize:function(t,e){ao.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Qo(t,e){return new Go(t,e)}Ho.create=Vo,Ho.pointsToPath=J,ho.geometryToLayer=co,ho.coordsToLatLng=uo,ho.coordsToLatLngs=po,ho.latLngToCoords=mo,ho.latLngsToCoords=go,ho.getFeature=fo,ho.asFeature=vo,ii.mergeOptions({boxZoom:!0});var Yo=mi.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(){Pe(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(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(),ee(),Te(),this._startPoint=this._map.mouseEventToContainerPoint(t),Pe(document,{contextmenu:je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(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();Ce(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),be(this._container,"leaflet-crosshair")),ie(),$e(),Ne(document,{contextmenu:je,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(s(this._resetState,this),0);var e=new R(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()}});ii.addInitHook("addHandler","boxZoom",Yo),ii.mergeOptions({doubleClickZoom:!0});var Ko=mi.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(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ii.addInitHook("addHandler","doubleClickZoom",Ko),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jo=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(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))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){be(this._map._container,"leaflet-grab"),be(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=q(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.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.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,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,s=(o+e+i)%t-e-i,r=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=n.multiplyBy(r/s),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),d=h/(i.inertiaDeceleration*r),u=c.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),S((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Jo),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xo=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Pe(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){Pe(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}je(t)}}});ii.addInitHook("addHandler","keyboard",Xo),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=mi.extend({addHooks:function(){Pe(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),o),je(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=this._delta/(4*this._map.options.wheelPxPerZoomLevel),n=4*Math.log(2/(1+Math.exp(-Math.abs(o))))/Math.LN2,s=i?Math.ceil(n/i)*i:n,r=t._limitZoom(e+(this._delta>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))}});ii.addInitHook("addHandler","scrollWheelZoom",tn),ii.mergeOptions({tap:!0,tapTolerance:15});var en=mi.extend({addHooks:function(){Pe(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ze(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new I(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Pe(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&be(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new I(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});At&&!kt&&ii.addInitHook("addHandler","tap",en),ii.mergeOptions({touchZoom:At&&!st,bounceAtZoomLimits:!0});var on=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Pe(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){be(this._map._container,"leaflet-touch-zoom"),Ne(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]),o=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(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Pe(document,"touchmove",this._onTouchMove,this),Pe(document,"touchend",this._onTouchEnd,this),Ze(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),n=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(n,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&n<1||this._zoom>e.getMaxZoom()&&n>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===n)return}else{var r=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===n&&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),E(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=S(a,this,!0),Ze(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),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}});ii.addInitHook("addHandler","touchZoom",on),ii.BoxZoom=Yo,ii.DoubleClickZoom=Ko,ii.Drag=Jo,ii.Keyboard=Xo,ii.ScrollWheelZoom=tn,ii.Tap=en,ii.TouchZoom=on,Object.freeze=i,t.version=e,t.Control=ni,t.control=si,t.Browser=Mt,t.Evented=z,t.Mixin=fi,t.Util=T,t.Class=$,t.Handler=mi,t.extend=o,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Ie,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Ii,t.PolyUtil=Di,t.Point=I,t.point=D,t.Bounds=N,t.bounds=B,t.Transformation=W,t.transformation=G,t.Projection=Ri,t.LatLng=U,t.latLng=F,t.LatLngBounds=R,t.latLngBounds=q,t.CRS=Z,t.GeoJSON=ho,t.geoJSON=yo,t.geoJson=_o,t.Layer=Zi,t.LayerGroup=ji,t.layerGroup=Vi,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xo,t.imageOverlay=wo,t.VideoOverlay=ko,t.videoOverlay=Ao,t.SVGOverlay=Co,t.svgOverlay=So,t.DivOverlay=Eo,t.Popup=To,t.popup=$o,t.Tooltip=Oo,t.tooltip=Lo,t.Icon=Gi,t.icon=Qi,t.DivIcon=Mo,t.divIcon=zo,t.Marker=Ji,t.marker=Xi,t.TileLayer=Do,t.tileLayer=No,t.GridLayer=Io,t.gridLayer=Po,t.SVG=Ho,t.svg=Wo,t.Renderer=qo,t.Canvas=Uo,t.canvas=Fo,t.Path=to,t.CircleMarker=eo,t.circleMarker=io,t.Circle=oo,t.circle=no,t.Polyline=so,t.polyline=ro,t.Polygon=ao,t.polygon=lo,t.Rectangle=Go,t.rectangle=Qo,t.Map=ii,t.map=oi;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t})(uc.exports);var pc=uc.exports;const mc={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},gc={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},fc=()=>mc;class vc extends lt{static get styles(){return r`
|
|
8259
|
+
`}}t([ge({type:Array,attribute:!1})],uc.prototype,"path",void 0),t([ge()],uc.prototype,"endpoint",void 0),t([ge()],uc.prototype,"osmId",void 0),t([ge({type:Object})],uc.prototype,"hovered",void 0),t([ge({type:Object})],uc.prototype,"editFeature",void 0),t([ge({type:String,attribute:!1})],uc.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var pc={exports:{}};(function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function o(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}Object.freeze=function(t){return t};var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var o,n,s,r;return r=function(){o=!1,n&&(s.apply(i,n),n=!1)},s=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(r,e),o=!0)},s}function h(t,e,i){var o=e[1],n=e[0],s=o-n;return t===o&&i?t:((t-n)%s+s)%s+n}function c(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function g(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var f=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(f,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var A=window.requestAnimationFrame||x("RequestAnimationFrame")||k,C=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function S(t,e,i){if(!i||A!==k)return A.call(window,s(t,e));t.call(e)}function E(t){t&&C.call(window,t)}var T=(Object.freeze||Object)({freeze:i,extend:o,create:n,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:g,template:v,isArray:b,indexOf:y,emptyImageUrl:_,requestFn:A,cancelFn:C,requestAnimFrame:S,cancelAnimFrame:E});function $(){}function O(t){if("undefined"!=typeof L&&L&&L.Mixin){t=b(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}$.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=n(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(o(e,t.statics),delete t.statics),t.includes&&(O(t.includes),o.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=o(n(s.options),t.options)),o(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},$.include=function(t){return o(this.prototype,t),this},$.mergeOptions=function(t){return o(this.prototype.options,t),this},$.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var M={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(o=[],this._events[t]=o),i===this&&(i=void 0);for(var n={fn:e,ctx:i},s=o,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(n)},_off:function(t,e,i){var o,n,s;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,s=o.length;n<s;n++){var r=o[n];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,s=o.length;n<s;n++)o[n].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=o({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var n=s((function(){this.off(t,e,i).off(t,n,i)}),this);return this.on(t,e,i).on(t,n,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,o({layer:t.target,propagatedFrom:t.target},t),!0)}};M.addEventListener=M.on,M.removeEventListener=M.clearAllEventListeners=M.off,M.addOneTimeEventListener=M.once,M.fireEvent=M.fire,M.hasEventListeners=M.listens;var z=$.extend(M);function I(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var P=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof I?t:b(t)?new I(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new I(t.x,t.y):new I(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function B(t,e){return!t||t instanceof N?t:new N(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function q(t,e){return t instanceof R?t:new R(t,e)}function U(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof U?t:b(t)&&"object"!=typeof t[0]?3===t.length?new U(t[0],t[1],t[2]):2===t.length?new U(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new U(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new U(t,e,i)}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new I(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new I(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=P(this.x),this.y=P(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new I(this.min.x,this.max.y)},getTopRight:function(){return new I(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof I?D(t):B(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=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,o=t.min,n=t.max,s=n.x>=e.x&&o.x<=i.x,r=n.y>=e.y&&o.y<=i.y;return s&&r},overlaps:function(t){t=B(t);var e=this.min,i=this.max,o=t.min,n=t.max,s=n.x>e.x&&o.x<i.x,r=n.y>e.y&&o.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof U)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(F(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new U(e.lat,e.lng),this._northEast=new U(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new U(e.lat-o,e.lng-n),new U(i.lat+o,i.lng+n))},getCenter:function(){return new U((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof U||"lat"in t?F(t):q(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>=e.lat&&o.lat<=i.lat,r=n.lng>=e.lng&&o.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>e.lat&&o.lat<i.lat,r=n.lng>e.lng&&o.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},U.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return j.distance(this,F(t))},wrap:function(){return j.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return q([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new U(this.lat,this.lng,this.alt)}};var Z={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new U(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new R(new U(s.lat-o,s.lng-n),new U(r.lat-o,r.lng-n))}},j=o({},Z,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(o)*Math.cos(n)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),V=6378137,H={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new I(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new U((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=V*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,o){if(b(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function G(t,e,i,o){return new W(t,e,i,o)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new I((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var Q=o({},j,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),Y=o({},Q,{code:"EPSG:900913"});function K(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function J(t,e){var i,o,n,s,r,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,s=(r=t[i]).length;o<s;o++)l+=(o?"L":"M")+(a=r[o]).x+" "+a.y;l+=e?$t?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=Lt("webkit"),nt=Lt("android"),st=Lt("android 2")||Lt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&Lt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=Lt("chrome"),ct=Lt("gecko")&&!ot&&!lt&&!tt,dt=!ht&&Lt("safari"),ut=Lt("phantom"),pt="OTransition"in X,mt=0===navigator.platform.indexOf("Win"),gt=tt&&"transition"in X,ft="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in X,bt=!window.L_DISABLE_3D&&(gt||ft||vt)&&!pt&&!ut,yt="undefined"!=typeof orientation||Lt("mobile"),_t=yt&&ot,xt=yt&&ft,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),At=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=yt&<,St=yt&&ct,Et=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Tt=!!document.createElement("canvas").getContext,$t=!(!document.createElementNS||!K("svg").createSVGRect),Ot=!$t&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Lt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Mt=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:gt,webkit3d:ft,gecko3d:vt,any3d:bt,mobile:yt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:At,mobileOpera:Ct,mobileGecko:St,retina:Et,canvas:Tt,svg:$t,vml:Ot}),zt=wt?"MSPointerDown":"pointerdown",It=wt?"MSPointerMove":"pointermove",Pt=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Bt={},Rt=!1,qt=0;function Ut(t,e,i,o){return"touchstart"===e?Zt(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Qt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,o,!1):"touchmove"===e?t.removeEventListener(It,o,!1):"touchend"===e&&(t.removeEventListener(Pt,o,!1),t.removeEventListener(Dt,o,!1)),this}function Zt(t,e,i){var o=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Ze(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(zt,o,!1),Rt||(document.documentElement.addEventListener(zt,jt,!0),document.documentElement.addEventListener(It,Vt,!0),document.documentElement.addEventListener(Pt,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Rt=!0)}function jt(t){Bt[t.pointerId]=t,qt++}function Vt(t){Bt[t.pointerId]&&(Bt[t.pointerId]=t)}function Ht(t){delete Bt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Bt)t.touches.push(Bt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(It,o,!1)}function Qt(t,e,i){var o=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Pt,o,!1),t.addEventListener(Dt,o,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Kt=wt?"MSPointerUp":kt?"pointerup":"touchend",Jt="_leaflet_";function Xt(t,e,i){var o,n,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(o||i);n=t.touches?t.touches[0]:t,s=a>0&&a<=r,o=i}}function l(t){if(s&&!n.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in n)i=n[r],a[r]=i&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Jt+Yt+i]=a,t[Jt+Kt+i]=l,t[Jt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Kt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Jt+Yt+e],o=t[Jt+Kt+e],n=t[Jt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Kt,o,!1),it||t.removeEventListener("dblclick",n,!1),this}var ee,ie,oe,ne,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function de(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function fe(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!fe(t,e)){var s=_e(t);ye(t,(s?s+" ":"")+e)}}function be(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Ae(t,e,i){var o=e||new I(0,0);t.style[re]=(gt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Ce(t,e){t._leaflet_pos=e,bt?Ae(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Se(t){return t._leaflet_pos||new I(0,0)}if("onselectstart"in document)ee=function(){Pe(window,"selectstart",Ze)},ie=function(){Ne(window,"selectstart",Ze)};else{var Ee=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Ee){var t=document.documentElement.style;oe=t[Ee],t[Ee]="none"}},ie=function(){Ee&&(document.documentElement.style[Ee]=oe,oe=void 0)}}function Te(){Pe(window,"dragstart",Ze)}function $e(){Ne(window,"dragstart",Ze)}function Oe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Le(),ne=t,se=t.style.outline,t.style.outline="none",Pe(window,"keydown",Le))}function Le(){ne&&(ne.style.outline=se,ne=void 0,se=void 0,Ne(window,"keydown",Le))}function Me(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ie=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:ge,hasClass:fe,addClass:ve,removeClass:be,setClass:ye,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Ae,setPosition:Ce,getPosition:Se,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Te,enableImageDrag:$e,preventOutline:Oe,restoreOutline:Le,getSizedParentNode:Me,getScale:ze});function Pe(t,e,i,o){if("object"==typeof e)for(var n in e)Be(t,n,e[n],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,o);return this}var De="_leaflet_events";function Ne(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,o);else{for(var a in t[De])Re(t,a,t[De][a]);delete t[De]}return this}function Be(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):"");if(t[De]&&t[De][n])return this;var s=function(e){return i.call(o||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Ut(t,e,s,n):!At||"dblclick"!==e||!Xt||kt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Je(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&nt&&(s=function(t){Xe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Xt(t,s,n),t[De]=t[De]||{},t[De][n]=s}function Re(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):""),s=t[De]&&t[De][n];if(!s)return this;kt&&0===e.indexOf("touch")?Ft(t,e,n):!At||"dblclick"!==e||!te||kt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,n),t[De][n]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Ke(t),this}function Ue(t){return Be(t,"mousewheel",qe),this}function Fe(t){return Pe(t,"mousedown touchstart dblclick",qe),Be(t,"click",Ye),this}function Ze(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function je(t){return Ze(t),qe(t),this}function Ve(t,e){if(!e)return new I(t.clientX,t.clientY);var i=ze(e),o=i.boundingClientRect;return new I((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var He=mt&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He: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}var Ge,Qe={};function Ye(t){Qe[t.type]=!0}function Ke(t){var e=Qe[t.type];return Qe[t.type]=!1,e}function Je(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}function Xe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,o=Ge&&i-Ge;o&&o>100&&o<500||t.target._simulatedClick&&!t._simulated?je(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Pe,off:Ne,stopPropagation:qe,disableScrollPropagation:Ue,disableClickPropagation:Fe,preventDefault:Ze,stop:je,getMousePosition:Ve,getWheelDelta:We,fakeStop:Ye,skipped:Ke,isExternalTarget:Je,addListener:Pe,removeListener:Ne}),ei=z.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Se(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=S(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ce(this._el,i),this.fire("step")},_complete:function(){E(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=z.extend({options:{crs:Q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&bt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Pe(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=o({animate:i.animate},i.zoom),i.pan=o({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),s=(t instanceof I?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),r=this.containerPointToLatLng(n.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),o=D(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var s=o.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(r.add(a).divideBy(2).add(s),n),zoom:n}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!bt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=n.distanceTo(o)||1,c=1.42,d=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*h*h)/(2*(t?l:a)*d*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function g(t){return p(t)/m(t)}var f=u(0);function v(t){return a*(m(f)/m(f+c*t))}function b(t){return a*(m(f)*g(f+c*t)-p(f))/d}function y(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-f)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=y(i)*x;i<=1?(this._flyToFrame=S(k,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(b(s)/h)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,q(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=D(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),s=this.project(n),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=B([a.min.add(i),a.max.subtract(o)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=D(r.x+c.x,r.y+c.y);(r.x<h.min.x||r.x>h.max.x)&&(d.x=s.x-c.x,c.x>0?d.x+=l.x-i.x:d.x-=l.x-o.x),(r.y<h.min.y||r.y>h.max.y)&&(d.y=s.y-c.y,c.y>0?d.y+=l.y-i.y:d.y-=l.y-o.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),r=i.divideBy(2).round(),a=n.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(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):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=o({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,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){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){var e=new U(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}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._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(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("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:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new R(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=q(t),i=D(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=B(this.project(a,o),this.project(r,o)).getSize(),c=bt?this.options.zoomSnap:1,d=l.x/h.x,u=l.y/h.y,p=e?Math.max(d,u):Math.min(d,u);return o=this.getScaleZoom(p,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(s,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new I(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 o=i.zoom(t*i.scale(e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(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(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(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(F(t)))},mouseEventToContainerPoint:function(t){return Ve(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=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Pe(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&bt,ve(t,"leaflet-container"+(At?" leaflet-touch":"")+(Et?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(dt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ce(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==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),Ce(this._mapPane,new I(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ce(this._mapPane,new I(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ce(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[a(this._container)]=this;var e=t?Ne:Pe;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),bt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=S((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,o=[],n="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(n&&!Je(s,t))break;if(o.push(i),n)break}if(s===this._container)break;s=s.parentNode}return o.length||r||n||!Je(s,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Ke(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Oe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=o({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Ze(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Se(this._mapPane)||new I(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return B([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),s=new N(o.subtract(n),o.add(n)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(o.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=B(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),s=o.max.subtract(t.max);return new I(this._rebound(n.x,-s.x),this._rebound(n.y,-s.y))},_rebound:function(t,e){return t+e>0?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(),o=bt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){be(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=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Ae(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",(function(){var t=this.getCenter(),e=this.getZoom();Ae(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_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 o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(S((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&be(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),S((function(){this._moveEnd(!0)}),this))}});function oi(t,e){return new ii(t,e)}var ni=$.extend({options:{position:"topright"},initialize:function(t){m(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(),o=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(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()}}),si=function(t){return new ni(t)};ii.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=de("div",e+"control-container",this._container);function o(o,n){var s=e+o+" "+e+n;t[o+n]=de("div",s,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=ni.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ni.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):be(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return be(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Fe(e),Ue(e);var o=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||Pe(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=de("a",t+"-toggle",e);n.href="#",n.title="Layers",At?(Pe(n,"click",je),Pe(n,"click",this.expand,this)):Pe(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",o),this._separator=de("div",t+"-separator",o),this._overlaysList=de("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)o=this._layers[i],this._addItem(o),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(t=t&&n>1,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(a(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='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+a(this),o),this._layerControlInputs.push(e),e.layerId=a(t.layer),Pe(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])&&this._map.removeLayer(n[s]);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])||this._map.addLayer(o[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)t=i[n],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=ni.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.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._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var s=de("a",i,o);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Fe(s),Pe(s,"click",je),Pe(s,"click",n,this),Pe(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";be(this._zoomInButton,e),be(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var hi=function(t){return new li(t)},ci=ni.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.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=de("div",e,i)),t.imperial&&(this._iScale=de("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,o,n=3.2808399*t;n>5280?(e=n/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_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)}}),di=function(t){return new ci(t)},ui=ni.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),Fe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},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(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};ni.Layers=ri,ni.Zoom=li,ni.Scale=ci,ni.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=$.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}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var gi,fi={Events:M},vi=At?"touchstart mousedown":"mousedown",bi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){m(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Pe(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!fe(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Oe(this._element),Te(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Me(this._element);this._startPoint=new I(e.clientX,e.clientY),this._parentScale=ze(i),Pe(document,yi[t.type],this._onMove,this),Pe(document,bi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&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 I(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ze(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Se(this._element).subtract(i),ve(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ve(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,E(this._animRequest),this._lastEvent=t,this._animRequest=S(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ce(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in be(document.body,"leaflet-dragging"),this._lastTarget&&(be(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yi)Ne(document,yi[t],this._onMove,this),Ne(document,bi[t],this._onUp,this);$e(),ie(),this._moved&&this._moving&&(E(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Ai(t=Si(t,i),i)}function wi(t,e,i){return Math.sqrt(Li(t,e,i,!0))}function ki(t,e,i){return Li(t,e,i)}function Ai(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Ci(t,o,e,0,i-1);var n,s=[];for(n=0;n<i;n++)o[n]&&s.push(t[n]);return s}function Ci(t,e,i,o,n){var s,r,a,l=0;for(r=o+1;r<=n-1;r++)(a=Li(t[r],t[o],t[n],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ci(t,e,i,o,s),Ci(t,e,i,s,n))}function Si(t,e){for(var i=[t[0]],o=1,n=0,s=t.length;o<s;o++)Oi(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<s-1&&i.push(t[s-1]),i}function Ei(t,e,i,o,n){var s,r,a,l=o?gi:$i(t,i),h=$i(e,i);for(gi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=$i(r=Ti(t,e,s=l||h,i,n),i),s===l?(t=r,l=a):(e=r,h=a)}}function Ti(t,e,i,o,n){var s,r,a=e.x-t.x,l=e.y-t.y,h=o.min,c=o.max;return 8&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):4&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):2&i?(s=c.x,r=t.y+l*(c.x-t.x)/a):1&i&&(s=h.x,r=t.y+l*(h.x-t.x)/a),new I(s,r,n)}function $i(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Oi(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Li(t,e,i,o){var n,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((n=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):n>0&&(s+=a*n,r+=l*n)),a=t.x-s,l=t.y-r,o?a*a+l*l:new I(s,r)}function Mi(t){return!b(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."),Mi(t)}var Ii=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ei,_getEdgeIntersection:Ti,_getBitCode:$i,_sqClosestPointOnSegment:Li,isFlat:Mi,_flat:zi});function Pi(t,e,i){var o,n,s,r,a,l,h,c,d,u=[1,4,2,8];for(n=0,h=t.length;n<h;n++)t[n]._code=$i(t[n],e);for(r=0;r<4;r++){for(c=u[r],o=[],n=0,s=(h=t.length)-1;n<h;s=n++)a=t[n],l=t[s],a._code&c?l._code&c||((d=Ti(l,a,c,e,i))._code=$i(d,e),o.push(d)):(l._code&c&&((d=Ti(l,a,c,e,i))._code=$i(d,e),o.push(d)),o.push(a));t=o}return t}var Di=(Object.freeze||Object)({clipPolygon:Pi}),Ni={project:function(t){return new I(t.lng,t.lat)},unproject:function(t){return new U(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Bi={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,o=t.lat*e,n=this.R_MINOR/i,s=Math.sqrt(1-n*n),r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-r)/(1+r),s/2);return o=-i*Math.log(Math.max(a,1e-10)),new I(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,s=Math.sqrt(1-n*n),r=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=h=Math.PI/2-2*Math.atan(r*e)-a;return new U(a*i,t.x*i/o)}},Ri=(Object.freeze||Object)({LonLat:Ni,Mercator:Bi,SphericalMercator:H}),qi=o({},j,{code:"EPSG:3395",projection:Bi,transformation:function(){var t=.5/(Math.PI*Bi.R);return G(t,.5,-t,.5)}()}),Ui=o({},j,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Fi=o({},Z,{projection:Ni,transformation:G(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,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});Z.Earth=j,Z.EPSG3395=qi,Z.EPSG3857=Q,Z.EPSG900913=Y,Z.EPSG4326=Ui,Z.Simple=Fi;var Zi=z.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[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(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.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(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=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),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!!t&&a(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?b(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var ji=Zi.extend({initialize:function(t,e){var i,o;if(m(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),Vi=function(t,e){return new ji(t,e)},Hi=ji.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ji.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),ji.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new R;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Hi(t)},Gi=$.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=D(o),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Et&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Qi(t){return new Gi(t)}var Yi=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ki=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&be(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,s=Se(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=B(r.min._subtract(a).add(n),r.max._subtract(a).subtract(n));if(!l.contains(s)){var h=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(o);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ce(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=S(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(E(this._panRequest),this._panRequest=S(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Se(e._icon),n=e._map.layerPointToLatLng(o);i&&Ce(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){E(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ji=Zi.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),s=!1;n!==this._shadow&&(this._removeShadow(),s=!0),n&&(ve(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Ce(this._icon,t),this._shadow&&Ce(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ki)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ki(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Ji(t,e)}var to=Zi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),eo=to.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=F(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return to.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new N(this._point.subtract(o),this._point.add(o))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function io(t,e){return new eo(t,e)}var oo=eo.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=o({},i,{radius:e})),m(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new R(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:to.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===j.distance){var n=Math.PI/180,s=this._mRadius/j.R/n,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(s*n)-Math.sin(e*n)*Math.sin(h*n))/(Math.cos(e*n)*Math.cos(h*n)))/n;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-r.y}else{var d=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function no(t,e,i){return new oo(t,e,i)}var so=to.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,s=Li,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],h=1,c=l.length;h<c;h++){var d=s(t,e=l[h-1],i=l[h],!0);d<o&&(o=d,n=s(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<l-1;t++)if(n=a[t],s=a[t+1],(o+=i=n.distanceTo(s))>e)return r=(o-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-n.x),s.y-r*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new R,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Mi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Mi(t),o=0,n=t.length;o<n;o++)i?(e[o]=F(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new I(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,s=t[0]instanceof U,r=t.length;if(s){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,s,r,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ei(a[i],a[i+1],t,i,!0))&&(l[o]=l[o]||[],l[o].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[o].push(r[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(o=0,n=(r=(a=this._parts[i]).length)-1;o<r;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new so(t,e)}so._flat=zi;var ao=so.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,s,r,a,l,h=this._rings[0],c=h.length;if(!c)return null;for(s=r=a=0,t=0,e=c-1;t<c;e=t++)i=h[t],o=h[e],n=i.y*o.x-o.y*i.x,r+=(i.x+o.x)*n,a+=(i.y+o.y)*n,s+=3*n;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=so.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof U&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){so.prototype._setLatLngs.call(this,t),Mi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new I(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 o,n=0,s=this._rings.length;n<s;n++)(o=Pi(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=0,r=(l=(e=this._parts[n]).length)-1;s<l;r=s++)i=e[s],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(h=!h);return h||so.prototype._containsPoint.call(this,t,!0)}});function lo(t,e){return new ao(t,e)}var ho=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=b(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=co(t,s);return r?(r.feature=vo(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=o({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function co(t,e){var i,o,n,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Ji(i);case"MultiPoint":for(n=0,s=a.length;n<s;n++)i=c(a[n]),l.push(h?h(t,i):new Ji(i));return new Hi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===r.type?0:1,c),new so(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===r.type?1:2,c),new ao(o,e);case"GeometryCollection":for(n=0,s=r.geometries.length;n<s;n++){var d=co({geometry:r.geometries[n],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function uo(t){return new U(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],s=0,r=t.length;s<r;s++)o=e?po(t[s],e-1,i):(i||uo)(t[s]),n.push(o);return n}function mo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function go(t,e,i,o){for(var n=[],s=0,r=t.length;s<r;s++)n.push(e?go(t[s],e-1,i,o):mo(t[s],o));return!e&&i&&n.push(n[0]),n}function fo(t,e){return t.feature?o({},t.feature,{geometry:e}):vo(e)}function vo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var bo={toGeoJSON:function(t){return fo(this,{type:"Point",coordinates:mo(this.getLatLng(),t)})}};function yo(t,e){return new ho(t,e)}Ji.include(bo),oo.include(bo),eo.include(bo),so.include({toGeoJSON:function(t){var e=!Mi(this._latlngs);return fo(this,{type:(e?"Multi":"")+"LineString",coordinates:go(this._latlngs,e?1:0,!1,t)})}}),ao.include({toGeoJSON:function(t){var e=!Mi(this._latlngs),i=e&&!Mi(this._latlngs[0]),o=go(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),fo(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),ji.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),fo(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,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var s=vo(n);"FeatureCollection"===s.type?o.push.apply(o,s.features):o.push(s)}}})),i?fo(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var _o=yo,xo=Zi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(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&&me(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(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:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(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;Ae(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();Ce(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(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)}}),wo=function(t,e,i){return new xo(t,e,i)},ko=xo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],n=0;n<i.length;n++)o.push(i[n].src);this._url=i.length>0?o:[e.src]}else{b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=de("source");a.src=this._url[r],e.appendChild(a)}}}});function Ao(t,e,i){return new ko(t,e,i)}var Co=xo.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=c,t.onmousemove=c}});function So(t,e,i){return new Co(t,e,i)}var Eo=Zi.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){m(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(xe(this._container,0),this._removeTimeout=setTimeout(s(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Zi||(i=e,e=t),e instanceof Hi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ce(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),To=Eo.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Eo.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof to||this._source.on("preclick",qe))},onRemove:function(t){Eo.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof to||this._source.off("preclick",qe))},getEvents:function(){var t=Eo.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=de("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=de("div",t+"-content-wrapper",e);if(this._contentNode=de("div",t+"-content",i),Fe(i),Ue(this._contentNode),Pe(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=de("a",t+"-close-button",e);o.href="#close",o.innerHTML="×",Pe(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=t.offsetHeight,n=this.options.maxHeight,s="leaflet-popup-scrolled";n&&o>n?(e.height=n+"px",ve(t,s)):be(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ce(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new I(this._containerLeft,-i-this._containerBottom);n._add(Se(this._container));var s=t.layerPointToContainerPoint(n),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+o+l.x>h.x&&(c=s.x+o-h.x+l.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+l.y>h.y&&(d=s.y+i-h.y+l.y),s.y-d-a.y<0&&(d=s.y-a.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),je(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),$o=function(t,e){return new To(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof To||(t=new To(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Zi.include({bindPopup:function(t,e){return t instanceof To?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new To(e,this)),this._popup.setContent(t)),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,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),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){var e=t.layer||t.target;this._popup&&this._map&&(je(t),e instanceof to?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Oo=Eo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Eo.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Eo.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Eo.prototype.getEvents.call(this);return At&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,o=e.latLngToContainerPoint(e.getCenter()),n=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&n.x<o.x?(s="right",t=t.add(D(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+h.x-l.x,a/2-h.y-l.y,!0))),be(i,"leaflet-tooltip-right"),be(i,"leaflet-tooltip-left"),be(i,"leaflet-tooltip-top"),be(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ce(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Lo=function(t,e){return new Oo(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Oo||(t=new Oo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Zi.include({bindTooltip:function(t,e){return t instanceof Oo?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Oo(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),At&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(be(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Mo=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=D(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zo(t){return new Mo(t)}Gi.Default=Yi;var Io=Zi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof I?t:new I(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,s=i.length;n<s;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var s=Math.min(1,(t-n.loaded)/200);xe(n.el,s),s<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(E(this._fadeFrame),this._fadeFrame=S(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),c(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new I(+n,+s);a.z=+r;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),r>o&&this._retainParent(n,s,r,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var s=2*e;s<2*e+2;s++){var r=new I(n,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+1<o&&this._retainChildren(n,s,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom)&&(n=void 0);var s=this.options.updateWhenZooming&&n!==this._tileZoom;o&&!s||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();bt?Ae(t.el,n,o):Ce(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*o);return new N(n.subtract(s),n.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),s=n.getCenter(),r=[],a=this.options.keepBuffer,l=new N(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new I(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=n.min.y;d<=n.max.y;d++)for(var u=n.min.x;u<=n.max.x;u++){var p=new I(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.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 g=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],g);this._level.el.appendChild(g)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new R(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 I(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(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,et&&this.options.opacity<1&&xe(t,this.options.opacity),nt&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),n=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(n),this.createTile.length<2&&S(s(this._tileReady,this,t,null,n)),Ce(n,i),this._tiles[o]={el:n,coords:t,current:!0},e.appendChild(n),this.fire("tileloadstart",{tile:n,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),E(this._fadeFrame),this._fadeFrame=S(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ve(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?S(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new I(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(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 Po(t){return new Io(t)}var Do=Io.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Et&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||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 Pe(i,"load",s(this._tileOnLoad,this,e,i)),Pe(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Et?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,o(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),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)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Io.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Io.prototype._tileReady.call(this,t,e,i)}});function No(t,e){return new Do(t,e)}var Bo=Do.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 i=o({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);var s=(e=m(this,e)).detectRetina&&Et?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},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,Do.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=B(i.project(e[0]),i.project(e[1])),n=o.min,s=o.max,r=(this._wmsVersion>=1.3&&this._crs===Ui?[n.y,n.x,s.y,s.x]:[n.x,n.y,s.x,s.y]).join(","),a=Do.prototype.getTileUrl.call(this,t);return a+g(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return o(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new Bo(t,e)}Do.WMS=Bo,No.wms=Ro;var qo=Zi.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(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),o=Se(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=n.multiplyBy(-i).add(o).add(n).subtract(r);bt?Ae(this._container,a,i):Ce(this._container,a)},_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()}}),Uo=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Pe(t,"mousemove",l(this._onMouseMove,32,this),this),Pe(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Pe(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,ue(this._container),Ne(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){qo.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=Et?2:1;Ce(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Et&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(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,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(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,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||S(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=r[i].length;o<n;o++)s=r[i][o],l[o?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(be(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,o,n=this._drawFirst;n;n=n.next)(i=n.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(ve(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fo(t){return Tt?new Uo(t):null}var Zo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),jo={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qo.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Zo("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Zo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(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;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Zo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,o.dashArray?e.dashStyle=b(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Zo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){ge(t._container)}},Vo=Ot?Zo:K,Ho=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qo.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)),Ce(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=Vo("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(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),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){ge(t._path)}});function Wo(t){return $t||Ot?new Ho(t):null}Ot&&Ho.include(jo),ii.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&&Fo(t)||Wo(t)}});var Go=ao.extend({initialize:function(t,e){ao.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Qo(t,e){return new Go(t,e)}Ho.create=Vo,Ho.pointsToPath=J,ho.geometryToLayer=co,ho.coordsToLatLng=uo,ho.coordsToLatLngs=po,ho.latLngToCoords=mo,ho.latLngsToCoords=go,ho.getFeature=fo,ho.asFeature=vo,ii.mergeOptions({boxZoom:!0});var Yo=mi.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(){Pe(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(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(),ee(),Te(),this._startPoint=this._map.mouseEventToContainerPoint(t),Pe(document,{contextmenu:je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(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();Ce(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),be(this._container,"leaflet-crosshair")),ie(),$e(),Ne(document,{contextmenu:je,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(s(this._resetState,this),0);var e=new R(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()}});ii.addInitHook("addHandler","boxZoom",Yo),ii.mergeOptions({doubleClickZoom:!0});var Ko=mi.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(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ii.addInitHook("addHandler","doubleClickZoom",Ko),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jo=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(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))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){be(this._map._container,"leaflet-grab"),be(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=q(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.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.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,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,s=(o+e+i)%t-e-i,r=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=n.multiplyBy(r/s),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),d=h/(i.inertiaDeceleration*r),u=c.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),S((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Jo),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xo=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Pe(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){Pe(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}je(t)}}});ii.addInitHook("addHandler","keyboard",Xo),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=mi.extend({addHooks:function(){Pe(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),o),je(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=this._delta/(4*this._map.options.wheelPxPerZoomLevel),n=4*Math.log(2/(1+Math.exp(-Math.abs(o))))/Math.LN2,s=i?Math.ceil(n/i)*i:n,r=t._limitZoom(e+(this._delta>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))}});ii.addInitHook("addHandler","scrollWheelZoom",tn),ii.mergeOptions({tap:!0,tapTolerance:15});var en=mi.extend({addHooks:function(){Pe(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ze(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new I(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Pe(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&be(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new I(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});At&&!kt&&ii.addInitHook("addHandler","tap",en),ii.mergeOptions({touchZoom:At&&!st,bounceAtZoomLimits:!0});var on=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Pe(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){be(this._map._container,"leaflet-touch-zoom"),Ne(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]),o=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(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Pe(document,"touchmove",this._onTouchMove,this),Pe(document,"touchend",this._onTouchEnd,this),Ze(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),n=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(n,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&n<1||this._zoom>e.getMaxZoom()&&n>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===n)return}else{var r=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===n&&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),E(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=S(a,this,!0),Ze(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,E(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),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}});ii.addInitHook("addHandler","touchZoom",on),ii.BoxZoom=Yo,ii.DoubleClickZoom=Ko,ii.Drag=Jo,ii.Keyboard=Xo,ii.ScrollWheelZoom=tn,ii.Tap=en,ii.TouchZoom=on,Object.freeze=i,t.version=e,t.Control=ni,t.control=si,t.Browser=Mt,t.Evented=z,t.Mixin=fi,t.Util=T,t.Class=$,t.Handler=mi,t.extend=o,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Ie,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Ii,t.PolyUtil=Di,t.Point=I,t.point=D,t.Bounds=N,t.bounds=B,t.Transformation=W,t.transformation=G,t.Projection=Ri,t.LatLng=U,t.latLng=F,t.LatLngBounds=R,t.latLngBounds=q,t.CRS=Z,t.GeoJSON=ho,t.geoJSON=yo,t.geoJson=_o,t.Layer=Zi,t.LayerGroup=ji,t.layerGroup=Vi,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xo,t.imageOverlay=wo,t.VideoOverlay=ko,t.videoOverlay=Ao,t.SVGOverlay=Co,t.svgOverlay=So,t.DivOverlay=Eo,t.Popup=To,t.popup=$o,t.Tooltip=Oo,t.tooltip=Lo,t.Icon=Gi,t.icon=Qi,t.DivIcon=Mo,t.divIcon=zo,t.Marker=Ji,t.marker=Xi,t.TileLayer=Do,t.tileLayer=No,t.GridLayer=Io,t.gridLayer=Po,t.SVG=Ho,t.svg=Wo,t.Renderer=qo,t.Canvas=Uo,t.canvas=Fo,t.Path=to,t.CircleMarker=eo,t.circleMarker=io,t.Circle=oo,t.circle=no,t.Polyline=so,t.polyline=ro,t.Polygon=ao,t.polygon=lo,t.Rectangle=Go,t.rectangle=Qo,t.Map=ii,t.map=oi;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t})(pc.exports);var mc=pc.exports;const gc={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},fc={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},vc=()=>gc;class bc extends lt{static get styles(){return r`
|
|
8158
8260
|
:host {
|
|
8159
8261
|
display: block;
|
|
8160
8262
|
padding: 0px;
|
|
@@ -8189,11 +8291,11 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
8189
8291
|
color: var(--color-link-primary);
|
|
8190
8292
|
cursor: pointer;
|
|
8191
8293
|
}
|
|
8192
|
-
`}constructor(){super(),this.osmId="",this.endpoint="",this.hovered=null,this.path=[],this.renderedMap=null,this.states=null,this.paths={},this.lastHovered=null}getRenderRoot(){return this.renderRoot}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}refreshMap(){const t=(t,e)=>{this.paths[t.properties.osm_id]=e,e.on({click:t=>{const e=t.target.feature.properties;if(e.osm_id!==this.path[this.path.length-1].osm_id){const i=t.originalEvent;i.stopPropagation(),i.preventDefault(),this.onFeatureClicked&&this.onFeatureClicked(e),this.hovered=null,this.path.push(e),this.osmId=e.osm_id,this.refreshMap()}},mouseover:t=>{const e=t.target.feature.properties;e.osm_id!==this.path[this.path.length-1].osm_id&&(t.target.setStyle(
|
|
8294
|
+
`}constructor(){super(),this.osmId="",this.endpoint="",this.hovered=null,this.path=[],this.renderedMap=null,this.states=null,this.paths={},this.lastHovered=null}getRenderRoot(){return this.renderRoot}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}refreshMap(){const t=(t,e)=>{this.paths[t.properties.osm_id]=e,e.on({click:t=>{const e=t.target.feature.properties;if(e.osm_id!==this.path[this.path.length-1].osm_id){const i=t.originalEvent;i.stopPropagation(),i.preventDefault(),this.onFeatureClicked&&this.onFeatureClicked(e),this.hovered=null,this.path.push(e),this.osmId=e.osm_id,this.refreshMap()}},mouseover:t=>{const e=t.target.feature.properties;e.osm_id!==this.path[this.path.length-1].osm_id&&(t.target.setStyle(fc),this.hovered=e)},mouseout:t=>{t.target.setStyle(gc),this.hovered=null}})};jt(this.getEndpoint()+"geometry/"+this.osmId+"/").then((e=>{this.states&&this.renderedMap.removeLayer(this.states);const i=e.json;0===this.path.length&&(this.path=[{name:i.name,osm_id:this.osmId,level:0}]),this.states=mc.geoJSON(i.geometry,{style:vc,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(gc),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(fc)}if(t.has("feature")&&this.feature&&(this.hovered=null,0!==this.path.length&&this.path[this.path.length-1].osm_id===this.feature.osm_id||this.path.push(this.feature)),t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(e);break}this.path=t,this.refreshMap()}}firstUpdated(t){const e=this.getRenderRoot().getElementById("alias-map");this.renderedMap=mc.map(e,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView([0,1],4),this.renderedMap.dragging.disable(),this.renderedMap.doubleClickZoom.disable(),this.refreshMap(),super.firstUpdated(t)}handleClickedBreadcrumb(t){this.osmId=t.currentTarget.getAttribute("data-osmid");const e=[];for(const t of this.path)if(e.push(t),t.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(t);break}this.path=e,this.refreshMap()}render(){return this.osmId?j`
|
|
8193
8295
|
<link
|
|
8194
8296
|
rel="stylesheet"
|
|
8195
8297
|
href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
|
|
8196
8298
|
/>
|
|
8197
8299
|
<div id="alias-map"></div>
|
|
8198
|
-
`:j`<div>No osm map id</div>`}}t([ge()],
|
|
8300
|
+
`:j`<div>No osm map id</div>`}}t([ge()],bc.prototype,"feature",void 0),t([ge()],bc.prototype,"osmId",void 0),t([ge()],bc.prototype,"endpoint",void 0),t([ge()],bc.prototype,"onFeatureClicked",void 0),t([ge()],bc.prototype,"hovered",void 0),t([ge()],bc.prototype,"path",void 0),dc("leaflet-map",bc),dc("alias-editor",uc)}();
|
|
8199
8301
|
//# sourceMappingURL=temba-components.js.map
|