@oiz/stzh-components 3.4.0-beta1 → 3.4.0-beta2
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/dist/cjs/{app-globals-1074eba6.js → app-globals-d9805497.js} +2 -2
- package/dist/cjs/{app-globals-1074eba6.js.map → app-globals-d9805497.js.map} +1 -1
- package/dist/cjs/index-92254d32.js +40 -16
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-actions.cjs.entry.js +10 -8
- package/dist/cjs/stzh-actions.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-archivelist.cjs.entry.js +6 -16
- package/dist/cjs/stzh-archivelist.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-card_2.cjs.entry.js → stzh-card.cjs.entry.js} +55 -143
- package/dist/cjs/stzh-card.cjs.entry.js.map +1 -0
- package/dist/cjs/{stzh-sortable.cjs.entry.js → stzh-cardlist_2.cjs.entry.js} +92 -1
- package/dist/cjs/stzh-cardlist_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{stzh-checkbox_4.cjs.entry.js → stzh-checkbox_3.cjs.entry.js} +4 -91
- package/dist/cjs/stzh-checkbox_3.cjs.entry.js.map +1 -0
- package/dist/cjs/{stzh-chip_2.cjs.entry.js → stzh-chip.cjs.entry.js} +1 -215
- package/dist/cjs/stzh-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-chipgroup.cjs.entry.js +25 -0
- package/dist/cjs/stzh-chipgroup.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-chipselect.cjs.entry.js +234 -0
- package/dist/cjs/stzh-chipselect.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-dropdown.cjs.entry.js +53 -55
- package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-fieldset.cjs.entry.js +1 -1
- package/dist/cjs/stzh-fieldset.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js +98 -41
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-input.cjs.entry.js +6 -2
- package/dist/cjs/stzh-input.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-chipgroup_2.cjs.entry.js → stzh-message.cjs.entry.js} +1 -18
- package/dist/cjs/stzh-message.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-overlay.cjs.entry.js +97 -0
- package/dist/cjs/stzh-overlay.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-poicard.cjs.entry.js +52 -0
- package/dist/cjs/stzh-poicard.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-poilist.cjs.entry.js +122 -0
- package/dist/cjs/stzh-poilist.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-popover.cjs.entry.js +445 -0
- package/dist/cjs/stzh-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-saptcha.cjs.entry.js +10 -9
- package/dist/cjs/stzh-saptcha.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +52 -3
- package/dist/cjs/stzh-search.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-section.cjs.entry.js +1 -1
- package/dist/cjs/stzh-section.cjs.entry.js.map +1 -1
- package/dist/cjs/{stzh-popover_2.cjs.entry.js → stzh-text.cjs.entry.js} +1 -438
- package/dist/cjs/stzh-text.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-vbz-connection-finder.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-connection-finder.cjs.entry.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +9 -0
- package/dist/collection/assets/i18n/en.json +9 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/stzh-actions/stzh-actions.css +27 -0
- package/dist/collection/components/stzh-actions/stzh-actions.js +30 -10
- package/dist/collection/components/stzh-actions/stzh-actions.js.map +1 -1
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.css +3 -0
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.js +42 -16
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.js.map +1 -1
- package/dist/collection/components/stzh-archivelist/stzh-archivelist.stories.js +109 -102
- package/dist/collection/components/stzh-card/stzh-card.css +5 -0
- package/dist/collection/components/stzh-card/stzh-card.js +72 -51
- package/dist/collection/components/stzh-card/stzh-card.js.map +1 -1
- package/dist/collection/components/stzh-cardlist/stzh-cardlist.css +5 -0
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.css +8 -8
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js +13 -1
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.js.map +1 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +11 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +89 -55
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js.map +1 -1
- package/dist/collection/components/stzh-fieldset/stzh-fieldset.css +120 -0
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.css +2 -0
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.js +156 -51
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.js.map +1 -1
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.stories.js +64 -63
- package/dist/collection/components/stzh-input/stzh-input.css +6 -0
- package/dist/collection/components/stzh-input/stzh-input.js +23 -1
- package/dist/collection/components/stzh-input/stzh-input.js.map +1 -1
- package/dist/collection/components/stzh-pi-teaser/stzh-pi-teaser.css +18 -3
- package/dist/collection/components/stzh-pi-teaser/stzh-pi-teaser.stories.js +30 -29
- package/dist/collection/components/stzh-poicard/stzh-poicard.css +231 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.e2e.js +16 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.e2e.js.map +1 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.js +86 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.js.map +1 -0
- package/dist/collection/components/stzh-poicard/stzh-poicard.stories.js +117 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.css +210 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.e2e.js +16 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.e2e.js.map +1 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.js +181 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.js.map +1 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.localization.js +2 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.localization.js.map +1 -0
- package/dist/collection/components/stzh-poilist/stzh-poilist.stories.js +31 -0
- package/dist/collection/components/stzh-richtext/stzh-richtext.stories.js +31 -16
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.js +34 -17
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.js.map +1 -1
- package/dist/collection/components/stzh-saptcha/stzh-saptcha.stories.js +3 -0
- package/dist/collection/components/stzh-search/stzh-search.css +4 -4
- package/dist/collection/components/stzh-search/stzh-search.js +122 -2
- package/dist/collection/components/stzh-search/stzh-search.js.map +1 -1
- package/dist/collection/components/stzh-section/stzh-section.css +19 -6
- package/dist/collection/components/stzh-vbz-connection-finder/stzh-vbz-connection-finder.js +1 -1
- package/dist/collection/components/stzh-vbz-connection-finder/stzh-vbz-connection-finder.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/pages/jobsearch/jobsearch.e2e.js +16 -0
- package/dist/collection/pages/jobsearch/jobsearch.e2e.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/stzh-actions.js +12 -9
- package/dist/components/stzh-actions.js.map +1 -1
- package/dist/components/stzh-archivelist.js +20 -22
- package/dist/components/stzh-archivelist.js.map +1 -1
- package/dist/components/stzh-card2.js +55 -51
- package/dist/components/stzh-card2.js.map +1 -1
- package/dist/components/stzh-cardlist2.js +1 -1
- package/dist/components/stzh-cardlist2.js.map +1 -1
- package/dist/components/stzh-chipselect2.js +14 -2
- package/dist/components/stzh-chipselect2.js.map +1 -1
- package/dist/components/stzh-dropdown2.js +55 -55
- package/dist/components/stzh-dropdown2.js.map +1 -1
- package/dist/components/stzh-fieldset.js +1 -1
- package/dist/components/stzh-fieldset.js.map +1 -1
- package/dist/components/stzh-geo-ref-data.js +109 -45
- package/dist/components/stzh-geo-ref-data.js.map +1 -1
- package/dist/components/stzh-input2.js +7 -2
- package/dist/components/stzh-input2.js.map +1 -1
- package/dist/components/stzh-pi-teaser.js +1 -1
- package/dist/components/stzh-pi-teaser.js.map +1 -1
- package/dist/components/stzh-poicard.d.ts +11 -0
- package/dist/components/stzh-poicard.js +8 -0
- package/dist/components/stzh-poicard.js.map +1 -0
- package/dist/components/stzh-poicard2.js +108 -0
- package/dist/components/stzh-poicard2.js.map +1 -0
- package/dist/components/stzh-poilist.d.ts +11 -0
- package/dist/components/stzh-poilist.js +246 -0
- package/dist/components/stzh-poilist.js.map +1 -0
- package/dist/components/stzh-saptcha.js +13 -14
- package/dist/components/stzh-saptcha.js.map +1 -1
- package/dist/components/stzh-search.js +57 -3
- package/dist/components/stzh-search.js.map +1 -1
- package/dist/components/stzh-section.js +1 -1
- package/dist/components/stzh-section.js.map +1 -1
- package/dist/components/stzh-vbz-connection-finder.js +1 -1
- package/dist/components/stzh-vbz-connection-finder.js.map +1 -1
- package/dist/esm/{app-globals-fbb949bd.js → app-globals-ca13b6e3.js} +2 -2
- package/dist/esm/{app-globals-fbb949bd.js.map → app-globals-ca13b6e3.js.map} +1 -1
- package/dist/esm/index-e3050b18.js +40 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-actions.entry.js +10 -8
- package/dist/esm/stzh-actions.entry.js.map +1 -1
- package/dist/esm/stzh-archivelist.entry.js +6 -16
- package/dist/esm/stzh-archivelist.entry.js.map +1 -1
- package/dist/esm/{stzh-card_2.entry.js → stzh-card.entry.js} +56 -143
- package/dist/esm/stzh-card.entry.js.map +1 -0
- package/dist/esm/{stzh-sortable.entry.js → stzh-cardlist_2.entry.js} +92 -2
- package/dist/esm/stzh-cardlist_2.entry.js.map +1 -0
- package/dist/esm/{stzh-checkbox_4.entry.js → stzh-checkbox_3.entry.js} +5 -91
- package/dist/esm/stzh-checkbox_3.entry.js.map +1 -0
- package/dist/esm/{stzh-chip_2.entry.js → stzh-chip.entry.js} +3 -216
- package/dist/esm/stzh-chip.entry.js.map +1 -0
- package/dist/esm/stzh-chipgroup.entry.js +21 -0
- package/dist/esm/stzh-chipgroup.entry.js.map +1 -0
- package/dist/esm/stzh-chipselect.entry.js +230 -0
- package/dist/esm/stzh-chipselect.entry.js.map +1 -0
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-dropdown.entry.js +53 -55
- package/dist/esm/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm/stzh-fieldset.entry.js +1 -1
- package/dist/esm/stzh-fieldset.entry.js.map +1 -1
- package/dist/esm/stzh-geo-ref-data.entry.js +98 -41
- package/dist/esm/stzh-geo-ref-data.entry.js.map +1 -1
- package/dist/esm/stzh-input.entry.js +6 -2
- package/dist/esm/stzh-input.entry.js.map +1 -1
- package/dist/esm/{stzh-chipgroup_2.entry.js → stzh-message.entry.js} +3 -19
- package/dist/esm/stzh-message.entry.js.map +1 -0
- package/dist/esm/stzh-overlay.entry.js +93 -0
- package/dist/esm/stzh-overlay.entry.js.map +1 -0
- package/dist/esm/stzh-pi-teaser.entry.js +1 -1
- package/dist/esm/stzh-pi-teaser.entry.js.map +1 -1
- package/dist/esm/stzh-poicard.entry.js +48 -0
- package/dist/esm/stzh-poicard.entry.js.map +1 -0
- package/dist/esm/stzh-poilist.entry.js +118 -0
- package/dist/esm/stzh-poilist.entry.js.map +1 -0
- package/dist/esm/stzh-popover.entry.js +441 -0
- package/dist/esm/stzh-popover.entry.js.map +1 -0
- package/dist/esm/stzh-saptcha.entry.js +11 -10
- package/dist/esm/stzh-saptcha.entry.js.map +1 -1
- package/dist/esm/stzh-search.entry.js +52 -3
- package/dist/esm/stzh-search.entry.js.map +1 -1
- package/dist/esm/stzh-section.entry.js +1 -1
- package/dist/esm/stzh-section.entry.js.map +1 -1
- package/dist/esm/{stzh-popover_2.entry.js → stzh-text.entry.js} +3 -439
- package/dist/esm/stzh-text.entry.js.map +1 -0
- package/dist/esm/stzh-vbz-connection-finder.entry.js +1 -1
- package/dist/esm/stzh-vbz-connection-finder.entry.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +9 -0
- package/dist/stzh-components/assets/i18n/en.json +9 -0
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/{p-206ec94f.entry.js → p-0846f5a7.entry.js} +2 -2
- package/dist/stzh-components/p-0846f5a7.entry.js.map +1 -0
- package/dist/stzh-components/p-0d092d58.entry.js +2 -0
- package/dist/stzh-components/p-0d092d58.entry.js.map +1 -0
- package/dist/stzh-components/{p-38cd406c.entry.js → p-10c2c688.entry.js} +2 -2
- package/dist/stzh-components/p-10c2c688.entry.js.map +1 -0
- package/dist/stzh-components/{p-23de5712.entry.js → p-1391115f.entry.js} +2 -2
- package/dist/stzh-components/{p-23de5712.entry.js.map → p-1391115f.entry.js.map} +1 -1
- package/dist/stzh-components/p-1b2fb680.entry.js +9 -0
- package/dist/stzh-components/p-1b2fb680.entry.js.map +1 -0
- package/dist/stzh-components/p-1e121c5f.entry.js +2 -0
- package/dist/stzh-components/p-1e121c5f.entry.js.map +1 -0
- package/dist/stzh-components/p-35d842ce.entry.js +2 -0
- package/dist/stzh-components/p-35d842ce.entry.js.map +1 -0
- package/dist/stzh-components/p-3e2b4d92.entry.js +2 -0
- package/dist/stzh-components/p-3e2b4d92.entry.js.map +1 -0
- package/dist/stzh-components/p-47cb71af.entry.js +2 -0
- package/dist/stzh-components/p-47cb71af.entry.js.map +1 -0
- package/dist/stzh-components/p-4e2db8e9.entry.js +8 -0
- package/dist/stzh-components/p-4e2db8e9.entry.js.map +1 -0
- package/dist/stzh-components/{p-cded8c4a.js → p-57caee36.js} +2 -2
- package/dist/stzh-components/p-616ae3be.entry.js +2 -0
- package/dist/stzh-components/p-616ae3be.entry.js.map +1 -0
- package/dist/stzh-components/{p-15d008ea.entry.js → p-72c9db89.entry.js} +3 -3
- package/dist/stzh-components/p-72c9db89.entry.js.map +1 -0
- package/dist/stzh-components/p-7bb2eb4e.entry.js +2 -0
- package/dist/stzh-components/p-7bb2eb4e.entry.js.map +1 -0
- package/dist/stzh-components/p-8c4d543d.entry.js +2 -0
- package/dist/stzh-components/p-8c4d543d.entry.js.map +1 -0
- package/dist/stzh-components/p-9506f599.entry.js +2 -0
- package/dist/stzh-components/p-9506f599.entry.js.map +1 -0
- package/dist/stzh-components/p-9b1267a6.entry.js +2 -0
- package/dist/stzh-components/p-9b1267a6.entry.js.map +1 -0
- package/dist/stzh-components/p-a9216459.entry.js +2 -0
- package/dist/stzh-components/p-a9216459.entry.js.map +1 -0
- package/dist/stzh-components/p-b2920d7f.entry.js +2 -0
- package/dist/stzh-components/p-b2920d7f.entry.js.map +1 -0
- package/dist/stzh-components/p-b6f19446.entry.js +2 -0
- package/dist/stzh-components/p-b6f19446.entry.js.map +1 -0
- package/dist/stzh-components/p-b75800da.entry.js +2 -0
- package/dist/stzh-components/p-b75800da.entry.js.map +1 -0
- package/dist/stzh-components/{p-d058fc1e.entry.js → p-c4bbdbfe.entry.js} +2 -2
- package/dist/stzh-components/p-c4bbdbfe.entry.js.map +1 -0
- package/dist/stzh-components/p-c6504f41.entry.js +2 -0
- package/dist/stzh-components/p-c6504f41.entry.js.map +1 -0
- package/dist/stzh-components/p-d29fd503.entry.js +2 -0
- package/dist/stzh-components/p-d29fd503.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/types/components/stzh-actions/stzh-actions.d.ts +3 -1
- package/dist/types/components/stzh-archivelist/stzh-archivelist.d.ts +4 -0
- package/dist/types/components/stzh-card/stzh-card.d.ts +4 -2
- package/dist/types/components/stzh-dropdown/stzh-dropdown.d.ts +6 -2
- package/dist/types/components/stzh-geo-ref-data/stzh-geo-ref-data.d.ts +16 -2
- package/dist/types/components/stzh-input/stzh-input.d.ts +2 -0
- package/dist/types/components/stzh-poicard/stzh-poicard.d.ts +14 -0
- package/dist/types/components/stzh-poilist/stzh-poilist.d.ts +31 -0
- package/dist/types/components/stzh-poilist/stzh-poilist.localization.d.ts +10 -0
- package/dist/types/components/stzh-saptcha/stzh-saptcha.d.ts +5 -4
- package/dist/types/components/stzh-search/stzh-search.d.ts +13 -0
- package/dist/types/components.d.ts +190 -10
- package/dist/types/index.d.ts +28 -0
- package/dist/vscode-data.json +104 -3
- package/package.json +1 -1
- package/dist/cjs/stzh-card_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-checkbox_4.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-chip_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-chipgroup_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-popover_2.cjs.entry.js.map +0 -1
- package/dist/cjs/stzh-sortable.cjs.entry.js.map +0 -1
- package/dist/esm/stzh-card_2.entry.js.map +0 -1
- package/dist/esm/stzh-checkbox_4.entry.js.map +0 -1
- package/dist/esm/stzh-chip_2.entry.js.map +0 -1
- package/dist/esm/stzh-chipgroup_2.entry.js.map +0 -1
- package/dist/esm/stzh-popover_2.entry.js.map +0 -1
- package/dist/esm/stzh-sortable.entry.js.map +0 -1
- package/dist/stzh-components/p-12851c24.entry.js +0 -2
- package/dist/stzh-components/p-12851c24.entry.js.map +0 -1
- package/dist/stzh-components/p-15d008ea.entry.js.map +0 -1
- package/dist/stzh-components/p-1b31cd8a.entry.js +0 -2
- package/dist/stzh-components/p-1b31cd8a.entry.js.map +0 -1
- package/dist/stzh-components/p-206ec94f.entry.js.map +0 -1
- package/dist/stzh-components/p-38cd406c.entry.js.map +0 -1
- package/dist/stzh-components/p-50c32fd1.entry.js +0 -2
- package/dist/stzh-components/p-50c32fd1.entry.js.map +0 -1
- package/dist/stzh-components/p-55349f2e.entry.js +0 -2
- package/dist/stzh-components/p-55349f2e.entry.js.map +0 -1
- package/dist/stzh-components/p-9c643610.entry.js +0 -2
- package/dist/stzh-components/p-9c643610.entry.js.map +0 -1
- package/dist/stzh-components/p-9cdd5e6f.entry.js +0 -2
- package/dist/stzh-components/p-9cdd5e6f.entry.js.map +0 -1
- package/dist/stzh-components/p-a672aaea.entry.js +0 -8
- package/dist/stzh-components/p-a672aaea.entry.js.map +0 -1
- package/dist/stzh-components/p-a77b49cb.entry.js +0 -2
- package/dist/stzh-components/p-a77b49cb.entry.js.map +0 -1
- package/dist/stzh-components/p-b509dedd.entry.js +0 -2
- package/dist/stzh-components/p-b509dedd.entry.js.map +0 -1
- package/dist/stzh-components/p-b870c799.entry.js +0 -2
- package/dist/stzh-components/p-b870c799.entry.js.map +0 -1
- package/dist/stzh-components/p-d058fc1e.entry.js.map +0 -1
- package/dist/stzh-components/p-da043311.entry.js +0 -9
- package/dist/stzh-components/p-da043311.entry.js.map +0 -1
- package/dist/stzh-components/p-fb077fd5.entry.js +0 -2
- package/dist/stzh-components/p-fb077fd5.entry.js.map +0 -1
- /package/dist/stzh-components/{p-cded8c4a.js.map → p-57caee36.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as e,g as r,e as n,w as h,F as a}from"./p-c7bfac7a.js";import{h as o}from"./p-d789f265.js";import{S as f}from"./p-fc692303.js";import{m as u}from"./p-10e2901a.js";import{t as l,c as v}from"./p-ed63ed76.js";import{c}from"./p-3d5f9ac0.js";import{c as d,a as m}from"./p-7183ba4d.js";import"./p-9b063923.js";const p=`<svg xmlns="http://www.w3.org/2000/svg" width="22px" height="22px" fill="none" viewBox="0 0 24 24"><g clip-path="url(#a)"><path fill="currentColor" d="m10 15.172 9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h24v24H0z"/></clipPath></defs></svg>`;const z=".sc-stzh-checkbox-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-checkbox-h{display:none}.sc-stzh-checkbox-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-checkbox-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-checkbox-h *.sc-stzh-checkbox,.sc-stzh-checkbox-h *.sc-stzh-checkbox::before,.sc-stzh-checkbox-h *.sc-stzh-checkbox::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-checkbox-h .has-focus.sc-stzh-checkbox{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox{outline-style:none !important}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox::-moz-focus-inner{border:0 !important}.sc-stzh-checkbox-h{display:inline-block}[disabled].sc-stzh-checkbox-h:not([disabled=false]){--description-color:var(--stzh-color-grey70)}.stzh-checkbox.sc-stzh-checkbox{display:grid}.stzh-checkbox__marker-symbol.sc-stzh-checkbox{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-checkbox__marker-text.sc-stzh-checkbox{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-checkbox__description-wrapper.sc-stzh-checkbox{display:flex;flex-direction:column-reverse;min-height:var(--description-min-height, var(--stzh-description-min-height, none))}.stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox__description.sc-stzh-checkbox{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-checkbox__error.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox__error-list.sc-stzh-checkbox{list-style:none;margin:0;padding:0}.stzh-checkbox__description.sc-stzh-checkbox{display:flex;align-items:flex-start;color:var(--stzh-input-description-color, var(--description-color, var(--stzh-color-coolgrey70)));transition:color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__description-long.sc-stzh-checkbox{margin-right:var(--stzh-space-xxsmall);margin-top:0.125rem}@supports (font: -apple-system-body) and (-webkit-appearance: none){.stzh-checkbox__description-long.sc-stzh-checkbox{margin-top:0}}.stzh-checkbox__description-long-popover.sc-stzh-checkbox{--width:auto;--max-width:27.3125rem}.stzh-checkbox__description-long-button.sc-stzh-checkbox{display:flex;justify-content:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer}.stzh-checkbox.sc-stzh-checkbox stzh-icon.stzh-checkbox__description-long-icon.sc-stzh-checkbox{--size:var(--stzh-icon-size-xsmall)}.stzh-checkbox--has-error.sc-stzh-checkbox .stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox--has-description.sc-stzh-checkbox .stzh-checkbox__description.sc-stzh-checkbox{margin-top:var(--stzh-space-xxxsmall)}.stzh-checkbox__field-wrapper.sc-stzh-checkbox{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);position:relative;display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}.stzh-checkbox__input.sc-stzh-checkbox{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;z-index:-1;opacity:0;pointer-events:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--stzh-form-input-border-radius)}.stzh-checkbox__mark.sc-stzh-checkbox{border:0.125rem solid var(--stzh-color-black);background-color:var(--stzh-color-white);width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:var(--stzh-form-input-border-radius);display:inline-flex;justify-content:center;align-items:center;transition:border-color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__check.sc-stzh-checkbox{display:flex;flex-direction:column;justify-content:center;opacity:0;color:var(--stzh-color-primary);transition-property:color;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-checkbox__label.sc-stzh-checkbox{--stzh-base-color:initial;display:inline-block;color:var(--stzh-base-color);transition:color var(--stzh-base-transition-animation-speed);margin-left:var(--stzh-space-small);line-height:1.5rem}.stzh-checkbox__label.sc-stzh-checkbox:empty{display:none}.stzh-checkbox__marker.sc-stzh-checkbox{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-left:calc(-0.25em + var(--stzh-space-xsmall))}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--stzh-color-primary70)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-primary90)}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__mark.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-primary70)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-primary90)}.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{opacity:1}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-error60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__field-wrapper.sc-stzh-checkbox{cursor:not-allowed}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--stzh-color-grey60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__mark.sc-stzh-checkbox{background-color:var(--stzh-color-grey20)}";let M=0;const _=class{constructor(s){t(this,s);this.stzhChange=i(this,"stzhChange",7);this.stzhFocus=i(this,"stzhFocus",7);this.stzhBlur=i(this,"stzhBlur",7);this.focusedByInput=false;this.handleReset=async()=>{this.checked=this.defaultChecked};this.onInput=t=>{this.checked=this.input.checked;this.stzhChange.emit({component:"stzh-checkbox",originalEvent:t,value:this.value,checked:this.checked})};this.onRootFocus=()=>{if(!this.focusedByInput){this.input.focus()}this.focusedByInput=false};this.onFocus=t=>{this.focusedByInput=true;const i=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhFocus.emit({component:"stzh-checkbox",originalEvent:t})};this.onBlur=t=>{const i=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhBlur.emit({component:"stzh-checkbox",originalEvent:t})};this.localization=undefined;this.disabled=false;this.name="";this.value="";this.invalid=false;this.required=false;this.checked=false;this.defaultChecked=undefined;this.label="";this.description=undefined;this.descriptionLong=undefined;this.descriptionLongTitle=undefined;this.hideOptional=false;this.error=undefined;this.a11yDescribedby=""}resetListener(t){if(t.target.contains(this.element)){requestAnimationFrame((()=>{this.handleReset()}))}}errorWatcher(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(i){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}}async componentWillLoad(){this.inputId=`stzh-checkbox-${M++}`;this.errorWatcher(this.error);this.defaultChecked=typeof this.defaultChecked==="boolean"?this.defaultChecked:this.checked;if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"checkbox")}}render(){var t,i;const r=o(this.element,"description")||!!this.description;const n=o(this.element,"description-long")||!!this.descriptionLong;const h=o(this.element,"error")||((t=this._error)===null||t===void 0?void 0:t.length)>0;const a={"stzh-checkbox":true,"stzh-checkbox--has-description":r,"stzh-checkbox--has-description-long":n,"stzh-checkbox--has-error":h,"stzh-checkbox--is-required":this.required,"stzh-checkbox--is-invalid":this.invalid||h,"stzh-checkbox--is-disabled":this.disabled};return s(e,{"is-invalid":this.invalid||h,tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},s("div",{class:a},s("label",{class:"stzh-checkbox__field-wrapper"},s("input",{class:"stzh-checkbox__input",ref:t=>this.input=t,type:"checkbox",id:this.inputId,name:this.name,value:this.value,disabled:this.disabled,"aria-describedby":`${this.inputId}-description ${this.a11yDescribedby}`,"aria-required":this.required?"true":"false","aria-invalid":this.invalid?"true":"false",checked:this.checked,defaultChecked:this.defaultChecked,onInput:this.onInput,onFocus:this.onFocus,onBlur:this.onBlur}),s("div",{class:"stzh-checkbox__mark"},s("div",{class:"stzh-checkbox__check",innerHTML:p})),s("div",{class:"stzh-checkbox__label"},this.label?this.label:s("slot",null),!this.hideOptional&&s("span",{class:"stzh-checkbox__marker"},s("span",{class:"stzh-checkbox__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),s("span",{class:"stzh-checkbox__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText)))),(((i=this._error)===null||i===void 0?void 0:i.length)>0||this.description||this.descriptionLong)&&s(f,{classPrefix:"stzh-checkbox",id:`${this.inputId}-description`,error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongTitle:this.descriptionLongTitle,descriptionLongUsed:n,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel})))}get element(){return r(this)}static get watchers(){return{error:["errorWatcher"]}}};_.style=z;const g=".sc-stzh-header-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-header-h{display:none}.sc-stzh-header-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h *.sc-stzh-header,.sc-stzh-header-h *.sc-stzh-header::before,.sc-stzh-header-h *.sc-stzh-header::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-header-h .has-focus.sc-stzh-header{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header{outline-style:none !important}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header::-moz-focus-inner{border:0 !important}.sc-stzh-header-h{--logo-width:auto;--logo-height:100%;--logobar-background-color:var(--stzh-header-logobar-background-color)}@media print{.sc-stzh-header-h{display:none}}[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:1.9375rem}@media screen and (min-width: 900px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:2.1875rem}}@media screen and (min-width: 1600px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:3.3125rem}}[logo-type=vbz].sc-stzh-header-h{--logo-height:1.8125rem}@media screen and (min-width: 900px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.3125rem}}@media screen and (min-width: 1600px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.75rem}}.sc-stzh-header-h[logo-type=vbz] .sc-stzh-header-s>[slot=logo]{align-self:center}.sc-stzh-header-h .sc-stzh-header-s>[slot=logo]{width:var(--logo-width);height:var(--logo-height)}.stzh-header.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);color:var(--stzh-color-grey90)}.stzh-header__inner.sc-stzh-header,.stzh-header__main.sc-stzh-header{max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-header__inner.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__main.sc-stzh-header{display:flex;flex-direction:column;background-color:var(--stzh-color-white)}@media screen and (max-width: 599px){.stzh-header__main.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__metabar.sc-stzh-header{background-color:var(--stzh-color-coolgrey10)}.stzh-header__metabar-inner.sc-stzh-header{margin-left:1.25rem;margin-right:1.25rem;display:flex;align-items:center;height:4rem}@media screen and (min-width: 600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2rem;margin-right:2rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2.5rem;margin-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:4rem;margin-right:4rem}}@media screen and (min-width: 1600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;max-width:84.25rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{height:4rem}}.stzh-header__burger.sc-stzh-header,.stzh-header__search.sc-stzh-header,.stzh-header__metanav-item.sc-stzh-header{color:var(--stzh-color-grey90);transition:color var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__burger.sc-stzh-header:hover,.stzh-header__search.sc-stzh-header:hover,.stzh-header__metanav-item.sc-stzh-header:hover{color:var(--stzh-color-black)}.stzh-header__burger.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;padding:0;margin-right:var(--stzh-space-medium);gap:var(--stzh-space-medium);color:var(--stzh-color-primary70)}@media screen and (min-width: 600px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__burger-icon.is-open.sc-stzh-header{display:none}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-close.sc-stzh-header{display:none}.stzh-header__metabar-search.sc-stzh-header{overflow:hidden;margin-right:var(--stzh-space-medium);transition-property:width;transition-duration:var(--stzh-base-transition-animation-speed);width:2.5rem;max-width:21.5625rem}.stzh-header__metabar-search.sc-stzh-header:focus-within{width:100%}@media screen and (min-width: 600px){.stzh-header__metabar-search.sc-stzh-header{width:6rem;margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-search.sc-stzh-header{width:10rem;margin-left:0;margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__search.sc-stzh-header{position:relative;display:block;width:100%}.stzh-header__search-input.sc-stzh-header{width:100%;max-width:100%;background-color:transparent;color:transparent;font-family:inherit;font-size:inherit;border:none;padding:var(--stzh-space-xsmall);padding-left:0;padding-right:0;height:var(--stzh-form-input-small-height);transition-property:padding-left, padding-right, background-color, color;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__search-input.sc-stzh-header{color:var(--stzh-color-secondary60);padding-left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}}.stzh-header__search-input.sc-stzh-header:focus{color:var(--stzh-color-secondary60);background-color:var(--stzh-color-white);padding-left:calc(var(--stzh-space-medium) + var(--stzh-icon-size) + var(--stzh-space-medium));padding-right:var(--stzh-space-xlarge)}.stzh-header__search-input.sc-stzh-header:-webkit-autofill{-webkit-background-clip:text;background-clip:text}.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-decoration,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-cancel-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-decoration{-webkit-appearance:none}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(var(--stzh-space-medium), -50%)}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{color:var(--stzh-color-grey70)}.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{position:absolute;top:50%;transform:translate(0, -50%);transition:transform var(--stzh-base-transition-animation-speed)}.stzh-header__search-icon.sc-stzh-header{left:0px}@media screen and (max-width: 599px){.stzh-header__search-icon.sc-stzh-header{transform:translate(0.5rem, -50%)}}.stzh-header__search-text.sc-stzh-header{pointer-events:none;left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}@media screen and (max-width: 599px){.stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-nav.sc-stzh-header{display:flex;align-items:center;margin-left:auto;gap:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xxlarge)}}.stzh-header__metanav-popover.sc-stzh-header{--width:auto;--min-width:15.875rem}.stzh-header__metanav-popover.is-langnav.sc-stzh-header{--min-width:8.75rem}.stzh-header__metanav-item.sc-stzh-header{display:none;gap:var(--stzh-space-small);align-items:center;justify-content:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;padding:0;border:none;text-decoration:none;font-size:100%;font-family:inherit;white-space:nowrap;min-width:2.5rem}@media screen and (min-width: 900px){.stzh-header__metanav-item.sc-stzh-header{display:flex}}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header{color:var(--stzh-color-primary70)}.stzh-header__metanav-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item.is-stay.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-mobile.sc-stzh-header{display:none}}.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:flex}}.stzh-header__metanav-menu-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item-text.sc-stzh-header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-header__metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}@media screen and (max-width: 899px){.stzh-header__metanav-item-text.has-no-short-label.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}@media screen and (max-width: 899px){.stzh-header__metanav-item-text-label-long.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}@media screen and (min-width: 600px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:flex}}@media screen and (min-width: 900px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}}.stzh-header__metanav-icon-wrapper.sc-stzh-header{position:relative;display:flex;align-items:center;justify-content:center}.stzh-header__metanav-icon-badge.sc-stzh-header{position:absolute;top:-0.25rem;right:-0.25rem}.stzh-header__metanav-icon.is-open.sc-stzh-header{display:none}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-close.sc-stzh-header{display:none}.stzh-header__logobar.sc-stzh-header{display:flex}@media screen and (min-width: 1600px){.stzh-header__logobar.sc-stzh-header{margin-left:auto;margin-right:auto;width:84.25rem}}.stzh-header__logobar-logo.sc-stzh-header{box-sizing:content-box;display:flex;overflow:hidden;flex-shrink:0}.stzh-header__logobar-decoration.sc-stzh-header{background-color:var(--logobar-background-color);flex-grow:1}@media screen and (min-width: 1600px){.stzh-header__logobar-decoration.sc-stzh-header{width:calc((100% - 34.5625rem) + ((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2));margin-right:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / -2)}}.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-medium);padding-right:var(--stzh-space-medium);padding-top:0.875rem;padding-bottom:0.6875rem;padding-left:1.25rem;display:inline-flex;width:18rem;height:4.125rem;transition:opacity var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{width:18.75rem;padding-left:2rem}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{width:24.9375rem;height:5.5rem;padding-top:1.125rem;padding-bottom:1.125rem;padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{width:38.5625rem;height:8.4375rem;padding-top:1.75rem;padding-bottom:1.5rem;padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__logo-link.sc-stzh-header{width:34.5625rem;padding-left:0}}.stzh-header__flyout.sc-stzh-header,.stzh-header__flyout-search.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);z-index:calc(var(--stzh-z-index-header) - 1);position:fixed;visibility:hidden;top:0;left:0;right:0;bottom:0;width:100dvw;height:100dvh;overflow:auto;transition:visibility var(--stzh-base-transition-animation-speed)}@media (min-height: 580px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}@media screen and (min-width: 900px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}.stzh-header__flyout-backdrop.sc-stzh-header{position:absolute;width:100%;height:100%;background-color:var(--stzh-color-black40op);opacity:0;transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-header__menu.sc-stzh-header{position:absolute;width:100%;height:auto;background-color:var(--stzh-color-secondary30);display:grid;grid-template-rows:auto auto;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateX(-100%);opacity:0}@media (min-height: 580px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{width:20.9375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:23.375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:27.4375rem}}@media screen and (min-width: 1600px){.stzh-header__menu.sc-stzh-header{width:calc((27.4375rem - 4rem) + ((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2))}}.stzh-header__menu-nav.sc-stzh-header{position:relative;overflow-x:hidden;overflow-y:hidden}@media (min-height: 580px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto}}@media screen and (min-width: 900px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto;position:static}}.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-xlarge);background-color:var(--stzh-color-secondary20)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-small)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-medium)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{display:none}}.stzh-header__menu-metanav-nav.sc-stzh-header{max-width:23.4375rem}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.sc-stzh-header{display:block;list-style:none;padding:0;margin:0}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-xxxlarge));padding-bottom:var(--stzh-space-xxxlarge)}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-huge))}}.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{overflow:auto;background-color:var(--stzh-color-secondary20);visibility:hidden;opacity:0;transform:translateX(100%);position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;transition-property:opacity, visibility, transform;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{z-index:initial;width:19.6875rem;transform:none;left:100%;transition-property:opacity, visibility}}@media screen and (min-width: 1260px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:20.875rem}}@media screen and (min-width: 1600px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:21.5625rem}}.stzh-header__menu-list.is-level-2.sc-stzh-header{height:-webkit-max-content;height:-moz-max-content;height:max-content}@media (min-height: 580px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary30);transform:none;transition-property:opacity, visibility}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header{transition-delay:var(--stzh-base-transition-animation-speed)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list.sc-stzh-header{z-index:200;transition-delay:0ms;visibility:visible;opacity:1}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header{background-color:var(--stzh-color-secondary40)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary10)}}@media screen and (max-width: 899px){.stzh-header__menu-nav.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open) .stzh-header__menu-nav.sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu-metanav-list.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open){transition-property:visibility;transition-duration:0ms;transition-delay:var(--stzh-base-transition-animation-speed);visibility:hidden}}@media screen and (max-width: 899px){.stzh-header__menu-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-list),.stzh-header__menu-metanav-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-metanav-list){transform:translateX(0);opacity:1;visibility:visible}}.stzh-header__menu-list-item.sc-stzh-header,.stzh-header__menu-metanav-list-item.sc-stzh-header{display:grid}.stzh-header__menu-list-item.is-backlink.sc-stzh-header{display:block}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;display:flex;align-items:center;gap:var(--stzh-space-xsmall);-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;text-decoration:none;background-color:transparent;color:var(--stzh-color-primary70);padding-left:var(--stzh-space-xxxlarge);padding-top:var(--stzh-space-small);padding-bottom:var(--stzh-space-small);padding-right:var(--stzh-space-large);transition-property:color, background-color;transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-size:var(--stzh-font-deci-font-size);line-height:var(--stzh-font-deci-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3.5rem}@media screen and (min-width: 900px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-1.sc-stzh-header{padding-left:calc(((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2))}}@media screen and (min-width: 900px){.stzh-header__menu-item.has-items.sc-stzh-header{cursor:default}}.stzh-header__menu-item.is-level-2.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3rem}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-bottom:var(--stzh-space-medium);padding-top:var(--stzh-space-medium);padding-bottom:var(--stzh-space-small);min-height:none;padding-left:1.25rem;padding-right:1.25rem;gap:var(--stzh-space-xxsmall)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{display:none}}.stzh-header__menu-item.is-level-2.is-main.sc-stzh-header{font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);margin-bottom:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header{min-height:2.75rem;padding-top:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item.is-level-2.sc-stzh-header{min-height:3.5rem;gap:var(--stzh-space-medium);padding-right:var(--stzh-space-xxlarge)}.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);justify-content:space-between;padding-top:0;padding-bottom:0;padding-right:var(--stzh-space-medium);margin-bottom:var(--stzh-space-xlarge);cursor:default}.stzh-header__menu-metanav-item.is-language.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);justify-content:space-between}.stzh-header__menu-metanav-item.is-action.sc-stzh-header{display:grid;padding-right:var(--stzh-space-xxxlarge);margin-top:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-hidden.sc-stzh-header{display:none}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header .stzh-header__menu-metanav-item-icon.sc-stzh-header{--size:var(--stzh-icon-size-small)}.stzh-header__menu-metanav-item-text.sc-stzh-header{display:flex;gap:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__menu-metanav-item-counter.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-header__app-nav.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__app-nav.sc-stzh-header{display:block}}.stzh-header__app-nav-bottom.sc-stzh-header{position:fixed;bottom:0;left:0;width:calc(100vw - var(--stzh-scrollbar-width));z-index:calc(var(--stzh-z-index-header) - 1)}@media screen and (min-width: 900px){.stzh-header__app-nav-bottom.sc-stzh-header{display:none}}.stzh-header--is-search-filled.sc-stzh-header .stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header--hide-logo.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:0}@media screen and (min-width: 600px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (min-width: 600px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}@media screen and (max-width: 599px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__logobar.sc-stzh-header{transition-property:opacity, visibility;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform, margin-top;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(0)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(0)}}@media screen and (min-width: 600px) and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__metabar.sc-stzh-header{visibility:hidden}}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__metabar.sc-stzh-header{visibility:hidden}.stzh-header--is-sticky.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:hidden;opacity:0}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__main.sc-stzh-header{margin-top:0px}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header__flyout-search-main.sc-stzh-header{position:absolute;width:100%;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateY(-6.25rem);opacity:0;margin-top:var(--stzh-header-main-height);overflow:auto}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:none;z-index:999;position:absolute;top:0;right:0;bottom:0;width:var(--stzh-scrollbar-width);background-color:var(--stzh-color-grey10);border-left:calc(0.5px * var(--stzh-scrollbar-active)) solid var(--stzh-color-grey30)}@media (min-height: 580px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}@media screen and (min-width: 900px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__menu.sc-stzh-header{opacity:1;transform:translateX(0)}.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search-main.sc-stzh-header{opacity:1;transform:translateX(0)}@media screen and (min-width: 600px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__inner.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}@media screen and (max-width: 599px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__main.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__main.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:1;transition:none}.stzh-header__search-button--is-hidden.sc-stzh-header{display:none}";const b="stzh-header-open";const x=class{constructor(s){t(this,s);this.stzhMetanavItemClick=i(this,"stzhMetanavItemClick",7);this.stzhMetanavItemChildClick=i(this,"stzhMetanavItemChildClick",7);this.stzhMetanavItemButtonClick=i(this,"stzhMetanavItemButtonClick",7);this.stzhMenuItemClick=i(this,"stzhMenuItemClick",7);this.stzhLanguageChange=i(this,"stzhLanguageChange",7);this.stzhSearchChange=i(this,"stzhSearchChange",7);this.stzhSearchChanged=i(this,"stzhSearchChanged",7);this.lastOpener=null;this.flyoutOpenedByMetanavItem=null;this.handleMenuListFocusout=t=>{const i=!t.currentTarget.contains(t.relatedTarget);if(this.isMedium&&i){this.closeMenuItem(false)}};this.handleBurgerClick=async()=>{if(this.flyoutOpenedByMetanavItem){this.flyoutOpenedByMetanavItem=false;this.closeMetanavItem()}else{this.flyoutSearchOpen=false;this.flyoutOpen=!this.flyoutOpen}const t=this.element.querySelector(".stzh-header__menu-item");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleSearchButtonClick=async()=>{this.flyoutOpen=false;this.flyoutSearchOpen=!this.flyoutSearchOpen;const t=this.element.querySelector(".stzh-search input[type='search']");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleBackdropClick=async()=>{this.flyoutOpen=false;this.updatePosition()};this.handleBackdropSearchClick=async()=>{this.flyoutSearchOpen=false;this.updatePosition()};this.handleMetanavItemClick=(t,i)=>{this.stzhMetanavItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleMetanavItemChildClick=(t,i)=>{this.stzhMetanavItemChildClick.emit({component:"stzh-header",itemChild:i,originalEvent:t})};this.handleMetanavItemButtonClick=(t,i)=>{this.stzhMetanavItemButtonClick.emit({component:"stzh-header",itemButton:i,originalEvent:t})};this.handleMenuItemClick=(t,i)=>{this.flyoutOpen=false;this.stzhMenuItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleSearchInput=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChange.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleSearchChange=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChanged.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleLanguageClick=(t,i)=>{if(this.languagePreventUrlchange){t.preventDefault()}this.languageActive=i.value;this.stzhLanguageChange.emit({component:"stzh-header",value:this.languageActive})};this.handleFlyoutResize=()=>{this.resizeMenunavElement()};this.handleResize=()=>{if(this.sticky==="disabled"){return}if(this.debounceResize){window.cancelAnimationFrame(this.debounceResize)}this.debounceResize=requestAnimationFrame((()=>{n((()=>{var t,i,s;this.isMedium=u("medium").matches;this.mainHeight=((t=this.mainElement)===null||t===void 0?void 0:t.offsetHeight)||0;this.metabarHeight=((i=this.metabarElement)===null||i===void 0?void 0:i.offsetHeight)||0;this.logobarHeight=((s=this.logobarElement)===null||s===void 0?void 0:s.offsetHeight)||0;this.headerTop=this.element.offsetTop;this.headerHeight=this.metabarHeight+this.logobarHeight}));h((()=>{document.documentElement.style.setProperty("--stzh-header-height",`${this.headerHeight}px`);document.documentElement.style.setProperty("--stzh-header-main-height",`${this.mainHeight}px`);document.documentElement.style.setProperty("--stzh-header-metabar-height",`${this.metabarHeight}px`);document.documentElement.style.setProperty("--stzh-header-logobar-height",`${this.logobarHeight}px`)}));this.scrollListener()}))};this.localization=undefined;this.href="https://www.stadt-zuerich.ch";this.menuId="anchorNavMain";this.searchId="anchorSearch";this.metanavId="anchorNavMeta";this.languageId="anchorNavLang";this.logoType="default";this.menuItems=[];this._menuItems=undefined;this.menuBackLabel=undefined;this.metanavItems=[];this._metanavItems=undefined;this.userSpecificMetanavItemsNotLoggedIn=[];this._userSpecificMetanavItemsNotLoggedIn=undefined;this.appNavItems=[];this._appNavItems=undefined;this.userSpecificMetanavItemsEndpoint=undefined;this.languageActive=undefined;this.languages=[];this._languages=undefined;this.languagePreventUrlchange=false;this.languageStay=false;this.hideMetabar=false;this.searchAction=undefined;this.searchFieldName="q";this.searchValue="";this.sticky="default";this.loginErrorMessage="";this.logoAnalyticsId=undefined;this.hideLogo=false;this.headerHeight=undefined;this.paddingTop=undefined;this.stickyActive=false;this.flyoutOpen=false;this.flyoutSearchOpen=false;this.searchFilled=undefined;this.fixed=false;this.fixedTransition=false;this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=false;this.userSpecificMetanavItemsLoggedIn=[];this.combinedMetanavItems=[]}handleKeydown(t){if(t.key==="Escape"){this.flyoutOpen=false;this.flyoutSearchOpen=false}}flyoutCloseClicked(){this.flyoutSearchOpen=false;this.updatePosition()}async flyoutOpenWatcher(t){if(!t){this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=null;this.flyoutOpenedByMetanavItem=false;document.body.classList.remove(b);this.enableSiblings();if(this.trap){this.trap.deactivate()}}else{document.body.classList.add(b);this.disableSiblings();if(this.trap){this.trap.activate()}}}async fixedWatcher(){this.paddingTop=this.fixed||this.flyoutOpen||this.flyoutSearchOpen?this.headerHeight:0;await this.waitForNextRender();this.fixedTransition=this.fixed||this.flyoutOpen||this.flyoutSearchOpen}stickyWatcher(){this.updatePosition()}async updatePosition(){if(this.flyoutOpen||this.flyoutSearchOpen){return}const t=()=>{this.stickyActive=true;document.documentElement.style.setProperty("--stzh-header-is-stuck","1");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","0")};const i=()=>{document.documentElement.style.setProperty("--stzh-header-is-stuck","0");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","1");this.stickyActive=false};if(this.sticky==="disabled"){i()}else if(this.sticky==="always-full"){t()}else if(this.sticky==="always"){if(this.belowStayStickyPoint){t()}else{i()}}else{if(this.scrollingUp&&this.belowStayStickyPoint){if(!this.stickyActive&&this.belowStartStickyPoint){t()}}else{if(this.stickyActive&&this.belowStayStickyPoint){i()}else{i()}}}}scrollListener(){if(this.sticky==="disabled"){return}n((()=>{this.currentScrollY=window.scrollY;this.scrollingUp=this.lastScrollY&&this.lastScrollY>this.currentScrollY;this.lastScrollY=this.currentScrollY;this.belowStayStickyPoint=this.currentScrollY>this.logobarHeight;this.belowStartStickyPoint=this.currentScrollY>this.headerHeight;this.fixed=this.belowStartStickyPoint||this.scrollingUp&&this.belowStayStickyPoint&&this.stickyActive||this.sticky==="always"&&this.belowStayStickyPoint||this.sticky==="always-full";this.headerOverlap=(this.headerTop-this.currentScrollY)/-1;this.hideLogo=this.sticky!=="always-full"&&this.isMedium&&this.headerOverlap>1}));h((()=>{this.updatePosition()}))}searchValueWatcher(t){this.searchFilled=t!==""}menuItemsWatcher(t){if(typeof t==="string"){this._menuItems=JSON.parse(t)}else{this._menuItems=t}this._menuItems=this._menuItems.map(((t,i)=>Object.assign({id:`submenu-${i}`},t)))}metanavItemsWatcher(t){if(typeof t==="string"){this._metanavItems=JSON.parse(t)}else{this._metanavItems=t}this._metanavItems=this._metanavItems.map(((t,i)=>Object.assign({id:`metanav-submenu-${i}`},t)))}appNavItemsWatcher(t){if(typeof t==="string"){this._appNavItems=JSON.parse(t)}else{this._appNavItems=t}}userSpecificMetanavItemsNotLoggedInWatcher(t){this._userSpecificMetanavItemsNotLoggedIn=t}languagesWatcher(t){if(typeof t==="string"){this._languages=JSON.parse(t)}else{this._languages=t}}getSiblings(){if(!this._parentElement){return[]}return Array.from(this._parentElement.children).filter((t=>t!==this.element))}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}waitForNextRender(){return new Promise((t=>this.renderPromiseResolve=t))}resizeMenunavElement(){if(u("headerMetanavSticky").matches||u("medium").matches||!this.openSubmenuElement){Object.assign(this.menunavElement.style,{height:null})}else{const{height:t}=this.openSubmenuElement.getBoundingClientRect();Object.assign(this.menunavElement.style,{height:`${t}px`})}}async openMenuItem(t,i){this.flyoutOpen=true;this.lastOpener=t.currentTarget;this.openSubmenuElement=this.element.querySelector(`#${i.id}`);this.currentOpenMenuItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{this.menunavElement.scrollTop=0;const t=this.openSubmenuElement&&l(this.openSubmenuElement)[0];t===null||t===void 0?void 0:t.focus();this.resizeMenunavElement()}))}async closeMenuItem(t=true){this.openSubmenuElement=null;this.currentOpenMenuItem=null;await this.waitForNextRender();if(t){requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null;this.resizeMenunavElement()}))}}async openMetanavItem(t,i){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenMetanavItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector(`#${i.id}`);const s=t&&l(t)[0];s===null||s===void 0?void 0:s.focus()}))}async closeMetanavItem(){this.currentOpenMetanavItem=null;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async openLanguage(t){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenLanguage=true;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector("#submenu-languages");const i=t&&l(t)[0];i===null||i===void 0?void 0:i.focus()}))}async closeLanguage(){this.currentOpenLanguage=false;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async requestUserSpecificMetanavItems(){if(!this.userSpecificMetanavItemsEndpoint){this.combinedMetanavItems=[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn];return}try{const t=await fetch(this.userSpecificMetanavItemsEndpoint);this.userSpecificMetanavItemsLoggedIn=await t.json();this.combinedMetanavItems=[...this._metanavItems,...this.userSpecificMetanavItemsLoggedIn]}catch(t){this.combinedMetanavItems=[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn];console.error("Error fetching data:",t);if(this.loginErrorMessage){document.querySelector("stzh-toastbar").toast(this.loginErrorMessage,{type:"error"})}}}async componentWillLoad(){this.menuItemsWatcher(this.menuItems);this.metanavItemsWatcher(this.metanavItems);this.appNavItemsWatcher(this.appNavItems);this.languagesWatcher(this.languages);this.searchValueWatcher(this.searchValue);this.userSpecificMetanavItemsNotLoggedInWatcher(this.userSpecificMetanavItemsNotLoggedIn);this.requestUserSpecificMetanavItems();if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"header")}}componentDidRender(){if(this.renderPromiseResolve){this.renderPromiseResolve()}if(this.flyoutElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutElement)}if(this.flyoutSearchElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutSearchElement)}}componentDidLoad(){this.trap=v(this.element,Object.assign(Object.assign({},c()),{initialFocus:false}));this.flyoutResizeObserver=new ResizeObserver(this.handleFlyoutResize);if(this.flyoutElement){this.flyoutResizeObserver.observe(this.flyoutElement)}}connectedCallback(){this._parentElement=this.element.parentElement;this.resizeObserver=new ResizeObserver(this.handleResize);this.resizeObserver.observe(this.element)}disconnectedCallback(){var t,i;this.flyoutOpenWatcher(false);(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.flyoutResizeObserver)===null||i===void 0?void 0:i.disconnect()}render(){var t,i,r,n,h,f,u;const l=o(this.element,"metanav-before");const v=o(this.element,"metanav-after");const c={"stzh-header":true,"stzh-header--is-flyout-open":this.flyoutOpen,"stzh-header--is-flyout-search-open":this.flyoutSearchOpen,"stzh-header--is-search-filled":this.searchFilled,"stzh-header--is-fixed":this.fixed,"stzh-header--is-fixed-transition":this.fixedTransition,"stzh-header--is-sticky":this.stickyActive,"stzh-header--is-sticky-transition":this.stickyActive&&this.fixedTransition,"stzh-header--hide-logo":this.hideLogo,"stzh-header--has-empty-metabar-mobile":!l&&!v&&this._metanavItems.filter((t=>t.stay||t.stayAndShowInMobileMenu)).length===0&&this._menuItems.length===0&&(this._languages.length===0||this._languages.length>0&&!this.languageStay)&&!this.searchAction,"stzh-header--has-empty-metabar":!l&&!v&&this._metanavItems.length===0&&this._menuItems.length===0&&this._languages.length===0&&!this.searchAction,[`stzh-header--sticky-${this.sticky}`]:!!this.sticky};const d=this.languageActive||window.stzhComponents.utils.getLocale(this.element);const m=((t=this._languages)===null||t===void 0?void 0:t.find((({value:t})=>t===d)))||((i=this._languages)===null||i===void 0?void 0:i[0])||null;const p=(t,i,e)=>{var r;const n=((r=t.items)===null||r===void 0?void 0:r.length)>0||t.itemButton||!t.href?"button":"a";return s(n,Object.assign({},e,{href:n==="a"&&t.href,target:n==="a"&&t.target,style:{order:t.cssOrder},class:Object.assign({"stzh-header__metanav-item":true,"is-heavy":t.important,"is-stay":t.stay||t.stayAndShowInMobileMenu},i||{})}),s("span",{class:{"stzh-header__metanav-item-text":true,"is-vhidden":t.labelHidden,"has-no-short-label":!t.labelShort}},s("span",{class:"stzh-header__metanav-item-text-label-long"},t.label),s("span",{class:"stzh-header__metanav-item-text-label-short","aria-hidden":"true"},t.labelShort)),t.icon&&s("span",{class:"stzh-header__metanav-icon-wrapper"},t.icon&&s("stzh-icon",{class:`stzh-header__metanav-icon ${t.iconOpen?"is-close":""}`,name:t.icon}),t.iconOpen&&s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:t.iconOpen}),(t.badge||t.badgeEmpty)&&s("stzh-badge",{class:"stzh-header__metanav-icon-badge",label:t.badge,type:typeof t.badgeType==="undefined"?"error":t.badgeType})))};return s(e,null,s("header",{class:c},s("div",{class:"stzh-header__header",style:{paddingTop:`${this.paddingTop}px`}},this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav-bottom"},s("stzh-app-nav",{items:this._appNavItems})),s("div",{class:"stzh-header__inner"},s("div",{class:"stzh-header__main",ref:t=>this.mainElement=t},s("div",{class:"stzh-header__logobar",ref:t=>this.logobarElement=t},s("div",{class:"stzh-header__logobar-logo"},s("a",{href:this.href,class:"stzh-header__logo-link","s-object-id":this.logoAnalyticsId||"Header Logo"},s("slot",{name:"logo"}))),s("div",{class:"stzh-header__logobar-decoration"})),!this.hideMetabar&&s("div",{class:"stzh-header__metabar",ref:t=>this.metabarElement=t},s("div",{class:"stzh-header__metabar-inner"},s("slot",{name:"menu-before"}),this._menuItems.length>0&&s("button",{id:this.menuId,class:`stzh-header__burger ${this.flyoutOpen&&!this.flyoutOpenedByMetanavItem&&"is-open"}`,onClick:this.handleBurgerClick},s("stzh-icon",{class:"stzh-header__burger-icon is-close",name:"menu"}),s("stzh-icon",{class:"stzh-header__burger-icon is-open",name:"close"}),s("div",{class:"stzh-header__burger-text"},this.localization.menuLabel)),this.searchAction&&!o(this.element,"search")&&s("form",{class:"stzh-header__metabar-search",action:this.searchAction,role:"search"},s("label",{class:"stzh-header__search"},s("input",{id:this.searchId,ref:t=>this.searchInput=t,class:"stzh-header__search-input",type:"search",name:this.searchFieldName,onChange:this.handleSearchChange,onInput:this.handleSearchInput}),s("stzh-icon",{class:"stzh-header__search-icon",name:"search"}),s("div",{class:"stzh-header__search-text"},this.localization.searchLabel))),o(this.element,"search")&&s("stzh-button",{iconPosition:"left",onClick:this.handleSearchButtonClick,variant:"tertiary-plain",size:"small"},s("stzh-icon",{slot:"icon",name:"search",class:this.flyoutSearchOpen?"stzh-header__search-button--is-hidden":""}),s("stzh-icon",{slot:"icon",name:"close",class:this.flyoutSearchOpen?"":"stzh-header__search-button--is-hidden"}),this.localization.searchLabel),s("slot",{name:"menu-after"}),this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav"},s("stzh-app-nav",{items:this._appNavItems})),s("div",{class:"stzh-header__metabar-nav",id:this.metanavId},s("slot",{name:"metanav-before"}),this.combinedMetanavItems.map((t=>{var i,e;return((i=t.items)===null||i===void 0?void 0:i.length)>0||t.itemButton?s(a,null,p(t,{"is-popover-mobile":true},{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}}),s("stzh-popover",{class:{"stzh-header__metanav-popover":true},placement:"bottom-end",distance:20,variant:t.variant,size:typeof t.size==="undefined"?"large":t.size},p(t,{"is-popover-desktop":true},{onClick:i=>{this.handleMetanavItemClick(i,t)}}),s("div",{slot:"content"},((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("stzh-menu",null,t.items.map((i=>s("stzh-menu-item",{class:{"stzh-header__metanav-menu-item":true,"is-heavy":typeof t.importantSubmenu==="undefined"||t.importantSubmenu},size:typeof t.size==="undefined"?"large":t.size,variant:t.variant,href:i.href,target:i.target,icon:i.icon,counter:i.counter,badge:i.badge,badgeType:i.badgeType,onClick:t=>{this.handleMetanavItemChildClick(t,i)}},i.label))))),t.itemButton&&s("stzh-button",{slot:"action",size:t.itemButton.size,href:t.itemButton.href,target:t.itemButton.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButton)}},t.itemButton.label))):p(t,{},{onClick:i=>{this.handleMetanavItemClick(i,t)}})})),((r=this._languages)===null||r===void 0?void 0:r.length)>0&&s(a,null,s("h2",{id:this.languageId,class:"stzh-header__vhidden"},this.localization.languageLabel),this._menuItems.length>0&&this.languageStay&&s("button",{class:{"stzh-header__metanav-item":true,"is-popover-mobile":true,"is-stay":this.languageStay},"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",onClick:t=>{if(this.currentOpenLanguage){this.closeLanguage()}else{this.openLanguage(t)}}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("stzh-popover",{class:"stzh-header__metanav-popover is-langnav",placement:"bottom-end",distance:20},s("button",{class:{"stzh-header__metanav-item":true,"is-popover-desktop":this._menuItems.length>0,"is-stay":this.languageStay}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("div",{slot:"content"},s("stzh-menu",null,this._languages.map((t=>s("stzh-menu-item",{class:"stzh-header__metanav-menu-item",active:(m===null||m===void 0?void 0:m.value)===t.value,href:t.value,onClick:i=>this.handleLanguageClick(i,t)},t.text))))))),s("slot",{name:"metanav-after"}))))))),(this._menuItems.length>0||((n=this.combinedMetanavItems)===null||n===void 0?void 0:n.length)>0)&&s("div",{ref:t=>this.flyoutElement=t,class:"stzh-header__flyout"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__menu"},s("nav",{class:"stzh-header__menu-nav",ref:t=>this.menunavElement=t,"aria-label":this.localization.navigationLabel},s("ul",{class:"stzh-header__menu-list is-level-1"},this._menuItems.map((t=>{var i,e;return s("li",{class:{"stzh-header__menu-list-item":true,"is-open":t===this.currentOpenMenuItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMenuItem?"true":"false","aria-controls":t.id,class:"stzh-header__menu-item is-level-1 has-items",onClick:t===this.currentOpenMenuItem?()=>this.closeMenuItem():i=>this.openMenuItem(i,t)},t.label):s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-1"},t.label),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-list is-level-2",onFocusout:this.handleMenuListFocusout},s("li",{class:"stzh-header__menu-list-item is-backlink"},s("button",{class:"stzh-header__menu-item is-level-2 is-backlink",onClick:()=>this.closeMenuItem()},s("stzh-icon",{name:"angle-left"}),s("span",null,this.menuBackLabel?this.menuBackLabel:this.localization.menuBackLabel))),s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2 is-main"},t.label)),t.items.map((t=>s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2"},t.label))))))})))),(((h=this.combinedMetanavItems)===null||h===void 0?void 0:h.length)>0||((f=this._languages)===null||f===void 0?void 0:f.length)>0)&&s("div",{class:"stzh-header__menu-metanav"},s("nav",{class:"stzh-header__menu-metanav-nav"},s("ul",{class:"stzh-header__menu-metanav-list is-level-1"},this.combinedMetanavItems.map((t=>{var i,e,r;return s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":t===this.currentOpenMetanavItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})):s("a",{href:t.href,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-metanav-list is-level-2"},s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,t.label),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:(r=this.localization.closeMetanavMenuLabel)===null||r===void 0?void 0:r.replace(/\{itemLabel\}/gi,t.label),onClick:()=>this.closeMetanavItem()}))),t.items.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{href:t.href,class:"stzh-header__menu-metanav-item is-level-2"},t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon}),s("span",{class:"stzh-header__menu-metanav-item-text"},s("span",null,t.label),t.counter&&s("span",{class:"stzh-header__menu-metanav-item-counter"},"(",t.counter,")")))))),t.itemButton&&s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action"},s("stzh-button",{href:t.itemButton.href,target:t.itemButton.target},t.itemButton.label)))))})),((u=this._languages)===null||u===void 0?void 0:u.length)>0&&s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":this.currentOpenLanguage}},s("button",{"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",class:"stzh-header__menu-metanav-item is-level-1",onClick:t=>this.openLanguage(t)},s("span",null,m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"angle-down"})),s("ul",{id:"submenu-languages",class:"stzh-header__menu-metanav-list is-level-2"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,this.localization.dialogLanguageTitle),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:"Sprach-Dialog schliessen",onClick:()=>this.closeLanguage()})),this._languages.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{class:"stzh-header__menu-metanav-item is-level-2 is-language",href:t.value,onClick:i=>this.handleLanguageClick(i,t)},s("span",null,t.text),(m===null||m===void 0?void 0:m.value)===t.value&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"checkmark"})))))))))))),o(this.element,"search")&&s("div",{ref:t=>this.flyoutSearchElement=t,class:"stzh-header__flyout-search"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropSearchClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__flyout-search-main"},s("slot",{name:"search"})))))}get element(){return r(this)}static get watchers(){return{flyoutOpen:["flyoutOpenWatcher","fixedWatcher"],flyoutSearchOpen:["flyoutOpenWatcher","fixedWatcher"],fixed:["fixedWatcher"],headerHeight:["fixedWatcher"],sticky:["stickyWatcher"],searchValue:["searchValueWatcher"],menuItems:["menuItemsWatcher"],metanavItems:["metanavItemsWatcher"],appNavItems:["appNavItemsWatcher"],userSpecificMetanavItemsNotLoggedIn:["userSpecificMetanavItemsNotLoggedInWatcher"],languages:["languagesWatcher"]}}};x.style=g;function y(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");t.WGS84=t["EPSG:4326"];t["EPSG:3785"]=t["EPSG:3857"];t.GOOGLE=t["EPSG:3857"];t["EPSG:900913"]=t["EPSG:3857"];t["EPSG:102113"]=t["EPSG:3857"]}var w=1;var k=2;var E=4;var C=5;var N=484813681109536e-20;var I=Math.PI/2;var S=.16666666666666666;var O=.04722222222222222;var T=.022156084656084655;var A=1e-10;var R=.017453292519943295;var P=57.29577951308232;var L=Math.PI/4;var D=Math.PI*2;var F=3.14159265359;var W={};W.greenwich=0;W.lisbon=-9.131906111111;W.paris=2.337229166667;W.bogota=-74.080916666667;W.madrid=-3.687938888889;W.rome=12.452333333333;W.bern=7.439583333333;W.jakarta=106.807719444444;W.ferro=-17.666666666667;W.brussels=4.367975;W.stockholm=18.058277777778;W.athens=23.7163375;W.oslo=10.722916666667;const G={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var j=/[\s_\-\/\(\)]/g;function V(t,i){if(t[i]){return t[i]}var s=Object.keys(t);var e=i.toLowerCase().replace(j,"");var r=-1;var n,h;while(++r<s.length){n=s[r];h=n.toLowerCase().replace(j,"");if(h===e){return t[n]}}}function U(t){var i={};var s=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");s.push(true);t[s[0].toLowerCase()]=s[1];return t}),{});var e,r,n;var h={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*R},lat_1:function(t){i.lat1=t*R},lat_2:function(t){i.lat2=t*R},lat_ts:function(t){i.lat_ts=t*R},lon_0:function(t){i.long0=t*R},lon_1:function(t){i.long1=t*R},lon_2:function(t){i.long2=t*R},alpha:function(t){i.alpha=parseFloat(t)*R},lonc:function(t){i.longc=t*R},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r_a:function(){i.R_A=true},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=true},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var s=V(G,t);if(s){i.to_meter=s.to_meter}},from_greenwich:function(t){i.from_greenwich=t*R},pm:function(t){var s=V(W,t);i.from_greenwich=(s?s:parseFloat(t))*R},nadgrids:function(t){if(t==="@null"){i.datumCode="none"}else{i.nadgrids=t}},axis:function(t){var s="ewnsud";if(t.length===3&&s.indexOf(t.substr(0,1))!==-1&&s.indexOf(t.substr(1,1))!==-1&&s.indexOf(t.substr(2,1))!==-1){i.axis=t}}};for(e in s){r=s[e];if(e in h){n=h[e];if(typeof n==="function"){n(r)}else{i[n]=r}}else{i[e]=r}}if(typeof i.datumCode==="string"&&i.datumCode!=="WGS84"){i.datumCode=i.datumCode.toLowerCase()}return i}var X=1;var q=2;var Y=3;var B=4;var H=5;var J=-1;var Z=/\s/;var $=/[A-Za-z]/;var K=/[A-Za-z84_]/;var Q=/[,\]]/;var tt=/[\d\.E\-\+]/;function it(t){if(typeof t!=="string"){throw new Error("not a string")}this.text=t.trim();this.level=0;this.place=0;this.root=null;this.stack=[];this.currentObject=null;this.state=X}it.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==B){while(Z.test(t)){if(this.place>=this.text.length){return}t=this.text[this.place++]}}switch(this.state){case X:return this.neutral(t);case q:return this.keyword(t);case B:return this.quoted(t);case H:return this.afterquote(t);case Y:return this.number(t);case J:return}};it.prototype.afterquote=function(t){if(t==='"'){this.word+='"';this.state=B;return}if(Q.test(t)){this.word=this.word.trim();this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)};it.prototype.afterItem=function(t){if(t===","){if(this.word!==null){this.currentObject.push(this.word)}this.word=null;this.state=X;return}if(t==="]"){this.level--;if(this.word!==null){this.currentObject.push(this.word);this.word=null}this.state=X;this.currentObject=this.stack.pop();if(!this.currentObject){this.state=J}return}};it.prototype.number=function(t){if(tt.test(t)){this.word+=t;return}if(Q.test(t)){this.word=parseFloat(this.word);this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)};it.prototype.quoted=function(t){if(t==='"'){this.state=H;return}this.word+=t;return};it.prototype.keyword=function(t){if(K.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word);this.level++;if(this.root===null){this.root=i}else{this.currentObject.push(i)}this.stack.push(this.currentObject);this.currentObject=i;this.state=X;return}if(Q.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)};it.prototype.neutral=function(t){if($.test(t)){this.word=t;this.state=q;return}if(t==='"'){this.word="";this.state=B;return}if(tt.test(t)){this.word=t;this.state=Y;return}if(Q.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)};it.prototype.output=function(){while(this.place<this.text.length){this.readCharicter()}if(this.state===J){return this.root}throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function st(t){var i=new it(t);return i.output()}function et(t,i,s){if(Array.isArray(i)){s.unshift(i);i=null}var e=i?{}:t;var r=s.reduce((function(t,i){rt(i,t);return t}),e);if(i){t[i]=r}}function rt(t,i){if(!Array.isArray(t)){i[t]=true;return}var s=t.shift();if(s==="PARAMETER"){s=t.shift()}if(t.length===1){if(Array.isArray(t[0])){i[s]={};rt(t[0],i[s]);return}i[s]=t[0];return}if(!t.length){i[s]=true;return}if(s==="TOWGS84"){i[s]=t;return}if(s==="AXIS"){if(!(s in i)){i[s]=[]}i[s].push(t);return}if(!Array.isArray(s)){i[s]={}}var e;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[s]={name:t[0].toLowerCase(),convert:t[1]};if(t.length===3){rt(t[2],i[s])}return;case"SPHEROID":case"ELLIPSOID":i[s]={name:t[0],a:t[1],rf:t[2]};if(t.length===4){rt(t[3],i[s])}return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]];et(i,s,t);return;default:e=-1;while(++e<t.length){if(!Array.isArray(t[e])){return rt(t,i[s])}}return et(i,s,t)}}var nt=.017453292519943295;function ht(t,i){var s=i[0];var e=i[1];if(!(s in t)&&e in t){t[s]=t[e];if(i.length===3){t[s]=i[2](t[s])}}}function at(t){return t*nt}function ot(t){if(t.type==="GEOGCS"){t.projName="longlat"}else if(t.type==="LOCAL_CS"){t.projName="identity";t.local=true}else{if(typeof t.PROJECTION==="object"){t.projName=Object.keys(t.PROJECTION)[0]}else{t.projName=t.PROJECTION}}if(t.AXIS){var i="";for(var s=0,e=t.AXIS.length;s<e;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];if(r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"){i+="n"}else if(r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"){i+="s"}else if(r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"){i+="e"}else if(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west"){i+="w"}}if(i.length===2){i+="u"}if(i.length===3){t.axis=i}}if(t.UNIT){t.units=t.UNIT.name.toLowerCase();if(t.units==="metre"){t.units="meter"}if(t.UNIT.convert){if(t.type==="GEOGCS"){if(t.DATUM&&t.DATUM.SPHEROID){t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a}}else{t.to_meter=t.UNIT.convert}}}var n=t.GEOGCS;if(t.type==="GEOGCS"){n=t}if(n){if(n.DATUM){t.datumCode=n.DATUM.name.toLowerCase()}else{t.datumCode=n.name.toLowerCase()}if(t.datumCode.slice(0,2)==="d_"){t.datumCode=t.datumCode.slice(2)}if(t.datumCode==="new_zealand_geodetic_datum_1949"||t.datumCode==="new_zealand_1949"){t.datumCode="nzgd49"}if(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984"){if(t.PROJECTION==="Mercator_Auxiliary_Sphere"){t.sphere=true}t.datumCode="wgs84"}if(t.datumCode.slice(-6)==="_ferro"){t.datumCode=t.datumCode.slice(0,-6)}if(t.datumCode.slice(-8)==="_jakarta"){t.datumCode=t.datumCode.slice(0,-8)}if(~t.datumCode.indexOf("belge")){t.datumCode="rnb72"}if(n.DATUM&&n.DATUM.SPHEROID){t.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk");if(t.ellps.toLowerCase().slice(0,13)==="international"){t.ellps="intl"}t.a=n.DATUM.SPHEROID.a;t.rf=parseFloat(n.DATUM.SPHEROID.rf,10)}if(n.DATUM&&n.DATUM.TOWGS84){t.datum_params=n.DATUM.TOWGS84}if(~t.datumCode.indexOf("osgb_1936")){t.datumCode="osgb36"}if(~t.datumCode.indexOf("osni_1952")){t.datumCode="osni52"}if(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965")){t.datumCode="ire65"}if(t.datumCode==="ch1903+"){t.datumCode="ch1903"}if(~t.datumCode.indexOf("israel")){t.datumCode="isr93"}}if(t.b&&!isFinite(t.b)){t.b=t.a}function h(i){var s=t.to_meter||1;return i*s}var a=function(i){return ht(t,i)};var o=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",at],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",at],["x0","false_easting",h],["y0","false_northing",h],["long0","central_meridian",at],["lat0","latitude_of_origin",at],["lat0","standard_parallel_1",at],["lat1","standard_parallel_1",at],["lat2","standard_parallel_2",at],["azimuth","Azimuth"],["alpha","azimuth",at],["srsCode","name"]];o.forEach(a);if(!t.long0&&t.longc&&(t.projName==="Albers_Conic_Equal_Area"||t.projName==="Lambert_Azimuthal_Equal_Area")){t.long0=t.longc}if(!t.lat_ts&&t.lat1&&(t.projName==="Stereographic_South_Pole"||t.projName==="Polar Stereographic (variant B)")){t.lat0=at(t.lat1>0?90:-90);t.lat_ts=t.lat1}else if(!t.lat_ts&&t.lat0&&t.projName==="Polar_Stereographic"){t.lat_ts=t.lat0;t.lat0=at(t.lat0>0?90:-90)}}function ft(t){var i=st(t);var s=i.shift();var e=i.shift();i.unshift(["name",e]);i.unshift(["type",s]);var r={};rt(i,r);ot(r);return r}function ut(t){var i=this;if(arguments.length===2){var s=arguments[1];if(typeof s==="string"){if(s.charAt(0)==="+"){ut[t]=U(arguments[1])}else{ut[t]=ft(arguments[1])}}else{ut[t]=s}}else if(arguments.length===1){if(Array.isArray(t)){return t.map((function(t){if(Array.isArray(t)){ut.apply(i,t)}else{ut(t)}}))}else if(typeof t==="string"){if(t in ut){return ut[t]}}else if("EPSG"in t){ut["EPSG:"+t.EPSG]=t}else if("ESRI"in t){ut["ESRI:"+t.ESRI]=t}else if("IAU2000"in t){ut["IAU2000:"+t.IAU2000]=t}else{console.log(t)}return}}y(ut);function lt(t){return typeof t==="string"}function vt(t){return t in ut}var ct=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function dt(t){return ct.some((function(i){return t.indexOf(i)>-1}))}function mt(t){return t[0]==="+"}function pt(t){if(lt(t)){if(vt(t)){return ut[t]}if(dt(t)){return ft(t)}if(mt(t)){return U(t)}}else{return t}}function zt(t,i){t=t||{};var s,e;if(!i){return t}for(e in i){s=i[e];if(s!==undefined){t[e]=s}}return t}function Mt(t,i,s){var e=t*i;return s/Math.sqrt(1-e*e)}function _t(t){return t<0?-1:1}function gt(t){return Math.abs(t)<=F?t:t-_t(t)*D}function bt(t,i,s){var e=t*s;var r=.5*t;e=Math.pow((1-e)/(1+e),r);return Math.tan(.5*(I-i))/e}function xt(t,i){var s=.5*t;var e,r;var n=I-2*Math.atan(i);for(var h=0;h<=15;h++){e=t*Math.sin(n);r=I-2*Math.atan(i*Math.pow((1-e)/(1+e),s))-n;n+=r;if(Math.abs(r)<=1e-10){return n}}return-9999}function yt(){var t=this.b/this.a;this.es=1-t*t;if(!("x0"in this)){this.x0=0}if(!("y0"in this)){this.y0=0}this.e=Math.sqrt(this.es);if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Mt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}else{if(!this.k0){if(this.k){this.k0=this.k}else{this.k0=1}}}}function wt(t){var i=t.x;var s=t.y;if(s*P>90&&s*P<-90&&i*P>180&&i*P<-180){return null}var e,r;if(Math.abs(Math.abs(s)-I)<=A){return null}else{if(this.sphere){e=this.x0+this.a*this.k0*gt(i-this.long0);r=this.y0+this.a*this.k0*Math.log(Math.tan(L+.5*s))}else{var n=Math.sin(s);var h=bt(this.e,s,n);e=this.x0+this.a*this.k0*gt(i-this.long0);r=this.y0-this.a*this.k0*Math.log(h)}t.x=e;t.y=r;return t}}function kt(t){var i=t.x-this.x0;var s=t.y-this.y0;var e,r;if(this.sphere){r=I-2*Math.atan(Math.exp(-s/(this.a*this.k0)))}else{var n=Math.exp(-s/(this.a*this.k0));r=xt(this.e,n);if(r===-9999){return null}}e=gt(this.long0+i/(this.a*this.k0));t.x=e;t.y=r;return t}var Et=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Ct={init:yt,forward:wt,inverse:kt,names:Et};function Nt(){}function It(t){return t}var St=["longlat","identity"];const Ot={init:Nt,forward:It,inverse:It,names:St};var Tt=[Ct,Ot];var At={};var Rt=[];function Pt(t,i){var s=Rt.length;if(!t.names){console.log(i);return true}Rt[s]=t;t.names.forEach((function(t){At[t.toLowerCase()]=s}));return this}function Lt(t){if(!t){return false}var i=t.toLowerCase();if(typeof At[i]!=="undefined"&&Rt[At[i]]){return Rt[At[i]]}}function Dt(){Tt.forEach(Pt)}const Ft={start:Dt,add:Pt,get:Lt};var Wt={};Wt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Wt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Wt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Wt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Wt.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"};Wt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Wt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Wt.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"};Wt.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Wt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Wt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Wt.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"};Wt.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Wt.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"};Wt.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."};Wt.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"};Wt.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Wt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Wt.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"};Wt.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"};Wt.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"};Wt.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"};Wt.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"};Wt.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Wt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Wt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Wt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Wt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Wt.hough={a:6378270,rf:297,ellipseName:"Hough"};Wt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Wt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Wt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Wt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Wt.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"};Wt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Wt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Wt.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"};Wt.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"};Wt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Wt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Wt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Gt=Wt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Wt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function jt(t,i,s,e){var r=t*t;var n=i*i;var h=(r-n)/r;var a=0;if(e){t*=1-h*(S+h*(O+h*T));r=t*t;h=0}else{a=Math.sqrt(h)}var o=(r-n)/n;return{es:h,e:a,ep2:o}}function Vt(t,i,s,e,r){if(!t){var n=V(Wt,e);if(!n){n=Gt}t=n.a;i=n.b;s=n.rf}if(s&&!i){i=(1-1/s)*t}if(s===0||Math.abs(t-i)<A){r=true;i=t}return{a:t,b:i,rf:s,sphere:r}}var Ut={};Ut.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};Ut.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};Ut.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};Ut.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};Ut.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};Ut.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};Ut.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};Ut.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"};Ut.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};Ut.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};Ut.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};Ut.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};Ut.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};Ut.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};Ut.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};Ut.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};Ut.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function Xt(t,i,s,e,r,n){var h={};if(t===undefined||t==="none"){h.datum_type=C}else{h.datum_type=E}if(i){h.datum_params=i.map(parseFloat);if(h.datum_params[0]!==0||h.datum_params[1]!==0||h.datum_params[2]!==0){h.datum_type=w}if(h.datum_params.length>3){if(h.datum_params[3]!==0||h.datum_params[4]!==0||h.datum_params[5]!==0||h.datum_params[6]!==0){h.datum_type=k;h.datum_params[3]*=N;h.datum_params[4]*=N;h.datum_params[5]*=N;h.datum_params[6]=h.datum_params[6]/1e6+1}}}h.a=s;h.b=e;h.es=r;h.ep2=n;return h}function qt(t,i){if(!(this instanceof qt)){return new qt(t)}i=i||function(t){if(t){throw t}};var s=pt(t);if(typeof s!=="object"){i(t);return}var e=qt.projections.get(s.projName);if(!e){i(t);return}if(s.datumCode&&s.datumCode!=="none"){var r=V(Ut,s.datumCode);if(r){s.datum_params=r.towgs84?r.towgs84.split(","):null;s.ellps=r.ellipse;s.datumName=r.datumName?r.datumName:s.datumCode}}s.k0=s.k0||1;s.axis=s.axis||"enu";s.ellps=s.ellps||"wgs84";var n=Vt(s.a,s.b,s.rf,s.ellps,s.sphere);var h=jt(n.a,n.b,n.rf,s.R_A);var a=s.datum||Xt(s.datumCode,s.datum_params,n.a,n.b,h.es,h.ep2);zt(this,s);zt(this,e);this.a=n.a;this.b=n.b;this.rf=n.rf;this.sphere=n.sphere;this.es=h.es;this.e=h.e;this.ep2=h.ep2;this.datum=a;this.init();i(null,this)}qt.projections=Ft;qt.projections.start();function Yt(t,i){if(t.datum_type!==i.datum_type){return false}else if(t.a!==i.a||Math.abs(t.es-i.es)>5e-11){return false}else if(t.datum_type===w){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]}else if(t.datum_type===k){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]}else{return true}}function Bt(t,i,s){var e=t.x;var r=t.y;var n=t.z?t.z:0;var h;var a;var o;var f;if(r<-I&&r>-1.001*I){r=-I}else if(r>I&&r<1.001*I){r=I}else if(r<-I||r>I){return null}if(e>Math.PI){e-=2*Math.PI}a=Math.sin(r);f=Math.cos(r);o=a*a;h=s/Math.sqrt(1-i*o);return{x:(h+n)*f*Math.cos(e),y:(h+n)*f*Math.sin(e),z:(h*(1-i)+n)*a}}function Ht(t,i,s,e){var r=1e-12;var n=r*r;var h=30;var a;var o;var f;var u;var l;var v;var c;var d;var m;var p;var z;var M;var _;var g=t.x;var b=t.y;var x=t.z?t.z:0;var y;var w;var k;a=Math.sqrt(g*g+b*b);o=Math.sqrt(g*g+b*b+x*x);if(a/s<r){y=0;if(o/s<r){w=I;k=-e;return{x:t.x,y:t.y,z:t.z}}}else{y=Math.atan2(b,g)}f=x/o;u=a/o;l=1/Math.sqrt(1-i*(2-i)*u*u);d=u*(1-i)*l;m=f*l;_=0;do{_++;c=s/Math.sqrt(1-i*m*m);k=a*d+x*m-c*(1-i*m*m);v=i*c/(c+k);l=1/Math.sqrt(1-v*(2-v)*u*u);p=u*(1-v)*l;z=f*l;M=z*d-p*m;d=p;m=z}while(M*M>n&&_<h);w=Math.atan(z/Math.abs(p));return{x:y,y:w,z:k}}function Jt(t,i,s){if(i===w){return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]}}else if(i===k){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];return{x:f*(t.x-o*t.y+a*t.z)+e,y:f*(o*t.x+t.y-h*t.z)+r,z:f*(-a*t.x+h*t.y+t.z)+n}}}function Zt(t,i,s){if(i===w){return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]}}else if(i===k){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];var u=(t.x-e)/f;var l=(t.y-r)/f;var v=(t.z-n)/f;return{x:u+o*l-a*v,y:-o*u+l+h*v,z:a*u-h*l+v}}}function $t(t){return t===w||t===k}function Kt(t,i,s){if(Yt(t,i)){return s}if(t.datum_type===C||i.datum_type===C){return s}if(t.es===i.es&&t.a===i.a&&!$t(t.datum_type)&&!$t(i.datum_type)){return s}s=Bt(s,t.es,t.a);if($t(t.datum_type)){s=Jt(s,t.datum_type,t.datum_params)}if($t(i.datum_type)){s=Zt(s,i.datum_type,i.datum_params)}return Ht(s,i.es,i.a,i.b)}function Qt(t,i,s){var e=s.x,r=s.y,n=s.z||0;var h,a,o;var f={};for(o=0;o<3;o++){if(i&&o===2&&s.z===undefined){continue}if(o===0){h=e;a="x"}else if(o===1){h=r;a="y"}else{h=n;a="z"}switch(t.axis[o]){case"e":f[a]=h;break;case"w":f[a]=-h;break;case"n":f[a]=h;break;case"s":f[a]=-h;break;case"u":if(s[a]!==undefined){f.z=h}break;case"d":if(s[a]!==undefined){f.z=-h}break;default:return null}}return f}function ti(t){var i={x:t[0],y:t[1]};if(t.length>2){i.z=t[2]}if(t.length>3){i.m=t[3]}return i}function ii(t){si(t.x);si(t.y)}function si(t){if(typeof Number.isFinite==="function"){if(Number.isFinite(t)){return}throw new TypeError("coordinates must be finite numbers")}if(typeof t!=="number"||t!==t||!isFinite(t)){throw new TypeError("coordinates must be finite numbers")}}function ei(t,i){return(t.datum.datum_type===w||t.datum.datum_type===k)&&i.datumCode!=="WGS84"||(i.datum.datum_type===w||i.datum.datum_type===k)&&t.datumCode!=="WGS84"}function ri(t,i,s){var e;if(Array.isArray(s)){s=ti(s)}ii(s);if(t.datum&&i.datum&&ei(t,i)){e=new qt("WGS84");s=ri(t,e,s);t=e}if(t.axis!=="enu"){s=Qt(t,false,s)}if(t.projName==="longlat"){s={x:s.x*R,y:s.y*R}}else{if(t.to_meter){s={x:s.x*t.to_meter,y:s.y*t.to_meter}}s=t.inverse(s)}if(t.from_greenwich){s.x+=t.from_greenwich}s=Kt(t.datum,i.datum,s);if(i.from_greenwich){s={x:s.x-i.from_greenwich,y:s.y}}if(i.projName==="longlat"){s={x:s.x*P,y:s.y*P}}else{s=i.forward(s);if(i.to_meter){s={x:s.x/i.to_meter,y:s.y/i.to_meter}}}if(i.axis!=="enu"){return Qt(i,true,s)}return s}var ni=qt("WGS84");function hi(t,i,s){var e,r,n;if(Array.isArray(s)){e=ri(t,i,s);if(s.length===3){return[e.x,e.y,e.z]}else{return[e.x,e.y]}}else{r=ri(t,i,s);n=Object.keys(s);if(n.length===2){return r}n.forEach((function(t){if(t==="x"||t==="y"){return}r[t]=s[t]}));return r}}function ai(t){if(t instanceof qt){return t}if(t.oProj){return t.oProj}return qt(t)}function oi(t,i,s){t=ai(t);var e=false;var r;if(typeof i==="undefined"){i=t;t=ni;e=true}else if(typeof i.x!=="undefined"||Array.isArray(i)){s=i;i=t;t=ni;e=true}i=ai(i);if(s){return hi(t,i,s)}else{r={forward:function(s){return hi(t,i,s)},inverse:function(s){return hi(i,t,s)}};if(e){r.oProj=i}return r}}var fi=6;var ui="AJSAJS";var li="AFAFAF";var vi=65;var ci=73;var di=79;var mi=86;var pi=90;const zi={forward:Mi,inverse:_i,toPoint:gi};function Mi(t,i){i=i||5;return Ei(yi({lat:t[1],lon:t[0]}),i)}function _i(t){var i=wi(Si(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat,i.lon,i.lat]}return[i.left,i.bottom,i.right,i.top]}function gi(t){var i=wi(Si(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat]}return[(i.left+i.right)/2,(i.top+i.bottom)/2]}function bi(t){return t*(Math.PI/180)}function xi(t){return 180*(t/Math.PI)}function yi(t){var i=t.lat;var s=t.lon;var e=6378137;var r=.00669438;var n=.9996;var h;var a;var o,f,u,l,v;var c=bi(i);var d=bi(s);var m;var p;p=Math.floor((s+180)/6)+1;if(s===180){p=60}if(i>=56&&i<64&&s>=3&&s<12){p=32}if(i>=72&&i<84){if(s>=0&&s<9){p=31}else if(s>=9&&s<21){p=33}else if(s>=21&&s<33){p=35}else if(s>=33&&s<42){p=37}}h=(p-1)*6-180+3;m=bi(h);a=r/(1-r);o=e/Math.sqrt(1-r*Math.sin(c)*Math.sin(c));f=Math.tan(c)*Math.tan(c);u=a*Math.cos(c)*Math.cos(c);l=Math.cos(c)*(d-m);v=e*((1-r/4-3*r*r/64-5*r*r*r/256)*c-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*c)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*c)-35*r*r*r/3072*Math.sin(6*c));var z=n*o*(l+(1-f+u)*l*l*l/6+(5-18*f+f*f+72*u-58*a)*l*l*l*l*l/120)+5e5;var M=n*(v+o*Math.tan(c)*(l*l/2+(5-f+9*u+4*u*u)*l*l*l*l/24+(61-58*f+f*f+600*u-330*a)*l*l*l*l*l*l/720));if(i<0){M+=1e7}return{northing:Math.round(M),easting:Math.round(z),zoneNumber:p,zoneLetter:ki(i)}}function wi(t){var i=t.northing;var s=t.easting;var e=t.zoneLetter;var r=t.zoneNumber;if(r<0||r>60){return null}var n=.9996;var h=6378137;var a=.00669438;var o;var f=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a));var u,l,v,c,d,m;var p;var z,M;var _=s-5e5;var g=i;if(e<"N"){g-=1e7}p=(r-1)*6-180+3;o=a/(1-a);m=g/n;z=m/(h*(1-a/4-3*a*a/64-5*a*a*a/256));M=z+(3*f/2-27*f*f*f/32)*Math.sin(2*z)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*z)+151*f*f*f/96*Math.sin(6*z);u=h/Math.sqrt(1-a*Math.sin(M)*Math.sin(M));l=Math.tan(M)*Math.tan(M);v=o*Math.cos(M)*Math.cos(M);c=h*(1-a)/Math.pow(1-a*Math.sin(M)*Math.sin(M),1.5);d=_/(u*n);var b=M-u*Math.tan(M)/c*(d*d/2-(5+3*l+10*v-4*v*v-9*o)*d*d*d*d/24+(61+90*l+298*v+45*l*l-252*o-3*v*v)*d*d*d*d*d*d/720);b=xi(b);var x=(d-(1+2*l+v)*d*d*d/6+(5-2*v+28*l-3*v*v+8*o+24*l*l)*d*d*d*d*d/120)/Math.cos(M);x=p+xi(x);var y;if(t.accuracy){var w=wi({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:w.lat,right:w.lon,bottom:b,left:x}}else{y={lat:b,lon:x}}return y}function ki(t){var i="Z";if(84>=t&&t>=72){i="X"}else if(72>t&&t>=64){i="W"}else if(64>t&&t>=56){i="V"}else if(56>t&&t>=48){i="U"}else if(48>t&&t>=40){i="T"}else if(40>t&&t>=32){i="S"}else if(32>t&&t>=24){i="R"}else if(24>t&&t>=16){i="Q"}else if(16>t&&t>=8){i="P"}else if(8>t&&t>=0){i="N"}else if(0>t&&t>=-8){i="M"}else if(-8>t&&t>=-16){i="L"}else if(-16>t&&t>=-24){i="K"}else if(-24>t&&t>=-32){i="J"}else if(-32>t&&t>=-40){i="H"}else if(-40>t&&t>=-48){i="G"}else if(-48>t&&t>=-56){i="F"}else if(-56>t&&t>=-64){i="E"}else if(-64>t&&t>=-72){i="D"}else if(-72>t&&t>=-80){i="C"}return i}function Ei(t,i){var s="00000"+t.easting,e="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Ci(t.easting,t.northing,t.zoneNumber)+s.substr(s.length-5,i)+e.substr(e.length-5,i)}function Ci(t,i,s){var e=Ni(s);var r=Math.floor(t/1e5);var n=Math.floor(i/1e5)%20;return Ii(r,n,e)}function Ni(t){var i=t%fi;if(i===0){i=fi}return i}function Ii(t,i,s){var e=s-1;var r=ui.charCodeAt(e);var n=li.charCodeAt(e);var h=r+t-1;var a=n+i;var o=false;if(h>pi){h=h-pi+vi-1;o=true}if(h===ci||r<ci&&h>ci||(h>ci||r<ci)&&o){h++}if(h===di||r<di&&h>di||(h>di||r<di)&&o){h++;if(h===ci){h++}}if(h>pi){h=h-pi+vi-1}if(a>mi){a=a-mi+vi-1;o=true}else{o=false}if(a===ci||n<ci&&a>ci||(a>ci||n<ci)&&o){a++}if(a===di||n<di&&a>di||(a>di||n<di)&&o){a++;if(a===ci){a++}}if(a>mi){a=a-mi+vi-1}var f=String.fromCharCode(h)+String.fromCharCode(a);return f}function Si(t){if(t&&t.length===0){throw"MGRSPoint coverting from nothing"}var i=t.length;var s=null;var e="";var r;var n=0;while(!/[A-Z]/.test(r=t.charAt(n))){if(n>=2){throw"MGRSPoint bad conversion from: "+t}e+=r;n++}var h=parseInt(e,10);if(n===0||n+3>i){throw"MGRSPoint bad conversion from: "+t}var a=t.charAt(n++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O"){throw"MGRSPoint zone letter "+a+" not handled: "+t}s=t.substring(n,n+=2);var o=Ni(h);var f=Oi(s.charAt(0),o);var u=Ti(s.charAt(1),o);while(u<Ai(a)){u+=2e6}var l=i-n;if(l%2!==0){throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t}var v=l/2;var c=0;var d=0;var m,p,z,M,_;if(v>0){m=1e5/Math.pow(10,v);p=t.substring(n,n+v);c=parseFloat(p)*m;z=t.substring(n+v);d=parseFloat(z)*m}M=c+f;_=d+u;return{easting:M,northing:_,zoneLetter:a,zoneNumber:h,accuracy:m}}function Oi(t,i){var s=ui.charCodeAt(i-1);var e=1e5;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===ci){s++}if(s===di){s++}if(s>pi){if(r){throw"Bad character: "+t}s=vi;r=true}e+=1e5}return e}function Ti(t,i){if(t>"V"){throw"MGRSPoint given invalid Northing "+t}var s=li.charCodeAt(i-1);var e=0;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===ci){s++}if(s===di){s++}if(s>mi){if(r){throw"Bad character: "+t}s=vi;r=true}e+=1e5}return e}function Ai(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0){return i}else{throw"Invalid zone letter: "+t}}function Ri(t,i,s){if(!(this instanceof Ri)){return new Ri(t,i,s)}if(Array.isArray(t)){this.x=t[0];this.y=t[1];this.z=t[2]||0}else if(typeof t==="object"){this.x=t.x;this.y=t.y;this.z=t.z||0}else if(typeof t==="string"&&typeof i==="undefined"){var e=t.split(",");this.x=parseFloat(e[0],10);this.y=parseFloat(e[1],10);this.z=parseFloat(e[2],10)||0}else{this.x=t;this.y=i;this.z=s||0}console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ri.fromMGRS=function(t){return new Ri(gi(t))};Ri.prototype.toMGRS=function(t){return Mi([this.x,this.y],t)};const Pi="2.4.4";var Li=1;var Di=.25;var Fi=.046875;var Wi=.01953125;var Gi=.01068115234375;var ji=.75;var Vi=.46875;var Ui=.013020833333333334;var Xi=.007120768229166667;var qi=.3645833333333333;var Yi=.005696614583333333;var Bi=.3076171875;function Hi(t){var i=[];i[0]=Li-t*(Di+t*(Fi+t*(Wi+t*Gi)));i[1]=t*(ji-t*(Fi+t*(Wi+t*Gi)));var s=t*t;i[2]=s*(Vi-t*(Ui+t*Xi));s*=t;i[3]=s*(qi-t*Yi);i[4]=s*t*Bi;return i}function Ji(t,i,s,e){s*=i;i*=i;return e[0]*t-s*(e[1]+i*(e[2]+i*(e[3]+i*e[4])))}var Zi=20;function $i(t,i,s){var e=1/(1-i);var r=t;for(var n=Zi;n;--n){var h=Math.sin(r);var a=1-i*h*h;a=(Ji(r,h,Math.cos(r),s)-t)*(a*Math.sqrt(a))*e;r-=a;if(Math.abs(a)<A){return r}}return r}function Ki(){this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;if(this.es){this.en=Hi(this.es);this.ml0=Ji(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en)}}function Qi(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r;var n,h;var a=Math.sin(s);var o=Math.cos(s);if(!this.es){var f=o*Math.sin(e);if(Math.abs(Math.abs(f)-1)<A){return 93}else{n=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0;h=o*Math.cos(e)/Math.sqrt(1-Math.pow(f,2));f=Math.abs(h);if(f>=1){if(f-1>A){return 93}else{h=0}}else{h=Math.acos(h)}if(s<0){h=-h}h=this.a*this.k0*(h-this.lat0)+this.y0}}else{var u=o*e;var l=Math.pow(u,2);var v=this.ep2*Math.pow(o,2);var c=Math.pow(v,2);var d=Math.abs(o)>A?Math.tan(s):0;var m=Math.pow(d,2);var p=Math.pow(m,2);r=1-this.es*Math.pow(a,2);u=u/Math.sqrt(r);var z=Ji(s,a,o,this.en);n=this.a*(this.k0*u*(1+l/6*(1-m+v+l/20*(5-18*m+p+14*v-58*m*v+l/42*(61+179*p-p*m-479*m)))))+this.x0;h=this.a*(this.k0*(z-this.ml0+a*e*u/2*(1+l/12*(5-m+9*v+4*c+l/30*(61+p-58*m+270*v-330*m*v+l/56*(1385+543*p-p*m-3111*m))))))+this.y0}t.x=n;t.y=h;return t}function ts(t){var i,s;var e,r;var n=(t.x-this.x0)*(1/this.a);var h=(t.y-this.y0)*(1/this.a);if(!this.es){var a=Math.exp(n/this.k0);var o=.5*(a-1/a);var f=this.lat0+h/this.k0;var u=Math.cos(f);i=Math.sqrt((1-Math.pow(u,2))/(1+Math.pow(o,2)));e=Math.asin(i);if(h<0){e=-e}if(o===0&&u===0){r=0}else{r=gt(Math.atan2(o,u)+this.long0)}}else{i=this.ml0+h/this.k0;s=$i(i,this.es,this.en);if(Math.abs(s)<I){var l=Math.sin(s);var v=Math.cos(s);var c=Math.abs(v)>A?Math.tan(s):0;var d=this.ep2*Math.pow(v,2);var m=Math.pow(d,2);var p=Math.pow(c,2);var z=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var M=n*Math.sqrt(i)/this.k0;var _=Math.pow(M,2);i=i*c;e=s-i*_/(1-this.es)*.5*(1-_/12*(5+3*p-9*d*p+d-4*m-_/30*(61+90*p-252*d*p+45*z+46*d-_/56*(1385+3633*p+4095*z+1574*z*p))));r=gt(this.long0+M*(1-_/6*(1+2*p+d-_/20*(5+28*p+24*z+8*d*p+6*d-_/42*(61+662*p+1320*z+720*z*p))))/v)}else{e=I*_t(h);r=0}}t.x=r;t.y=e;return t}var is=["Transverse_Mercator","Transverse Mercator","tmerc"];const ss={init:Ki,forward:Qi,inverse:ts,names:is};function es(t){var i=Math.exp(t);i=(i-1/i)/2;return i}function rs(t,i){t=Math.abs(t);i=Math.abs(i);var s=Math.max(t,i);var e=Math.min(t,i)/(s?s:1);return s*Math.sqrt(1+Math.pow(e,2))}function ns(t){var i=1+t;var s=i-1;return s===0?t:t*Math.log(i)/s}function hs(t){var i=Math.abs(t);i=ns(i*(1+i/(rs(1,i)+1)));return t<0?-i:i}function as(t,i){var s=2*Math.cos(2*i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return i+h*Math.sin(2*i)}function os(t,i){var s=2*Math.cos(i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return Math.sin(i)*h}function fs(t){var i=Math.exp(t);i=(i+1/i)/2;return i}function us(t,i,s){var e=Math.sin(i);var r=Math.cos(i);var n=es(s);var h=fs(s);var a=2*r*h;var o=-2*e*n;var f=t.length-1;var u=t[f];var l=0;var v=0;var c=0;var d;var m;while(--f>=0){d=v;m=l;v=u;l=c;u=-d+a*v-o*l+t[f];c=-m+o*v+a*l}a=e*h;o=r*n;return[a*u-o*c,a*c+o*u]}function ls(){if(this.es===undefined||this.es<=0){throw new Error("incorrect elliptical usage")}this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;this.cgb=[];this.cbg=[];this.utg=[];this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es));var i=t/(2-t);var s=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675))))));this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725))))));s=s*i;this.cgb[1]=s*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945)))));this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945)))));s=s*i;this.cgb[2]=s*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835))));this.cbg[2]=s*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835))));s=s*i;this.cgb[3]=s*(4279/630+i*(-332/35+i*(-399572/14175)));this.cbg[3]=s*(1237/630+i*(-12/5+i*(-24832/14175)));s=s*i;this.cgb[4]=s*(4174/315+i*(-144838/6237));this.cbg[4]=s*(-734/315+i*(109598/31185));s=s*i;this.cgb[5]=s*(601676/22275);this.cbg[5]=s*(444337/155925);s=Math.pow(i,2);this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256)));this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800))))));this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800))))));this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720)))));this.gtu[1]=s*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360)))));s=s*i;this.utg[2]=s*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720))));this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440))));s=s*i;this.utg[3]=s*(-4397/161280+i*(11/504+i*(830251/7257600)));this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600)));s=s*i;this.utg[4]=s*(-4583/161280+i*(108847/3991680));this.gtu[4]=s*(34729/80640+i*(-3418889/1995840));s=s*i;this.utg[5]=s*(-20648693/638668800);this.gtu[5]=s*(212378941/319334400);var e=as(this.cbg,this.lat0);this.Zb=-this.Qn*(e+os(this.gtu,2*e))}function vs(t){var i=gt(t.x-this.long0);var s=t.y;s=as(this.cbg,s);var e=Math.sin(s);var r=Math.cos(s);var n=Math.sin(i);var h=Math.cos(i);s=Math.atan2(e,h*r);i=Math.atan2(n*r,rs(e,r*h));i=hs(Math.tan(i));var a=us(this.gtu,2*s,2*i);s=s+a[0];i=i+a[1];var o;var f;if(Math.abs(i)<=2.623395162778){o=this.a*(this.Qn*i)+this.x0;f=this.a*(this.Qn*s+this.Zb)+this.y0}else{o=Infinity;f=Infinity}t.x=o;t.y=f;return t}function cs(t){var i=(t.x-this.x0)*(1/this.a);var s=(t.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn;i=i/this.Qn;var e;var r;if(Math.abs(i)<=2.623395162778){var n=us(this.utg,2*s,2*i);s=s+n[0];i=i+n[1];i=Math.atan(es(i));var h=Math.sin(s);var a=Math.cos(s);var o=Math.sin(i);var f=Math.cos(i);s=Math.atan2(h*f,rs(o,f*a));i=Math.atan2(o,f*a);e=gt(i+this.long0);r=as(this.cgb,s)}else{e=Infinity;r=Infinity}t.x=e;t.y=r;return t}var ds=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"];const ms={init:ls,forward:vs,inverse:cs,names:ds};function ps(t,i){if(t===undefined){t=Math.floor((gt(i)+Math.PI)*30/Math.PI)+1;if(t<0){return 0}else if(t>60){return 60}}return t}var zs="etmerc";function Ms(){var t=ps(this.zone,this.long0);if(t===undefined){throw new Error("unknown utm zone")}this.lat0=0;this.long0=(6*Math.abs(t)-183)*R;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;ms.init.apply(this);this.forward=ms.forward;this.inverse=ms.inverse}var _s=["Universal Transverse Mercator System","utm"];const gs={init:Ms,names:_s,dependsOn:zs};function bs(t,i){return Math.pow((1-t)/(1+t),i)}var xs=20;function ys(){var t=Math.sin(this.lat0);var i=Math.cos(this.lat0);i*=i;this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t);this.C=Math.sqrt(1+this.es*i*i/(1-this.es));this.phic0=Math.asin(t/this.C);this.ratexp=.5*this.C*this.e;this.K=Math.tan(.5*this.phic0+L)/(Math.pow(Math.tan(.5*this.lat0+L),this.C)*bs(this.e*t,this.ratexp))}function ws(t){var i=t.x;var s=t.y;t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+L),this.C)*bs(this.e*Math.sin(s),this.ratexp))-I;t.x=this.C*i;return t}function ks(t){var i=1e-14;var s=t.x/this.C;var e=t.y;var r=Math.pow(Math.tan(.5*e+L)/this.K,1/this.C);for(var n=xs;n>0;--n){e=2*Math.atan(r*bs(this.e*Math.sin(t.y),-.5*this.e))-I;if(Math.abs(e-t.y)<i){break}t.y=e}if(!n){return null}t.x=s;t.y=e;return t}var Es=["gauss"];const Cs={init:ys,forward:ws,inverse:ks,names:Es};function Ns(){Cs.init.apply(this);if(!this.rc){return}this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;if(!this.title){this.title="Oblique Stereographic Alternative"}}function Is(t){var i,s,e,r;t.x=gt(t.x-this.long0);Cs.forward.apply(this,[t]);i=Math.sin(t.y);s=Math.cos(t.y);e=Math.cos(t.x);r=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*e);t.x=r*s*Math.sin(t.x);t.y=r*(this.cosc0*i-this.sinc0*s*e);t.x=this.a*t.x+this.x0;t.y=this.a*t.y+this.y0;return t}function Ss(t){var i,s,e,r,n;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(n=Math.sqrt(t.x*t.x+t.y*t.y)){var h=2*Math.atan2(n,this.R2);i=Math.sin(h);s=Math.cos(h);r=Math.asin(s*this.sinc0+t.y*i*this.cosc0/n);e=Math.atan2(t.x*i,n*this.cosc0*s-t.y*this.sinc0*i)}else{r=this.phic0;e=0}t.x=e;t.y=r;Cs.inverse.apply(this,[t]);t.x=gt(t.x+this.long0);return t}var Os=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"];const Ts={init:Ns,forward:Is,inverse:Ss,names:Os};function As(t,i,s){i*=s;return Math.tan(.5*(I+t))*Math.pow((1-i)/(1+i),.5*s)}function Rs(){this.coslat0=Math.cos(this.lat0);this.sinlat0=Math.sin(this.lat0);if(this.sphere){if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=A){this.k0=.5*(1+_t(this.lat0)*Math.sin(this.lat_ts))}}else{if(Math.abs(this.coslat0)<=A){if(this.lat0>0){this.con=1}else{this.con=-1}}this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e));if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=A){this.k0=.5*this.cons*Mt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/bt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))}this.ms1=Mt(this.e,this.sinlat0,this.coslat0);this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-I;this.cosX0=Math.cos(this.X0);this.sinX0=Math.sin(this.X0)}}function Ps(t){var i=t.x;var s=t.y;var e=Math.sin(s);var r=Math.cos(s);var n,h,a,o,f,u;var l=gt(i-this.long0);if(Math.abs(Math.abs(i-this.long0)-Math.PI)<=A&&Math.abs(s+this.lat0)<=A){t.x=NaN;t.y=NaN;return t}if(this.sphere){n=2*this.k0/(1+this.sinlat0*e+this.coslat0*r*Math.cos(l));t.x=this.a*n*r*Math.sin(l)+this.x0;t.y=this.a*n*(this.coslat0*e-this.sinlat0*r*Math.cos(l))+this.y0;return t}else{h=2*Math.atan(this.ssfn_(s,e,this.e))-I;o=Math.cos(h);a=Math.sin(h);if(Math.abs(this.coslat0)<=A){f=bt(this.e,s*this.con,this.con*e);u=2*this.a*this.k0*f/this.cons;t.x=this.x0+u*Math.sin(i-this.long0);t.y=this.y0-this.con*u*Math.cos(i-this.long0);return t}else if(Math.abs(this.sinlat0)<A){n=2*this.a*this.k0/(1+o*Math.cos(l));t.y=n*a}else{n=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*o*Math.cos(l)));t.y=n*(this.cosX0*a-this.sinX0*o*Math.cos(l))+this.y0}t.x=n*o*Math.sin(l)+this.x0}return t}function Ls(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n;var h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(h/(.5*this.a*this.k0));i=this.long0;s=this.lat0;if(h<=A){t.x=i;t.y=s;return t}s=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/h);if(Math.abs(this.coslat0)<A){if(this.lat0>0){i=gt(this.long0+Math.atan2(t.x,-1*t.y))}else{i=gt(this.long0+Math.atan2(t.x,t.y))}}else{i=gt(this.long0+Math.atan2(t.x*Math.sin(a),h*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a)))}t.x=i;t.y=s;return t}else{if(Math.abs(this.coslat0)<=A){if(h<=A){s=this.lat0;i=this.long0;t.x=i;t.y=s;return t}t.x*=this.con;t.y*=this.con;e=h*this.cons/(2*this.a*this.k0);s=this.con*xt(this.e,e);i=this.con*gt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else{r=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1));i=this.long0;if(h<=A){n=this.X0}else{n=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/h);i=gt(this.long0+Math.atan2(t.x*Math.sin(r),h*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))}s=-1*xt(this.e,Math.tan(.5*(I+n)))}}t.x=i;t.y=s;return t}var Ds=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const Fs={init:Rs,forward:Ps,inverse:Ls,names:Ds,ssfn_:As};function Ws(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t);var s=this.a;var e=this.rf;var r=1/e;var n=2*r-Math.pow(r,2);var h=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2));this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4));this.b0=Math.asin(i/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2));var o=Math.log(Math.tan(Math.PI/4+t/2));var f=Math.log((1+h*i)/(1-h*i));this.K=a-this.alpha*o+this.alpha*h/2*f}function Gs(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2));var s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y)));var e=-this.alpha*(i+s)+this.K;var r=2*(Math.atan(Math.exp(e))-Math.PI/4);var n=this.alpha*(t.x-this.lambda0);var h=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(n)));var a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(n));t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0;t.x=this.R*h+this.x0;return t}function js(t){var i=t.x-this.x0;var s=t.y-this.y0;var e=i/this.R;var r=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4);var n=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(e));var h=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(r)));var a=this.lambda0+h/this.alpha;var o=0;var f=n;var u=-1e3;var l=0;while(Math.abs(f-u)>1e-7){if(++l>20){return}o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2));u=f;f=2*Math.atan(Math.exp(o))-Math.PI/2}t.x=a;t.y=f;return t}var Vs=["somerc"];const Us={init:Ws,forward:Gs,inverse:js,names:Vs};function Xs(){this.no_off=this.no_off||false;this.no_rot=this.no_rot||false;if(isNaN(this.k0)){this.k0=1}var t=Math.sin(this.lat0);var i=Math.cos(this.lat0);var s=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(i,4));this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-s*s);var e=bt(this.e,this.lat0,t);var r=this.bl/i*Math.sqrt((1-this.es)/(1-s*s));if(r*r<1){r=1}var n;var h;if(!isNaN(this.longc)){if(this.lat0>=0){n=r+Math.sqrt(r*r-1)}else{n=r-Math.sqrt(r*r-1)}this.el=n*Math.pow(e,this.bl);h=.5*(n-1/n);this.gamma0=Math.asin(Math.sin(this.alpha)/r);this.long0=this.longc-Math.asin(h*Math.tan(this.gamma0))/this.bl}else{var a=bt(this.e,this.lat1,Math.sin(this.lat1));var o=bt(this.e,this.lat2,Math.sin(this.lat2));if(this.lat0>=0){this.el=(r+Math.sqrt(r*r-1))*Math.pow(e,this.bl)}else{this.el=(r-Math.sqrt(r*r-1))*Math.pow(e,this.bl)}var f=Math.pow(a,this.bl);var u=Math.pow(o,this.bl);n=this.el/f;h=.5*(n-1/n);var l=(this.el*this.el-u*f)/(this.el*this.el+u*f);var v=(u-f)/(u+f);var c=gt(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(l*Math.tan(.5*this.bl*c)/v)/this.bl;this.long0=gt(this.long0);var d=gt(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*d)/h);this.alpha=Math.asin(r*Math.sin(this.gamma0))}if(this.no_off){this.uc=0}else{if(this.lat0>=0){this.uc=this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha))}else{this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha))}}}function qs(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r,n;var h;if(Math.abs(Math.abs(s)-I)<=A){if(s>0){h=-1}else{h=1}n=this.al/this.bl*Math.log(Math.tan(L+h*this.gamma0*.5));r=-1*h*I*this.al/this.bl}else{var a=bt(this.e,s,Math.sin(s));var o=this.el/Math.pow(a,this.bl);var f=.5*(o-1/o);var u=.5*(o+1/o);var l=Math.sin(this.bl*e);var v=(f*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/u;if(Math.abs(Math.abs(v)-1)<=A){n=Number.POSITIVE_INFINITY}else{n=.5*this.al*Math.log((1-v)/(1+v))/this.bl}if(Math.abs(Math.cos(this.bl*e))<=A){r=this.al*this.bl*e}else{r=this.al*Math.atan2(f*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*e))/this.bl}}if(this.no_rot){t.x=this.x0+r;t.y=this.y0+n}else{r-=this.uc;t.x=this.x0+n*Math.cos(this.alpha)+r*Math.sin(this.alpha);t.y=this.y0+r*Math.cos(this.alpha)-n*Math.sin(this.alpha)}return t}function Ys(t){var i,s;if(this.no_rot){s=t.y-this.y0;i=t.x-this.x0}else{s=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha);i=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha);i+=this.uc}var e=Math.exp(-1*this.bl*s/this.al);var r=.5*(e-1/e);var n=.5*(e+1/e);var h=Math.sin(this.bl*i/this.al);var a=(h*Math.cos(this.gamma0)+r*Math.sin(this.gamma0))/n;var o=Math.pow(this.el/Math.sqrt((1+a)/(1-a)),1/this.bl);if(Math.abs(a-1)<A){t.x=this.long0;t.y=I}else if(Math.abs(a+1)<A){t.x=this.long0;t.y=-1*I}else{t.y=xt(this.e,o);t.x=gt(this.long0-Math.atan2(r*Math.cos(this.gamma0)-h*Math.sin(this.gamma0),Math.cos(this.bl*i/this.al))/this.bl)}return t}var Bs=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"];const Hs={init:Xs,forward:qs,inverse:Ys,names:Bs};function Js(){if(!this.lat2){this.lat2=this.lat1}if(!this.k0){this.k0=1}this.x0=this.x0||0;this.y0=this.y0||0;if(Math.abs(this.lat1+this.lat2)<A){return}var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1);var s=Math.cos(this.lat1);var e=Mt(this.e,i,s);var r=bt(this.e,this.lat1,i);var n=Math.sin(this.lat2);var h=Math.cos(this.lat2);var a=Mt(this.e,n,h);var o=bt(this.e,this.lat2,n);var f=bt(this.e,this.lat0,Math.sin(this.lat0));if(Math.abs(this.lat1-this.lat2)>A){this.ns=Math.log(e/a)/Math.log(r/o)}else{this.ns=i}if(isNaN(this.ns)){this.ns=i}this.f0=e/(this.ns*Math.pow(r,this.ns));this.rh=this.a*this.f0*Math.pow(f,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}}function Zs(t){var i=t.x;var s=t.y;if(Math.abs(2*Math.abs(s)-Math.PI)<=A){s=_t(s)*(I-2*A)}var e=Math.abs(Math.abs(s)-I);var r,n;if(e>A){r=bt(this.e,s,Math.sin(s));n=this.a*this.f0*Math.pow(r,this.ns)}else{e=s*this.ns;if(e<=0){return null}n=0}var h=this.ns*gt(i-this.long0);t.x=this.k0*(n*Math.sin(h))+this.x0;t.y=this.k0*(this.rh-n*Math.cos(h))+this.y0;return t}function $s(t){var i,s,e;var r,n;var h=(t.x-this.x0)/this.k0;var a=this.rh-(t.y-this.y0)/this.k0;if(this.ns>0){i=Math.sqrt(h*h+a*a);s=1}else{i=-Math.sqrt(h*h+a*a);s=-1}var o=0;if(i!==0){o=Math.atan2(s*h,s*a)}if(i!==0||this.ns>0){s=1/this.ns;e=Math.pow(i/(this.a*this.f0),s);r=xt(this.e,e);if(r===-9999){return null}}else{r=-I}n=gt(o/this.ns+this.long0);t.x=n;t.y=r;return t}var Ks=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"];const Qs={init:Js,forward:Zs,inverse:$s,names:Ks};function te(){this.a=6377397.155;this.es=.006674372230614;this.e=Math.sqrt(this.es);if(!this.lat0){this.lat0=.863937979737193}if(!this.long0){this.long0=.7417649320975901-.308341501185665}if(!this.k0){this.k0=.9999}this.s45=.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq}function ie(t){var i,s,e,r,n,h,a;var o=t.x;var f=t.y;var u=gt(o-this.long0);i=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2);s=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/i)-this.s45);e=-u*this.alfa;r=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(e));n=Math.asin(Math.cos(s)*Math.sin(e)/Math.cos(r));h=this.n*n;a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n);t.y=a*Math.cos(h)/1;t.x=a*Math.sin(h)/1;if(!this.czech){t.y*=-1;t.x*=-1}return t}function se(t){var i,s,e,r,n,h,a;var o;var f=t.x;t.x=t.y;t.y=f;if(!this.czech){t.y*=-1;t.x*=-1}h=Math.sqrt(t.x*t.x+t.y*t.y);n=Math.atan2(t.y,t.x);r=n/Math.sin(this.s0);e=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);i=Math.asin(Math.cos(this.ad)*Math.sin(e)-Math.sin(this.ad)*Math.cos(e)*Math.cos(r));s=Math.asin(Math.cos(e)*Math.sin(r)/Math.cos(i));t.x=this.long0-s/this.alfa;a=i;o=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45);if(Math.abs(a-t.y)<1e-10){o=1}a=t.y;u+=1}while(o===0&&u<15);if(u>=15){return null}return t}var ee=["Krovak","krovak"];const re={init:te,forward:ie,inverse:se,names:ee};function ne(t,i,s,e,r){return t*r-i*Math.sin(2*r)+s*Math.sin(4*r)-e*Math.sin(6*r)}function he(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function ae(t){return.375*t*(1+.25*t*(1+.46875*t))}function oe(t){return.05859375*t*t*(1+.75*t)}function fe(t){return t*t*t*(35/3072)}function ue(t,i,s){var e=i*s;return t/Math.sqrt(1-e*e)}function le(t){return Math.abs(t)<I?t:t-_t(t)*Math.PI}function ve(t,i,s,e,r){var n;var h;n=t/i;for(var a=0;a<15;a++){h=(t-(i*n-s*Math.sin(2*n)+e*Math.sin(4*n)-r*Math.sin(6*n)))/(i-2*s*Math.cos(2*n)+4*e*Math.cos(4*n)-6*r*Math.cos(6*n));n+=h;if(Math.abs(h)<=1e-10){return n}}return NaN}function ce(){if(!this.sphere){this.e0=he(this.es);this.e1=ae(this.es);this.e2=oe(this.es);this.e3=fe(this.es);this.ml0=this.a*ne(this.e0,this.e1,this.e2,this.e3,this.lat0)}}function de(t){var i,s;var e=t.x;var r=t.y;e=gt(e-this.long0);if(this.sphere){i=this.a*Math.asin(Math.cos(r)*Math.sin(e));s=this.a*(Math.atan2(Math.tan(r),Math.cos(e))-this.lat0)}else{var n=Math.sin(r);var h=Math.cos(r);var a=ue(this.a,this.e,n);var o=Math.tan(r)*Math.tan(r);var f=e*Math.cos(r);var u=f*f;var l=this.es*h*h/(1-this.es);var v=this.a*ne(this.e0,this.e1,this.e2,this.e3,r);i=a*f*(1-u*o*(1/6-(8-o+8*l)*u/120));s=v-this.ml0+a*n/h*u*(.5+(5-o+6*l)*u/24)}t.x=i+this.x0;t.y=s+this.y0;return t}function me(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r;if(this.sphere){var n=s+this.lat0;e=Math.asin(Math.sin(n)*Math.cos(i));r=Math.atan2(Math.tan(i),Math.cos(n))}else{var h=this.ml0/this.a+s;var a=ve(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-I)<=A){t.x=this.long0;t.y=I;if(s<0){t.y*=-1}return t}var o=ue(this.a,this.e,Math.sin(a));var f=o*o*o/this.a/this.a*(1-this.es);var u=Math.pow(Math.tan(a),2);var l=i*this.a/o;var v=l*l;e=a-o*Math.tan(a)/f*l*l*(.5-(1+3*u)*l*l/24);r=l*(1-v*(u/3+(1+3*u)*u*v/15))/Math.cos(a)}t.x=gt(r+this.long0);t.y=le(e);return t}var pe=["Cassini","Cassini_Soldner","cass"];const ze={init:ce,forward:de,inverse:me,names:pe};function Me(t,i){var s;if(t>1e-7){s=t*i;return(1-t*t)*(i/(1-s*s)-.5/t*Math.log((1-s)/(1+s)))}else{return 2*i}}var _e=1;var ge=2;var be=3;var xe=4;function ye(){var t=Math.abs(this.lat0);if(Math.abs(t-I)<A){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else if(Math.abs(t)<A){this.mode=this.EQUIT}else{this.mode=this.OBLIQ}if(this.es>0){var i;this.qp=Me(this.e,1);this.mmf=.5/(1-this.es);this.apa=Te(this.es);switch(this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp);i=Math.sin(this.lat0);this.sinb1=Me(this.e,i)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd;break}}else{if(this.mode===this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}}}function we(t){var i,s,e,r,n,h,a,o,f,u;var l=t.x;var v=t.y;l=gt(l-this.long0);if(this.sphere){n=Math.sin(v);u=Math.cos(v);e=Math.cos(l);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){s=this.mode===this.EQUIT?1+u*e:1+this.sinph0*n+this.cosph0*u*e;if(s<=A){return null}s=Math.sqrt(2/s);i=s*u*Math.sin(l);s*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*u*e}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){e=-e}if(Math.abs(v+this.phi0)<A){return null}s=L-v*.5;s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s));i=s*Math.sin(l);s*=e}}else{a=0;o=0;f=0;e=Math.cos(l);r=Math.sin(l);n=Math.sin(v);h=Me(this.e,n);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){a=h/this.qp;o=Math.sqrt(1-a*a)}switch(this.mode){case this.OBLIQ:f=1+this.sinb1*a+this.cosb1*o*e;break;case this.EQUIT:f=1+o*e;break;case this.N_POLE:f=I+v;h=this.qp-h;break;case this.S_POLE:f=v-I;h=this.qp+h;break}if(Math.abs(f)<A){return null}switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f);if(this.mode===this.OBLIQ){s=this.ymf*f*(this.cosb1*a-this.sinb1*o*e)}else{s=(f=Math.sqrt(2/(1+o*e)))*a*this.ymf}i=this.xmf*f*o*r;break;case this.N_POLE:case this.S_POLE:if(h>=0){i=(f=Math.sqrt(h))*r;s=e*(this.mode===this.S_POLE?f:-f)}else{i=s=0}break}}t.x=this.a*i+this.x0;t.y=this.a*s+this.y0;return t}function ke(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r,n,h,a,o,f;if(this.sphere){var u=0,l,v=0;l=Math.sqrt(i*i+s*s);r=l*.5;if(r>1){return null}r=2*Math.asin(r);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){v=Math.sin(r);u=Math.cos(r)}switch(this.mode){case this.EQUIT:r=Math.abs(l)<=A?0:Math.asin(s*v/l);i*=v;s=u*l;break;case this.OBLIQ:r=Math.abs(l)<=A?this.phi0:Math.asin(u*this.sinph0+s*v*this.cosph0/l);i*=v*this.cosph0;s=(u-Math.sin(r)*this.sinph0)*l;break;case this.N_POLE:s=-s;r=I-r;break;case this.S_POLE:r-=I;break}e=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,s)}else{f=0;if(this.mode===this.OBLIQ||this.mode===this.EQUIT){i/=this.dd;s*=this.dd;o=Math.sqrt(i*i+s*s);if(o<A){t.x=0;t.y=this.phi0;return t}h=2*Math.asin(.5*o/this.rq);n=Math.cos(h);i*=h=Math.sin(h);if(this.mode===this.OBLIQ){f=n*this.sinb1+s*h*this.cosb1/o;a=this.qp*f;s=o*this.cosb1*n-s*this.sinb1*h}else{f=s*h/o;a=this.qp*f;s=o*n}}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){s=-s}a=i*i+s*s;if(!a){t.x=0;t.y=this.phi0;return t}f=1-a/this.qp;if(this.mode===this.S_POLE){f=-f}}e=Math.atan2(i,s);r=Ae(Math.asin(f),this.apa)}t.x=gt(this.long0+e);t.y=r;return t}var Ee=.3333333333333333;var Ce=.17222222222222222;var Ne=.10257936507936508;var Ie=.06388888888888888;var Se=.0664021164021164;var Oe=.016415012942191543;function Te(t){var i;var s=[];s[0]=t*Ee;i=t*t;s[0]+=i*Ce;s[1]=i*Ie;i*=t;s[0]+=i*Ne;s[1]+=i*Se;s[2]=i*Oe;return s}function Ae(t,i){var s=t+t;return t+i[0]*Math.sin(s)+i[1]*Math.sin(s+s)+i[2]*Math.sin(s+s+s)}var Re=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Pe={init:ye,forward:we,inverse:ke,names:Re,S_POLE:_e,N_POLE:ge,EQUIT:be,OBLIQ:xe};function Le(t){if(Math.abs(t)>1){t=t>1?1:-1}return Math.asin(t)}function De(){if(Math.abs(this.lat1+this.lat2)<A){return}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Mt(this.e3,this.sin_po,this.cos_po);this.qs1=Me(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Mt(this.e3,this.sin_po,this.cos_po);this.qs2=Me(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=Me(this.e3,this.sin_po);if(Math.abs(this.lat1-this.lat2)>A){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0}function Fe(t){var i=t.x;var s=t.y;this.sin_phi=Math.sin(s);this.cos_phi=Math.cos(s);var e=Me(this.e3,this.sin_phi);var r=this.a*Math.sqrt(this.c-this.ns0*e)/this.ns0;var n=this.ns0*gt(i-this.long0);var h=r*Math.sin(n)+this.x0;var a=this.rh-r*Math.cos(n)+this.y0;t.x=h;t.y=a;return t}function We(t){var i,s,e,r,n,h;t.x-=this.x0;t.y=this.rh-t.y+this.y0;if(this.ns0>=0){i=Math.sqrt(t.x*t.x+t.y*t.y);e=1}else{i=-Math.sqrt(t.x*t.x+t.y*t.y);e=-1}r=0;if(i!==0){r=Math.atan2(e*t.x,e*t.y)}e=i*this.ns0/this.a;if(this.sphere){h=Math.asin((this.c-e*e)/(2*this.ns0))}else{s=(this.c-e*e)/this.ns0;h=this.phi1z(this.e3,s)}n=gt(r/this.ns0+this.long0);t.x=n;t.y=h;return t}function Ge(t,i){var s,e,r,n,h;var a=Le(.5*i);if(t<A){return a}var o=t*t;for(var f=1;f<=25;f++){s=Math.sin(a);e=Math.cos(a);r=t*s;n=1-r*r;h=.5*n*n/e*(i/(1-o)-s/n+.5/t*Math.log((1-r)/(1+r)));a=a+h;if(Math.abs(h)<=1e-7){return a}}return null}var je=["Albers_Conic_Equal_Area","Albers","aea"];const Ve={init:De,forward:Fe,inverse:We,names:je,phi1z:Ge};function Ue(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1e3*this.a;this.rc=1}function Xe(t){var i,s;var e;var r;var n;var h;var a,o;var f=t.x;var u=t.y;e=gt(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=A){a=this.x0+this.a*n*s*Math.sin(e)/h;o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)/h}else{a=this.x0+this.infinity_dist*s*Math.sin(e);o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function qe(t){var i;var s,e;var r;var n,h;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(i=Math.sqrt(t.x*t.x+t.y*t.y)){r=Math.atan2(i,this.rc);s=Math.sin(r);e=Math.cos(r);h=Le(e*this.sin_p14+t.y*s*this.cos_p14/i);n=Math.atan2(t.x*s,i*this.cos_p14*e-t.y*this.sin_p14*s);n=gt(this.long0+n)}else{h=this.phic0;n=0}t.x=n;t.y=h;return t}var Ye=["gnom"];const Be={init:Ue,forward:Xe,inverse:qe,names:Ye};function He(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6){if(i<0){return-1*I}else{return I}}var e=Math.asin(.5*i);var r;var n;var h;var a;for(var o=0;o<30;o++){n=Math.sin(e);h=Math.cos(e);a=t*n;r=Math.pow(1-a*a,2)/(2*h)*(i/(1-t*t)-n/(1-a*a)+.5/t*Math.log((1-a)/(1+a)));e+=r;if(Math.abs(r)<=1e-10){return e}}return NaN}function Je(){if(!this.sphere){this.k0=Mt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}function Ze(t){var i=t.x;var s=t.y;var e,r;var n=gt(i-this.long0);if(this.sphere){e=this.x0+this.a*n*Math.cos(this.lat_ts);r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts)}else{var h=Me(this.e,Math.sin(s));e=this.x0+this.a*this.k0*n;r=this.y0+this.a*h*.5/this.k0}t.x=e;t.y=r;return t}function $e(t){t.x-=this.x0;t.y-=this.y0;var i,s;if(this.sphere){i=gt(this.long0+t.x/this.a/Math.cos(this.lat_ts));s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))}else{s=He(this.e,2*t.y*this.k0/this.a);i=gt(this.long0+t.x/(this.a*this.k0))}t.x=i;t.y=s;return t}var Ke=["cea"];const Qe={init:Je,forward:Ze,inverse:$e,names:Ke};function tr(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Equidistant Cylindrical (Plate Carre)";this.rc=Math.cos(this.lat_ts)}function ir(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r=le(s-this.lat0);t.x=this.x0+this.a*e*this.rc;t.y=this.y0+this.a*r;return t}function sr(t){var i=t.x;var s=t.y;t.x=gt(this.long0+(i-this.x0)/(this.a*this.rc));t.y=le(this.lat0+(s-this.y0)/this.a);return t}var er=["Equirectangular","Equidistant_Cylindrical","eqc"];const rr={init:tr,forward:ir,inverse:sr,names:er};var nr=20;function hr(){this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=he(this.es);this.e1=ae(this.es);this.e2=oe(this.es);this.e3=fe(this.es);this.ml0=this.a*ne(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ar(t){var i=t.x;var s=t.y;var e,r,n;var h=gt(i-this.long0);n=h*Math.sin(s);if(this.sphere){if(Math.abs(s)<=A){e=this.a*h;r=-1*this.a*this.lat0}else{e=this.a*Math.sin(n)/Math.tan(s);r=this.a*(le(s-this.lat0)+(1-Math.cos(n))/Math.tan(s))}}else{if(Math.abs(s)<=A){e=this.a*h;r=-1*this.ml0}else{var a=ue(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n);r=this.a*ne(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}}t.x=e+this.x0;t.y=r+this.y0;return t}function or(t){var i,s,e,r,n;var h,a;var o,f;e=t.x-this.x0;r=t.y-this.y0;if(this.sphere){if(Math.abs(r+this.a*this.lat0)<=A){i=gt(e/this.a+this.long0);s=0}else{h=this.lat0+r/this.a;a=e*e/this.a/this.a+h*h;o=h;var u;for(n=nr;n;--n){u=Math.tan(o);f=-1*(h*(o*u+1)-o-.5*(o*o+a)*u)/((o-h)/u-1);o+=f;if(Math.abs(f)<=A){s=o;break}}i=gt(this.long0+Math.asin(e*Math.tan(o)/this.a)/Math.sin(s))}}else{if(Math.abs(r+this.ml0)<=A){s=0;i=gt(this.long0+e/this.a)}else{h=(this.ml0+r)/this.a;a=e*e/this.a/this.a+h*h;o=h;var l,v,c,d;var m;for(n=nr;n;--n){m=this.e*Math.sin(o);l=Math.sqrt(1-m*m)*Math.tan(o);v=this.a*ne(this.e0,this.e1,this.e2,this.e3,o);c=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o);d=v/this.a;f=(h*(l*d+1)-d-.5*l*(d*d+a))/(this.es*Math.sin(2*o)*(d*d+a-2*h*d)/(4*l)+(h-d)*(l*c-2/Math.sin(2*o))-c);o-=f;if(Math.abs(f)<=A){s=o;break}}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s);i=gt(this.long0+Math.asin(e*l/this.a)/Math.sin(s))}}t.x=i;t.y=s;return t}var fr=["Polyconic","poly"];const ur={init:hr,forward:ar,inverse:or,names:fr};function lr(){this.A=[];this.A[1]=.6399175073;this.A[2]=-.1358797613;this.A[3]=.063294409;this.A[4]=-.02526853;this.A[5]=.0117879;this.A[6]=-.0055161;this.A[7]=.0026906;this.A[8]=-.001333;this.A[9]=67e-5;this.A[10]=-34e-5;this.B_re=[];this.B_im=[];this.B_re[1]=.7557853228;this.B_im[1]=0;this.B_re[2]=.249204646;this.B_im[2]=.003371507;this.B_re[3]=-.001541739;this.B_im[3]=.04105856;this.B_re[4]=-.10162907;this.B_im[4]=.01727609;this.B_re[5]=-.26623489;this.B_im[5]=-.36249218;this.B_re[6]=-.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-.577245789;this.C_im[2]=-.007809598;this.C_re[3]=.508307513;this.C_im[3]=-.112208952;this.C_re[4]=-.15094762;this.C_im[4]=.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=.5185406398;this.D[3]=-.03333098;this.D[4]=-.1052906;this.D[5]=-.0368594;this.D[6]=.007317;this.D[7]=.0122;this.D[8]=.00394;this.D[9]=-.0013}function vr(t){var i;var s=t.x;var e=t.y;var r=e-this.lat0;var n=s-this.long0;var h=r/N*1e-5;var a=n;var o=1;var f=0;for(i=1;i<=10;i++){o=o*h;f=f+this.A[i]*o}var u=f;var l=a;var v=1;var c=0;var d;var m;var p=0;var z=0;for(i=1;i<=6;i++){d=v*u-c*l;m=c*u+v*l;v=d;c=m;p=p+this.B_re[i]*v-this.B_im[i]*c;z=z+this.B_im[i]*v+this.B_re[i]*c}t.x=z*this.a+this.x0;t.y=p*this.a+this.y0;return t}function cr(t){var i;var s=t.x;var e=t.y;var r=s-this.x0;var n=e-this.y0;var h=n/this.a;var a=r/this.a;var o=1;var f=0;var u;var l;var v=0;var c=0;for(i=1;i<=6;i++){u=o*h-f*a;l=f*h+o*a;o=u;f=l;v=v+this.C_re[i]*o-this.C_im[i]*f;c=c+this.C_im[i]*o+this.C_re[i]*f}for(var d=0;d<this.iterations;d++){var m=v;var p=c;var z;var M;var _=h;var g=a;for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;_=_+(i-1)*(this.B_re[i]*m-this.B_im[i]*p);g=g+(i-1)*(this.B_im[i]*m+this.B_re[i]*p)}m=1;p=0;var b=this.B_re[1];var x=this.B_im[1];for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;b=b+i*(this.B_re[i]*m-this.B_im[i]*p);x=x+i*(this.B_im[i]*m+this.B_re[i]*p)}var y=b*b+x*x;v=(_*b+g*x)/y;c=(g*b-_*x)/y}var w=v;var k=c;var E=1;var C=0;for(i=1;i<=9;i++){E=E*w;C=C+this.D[i]*E}var I=this.lat0+C*N*1e5;var S=this.long0+k;t.x=S;t.y=I;return t}var dr=["New_Zealand_Map_Grid","nzmg"];const mr={init:lr,forward:vr,inverse:cr,names:dr};function pr(){}function zr(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r=this.x0+this.a*e;var n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;t.x=r;t.y=n;return t}function Mr(t){t.x-=this.x0;t.y-=this.y0;var i=gt(this.long0+t.x/this.a);var s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);t.x=i;t.y=s;return t}var _r=["Miller_Cylindrical","mill"];const gr={init:pr,forward:zr,inverse:Mr,names:_r};var br=20;function xr(){if(!this.sphere){this.en=Hi(this.es)}else{this.n=1;this.m=0;this.es=0;this.C_y=Math.sqrt((this.m+1)/this.n);this.C_x=this.C_y/(this.m+1)}}function yr(t){var i,s;var e=t.x;var r=t.y;e=gt(e-this.long0);if(this.sphere){if(!this.m){r=this.n!==1?Math.asin(this.n*Math.sin(r)):r}else{var n=this.n*Math.sin(r);for(var h=br;h;--h){var a=(this.m*r+Math.sin(r)-n)/(this.m+Math.cos(r));r-=a;if(Math.abs(a)<A){break}}}i=this.a*this.C_x*e*(this.m+Math.cos(r));s=this.a*this.C_y*r}else{var o=Math.sin(r);var f=Math.cos(r);s=this.a*Ji(r,o,f,this.en);i=this.a*e*f/Math.sqrt(1-this.es*o*o)}t.x=i;t.y=s;return t}function wr(t){var i,s,e,r;t.x-=this.x0;e=t.x/this.a;t.y-=this.y0;i=t.y/this.a;if(this.sphere){i/=this.C_y;e=e/(this.C_x*(this.m+Math.cos(i)));if(this.m){i=Le((this.m*i+Math.sin(i))/this.n)}else if(this.n!==1){i=Le(Math.sin(i)/this.n)}e=gt(e+this.long0);i=le(i)}else{i=$i(t.y/this.a,this.es,this.en);r=Math.abs(i);if(r<I){r=Math.sin(i);s=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(i));e=gt(s)}else if(r-A<I){e=this.long0}}t.x=e;t.y=i;return t}var kr=["Sinusoidal","sinu"];const Er={init:xr,forward:yr,inverse:wr,names:kr};function Cr(){}function Nr(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r=s;var n=Math.PI*Math.sin(s);while(true){var h=-(r+Math.sin(r)-n)/(1+Math.cos(r));r+=h;if(Math.abs(h)<A){break}}r/=2;if(Math.PI/2-Math.abs(s)<A){e=0}var a=.900316316158*this.a*e*Math.cos(r)+this.x0;var o=1.4142135623731*this.a*Math.sin(r)+this.y0;t.x=a;t.y=o;return t}function Ir(t){var i;var s;t.x-=this.x0;t.y-=this.y0;s=t.y/(1.4142135623731*this.a);if(Math.abs(s)>.999999999999){s=.999999999999}i=Math.asin(s);var e=gt(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));if(e<-Math.PI){e=-Math.PI}if(e>Math.PI){e=Math.PI}s=(2*i+Math.sin(2*i))/Math.PI;if(Math.abs(s)>1){s=1}var r=Math.asin(s);t.x=e;t.y=r;return t}var Sr=["Mollweide","moll"];const Or={init:Cr,forward:Nr,inverse:Ir,names:Sr};function Tr(){if(Math.abs(this.lat1+this.lat2)<A){return}this.lat2=this.lat2||this.lat1;this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=he(this.es);this.e1=ae(this.es);this.e2=oe(this.es);this.e3=fe(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Mt(this.e,this.sinphi,this.cosphi);this.ml1=ne(this.e0,this.e1,this.e2,this.e3,this.lat1);if(Math.abs(this.lat1-this.lat2)<A){this.ns=this.sinphi}else{this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=Mt(this.e,this.sinphi,this.cosphi);this.ml2=ne(this.e0,this.e1,this.e2,this.e3,this.lat2);this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}this.g=this.ml1+this.ms1/this.ns;this.ml0=ne(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)}function Ar(t){var i=t.x;var s=t.y;var e;if(this.sphere){e=this.a*(this.g-s)}else{var r=ne(this.e0,this.e1,this.e2,this.e3,s);e=this.a*(this.g-r)}var n=this.ns*gt(i-this.long0);var h=this.x0+e*Math.sin(n);var a=this.y0+this.rh-e*Math.cos(n);t.x=h;t.y=a;return t}function Rr(t){t.x-=this.x0;t.y=this.rh-t.y+this.y0;var i,s,e,r;if(this.ns>=0){s=Math.sqrt(t.x*t.x+t.y*t.y);i=1}else{s=-Math.sqrt(t.x*t.x+t.y*t.y);i=-1}var n=0;if(s!==0){n=Math.atan2(i*t.x,i*t.y)}if(this.sphere){r=gt(this.long0+n/this.ns);e=le(this.g-s/this.a);t.x=r;t.y=e;return t}else{var h=this.g-s/this.a;e=ve(h,this.e0,this.e1,this.e2,this.e3);r=gt(this.long0+n/this.ns);t.x=r;t.y=e;return t}}var Pr=["Equidistant_Conic","eqdc"];const Lr={init:Tr,forward:Ar,inverse:Rr,names:Pr};function Dr(){this.R=this.a}function Fr(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r,n;if(Math.abs(s)<=A){r=this.x0+this.R*e;n=this.y0}var h=Le(2*Math.abs(s/Math.PI));if(Math.abs(e)<=A||Math.abs(Math.abs(s)-I)<=A){r=this.x0;if(s>=0){n=this.y0+Math.PI*this.R*Math.tan(.5*h)}else{n=this.y0+Math.PI*this.R*-Math.tan(.5*h)}}var a=.5*Math.abs(Math.PI/e-e/Math.PI);var o=a*a;var f=Math.sin(h);var u=Math.cos(h);var l=u/(f+u-1);var v=l*l;var c=l*(2/f-1);var d=c*c;var m=Math.PI*this.R*(a*(l-d)+Math.sqrt(o*(l-d)*(l-d)-(d+o)*(v-d)))/(d+o);if(e<0){m=-m}r=this.x0+m;var p=o+l;m=Math.PI*this.R*(c*p-a*Math.sqrt((d+o)*(o+1)-p*p))/(d+o);if(s>=0){n=this.y0+m}else{n=this.y0-m}t.x=r;t.y=n;return t}function Wr(t){var i,s;var e,r,n,h,a,o;var f;var u;var l;var v;var c;t.x-=this.x0;t.y-=this.y0;l=Math.PI*this.R;e=t.x/l;r=t.y/l;n=e*e+r*r;h=-Math.abs(r)*(1+n);a=h-2*r*r+e*e;o=-2*h+1+2*r*r+n*n;c=r*r/o+(2*a*a*a/o/o/o-9*h*a/o/o)/27;f=(h-a*a/3/o)/o;u=2*Math.sqrt(-f/3);l=3*c/f/u;if(Math.abs(l)>1){if(l>=0){l=1}else{l=-1}}v=Math.acos(l)/3;if(t.y>=0){s=(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}else{s=-(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}if(Math.abs(e)<A){i=this.long0}else{i=gt(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(e*e-r*r)+n*n))/2/e)}t.x=i;t.y=s;return t}var Gr=["Van_der_Grinten_I","VanDerGrinten","vandg"];const jr={init:Dr,forward:Fr,inverse:Wr,names:Gr};function Vr(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)}function Ur(t){var i=t.x;var s=t.y;var e=Math.sin(t.y);var r=Math.cos(t.y);var n=gt(i-this.long0);var h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,y,w,k,E,C,N;if(this.sphere){if(Math.abs(this.sin_p12-1)<=A){t.x=this.x0+this.a*(I-s)*Math.sin(n);t.y=this.y0-this.a*(I-s)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=A){t.x=this.x0+this.a*(I+s)*Math.sin(n);t.y=this.y0+this.a*(I+s)*Math.cos(n);return t}else{y=this.sin_p12*e+this.cos_p12*r*Math.cos(n);b=Math.acos(y);x=b/Math.sin(b);t.x=this.x0+this.a*x*r*Math.sin(n);t.y=this.y0+this.a*x*(this.cos_p12*e-this.sin_p12*r*Math.cos(n));return t}}else{h=he(this.es);a=ae(this.es);o=oe(this.es);f=fe(this.es);if(Math.abs(this.sin_p12-1)<=A){u=this.a*ne(h,a,o,f,I);l=this.a*ne(h,a,o,f,s);t.x=this.x0+(u-l)*Math.sin(n);t.y=this.y0-(u-l)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=A){u=this.a*ne(h,a,o,f,I);l=this.a*ne(h,a,o,f,s);t.x=this.x0+(u+l)*Math.sin(n);t.y=this.y0+(u+l)*Math.cos(n);return t}else{v=e/r;c=ue(this.a,this.e,this.sin_p12);d=ue(this.a,this.e,e);m=Math.atan((1-this.es)*v+this.es*c*this.sin_p12/(d*r));p=Math.atan2(Math.sin(n),this.cos_p12*Math.tan(m)-this.sin_p12*Math.cos(n));if(p===0){w=Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else if(Math.abs(Math.abs(p)-Math.PI)<=A){w=-Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else{w=Math.asin(Math.sin(n)*Math.cos(m)/Math.sin(p))}z=this.e*this.sin_p12/Math.sqrt(1-this.es);M=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es);_=z*M;g=M*M;k=w*w;E=k*w;C=E*w;N=C*w;b=c*w*(1-k*g*(1-g)/6+E/8*_*(1-2*g)+C/120*(g*(4-7*g)-3*z*z*(1-7*g))-N/48*_);t.x=this.x0+b*Math.sin(p);t.y=this.y0+b*Math.cos(p);return t}}}function Xr(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,y;if(this.sphere){i=Math.sqrt(t.x*t.x+t.y*t.y);if(i>2*I*this.a){return}s=i/this.a;e=Math.sin(s);r=Math.cos(s);n=this.long0;if(Math.abs(i)<=A){h=this.lat0}else{h=Le(r*this.sin_p12+t.y*e*this.cos_p12/i);a=Math.abs(this.lat0)-I;if(Math.abs(a)<=A){if(this.lat0>=0){n=gt(this.long0+Math.atan2(t.x,-t.y))}else{n=gt(this.long0-Math.atan2(-t.x,t.y))}}else{n=gt(this.long0+Math.atan2(t.x*e,i*this.cos_p12*r-t.y*this.sin_p12*e))}}t.x=n;t.y=h;return t}else{o=he(this.es);f=ae(this.es);u=oe(this.es);l=fe(this.es);if(Math.abs(this.sin_p12-1)<=A){v=this.a*ne(o,f,u,l,I);i=Math.sqrt(t.x*t.x+t.y*t.y);c=v-i;h=ve(c/this.a,o,f,u,l);n=gt(this.long0+Math.atan2(t.x,-1*t.y));t.x=n;t.y=h;return t}else if(Math.abs(this.sin_p12+1)<=A){v=this.a*ne(o,f,u,l,I);i=Math.sqrt(t.x*t.x+t.y*t.y);c=i-v;h=ve(c/this.a,o,f,u,l);n=gt(this.long0+Math.atan2(t.x,t.y));t.x=n;t.y=h;return t}else{i=Math.sqrt(t.x*t.x+t.y*t.y);p=Math.atan2(t.x,t.y);d=ue(this.a,this.e,this.sin_p12);z=Math.cos(p);M=this.e*this.cos_p12*z;_=-M*M/(1-this.es);g=3*this.es*(1-_)*this.sin_p12*this.cos_p12*z/(1-this.es);b=i/d;x=b-_*(1+_)*Math.pow(b,3)/6-g*(1+3*_)*Math.pow(b,4)/24;y=1-_*x*x/2-b*x*x*x/6;m=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*z);n=gt(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(m)));h=Math.atan((1-this.es*y*this.sin_p12/Math.sin(m))*Math.tan(m)/(1-this.es));t.x=n;t.y=h;return t}}}var qr=["Azimuthal_Equidistant","aeqd"];const Yr={init:Vr,forward:Ur,inverse:Xr,names:qr};function Br(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)}function Hr(t){var i,s;var e;var r;var n;var h,a,o;var f=t.x;var u=t.y;e=gt(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=A){a=this.a*n*s*Math.sin(e);o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function Jr(t){var i;var s;var e,r;var n;var h,a;t.x-=this.x0;t.y-=this.y0;i=Math.sqrt(t.x*t.x+t.y*t.y);s=Le(i/this.a);e=Math.sin(s);r=Math.cos(s);h=this.long0;if(Math.abs(i)<=A){a=this.lat0;t.x=h;t.y=a;return t}a=Le(r*this.sin_p14+t.y*e*this.cos_p14/i);n=Math.abs(this.lat0)-I;if(Math.abs(n)<=A){if(this.lat0>=0){h=gt(this.long0+Math.atan2(t.x,-t.y))}else{h=gt(this.long0-Math.atan2(-t.x,t.y))}t.x=h;t.y=a;return t}h=gt(this.long0+Math.atan2(t.x*e,i*this.cos_p14*r-t.y*this.sin_p14*e));t.x=h;t.y=a;return t}var Zr=["ortho"];const $r={init:Br,forward:Hr,inverse:Jr,names:Zr};var Kr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6};var Qr={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function tn(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Quadrilateralized Spherical Cube";if(this.lat0>=I-L/2){this.face=Kr.TOP}else if(this.lat0<=-(I-L/2)){this.face=Kr.BOTTOM}else if(Math.abs(this.long0)<=L){this.face=Kr.FRONT}else if(Math.abs(this.long0)<=I+L){this.face=this.long0>0?Kr.RIGHT:Kr.LEFT}else{this.face=Kr.BACK}if(this.es!==0){this.one_minus_f=1-(this.a-this.b)/this.a;this.one_minus_f_squared=this.one_minus_f*this.one_minus_f}}function sn(t){var i={x:0,y:0};var s,e;var r,n;var h,a;var o={value:0};t.x-=this.long0;if(this.es!==0){s=Math.atan(this.one_minus_f_squared*Math.tan(t.y))}else{s=t.y}e=t.x;if(this.face===Kr.TOP){n=I-s;if(e>=L&&e<=I+L){o.value=Qr.AREA_0;r=e-I}else if(e>I+L||e<=-(I+L)){o.value=Qr.AREA_1;r=e>0?e-F:e+F}else if(e>-(I+L)&&e<=-L){o.value=Qr.AREA_2;r=e+I}else{o.value=Qr.AREA_3;r=e}}else if(this.face===Kr.BOTTOM){n=I+s;if(e>=L&&e<=I+L){o.value=Qr.AREA_0;r=-e+I}else if(e<L&&e>=-L){o.value=Qr.AREA_1;r=-e}else if(e<-L&&e>=-(I+L)){o.value=Qr.AREA_2;r=-e-I}else{o.value=Qr.AREA_3;r=e>0?-e+F:-e-F}}else{var f,u,l;var v,c;var d,m;if(this.face===Kr.RIGHT){e=nn(e,+I)}else if(this.face===Kr.BACK){e=nn(e,+F)}else if(this.face===Kr.LEFT){e=nn(e,-I)}v=Math.sin(s);c=Math.cos(s);d=Math.sin(e);m=Math.cos(e);f=c*m;u=c*d;l=v;if(this.face===Kr.FRONT){n=Math.acos(f);r=rn(n,l,u,o)}else if(this.face===Kr.RIGHT){n=Math.acos(u);r=rn(n,l,-f,o)}else if(this.face===Kr.BACK){n=Math.acos(-f);r=rn(n,l,-u,o)}else if(this.face===Kr.LEFT){n=Math.acos(-u);r=rn(n,l,f,o)}else{n=r=0;o.value=Qr.AREA_0}}a=Math.atan(12/F*(r+Math.acos(Math.sin(r)*Math.cos(L))-I));h=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r)))));if(o.value===Qr.AREA_1){a+=I}else if(o.value===Qr.AREA_2){a+=F}else if(o.value===Qr.AREA_3){a+=1.5*F}i.x=h*Math.cos(a);i.y=h*Math.sin(a);i.x=i.x*this.a+this.x0;i.y=i.y*this.a+this.y0;t.x=i.x;t.y=i.y;return t}function en(t){var i={lam:0,phi:0};var s,e,r,n;var h,a,o,f;var u;var l={value:0};t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;e=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y));s=Math.atan2(t.y,t.x);if(t.x>=0&&t.x>=Math.abs(t.y)){l.value=Qr.AREA_0}else if(t.y>=0&&t.y>=Math.abs(t.x)){l.value=Qr.AREA_1;s-=I}else if(t.x<0&&-t.x>=Math.abs(t.y)){l.value=Qr.AREA_2;s=s<0?s+F:s-F}else{l.value=Qr.AREA_3;s+=I}u=F/12*Math.tan(s);h=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2));a=Math.atan(h);r=Math.cos(s);n=Math.tan(e);o=1-r*r*n*n*(1-Math.cos(Math.atan(1/Math.cos(a))));if(o<-1){o=-1}else if(o>+1){o=+1}if(this.face===Kr.TOP){f=Math.acos(o);i.phi=I-f;if(l.value===Qr.AREA_0){i.lam=a+I}else if(l.value===Qr.AREA_1){i.lam=a<0?a+F:a-F}else if(l.value===Qr.AREA_2){i.lam=a-I}else{i.lam=a}}else if(this.face===Kr.BOTTOM){f=Math.acos(o);i.phi=f-I;if(l.value===Qr.AREA_0){i.lam=-a+I}else if(l.value===Qr.AREA_1){i.lam=-a}else if(l.value===Qr.AREA_2){i.lam=-a-I}else{i.lam=a<0?-a-F:-a+F}}else{var v,c,d;v=o;u=v*v;if(u>=1){d=0}else{d=Math.sqrt(1-u)*Math.sin(a)}u+=d*d;if(u>=1){c=0}else{c=Math.sqrt(1-u)}if(l.value===Qr.AREA_1){u=c;c=-d;d=u}else if(l.value===Qr.AREA_2){c=-c;d=-d}else if(l.value===Qr.AREA_3){u=c;c=d;d=-u}if(this.face===Kr.RIGHT){u=v;v=-c;c=u}else if(this.face===Kr.BACK){v=-v;c=-c}else if(this.face===Kr.LEFT){u=v;v=c;c=-u}i.phi=Math.acos(-d)-I;i.lam=Math.atan2(c,v);if(this.face===Kr.RIGHT){i.lam=nn(i.lam,-I)}else if(this.face===Kr.BACK){i.lam=nn(i.lam,-F)}else if(this.face===Kr.LEFT){i.lam=nn(i.lam,+I)}}if(this.es!==0){var m;var p,z;m=i.phi<0?1:0;p=Math.tan(i.phi);z=this.b/Math.sqrt(p*p+this.one_minus_f_squared);i.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z));if(m){i.phi=-i.phi}}i.lam+=this.long0;t.x=i.lam;t.y=i.phi;return t}function rn(t,i,s,e){var r;if(t<A){e.value=Qr.AREA_0;r=0}else{r=Math.atan2(i,s);if(Math.abs(r)<=L){e.value=Qr.AREA_0}else if(r>L&&r<=I+L){e.value=Qr.AREA_1;r-=I}else if(r>I+L||r<=-(I+L)){e.value=Qr.AREA_2;r=r>=0?r-F:r+F}else{e.value=Qr.AREA_3;r+=I}}return r}function nn(t,i){var s=t+i;if(s<-F){s+=D}else if(s>+F){s-=D}return s}var hn=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const an={init:tn,forward:sn,inverse:en,names:hn};function on(t){t.Proj.projections.add(ss);t.Proj.projections.add(ms);t.Proj.projections.add(gs);t.Proj.projections.add(Ts);t.Proj.projections.add(Fs);t.Proj.projections.add(Us);t.Proj.projections.add(Hs);t.Proj.projections.add(Qs);t.Proj.projections.add(re);t.Proj.projections.add(ze);t.Proj.projections.add(Pe);t.Proj.projections.add(Ve);t.Proj.projections.add(Be);t.Proj.projections.add(Qe);t.Proj.projections.add(rr);t.Proj.projections.add(ur);t.Proj.projections.add(mr);t.Proj.projections.add(gr);t.Proj.projections.add(Er);t.Proj.projections.add(Or);t.Proj.projections.add(Lr);t.Proj.projections.add(jr);t.Proj.projections.add(Yr);t.Proj.projections.add($r);t.Proj.projections.add(an)}oi.defaultDatum="WGS84";oi.Proj=qt;oi.WGS84=new oi.Proj("WGS84");oi.Point=Ri;oi.toPoint=ti;oi.defs=ut;oi.transform=ri;oi.mgrs=zi;oi.version=Pi;on(oi);var fn={};fn.ASSUME_TOUCH=false;fn.DEFAULT_MAX_ZOOM=42;fn.DEFAULT_MIN_ZOOM=0;fn.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD=.5;fn.DEFAULT_TILE_SIZE=256;fn.DEFAULT_WMS_VERSION="1.3.0";fn.ENABLE_CANVAS=true;fn.ENABLE_PROJ4JS=true;fn.ENABLE_RASTER_REPROJECTION=true;fn.ENABLE_WEBGL=true;fn.DEBUG_WEBGL=true;fn.INITIAL_ATLAS_SIZE=256;fn.MAX_ATLAS_SIZE=-1;fn.MOUSEWHEELZOOM_MAXDELTA=1;fn.OVERVIEWMAP_MAX_RATIO=.75;fn.OVERVIEWMAP_MIN_RATIO=.1;fn.RASTER_REPROJECTION_MAX_SOURCE_TILES=100;fn.RASTER_REPROJECTION_MAX_SUBDIVISION=10;fn.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH=.25;fn.SIMPLIFY_TOLERANCE=.5;fn.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024;fn.VERSION="v4.6.5";fn.inherits=function(t,i){t.prototype=Object.create(i.prototype);t.prototype.constructor=t};fn.nullFunction=function(){};fn.getUid=function(t){return t.ol_uid||(t.ol_uid=++fn.uidCounter_)};fn.uidCounter_=0;var un={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};var ln={PROPERTYCHANGE:"propertychange"};var vn={};vn.assign=typeof Object.assign==="function"?Object.assign:function(t,i){if(t===undefined||t===null){throw new TypeError("Cannot convert undefined or null to object")}var s=Object(t);for(var e=1,r=arguments.length;e<r;++e){var n=arguments[e];if(n!==undefined&&n!==null){for(var h in n){if(n.hasOwnProperty(h)){s[h]=n[h]}}}}return s};vn.clear=function(t){for(var i in t){delete t[i]}};vn.getValues=function(t){var i=[];for(var s in t){i.push(t[s])}return i};vn.isEmpty=function(t){var i;for(i in t){return false}return!i};var cn={};cn.bindListener_=function(t){var i=function(i){var s=t.listener;var e=t.bindTo||t.target;if(t.callOnce){cn.unlistenByKey(t)}return s.call(e,i)};t.boundListener=i;return i};cn.findListener_=function(t,i,s,e){var r;for(var n=0,h=t.length;n<h;++n){r=t[n];if(r.listener===i&&r.bindTo===s){if(e){r.deleteIndex=n}return r}}return undefined};cn.getListeners=function(t,i){var s=t.ol_lm;return s?s[i]:undefined};cn.getListenerMap_=function(t){var i=t.ol_lm;if(!i){i=t.ol_lm={}}return i};cn.removeListeners_=function(t,i){var s=cn.getListeners(t,i);if(s){for(var e=0,r=s.length;e<r;++e){t.removeEventListener(i,s[e].boundListener);vn.clear(s[e])}s.length=0;var n=t.ol_lm;if(n){delete n[i];if(Object.keys(n).length===0){delete t.ol_lm}}}};cn.listen=function(t,i,s,e,r){var n=cn.getListenerMap_(t);var h=n[i];if(!h){h=n[i]=[]}var a=cn.findListener_(h,s,e,false);if(a){if(!r){a.callOnce=false}}else{a={bindTo:e,callOnce:!!r,listener:s,target:t,type:i};t.addEventListener(i,cn.bindListener_(a));h.push(a)}return a};cn.listenOnce=function(t,i,s,e){return cn.listen(t,i,s,e,true)};cn.unlisten=function(t,i,s,e){var r=cn.getListeners(t,i);if(r){var n=cn.findListener_(r,s,e,true);if(n){cn.unlistenByKey(n)}}};cn.unlistenByKey=function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=cn.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);if(s!==-1){i.splice(s,1)}if(i.length===0){cn.removeListeners_(t.target,t.type)}}vn.clear(t)}};cn.unlistenAll=function(t){var i=cn.getListenerMap_(t);for(var s in i){cn.removeListeners_(t,s)}};var dn=function(){};dn.prototype.disposed_=false;dn.prototype.dispose=function(){if(!this.disposed_){this.disposed_=true;this.disposeInternal()}};dn.prototype.disposeInternal=fn.nullFunction;var mn=function(t){this.type=t;this.target=null};mn.prototype.preventDefault=mn.prototype.stopPropagation=function(){this.propagationStopped=true};mn.stopPropagation=function(t){t.stopPropagation()};mn.preventDefault=function(t){t.preventDefault()};var pn=function(){dn.call(this);this.pendingRemovals_={};this.dispatching_={};this.listeners_={}};fn.inherits(pn,dn);pn.prototype.addEventListener=function(t,i){var s=this.listeners_[t];if(!s){s=this.listeners_[t]=[]}if(s.indexOf(i)===-1){s.push(i)}};pn.prototype.dispatchEvent=function(t){var i=typeof t==="string"?new mn(t):t;var s=i.type;i.target=this;var e=this.listeners_[s];var r;if(e){if(!(s in this.dispatching_)){this.dispatching_[s]=0;this.pendingRemovals_[s]=0}++this.dispatching_[s];for(var n=0,h=e.length;n<h;++n){if(e[n].call(this,i)===false||i.propagationStopped){r=false;break}}--this.dispatching_[s];if(this.dispatching_[s]===0){var a=this.pendingRemovals_[s];delete this.pendingRemovals_[s];while(a--){this.removeEventListener(s,fn.nullFunction)}delete this.dispatching_[s]}return r}};pn.prototype.disposeInternal=function(){cn.unlistenAll(this)};pn.prototype.getListeners=function(t){return this.listeners_[t]};pn.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0};pn.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var e=s.indexOf(i);if(t in this.pendingRemovals_){s[e]=fn.nullFunction;++this.pendingRemovals_[t]}else{s.splice(e,1);if(s.length===0){delete this.listeners_[t]}}}};var zn={CHANGE:"change",CLEAR:"clear",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"};var Mn=function(){pn.call(this);this.revision_=0};fn.inherits(Mn,pn);Mn.unByKey=function(t){if(Array.isArray(t)){for(var i=0,s=t.length;i<s;++i){cn.unlistenByKey(t[i])}}else{cn.unlistenByKey(t)}};Mn.prototype.changed=function(){++this.revision_;this.dispatchEvent(zn.CHANGE)};Mn.prototype.getRevision=function(){return this.revision_};Mn.prototype.on=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=cn.listen(this,t[n],i,s)}return r}else{return cn.listen(this,t,i,s)}};Mn.prototype.once=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=cn.listenOnce(this,t[n],i,s)}return r}else{return cn.listenOnce(this,t,i,s)}};Mn.prototype.un=function(t,i,s){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;++e){cn.unlisten(this,t[e],i,s)}return}else{cn.unlisten(this,t,i,s)}};var _n=function(t){Mn.call(this);fn.getUid(this);this.values_={};if(t!==undefined){this.setProperties(t)}};fn.inherits(_n,Mn);_n.changeEventTypeCache_={};_n.getChangeEventType=function(t){return _n.changeEventTypeCache_.hasOwnProperty(t)?_n.changeEventTypeCache_[t]:_n.changeEventTypeCache_[t]="change:"+t};_n.prototype.get=function(t){var i;if(this.values_.hasOwnProperty(t)){i=this.values_[t]}return i};_n.prototype.getKeys=function(){return Object.keys(this.values_)};_n.prototype.getProperties=function(){return vn.assign({},this.values_)};_n.prototype.notify=function(t,i){var s;s=_n.getChangeEventType(t);this.dispatchEvent(new _n.Event(s,t,i));s=ln.PROPERTYCHANGE;this.dispatchEvent(new _n.Event(s,t,i))};_n.prototype.set=function(t,i,s){if(s){this.values_[t]=i}else{var e=this.values_[t];this.values_[t]=i;if(e!==i){this.notify(t,e)}}};_n.prototype.setProperties=function(t,i){var s;for(s in t){this.set(s,t[s],i)}};_n.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t];if(!i){this.notify(t,s)}}};_n.Event=function(t,i,s){mn.call(this,t);this.key=i;this.oldValue=s};fn.inherits(_n.Event,mn);var gn=function(t){var i=fn.VERSION?fn.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.";this.code=t;this.name="AssertionError"};fn.inherits(gn,Error);var bn={};bn.assert=function(t,i){if(!t){throw new gn(i)}};var xn={};xn.clamp=function(t,i,s){return Math.min(Math.max(t,i),s)};xn.cosh=function(){var t;if("cosh"in Math){t=Math.cosh}else{t=function(t){var i=Math.exp(t);return(i+1/i)/2}}return t}();xn.roundUpToPowerOfTwo=function(t){bn.assert(0<t,29);return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))};xn.squaredSegmentDistance=function(t,i,s,e,r,n){var h=r-s;var a=n-e;if(h!==0||a!==0){var o=((t-s)*h+(i-e)*a)/(h*h+a*a);if(o>1){s=r;e=n}else if(o>0){s+=h*o;e+=a*o}}return xn.squaredDistance(t,i,s,e)};xn.squaredDistance=function(t,i,s,e){var r=s-t;var n=e-i;return r*r+n*n};xn.solveLinearSystem=function(t){var i=t.length;for(var s=0;s<i;s++){var e=s;var r=Math.abs(t[s][s]);for(var n=s+1;n<i;n++){var h=Math.abs(t[n][s]);if(h>r){r=h;e=n}}if(r===0){return null}var a=t[e];t[e]=t[s];t[s]=a;for(var o=s+1;o<i;o++){var f=-t[o][s]/t[s][s];for(var u=s;u<i+1;u++){if(s==u){t[o][u]=0}else{t[o][u]+=f*t[s][u]}}}}var l=new Array(i);for(var v=i-1;v>=0;v--){l[v]=t[v][i]/t[v][v];for(var c=v-1;c>=0;c--){t[c][i]-=t[c][v]*l[v]}}return l};xn.toDegrees=function(t){return t*180/Math.PI};xn.toRadians=function(t){return t*Math.PI/180};xn.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s};xn.lerp=function(t,i,s){return t+s*(i-t)};var yn={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};
|
|
1
|
+
import{r as t,c as i,h as s,a as e,g as r,e as n,w as h,F as a}from"./p-c7bfac7a.js";import{h as o}from"./p-d789f265.js";import{S as f}from"./p-fc692303.js";import{m as u}from"./p-10e2901a.js";import{t as l,c as v}from"./p-ed63ed76.js";import{c}from"./p-3d5f9ac0.js";import{c as d,a as m}from"./p-7183ba4d.js";import"./p-9b063923.js";const p=`<svg xmlns="http://www.w3.org/2000/svg" width="22px" height="22px" fill="none" viewBox="0 0 24 24"><g clip-path="url(#a)"><path fill="currentColor" d="m10 15.172 9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h24v24H0z"/></clipPath></defs></svg>`;const z=".sc-stzh-checkbox-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-checkbox-h{display:none}.sc-stzh-checkbox-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-checkbox-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-checkbox-h *.sc-stzh-checkbox,.sc-stzh-checkbox-h *.sc-stzh-checkbox::before,.sc-stzh-checkbox-h *.sc-stzh-checkbox::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-checkbox-h .has-focus.sc-stzh-checkbox{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox{outline-style:none !important}.sc-stzh-checkbox-h .stzh-fylingfocus-focused.sc-stzh-checkbox::-moz-focus-inner{border:0 !important}.sc-stzh-checkbox-h{display:inline-block}[disabled].sc-stzh-checkbox-h:not([disabled=false]){--description-color:var(--stzh-color-grey70)}.stzh-checkbox.sc-stzh-checkbox{display:grid}.stzh-checkbox__marker-symbol.sc-stzh-checkbox{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-checkbox__marker-text.sc-stzh-checkbox{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-checkbox__description-wrapper.sc-stzh-checkbox{display:flex;flex-direction:column-reverse;min-height:var(--description-min-height, var(--stzh-description-min-height, none))}.stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox__description.sc-stzh-checkbox{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-checkbox__error.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox__error-list.sc-stzh-checkbox{list-style:none;margin:0;padding:0}.stzh-checkbox__description.sc-stzh-checkbox{display:flex;align-items:flex-start;color:var(--stzh-input-description-color, var(--description-color, var(--stzh-color-coolgrey70)));transition:color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__description-long.sc-stzh-checkbox{margin-right:var(--stzh-space-xxsmall);margin-top:0.125rem}@supports (font: -apple-system-body) and (-webkit-appearance: none){.stzh-checkbox__description-long.sc-stzh-checkbox{margin-top:0}}.stzh-checkbox__description-long-popover.sc-stzh-checkbox{--width:auto;--max-width:27.3125rem}.stzh-checkbox__description-long-button.sc-stzh-checkbox{display:flex;justify-content:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer}.stzh-checkbox.sc-stzh-checkbox stzh-icon.stzh-checkbox__description-long-icon.sc-stzh-checkbox{--size:var(--stzh-icon-size-xsmall)}.stzh-checkbox--has-error.sc-stzh-checkbox .stzh-checkbox__error.sc-stzh-checkbox,.stzh-checkbox--has-description.sc-stzh-checkbox .stzh-checkbox__description.sc-stzh-checkbox{margin-top:var(--stzh-space-xxxsmall)}.stzh-checkbox__field-wrapper.sc-stzh-checkbox{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);position:relative;display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}.stzh-checkbox__input.sc-stzh-checkbox{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;z-index:-1;opacity:0;pointer-events:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--stzh-form-input-border-radius)}.stzh-checkbox__mark.sc-stzh-checkbox{border:0.125rem solid var(--stzh-color-black);background-color:var(--stzh-color-white);width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:var(--stzh-form-input-border-radius);display:inline-flex;justify-content:center;align-items:center;transition:border-color var(--stzh-base-transition-animation-speed)}.stzh-checkbox__check.sc-stzh-checkbox{display:flex;flex-direction:column;justify-content:center;opacity:0;color:var(--stzh-color-primary);transition-property:color;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-checkbox__label.sc-stzh-checkbox{--stzh-base-color:initial;display:inline-block;color:var(--stzh-base-color);transition:color var(--stzh-base-transition-animation-speed);margin-left:var(--stzh-space-small);line-height:1.5rem}.stzh-checkbox__label.sc-stzh-checkbox:empty{display:none}.stzh-checkbox__marker.sc-stzh-checkbox{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-left:calc(-0.25em + var(--stzh-space-xsmall))}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--stzh-color-primary70)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-primary90)}.stzh-checkbox.sc-stzh-checkbox:hover .stzh-checkbox__mark.sc-stzh-checkbox,.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-primary70)}.stzh-checkbox__input.sc-stzh-checkbox:checked:hover~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-primary90)}.stzh-checkbox__input.sc-stzh-checkbox:checked~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{opacity:1}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox,.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-error60)}.stzh-checkbox--is-invalid.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-error60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__field-wrapper.sc-stzh-checkbox{cursor:not-allowed}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__label.sc-stzh-checkbox{color:var(--stzh-color-grey60)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox .stzh-checkbox__check.sc-stzh-checkbox{color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__input.sc-stzh-checkbox~.stzh-checkbox__mark.sc-stzh-checkbox{border-color:var(--stzh-color-grey50)}.stzh-checkbox--is-disabled.sc-stzh-checkbox .stzh-checkbox__mark.sc-stzh-checkbox{background-color:var(--stzh-color-grey20)}";let M=0;const _=class{constructor(s){t(this,s);this.stzhChange=i(this,"stzhChange",7);this.stzhFocus=i(this,"stzhFocus",7);this.stzhBlur=i(this,"stzhBlur",7);this.focusedByInput=false;this.handleReset=async()=>{this.checked=this.defaultChecked};this.onInput=t=>{this.checked=this.input.checked;this.stzhChange.emit({component:"stzh-checkbox",originalEvent:t,value:this.value,checked:this.checked})};this.onRootFocus=()=>{if(!this.focusedByInput){this.input.focus()}this.focusedByInput=false};this.onFocus=t=>{this.focusedByInput=true;const i=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhFocus.emit({component:"stzh-checkbox",originalEvent:t})};this.onBlur=t=>{const i=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(i);this.stzhBlur.emit({component:"stzh-checkbox",originalEvent:t})};this.localization=undefined;this.disabled=false;this.name="";this.value="";this.invalid=false;this.required=false;this.checked=false;this.defaultChecked=undefined;this.label="";this.description=undefined;this.descriptionLong=undefined;this.descriptionLongTitle=undefined;this.hideOptional=false;this.error=undefined;this.a11yDescribedby=""}resetListener(t){if(t.target.contains(this.element)){requestAnimationFrame((()=>{this.handleReset()}))}}errorWatcher(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(i){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}}async componentWillLoad(){this.inputId=`stzh-checkbox-${M++}`;this.errorWatcher(this.error);this.defaultChecked=typeof this.defaultChecked==="boolean"?this.defaultChecked:this.checked;if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"checkbox")}}render(){var t,i;const r=o(this.element,"description")||!!this.description;const n=o(this.element,"description-long")||!!this.descriptionLong;const h=o(this.element,"error")||((t=this._error)===null||t===void 0?void 0:t.length)>0;const a={"stzh-checkbox":true,"stzh-checkbox--has-description":r,"stzh-checkbox--has-description-long":n,"stzh-checkbox--has-error":h,"stzh-checkbox--is-required":this.required,"stzh-checkbox--is-invalid":this.invalid||h,"stzh-checkbox--is-disabled":this.disabled};return s(e,{"is-invalid":this.invalid||h,tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},s("div",{class:a},s("label",{class:"stzh-checkbox__field-wrapper"},s("input",{class:"stzh-checkbox__input",ref:t=>this.input=t,type:"checkbox",id:this.inputId,name:this.name,value:this.value,disabled:this.disabled,"aria-describedby":`${this.inputId}-description ${this.a11yDescribedby}`,"aria-required":this.required?"true":"false","aria-invalid":this.invalid?"true":"false",checked:this.checked,defaultChecked:this.defaultChecked,onInput:this.onInput,onFocus:this.onFocus,onBlur:this.onBlur}),s("div",{class:"stzh-checkbox__mark"},s("div",{class:"stzh-checkbox__check",innerHTML:p})),s("div",{class:"stzh-checkbox__label"},this.label?this.label:s("slot",null),!this.hideOptional&&s("span",{class:"stzh-checkbox__marker"},s("span",{class:"stzh-checkbox__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),s("span",{class:"stzh-checkbox__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText)))),(((i=this._error)===null||i===void 0?void 0:i.length)>0||this.description||this.descriptionLong)&&s(f,{classPrefix:"stzh-checkbox",id:`${this.inputId}-description`,error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongTitle:this.descriptionLongTitle,descriptionLongUsed:n,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel})))}get element(){return r(this)}static get watchers(){return{error:["errorWatcher"]}}};_.style=z;const g=".sc-stzh-header-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-header-h{display:none}.sc-stzh-header-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h *.sc-stzh-header,.sc-stzh-header-h *.sc-stzh-header::before,.sc-stzh-header-h *.sc-stzh-header::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-header-h .has-focus.sc-stzh-header{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header{outline-style:none !important}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header::-moz-focus-inner{border:0 !important}.sc-stzh-header-h{--logo-width:auto;--logo-height:100%;--logobar-background-color:var(--stzh-header-logobar-background-color)}@media print{.sc-stzh-header-h{display:none}}[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:1.9375rem}@media screen and (min-width: 900px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:2.1875rem}}@media screen and (min-width: 1600px){[logo-type=aoz].sc-stzh-header-h,[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h{--logo-height:3.3125rem}}[logo-type=vbz].sc-stzh-header-h{--logo-height:1.8125rem}@media screen and (min-width: 900px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.3125rem}}@media screen and (min-width: 1600px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.75rem}}.sc-stzh-header-h[logo-type=vbz] .sc-stzh-header-s>[slot=logo]{align-self:center}.sc-stzh-header-h .sc-stzh-header-s>[slot=logo]{width:var(--logo-width);height:var(--logo-height)}.stzh-header.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);color:var(--stzh-color-grey90)}.stzh-header__inner.sc-stzh-header,.stzh-header__main.sc-stzh-header{max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-header__inner.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__main.sc-stzh-header{display:flex;flex-direction:column;background-color:var(--stzh-color-white)}@media screen and (max-width: 599px){.stzh-header__main.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__metabar.sc-stzh-header{background-color:var(--stzh-color-coolgrey10)}.stzh-header__metabar-inner.sc-stzh-header{margin-left:1.25rem;margin-right:1.25rem;display:flex;align-items:center;height:4rem}@media screen and (min-width: 600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2rem;margin-right:2rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:2.5rem;margin-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:4rem;margin-right:4rem}}@media screen and (min-width: 1600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;max-width:84.25rem}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{height:4rem}}.stzh-header__burger.sc-stzh-header,.stzh-header__search.sc-stzh-header,.stzh-header__metanav-item.sc-stzh-header{color:var(--stzh-color-grey90);transition:color var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__burger.sc-stzh-header:hover,.stzh-header__search.sc-stzh-header:hover,.stzh-header__metanav-item.sc-stzh-header:hover{color:var(--stzh-color-black)}.stzh-header__burger.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;padding:0;margin-right:var(--stzh-space-medium);gap:var(--stzh-space-medium);color:var(--stzh-color-primary70)}@media screen and (min-width: 600px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__burger-icon.is-open.sc-stzh-header{display:none}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-close.sc-stzh-header{display:none}.stzh-header__metabar-search.sc-stzh-header{overflow:hidden;margin-right:var(--stzh-space-medium);transition-property:width;transition-duration:var(--stzh-base-transition-animation-speed);width:2.5rem;max-width:21.5625rem}.stzh-header__metabar-search.sc-stzh-header:focus-within{width:100%}@media screen and (min-width: 600px){.stzh-header__metabar-search.sc-stzh-header{width:6rem;margin-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-search.sc-stzh-header{width:10rem;margin-left:0;margin-right:var(--stzh-space-xxxxlarge)}}.stzh-header__search.sc-stzh-header{position:relative;display:block;width:100%}.stzh-header__search-input.sc-stzh-header{width:100%;max-width:100%;background-color:transparent;color:transparent;font-family:inherit;font-size:inherit;border:none;padding:var(--stzh-space-xsmall);padding-left:0;padding-right:0;height:var(--stzh-form-input-small-height);transition-property:padding-left, padding-right, background-color, color;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__search-input.sc-stzh-header{color:var(--stzh-color-secondary60);padding-left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}}.stzh-header__search-input.sc-stzh-header:focus{color:var(--stzh-color-secondary60);background-color:var(--stzh-color-white);padding-left:calc(var(--stzh-space-medium) + var(--stzh-icon-size) + var(--stzh-space-medium));padding-right:var(--stzh-space-xlarge)}.stzh-header__search-input.sc-stzh-header:-webkit-autofill{-webkit-background-clip:text;background-clip:text}.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-decoration,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-cancel-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-decoration{-webkit-appearance:none}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(var(--stzh-space-medium), -50%)}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{color:var(--stzh-color-grey70)}.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{position:absolute;top:50%;transform:translate(0, -50%);transition:transform var(--stzh-base-transition-animation-speed)}.stzh-header__search-icon.sc-stzh-header{left:0px}@media screen and (max-width: 599px){.stzh-header__search-icon.sc-stzh-header{transform:translate(0.5rem, -50%)}}.stzh-header__search-text.sc-stzh-header{pointer-events:none;left:calc(var(--stzh-icon-size) + var(--stzh-space-medium))}@media screen and (max-width: 599px){.stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-nav.sc-stzh-header{display:flex;align-items:center;margin-left:auto;gap:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xxlarge)}}.stzh-header__metanav-popover.sc-stzh-header{--width:auto;--min-width:15.875rem}.stzh-header__metanav-popover.is-langnav.sc-stzh-header{--min-width:8.75rem}.stzh-header__metanav-item.sc-stzh-header{display:none;gap:var(--stzh-space-small);align-items:center;justify-content:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;padding:0;border:none;text-decoration:none;font-size:100%;font-family:inherit;white-space:nowrap;min-width:2.5rem}@media screen and (min-width: 900px){.stzh-header__metanav-item.sc-stzh-header{display:flex}}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header{color:var(--stzh-color-primary70)}.stzh-header__metanav-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item.is-stay.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-mobile.sc-stzh-header{display:none}}.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:flex}}.stzh-header__metanav-menu-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item-text.sc-stzh-header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-header__metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}@media screen and (max-width: 899px){.stzh-header__metanav-item-text.has-no-short-label.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}@media screen and (max-width: 899px){.stzh-header__metanav-item-text-label-long.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}@media screen and (min-width: 600px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:flex}}@media screen and (min-width: 900px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}}.stzh-header__metanav-icon-wrapper.sc-stzh-header{position:relative;display:flex;align-items:center;justify-content:center}.stzh-header__metanav-icon-badge.sc-stzh-header{position:absolute;top:-0.25rem;right:-0.25rem}.stzh-header__metanav-icon.is-open.sc-stzh-header{display:none}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-close.sc-stzh-header{display:none}.stzh-header__logobar.sc-stzh-header{display:flex}@media screen and (min-width: 1600px){.stzh-header__logobar.sc-stzh-header{margin-left:auto;margin-right:auto;width:84.25rem}}.stzh-header__logobar-logo.sc-stzh-header{box-sizing:content-box;display:flex;overflow:hidden;flex-shrink:0}.stzh-header__logobar-decoration.sc-stzh-header{background-color:var(--logobar-background-color);flex-grow:1}@media screen and (min-width: 1600px){.stzh-header__logobar-decoration.sc-stzh-header{width:calc((100% - 34.5625rem) + ((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2));margin-right:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / -2)}}.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-medium);padding-right:var(--stzh-space-medium);padding-top:0.875rem;padding-bottom:0.6875rem;padding-left:1.25rem;display:inline-flex;width:18rem;height:4.125rem;transition:opacity var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{width:18.75rem;padding-left:2rem}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{width:24.9375rem;height:5.5rem;padding-top:1.125rem;padding-bottom:1.125rem;padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{width:38.5625rem;height:8.4375rem;padding-top:1.75rem;padding-bottom:1.5rem;padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__logo-link.sc-stzh-header{width:34.5625rem;padding-left:0}}.stzh-header__flyout.sc-stzh-header,.stzh-header__flyout-search.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);z-index:calc(var(--stzh-z-index-header) - 1);position:fixed;visibility:hidden;top:0;left:0;right:0;bottom:0;width:100dvw;height:100dvh;overflow:auto;transition:visibility var(--stzh-base-transition-animation-speed)}@media (min-height: 580px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}@media screen and (min-width: 900px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}.stzh-header__flyout-backdrop.sc-stzh-header{position:absolute;width:100%;height:100%;background-color:var(--stzh-color-black40op);opacity:0;transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-header__menu.sc-stzh-header{position:absolute;width:100%;height:auto;background-color:var(--stzh-color-secondary30);display:grid;grid-template-rows:auto auto;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateX(-100%);opacity:0}@media (min-height: 580px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{width:20.9375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:23.375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:27.4375rem}}@media screen and (min-width: 1600px){.stzh-header__menu.sc-stzh-header{width:calc((27.4375rem - 4rem) + ((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2))}}.stzh-header__menu-nav.sc-stzh-header{position:relative;overflow-x:hidden;overflow-y:hidden}@media (min-height: 580px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto}}@media screen and (min-width: 900px){.stzh-header__menu-nav.sc-stzh-header{overflow-y:auto;position:static}}.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-xlarge);background-color:var(--stzh-color-secondary20)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-small)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-medium)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{display:none}}.stzh-header__menu-metanav-nav.sc-stzh-header{max-width:23.4375rem}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.sc-stzh-header{display:block;list-style:none;padding:0;margin:0}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-xxxlarge));padding-bottom:var(--stzh-space-xxxlarge)}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-huge))}}.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{overflow:auto;background-color:var(--stzh-color-secondary20);visibility:hidden;opacity:0;transform:translateX(100%);position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;transition-property:opacity, visibility, transform;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{z-index:initial;width:19.6875rem;transform:none;left:100%;transition-property:opacity, visibility}}@media screen and (min-width: 1260px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:20.875rem}}@media screen and (min-width: 1600px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:21.5625rem}}.stzh-header__menu-list.is-level-2.sc-stzh-header{height:-webkit-max-content;height:-moz-max-content;height:max-content}@media (min-height: 580px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary30);transform:none;transition-property:opacity, visibility}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header>.stzh-header__menu-list-item.sc-stzh-header>.stzh-header__menu-list).sc-stzh-header{transition-delay:var(--stzh-base-transition-animation-speed)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list.sc-stzh-header{z-index:200;transition-delay:0ms;visibility:visible;opacity:1}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header{background-color:var(--stzh-color-secondary40)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary10)}}@media screen and (max-width: 899px){.stzh-header__menu-nav.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open) .stzh-header__menu-nav.sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu-metanav-list.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open){transition-property:visibility;transition-duration:0ms;transition-delay:var(--stzh-base-transition-animation-speed);visibility:hidden}}@media screen and (max-width: 899px){.stzh-header__menu-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-list),.stzh-header__menu-metanav-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-metanav-list){transform:translateX(0);opacity:1;visibility:visible}}.stzh-header__menu-list-item.sc-stzh-header,.stzh-header__menu-metanav-list-item.sc-stzh-header{display:grid}.stzh-header__menu-list-item.is-backlink.sc-stzh-header{display:block}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;display:flex;align-items:center;gap:var(--stzh-space-xsmall);-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;text-decoration:none;background-color:transparent;color:var(--stzh-color-primary70);padding-left:var(--stzh-space-xxxlarge);padding-top:var(--stzh-space-small);padding-bottom:var(--stzh-space-small);padding-right:var(--stzh-space-large);transition-property:color, background-color;transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-size:var(--stzh-font-deci-font-size);line-height:var(--stzh-font-deci-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3.5rem}@media screen and (min-width: 900px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:2.5rem}}@media screen and (min-width: 1260px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:4rem}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-1.sc-stzh-header{padding-left:calc(((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2))}}@media screen and (min-width: 900px){.stzh-header__menu-item.has-items.sc-stzh-header{cursor:default}}.stzh-header__menu-item.is-level-2.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3rem}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xlarge)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xxlarge)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-bottom:var(--stzh-space-medium);padding-top:var(--stzh-space-medium);padding-bottom:var(--stzh-space-small);min-height:none;padding-left:1.25rem;padding-right:1.25rem;gap:var(--stzh-space-xxsmall)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{display:none}}.stzh-header__menu-item.is-level-2.is-main.sc-stzh-header{font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);margin-bottom:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header{min-height:2.75rem;padding-top:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item.is-level-2.sc-stzh-header{min-height:3.5rem;gap:var(--stzh-space-medium);padding-right:var(--stzh-space-xxlarge)}.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);justify-content:space-between;padding-top:0;padding-bottom:0;padding-right:var(--stzh-space-medium);margin-bottom:var(--stzh-space-xlarge);cursor:default}.stzh-header__menu-metanav-item.is-language.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);justify-content:space-between}.stzh-header__menu-metanav-item.is-action.sc-stzh-header{display:grid;padding-right:var(--stzh-space-xxxlarge);margin-top:var(--stzh-space-xlarge)}.stzh-header__menu-metanav-item.is-hidden.sc-stzh-header{display:none}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header .stzh-header__menu-metanav-item-icon.sc-stzh-header{--size:var(--stzh-icon-size-small)}.stzh-header__menu-metanav-item-text.sc-stzh-header{display:flex;gap:var(--stzh-space-xsmall)}.stzh-header__menu-metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__menu-metanav-item-counter.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-header__app-nav.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__app-nav.sc-stzh-header{display:block}}.stzh-header__app-nav-bottom.sc-stzh-header{position:fixed;bottom:0;left:0;width:calc(100vw - var(--stzh-scrollbar-width));z-index:calc(var(--stzh-z-index-header) - 1)}@media screen and (min-width: 900px){.stzh-header__app-nav-bottom.sc-stzh-header{display:none}}.stzh-header--is-search-filled.sc-stzh-header .stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header--hide-logo.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:0}@media screen and (min-width: 600px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) / -1)}}@media screen and (min-width: 600px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}@media screen and (max-width: 599px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__logobar.sc-stzh-header{transition-property:opacity, visibility;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform, margin-top;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(0)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(0)}}@media screen and (min-width: 600px) and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__metabar.sc-stzh-header{visibility:hidden}}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__inner.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__main.sc-stzh-header{margin-top:calc((var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height)) / -1)}}.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__metabar.sc-stzh-header{visibility:hidden}.stzh-header--is-sticky.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:hidden;opacity:0}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__main.sc-stzh-header{margin-top:0px}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header__flyout-search-main.sc-stzh-header{position:absolute;width:100%;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateY(-6.25rem);opacity:0;margin-top:var(--stzh-header-main-height);overflow:auto}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:none;z-index:999;position:absolute;top:0;right:0;bottom:0;width:var(--stzh-scrollbar-width);background-color:var(--stzh-color-grey10);border-left:calc(0.5px * var(--stzh-scrollbar-active)) solid var(--stzh-color-grey30)}@media (min-height: 580px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}@media screen and (min-width: 900px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__menu.sc-stzh-header{opacity:1;transform:translateX(0)}.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search-main.sc-stzh-header{opacity:1;transform:translateX(0)}@media screen and (min-width: 600px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__inner.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}@media screen and (max-width: 599px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__main.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__main.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:1;transition:none}.stzh-header__search-button--is-hidden.sc-stzh-header{display:none}";const b="stzh-header-open";const x=class{constructor(s){t(this,s);this.stzhMetanavItemClick=i(this,"stzhMetanavItemClick",7);this.stzhMetanavItemChildClick=i(this,"stzhMetanavItemChildClick",7);this.stzhMetanavItemButtonClick=i(this,"stzhMetanavItemButtonClick",7);this.stzhMenuItemClick=i(this,"stzhMenuItemClick",7);this.stzhLanguageChange=i(this,"stzhLanguageChange",7);this.stzhSearchChange=i(this,"stzhSearchChange",7);this.stzhSearchChanged=i(this,"stzhSearchChanged",7);this.lastOpener=null;this.flyoutOpenedByMetanavItem=null;this.handleMenuListFocusout=t=>{const i=!t.currentTarget.contains(t.relatedTarget);if(this.isMedium&&i){this.closeMenuItem(false)}};this.handleBurgerClick=async()=>{if(this.flyoutOpenedByMetanavItem){this.flyoutOpenedByMetanavItem=false;this.closeMetanavItem()}else{this.flyoutSearchOpen=false;this.flyoutOpen=!this.flyoutOpen}const t=this.element.querySelector(".stzh-header__menu-item");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleSearchButtonClick=async()=>{this.flyoutOpen=false;this.flyoutSearchOpen=!this.flyoutSearchOpen;const t=this.element.querySelector(".stzh-search input[type='search']");if(t){window.setTimeout((()=>{t.focus()}),100)}this.updatePosition()};this.handleBackdropClick=async()=>{this.flyoutOpen=false;this.updatePosition()};this.handleBackdropSearchClick=async()=>{this.flyoutSearchOpen=false;this.updatePosition()};this.handleMetanavItemClick=(t,i)=>{this.stzhMetanavItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleMetanavItemChildClick=(t,i)=>{this.stzhMetanavItemChildClick.emit({component:"stzh-header",itemChild:i,originalEvent:t})};this.handleMetanavItemButtonClick=(t,i)=>{this.stzhMetanavItemButtonClick.emit({component:"stzh-header",itemButton:i,originalEvent:t})};this.handleMenuItemClick=(t,i)=>{this.flyoutOpen=false;this.stzhMenuItemClick.emit({component:"stzh-header",item:i,originalEvent:t})};this.handleSearchInput=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChange.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleSearchChange=t=>{this.searchValue=this.searchInput.value;this.stzhSearchChanged.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})};this.handleLanguageClick=(t,i)=>{if(this.languagePreventUrlchange){t.preventDefault()}this.languageActive=i.value;this.stzhLanguageChange.emit({component:"stzh-header",value:this.languageActive})};this.handleFlyoutResize=()=>{this.resizeMenunavElement()};this.handleResize=()=>{if(this.sticky==="disabled"){return}if(this.debounceResize){window.cancelAnimationFrame(this.debounceResize)}this.debounceResize=requestAnimationFrame((()=>{n((()=>{var t,i,s;this.isMedium=u("medium").matches;this.mainHeight=((t=this.mainElement)===null||t===void 0?void 0:t.offsetHeight)||0;this.metabarHeight=((i=this.metabarElement)===null||i===void 0?void 0:i.offsetHeight)||0;this.logobarHeight=((s=this.logobarElement)===null||s===void 0?void 0:s.offsetHeight)||0;this.headerTop=this.element.offsetTop;this.headerHeight=this.metabarHeight+this.logobarHeight}));h((()=>{document.documentElement.style.setProperty("--stzh-header-height",`${this.headerHeight}px`);document.documentElement.style.setProperty("--stzh-header-main-height",`${this.mainHeight}px`);document.documentElement.style.setProperty("--stzh-header-metabar-height",`${this.metabarHeight}px`);document.documentElement.style.setProperty("--stzh-header-logobar-height",`${this.logobarHeight}px`)}));this.scrollListener()}))};this.localization=undefined;this.href="https://www.stadt-zuerich.ch";this.menuId="anchorNavMain";this.searchId="anchorSearch";this.metanavId="anchorNavMeta";this.languageId="anchorNavLang";this.logoType="default";this.menuItems=[];this._menuItems=undefined;this.menuBackLabel=undefined;this.metanavItems=[];this._metanavItems=undefined;this.userSpecificMetanavItemsNotLoggedIn=[];this._userSpecificMetanavItemsNotLoggedIn=undefined;this.appNavItems=[];this._appNavItems=undefined;this.userSpecificMetanavItemsEndpoint=undefined;this.languageActive=undefined;this.languages=[];this._languages=undefined;this.languagePreventUrlchange=false;this.languageStay=false;this.hideMetabar=false;this.searchAction=undefined;this.searchFieldName="q";this.searchValue="";this.sticky="default";this.loginErrorMessage="";this.logoAnalyticsId=undefined;this.hideLogo=false;this.headerHeight=undefined;this.paddingTop=undefined;this.stickyActive=false;this.flyoutOpen=false;this.flyoutSearchOpen=false;this.searchFilled=undefined;this.fixed=false;this.fixedTransition=false;this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=false;this.userSpecificMetanavItemsLoggedIn=[];this.combinedMetanavItems=[]}handleKeydown(t){if(t.key==="Escape"){this.flyoutOpen=false;this.flyoutSearchOpen=false}}flyoutCloseClicked(){this.flyoutSearchOpen=false;this.updatePosition()}async flyoutOpenWatcher(t){if(!t){this.currentOpenMenuItem=null;this.currentOpenMetanavItem=null;this.currentOpenLanguage=null;this.flyoutOpenedByMetanavItem=false;document.body.classList.remove(b);this.enableSiblings();if(this.trap){this.trap.deactivate()}}else{document.body.classList.add(b);this.disableSiblings();if(this.trap){this.trap.activate()}}}async fixedWatcher(){this.paddingTop=this.fixed||this.flyoutOpen||this.flyoutSearchOpen?this.headerHeight:0;await this.waitForNextRender();this.fixedTransition=this.fixed||this.flyoutOpen||this.flyoutSearchOpen}stickyWatcher(){this.updatePosition()}async updatePosition(){if(this.flyoutOpen||this.flyoutSearchOpen){return}const t=()=>{this.stickyActive=true;document.documentElement.style.setProperty("--stzh-header-is-stuck","1");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","0")};const i=()=>{document.documentElement.style.setProperty("--stzh-header-is-stuck","0");document.documentElement.style.setProperty("--stzh-header-is-not-stuck","1");this.stickyActive=false};if(this.sticky==="disabled"){i()}else if(this.sticky==="always-full"){t()}else if(this.sticky==="always"){if(this.belowStayStickyPoint){t()}else{i()}}else{if(this.scrollingUp&&this.belowStayStickyPoint){if(!this.stickyActive&&this.belowStartStickyPoint){t()}}else{if(this.stickyActive&&this.belowStayStickyPoint){i()}else{i()}}}}scrollListener(){if(this.sticky==="disabled"){return}n((()=>{this.currentScrollY=window.scrollY;this.scrollingUp=this.lastScrollY&&this.lastScrollY>this.currentScrollY;this.lastScrollY=this.currentScrollY;this.belowStayStickyPoint=this.currentScrollY>this.logobarHeight;this.belowStartStickyPoint=this.currentScrollY>this.headerHeight;this.fixed=this.belowStartStickyPoint||this.scrollingUp&&this.belowStayStickyPoint&&this.stickyActive||this.sticky==="always"&&this.belowStayStickyPoint||this.sticky==="always-full";this.headerOverlap=(this.headerTop-this.currentScrollY)/-1;this.hideLogo=this.sticky!=="always-full"&&this.isMedium&&this.headerOverlap>1}));h((()=>{this.updatePosition()}))}searchValueWatcher(t){this.searchFilled=t!==""}menuItemsWatcher(t){if(typeof t==="string"){this._menuItems=JSON.parse(t)}else{this._menuItems=t}this._menuItems=this._menuItems.map(((t,i)=>Object.assign({id:`submenu-${i}`},t)))}metanavItemsWatcher(t){if(typeof t==="string"){this._metanavItems=JSON.parse(t)}else{this._metanavItems=t}this._metanavItems=this._metanavItems.map(((t,i)=>Object.assign({id:`metanav-submenu-${i}`},t)))}appNavItemsWatcher(t){if(typeof t==="string"){this._appNavItems=JSON.parse(t)}else{this._appNavItems=t}}userSpecificMetanavItemsNotLoggedInWatcher(t){this._userSpecificMetanavItemsNotLoggedIn=t}languagesWatcher(t){if(typeof t==="string"){this._languages=JSON.parse(t)}else{this._languages=t}}getSiblings(){if(!this._parentElement){return[]}return Array.from(this._parentElement.children).filter((t=>t!==this.element))}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}waitForNextRender(){return new Promise((t=>this.renderPromiseResolve=t))}resizeMenunavElement(){if(u("headerMetanavSticky").matches||u("medium").matches||!this.openSubmenuElement){Object.assign(this.menunavElement.style,{height:null})}else{const{height:t}=this.openSubmenuElement.getBoundingClientRect();Object.assign(this.menunavElement.style,{height:`${t}px`})}}async openMenuItem(t,i){this.flyoutOpen=true;this.lastOpener=t.currentTarget;this.openSubmenuElement=this.element.querySelector(`#${i.id}`);this.currentOpenMenuItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{this.menunavElement.scrollTop=0;const t=this.openSubmenuElement&&l(this.openSubmenuElement)[0];t===null||t===void 0?void 0:t.focus();this.resizeMenunavElement()}))}async closeMenuItem(t=true){this.openSubmenuElement=null;this.currentOpenMenuItem=null;await this.waitForNextRender();if(t){requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null;this.resizeMenunavElement()}))}}async openMetanavItem(t,i){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenMetanavItem=i;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector(`#${i.id}`);const s=t&&l(t)[0];s===null||s===void 0?void 0:s.focus()}))}async closeMetanavItem(){this.currentOpenMetanavItem=null;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async openLanguage(t){if(!this.flyoutOpen){this.flyoutOpenedByMetanavItem=true;this.flyoutOpen=true}this.lastOpener=t.currentTarget;this.currentOpenLanguage=true;await this.waitForNextRender();requestAnimationFrame((()=>{const t=this.element.querySelector("#submenu-languages");const i=t&&l(t)[0];i===null||i===void 0?void 0:i.focus()}))}async closeLanguage(){this.currentOpenLanguage=false;if(this.flyoutOpenedByMetanavItem){this.flyoutOpen=false}await this.waitForNextRender();requestAnimationFrame((()=>{this.lastOpener.focus();this.lastOpener=null}))}async requestUserSpecificMetanavItems(){if(!this.userSpecificMetanavItemsEndpoint){this.combinedMetanavItems=[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn];return}try{const t=await fetch(this.userSpecificMetanavItemsEndpoint);this.userSpecificMetanavItemsLoggedIn=await t.json();this.combinedMetanavItems=[...this._metanavItems,...this.userSpecificMetanavItemsLoggedIn]}catch(t){this.combinedMetanavItems=[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn];console.error("Error fetching data:",t);if(this.loginErrorMessage){document.querySelector("stzh-toastbar").toast(this.loginErrorMessage,{type:"error"})}}}async componentWillLoad(){this.menuItemsWatcher(this.menuItems);this.metanavItemsWatcher(this.metanavItems);this.appNavItemsWatcher(this.appNavItems);this.languagesWatcher(this.languages);this.searchValueWatcher(this.searchValue);this.userSpecificMetanavItemsNotLoggedInWatcher(this.userSpecificMetanavItemsNotLoggedIn);this.requestUserSpecificMetanavItems();if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"header")}}componentDidRender(){if(this.renderPromiseResolve){this.renderPromiseResolve()}if(this.flyoutElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutElement)}if(this.flyoutSearchElement&&this.flyoutResizeObserver){this.flyoutResizeObserver.observe(this.flyoutSearchElement)}}componentDidLoad(){this.trap=v(this.element,Object.assign(Object.assign({},c()),{initialFocus:false}));this.flyoutResizeObserver=new ResizeObserver(this.handleFlyoutResize);if(this.flyoutElement){this.flyoutResizeObserver.observe(this.flyoutElement)}}connectedCallback(){this._parentElement=this.element.parentElement;this.resizeObserver=new ResizeObserver(this.handleResize);this.resizeObserver.observe(this.element)}disconnectedCallback(){var t,i;this.flyoutOpenWatcher(false);(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.flyoutResizeObserver)===null||i===void 0?void 0:i.disconnect()}render(){var t,i,r,n,h,f,u;const l=o(this.element,"metanav-before");const v=o(this.element,"metanav-after");const c={"stzh-header":true,"stzh-header--is-flyout-open":this.flyoutOpen,"stzh-header--is-flyout-search-open":this.flyoutSearchOpen,"stzh-header--is-search-filled":this.searchFilled,"stzh-header--is-fixed":this.fixed,"stzh-header--is-fixed-transition":this.fixedTransition,"stzh-header--is-sticky":this.stickyActive,"stzh-header--is-sticky-transition":this.stickyActive&&this.fixedTransition,"stzh-header--hide-logo":this.hideLogo,"stzh-header--has-empty-metabar-mobile":!l&&!v&&this._metanavItems.filter((t=>t.stay||t.stayAndShowInMobileMenu)).length===0&&this._menuItems.length===0&&(this._languages.length===0||this._languages.length>0&&!this.languageStay)&&!this.searchAction,"stzh-header--has-empty-metabar":!l&&!v&&this._metanavItems.length===0&&this._menuItems.length===0&&this._languages.length===0&&!this.searchAction,[`stzh-header--sticky-${this.sticky}`]:!!this.sticky};const d=this.languageActive||window.stzhComponents.utils.getLocale(this.element);const m=((t=this._languages)===null||t===void 0?void 0:t.find((({value:t})=>t===d)))||((i=this._languages)===null||i===void 0?void 0:i[0])||null;const p=(t,i,e)=>{var r;const n=((r=t.items)===null||r===void 0?void 0:r.length)>0||t.itemButton||!t.href?"button":"a";return s(n,Object.assign({},e,{href:n==="a"&&t.href,target:n==="a"&&t.target,style:{order:t.cssOrder},class:Object.assign({"stzh-header__metanav-item":true,"is-heavy":t.important,"is-stay":t.stay||t.stayAndShowInMobileMenu},i||{})}),s("span",{class:{"stzh-header__metanav-item-text":true,"is-vhidden":t.labelHidden,"has-no-short-label":!t.labelShort}},s("span",{class:"stzh-header__metanav-item-text-label-long"},t.label),s("span",{class:"stzh-header__metanav-item-text-label-short","aria-hidden":"true"},t.labelShort)),t.icon&&s("span",{class:"stzh-header__metanav-icon-wrapper"},t.icon&&s("stzh-icon",{class:`stzh-header__metanav-icon ${t.iconOpen?"is-close":""}`,name:t.icon}),t.iconOpen&&s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:t.iconOpen}),(t.badge||t.badgeEmpty)&&s("stzh-badge",{class:"stzh-header__metanav-icon-badge",label:t.badge,type:typeof t.badgeType==="undefined"?"error":t.badgeType})))};return s(e,null,s("header",{class:c},s("div",{class:"stzh-header__header",style:{paddingTop:`${this.paddingTop}px`}},this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav-bottom"},s("stzh-app-nav",{items:this._appNavItems})),s("div",{class:"stzh-header__inner"},s("div",{class:"stzh-header__main",ref:t=>this.mainElement=t},s("div",{class:"stzh-header__logobar",ref:t=>this.logobarElement=t},s("div",{class:"stzh-header__logobar-logo"},s("a",{href:this.href,class:"stzh-header__logo-link","s-object-id":this.logoAnalyticsId||"Header Logo"},s("slot",{name:"logo"}))),s("div",{class:"stzh-header__logobar-decoration"})),!this.hideMetabar&&s("div",{class:"stzh-header__metabar",ref:t=>this.metabarElement=t},s("div",{class:"stzh-header__metabar-inner"},s("slot",{name:"menu-before"}),this._menuItems.length>0&&s("button",{id:this.menuId,class:`stzh-header__burger ${this.flyoutOpen&&!this.flyoutOpenedByMetanavItem&&"is-open"}`,onClick:this.handleBurgerClick},s("stzh-icon",{class:"stzh-header__burger-icon is-close",name:"menu"}),s("stzh-icon",{class:"stzh-header__burger-icon is-open",name:"close"}),s("div",{class:"stzh-header__burger-text"},this.localization.menuLabel)),this.searchAction&&!o(this.element,"search")&&s("form",{class:"stzh-header__metabar-search",action:this.searchAction,role:"search"},s("label",{class:"stzh-header__search"},s("input",{id:this.searchId,ref:t=>this.searchInput=t,class:"stzh-header__search-input",type:"search",name:this.searchFieldName,onChange:this.handleSearchChange,onInput:this.handleSearchInput}),s("stzh-icon",{class:"stzh-header__search-icon",name:"search"}),s("div",{class:"stzh-header__search-text"},this.localization.searchLabel))),o(this.element,"search")&&s("stzh-button",{iconPosition:"left",onClick:this.handleSearchButtonClick,variant:"tertiary-plain",size:"small"},s("stzh-icon",{slot:"icon",name:"search",class:this.flyoutSearchOpen?"stzh-header__search-button--is-hidden":""}),s("stzh-icon",{slot:"icon",name:"close",class:this.flyoutSearchOpen?"":"stzh-header__search-button--is-hidden"}),this.localization.searchLabel),s("slot",{name:"menu-after"}),this._appNavItems.length>0&&s("div",{class:"stzh-header__app-nav"},s("stzh-app-nav",{items:this._appNavItems})),s("div",{class:"stzh-header__metabar-nav",id:this.metanavId},s("slot",{name:"metanav-before"}),this.combinedMetanavItems.map((t=>{var i,e;return((i=t.items)===null||i===void 0?void 0:i.length)>0||t.itemButton?s(a,null,p(t,{"is-popover-mobile":true},{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}}),s("stzh-popover",{class:{"stzh-header__metanav-popover":true},placement:"bottom-end",distance:20,variant:t.variant,size:typeof t.size==="undefined"?"large":t.size},p(t,{"is-popover-desktop":true},{onClick:i=>{this.handleMetanavItemClick(i,t)}}),s("div",{slot:"content"},((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("stzh-menu",null,t.items.map((i=>s("stzh-menu-item",{class:{"stzh-header__metanav-menu-item":true,"is-heavy":typeof t.importantSubmenu==="undefined"||t.importantSubmenu},size:typeof t.size==="undefined"?"large":t.size,variant:t.variant,href:i.href,target:i.target,icon:i.icon,counter:i.counter,badge:i.badge,badgeType:i.badgeType,onClick:t=>{this.handleMetanavItemChildClick(t,i)}},i.label))))),t.itemButton&&s("stzh-button",{slot:"action",size:t.itemButton.size,href:t.itemButton.href,target:t.itemButton.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButton)}},t.itemButton.label))):p(t,{},{onClick:i=>{this.handleMetanavItemClick(i,t)}})})),((r=this._languages)===null||r===void 0?void 0:r.length)>0&&s(a,null,s("h2",{id:this.languageId,class:"stzh-header__vhidden"},this.localization.languageLabel),this._menuItems.length>0&&this.languageStay&&s("button",{class:{"stzh-header__metanav-item":true,"is-popover-mobile":true,"is-stay":this.languageStay},"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",onClick:t=>{if(this.currentOpenLanguage){this.closeLanguage()}else{this.openLanguage(t)}}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("stzh-popover",{class:"stzh-header__metanav-popover is-langnav",placement:"bottom-end",distance:20},s("button",{class:{"stzh-header__metanav-item":true,"is-popover-desktop":this._menuItems.length>0,"is-stay":this.languageStay}},s("span",{class:"stzh-header__metanav-item-text"},m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),s("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),s("div",{slot:"content"},s("stzh-menu",null,this._languages.map((t=>s("stzh-menu-item",{class:"stzh-header__metanav-menu-item",active:(m===null||m===void 0?void 0:m.value)===t.value,href:t.value,onClick:i=>this.handleLanguageClick(i,t)},t.text))))))),s("slot",{name:"metanav-after"}))))))),(this._menuItems.length>0||((n=this.combinedMetanavItems)===null||n===void 0?void 0:n.length)>0)&&s("div",{ref:t=>this.flyoutElement=t,class:"stzh-header__flyout"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__menu"},s("nav",{class:"stzh-header__menu-nav",ref:t=>this.menunavElement=t,"aria-label":this.localization.navigationLabel},s("ul",{class:"stzh-header__menu-list is-level-1"},this._menuItems.map((t=>{var i,e;return s("li",{class:{"stzh-header__menu-list-item":true,"is-open":t===this.currentOpenMenuItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMenuItem?"true":"false","aria-controls":t.id,class:"stzh-header__menu-item is-level-1 has-items",onClick:t===this.currentOpenMenuItem?()=>this.closeMenuItem():i=>this.openMenuItem(i,t)},t.label):s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-1"},t.label),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-list is-level-2",onFocusout:this.handleMenuListFocusout},s("li",{class:"stzh-header__menu-list-item is-backlink"},s("button",{class:"stzh-header__menu-item is-level-2 is-backlink",onClick:()=>this.closeMenuItem()},s("stzh-icon",{name:"angle-left"}),s("span",null,this.menuBackLabel?this.menuBackLabel:this.localization.menuBackLabel))),s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2 is-main"},t.label)),t.items.map((t=>s("li",{class:"stzh-header__menu-list-item"},s("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2"},t.label))))))})))),(((h=this.combinedMetanavItems)===null||h===void 0?void 0:h.length)>0||((f=this._languages)===null||f===void 0?void 0:f.length)>0)&&s("div",{class:"stzh-header__menu-metanav"},s("nav",{class:"stzh-header__menu-metanav-nav"},s("ul",{class:"stzh-header__menu-metanav-list is-level-1"},this.combinedMetanavItems.map((t=>{var i,e,r;return s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":t===this.currentOpenMetanavItem}},((i=t.items)===null||i===void 0?void 0:i.length)>0?s("button",{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{if(t===this.currentOpenMetanavItem){this.closeMetanavItem()}else{this.openMetanavItem(i,t)}this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})):s("a",{href:t.href,class:{"stzh-header__menu-metanav-item is-level-1":true,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{this.handleMetanavItemClick(i,t)}},s("span",{class:{"stzh-header__menu-metanav-item-text":true,"is-vhidden":t.labelHidden}},t.label),t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})),((e=t.items)===null||e===void 0?void 0:e.length)>0&&s("ul",{id:t.id,class:"stzh-header__menu-metanav-list is-level-2"},s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,t.label),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:(r=this.localization.closeMetanavMenuLabel)===null||r===void 0?void 0:r.replace(/\{itemLabel\}/gi,t.label),onClick:()=>this.closeMetanavItem()}))),t.items.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{href:t.href,class:"stzh-header__menu-metanav-item is-level-2"},t.icon&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon}),s("span",{class:"stzh-header__menu-metanav-item-text"},s("span",null,t.label),t.counter&&s("span",{class:"stzh-header__menu-metanav-item-counter"},"(",t.counter,")")))))),t.itemButton&&s("li",{class:"stzh-header__menu-metanav-list-item"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action"},s("stzh-button",{href:t.itemButton.href,target:t.itemButton.target},t.itemButton.label)))))})),((u=this._languages)===null||u===void 0?void 0:u.length)>0&&s("li",{class:{"stzh-header__menu-metanav-list-item":true,"is-open":this.currentOpenLanguage}},s("button",{"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",class:"stzh-header__menu-metanav-item is-level-1",onClick:t=>this.openLanguage(t)},s("span",null,m===null||m===void 0?void 0:m.text),s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"angle-down"})),s("ul",{id:"submenu-languages",class:"stzh-header__menu-metanav-list is-level-2"},s("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},s("span",null,this.localization.dialogLanguageTitle),s("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:true,label:"Sprach-Dialog schliessen",onClick:()=>this.closeLanguage()})),this._languages.map((t=>s("li",{class:"stzh-header__menu-metanav-list-item"},s("a",{class:"stzh-header__menu-metanav-item is-level-2 is-language",href:t.value,onClick:i=>this.handleLanguageClick(i,t)},s("span",null,t.text),(m===null||m===void 0?void 0:m.value)===t.value&&s("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"checkmark"})))))))))))),o(this.element,"search")&&s("div",{ref:t=>this.flyoutSearchElement=t,class:"stzh-header__flyout-search"},s("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropSearchClick}),s("div",{class:"stzh-header__flyout-scrollbar"}),s("div",{class:"stzh-header__flyout-search-main"},s("slot",{name:"search"})))))}get element(){return r(this)}static get watchers(){return{flyoutOpen:["flyoutOpenWatcher","fixedWatcher"],flyoutSearchOpen:["flyoutOpenWatcher","fixedWatcher"],fixed:["fixedWatcher"],headerHeight:["fixedWatcher"],sticky:["stickyWatcher"],searchValue:["searchValueWatcher"],menuItems:["menuItemsWatcher"],metanavItems:["metanavItemsWatcher"],appNavItems:["appNavItemsWatcher"],userSpecificMetanavItemsNotLoggedIn:["userSpecificMetanavItemsNotLoggedInWatcher"],languages:["languagesWatcher"]}}};x.style=g;function w(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");t.WGS84=t["EPSG:4326"];t["EPSG:3785"]=t["EPSG:3857"];t.GOOGLE=t["EPSG:3857"];t["EPSG:900913"]=t["EPSG:3857"];t["EPSG:102113"]=t["EPSG:3857"]}var y=1;var k=2;var E=4;var C=5;var N=484813681109536e-20;var I=Math.PI/2;var S=.16666666666666666;var O=.04722222222222222;var T=.022156084656084655;var A=1e-10;var R=.017453292519943295;var P=57.29577951308232;var L=Math.PI/4;var D=Math.PI*2;var F=3.14159265359;var W={};W.greenwich=0;W.lisbon=-9.131906111111;W.paris=2.337229166667;W.bogota=-74.080916666667;W.madrid=-3.687938888889;W.rome=12.452333333333;W.bern=7.439583333333;W.jakarta=106.807719444444;W.ferro=-17.666666666667;W.brussels=4.367975;W.stockholm=18.058277777778;W.athens=23.7163375;W.oslo=10.722916666667;const G={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var V=/[\s_\-\/\(\)]/g;function j(t,i){if(t[i]){return t[i]}var s=Object.keys(t);var e=i.toLowerCase().replace(V,"");var r=-1;var n,h;while(++r<s.length){n=s[r];h=n.toLowerCase().replace(V,"");if(h===e){return t[n]}}}function U(t){var i={};var s=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");s.push(true);t[s[0].toLowerCase()]=s[1];return t}),{});var e,r,n;var h={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*R},lat_1:function(t){i.lat1=t*R},lat_2:function(t){i.lat2=t*R},lat_ts:function(t){i.lat_ts=t*R},lon_0:function(t){i.long0=t*R},lon_1:function(t){i.long1=t*R},lon_2:function(t){i.long2=t*R},alpha:function(t){i.alpha=parseFloat(t)*R},lonc:function(t){i.longc=t*R},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r_a:function(){i.R_A=true},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=true},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var s=j(G,t);if(s){i.to_meter=s.to_meter}},from_greenwich:function(t){i.from_greenwich=t*R},pm:function(t){var s=j(W,t);i.from_greenwich=(s?s:parseFloat(t))*R},nadgrids:function(t){if(t==="@null"){i.datumCode="none"}else{i.nadgrids=t}},axis:function(t){var s="ewnsud";if(t.length===3&&s.indexOf(t.substr(0,1))!==-1&&s.indexOf(t.substr(1,1))!==-1&&s.indexOf(t.substr(2,1))!==-1){i.axis=t}}};for(e in s){r=s[e];if(e in h){n=h[e];if(typeof n==="function"){n(r)}else{i[n]=r}}else{i[e]=r}}if(typeof i.datumCode==="string"&&i.datumCode!=="WGS84"){i.datumCode=i.datumCode.toLowerCase()}return i}var X=1;var q=2;var Y=3;var B=4;var H=5;var J=-1;var Z=/\s/;var $=/[A-Za-z]/;var K=/[A-Za-z84_]/;var Q=/[,\]]/;var tt=/[\d\.E\-\+]/;function it(t){if(typeof t!=="string"){throw new Error("not a string")}this.text=t.trim();this.level=0;this.place=0;this.root=null;this.stack=[];this.currentObject=null;this.state=X}it.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==B){while(Z.test(t)){if(this.place>=this.text.length){return}t=this.text[this.place++]}}switch(this.state){case X:return this.neutral(t);case q:return this.keyword(t);case B:return this.quoted(t);case H:return this.afterquote(t);case Y:return this.number(t);case J:return}};it.prototype.afterquote=function(t){if(t==='"'){this.word+='"';this.state=B;return}if(Q.test(t)){this.word=this.word.trim();this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)};it.prototype.afterItem=function(t){if(t===","){if(this.word!==null){this.currentObject.push(this.word)}this.word=null;this.state=X;return}if(t==="]"){this.level--;if(this.word!==null){this.currentObject.push(this.word);this.word=null}this.state=X;this.currentObject=this.stack.pop();if(!this.currentObject){this.state=J}return}};it.prototype.number=function(t){if(tt.test(t)){this.word+=t;return}if(Q.test(t)){this.word=parseFloat(this.word);this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)};it.prototype.quoted=function(t){if(t==='"'){this.state=H;return}this.word+=t;return};it.prototype.keyword=function(t){if(K.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word);this.level++;if(this.root===null){this.root=i}else{this.currentObject.push(i)}this.stack.push(this.currentObject);this.currentObject=i;this.state=X;return}if(Q.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)};it.prototype.neutral=function(t){if($.test(t)){this.word=t;this.state=q;return}if(t==='"'){this.word="";this.state=B;return}if(tt.test(t)){this.word=t;this.state=Y;return}if(Q.test(t)){this.afterItem(t);return}throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)};it.prototype.output=function(){while(this.place<this.text.length){this.readCharicter()}if(this.state===J){return this.root}throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function st(t){var i=new it(t);return i.output()}function et(t,i,s){if(Array.isArray(i)){s.unshift(i);i=null}var e=i?{}:t;var r=s.reduce((function(t,i){rt(i,t);return t}),e);if(i){t[i]=r}}function rt(t,i){if(!Array.isArray(t)){i[t]=true;return}var s=t.shift();if(s==="PARAMETER"){s=t.shift()}if(t.length===1){if(Array.isArray(t[0])){i[s]={};rt(t[0],i[s]);return}i[s]=t[0];return}if(!t.length){i[s]=true;return}if(s==="TOWGS84"){i[s]=t;return}if(s==="AXIS"){if(!(s in i)){i[s]=[]}i[s].push(t);return}if(!Array.isArray(s)){i[s]={}}var e;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[s]={name:t[0].toLowerCase(),convert:t[1]};if(t.length===3){rt(t[2],i[s])}return;case"SPHEROID":case"ELLIPSOID":i[s]={name:t[0],a:t[1],rf:t[2]};if(t.length===4){rt(t[3],i[s])}return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]];et(i,s,t);return;default:e=-1;while(++e<t.length){if(!Array.isArray(t[e])){return rt(t,i[s])}}return et(i,s,t)}}var nt=.017453292519943295;function ht(t,i){var s=i[0];var e=i[1];if(!(s in t)&&e in t){t[s]=t[e];if(i.length===3){t[s]=i[2](t[s])}}}function at(t){return t*nt}function ot(t){if(t.type==="GEOGCS"){t.projName="longlat"}else if(t.type==="LOCAL_CS"){t.projName="identity";t.local=true}else{if(typeof t.PROJECTION==="object"){t.projName=Object.keys(t.PROJECTION)[0]}else{t.projName=t.PROJECTION}}if(t.AXIS){var i="";for(var s=0,e=t.AXIS.length;s<e;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];if(r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"){i+="n"}else if(r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"){i+="s"}else if(r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"){i+="e"}else if(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west"){i+="w"}}if(i.length===2){i+="u"}if(i.length===3){t.axis=i}}if(t.UNIT){t.units=t.UNIT.name.toLowerCase();if(t.units==="metre"){t.units="meter"}if(t.UNIT.convert){if(t.type==="GEOGCS"){if(t.DATUM&&t.DATUM.SPHEROID){t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a}}else{t.to_meter=t.UNIT.convert}}}var n=t.GEOGCS;if(t.type==="GEOGCS"){n=t}if(n){if(n.DATUM){t.datumCode=n.DATUM.name.toLowerCase()}else{t.datumCode=n.name.toLowerCase()}if(t.datumCode.slice(0,2)==="d_"){t.datumCode=t.datumCode.slice(2)}if(t.datumCode==="new_zealand_geodetic_datum_1949"||t.datumCode==="new_zealand_1949"){t.datumCode="nzgd49"}if(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984"){if(t.PROJECTION==="Mercator_Auxiliary_Sphere"){t.sphere=true}t.datumCode="wgs84"}if(t.datumCode.slice(-6)==="_ferro"){t.datumCode=t.datumCode.slice(0,-6)}if(t.datumCode.slice(-8)==="_jakarta"){t.datumCode=t.datumCode.slice(0,-8)}if(~t.datumCode.indexOf("belge")){t.datumCode="rnb72"}if(n.DATUM&&n.DATUM.SPHEROID){t.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk");if(t.ellps.toLowerCase().slice(0,13)==="international"){t.ellps="intl"}t.a=n.DATUM.SPHEROID.a;t.rf=parseFloat(n.DATUM.SPHEROID.rf,10)}if(n.DATUM&&n.DATUM.TOWGS84){t.datum_params=n.DATUM.TOWGS84}if(~t.datumCode.indexOf("osgb_1936")){t.datumCode="osgb36"}if(~t.datumCode.indexOf("osni_1952")){t.datumCode="osni52"}if(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965")){t.datumCode="ire65"}if(t.datumCode==="ch1903+"){t.datumCode="ch1903"}if(~t.datumCode.indexOf("israel")){t.datumCode="isr93"}}if(t.b&&!isFinite(t.b)){t.b=t.a}function h(i){var s=t.to_meter||1;return i*s}var a=function(i){return ht(t,i)};var o=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",at],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",at],["x0","false_easting",h],["y0","false_northing",h],["long0","central_meridian",at],["lat0","latitude_of_origin",at],["lat0","standard_parallel_1",at],["lat1","standard_parallel_1",at],["lat2","standard_parallel_2",at],["azimuth","Azimuth"],["alpha","azimuth",at],["srsCode","name"]];o.forEach(a);if(!t.long0&&t.longc&&(t.projName==="Albers_Conic_Equal_Area"||t.projName==="Lambert_Azimuthal_Equal_Area")){t.long0=t.longc}if(!t.lat_ts&&t.lat1&&(t.projName==="Stereographic_South_Pole"||t.projName==="Polar Stereographic (variant B)")){t.lat0=at(t.lat1>0?90:-90);t.lat_ts=t.lat1}else if(!t.lat_ts&&t.lat0&&t.projName==="Polar_Stereographic"){t.lat_ts=t.lat0;t.lat0=at(t.lat0>0?90:-90)}}function ft(t){var i=st(t);var s=i.shift();var e=i.shift();i.unshift(["name",e]);i.unshift(["type",s]);var r={};rt(i,r);ot(r);return r}function ut(t){var i=this;if(arguments.length===2){var s=arguments[1];if(typeof s==="string"){if(s.charAt(0)==="+"){ut[t]=U(arguments[1])}else{ut[t]=ft(arguments[1])}}else{ut[t]=s}}else if(arguments.length===1){if(Array.isArray(t)){return t.map((function(t){if(Array.isArray(t)){ut.apply(i,t)}else{ut(t)}}))}else if(typeof t==="string"){if(t in ut){return ut[t]}}else if("EPSG"in t){ut["EPSG:"+t.EPSG]=t}else if("ESRI"in t){ut["ESRI:"+t.ESRI]=t}else if("IAU2000"in t){ut["IAU2000:"+t.IAU2000]=t}else{console.log(t)}return}}w(ut);function lt(t){return typeof t==="string"}function vt(t){return t in ut}var ct=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function dt(t){return ct.some((function(i){return t.indexOf(i)>-1}))}function mt(t){return t[0]==="+"}function pt(t){if(lt(t)){if(vt(t)){return ut[t]}if(dt(t)){return ft(t)}if(mt(t)){return U(t)}}else{return t}}function zt(t,i){t=t||{};var s,e;if(!i){return t}for(e in i){s=i[e];if(s!==undefined){t[e]=s}}return t}function Mt(t,i,s){var e=t*i;return s/Math.sqrt(1-e*e)}function _t(t){return t<0?-1:1}function gt(t){return Math.abs(t)<=F?t:t-_t(t)*D}function bt(t,i,s){var e=t*s;var r=.5*t;e=Math.pow((1-e)/(1+e),r);return Math.tan(.5*(I-i))/e}function xt(t,i){var s=.5*t;var e,r;var n=I-2*Math.atan(i);for(var h=0;h<=15;h++){e=t*Math.sin(n);r=I-2*Math.atan(i*Math.pow((1-e)/(1+e),s))-n;n+=r;if(Math.abs(r)<=1e-10){return n}}return-9999}function wt(){var t=this.b/this.a;this.es=1-t*t;if(!("x0"in this)){this.x0=0}if(!("y0"in this)){this.y0=0}this.e=Math.sqrt(this.es);if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Mt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}else{if(!this.k0){if(this.k){this.k0=this.k}else{this.k0=1}}}}function yt(t){var i=t.x;var s=t.y;if(s*P>90&&s*P<-90&&i*P>180&&i*P<-180){return null}var e,r;if(Math.abs(Math.abs(s)-I)<=A){return null}else{if(this.sphere){e=this.x0+this.a*this.k0*gt(i-this.long0);r=this.y0+this.a*this.k0*Math.log(Math.tan(L+.5*s))}else{var n=Math.sin(s);var h=bt(this.e,s,n);e=this.x0+this.a*this.k0*gt(i-this.long0);r=this.y0-this.a*this.k0*Math.log(h)}t.x=e;t.y=r;return t}}function kt(t){var i=t.x-this.x0;var s=t.y-this.y0;var e,r;if(this.sphere){r=I-2*Math.atan(Math.exp(-s/(this.a*this.k0)))}else{var n=Math.exp(-s/(this.a*this.k0));r=xt(this.e,n);if(r===-9999){return null}}e=gt(this.long0+i/(this.a*this.k0));t.x=e;t.y=r;return t}var Et=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Ct={init:wt,forward:yt,inverse:kt,names:Et};function Nt(){}function It(t){return t}var St=["longlat","identity"];const Ot={init:Nt,forward:It,inverse:It,names:St};var Tt=[Ct,Ot];var At={};var Rt=[];function Pt(t,i){var s=Rt.length;if(!t.names){console.log(i);return true}Rt[s]=t;t.names.forEach((function(t){At[t.toLowerCase()]=s}));return this}function Lt(t){if(!t){return false}var i=t.toLowerCase();if(typeof At[i]!=="undefined"&&Rt[At[i]]){return Rt[At[i]]}}function Dt(){Tt.forEach(Pt)}const Ft={start:Dt,add:Pt,get:Lt};var Wt={};Wt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Wt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Wt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Wt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Wt.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"};Wt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Wt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Wt.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"};Wt.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Wt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Wt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Wt.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"};Wt.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Wt.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"};Wt.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."};Wt.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"};Wt.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Wt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Wt.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"};Wt.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"};Wt.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"};Wt.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"};Wt.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"};Wt.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Wt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Wt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Wt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Wt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Wt.hough={a:6378270,rf:297,ellipseName:"Hough"};Wt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Wt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Wt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Wt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Wt.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"};Wt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Wt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Wt.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"};Wt.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"};Wt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Wt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Wt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Gt=Wt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Wt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Vt(t,i,s,e){var r=t*t;var n=i*i;var h=(r-n)/r;var a=0;if(e){t*=1-h*(S+h*(O+h*T));r=t*t;h=0}else{a=Math.sqrt(h)}var o=(r-n)/n;return{es:h,e:a,ep2:o}}function jt(t,i,s,e,r){if(!t){var n=j(Wt,e);if(!n){n=Gt}t=n.a;i=n.b;s=n.rf}if(s&&!i){i=(1-1/s)*t}if(s===0||Math.abs(t-i)<A){r=true;i=t}return{a:t,b:i,rf:s,sphere:r}}var Ut={};Ut.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};Ut.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};Ut.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};Ut.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};Ut.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};Ut.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};Ut.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};Ut.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"};Ut.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};Ut.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};Ut.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};Ut.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};Ut.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};Ut.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};Ut.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};Ut.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};Ut.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function Xt(t,i,s,e,r,n){var h={};if(t===undefined||t==="none"){h.datum_type=C}else{h.datum_type=E}if(i){h.datum_params=i.map(parseFloat);if(h.datum_params[0]!==0||h.datum_params[1]!==0||h.datum_params[2]!==0){h.datum_type=y}if(h.datum_params.length>3){if(h.datum_params[3]!==0||h.datum_params[4]!==0||h.datum_params[5]!==0||h.datum_params[6]!==0){h.datum_type=k;h.datum_params[3]*=N;h.datum_params[4]*=N;h.datum_params[5]*=N;h.datum_params[6]=h.datum_params[6]/1e6+1}}}h.a=s;h.b=e;h.es=r;h.ep2=n;return h}function qt(t,i){if(!(this instanceof qt)){return new qt(t)}i=i||function(t){if(t){throw t}};var s=pt(t);if(typeof s!=="object"){i(t);return}var e=qt.projections.get(s.projName);if(!e){i(t);return}if(s.datumCode&&s.datumCode!=="none"){var r=j(Ut,s.datumCode);if(r){s.datum_params=r.towgs84?r.towgs84.split(","):null;s.ellps=r.ellipse;s.datumName=r.datumName?r.datumName:s.datumCode}}s.k0=s.k0||1;s.axis=s.axis||"enu";s.ellps=s.ellps||"wgs84";var n=jt(s.a,s.b,s.rf,s.ellps,s.sphere);var h=Vt(n.a,n.b,n.rf,s.R_A);var a=s.datum||Xt(s.datumCode,s.datum_params,n.a,n.b,h.es,h.ep2);zt(this,s);zt(this,e);this.a=n.a;this.b=n.b;this.rf=n.rf;this.sphere=n.sphere;this.es=h.es;this.e=h.e;this.ep2=h.ep2;this.datum=a;this.init();i(null,this)}qt.projections=Ft;qt.projections.start();function Yt(t,i){if(t.datum_type!==i.datum_type){return false}else if(t.a!==i.a||Math.abs(t.es-i.es)>5e-11){return false}else if(t.datum_type===y){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]}else if(t.datum_type===k){return t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]}else{return true}}function Bt(t,i,s){var e=t.x;var r=t.y;var n=t.z?t.z:0;var h;var a;var o;var f;if(r<-I&&r>-1.001*I){r=-I}else if(r>I&&r<1.001*I){r=I}else if(r<-I||r>I){return null}if(e>Math.PI){e-=2*Math.PI}a=Math.sin(r);f=Math.cos(r);o=a*a;h=s/Math.sqrt(1-i*o);return{x:(h+n)*f*Math.cos(e),y:(h+n)*f*Math.sin(e),z:(h*(1-i)+n)*a}}function Ht(t,i,s,e){var r=1e-12;var n=r*r;var h=30;var a;var o;var f;var u;var l;var v;var c;var d;var m;var p;var z;var M;var _;var g=t.x;var b=t.y;var x=t.z?t.z:0;var w;var y;var k;a=Math.sqrt(g*g+b*b);o=Math.sqrt(g*g+b*b+x*x);if(a/s<r){w=0;if(o/s<r){y=I;k=-e;return{x:t.x,y:t.y,z:t.z}}}else{w=Math.atan2(b,g)}f=x/o;u=a/o;l=1/Math.sqrt(1-i*(2-i)*u*u);d=u*(1-i)*l;m=f*l;_=0;do{_++;c=s/Math.sqrt(1-i*m*m);k=a*d+x*m-c*(1-i*m*m);v=i*c/(c+k);l=1/Math.sqrt(1-v*(2-v)*u*u);p=u*(1-v)*l;z=f*l;M=z*d-p*m;d=p;m=z}while(M*M>n&&_<h);y=Math.atan(z/Math.abs(p));return{x:w,y,z:k}}function Jt(t,i,s){if(i===y){return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]}}else if(i===k){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];return{x:f*(t.x-o*t.y+a*t.z)+e,y:f*(o*t.x+t.y-h*t.z)+r,z:f*(-a*t.x+h*t.y+t.z)+n}}}function Zt(t,i,s){if(i===y){return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]}}else if(i===k){var e=s[0];var r=s[1];var n=s[2];var h=s[3];var a=s[4];var o=s[5];var f=s[6];var u=(t.x-e)/f;var l=(t.y-r)/f;var v=(t.z-n)/f;return{x:u+o*l-a*v,y:-o*u+l+h*v,z:a*u-h*l+v}}}function $t(t){return t===y||t===k}function Kt(t,i,s){if(Yt(t,i)){return s}if(t.datum_type===C||i.datum_type===C){return s}if(t.es===i.es&&t.a===i.a&&!$t(t.datum_type)&&!$t(i.datum_type)){return s}s=Bt(s,t.es,t.a);if($t(t.datum_type)){s=Jt(s,t.datum_type,t.datum_params)}if($t(i.datum_type)){s=Zt(s,i.datum_type,i.datum_params)}return Ht(s,i.es,i.a,i.b)}function Qt(t,i,s){var e=s.x,r=s.y,n=s.z||0;var h,a,o;var f={};for(o=0;o<3;o++){if(i&&o===2&&s.z===undefined){continue}if(o===0){h=e;a="x"}else if(o===1){h=r;a="y"}else{h=n;a="z"}switch(t.axis[o]){case"e":f[a]=h;break;case"w":f[a]=-h;break;case"n":f[a]=h;break;case"s":f[a]=-h;break;case"u":if(s[a]!==undefined){f.z=h}break;case"d":if(s[a]!==undefined){f.z=-h}break;default:return null}}return f}function ti(t){var i={x:t[0],y:t[1]};if(t.length>2){i.z=t[2]}if(t.length>3){i.m=t[3]}return i}function ii(t){si(t.x);si(t.y)}function si(t){if(typeof Number.isFinite==="function"){if(Number.isFinite(t)){return}throw new TypeError("coordinates must be finite numbers")}if(typeof t!=="number"||t!==t||!isFinite(t)){throw new TypeError("coordinates must be finite numbers")}}function ei(t,i){return(t.datum.datum_type===y||t.datum.datum_type===k)&&i.datumCode!=="WGS84"||(i.datum.datum_type===y||i.datum.datum_type===k)&&t.datumCode!=="WGS84"}function ri(t,i,s){var e;if(Array.isArray(s)){s=ti(s)}ii(s);if(t.datum&&i.datum&&ei(t,i)){e=new qt("WGS84");s=ri(t,e,s);t=e}if(t.axis!=="enu"){s=Qt(t,false,s)}if(t.projName==="longlat"){s={x:s.x*R,y:s.y*R}}else{if(t.to_meter){s={x:s.x*t.to_meter,y:s.y*t.to_meter}}s=t.inverse(s)}if(t.from_greenwich){s.x+=t.from_greenwich}s=Kt(t.datum,i.datum,s);if(i.from_greenwich){s={x:s.x-i.from_greenwich,y:s.y}}if(i.projName==="longlat"){s={x:s.x*P,y:s.y*P}}else{s=i.forward(s);if(i.to_meter){s={x:s.x/i.to_meter,y:s.y/i.to_meter}}}if(i.axis!=="enu"){return Qt(i,true,s)}return s}var ni=qt("WGS84");function hi(t,i,s){var e,r,n;if(Array.isArray(s)){e=ri(t,i,s);if(s.length===3){return[e.x,e.y,e.z]}else{return[e.x,e.y]}}else{r=ri(t,i,s);n=Object.keys(s);if(n.length===2){return r}n.forEach((function(t){if(t==="x"||t==="y"){return}r[t]=s[t]}));return r}}function ai(t){if(t instanceof qt){return t}if(t.oProj){return t.oProj}return qt(t)}function oi(t,i,s){t=ai(t);var e=false;var r;if(typeof i==="undefined"){i=t;t=ni;e=true}else if(typeof i.x!=="undefined"||Array.isArray(i)){s=i;i=t;t=ni;e=true}i=ai(i);if(s){return hi(t,i,s)}else{r={forward:function(s){return hi(t,i,s)},inverse:function(s){return hi(i,t,s)}};if(e){r.oProj=i}return r}}var fi=6;var ui="AJSAJS";var li="AFAFAF";var vi=65;var ci=73;var di=79;var mi=86;var pi=90;const zi={forward:Mi,inverse:_i,toPoint:gi};function Mi(t,i){i=i||5;return Ei(wi({lat:t[1],lon:t[0]}),i)}function _i(t){var i=yi(Si(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat,i.lon,i.lat]}return[i.left,i.bottom,i.right,i.top]}function gi(t){var i=yi(Si(t.toUpperCase()));if(i.lat&&i.lon){return[i.lon,i.lat]}return[(i.left+i.right)/2,(i.top+i.bottom)/2]}function bi(t){return t*(Math.PI/180)}function xi(t){return 180*(t/Math.PI)}function wi(t){var i=t.lat;var s=t.lon;var e=6378137;var r=.00669438;var n=.9996;var h;var a;var o,f,u,l,v;var c=bi(i);var d=bi(s);var m;var p;p=Math.floor((s+180)/6)+1;if(s===180){p=60}if(i>=56&&i<64&&s>=3&&s<12){p=32}if(i>=72&&i<84){if(s>=0&&s<9){p=31}else if(s>=9&&s<21){p=33}else if(s>=21&&s<33){p=35}else if(s>=33&&s<42){p=37}}h=(p-1)*6-180+3;m=bi(h);a=r/(1-r);o=e/Math.sqrt(1-r*Math.sin(c)*Math.sin(c));f=Math.tan(c)*Math.tan(c);u=a*Math.cos(c)*Math.cos(c);l=Math.cos(c)*(d-m);v=e*((1-r/4-3*r*r/64-5*r*r*r/256)*c-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*c)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*c)-35*r*r*r/3072*Math.sin(6*c));var z=n*o*(l+(1-f+u)*l*l*l/6+(5-18*f+f*f+72*u-58*a)*l*l*l*l*l/120)+5e5;var M=n*(v+o*Math.tan(c)*(l*l/2+(5-f+9*u+4*u*u)*l*l*l*l/24+(61-58*f+f*f+600*u-330*a)*l*l*l*l*l*l/720));if(i<0){M+=1e7}return{northing:Math.round(M),easting:Math.round(z),zoneNumber:p,zoneLetter:ki(i)}}function yi(t){var i=t.northing;var s=t.easting;var e=t.zoneLetter;var r=t.zoneNumber;if(r<0||r>60){return null}var n=.9996;var h=6378137;var a=.00669438;var o;var f=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a));var u,l,v,c,d,m;var p;var z,M;var _=s-5e5;var g=i;if(e<"N"){g-=1e7}p=(r-1)*6-180+3;o=a/(1-a);m=g/n;z=m/(h*(1-a/4-3*a*a/64-5*a*a*a/256));M=z+(3*f/2-27*f*f*f/32)*Math.sin(2*z)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*z)+151*f*f*f/96*Math.sin(6*z);u=h/Math.sqrt(1-a*Math.sin(M)*Math.sin(M));l=Math.tan(M)*Math.tan(M);v=o*Math.cos(M)*Math.cos(M);c=h*(1-a)/Math.pow(1-a*Math.sin(M)*Math.sin(M),1.5);d=_/(u*n);var b=M-u*Math.tan(M)/c*(d*d/2-(5+3*l+10*v-4*v*v-9*o)*d*d*d*d/24+(61+90*l+298*v+45*l*l-252*o-3*v*v)*d*d*d*d*d*d/720);b=xi(b);var x=(d-(1+2*l+v)*d*d*d/6+(5-2*v+28*l-3*v*v+8*o+24*l*l)*d*d*d*d*d/120)/Math.cos(M);x=p+xi(x);var w;if(t.accuracy){var y=yi({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:y.lat,right:y.lon,bottom:b,left:x}}else{w={lat:b,lon:x}}return w}function ki(t){var i="Z";if(84>=t&&t>=72){i="X"}else if(72>t&&t>=64){i="W"}else if(64>t&&t>=56){i="V"}else if(56>t&&t>=48){i="U"}else if(48>t&&t>=40){i="T"}else if(40>t&&t>=32){i="S"}else if(32>t&&t>=24){i="R"}else if(24>t&&t>=16){i="Q"}else if(16>t&&t>=8){i="P"}else if(8>t&&t>=0){i="N"}else if(0>t&&t>=-8){i="M"}else if(-8>t&&t>=-16){i="L"}else if(-16>t&&t>=-24){i="K"}else if(-24>t&&t>=-32){i="J"}else if(-32>t&&t>=-40){i="H"}else if(-40>t&&t>=-48){i="G"}else if(-48>t&&t>=-56){i="F"}else if(-56>t&&t>=-64){i="E"}else if(-64>t&&t>=-72){i="D"}else if(-72>t&&t>=-80){i="C"}return i}function Ei(t,i){var s="00000"+t.easting,e="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Ci(t.easting,t.northing,t.zoneNumber)+s.substr(s.length-5,i)+e.substr(e.length-5,i)}function Ci(t,i,s){var e=Ni(s);var r=Math.floor(t/1e5);var n=Math.floor(i/1e5)%20;return Ii(r,n,e)}function Ni(t){var i=t%fi;if(i===0){i=fi}return i}function Ii(t,i,s){var e=s-1;var r=ui.charCodeAt(e);var n=li.charCodeAt(e);var h=r+t-1;var a=n+i;var o=false;if(h>pi){h=h-pi+vi-1;o=true}if(h===ci||r<ci&&h>ci||(h>ci||r<ci)&&o){h++}if(h===di||r<di&&h>di||(h>di||r<di)&&o){h++;if(h===ci){h++}}if(h>pi){h=h-pi+vi-1}if(a>mi){a=a-mi+vi-1;o=true}else{o=false}if(a===ci||n<ci&&a>ci||(a>ci||n<ci)&&o){a++}if(a===di||n<di&&a>di||(a>di||n<di)&&o){a++;if(a===ci){a++}}if(a>mi){a=a-mi+vi-1}var f=String.fromCharCode(h)+String.fromCharCode(a);return f}function Si(t){if(t&&t.length===0){throw"MGRSPoint coverting from nothing"}var i=t.length;var s=null;var e="";var r;var n=0;while(!/[A-Z]/.test(r=t.charAt(n))){if(n>=2){throw"MGRSPoint bad conversion from: "+t}e+=r;n++}var h=parseInt(e,10);if(n===0||n+3>i){throw"MGRSPoint bad conversion from: "+t}var a=t.charAt(n++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O"){throw"MGRSPoint zone letter "+a+" not handled: "+t}s=t.substring(n,n+=2);var o=Ni(h);var f=Oi(s.charAt(0),o);var u=Ti(s.charAt(1),o);while(u<Ai(a)){u+=2e6}var l=i-n;if(l%2!==0){throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t}var v=l/2;var c=0;var d=0;var m,p,z,M,_;if(v>0){m=1e5/Math.pow(10,v);p=t.substring(n,n+v);c=parseFloat(p)*m;z=t.substring(n+v);d=parseFloat(z)*m}M=c+f;_=d+u;return{easting:M,northing:_,zoneLetter:a,zoneNumber:h,accuracy:m}}function Oi(t,i){var s=ui.charCodeAt(i-1);var e=1e5;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===ci){s++}if(s===di){s++}if(s>pi){if(r){throw"Bad character: "+t}s=vi;r=true}e+=1e5}return e}function Ti(t,i){if(t>"V"){throw"MGRSPoint given invalid Northing "+t}var s=li.charCodeAt(i-1);var e=0;var r=false;while(s!==t.charCodeAt(0)){s++;if(s===ci){s++}if(s===di){s++}if(s>mi){if(r){throw"Bad character: "+t}s=vi;r=true}e+=1e5}return e}function Ai(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0){return i}else{throw"Invalid zone letter: "+t}}function Ri(t,i,s){if(!(this instanceof Ri)){return new Ri(t,i,s)}if(Array.isArray(t)){this.x=t[0];this.y=t[1];this.z=t[2]||0}else if(typeof t==="object"){this.x=t.x;this.y=t.y;this.z=t.z||0}else if(typeof t==="string"&&typeof i==="undefined"){var e=t.split(",");this.x=parseFloat(e[0],10);this.y=parseFloat(e[1],10);this.z=parseFloat(e[2],10)||0}else{this.x=t;this.y=i;this.z=s||0}console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ri.fromMGRS=function(t){return new Ri(gi(t))};Ri.prototype.toMGRS=function(t){return Mi([this.x,this.y],t)};const Pi="2.4.4";var Li=1;var Di=.25;var Fi=.046875;var Wi=.01953125;var Gi=.01068115234375;var Vi=.75;var ji=.46875;var Ui=.013020833333333334;var Xi=.007120768229166667;var qi=.3645833333333333;var Yi=.005696614583333333;var Bi=.3076171875;function Hi(t){var i=[];i[0]=Li-t*(Di+t*(Fi+t*(Wi+t*Gi)));i[1]=t*(Vi-t*(Fi+t*(Wi+t*Gi)));var s=t*t;i[2]=s*(ji-t*(Ui+t*Xi));s*=t;i[3]=s*(qi-t*Yi);i[4]=s*t*Bi;return i}function Ji(t,i,s,e){s*=i;i*=i;return e[0]*t-s*(e[1]+i*(e[2]+i*(e[3]+i*e[4])))}var Zi=20;function $i(t,i,s){var e=1/(1-i);var r=t;for(var n=Zi;n;--n){var h=Math.sin(r);var a=1-i*h*h;a=(Ji(r,h,Math.cos(r),s)-t)*(a*Math.sqrt(a))*e;r-=a;if(Math.abs(a)<A){return r}}return r}function Ki(){this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;if(this.es){this.en=Hi(this.es);this.ml0=Ji(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en)}}function Qi(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r;var n,h;var a=Math.sin(s);var o=Math.cos(s);if(!this.es){var f=o*Math.sin(e);if(Math.abs(Math.abs(f)-1)<A){return 93}else{n=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0;h=o*Math.cos(e)/Math.sqrt(1-Math.pow(f,2));f=Math.abs(h);if(f>=1){if(f-1>A){return 93}else{h=0}}else{h=Math.acos(h)}if(s<0){h=-h}h=this.a*this.k0*(h-this.lat0)+this.y0}}else{var u=o*e;var l=Math.pow(u,2);var v=this.ep2*Math.pow(o,2);var c=Math.pow(v,2);var d=Math.abs(o)>A?Math.tan(s):0;var m=Math.pow(d,2);var p=Math.pow(m,2);r=1-this.es*Math.pow(a,2);u=u/Math.sqrt(r);var z=Ji(s,a,o,this.en);n=this.a*(this.k0*u*(1+l/6*(1-m+v+l/20*(5-18*m+p+14*v-58*m*v+l/42*(61+179*p-p*m-479*m)))))+this.x0;h=this.a*(this.k0*(z-this.ml0+a*e*u/2*(1+l/12*(5-m+9*v+4*c+l/30*(61+p-58*m+270*v-330*m*v+l/56*(1385+543*p-p*m-3111*m))))))+this.y0}t.x=n;t.y=h;return t}function ts(t){var i,s;var e,r;var n=(t.x-this.x0)*(1/this.a);var h=(t.y-this.y0)*(1/this.a);if(!this.es){var a=Math.exp(n/this.k0);var o=.5*(a-1/a);var f=this.lat0+h/this.k0;var u=Math.cos(f);i=Math.sqrt((1-Math.pow(u,2))/(1+Math.pow(o,2)));e=Math.asin(i);if(h<0){e=-e}if(o===0&&u===0){r=0}else{r=gt(Math.atan2(o,u)+this.long0)}}else{i=this.ml0+h/this.k0;s=$i(i,this.es,this.en);if(Math.abs(s)<I){var l=Math.sin(s);var v=Math.cos(s);var c=Math.abs(v)>A?Math.tan(s):0;var d=this.ep2*Math.pow(v,2);var m=Math.pow(d,2);var p=Math.pow(c,2);var z=Math.pow(p,2);i=1-this.es*Math.pow(l,2);var M=n*Math.sqrt(i)/this.k0;var _=Math.pow(M,2);i=i*c;e=s-i*_/(1-this.es)*.5*(1-_/12*(5+3*p-9*d*p+d-4*m-_/30*(61+90*p-252*d*p+45*z+46*d-_/56*(1385+3633*p+4095*z+1574*z*p))));r=gt(this.long0+M*(1-_/6*(1+2*p+d-_/20*(5+28*p+24*z+8*d*p+6*d-_/42*(61+662*p+1320*z+720*z*p))))/v)}else{e=I*_t(h);r=0}}t.x=r;t.y=e;return t}var is=["Transverse_Mercator","Transverse Mercator","tmerc"];const ss={init:Ki,forward:Qi,inverse:ts,names:is};function es(t){var i=Math.exp(t);i=(i-1/i)/2;return i}function rs(t,i){t=Math.abs(t);i=Math.abs(i);var s=Math.max(t,i);var e=Math.min(t,i)/(s?s:1);return s*Math.sqrt(1+Math.pow(e,2))}function ns(t){var i=1+t;var s=i-1;return s===0?t:t*Math.log(i)/s}function hs(t){var i=Math.abs(t);i=ns(i*(1+i/(rs(1,i)+1)));return t<0?-i:i}function as(t,i){var s=2*Math.cos(2*i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return i+h*Math.sin(2*i)}function os(t,i){var s=2*Math.cos(i);var e=t.length-1;var r=t[e];var n=0;var h;while(--e>=0){h=-n+s*r+t[e];n=r;r=h}return Math.sin(i)*h}function fs(t){var i=Math.exp(t);i=(i+1/i)/2;return i}function us(t,i,s){var e=Math.sin(i);var r=Math.cos(i);var n=es(s);var h=fs(s);var a=2*r*h;var o=-2*e*n;var f=t.length-1;var u=t[f];var l=0;var v=0;var c=0;var d;var m;while(--f>=0){d=v;m=l;v=u;l=c;u=-d+a*v-o*l+t[f];c=-m+o*v+a*l}a=e*h;o=r*n;return[a*u-o*c,a*c+o*u]}function ls(){if(this.es===undefined||this.es<=0){throw new Error("incorrect elliptical usage")}this.x0=this.x0!==undefined?this.x0:0;this.y0=this.y0!==undefined?this.y0:0;this.long0=this.long0!==undefined?this.long0:0;this.lat0=this.lat0!==undefined?this.lat0:0;this.cgb=[];this.cbg=[];this.utg=[];this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es));var i=t/(2-t);var s=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675))))));this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725))))));s=s*i;this.cgb[1]=s*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945)))));this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945)))));s=s*i;this.cgb[2]=s*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835))));this.cbg[2]=s*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835))));s=s*i;this.cgb[3]=s*(4279/630+i*(-332/35+i*(-399572/14175)));this.cbg[3]=s*(1237/630+i*(-12/5+i*(-24832/14175)));s=s*i;this.cgb[4]=s*(4174/315+i*(-144838/6237));this.cbg[4]=s*(-734/315+i*(109598/31185));s=s*i;this.cgb[5]=s*(601676/22275);this.cbg[5]=s*(444337/155925);s=Math.pow(i,2);this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256)));this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800))))));this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800))))));this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720)))));this.gtu[1]=s*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360)))));s=s*i;this.utg[2]=s*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720))));this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440))));s=s*i;this.utg[3]=s*(-4397/161280+i*(11/504+i*(830251/7257600)));this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600)));s=s*i;this.utg[4]=s*(-4583/161280+i*(108847/3991680));this.gtu[4]=s*(34729/80640+i*(-3418889/1995840));s=s*i;this.utg[5]=s*(-20648693/638668800);this.gtu[5]=s*(212378941/319334400);var e=as(this.cbg,this.lat0);this.Zb=-this.Qn*(e+os(this.gtu,2*e))}function vs(t){var i=gt(t.x-this.long0);var s=t.y;s=as(this.cbg,s);var e=Math.sin(s);var r=Math.cos(s);var n=Math.sin(i);var h=Math.cos(i);s=Math.atan2(e,h*r);i=Math.atan2(n*r,rs(e,r*h));i=hs(Math.tan(i));var a=us(this.gtu,2*s,2*i);s=s+a[0];i=i+a[1];var o;var f;if(Math.abs(i)<=2.623395162778){o=this.a*(this.Qn*i)+this.x0;f=this.a*(this.Qn*s+this.Zb)+this.y0}else{o=Infinity;f=Infinity}t.x=o;t.y=f;return t}function cs(t){var i=(t.x-this.x0)*(1/this.a);var s=(t.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn;i=i/this.Qn;var e;var r;if(Math.abs(i)<=2.623395162778){var n=us(this.utg,2*s,2*i);s=s+n[0];i=i+n[1];i=Math.atan(es(i));var h=Math.sin(s);var a=Math.cos(s);var o=Math.sin(i);var f=Math.cos(i);s=Math.atan2(h*f,rs(o,f*a));i=Math.atan2(o,f*a);e=gt(i+this.long0);r=as(this.cgb,s)}else{e=Infinity;r=Infinity}t.x=e;t.y=r;return t}var ds=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"];const ms={init:ls,forward:vs,inverse:cs,names:ds};function ps(t,i){if(t===undefined){t=Math.floor((gt(i)+Math.PI)*30/Math.PI)+1;if(t<0){return 0}else if(t>60){return 60}}return t}var zs="etmerc";function Ms(){var t=ps(this.zone,this.long0);if(t===undefined){throw new Error("unknown utm zone")}this.lat0=0;this.long0=(6*Math.abs(t)-183)*R;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;ms.init.apply(this);this.forward=ms.forward;this.inverse=ms.inverse}var _s=["Universal Transverse Mercator System","utm"];const gs={init:Ms,names:_s,dependsOn:zs};function bs(t,i){return Math.pow((1-t)/(1+t),i)}var xs=20;function ws(){var t=Math.sin(this.lat0);var i=Math.cos(this.lat0);i*=i;this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t);this.C=Math.sqrt(1+this.es*i*i/(1-this.es));this.phic0=Math.asin(t/this.C);this.ratexp=.5*this.C*this.e;this.K=Math.tan(.5*this.phic0+L)/(Math.pow(Math.tan(.5*this.lat0+L),this.C)*bs(this.e*t,this.ratexp))}function ys(t){var i=t.x;var s=t.y;t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+L),this.C)*bs(this.e*Math.sin(s),this.ratexp))-I;t.x=this.C*i;return t}function ks(t){var i=1e-14;var s=t.x/this.C;var e=t.y;var r=Math.pow(Math.tan(.5*e+L)/this.K,1/this.C);for(var n=xs;n>0;--n){e=2*Math.atan(r*bs(this.e*Math.sin(t.y),-.5*this.e))-I;if(Math.abs(e-t.y)<i){break}t.y=e}if(!n){return null}t.x=s;t.y=e;return t}var Es=["gauss"];const Cs={init:ws,forward:ys,inverse:ks,names:Es};function Ns(){Cs.init.apply(this);if(!this.rc){return}this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;if(!this.title){this.title="Oblique Stereographic Alternative"}}function Is(t){var i,s,e,r;t.x=gt(t.x-this.long0);Cs.forward.apply(this,[t]);i=Math.sin(t.y);s=Math.cos(t.y);e=Math.cos(t.x);r=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*e);t.x=r*s*Math.sin(t.x);t.y=r*(this.cosc0*i-this.sinc0*s*e);t.x=this.a*t.x+this.x0;t.y=this.a*t.y+this.y0;return t}function Ss(t){var i,s,e,r,n;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(n=Math.sqrt(t.x*t.x+t.y*t.y)){var h=2*Math.atan2(n,this.R2);i=Math.sin(h);s=Math.cos(h);r=Math.asin(s*this.sinc0+t.y*i*this.cosc0/n);e=Math.atan2(t.x*i,n*this.cosc0*s-t.y*this.sinc0*i)}else{r=this.phic0;e=0}t.x=e;t.y=r;Cs.inverse.apply(this,[t]);t.x=gt(t.x+this.long0);return t}var Os=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"];const Ts={init:Ns,forward:Is,inverse:Ss,names:Os};function As(t,i,s){i*=s;return Math.tan(.5*(I+t))*Math.pow((1-i)/(1+i),.5*s)}function Rs(){this.coslat0=Math.cos(this.lat0);this.sinlat0=Math.sin(this.lat0);if(this.sphere){if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=A){this.k0=.5*(1+_t(this.lat0)*Math.sin(this.lat_ts))}}else{if(Math.abs(this.coslat0)<=A){if(this.lat0>0){this.con=1}else{this.con=-1}}this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e));if(this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=A){this.k0=.5*this.cons*Mt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/bt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))}this.ms1=Mt(this.e,this.sinlat0,this.coslat0);this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-I;this.cosX0=Math.cos(this.X0);this.sinX0=Math.sin(this.X0)}}function Ps(t){var i=t.x;var s=t.y;var e=Math.sin(s);var r=Math.cos(s);var n,h,a,o,f,u;var l=gt(i-this.long0);if(Math.abs(Math.abs(i-this.long0)-Math.PI)<=A&&Math.abs(s+this.lat0)<=A){t.x=NaN;t.y=NaN;return t}if(this.sphere){n=2*this.k0/(1+this.sinlat0*e+this.coslat0*r*Math.cos(l));t.x=this.a*n*r*Math.sin(l)+this.x0;t.y=this.a*n*(this.coslat0*e-this.sinlat0*r*Math.cos(l))+this.y0;return t}else{h=2*Math.atan(this.ssfn_(s,e,this.e))-I;o=Math.cos(h);a=Math.sin(h);if(Math.abs(this.coslat0)<=A){f=bt(this.e,s*this.con,this.con*e);u=2*this.a*this.k0*f/this.cons;t.x=this.x0+u*Math.sin(i-this.long0);t.y=this.y0-this.con*u*Math.cos(i-this.long0);return t}else if(Math.abs(this.sinlat0)<A){n=2*this.a*this.k0/(1+o*Math.cos(l));t.y=n*a}else{n=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*o*Math.cos(l)));t.y=n*(this.cosX0*a-this.sinX0*o*Math.cos(l))+this.y0}t.x=n*o*Math.sin(l)+this.x0}return t}function Ls(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n;var h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(h/(.5*this.a*this.k0));i=this.long0;s=this.lat0;if(h<=A){t.x=i;t.y=s;return t}s=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/h);if(Math.abs(this.coslat0)<A){if(this.lat0>0){i=gt(this.long0+Math.atan2(t.x,-1*t.y))}else{i=gt(this.long0+Math.atan2(t.x,t.y))}}else{i=gt(this.long0+Math.atan2(t.x*Math.sin(a),h*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a)))}t.x=i;t.y=s;return t}else{if(Math.abs(this.coslat0)<=A){if(h<=A){s=this.lat0;i=this.long0;t.x=i;t.y=s;return t}t.x*=this.con;t.y*=this.con;e=h*this.cons/(2*this.a*this.k0);s=this.con*xt(this.e,e);i=this.con*gt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else{r=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1));i=this.long0;if(h<=A){n=this.X0}else{n=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/h);i=gt(this.long0+Math.atan2(t.x*Math.sin(r),h*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))}s=-1*xt(this.e,Math.tan(.5*(I+n)))}}t.x=i;t.y=s;return t}var Ds=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const Fs={init:Rs,forward:Ps,inverse:Ls,names:Ds,ssfn_:As};function Ws(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t);var s=this.a;var e=this.rf;var r=1/e;var n=2*r-Math.pow(r,2);var h=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2));this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4));this.b0=Math.asin(i/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2));var o=Math.log(Math.tan(Math.PI/4+t/2));var f=Math.log((1+h*i)/(1-h*i));this.K=a-this.alpha*o+this.alpha*h/2*f}function Gs(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2));var s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y)));var e=-this.alpha*(i+s)+this.K;var r=2*(Math.atan(Math.exp(e))-Math.PI/4);var n=this.alpha*(t.x-this.lambda0);var h=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(n)));var a=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(n));t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0;t.x=this.R*h+this.x0;return t}function Vs(t){var i=t.x-this.x0;var s=t.y-this.y0;var e=i/this.R;var r=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4);var n=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(e));var h=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(r)));var a=this.lambda0+h/this.alpha;var o=0;var f=n;var u=-1e3;var l=0;while(Math.abs(f-u)>1e-7){if(++l>20){return}o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2));u=f;f=2*Math.atan(Math.exp(o))-Math.PI/2}t.x=a;t.y=f;return t}var js=["somerc"];const Us={init:Ws,forward:Gs,inverse:Vs,names:js};function Xs(){this.no_off=this.no_off||false;this.no_rot=this.no_rot||false;if(isNaN(this.k0)){this.k0=1}var t=Math.sin(this.lat0);var i=Math.cos(this.lat0);var s=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(i,4));this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-s*s);var e=bt(this.e,this.lat0,t);var r=this.bl/i*Math.sqrt((1-this.es)/(1-s*s));if(r*r<1){r=1}var n;var h;if(!isNaN(this.longc)){if(this.lat0>=0){n=r+Math.sqrt(r*r-1)}else{n=r-Math.sqrt(r*r-1)}this.el=n*Math.pow(e,this.bl);h=.5*(n-1/n);this.gamma0=Math.asin(Math.sin(this.alpha)/r);this.long0=this.longc-Math.asin(h*Math.tan(this.gamma0))/this.bl}else{var a=bt(this.e,this.lat1,Math.sin(this.lat1));var o=bt(this.e,this.lat2,Math.sin(this.lat2));if(this.lat0>=0){this.el=(r+Math.sqrt(r*r-1))*Math.pow(e,this.bl)}else{this.el=(r-Math.sqrt(r*r-1))*Math.pow(e,this.bl)}var f=Math.pow(a,this.bl);var u=Math.pow(o,this.bl);n=this.el/f;h=.5*(n-1/n);var l=(this.el*this.el-u*f)/(this.el*this.el+u*f);var v=(u-f)/(u+f);var c=gt(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(l*Math.tan(.5*this.bl*c)/v)/this.bl;this.long0=gt(this.long0);var d=gt(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*d)/h);this.alpha=Math.asin(r*Math.sin(this.gamma0))}if(this.no_off){this.uc=0}else{if(this.lat0>=0){this.uc=this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha))}else{this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha))}}}function qs(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r,n;var h;if(Math.abs(Math.abs(s)-I)<=A){if(s>0){h=-1}else{h=1}n=this.al/this.bl*Math.log(Math.tan(L+h*this.gamma0*.5));r=-1*h*I*this.al/this.bl}else{var a=bt(this.e,s,Math.sin(s));var o=this.el/Math.pow(a,this.bl);var f=.5*(o-1/o);var u=.5*(o+1/o);var l=Math.sin(this.bl*e);var v=(f*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/u;if(Math.abs(Math.abs(v)-1)<=A){n=Number.POSITIVE_INFINITY}else{n=.5*this.al*Math.log((1-v)/(1+v))/this.bl}if(Math.abs(Math.cos(this.bl*e))<=A){r=this.al*this.bl*e}else{r=this.al*Math.atan2(f*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*e))/this.bl}}if(this.no_rot){t.x=this.x0+r;t.y=this.y0+n}else{r-=this.uc;t.x=this.x0+n*Math.cos(this.alpha)+r*Math.sin(this.alpha);t.y=this.y0+r*Math.cos(this.alpha)-n*Math.sin(this.alpha)}return t}function Ys(t){var i,s;if(this.no_rot){s=t.y-this.y0;i=t.x-this.x0}else{s=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha);i=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha);i+=this.uc}var e=Math.exp(-1*this.bl*s/this.al);var r=.5*(e-1/e);var n=.5*(e+1/e);var h=Math.sin(this.bl*i/this.al);var a=(h*Math.cos(this.gamma0)+r*Math.sin(this.gamma0))/n;var o=Math.pow(this.el/Math.sqrt((1+a)/(1-a)),1/this.bl);if(Math.abs(a-1)<A){t.x=this.long0;t.y=I}else if(Math.abs(a+1)<A){t.x=this.long0;t.y=-1*I}else{t.y=xt(this.e,o);t.x=gt(this.long0-Math.atan2(r*Math.cos(this.gamma0)-h*Math.sin(this.gamma0),Math.cos(this.bl*i/this.al))/this.bl)}return t}var Bs=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"];const Hs={init:Xs,forward:qs,inverse:Ys,names:Bs};function Js(){if(!this.lat2){this.lat2=this.lat1}if(!this.k0){this.k0=1}this.x0=this.x0||0;this.y0=this.y0||0;if(Math.abs(this.lat1+this.lat2)<A){return}var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1);var s=Math.cos(this.lat1);var e=Mt(this.e,i,s);var r=bt(this.e,this.lat1,i);var n=Math.sin(this.lat2);var h=Math.cos(this.lat2);var a=Mt(this.e,n,h);var o=bt(this.e,this.lat2,n);var f=bt(this.e,this.lat0,Math.sin(this.lat0));if(Math.abs(this.lat1-this.lat2)>A){this.ns=Math.log(e/a)/Math.log(r/o)}else{this.ns=i}if(isNaN(this.ns)){this.ns=i}this.f0=e/(this.ns*Math.pow(r,this.ns));this.rh=this.a*this.f0*Math.pow(f,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}}function Zs(t){var i=t.x;var s=t.y;if(Math.abs(2*Math.abs(s)-Math.PI)<=A){s=_t(s)*(I-2*A)}var e=Math.abs(Math.abs(s)-I);var r,n;if(e>A){r=bt(this.e,s,Math.sin(s));n=this.a*this.f0*Math.pow(r,this.ns)}else{e=s*this.ns;if(e<=0){return null}n=0}var h=this.ns*gt(i-this.long0);t.x=this.k0*(n*Math.sin(h))+this.x0;t.y=this.k0*(this.rh-n*Math.cos(h))+this.y0;return t}function $s(t){var i,s,e;var r,n;var h=(t.x-this.x0)/this.k0;var a=this.rh-(t.y-this.y0)/this.k0;if(this.ns>0){i=Math.sqrt(h*h+a*a);s=1}else{i=-Math.sqrt(h*h+a*a);s=-1}var o=0;if(i!==0){o=Math.atan2(s*h,s*a)}if(i!==0||this.ns>0){s=1/this.ns;e=Math.pow(i/(this.a*this.f0),s);r=xt(this.e,e);if(r===-9999){return null}}else{r=-I}n=gt(o/this.ns+this.long0);t.x=n;t.y=r;return t}var Ks=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"];const Qs={init:Js,forward:Zs,inverse:$s,names:Ks};function te(){this.a=6377397.155;this.es=.006674372230614;this.e=Math.sqrt(this.es);if(!this.lat0){this.lat0=.863937979737193}if(!this.long0){this.long0=.7417649320975901-.308341501185665}if(!this.k0){this.k0=.9999}this.s45=.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq}function ie(t){var i,s,e,r,n,h,a;var o=t.x;var f=t.y;var u=gt(o-this.long0);i=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2);s=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/i)-this.s45);e=-u*this.alfa;r=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(e));n=Math.asin(Math.cos(s)*Math.sin(e)/Math.cos(r));h=this.n*n;a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n);t.y=a*Math.cos(h)/1;t.x=a*Math.sin(h)/1;if(!this.czech){t.y*=-1;t.x*=-1}return t}function se(t){var i,s,e,r,n,h,a;var o;var f=t.x;t.x=t.y;t.y=f;if(!this.czech){t.y*=-1;t.x*=-1}h=Math.sqrt(t.x*t.x+t.y*t.y);n=Math.atan2(t.y,t.x);r=n/Math.sin(this.s0);e=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);i=Math.asin(Math.cos(this.ad)*Math.sin(e)-Math.sin(this.ad)*Math.cos(e)*Math.cos(r));s=Math.asin(Math.cos(e)*Math.sin(r)/Math.cos(i));t.x=this.long0-s/this.alfa;a=i;o=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45);if(Math.abs(a-t.y)<1e-10){o=1}a=t.y;u+=1}while(o===0&&u<15);if(u>=15){return null}return t}var ee=["Krovak","krovak"];const re={init:te,forward:ie,inverse:se,names:ee};function ne(t,i,s,e,r){return t*r-i*Math.sin(2*r)+s*Math.sin(4*r)-e*Math.sin(6*r)}function he(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function ae(t){return.375*t*(1+.25*t*(1+.46875*t))}function oe(t){return.05859375*t*t*(1+.75*t)}function fe(t){return t*t*t*(35/3072)}function ue(t,i,s){var e=i*s;return t/Math.sqrt(1-e*e)}function le(t){return Math.abs(t)<I?t:t-_t(t)*Math.PI}function ve(t,i,s,e,r){var n;var h;n=t/i;for(var a=0;a<15;a++){h=(t-(i*n-s*Math.sin(2*n)+e*Math.sin(4*n)-r*Math.sin(6*n)))/(i-2*s*Math.cos(2*n)+4*e*Math.cos(4*n)-6*r*Math.cos(6*n));n+=h;if(Math.abs(h)<=1e-10){return n}}return NaN}function ce(){if(!this.sphere){this.e0=he(this.es);this.e1=ae(this.es);this.e2=oe(this.es);this.e3=fe(this.es);this.ml0=this.a*ne(this.e0,this.e1,this.e2,this.e3,this.lat0)}}function de(t){var i,s;var e=t.x;var r=t.y;e=gt(e-this.long0);if(this.sphere){i=this.a*Math.asin(Math.cos(r)*Math.sin(e));s=this.a*(Math.atan2(Math.tan(r),Math.cos(e))-this.lat0)}else{var n=Math.sin(r);var h=Math.cos(r);var a=ue(this.a,this.e,n);var o=Math.tan(r)*Math.tan(r);var f=e*Math.cos(r);var u=f*f;var l=this.es*h*h/(1-this.es);var v=this.a*ne(this.e0,this.e1,this.e2,this.e3,r);i=a*f*(1-u*o*(1/6-(8-o+8*l)*u/120));s=v-this.ml0+a*n/h*u*(.5+(5-o+6*l)*u/24)}t.x=i+this.x0;t.y=s+this.y0;return t}function me(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r;if(this.sphere){var n=s+this.lat0;e=Math.asin(Math.sin(n)*Math.cos(i));r=Math.atan2(Math.tan(i),Math.cos(n))}else{var h=this.ml0/this.a+s;var a=ve(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-I)<=A){t.x=this.long0;t.y=I;if(s<0){t.y*=-1}return t}var o=ue(this.a,this.e,Math.sin(a));var f=o*o*o/this.a/this.a*(1-this.es);var u=Math.pow(Math.tan(a),2);var l=i*this.a/o;var v=l*l;e=a-o*Math.tan(a)/f*l*l*(.5-(1+3*u)*l*l/24);r=l*(1-v*(u/3+(1+3*u)*u*v/15))/Math.cos(a)}t.x=gt(r+this.long0);t.y=le(e);return t}var pe=["Cassini","Cassini_Soldner","cass"];const ze={init:ce,forward:de,inverse:me,names:pe};function Me(t,i){var s;if(t>1e-7){s=t*i;return(1-t*t)*(i/(1-s*s)-.5/t*Math.log((1-s)/(1+s)))}else{return 2*i}}var _e=1;var ge=2;var be=3;var xe=4;function we(){var t=Math.abs(this.lat0);if(Math.abs(t-I)<A){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else if(Math.abs(t)<A){this.mode=this.EQUIT}else{this.mode=this.OBLIQ}if(this.es>0){var i;this.qp=Me(this.e,1);this.mmf=.5/(1-this.es);this.apa=Te(this.es);switch(this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp);i=Math.sin(this.lat0);this.sinb1=Me(this.e,i)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd;break}}else{if(this.mode===this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}}}function ye(t){var i,s,e,r,n,h,a,o,f,u;var l=t.x;var v=t.y;l=gt(l-this.long0);if(this.sphere){n=Math.sin(v);u=Math.cos(v);e=Math.cos(l);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){s=this.mode===this.EQUIT?1+u*e:1+this.sinph0*n+this.cosph0*u*e;if(s<=A){return null}s=Math.sqrt(2/s);i=s*u*Math.sin(l);s*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*u*e}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){e=-e}if(Math.abs(v+this.phi0)<A){return null}s=L-v*.5;s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s));i=s*Math.sin(l);s*=e}}else{a=0;o=0;f=0;e=Math.cos(l);r=Math.sin(l);n=Math.sin(v);h=Me(this.e,n);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){a=h/this.qp;o=Math.sqrt(1-a*a)}switch(this.mode){case this.OBLIQ:f=1+this.sinb1*a+this.cosb1*o*e;break;case this.EQUIT:f=1+o*e;break;case this.N_POLE:f=I+v;h=this.qp-h;break;case this.S_POLE:f=v-I;h=this.qp+h;break}if(Math.abs(f)<A){return null}switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f);if(this.mode===this.OBLIQ){s=this.ymf*f*(this.cosb1*a-this.sinb1*o*e)}else{s=(f=Math.sqrt(2/(1+o*e)))*a*this.ymf}i=this.xmf*f*o*r;break;case this.N_POLE:case this.S_POLE:if(h>=0){i=(f=Math.sqrt(h))*r;s=e*(this.mode===this.S_POLE?f:-f)}else{i=s=0}break}}t.x=this.a*i+this.x0;t.y=this.a*s+this.y0;return t}function ke(t){t.x-=this.x0;t.y-=this.y0;var i=t.x/this.a;var s=t.y/this.a;var e,r,n,h,a,o,f;if(this.sphere){var u=0,l,v=0;l=Math.sqrt(i*i+s*s);r=l*.5;if(r>1){return null}r=2*Math.asin(r);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){v=Math.sin(r);u=Math.cos(r)}switch(this.mode){case this.EQUIT:r=Math.abs(l)<=A?0:Math.asin(s*v/l);i*=v;s=u*l;break;case this.OBLIQ:r=Math.abs(l)<=A?this.phi0:Math.asin(u*this.sinph0+s*v*this.cosph0/l);i*=v*this.cosph0;s=(u-Math.sin(r)*this.sinph0)*l;break;case this.N_POLE:s=-s;r=I-r;break;case this.S_POLE:r-=I;break}e=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,s)}else{f=0;if(this.mode===this.OBLIQ||this.mode===this.EQUIT){i/=this.dd;s*=this.dd;o=Math.sqrt(i*i+s*s);if(o<A){t.x=0;t.y=this.phi0;return t}h=2*Math.asin(.5*o/this.rq);n=Math.cos(h);i*=h=Math.sin(h);if(this.mode===this.OBLIQ){f=n*this.sinb1+s*h*this.cosb1/o;a=this.qp*f;s=o*this.cosb1*n-s*this.sinb1*h}else{f=s*h/o;a=this.qp*f;s=o*n}}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE){s=-s}a=i*i+s*s;if(!a){t.x=0;t.y=this.phi0;return t}f=1-a/this.qp;if(this.mode===this.S_POLE){f=-f}}e=Math.atan2(i,s);r=Ae(Math.asin(f),this.apa)}t.x=gt(this.long0+e);t.y=r;return t}var Ee=.3333333333333333;var Ce=.17222222222222222;var Ne=.10257936507936508;var Ie=.06388888888888888;var Se=.0664021164021164;var Oe=.016415012942191543;function Te(t){var i;var s=[];s[0]=t*Ee;i=t*t;s[0]+=i*Ce;s[1]=i*Ie;i*=t;s[0]+=i*Ne;s[1]+=i*Se;s[2]=i*Oe;return s}function Ae(t,i){var s=t+t;return t+i[0]*Math.sin(s)+i[1]*Math.sin(s+s)+i[2]*Math.sin(s+s+s)}var Re=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Pe={init:we,forward:ye,inverse:ke,names:Re,S_POLE:_e,N_POLE:ge,EQUIT:be,OBLIQ:xe};function Le(t){if(Math.abs(t)>1){t=t>1?1:-1}return Math.asin(t)}function De(){if(Math.abs(this.lat1+this.lat2)<A){return}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Mt(this.e3,this.sin_po,this.cos_po);this.qs1=Me(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Mt(this.e3,this.sin_po,this.cos_po);this.qs2=Me(this.e3,this.sin_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=Me(this.e3,this.sin_po);if(Math.abs(this.lat1-this.lat2)>A){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0}function Fe(t){var i=t.x;var s=t.y;this.sin_phi=Math.sin(s);this.cos_phi=Math.cos(s);var e=Me(this.e3,this.sin_phi);var r=this.a*Math.sqrt(this.c-this.ns0*e)/this.ns0;var n=this.ns0*gt(i-this.long0);var h=r*Math.sin(n)+this.x0;var a=this.rh-r*Math.cos(n)+this.y0;t.x=h;t.y=a;return t}function We(t){var i,s,e,r,n,h;t.x-=this.x0;t.y=this.rh-t.y+this.y0;if(this.ns0>=0){i=Math.sqrt(t.x*t.x+t.y*t.y);e=1}else{i=-Math.sqrt(t.x*t.x+t.y*t.y);e=-1}r=0;if(i!==0){r=Math.atan2(e*t.x,e*t.y)}e=i*this.ns0/this.a;if(this.sphere){h=Math.asin((this.c-e*e)/(2*this.ns0))}else{s=(this.c-e*e)/this.ns0;h=this.phi1z(this.e3,s)}n=gt(r/this.ns0+this.long0);t.x=n;t.y=h;return t}function Ge(t,i){var s,e,r,n,h;var a=Le(.5*i);if(t<A){return a}var o=t*t;for(var f=1;f<=25;f++){s=Math.sin(a);e=Math.cos(a);r=t*s;n=1-r*r;h=.5*n*n/e*(i/(1-o)-s/n+.5/t*Math.log((1-r)/(1+r)));a=a+h;if(Math.abs(h)<=1e-7){return a}}return null}var Ve=["Albers_Conic_Equal_Area","Albers","aea"];const je={init:De,forward:Fe,inverse:We,names:Ve,phi1z:Ge};function Ue(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1e3*this.a;this.rc=1}function Xe(t){var i,s;var e;var r;var n;var h;var a,o;var f=t.x;var u=t.y;e=gt(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=A){a=this.x0+this.a*n*s*Math.sin(e)/h;o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)/h}else{a=this.x0+this.infinity_dist*s*Math.sin(e);o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function qe(t){var i;var s,e;var r;var n,h;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(i=Math.sqrt(t.x*t.x+t.y*t.y)){r=Math.atan2(i,this.rc);s=Math.sin(r);e=Math.cos(r);h=Le(e*this.sin_p14+t.y*s*this.cos_p14/i);n=Math.atan2(t.x*s,i*this.cos_p14*e-t.y*this.sin_p14*s);n=gt(this.long0+n)}else{h=this.phic0;n=0}t.x=n;t.y=h;return t}var Ye=["gnom"];const Be={init:Ue,forward:Xe,inverse:qe,names:Ye};function He(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6){if(i<0){return-1*I}else{return I}}var e=Math.asin(.5*i);var r;var n;var h;var a;for(var o=0;o<30;o++){n=Math.sin(e);h=Math.cos(e);a=t*n;r=Math.pow(1-a*a,2)/(2*h)*(i/(1-t*t)-n/(1-a*a)+.5/t*Math.log((1-a)/(1+a)));e+=r;if(Math.abs(r)<=1e-10){return e}}return NaN}function Je(){if(!this.sphere){this.k0=Mt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}function Ze(t){var i=t.x;var s=t.y;var e,r;var n=gt(i-this.long0);if(this.sphere){e=this.x0+this.a*n*Math.cos(this.lat_ts);r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts)}else{var h=Me(this.e,Math.sin(s));e=this.x0+this.a*this.k0*n;r=this.y0+this.a*h*.5/this.k0}t.x=e;t.y=r;return t}function $e(t){t.x-=this.x0;t.y-=this.y0;var i,s;if(this.sphere){i=gt(this.long0+t.x/this.a/Math.cos(this.lat_ts));s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))}else{s=He(this.e,2*t.y*this.k0/this.a);i=gt(this.long0+t.x/(this.a*this.k0))}t.x=i;t.y=s;return t}var Ke=["cea"];const Qe={init:Je,forward:Ze,inverse:$e,names:Ke};function tr(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Equidistant Cylindrical (Plate Carre)";this.rc=Math.cos(this.lat_ts)}function ir(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r=le(s-this.lat0);t.x=this.x0+this.a*e*this.rc;t.y=this.y0+this.a*r;return t}function sr(t){var i=t.x;var s=t.y;t.x=gt(this.long0+(i-this.x0)/(this.a*this.rc));t.y=le(this.lat0+(s-this.y0)/this.a);return t}var er=["Equirectangular","Equidistant_Cylindrical","eqc"];const rr={init:tr,forward:ir,inverse:sr,names:er};var nr=20;function hr(){this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=he(this.es);this.e1=ae(this.es);this.e2=oe(this.es);this.e3=fe(this.es);this.ml0=this.a*ne(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ar(t){var i=t.x;var s=t.y;var e,r,n;var h=gt(i-this.long0);n=h*Math.sin(s);if(this.sphere){if(Math.abs(s)<=A){e=this.a*h;r=-1*this.a*this.lat0}else{e=this.a*Math.sin(n)/Math.tan(s);r=this.a*(le(s-this.lat0)+(1-Math.cos(n))/Math.tan(s))}}else{if(Math.abs(s)<=A){e=this.a*h;r=-1*this.ml0}else{var a=ue(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(n);r=this.a*ne(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(n))}}t.x=e+this.x0;t.y=r+this.y0;return t}function or(t){var i,s,e,r,n;var h,a;var o,f;e=t.x-this.x0;r=t.y-this.y0;if(this.sphere){if(Math.abs(r+this.a*this.lat0)<=A){i=gt(e/this.a+this.long0);s=0}else{h=this.lat0+r/this.a;a=e*e/this.a/this.a+h*h;o=h;var u;for(n=nr;n;--n){u=Math.tan(o);f=-1*(h*(o*u+1)-o-.5*(o*o+a)*u)/((o-h)/u-1);o+=f;if(Math.abs(f)<=A){s=o;break}}i=gt(this.long0+Math.asin(e*Math.tan(o)/this.a)/Math.sin(s))}}else{if(Math.abs(r+this.ml0)<=A){s=0;i=gt(this.long0+e/this.a)}else{h=(this.ml0+r)/this.a;a=e*e/this.a/this.a+h*h;o=h;var l,v,c,d;var m;for(n=nr;n;--n){m=this.e*Math.sin(o);l=Math.sqrt(1-m*m)*Math.tan(o);v=this.a*ne(this.e0,this.e1,this.e2,this.e3,o);c=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o);d=v/this.a;f=(h*(l*d+1)-d-.5*l*(d*d+a))/(this.es*Math.sin(2*o)*(d*d+a-2*h*d)/(4*l)+(h-d)*(l*c-2/Math.sin(2*o))-c);o-=f;if(Math.abs(f)<=A){s=o;break}}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s);i=gt(this.long0+Math.asin(e*l/this.a)/Math.sin(s))}}t.x=i;t.y=s;return t}var fr=["Polyconic","poly"];const ur={init:hr,forward:ar,inverse:or,names:fr};function lr(){this.A=[];this.A[1]=.6399175073;this.A[2]=-.1358797613;this.A[3]=.063294409;this.A[4]=-.02526853;this.A[5]=.0117879;this.A[6]=-.0055161;this.A[7]=.0026906;this.A[8]=-.001333;this.A[9]=67e-5;this.A[10]=-34e-5;this.B_re=[];this.B_im=[];this.B_re[1]=.7557853228;this.B_im[1]=0;this.B_re[2]=.249204646;this.B_im[2]=.003371507;this.B_re[3]=-.001541739;this.B_im[3]=.04105856;this.B_re[4]=-.10162907;this.B_im[4]=.01727609;this.B_re[5]=-.26623489;this.B_im[5]=-.36249218;this.B_re[6]=-.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-.577245789;this.C_im[2]=-.007809598;this.C_re[3]=.508307513;this.C_im[3]=-.112208952;this.C_re[4]=-.15094762;this.C_im[4]=.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=.5185406398;this.D[3]=-.03333098;this.D[4]=-.1052906;this.D[5]=-.0368594;this.D[6]=.007317;this.D[7]=.0122;this.D[8]=.00394;this.D[9]=-.0013}function vr(t){var i;var s=t.x;var e=t.y;var r=e-this.lat0;var n=s-this.long0;var h=r/N*1e-5;var a=n;var o=1;var f=0;for(i=1;i<=10;i++){o=o*h;f=f+this.A[i]*o}var u=f;var l=a;var v=1;var c=0;var d;var m;var p=0;var z=0;for(i=1;i<=6;i++){d=v*u-c*l;m=c*u+v*l;v=d;c=m;p=p+this.B_re[i]*v-this.B_im[i]*c;z=z+this.B_im[i]*v+this.B_re[i]*c}t.x=z*this.a+this.x0;t.y=p*this.a+this.y0;return t}function cr(t){var i;var s=t.x;var e=t.y;var r=s-this.x0;var n=e-this.y0;var h=n/this.a;var a=r/this.a;var o=1;var f=0;var u;var l;var v=0;var c=0;for(i=1;i<=6;i++){u=o*h-f*a;l=f*h+o*a;o=u;f=l;v=v+this.C_re[i]*o-this.C_im[i]*f;c=c+this.C_im[i]*o+this.C_re[i]*f}for(var d=0;d<this.iterations;d++){var m=v;var p=c;var z;var M;var _=h;var g=a;for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;_=_+(i-1)*(this.B_re[i]*m-this.B_im[i]*p);g=g+(i-1)*(this.B_im[i]*m+this.B_re[i]*p)}m=1;p=0;var b=this.B_re[1];var x=this.B_im[1];for(i=2;i<=6;i++){z=m*v-p*c;M=p*v+m*c;m=z;p=M;b=b+i*(this.B_re[i]*m-this.B_im[i]*p);x=x+i*(this.B_im[i]*m+this.B_re[i]*p)}var w=b*b+x*x;v=(_*b+g*x)/w;c=(g*b-_*x)/w}var y=v;var k=c;var E=1;var C=0;for(i=1;i<=9;i++){E=E*y;C=C+this.D[i]*E}var I=this.lat0+C*N*1e5;var S=this.long0+k;t.x=S;t.y=I;return t}var dr=["New_Zealand_Map_Grid","nzmg"];const mr={init:lr,forward:vr,inverse:cr,names:dr};function pr(){}function zr(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r=this.x0+this.a*e;var n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;t.x=r;t.y=n;return t}function Mr(t){t.x-=this.x0;t.y-=this.y0;var i=gt(this.long0+t.x/this.a);var s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);t.x=i;t.y=s;return t}var _r=["Miller_Cylindrical","mill"];const gr={init:pr,forward:zr,inverse:Mr,names:_r};var br=20;function xr(){if(!this.sphere){this.en=Hi(this.es)}else{this.n=1;this.m=0;this.es=0;this.C_y=Math.sqrt((this.m+1)/this.n);this.C_x=this.C_y/(this.m+1)}}function wr(t){var i,s;var e=t.x;var r=t.y;e=gt(e-this.long0);if(this.sphere){if(!this.m){r=this.n!==1?Math.asin(this.n*Math.sin(r)):r}else{var n=this.n*Math.sin(r);for(var h=br;h;--h){var a=(this.m*r+Math.sin(r)-n)/(this.m+Math.cos(r));r-=a;if(Math.abs(a)<A){break}}}i=this.a*this.C_x*e*(this.m+Math.cos(r));s=this.a*this.C_y*r}else{var o=Math.sin(r);var f=Math.cos(r);s=this.a*Ji(r,o,f,this.en);i=this.a*e*f/Math.sqrt(1-this.es*o*o)}t.x=i;t.y=s;return t}function yr(t){var i,s,e,r;t.x-=this.x0;e=t.x/this.a;t.y-=this.y0;i=t.y/this.a;if(this.sphere){i/=this.C_y;e=e/(this.C_x*(this.m+Math.cos(i)));if(this.m){i=Le((this.m*i+Math.sin(i))/this.n)}else if(this.n!==1){i=Le(Math.sin(i)/this.n)}e=gt(e+this.long0);i=le(i)}else{i=$i(t.y/this.a,this.es,this.en);r=Math.abs(i);if(r<I){r=Math.sin(i);s=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(i));e=gt(s)}else if(r-A<I){e=this.long0}}t.x=e;t.y=i;return t}var kr=["Sinusoidal","sinu"];const Er={init:xr,forward:wr,inverse:yr,names:kr};function Cr(){}function Nr(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r=s;var n=Math.PI*Math.sin(s);while(true){var h=-(r+Math.sin(r)-n)/(1+Math.cos(r));r+=h;if(Math.abs(h)<A){break}}r/=2;if(Math.PI/2-Math.abs(s)<A){e=0}var a=.900316316158*this.a*e*Math.cos(r)+this.x0;var o=1.4142135623731*this.a*Math.sin(r)+this.y0;t.x=a;t.y=o;return t}function Ir(t){var i;var s;t.x-=this.x0;t.y-=this.y0;s=t.y/(1.4142135623731*this.a);if(Math.abs(s)>.999999999999){s=.999999999999}i=Math.asin(s);var e=gt(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));if(e<-Math.PI){e=-Math.PI}if(e>Math.PI){e=Math.PI}s=(2*i+Math.sin(2*i))/Math.PI;if(Math.abs(s)>1){s=1}var r=Math.asin(s);t.x=e;t.y=r;return t}var Sr=["Mollweide","moll"];const Or={init:Cr,forward:Nr,inverse:Ir,names:Sr};function Tr(){if(Math.abs(this.lat1+this.lat2)<A){return}this.lat2=this.lat2||this.lat1;this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=he(this.es);this.e1=ae(this.es);this.e2=oe(this.es);this.e3=fe(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Mt(this.e,this.sinphi,this.cosphi);this.ml1=ne(this.e0,this.e1,this.e2,this.e3,this.lat1);if(Math.abs(this.lat1-this.lat2)<A){this.ns=this.sinphi}else{this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=Mt(this.e,this.sinphi,this.cosphi);this.ml2=ne(this.e0,this.e1,this.e2,this.e3,this.lat2);this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}this.g=this.ml1+this.ms1/this.ns;this.ml0=ne(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)}function Ar(t){var i=t.x;var s=t.y;var e;if(this.sphere){e=this.a*(this.g-s)}else{var r=ne(this.e0,this.e1,this.e2,this.e3,s);e=this.a*(this.g-r)}var n=this.ns*gt(i-this.long0);var h=this.x0+e*Math.sin(n);var a=this.y0+this.rh-e*Math.cos(n);t.x=h;t.y=a;return t}function Rr(t){t.x-=this.x0;t.y=this.rh-t.y+this.y0;var i,s,e,r;if(this.ns>=0){s=Math.sqrt(t.x*t.x+t.y*t.y);i=1}else{s=-Math.sqrt(t.x*t.x+t.y*t.y);i=-1}var n=0;if(s!==0){n=Math.atan2(i*t.x,i*t.y)}if(this.sphere){r=gt(this.long0+n/this.ns);e=le(this.g-s/this.a);t.x=r;t.y=e;return t}else{var h=this.g-s/this.a;e=ve(h,this.e0,this.e1,this.e2,this.e3);r=gt(this.long0+n/this.ns);t.x=r;t.y=e;return t}}var Pr=["Equidistant_Conic","eqdc"];const Lr={init:Tr,forward:Ar,inverse:Rr,names:Pr};function Dr(){this.R=this.a}function Fr(t){var i=t.x;var s=t.y;var e=gt(i-this.long0);var r,n;if(Math.abs(s)<=A){r=this.x0+this.R*e;n=this.y0}var h=Le(2*Math.abs(s/Math.PI));if(Math.abs(e)<=A||Math.abs(Math.abs(s)-I)<=A){r=this.x0;if(s>=0){n=this.y0+Math.PI*this.R*Math.tan(.5*h)}else{n=this.y0+Math.PI*this.R*-Math.tan(.5*h)}}var a=.5*Math.abs(Math.PI/e-e/Math.PI);var o=a*a;var f=Math.sin(h);var u=Math.cos(h);var l=u/(f+u-1);var v=l*l;var c=l*(2/f-1);var d=c*c;var m=Math.PI*this.R*(a*(l-d)+Math.sqrt(o*(l-d)*(l-d)-(d+o)*(v-d)))/(d+o);if(e<0){m=-m}r=this.x0+m;var p=o+l;m=Math.PI*this.R*(c*p-a*Math.sqrt((d+o)*(o+1)-p*p))/(d+o);if(s>=0){n=this.y0+m}else{n=this.y0-m}t.x=r;t.y=n;return t}function Wr(t){var i,s;var e,r,n,h,a,o;var f;var u;var l;var v;var c;t.x-=this.x0;t.y-=this.y0;l=Math.PI*this.R;e=t.x/l;r=t.y/l;n=e*e+r*r;h=-Math.abs(r)*(1+n);a=h-2*r*r+e*e;o=-2*h+1+2*r*r+n*n;c=r*r/o+(2*a*a*a/o/o/o-9*h*a/o/o)/27;f=(h-a*a/3/o)/o;u=2*Math.sqrt(-f/3);l=3*c/f/u;if(Math.abs(l)>1){if(l>=0){l=1}else{l=-1}}v=Math.acos(l)/3;if(t.y>=0){s=(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}else{s=-(-u*Math.cos(v+Math.PI/3)-a/3/o)*Math.PI}if(Math.abs(e)<A){i=this.long0}else{i=gt(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(e*e-r*r)+n*n))/2/e)}t.x=i;t.y=s;return t}var Gr=["Van_der_Grinten_I","VanDerGrinten","vandg"];const Vr={init:Dr,forward:Fr,inverse:Wr,names:Gr};function jr(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)}function Ur(t){var i=t.x;var s=t.y;var e=Math.sin(t.y);var r=Math.cos(t.y);var n=gt(i-this.long0);var h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,w,y,k,E,C,N;if(this.sphere){if(Math.abs(this.sin_p12-1)<=A){t.x=this.x0+this.a*(I-s)*Math.sin(n);t.y=this.y0-this.a*(I-s)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=A){t.x=this.x0+this.a*(I+s)*Math.sin(n);t.y=this.y0+this.a*(I+s)*Math.cos(n);return t}else{w=this.sin_p12*e+this.cos_p12*r*Math.cos(n);b=Math.acos(w);x=b/Math.sin(b);t.x=this.x0+this.a*x*r*Math.sin(n);t.y=this.y0+this.a*x*(this.cos_p12*e-this.sin_p12*r*Math.cos(n));return t}}else{h=he(this.es);a=ae(this.es);o=oe(this.es);f=fe(this.es);if(Math.abs(this.sin_p12-1)<=A){u=this.a*ne(h,a,o,f,I);l=this.a*ne(h,a,o,f,s);t.x=this.x0+(u-l)*Math.sin(n);t.y=this.y0-(u-l)*Math.cos(n);return t}else if(Math.abs(this.sin_p12+1)<=A){u=this.a*ne(h,a,o,f,I);l=this.a*ne(h,a,o,f,s);t.x=this.x0+(u+l)*Math.sin(n);t.y=this.y0+(u+l)*Math.cos(n);return t}else{v=e/r;c=ue(this.a,this.e,this.sin_p12);d=ue(this.a,this.e,e);m=Math.atan((1-this.es)*v+this.es*c*this.sin_p12/(d*r));p=Math.atan2(Math.sin(n),this.cos_p12*Math.tan(m)-this.sin_p12*Math.cos(n));if(p===0){y=Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else if(Math.abs(Math.abs(p)-Math.PI)<=A){y=-Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m))}else{y=Math.asin(Math.sin(n)*Math.cos(m)/Math.sin(p))}z=this.e*this.sin_p12/Math.sqrt(1-this.es);M=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es);_=z*M;g=M*M;k=y*y;E=k*y;C=E*y;N=C*y;b=c*y*(1-k*g*(1-g)/6+E/8*_*(1-2*g)+C/120*(g*(4-7*g)-3*z*z*(1-7*g))-N/48*_);t.x=this.x0+b*Math.sin(p);t.y=this.y0+b*Math.cos(p);return t}}}function Xr(t){t.x-=this.x0;t.y-=this.y0;var i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z,M,_,g,b,x,w;if(this.sphere){i=Math.sqrt(t.x*t.x+t.y*t.y);if(i>2*I*this.a){return}s=i/this.a;e=Math.sin(s);r=Math.cos(s);n=this.long0;if(Math.abs(i)<=A){h=this.lat0}else{h=Le(r*this.sin_p12+t.y*e*this.cos_p12/i);a=Math.abs(this.lat0)-I;if(Math.abs(a)<=A){if(this.lat0>=0){n=gt(this.long0+Math.atan2(t.x,-t.y))}else{n=gt(this.long0-Math.atan2(-t.x,t.y))}}else{n=gt(this.long0+Math.atan2(t.x*e,i*this.cos_p12*r-t.y*this.sin_p12*e))}}t.x=n;t.y=h;return t}else{o=he(this.es);f=ae(this.es);u=oe(this.es);l=fe(this.es);if(Math.abs(this.sin_p12-1)<=A){v=this.a*ne(o,f,u,l,I);i=Math.sqrt(t.x*t.x+t.y*t.y);c=v-i;h=ve(c/this.a,o,f,u,l);n=gt(this.long0+Math.atan2(t.x,-1*t.y));t.x=n;t.y=h;return t}else if(Math.abs(this.sin_p12+1)<=A){v=this.a*ne(o,f,u,l,I);i=Math.sqrt(t.x*t.x+t.y*t.y);c=i-v;h=ve(c/this.a,o,f,u,l);n=gt(this.long0+Math.atan2(t.x,t.y));t.x=n;t.y=h;return t}else{i=Math.sqrt(t.x*t.x+t.y*t.y);p=Math.atan2(t.x,t.y);d=ue(this.a,this.e,this.sin_p12);z=Math.cos(p);M=this.e*this.cos_p12*z;_=-M*M/(1-this.es);g=3*this.es*(1-_)*this.sin_p12*this.cos_p12*z/(1-this.es);b=i/d;x=b-_*(1+_)*Math.pow(b,3)/6-g*(1+3*_)*Math.pow(b,4)/24;w=1-_*x*x/2-b*x*x*x/6;m=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*z);n=gt(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(m)));h=Math.atan((1-this.es*w*this.sin_p12/Math.sin(m))*Math.tan(m)/(1-this.es));t.x=n;t.y=h;return t}}}var qr=["Azimuthal_Equidistant","aeqd"];const Yr={init:jr,forward:Ur,inverse:Xr,names:qr};function Br(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)}function Hr(t){var i,s;var e;var r;var n;var h,a,o;var f=t.x;var u=t.y;e=gt(f-this.long0);i=Math.sin(u);s=Math.cos(u);r=Math.cos(e);h=this.sin_p14*i+this.cos_p14*s*r;n=1;if(h>0||Math.abs(h)<=A){a=this.a*n*s*Math.sin(e);o=this.y0+this.a*n*(this.cos_p14*i-this.sin_p14*s*r)}t.x=a;t.y=o;return t}function Jr(t){var i;var s;var e,r;var n;var h,a;t.x-=this.x0;t.y-=this.y0;i=Math.sqrt(t.x*t.x+t.y*t.y);s=Le(i/this.a);e=Math.sin(s);r=Math.cos(s);h=this.long0;if(Math.abs(i)<=A){a=this.lat0;t.x=h;t.y=a;return t}a=Le(r*this.sin_p14+t.y*e*this.cos_p14/i);n=Math.abs(this.lat0)-I;if(Math.abs(n)<=A){if(this.lat0>=0){h=gt(this.long0+Math.atan2(t.x,-t.y))}else{h=gt(this.long0-Math.atan2(-t.x,t.y))}t.x=h;t.y=a;return t}h=gt(this.long0+Math.atan2(t.x*e,i*this.cos_p14*r-t.y*this.sin_p14*e));t.x=h;t.y=a;return t}var Zr=["ortho"];const $r={init:Br,forward:Hr,inverse:Jr,names:Zr};var Kr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6};var Qr={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function tn(){this.x0=this.x0||0;this.y0=this.y0||0;this.lat0=this.lat0||0;this.long0=this.long0||0;this.lat_ts=this.lat_ts||0;this.title=this.title||"Quadrilateralized Spherical Cube";if(this.lat0>=I-L/2){this.face=Kr.TOP}else if(this.lat0<=-(I-L/2)){this.face=Kr.BOTTOM}else if(Math.abs(this.long0)<=L){this.face=Kr.FRONT}else if(Math.abs(this.long0)<=I+L){this.face=this.long0>0?Kr.RIGHT:Kr.LEFT}else{this.face=Kr.BACK}if(this.es!==0){this.one_minus_f=1-(this.a-this.b)/this.a;this.one_minus_f_squared=this.one_minus_f*this.one_minus_f}}function sn(t){var i={x:0,y:0};var s,e;var r,n;var h,a;var o={value:0};t.x-=this.long0;if(this.es!==0){s=Math.atan(this.one_minus_f_squared*Math.tan(t.y))}else{s=t.y}e=t.x;if(this.face===Kr.TOP){n=I-s;if(e>=L&&e<=I+L){o.value=Qr.AREA_0;r=e-I}else if(e>I+L||e<=-(I+L)){o.value=Qr.AREA_1;r=e>0?e-F:e+F}else if(e>-(I+L)&&e<=-L){o.value=Qr.AREA_2;r=e+I}else{o.value=Qr.AREA_3;r=e}}else if(this.face===Kr.BOTTOM){n=I+s;if(e>=L&&e<=I+L){o.value=Qr.AREA_0;r=-e+I}else if(e<L&&e>=-L){o.value=Qr.AREA_1;r=-e}else if(e<-L&&e>=-(I+L)){o.value=Qr.AREA_2;r=-e-I}else{o.value=Qr.AREA_3;r=e>0?-e+F:-e-F}}else{var f,u,l;var v,c;var d,m;if(this.face===Kr.RIGHT){e=nn(e,+I)}else if(this.face===Kr.BACK){e=nn(e,+F)}else if(this.face===Kr.LEFT){e=nn(e,-I)}v=Math.sin(s);c=Math.cos(s);d=Math.sin(e);m=Math.cos(e);f=c*m;u=c*d;l=v;if(this.face===Kr.FRONT){n=Math.acos(f);r=rn(n,l,u,o)}else if(this.face===Kr.RIGHT){n=Math.acos(u);r=rn(n,l,-f,o)}else if(this.face===Kr.BACK){n=Math.acos(-f);r=rn(n,l,-u,o)}else if(this.face===Kr.LEFT){n=Math.acos(-u);r=rn(n,l,f,o)}else{n=r=0;o.value=Qr.AREA_0}}a=Math.atan(12/F*(r+Math.acos(Math.sin(r)*Math.cos(L))-I));h=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r)))));if(o.value===Qr.AREA_1){a+=I}else if(o.value===Qr.AREA_2){a+=F}else if(o.value===Qr.AREA_3){a+=1.5*F}i.x=h*Math.cos(a);i.y=h*Math.sin(a);i.x=i.x*this.a+this.x0;i.y=i.y*this.a+this.y0;t.x=i.x;t.y=i.y;return t}function en(t){var i={lam:0,phi:0};var s,e,r,n;var h,a,o,f;var u;var l={value:0};t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;e=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y));s=Math.atan2(t.y,t.x);if(t.x>=0&&t.x>=Math.abs(t.y)){l.value=Qr.AREA_0}else if(t.y>=0&&t.y>=Math.abs(t.x)){l.value=Qr.AREA_1;s-=I}else if(t.x<0&&-t.x>=Math.abs(t.y)){l.value=Qr.AREA_2;s=s<0?s+F:s-F}else{l.value=Qr.AREA_3;s+=I}u=F/12*Math.tan(s);h=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2));a=Math.atan(h);r=Math.cos(s);n=Math.tan(e);o=1-r*r*n*n*(1-Math.cos(Math.atan(1/Math.cos(a))));if(o<-1){o=-1}else if(o>+1){o=+1}if(this.face===Kr.TOP){f=Math.acos(o);i.phi=I-f;if(l.value===Qr.AREA_0){i.lam=a+I}else if(l.value===Qr.AREA_1){i.lam=a<0?a+F:a-F}else if(l.value===Qr.AREA_2){i.lam=a-I}else{i.lam=a}}else if(this.face===Kr.BOTTOM){f=Math.acos(o);i.phi=f-I;if(l.value===Qr.AREA_0){i.lam=-a+I}else if(l.value===Qr.AREA_1){i.lam=-a}else if(l.value===Qr.AREA_2){i.lam=-a-I}else{i.lam=a<0?-a-F:-a+F}}else{var v,c,d;v=o;u=v*v;if(u>=1){d=0}else{d=Math.sqrt(1-u)*Math.sin(a)}u+=d*d;if(u>=1){c=0}else{c=Math.sqrt(1-u)}if(l.value===Qr.AREA_1){u=c;c=-d;d=u}else if(l.value===Qr.AREA_2){c=-c;d=-d}else if(l.value===Qr.AREA_3){u=c;c=d;d=-u}if(this.face===Kr.RIGHT){u=v;v=-c;c=u}else if(this.face===Kr.BACK){v=-v;c=-c}else if(this.face===Kr.LEFT){u=v;v=c;c=-u}i.phi=Math.acos(-d)-I;i.lam=Math.atan2(c,v);if(this.face===Kr.RIGHT){i.lam=nn(i.lam,-I)}else if(this.face===Kr.BACK){i.lam=nn(i.lam,-F)}else if(this.face===Kr.LEFT){i.lam=nn(i.lam,+I)}}if(this.es!==0){var m;var p,z;m=i.phi<0?1:0;p=Math.tan(i.phi);z=this.b/Math.sqrt(p*p+this.one_minus_f_squared);i.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z));if(m){i.phi=-i.phi}}i.lam+=this.long0;t.x=i.lam;t.y=i.phi;return t}function rn(t,i,s,e){var r;if(t<A){e.value=Qr.AREA_0;r=0}else{r=Math.atan2(i,s);if(Math.abs(r)<=L){e.value=Qr.AREA_0}else if(r>L&&r<=I+L){e.value=Qr.AREA_1;r-=I}else if(r>I+L||r<=-(I+L)){e.value=Qr.AREA_2;r=r>=0?r-F:r+F}else{e.value=Qr.AREA_3;r+=I}}return r}function nn(t,i){var s=t+i;if(s<-F){s+=D}else if(s>+F){s-=D}return s}var hn=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const an={init:tn,forward:sn,inverse:en,names:hn};function on(t){t.Proj.projections.add(ss);t.Proj.projections.add(ms);t.Proj.projections.add(gs);t.Proj.projections.add(Ts);t.Proj.projections.add(Fs);t.Proj.projections.add(Us);t.Proj.projections.add(Hs);t.Proj.projections.add(Qs);t.Proj.projections.add(re);t.Proj.projections.add(ze);t.Proj.projections.add(Pe);t.Proj.projections.add(je);t.Proj.projections.add(Be);t.Proj.projections.add(Qe);t.Proj.projections.add(rr);t.Proj.projections.add(ur);t.Proj.projections.add(mr);t.Proj.projections.add(gr);t.Proj.projections.add(Er);t.Proj.projections.add(Or);t.Proj.projections.add(Lr);t.Proj.projections.add(Vr);t.Proj.projections.add(Yr);t.Proj.projections.add($r);t.Proj.projections.add(an)}oi.defaultDatum="WGS84";oi.Proj=qt;oi.WGS84=new oi.Proj("WGS84");oi.Point=Ri;oi.toPoint=ti;oi.defs=ut;oi.transform=ri;oi.mgrs=zi;oi.version=Pi;on(oi);var fn={};fn.ASSUME_TOUCH=false;fn.DEFAULT_MAX_ZOOM=42;fn.DEFAULT_MIN_ZOOM=0;fn.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD=.5;fn.DEFAULT_TILE_SIZE=256;fn.DEFAULT_WMS_VERSION="1.3.0";fn.ENABLE_CANVAS=true;fn.ENABLE_PROJ4JS=true;fn.ENABLE_RASTER_REPROJECTION=true;fn.ENABLE_WEBGL=true;fn.DEBUG_WEBGL=true;fn.INITIAL_ATLAS_SIZE=256;fn.MAX_ATLAS_SIZE=-1;fn.MOUSEWHEELZOOM_MAXDELTA=1;fn.OVERVIEWMAP_MAX_RATIO=.75;fn.OVERVIEWMAP_MIN_RATIO=.1;fn.RASTER_REPROJECTION_MAX_SOURCE_TILES=100;fn.RASTER_REPROJECTION_MAX_SUBDIVISION=10;fn.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH=.25;fn.SIMPLIFY_TOLERANCE=.5;fn.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024;fn.VERSION="v4.6.5";fn.inherits=function(t,i){t.prototype=Object.create(i.prototype);t.prototype.constructor=t};fn.nullFunction=function(){};fn.getUid=function(t){return t.ol_uid||(t.ol_uid=++fn.uidCounter_)};fn.uidCounter_=0;var un={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};var ln={PROPERTYCHANGE:"propertychange"};var vn={};vn.assign=typeof Object.assign==="function"?Object.assign:function(t,i){if(t===undefined||t===null){throw new TypeError("Cannot convert undefined or null to object")}var s=Object(t);for(var e=1,r=arguments.length;e<r;++e){var n=arguments[e];if(n!==undefined&&n!==null){for(var h in n){if(n.hasOwnProperty(h)){s[h]=n[h]}}}}return s};vn.clear=function(t){for(var i in t){delete t[i]}};vn.getValues=function(t){var i=[];for(var s in t){i.push(t[s])}return i};vn.isEmpty=function(t){var i;for(i in t){return false}return!i};var cn={};cn.bindListener_=function(t){var i=function(i){var s=t.listener;var e=t.bindTo||t.target;if(t.callOnce){cn.unlistenByKey(t)}return s.call(e,i)};t.boundListener=i;return i};cn.findListener_=function(t,i,s,e){var r;for(var n=0,h=t.length;n<h;++n){r=t[n];if(r.listener===i&&r.bindTo===s){if(e){r.deleteIndex=n}return r}}return undefined};cn.getListeners=function(t,i){var s=t.ol_lm;return s?s[i]:undefined};cn.getListenerMap_=function(t){var i=t.ol_lm;if(!i){i=t.ol_lm={}}return i};cn.removeListeners_=function(t,i){var s=cn.getListeners(t,i);if(s){for(var e=0,r=s.length;e<r;++e){t.removeEventListener(i,s[e].boundListener);vn.clear(s[e])}s.length=0;var n=t.ol_lm;if(n){delete n[i];if(Object.keys(n).length===0){delete t.ol_lm}}}};cn.listen=function(t,i,s,e,r){var n=cn.getListenerMap_(t);var h=n[i];if(!h){h=n[i]=[]}var a=cn.findListener_(h,s,e,false);if(a){if(!r){a.callOnce=false}}else{a={bindTo:e,callOnce:!!r,listener:s,target:t,type:i};t.addEventListener(i,cn.bindListener_(a));h.push(a)}return a};cn.listenOnce=function(t,i,s,e){return cn.listen(t,i,s,e,true)};cn.unlisten=function(t,i,s,e){var r=cn.getListeners(t,i);if(r){var n=cn.findListener_(r,s,e,true);if(n){cn.unlistenByKey(n)}}};cn.unlistenByKey=function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=cn.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);if(s!==-1){i.splice(s,1)}if(i.length===0){cn.removeListeners_(t.target,t.type)}}vn.clear(t)}};cn.unlistenAll=function(t){var i=cn.getListenerMap_(t);for(var s in i){cn.removeListeners_(t,s)}};var dn=function(){};dn.prototype.disposed_=false;dn.prototype.dispose=function(){if(!this.disposed_){this.disposed_=true;this.disposeInternal()}};dn.prototype.disposeInternal=fn.nullFunction;var mn=function(t){this.type=t;this.target=null};mn.prototype.preventDefault=mn.prototype.stopPropagation=function(){this.propagationStopped=true};mn.stopPropagation=function(t){t.stopPropagation()};mn.preventDefault=function(t){t.preventDefault()};var pn=function(){dn.call(this);this.pendingRemovals_={};this.dispatching_={};this.listeners_={}};fn.inherits(pn,dn);pn.prototype.addEventListener=function(t,i){var s=this.listeners_[t];if(!s){s=this.listeners_[t]=[]}if(s.indexOf(i)===-1){s.push(i)}};pn.prototype.dispatchEvent=function(t){var i=typeof t==="string"?new mn(t):t;var s=i.type;i.target=this;var e=this.listeners_[s];var r;if(e){if(!(s in this.dispatching_)){this.dispatching_[s]=0;this.pendingRemovals_[s]=0}++this.dispatching_[s];for(var n=0,h=e.length;n<h;++n){if(e[n].call(this,i)===false||i.propagationStopped){r=false;break}}--this.dispatching_[s];if(this.dispatching_[s]===0){var a=this.pendingRemovals_[s];delete this.pendingRemovals_[s];while(a--){this.removeEventListener(s,fn.nullFunction)}delete this.dispatching_[s]}return r}};pn.prototype.disposeInternal=function(){cn.unlistenAll(this)};pn.prototype.getListeners=function(t){return this.listeners_[t]};pn.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0};pn.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var e=s.indexOf(i);if(t in this.pendingRemovals_){s[e]=fn.nullFunction;++this.pendingRemovals_[t]}else{s.splice(e,1);if(s.length===0){delete this.listeners_[t]}}}};var zn={CHANGE:"change",CLEAR:"clear",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"};var Mn=function(){pn.call(this);this.revision_=0};fn.inherits(Mn,pn);Mn.unByKey=function(t){if(Array.isArray(t)){for(var i=0,s=t.length;i<s;++i){cn.unlistenByKey(t[i])}}else{cn.unlistenByKey(t)}};Mn.prototype.changed=function(){++this.revision_;this.dispatchEvent(zn.CHANGE)};Mn.prototype.getRevision=function(){return this.revision_};Mn.prototype.on=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=cn.listen(this,t[n],i,s)}return r}else{return cn.listen(this,t,i,s)}};Mn.prototype.once=function(t,i,s){if(Array.isArray(t)){var e=t.length;var r=new Array(e);for(var n=0;n<e;++n){r[n]=cn.listenOnce(this,t[n],i,s)}return r}else{return cn.listenOnce(this,t,i,s)}};Mn.prototype.un=function(t,i,s){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;++e){cn.unlisten(this,t[e],i,s)}return}else{cn.unlisten(this,t,i,s)}};var _n=function(t){Mn.call(this);fn.getUid(this);this.values_={};if(t!==undefined){this.setProperties(t)}};fn.inherits(_n,Mn);_n.changeEventTypeCache_={};_n.getChangeEventType=function(t){return _n.changeEventTypeCache_.hasOwnProperty(t)?_n.changeEventTypeCache_[t]:_n.changeEventTypeCache_[t]="change:"+t};_n.prototype.get=function(t){var i;if(this.values_.hasOwnProperty(t)){i=this.values_[t]}return i};_n.prototype.getKeys=function(){return Object.keys(this.values_)};_n.prototype.getProperties=function(){return vn.assign({},this.values_)};_n.prototype.notify=function(t,i){var s;s=_n.getChangeEventType(t);this.dispatchEvent(new _n.Event(s,t,i));s=ln.PROPERTYCHANGE;this.dispatchEvent(new _n.Event(s,t,i))};_n.prototype.set=function(t,i,s){if(s){this.values_[t]=i}else{var e=this.values_[t];this.values_[t]=i;if(e!==i){this.notify(t,e)}}};_n.prototype.setProperties=function(t,i){var s;for(s in t){this.set(s,t[s],i)}};_n.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t];if(!i){this.notify(t,s)}}};_n.Event=function(t,i,s){mn.call(this,t);this.key=i;this.oldValue=s};fn.inherits(_n.Event,mn);var gn=function(t){var i=fn.VERSION?fn.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.";this.code=t;this.name="AssertionError"};fn.inherits(gn,Error);var bn={};bn.assert=function(t,i){if(!t){throw new gn(i)}};var xn={};xn.clamp=function(t,i,s){return Math.min(Math.max(t,i),s)};xn.cosh=function(){var t;if("cosh"in Math){t=Math.cosh}else{t=function(t){var i=Math.exp(t);return(i+1/i)/2}}return t}();xn.roundUpToPowerOfTwo=function(t){bn.assert(0<t,29);return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))};xn.squaredSegmentDistance=function(t,i,s,e,r,n){var h=r-s;var a=n-e;if(h!==0||a!==0){var o=((t-s)*h+(i-e)*a)/(h*h+a*a);if(o>1){s=r;e=n}else if(o>0){s+=h*o;e+=a*o}}return xn.squaredDistance(t,i,s,e)};xn.squaredDistance=function(t,i,s,e){var r=s-t;var n=e-i;return r*r+n*n};xn.solveLinearSystem=function(t){var i=t.length;for(var s=0;s<i;s++){var e=s;var r=Math.abs(t[s][s]);for(var n=s+1;n<i;n++){var h=Math.abs(t[n][s]);if(h>r){r=h;e=n}}if(r===0){return null}var a=t[e];t[e]=t[s];t[s]=a;for(var o=s+1;o<i;o++){var f=-t[o][s]/t[s][s];for(var u=s;u<i+1;u++){if(s==u){t[o][u]=0}else{t[o][u]+=f*t[s][u]}}}}var l=new Array(i);for(var v=i-1;v>=0;v--){l[v]=t[v][i]/t[v][v];for(var c=v-1;c>=0;c--){t[c][i]-=t[c][v]*l[v]}}return l};xn.toDegrees=function(t){return t*180/Math.PI};xn.toRadians=function(t){return t*Math.PI/180};xn.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s};xn.lerp=function(t,i,s){return t+s*(i-t)};var wn={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Latitude/longitude spherical geodesy formulae taken from
|
|
5
5
|
* http://www.movable-type.co.uk/scripts/latlong.html
|
|
6
6
|
* Licensed under CC-BY-3.0.
|
|
7
|
-
*/var wn=function(t){this.radius=t};wn.prototype.geodesicArea=function(t){return wn.getArea_(t,this.radius)};wn.prototype.haversineDistance=function(t,i){return wn.getDistance_(t,i,this.radius)};wn.prototype.offset=function(t,i,s){var e=xn.toRadians(t[1]);var r=xn.toRadians(t[0]);var n=i/this.radius;var h=Math.asin(Math.sin(e)*Math.cos(n)+Math.cos(e)*Math.sin(n)*Math.cos(s));var a=r+Math.atan2(Math.sin(s)*Math.sin(n)*Math.cos(e),Math.cos(n)-Math.sin(e)*Math.sin(h));return[xn.toDegrees(a),xn.toDegrees(h)]};wn.DEFAULT_RADIUS=6371008.8;wn.getLength=function(t,i){var s=i||{};var e=s.radius||wn.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,l,v;switch(n){case yn.POINT:case yn.MULTI_POINT:{break}case yn.LINE_STRING:case yn.LINEAR_RING:{a=t.getCoordinates();h=wn.getLength_(a,e);break}case yn.MULTI_LINE_STRING:case yn.POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){h+=wn.getLength_(a[f],e)}break}case yn.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];for(l=0,v=o.length;l<v;++l){h+=wn.getLength_(o[l],e)}}break}case yn.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=wn.getLength(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};wn.getLength_=function(t,i){var s=0;for(var e=0,r=t.length;e<r-1;++e){s+=wn.getDistance_(t[e],t[e+1],i)}return s};wn.getDistance_=function(t,i,s){var e=xn.toRadians(t[1]);var r=xn.toRadians(i[1]);var n=(r-e)/2;var h=xn.toRadians(i[0]-t[0])/2;var a=Math.sin(n)*Math.sin(n)+Math.sin(h)*Math.sin(h)*Math.cos(e)*Math.cos(r);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))};wn.getArea=function(t,i){var s=i||{};var e=s.radius||wn.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,l,v;switch(n){case yn.POINT:case yn.MULTI_POINT:case yn.LINE_STRING:case yn.MULTI_LINE_STRING:case yn.LINEAR_RING:{break}case yn.POLYGON:{a=t.getCoordinates();h=Math.abs(wn.getArea_(a[0],e));for(f=1,u=a.length;f<u;++f){h-=Math.abs(wn.getArea_(a[f],e))}break}case yn.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];h+=Math.abs(wn.getArea_(o[0],e));for(l=1,v=o.length;l<v;++l){h-=Math.abs(wn.getArea_(o[l],e))}}break}case yn.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=wn.getArea(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};wn.getArea_=function(t,i){var s=0,e=t.length;var r=t[e-1][0];var n=t[e-1][1];for(var h=0;h<e;h++){var a=t[h][0],o=t[h][1];s+=xn.toRadians(a-r)*(2+Math.sin(xn.toRadians(n))+Math.sin(xn.toRadians(o)));r=a;n=o}return s*i*i/2};var kn={};kn.binarySearch=function(t,i,s){var e,r;var n=s||kn.numberSafeCompareFunction;var h=0;var a=t.length;var o=false;while(h<a){e=h+(a-h>>1);r=+n(t[e],i);if(r<0){h=e+1}else{a=e;o=!r}}return o?h:~h};kn.numberSafeCompareFunction=function(t,i){return t>i?1:t<i?-1:0};kn.includes=function(t,i){return t.indexOf(i)>=0};kn.linearFindNearest=function(t,i,s){var e=t.length;if(t[0]<=i){return 0}else if(i<=t[e-1]){return e-1}else{var r;if(s>0){for(r=1;r<e;++r){if(t[r]<i){return r-1}}}else if(s<0){for(r=1;r<e;++r){if(t[r]<=i){return r}}}else{for(r=1;r<e;++r){if(t[r]==i){return r}else if(t[r]<i){if(t[r-1]-i<i-t[r]){return r-1}else{return r}}}}return e-1}};kn.reverseSubArray=function(t,i,s){while(i<s){var e=t[i];t[i]=t[s];t[s]=e;++i;--s}};kn.extend=function(t,i){var s;var e=Array.isArray(i)?i:[i];var r=e.length;for(s=0;s<r;s++){t[t.length]=e[s]}};kn.remove=function(t,i){var s=t.indexOf(i);var e=s>-1;if(e){t.splice(s,1)}return e};kn.find=function(t,i){var s=t.length>>>0;var e;for(var r=0;r<s;r++){e=t[r];if(i(e,r,t)){return e}}return null};kn.equals=function(t,i){var s=t.length;if(s!==i.length){return false}for(var e=0;e<s;e++){if(t[e]!==i[e]){return false}}return true};kn.stableSort=function(t,i){var s=t.length;var e=Array(t.length);var r;for(r=0;r<s;r++){e[r]={index:r,value:t[r]}}e.sort((function(t,s){return i(t.value,s.value)||t.index-s.index}));for(r=0;r<t.length;r++){t[r]=e[r].value}};kn.findIndex=function(t,i){var s;var e=!t.every((function(e,r){s=r;return!i(e,r,t)}));return e?s:-1};kn.isSorted=function(t,i,s){var e=i||kn.numberSafeCompareFunction;return t.every((function(i,r){if(r===0){return true}var n=e(t[r-1],i);return!(n>0||s&&n===0)}))};var En={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Cn={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};var Nn={};Nn.boundingExtent=function(t){var i=Nn.createEmpty();for(var s=0,e=t.length;s<e;++s){Nn.extendCoordinate(i,t[s])}return i};Nn.boundingExtentXYs_=function(t,i,s){var e=Math.min.apply(null,t);var r=Math.min.apply(null,i);var n=Math.max.apply(null,t);var h=Math.max.apply(null,i);return Nn.createOrUpdate(e,r,n,h,s)};Nn.buffer=function(t,i,s){if(s){s[0]=t[0]-i;s[1]=t[1]-i;s[2]=t[2]+i;s[3]=t[3]+i;return s}else{return[t[0]-i,t[1]-i,t[2]+i,t[3]+i]}};Nn.clone=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t.slice()}};Nn.closestSquaredDistanceXY=function(t,i,s){var e,r;if(i<t[0]){e=t[0]-i}else if(t[2]<i){e=i-t[2]}else{e=0}if(s<t[1]){r=t[1]-s}else if(t[3]<s){r=s-t[3]}else{r=0}return e*e+r*r};Nn.containsCoordinate=function(t,i){return Nn.containsXY(t,i[0],i[1])};Nn.containsExtent=function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]};Nn.containsXY=function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]};Nn.coordinateRelationship=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=i[0];var a=i[1];var o=Cn.UNKNOWN;if(h<s){o=o|Cn.LEFT}else if(h>r){o=o|Cn.RIGHT}if(a<e){o=o|Cn.BELOW}else if(a>n){o=o|Cn.ABOVE}if(o===Cn.UNKNOWN){o=Cn.INTERSECTING}return o};Nn.createEmpty=function(){return[Infinity,Infinity,-Infinity,-Infinity]};Nn.createOrUpdate=function(t,i,s,e,r){if(r){r[0]=t;r[1]=i;r[2]=s;r[3]=e;return r}else{return[t,i,s,e]}};Nn.createOrUpdateEmpty=function(t){return Nn.createOrUpdate(Infinity,Infinity,-Infinity,-Infinity,t)};Nn.createOrUpdateFromCoordinate=function(t,i){var s=t[0];var e=t[1];return Nn.createOrUpdate(s,e,s,e,i)};Nn.createOrUpdateFromCoordinates=function(t,i){var s=Nn.createOrUpdateEmpty(i);return Nn.extendCoordinates(s,t)};Nn.createOrUpdateFromFlatCoordinates=function(t,i,s,e,r){var n=Nn.createOrUpdateEmpty(r);return Nn.extendFlatCoordinates(n,t,i,s,e)};Nn.createOrUpdateFromRings=function(t,i){var s=Nn.createOrUpdateEmpty(i);return Nn.extendRings(s,t)};Nn.equals=function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]};Nn.extend=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[2]>t[2]){t[2]=i[2]}if(i[1]<t[1]){t[1]=i[1]}if(i[3]>t[3]){t[3]=i[3]}return t};Nn.extendCoordinate=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[0]>t[2]){t[2]=i[0]}if(i[1]<t[1]){t[1]=i[1]}if(i[1]>t[3]){t[3]=i[1]}};Nn.extendCoordinates=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){Nn.extendCoordinate(t,i[s])}return t};Nn.extendFlatCoordinates=function(t,i,s,e,r){for(;s<e;s+=r){Nn.extendXY(t,i[s],i[s+1])}return t};Nn.extendRings=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){Nn.extendCoordinates(t,i[s])}return t};Nn.extendXY=function(t,i,s){t[0]=Math.min(t[0],i);t[1]=Math.min(t[1],s);t[2]=Math.max(t[2],i);t[3]=Math.max(t[3],s)};Nn.forEachCorner=function(t,i,s){var e;e=i.call(s,Nn.getBottomLeft(t));if(e){return e}e=i.call(s,Nn.getBottomRight(t));if(e){return e}e=i.call(s,Nn.getTopRight(t));if(e){return e}e=i.call(s,Nn.getTopLeft(t));if(e){return e}return false};Nn.getArea=function(t){var i=0;if(!Nn.isEmpty(t)){i=Nn.getWidth(t)*Nn.getHeight(t)}return i};Nn.getBottomLeft=function(t){return[t[0],t[1]]};Nn.getBottomRight=function(t){return[t[2],t[1]]};Nn.getCenter=function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]};Nn.getCorner=function(t,i){var s;if(i===En.BOTTOM_LEFT){s=Nn.getBottomLeft(t)}else if(i===En.BOTTOM_RIGHT){s=Nn.getBottomRight(t)}else if(i===En.TOP_LEFT){s=Nn.getTopLeft(t)}else if(i===En.TOP_RIGHT){s=Nn.getTopRight(t)}else{bn.assert(false,13)}return s};Nn.getEnlargedArea=function(t,i){var s=Math.min(t[0],i[0]);var e=Math.min(t[1],i[1]);var r=Math.max(t[2],i[2]);var n=Math.max(t[3],i[3]);return(r-s)*(n-e)};Nn.getForViewAndSize=function(t,i,s,e,r){var n=i*e[0]/2;var h=i*e[1]/2;var a=Math.cos(s);var o=Math.sin(s);var f=n*a;var u=n*o;var l=h*a;var v=h*o;var c=t[0];var d=t[1];var m=c-f+v;var p=c-f-v;var z=c+f-v;var M=c+f+v;var _=d-u-l;var g=d-u+l;var b=d+u+l;var x=d+u-l;return Nn.createOrUpdate(Math.min(m,p,z,M),Math.min(_,g,b,x),Math.max(m,p,z,M),Math.max(_,g,b,x),r)};Nn.getHeight=function(t){return t[3]-t[1]};Nn.getIntersectionArea=function(t,i){var s=Nn.getIntersection(t,i);return Nn.getArea(s)};Nn.getIntersection=function(t,i,s){var e=s?s:Nn.createEmpty();if(Nn.intersects(t,i)){if(t[0]>i[0]){e[0]=t[0]}else{e[0]=i[0]}if(t[1]>i[1]){e[1]=t[1]}else{e[1]=i[1]}if(t[2]<i[2]){e[2]=t[2]}else{e[2]=i[2]}if(t[3]<i[3]){e[3]=t[3]}else{e[3]=i[3]}}return e};Nn.getMargin=function(t){return Nn.getWidth(t)+Nn.getHeight(t)};Nn.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]};Nn.getTopLeft=function(t){return[t[0],t[3]]};Nn.getTopRight=function(t){return[t[2],t[3]]};Nn.getWidth=function(t){return t[2]-t[0]};Nn.intersects=function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]};Nn.isEmpty=function(t){return t[2]<t[0]||t[3]<t[1]};Nn.returnOrUpdate=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t}};Nn.scaleFromCenter=function(t,i){var s=(t[2]-t[0])/2*(i-1);var e=(t[3]-t[1])/2*(i-1);t[0]-=s;t[2]+=s;t[1]-=e;t[3]+=e};Nn.intersectsSegment=function(t,i,s){var e=false;var r=Nn.coordinateRelationship(t,i);var n=Nn.coordinateRelationship(t,s);if(r===Cn.INTERSECTING||n===Cn.INTERSECTING){e=true}else{var h=t[0];var a=t[1];var o=t[2];var f=t[3];var u=i[0];var l=i[1];var v=s[0];var c=s[1];var d=(c-l)/(v-u);var m,p;if(!!(n&Cn.ABOVE)&&!(r&Cn.ABOVE)){m=v-(c-f)/d;e=m>=h&&m<=o}if(!e&&!!(n&Cn.RIGHT)&&!(r&Cn.RIGHT)){p=c-(v-o)*d;e=p>=a&&p<=f}if(!e&&!!(n&Cn.BELOW)&&!(r&Cn.BELOW)){m=v-(c-a)/d;e=m>=h&&m<=o}if(!e&&!!(n&Cn.LEFT)&&!(r&Cn.LEFT)){p=c-(v-h)*d;e=p>=a&&p<=f}}return e};Nn.applyTransform=function(t,i,s){var e=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];i(e,e,2);var r=[e[0],e[2],e[4],e[6]];var n=[e[1],e[3],e[5],e[7]];return Nn.boundingExtentXYs_(r,n,s)};var In={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Sn={};Sn.TRUE=function(){return true};Sn.FALSE=function(){return false};var On={};On.transform2D=function(t,i,s,e,r,n){var h=n?n:[];var a=0;var o;for(o=i;o<s;o+=e){var f=t[o];var u=t[o+1];h[a++]=r[0]*f+r[2]*u+r[4];h[a++]=r[1]*f+r[3]*u+r[5]}if(n&&h.length!=a){h.length=a}return h};On.rotate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=Math.cos(r);var f=Math.sin(r);var u=n[0];var l=n[1];var v=0;for(var c=i;c<s;c+=e){var d=t[c]-u;var m=t[c+1]-l;a[v++]=u+d*o-m*f;a[v++]=l+d*f+m*o;for(var p=c+2;p<c+e;++p){a[v++]=t[p]}}if(h&&a.length!=v){a.length=v}return a};On.scale=function(t,i,s,e,r,n,h,a){var o=a?a:[];var f=h[0];var u=h[1];var l=0;for(var v=i;v<s;v+=e){var c=t[v]-f;var d=t[v+1]-u;o[l++]=f+r*c;o[l++]=u+n*d;for(var m=v+2;m<v+e;++m){o[l++]=t[m]}}if(a&&o.length!=l){o.length=l}return o};On.translate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=0;var f,u;for(f=i;f<s;f+=e){a[o++]=t[f]+r;a[o++]=t[f+1]+n;for(u=f+2;u<f+e;++u){a[o++]=t[u]}}if(h&&a.length!=o){a.length=o}return a};var Tn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};Tn.METERS_PER_UNIT={};Tn.METERS_PER_UNIT[Tn.DEGREES]=2*Math.PI*6370997/360;Tn.METERS_PER_UNIT[Tn.FEET]=.3048;Tn.METERS_PER_UNIT[Tn.METERS]=1;Tn.METERS_PER_UNIT[Tn.USFEET]=1200/3937;var An={};An.cache_=null;An.set=function(t){An.cache_=t};An.get=function(){return An.cache_||window["proj4"]};var Rn=function(t){this.code_=t.code;this.units_=t.units;this.extent_=t.extent!==undefined?t.extent:null;this.worldExtent_=t.worldExtent!==undefined?t.worldExtent:null;this.axisOrientation_=t.axisOrientation!==undefined?t.axisOrientation:"enu";this.global_=t.global!==undefined?t.global:false;this.canWrapX_=!!(this.global_&&this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(fn.ENABLE_PROJ4JS){var s=An.get();if(typeof s=="function"){var e=s.defs(i);if(e!==undefined){if(e.axis!==undefined&&t.axisOrientation===undefined){this.axisOrientation_=e.axis}if(t.metersPerUnit===undefined){this.metersPerUnit_=e.to_meter}if(t.units===undefined){this.units_=e.units}}}}};Rn.prototype.canWrapX=function(){return this.canWrapX_};Rn.prototype.getCode=function(){return this.code_};Rn.prototype.getExtent=function(){return this.extent_};Rn.prototype.getUnits=function(){return this.units_};Rn.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Tn.METERS_PER_UNIT[this.units_]};Rn.prototype.getWorldExtent=function(){return this.worldExtent_};Rn.prototype.getAxisOrientation=function(){return this.axisOrientation_};Rn.prototype.isGlobal=function(){return this.global_};Rn.prototype.setGlobal=function(t){this.global_=t;this.canWrapX_=!!(t&&this.extent_)};Rn.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};Rn.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t};Rn.prototype.setExtent=function(t){this.extent_=t;this.canWrapX_=!!(this.global_&&t)};Rn.prototype.setWorldExtent=function(t){this.worldExtent_=t};Rn.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t};Rn.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Pn={};Pn.Projection_=function(t){Rn.call(this,{code:t,units:Tn.METERS,extent:Pn.EXTENT,global:true,worldExtent:Pn.WORLD_EXTENT,getPointResolution:function(t,i){return t/xn.cosh(i[1]/Pn.RADIUS)}})};fn.inherits(Pn.Projection_,Rn);Pn.RADIUS=6378137;Pn.HALF_SIZE=Math.PI*Pn.RADIUS;Pn.EXTENT=[-Pn.HALF_SIZE,-Pn.HALF_SIZE,Pn.HALF_SIZE,Pn.HALF_SIZE];Pn.WORLD_EXTENT=[-180,-85,180,85];Pn.PROJECTIONS=[new Pn.Projection_("EPSG:3857"),new Pn.Projection_("EPSG:102100"),new Pn.Projection_("EPSG:102113"),new Pn.Projection_("EPSG:900913"),new Pn.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Pn.Projection_("urn:ogc:def:crs:EPSG::3857"),new Pn.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")];Pn.fromEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}var h=Pn.HALF_SIZE;for(var a=0;a<e;a+=r){n[a]=h*t[a]/180;var o=Pn.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));if(o>h){o=h}else if(o<-h){o=-h}n[a+1]=o}return n};Pn.toEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}for(var h=0;h<e;h+=r){n[h]=180*t[h]/Pn.HALF_SIZE;n[h+1]=360*Math.atan(Math.exp(t[h+1]/Pn.RADIUS))/Math.PI-90}return n};var Ln={};Ln.Projection_=function(t,i){Rn.call(this,{code:t,units:Tn.DEGREES,extent:Ln.EXTENT,axisOrientation:i,global:true,metersPerUnit:Ln.METERS_PER_UNIT,worldExtent:Ln.EXTENT})};fn.inherits(Ln.Projection_,Rn);Ln.RADIUS=6378137;Ln.EXTENT=[-180,-90,180,90];Ln.METERS_PER_UNIT=Math.PI*Ln.RADIUS/180;Ln.PROJECTIONS=[new Ln.Projection_("CRS:84"),new Ln.Projection_("EPSG:4326","neu"),new Ln.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new Ln.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Ln.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ln.Projection_("urn:ogc:def:crs:OGC:2:84"),new Ln.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ln.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var Dn={};Dn.cache_={};Dn.clear=function(){Dn.cache_={}};Dn.get=function(t){var i=Dn.cache_;return i[t]||null};Dn.add=function(t,i){var s=Dn.cache_;s[t]=i};var Fn={};Fn.cache_={};Fn.clear=function(){Fn.cache_={}};Fn.add=function(t,i,s){var e=t.getCode();var r=i.getCode();var n=Fn.cache_;if(!(e in n)){n[e]={}}n[e][r]=s};Fn.remove=function(t,i){var s=t.getCode();var e=i.getCode();var r=Fn.cache_;var n=r[s][e];delete r[s][e];if(vn.isEmpty(r[s])){delete r[s]}return n};Fn.get=function(t,i){var s;var e=Fn.cache_;if(t in e&&i in e[t]){s=e[t][i]}return s};var Wn={};Wn.METERS_PER_UNIT=Tn.METERS_PER_UNIT;Wn.SPHERE_=new wn(wn.DEFAULT_RADIUS);if(fn.ENABLE_PROJ4JS){Wn.setProj4=function(t){An.set(t)}}Wn.getPointResolution=function(t,i,s,e){t=Wn.get(t);var r;var n=t.getPointResolutionFunc();if(n){r=n(i,s)}else{var h=t.getUnits();if(h==Tn.DEGREES&&!e||e==Tn.DEGREES){r=i}else{var a=Wn.getTransformFromProjections(t,Wn.get("EPSG:4326"));var o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=a(o,o,2);var f=Wn.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4));var u=Wn.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8));r=(f+u)/2;var l=e?Tn.METERS_PER_UNIT[e]:t.getMetersPerUnit();if(l!==undefined){r/=l}}}return r};Wn.addEquivalentProjections=function(t){Wn.addProjections(t);t.forEach((function(i){t.forEach((function(t){if(i!==t){Fn.add(i,t,Wn.cloneTransform)}}))}))};Wn.addEquivalentTransforms=function(t,i,s,e){t.forEach((function(t){i.forEach((function(i){Fn.add(t,i,s);Fn.add(i,t,e)}))}))};Wn.addProjection=function(t){Dn.add(t.getCode(),t);Fn.add(t,t,Wn.cloneTransform)};Wn.addProjections=function(t){t.forEach(Wn.addProjection)};Wn.clearAllProjections=function(){Dn.clear();Fn.clear()};Wn.createProjection=function(t,i){if(!t){return Wn.get(i)}else if(typeof t==="string"){return Wn.get(t)}else{return t}};Wn.addCoordinateTransforms=function(t,i,s,e){var r=Wn.get(t);var n=Wn.get(i);Fn.add(r,n,Wn.createTransformFromCoordinateTransform(s));Fn.add(n,r,Wn.createTransformFromCoordinateTransform(e))};Wn.createTransformFromCoordinateTransform=function(t){return function(i,s,e){var r=i.length;var n=e!==undefined?e:2;var h=s!==undefined?s:new Array(r);var a,o,f;for(o=0;o<r;o+=n){a=t([i[o],i[o+1]]);h[o]=a[0];h[o+1]=a[1];for(f=n-1;f>=2;--f){h[o+f]=i[o+f]}}return h}};Wn.fromLonLat=function(t,i){return Wn.transform(t,"EPSG:4326",i!==undefined?i:"EPSG:3857")};Wn.toLonLat=function(t,i){var s=Wn.transform(t,i!==undefined?i:"EPSG:3857","EPSG:4326");var e=s[0];if(e<-180||e>180){s[0]=xn.modulo(e+180,360)-180}return s};Wn.get=function(t){var i=null;if(t instanceof Rn){i=t}else if(typeof t==="string"){var s=t;i=Dn.get(s);if(fn.ENABLE_PROJ4JS&&!i){var e=An.get();if(typeof e=="function"&&e.defs(s)!==undefined){i=new Rn({code:s});Wn.addProjection(i)}}}return i};Wn.equivalent=function(t,i){if(t===i){return true}var s=t.getUnits()===i.getUnits();if(t.getCode()===i.getCode()){return s}else{var e=Wn.getTransformFromProjections(t,i);return e===Wn.cloneTransform&&s}};Wn.getTransform=function(t,i){var s=Wn.get(t);var e=Wn.get(i);return Wn.getTransformFromProjections(s,e)};Wn.getTransformFromProjections=function(t,i){var s=t.getCode();var e=i.getCode();var r=Fn.get(s,e);if(fn.ENABLE_PROJ4JS&&!r){var n=An.get();if(typeof n=="function"){var h=n.defs(s);var a=n.defs(e);if(h!==undefined&&a!==undefined){if(h===a){Wn.addEquivalentProjections([i,t])}else{var o=n(e,s);Wn.addCoordinateTransforms(i,t,o.forward,o.inverse)}r=Fn.get(s,e)}}}if(!r){r=Wn.identityTransform}return r};Wn.identityTransform=function(t,i,s){if(i!==undefined&&t!==i){for(var e=0,r=t.length;e<r;++e){i[e]=t[e]}t=i}return t};Wn.cloneTransform=function(t,i,s){var e;if(i!==undefined){for(var r=0,n=t.length;r<n;++r){i[r]=t[r]}e=i}else{e=t.slice()}return e};Wn.transform=function(t,i,s){var e=Wn.getTransform(i,s);return e(t,undefined,t.length)};Wn.transformExtent=function(t,i,s){var e=Wn.getTransform(i,s);return Nn.applyTransform(t,e)};Wn.transformWithProjections=function(t,i,s){var e=Wn.getTransformFromProjections(i,s);return e(t)};Wn.addCommon=function(){Wn.addEquivalentProjections(Pn.PROJECTIONS);Wn.addEquivalentProjections(Ln.PROJECTIONS);Wn.addEquivalentTransforms(Ln.PROJECTIONS,Pn.PROJECTIONS,Pn.fromEPSG4326,Pn.toEPSG4326)};Wn.addCommon();var Gn={};Gn.tmp_=new Array(6);Gn.create=function(){return[1,0,0,1,0,0]};Gn.reset=function(t){return Gn.set(t,1,0,0,1,0,0)};Gn.multiply=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];var o=i[0];var f=i[1];var u=i[2];var l=i[3];var v=i[4];var c=i[5];t[0]=s*o+r*f;t[1]=e*o+n*f;t[2]=s*u+r*l;t[3]=e*u+n*l;t[4]=s*v+r*c+h;t[5]=e*v+n*c+a;return t};Gn.set=function(t,i,s,e,r,n,h){t[0]=i;t[1]=s;t[2]=e;t[3]=r;t[4]=n;t[5]=h;return t};Gn.setFromArray=function(t,i){t[0]=i[0];t[1]=i[1];t[2]=i[2];t[3]=i[3];t[4]=i[4];t[5]=i[5];return t};Gn.apply=function(t,i){var s=i[0],e=i[1];i[0]=t[0]*s+t[2]*e+t[4];i[1]=t[1]*s+t[3]*e+t[5];return i};Gn.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);return Gn.multiply(t,Gn.set(Gn.tmp_,s,e,-e,s,0,0))};Gn.scale=function(t,i,s){return Gn.multiply(t,Gn.set(Gn.tmp_,i,0,0,s,0,0))};Gn.translate=function(t,i,s){return Gn.multiply(t,Gn.set(Gn.tmp_,1,0,0,1,i,s))};Gn.compose=function(t,i,s,e,r,n,h,a){var o=Math.sin(n);var f=Math.cos(n);t[0]=e*f;t[1]=r*o;t[2]=-e*o;t[3]=r*f;t[4]=h*e*f-a*e*o+i;t[5]=h*r*o+a*r*f+s;return t};Gn.invert=function(t){var i=Gn.determinant(t);bn.assert(i!==0,32);var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];t[0]=n/i;t[1]=-e/i;t[2]=-r/i;t[3]=s/i;t[4]=(r*a-n*h)/i;t[5]=-(s*a-e*h)/i;return t};Gn.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var jn=function(){_n.call(this);this.extent_=Nn.createEmpty();this.extentRevision_=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.tmpTransform_=Gn.create()};fn.inherits(jn,_n);jn.prototype.clone=function(){};jn.prototype.closestPointXY=function(t,i,s,e){};jn.prototype.getClosestPoint=function(t,i){var s=i?i:[NaN,NaN];this.closestPointXY(t[0],t[1],s,Infinity);return s};jn.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])};jn.prototype.computeExtent=function(t){};jn.prototype.containsXY=Sn.FALSE;jn.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){this.extent_=this.computeExtent(this.extent_);this.extentRevision_=this.getRevision()}return Nn.returnOrUpdate(this.extent_,t)};jn.prototype.rotate=function(t,i){};jn.prototype.scale=function(t,i,s){};jn.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)};jn.prototype.getSimplifiedGeometry=function(t){};jn.prototype.getType=function(){};jn.prototype.applyTransform=function(t){};jn.prototype.intersectsExtent=function(t){};jn.prototype.translate=function(t,i){};jn.prototype.transform=function(t,i){var s=this.tmpTransform_;t=Wn.get(t);var e=t.getUnits()==Tn.TILE_PIXELS?function(e,r,n){var h=t.getExtent();var a=t.getWorldExtent();var o=Nn.getHeight(a)/Nn.getHeight(h);Gn.compose(s,a[0],a[3],o,-o,0,0,0);On.transform2D(e,0,e.length,n,s,r);return Wn.getTransform(t,i)(e,r,n)}:Wn.getTransform(t,i);this.applyTransform(e);return this};var Vn=function(){jn.call(this);this.layout=In.XY;this.stride=2;this.flatCoordinates=null};fn.inherits(Vn,jn);Vn.getLayoutForStride_=function(t){var i;if(t==2){i=In.XY}else if(t==3){i=In.XYZ}else if(t==4){i=In.XYZM}return i};Vn.getStrideForLayout=function(t){var i;if(t==In.XY){i=2}else if(t==In.XYZ||t==In.XYM){i=3}else if(t==In.XYZM){i=4}return i};Vn.prototype.containsXY=Sn.FALSE;Vn.prototype.computeExtent=function(t){return Nn.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};Vn.prototype.getCoordinates=function(){};Vn.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)};Vn.prototype.getFlatCoordinates=function(){return this.flatCoordinates};Vn.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)};Vn.prototype.getLayout=function(){return this.layout};Vn.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()){vn.clear(this.simplifiedGeometryCache);this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=this.getRevision()}if(t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance){return this}var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i)){return this.simplifiedGeometryCache[i]}else{var s=this.getSimplifiedGeometryInternal(t);var e=s.getFlatCoordinates();if(e.length<this.flatCoordinates.length){this.simplifiedGeometryCache[i]=s;return s}else{this.simplifiedGeometryMaxMinSquaredTolerance=t;return this}}};Vn.prototype.getSimplifiedGeometryInternal=function(t){return this};Vn.prototype.getStride=function(){return this.stride};Vn.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=Vn.getStrideForLayout(t);this.layout=t;this.flatCoordinates=i};Vn.prototype.setCoordinates=function(t,i){};Vn.prototype.setLayout=function(t,i,s){var e;if(t){e=Vn.getStrideForLayout(t)}else{var r;for(r=0;r<s;++r){if(i.length===0){this.layout=In.XY;this.stride=2;return}else{i=i[0]}}e=i.length;t=Vn.getLayoutForStride_(e)}this.layout=t;this.stride=e};Vn.prototype.applyTransform=function(t){if(this.flatCoordinates){t(this.flatCoordinates,this.flatCoordinates,this.stride);this.changed()}};Vn.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();On.rotate(s,0,s.length,e,t,i,s);this.changed()}};Vn.prototype.scale=function(t,i,s){var e=i;if(e===undefined){e=t}var r=s;if(!r){r=Nn.getCenter(this.getExtent())}var n=this.getFlatCoordinates();if(n){var h=this.getStride();On.scale(n,0,n.length,h,t,e,r,n);this.changed()}};Vn.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();On.translate(s,0,s.length,e,t,i,s);this.changed()}};Vn.transform2D=function(t,i,s){var e=t.getFlatCoordinates();if(!e){return null}else{var r=t.getStride();return On.transform2D(e,0,e.length,r,i,s)}};var Un={};Un.linearRing=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=h*a-n*o;n=a;h=o}return r/2};Un.linearRings=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=Un.linearRing(t,i,a,e);i=a}return r};Un.linearRingss=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=Un.linearRings(t,i,a,e);i=a[a.length-1]}return r};var Xn={};Xn.point=function(t,i,s,e,r,n,h){var a=t[i];var o=t[i+1];var f=t[s]-a;var u=t[s+1]-o;var l,v;if(f===0&&u===0){v=i}else{var c=((r-a)*f+(n-o)*u)/(f*f+u*u);if(c>1){v=s}else if(c>0){for(l=0;l<e;++l){h[l]=xn.lerp(t[i+l],t[s+l],c)}h.length=e;return}else{v=i}}for(l=0;l<e;++l){h[l]=t[v+l]}h.length=e};Xn.getMaxSquaredDelta=function(t,i,s,e,r){var n=t[i];var h=t[i+1];for(i+=e;i<s;i+=e){var a=t[i];var o=t[i+1];var f=xn.squaredDistance(n,h,a,o);if(f>r){r=f}n=a;h=o}return r};Xn.getsMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=Xn.getMaxSquaredDelta(t,i,a,e,r);i=a}return r};Xn.getssMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=Xn.getsMaxSquaredDelta(t,i,a,e,r);i=a[a.length-1]}return r};Xn.getClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){if(i==s){return f}var l,v;if(r===0){v=xn.squaredDistance(h,a,t[i],t[i+1]);if(v<f){for(l=0;l<e;++l){o[l]=t[i+l]}o.length=e;return v}else{return f}}var c=u?u:[NaN,NaN];var d=i+e;while(d<s){Xn.point(t,d-e,d,e,h,a,c);v=xn.squaredDistance(h,a,c[0],c[1]);if(v<f){f=v;for(l=0;l<e;++l){o[l]=c[l]}o.length=e;d+=e}else{d+=e*Math.max((Math.sqrt(v)-Math.sqrt(f))/r|0,1)}}if(n){Xn.point(t,s-e,i,e,h,a,c);v=xn.squaredDistance(h,a,c[0],c[1]);if(v<f){f=v;for(l=0;l<e;++l){o[l]=c[l]}o.length=e}}return f};Xn.getsClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var l=u?u:[NaN,NaN];var v,c;for(v=0,c=s.length;v<c;++v){var d=s[v];f=Xn.getClosestPoint(t,i,d,e,r,n,h,a,o,f,l);i=d}return f};Xn.getssClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var l=u?u:[NaN,NaN];var v,c;for(v=0,c=s.length;v<c;++v){var d=s[v];f=Xn.getsClosestPoint(t,i,d,e,r,n,h,a,o,f,l);i=d[d.length-1]}return f};var qn={};qn.coordinate=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){t[i++]=s[r]}return i};qn.coordinates=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){var h=s[r];var a;for(a=0;a<e;++a){t[i++]=h[a]}}return i};qn.coordinatess=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=qn.coordinates(t,i,s[a],e);n[h++]=f;i=f}n.length=h;return n};qn.coordinatesss=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=qn.coordinatess(t,i,s[a],e,n[h]);n[h++]=f;i=f[f.length-1]}n.length=h;return n};var Yn={};Yn.coordinates=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a;for(a=i;a<s;a+=e){n[h++]=t.slice(a,a+e)}n.length=h;return n};Yn.coordinatess=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=Yn.coordinates(t,i,f,e,n[h]);i=f}n.length=h;return n};Yn.coordinatesss=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=Yn.coordinatess(t,i,f,e,n[h]);i=f[f.length-1]}n.length=h;return n};var Bn={};Bn.lineString=function(t,i,s,e,r,n,h){var a=h!==undefined?h:[];if(!n){s=Bn.radialDistance(t,i,s,e,r,a,0);t=a;i=0;e=2}a.length=Bn.douglasPeucker(t,i,s,e,r,a,0);return a};Bn.douglasPeucker=function(t,i,s,e,r,n,h){var a=(s-i)/e;if(a<3){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var o=new Array(a);o[0]=1;o[a-1]=1;var f=[i,s-e];var u=0;var l;while(f.length>0){var v=f.pop();var c=f.pop();var d=0;var m=t[c];var p=t[c+1];var z=t[v];var M=t[v+1];for(l=c+e;l<v;l+=e){var _=t[l];var g=t[l+1];var b=xn.squaredSegmentDistance(_,g,m,p,z,M);if(b>d){u=l;d=b}}if(d>r){o[(u-i)/e]=1;if(c+e<u){f.push(c,u)}if(u+e<v){f.push(u,v)}}}for(l=0;l<a;++l){if(o[l]){n[h++]=t[i+l*e];n[h++]=t[i+l*e+1]}}return h};Bn.douglasPeuckers=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=Bn.douglasPeucker(t,i,u,e,r,n,h);a.push(h);i=u}return h};Bn.douglasPeuckerss=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var l=[];h=Bn.douglasPeuckers(t,i,u,e,r,n,h,l);a.push(l);i=u[u.length-1]}return h};Bn.radialDistance=function(t,i,s,e,r,n,h){if(s<=i+e){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var a=t[i];var o=t[i+1];n[h++]=a;n[h++]=o;var f=a;var u=o;for(i+=e;i<s;i+=e){f=t[i];u=t[i+1];if(xn.squaredDistance(a,o,f,u)>r){n[h++]=f;n[h++]=u;a=f;o=u}}if(f!=a||u!=o){n[h++]=f;n[h++]=u}return h};Bn.snap=function(t,i){return i*Math.round(t/i)};Bn.quantize=function(t,i,s,e,r,n,h){if(i==s){return h}var a=Bn.snap(t[i],r);var o=Bn.snap(t[i+1],r);i+=e;n[h++]=a;n[h++]=o;var f,u;do{f=Bn.snap(t[i],r);u=Bn.snap(t[i+1],r);i+=e;if(i==s){n[h++]=f;n[h++]=u;return h}}while(f==a&&u==o);while(i<s){var l,v;l=Bn.snap(t[i],r);v=Bn.snap(t[i+1],r);i+=e;if(l==f&&v==u){continue}var c=f-a;var d=u-o;var m=l-a;var p=v-o;if(c*p==d*m&&(c<0&&m<c||c==m||c>0&&m>c)&&(d<0&&p<d||d==p||d>0&&p>d)){f=l;u=v;continue}n[h++]=f;n[h++]=u;a=f;o=u;f=l;u=v}n[h++]=f;n[h++]=u;return h};Bn.quantizes=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=Bn.quantize(t,i,u,e,r,n,h);a.push(h);i=u}return h};Bn.quantizess=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var l=[];h=Bn.quantizes(t,i,u,e,r,n,h,l);a.push(l);i=u[u.length-1]}return h};var Hn=function(t,i){Vn.call(this);this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};fn.inherits(Hn,Vn);Hn.prototype.clone=function(){var t=new Hn(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};Hn.prototype.closestPointXY=function(t,i,s,e){if(e<Nn.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Xn.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Xn.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,i,s,e)};Hn.prototype.getArea=function(){return Un.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};Hn.prototype.getCoordinates=function(){return Yn.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};Hn.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Bn.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new Hn(null);s.setFlatCoordinates(In.XY,i);return s};Hn.prototype.getType=function(){return yn.LINEAR_RING};Hn.prototype.intersectsExtent=function(t){};Hn.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=qn.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};Hn.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Jn=function(t,i){Vn.call(this);this.setCoordinates(t,i)};fn.inherits(Jn,Vn);Jn.prototype.clone=function(){var t=new Jn(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};Jn.prototype.closestPointXY=function(t,i,s,e){var r=this.flatCoordinates;var n=xn.squaredDistance(t,i,r[0],r[1]);if(n<e){var h=this.stride;var a;for(a=0;a<h;++a){s[a]=r[a]}s.length=h;return n}else{return e}};Jn.prototype.getCoordinates=function(){return!this.flatCoordinates?[]:this.flatCoordinates.slice()};Jn.prototype.computeExtent=function(t){return Nn.createOrUpdateFromCoordinate(this.flatCoordinates,t)};Jn.prototype.getType=function(){return yn.POINT};Jn.prototype.intersectsExtent=function(t){return Nn.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])};Jn.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null)}else{this.setLayout(i,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=qn.coordinate(this.flatCoordinates,0,t,this.stride);this.changed()}};Jn.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Zn={};Zn.linearRingContainsExtent=function(t,i,s,e,r){var n=Nn.forEachCorner(r,(function(r){return!Zn.linearRingContainsXY(t,i,s,e,r[0],r[1])}));return!n};Zn.linearRingContainsXY=function(t,i,s,e,r,n){var h=0;var a=t[s-e];var o=t[s-e+1];for(;i<s;i+=e){var f=t[i];var u=t[i+1];if(o<=n){if(u>n&&(f-a)*(n-o)-(r-a)*(u-o)>0){h++}}else if(u<=n&&(f-a)*(n-o)-(r-a)*(u-o)<0){h--}a=f;o=u}return h!==0};Zn.linearRingsContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}if(!Zn.linearRingContainsXY(t,i,s[0],e,r,n)){return false}var h,a;for(h=1,a=s.length;h<a;++h){if(Zn.linearRingContainsXY(t,s[h-1],s[h],e,r,n)){return false}}return true};Zn.linearRingssContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];if(Zn.linearRingsContainsXY(t,i,o,e,r,n)){return true}i=o[o.length-1]}return false};var $n={};$n.linearRings=function(t,i,s,e,r,n,h){var a,o,f,u,l,v,c;var d=r[n+1];var m=[];for(var p=0,z=s.length;p<z;++p){var M=s[p];u=t[M-e];v=t[M-e+1];for(a=i;a<M;a+=e){l=t[a];c=t[a+1];if(d<=v&&c<=d||v<=d&&d<=c){f=(d-v)/(c-v)*(l-u)+u;m.push(f)}u=l;v=c}}var _=NaN;var g=-Infinity;m.sort(kn.numberSafeCompareFunction);u=m[0];for(a=1,o=m.length;a<o;++a){l=m[a];var b=Math.abs(l-u);if(b>g){f=(u+l)/2;if(Zn.linearRingsContainsXY(t,i,s,e,f,d)){_=f;g=b}}u=l}if(isNaN(_)){_=r[n]}if(h){h.push(_,d,g);return h}else{return[_,d,g]}};$n.linearRingss=function(t,i,s,e,r){var n=[];var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];n=$n.linearRings(t,i,o,e,r,2*h,n);i=o[o.length-1]}return n};var Kn={};Kn.forEach=function(t,i,s,e,r,n){var h=[t[i],t[i+1]];var a=[];var o;for(;i+e<s;i+=e){a[0]=t[i+e];a[1]=t[i+e+1];o=r.call(n,h,a);if(o){return o}h[0]=a[0];h[1]=a[1]}return false};var Qn={};Qn.lineString=function(t,i,s,e,r){var n=Nn.extendFlatCoordinates(Nn.createEmpty(),t,i,s,e);if(!Nn.intersects(r,n)){return false}if(Nn.containsExtent(r,n)){return true}if(n[0]>=r[0]&&n[2]<=r[2]){return true}if(n[1]>=r[1]&&n[3]<=r[3]){return true}return Kn.forEach(t,i,s,e,(function(t,i){return Nn.intersectsSegment(r,t,i)}))};Qn.lineStrings=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(Qn.lineString(t,i,s[n],e,r)){return true}i=s[n]}return false};Qn.linearRing=function(t,i,s,e,r){if(Qn.lineString(t,i,s,e,r)){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[0],r[1])){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[0],r[3])){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[2],r[1])){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[2],r[3])){return true}return false};Qn.linearRings=function(t,i,s,e,r){if(!Qn.linearRing(t,i,s[0],e,r)){return false}if(s.length===1){return true}var n,h;for(n=1,h=s.length;n<h;++n){if(Zn.linearRingContainsExtent(t,s[n-1],s[n],e,r)){return false}}return true};Qn.linearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];if(Qn.linearRings(t,i,a,e,r)){return true}i=a[a.length-1]}return false};var th={};th.coordinates=function(t,i,s,e){while(i<s-e){var r;for(r=0;r<e;++r){var n=t[i+r];t[i+r]=t[s-e+r];t[s-e+r]=n}i+=e;s-=e}};var ih={};ih.linearRingIsClockwise=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=(a-n)*(o+h);n=a;h=o}return r>0};ih.linearRingsAreOriented=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=ih.linearRingIsClockwise(t,i,o,e);if(h===0){if(n&&f||!n&&!f){return false}}else{if(n&&!f||!n&&f){return false}}i=o}return true};ih.linearRingssAreOriented=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(!ih.linearRingsAreOriented(t,i,s[n],e,r)){return false}}return true};ih.orientLinearRings=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=ih.linearRingIsClockwise(t,i,o,e);var u=h===0?n&&f||!n&&!f:n&&!f||!n&&f;if(u){th.coordinates(t,i,o,e)}i=o}return i};ih.orientLinearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){i=ih.orientLinearRings(t,i,s[n],e,r)}return i};var sh=function(t,i){Vn.call(this);this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.orientedRevision_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(t,i)};fn.inherits(sh,Vn);sh.prototype.appendLinearRing=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.getFlatCoordinates().slice()}else{kn.extend(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()};sh.prototype.clone=function(){var t=new sh(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return t};sh.prototype.closestPointXY=function(t,i,s,e){if(e<Nn.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Xn.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Xn.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,i,s,e)};sh.prototype.containsXY=function(t,i){return Zn.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)};sh.prototype.getArea=function(){return Un.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)};sh.prototype.getCoordinates=function(t){var i;if(t!==undefined){i=this.getOrientedFlatCoordinates().slice();ih.orientLinearRings(i,0,this.ends_,this.stride,t)}else{i=this.flatCoordinates}return Yn.coordinatess(i,0,this.ends_,this.stride)};sh.prototype.getEnds=function(){return this.ends_};sh.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Nn.getCenter(this.getExtent());this.flatInteriorPoint_=$n.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_};sh.prototype.getInteriorPoint=function(){return new Jn(this.getFlatInteriorPoint(),In.XYM)};sh.prototype.getLinearRingCount=function(){return this.ends_.length};sh.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t){return null}var i=new Hn(null);i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]));return i};sh.prototype.getLinearRings=function(){var t=this.layout;var i=this.flatCoordinates;var s=this.ends_;var e=[];var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];var o=new Hn(null);o.setFlatCoordinates(t,i.slice(r,a));e.push(o);r=a}return e};sh.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;if(ih.linearRingsAreOriented(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=ih.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};sh.prototype.getSimplifiedGeometryInternal=function(t){var i=[];var s=[];i.length=Bn.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var e=new sh(null);e.setFlatCoordinates(In.XY,i,s);return e};sh.prototype.getType=function(){return yn.POLYGON};sh.prototype.intersectsExtent=function(t){return Qn.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)};sh.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null,this.ends_)}else{this.setLayout(i,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}var s=qn.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=s.length===0?0:s[s.length-1];this.changed()}};sh.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i);this.ends_=s;this.changed()};sh.circular=function(t,i,s,e){var r=e?e:32;var n=[];var h;for(h=0;h<r;++h){kn.extend(n,t.offset(i,s,2*Math.PI*h/r))}n.push(n[0],n[1]);var a=new sh(null);a.setFlatCoordinates(In.XY,n,[n.length]);return a};sh.fromExtent=function(t){var i=t[0];var s=t[1];var e=t[2];var r=t[3];var n=[i,s,i,r,e,r,e,s,i,s];var h=new sh(null);h.setFlatCoordinates(In.XY,n,[n.length]);return h};sh.fromCircle=function(t,i,s){var e=i?i:32;var r=t.getStride();var n=t.getLayout();var h=new sh(null,n);var a=r*(e+1);var o=new Array(a);for(var f=0;f<a;f++){o[f]=0}var u=[o.length];h.setFlatCoordinates(n,o,u);sh.makeRegular(h,t.getCenter(),t.getRadius(),s);return h};sh.makeRegular=function(t,i,s,e){var r=t.getFlatCoordinates();var n=t.getLayout();var h=t.getStride();var a=t.getEnds();var o=r.length/h-1;var f=e?e:0;var u,l;for(var v=0;v<=o;++v){l=v*h;u=f+xn.modulo(v,o)*2*Math.PI/o;r[l]=i[0]+s*Math.cos(u);r[l+1]=i[1]+s*Math.sin(u)}t.setFlatCoordinates(n,r,a)};var eh={};eh.ONE=1;eh.SRC_ALPHA=770;eh.COLOR_ATTACHMENT0=36064;eh.COLOR_BUFFER_BIT=16384;eh.TRIANGLES=4;eh.TRIANGLE_STRIP=5;eh.ONE_MINUS_SRC_ALPHA=771;eh.ARRAY_BUFFER=34962;eh.ELEMENT_ARRAY_BUFFER=34963;eh.STREAM_DRAW=35040;eh.STATIC_DRAW=35044;eh.DYNAMIC_DRAW=35048;eh.CULL_FACE=2884;eh.BLEND=3042;eh.STENCIL_TEST=2960;eh.DEPTH_TEST=2929;eh.SCISSOR_TEST=3089;eh.UNSIGNED_BYTE=5121;eh.UNSIGNED_SHORT=5123;eh.UNSIGNED_INT=5125;eh.FLOAT=5126;eh.RGBA=6408;eh.FRAGMENT_SHADER=35632;eh.VERTEX_SHADER=35633;eh.LINK_STATUS=35714;eh.LINEAR=9729;eh.TEXTURE_MAG_FILTER=10240;eh.TEXTURE_MIN_FILTER=10241;eh.TEXTURE_WRAP_S=10242;eh.TEXTURE_WRAP_T=10243;eh.TEXTURE_2D=3553;eh.TEXTURE0=33984;eh.CLAMP_TO_EDGE=33071;eh.COMPILE_STATUS=35713;eh.FRAMEBUFFER=36160;eh.CONTEXT_IDS_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];eh.getContext=function(t,i){var s,e,r=eh.CONTEXT_IDS_.length;for(e=0;e<r;++e){try{s=t.getContext(eh.CONTEXT_IDS_[e],i);if(s){return s}}catch(t){}}return null};var rh={};var nh=typeof navigator!=="undefined"?navigator.userAgent.toLowerCase():"";rh.FIREFOX=nh.indexOf("firefox")!==-1;rh.SAFARI=nh.indexOf("safari")!==-1&&nh.indexOf("chrom")==-1;rh.WEBKIT=nh.indexOf("webkit")!==-1&&nh.indexOf("edge")==-1;rh.MAC=nh.indexOf("macintosh")!==-1;rh.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1;rh.CANVAS_LINE_DASH=false;rh.CANVAS=fn.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window)){return false}try{var t=document.createElement("CANVAS").getContext("2d");if(!t){return false}else{if(t.setLineDash!==undefined){rh.CANVAS_LINE_DASH=true}return true}}catch(t){return false}}();rh.DEVICE_ORIENTATION="DeviceOrientationEvent"in window;rh.GEOLOCATION="geolocation"in navigator;rh.TOUCH=fn.ASSUME_TOUCH||"ontouchstart"in window;rh.POINTER="PointerEvent"in window;rh.MSPOINTER=!!navigator.msPointerEnabled;(function(){if(fn.ENABLE_WEBGL){var t=false;var i;var s=[];if("WebGLRenderingContext"in window){try{var e=document.createElement("CANVAS");var r=eh.getContext(e,{failIfMajorPerformanceCaveat:true});if(r){t=true;i=r.getParameter(r.MAX_TEXTURE_SIZE);s=r.getSupportedExtensions()}}catch(t){}}rh.WEBGL=t;fn.WEBGL_EXTENSIONS=s;fn.WEBGL_MAX_TEXTURE_SIZE=i}})();var hh=function(t){_n.call(this);var i=t||{};this.position_=null;this.transform_=Wn.identityTransform;this.sphere_=new wn(Ln.RADIUS);this.watchId_=undefined;cn.listen(this,_n.getChangeEventType(un.PROJECTION),this.handleProjectionChanged_,this);cn.listen(this,_n.getChangeEventType(un.TRACKING),this.handleTrackingChanged_,this);if(i.projection!==undefined){this.setProjection(i.projection)}if(i.trackingOptions!==undefined){this.setTrackingOptions(i.trackingOptions)}this.setTracking(i.tracking!==undefined?i.tracking:false)};fn.inherits(hh,_n);hh.prototype.disposeInternal=function(){this.setTracking(false);_n.prototype.disposeInternal.call(this)};hh.prototype.handleProjectionChanged_=function(){var t=this.getProjection();if(t){this.transform_=Wn.getTransformFromProjections(Wn.get("EPSG:4326"),t);if(this.position_){this.set(un.POSITION,this.transform_(this.position_))}}};hh.prototype.handleTrackingChanged_=function(){if(rh.GEOLOCATION){var t=this.getTracking();if(t&&this.watchId_===undefined){this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions())}else if(!t&&this.watchId_!==undefined){navigator.geolocation.clearWatch(this.watchId_);this.watchId_=undefined}}};hh.prototype.positionChange_=function(t){var i=t.coords;this.set(un.ACCURACY,i.accuracy);this.set(un.ALTITUDE,i.altitude===null?undefined:i.altitude);this.set(un.ALTITUDE_ACCURACY,i.altitudeAccuracy===null?undefined:i.altitudeAccuracy);this.set(un.HEADING,i.heading===null?undefined:xn.toRadians(i.heading));if(!this.position_){this.position_=[i.longitude,i.latitude]}else{this.position_[0]=i.longitude;this.position_[1]=i.latitude}var s=this.transform_(this.position_);this.set(un.POSITION,s);this.set(un.SPEED,i.speed===null?undefined:i.speed);var e=sh.circular(this.sphere_,this.position_,i.accuracy);e.applyTransform(this.transform_);this.set(un.ACCURACY_GEOMETRY,e);this.changed()};hh.prototype.positionError_=function(t){t.type=zn.ERROR;this.setTracking(false);this.dispatchEvent(t)};hh.prototype.getAccuracy=function(){return this.get(un.ACCURACY)};hh.prototype.getAccuracyGeometry=function(){return this.get(un.ACCURACY_GEOMETRY)||null};hh.prototype.getAltitude=function(){return this.get(un.ALTITUDE)};hh.prototype.getAltitudeAccuracy=function(){return this.get(un.ALTITUDE_ACCURACY)};hh.prototype.getHeading=function(){return this.get(un.HEADING)};hh.prototype.getPosition=function(){return this.get(un.POSITION)};hh.prototype.getProjection=function(){return this.get(un.PROJECTION)};hh.prototype.getSpeed=function(){return this.get(un.SPEED)};hh.prototype.getTracking=function(){return this.get(un.TRACKING)};hh.prototype.getTrackingOptions=function(){return this.get(un.TRACKING_OPTIONS)};hh.prototype.setProjection=function(t){this.set(un.PROJECTION,Wn.get(t))};hh.prototype.setTracking=function(t){this.set(un.TRACKING,t)};hh.prototype.setTrackingOptions=function(t){this.set(un.TRACKING_OPTIONS,t)};var ah={ADD:"add",REMOVE:"remove"};var oh=function(t,i){_n.call(this);var s=i||{};this.unique_=!!s.unique;this.array_=t?t:[];if(this.unique_){for(var e=0,r=this.array_.length;e<r;++e){this.assertUnique_(this.array_[e],e)}}this.updateLength_()};fn.inherits(oh,_n);oh.prototype.clear=function(){while(this.getLength()>0){this.pop()}};oh.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i){this.push(t[i])}return this};oh.prototype.forEach=function(t,i){var s=i?t.bind(i):t;var e=this.array_;for(var r=0,n=e.length;r<n;++r){s(e[r],r,e)}};oh.prototype.getArray=function(){return this.array_};oh.prototype.item=function(t){return this.array_[t]};oh.prototype.getLength=function(){return this.get(oh.Property_.LENGTH)};oh.prototype.insertAt=function(t,i){if(this.unique_){this.assertUnique_(i)}this.array_.splice(t,0,i);this.updateLength_();this.dispatchEvent(new oh.Event(ah.ADD,i))};oh.prototype.pop=function(){return this.removeAt(this.getLength()-1)};oh.prototype.push=function(t){if(this.unique_){this.assertUnique_(t)}var i=this.getLength();this.insertAt(i,t);return this.getLength()};oh.prototype.remove=function(t){var i=this.array_;var s,e;for(s=0,e=i.length;s<e;++s){if(i[s]===t){return this.removeAt(s)}}return undefined};oh.prototype.removeAt=function(t){var i=this.array_[t];this.array_.splice(t,1);this.updateLength_();this.dispatchEvent(new oh.Event(ah.REMOVE,i));return i};oh.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){if(this.unique_){this.assertUnique_(i,t)}var e=this.array_[t];this.array_[t]=i;this.dispatchEvent(new oh.Event(ah.REMOVE,e));this.dispatchEvent(new oh.Event(ah.ADD,i))}else{var r;for(r=s;r<t;++r){this.insertAt(r,undefined)}this.insertAt(t,i)}};oh.prototype.updateLength_=function(){this.set(oh.Property_.LENGTH,this.array_.length)};oh.prototype.assertUnique_=function(t,i){for(var s=0,e=this.array_.length;s<e;++s){if(this.array_[s]===t&&s!==i){throw new gn(58)}}};oh.Property_={LENGTH:"length"};oh.Event=function(t,i){mn.call(this,t);this.element=i};fn.inherits(oh.Event,mn);var fh=function(t,i,s){mn.call(this,t);this.map=i;this.frameState=s!==undefined?s:null};fn.inherits(fh,mn);var uh=function(t,i,s,e,r){fh.call(this,t,i,r);this.originalEvent=s;this.pixel=i.getEventPixel(s);this.coordinate=i.getCoordinateFromPixel(this.pixel);this.dragging=e!==undefined?e:false};fn.inherits(uh,fh);uh.prototype.preventDefault=function(){fh.prototype.preventDefault.call(this);this.originalEvent.preventDefault()};uh.prototype.stopPropagation=function(){fh.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()};var lh={SINGLECLICK:"singleclick",CLICK:zn.CLICK,DBLCLICK:zn.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var vh=function(t,i,s,e,r){uh.call(this,t,i,s.originalEvent,e,r);this.pointerEvent=s};fn.inherits(vh,uh);var ch={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var dh=function(t,i){this.dispatcher=t;this.mapping_=i};dh.prototype.getEvents=function(){return Object.keys(this.mapping_)};dh.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var mh=function(t){var i={mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout};dh.call(this,t,i);this.pointerMap=t.pointerMap;this.lastTouches=[]};fn.inherits(mh,dh);mh.POINTER_ID=1;mh.POINTER_TYPE="mouse";mh.DEDUP_DIST=25;mh.prototype.isEventSimulatedFromTouch_=function(t){var i=this.lastTouches;var s=t.clientX,e=t.clientY;for(var r=0,n=i.length,h;r<n&&(h=i[r]);r++){var a=Math.abs(s-h[0]),o=Math.abs(e-h[1]);if(a<=mh.DEDUP_DIST&&o<=mh.DEDUP_DIST){return true}}return false};mh.prepareEvent=function(t,i){var s=i.cloneEvent(t,t);var e=s.preventDefault;s.preventDefault=function(){t.preventDefault();e()};s.pointerId=mh.POINTER_ID;s.isPrimary=true;s.pointerType=mh.POINTER_TYPE;return s};mh.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){if(mh.POINTER_ID.toString()in this.pointerMap){this.cancel(t)}var i=mh.prepareEvent(t,this.dispatcher);this.pointerMap[mh.POINTER_ID.toString()]=t;this.dispatcher.down(i,t)}};mh.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}};mh.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[mh.POINTER_ID.toString()];if(i&&i.button===t.button){var s=mh.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t);this.cleanupMouse()}}};mh.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}};mh.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}};mh.prototype.cancel=function(t){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t);this.cleanupMouse()};mh.prototype.cleanupMouse=function(){delete this.pointerMap[mh.POINTER_ID.toString()]};var ph=function(t){var i={MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture};dh.call(this,t,i);this.pointerMap=t.pointerMap;this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};fn.inherits(ph,dh);ph.prototype.prepareEvent_=function(t){var i=t;if(typeof t.pointerType==="number"){i=this.dispatcher.cloneEvent(t,t);i.pointerType=this.POINTER_TYPES[t.pointerType]}return i};ph.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]};ph.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)};ph.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)};ph.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t);this.cleanup(t.pointerId)};ph.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)};ph.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)};ph.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t);this.cleanup(t.pointerId)};ph.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)};ph.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var zh=function(t){var i={pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture};dh.call(this,t,i)};fn.inherits(zh,dh);zh.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var Mh=function(t,i,s){mn.call(this,t);this.originalEvent=i;var e=s?s:{};this.buttons=this.getButtons_(e);this.pressure=this.getPressure_(e,this.buttons);this.bubbles="bubbles"in e?e["bubbles"]:false;this.cancelable="cancelable"in e?e["cancelable"]:false;this.view="view"in e?e["view"]:null;this.detail="detail"in e?e["detail"]:null;this.screenX="screenX"in e?e["screenX"]:0;this.screenY="screenY"in e?e["screenY"]:0;this.clientX="clientX"in e?e["clientX"]:0;this.clientY="clientY"in e?e["clientY"]:0;this.ctrlKey="ctrlKey"in e?e["ctrlKey"]:false;this.altKey="altKey"in e?e["altKey"]:false;this.shiftKey="shiftKey"in e?e["shiftKey"]:false;this.metaKey="metaKey"in e?e["metaKey"]:false;this.button="button"in e?e["button"]:0;this.relatedTarget="relatedTarget"in e?e["relatedTarget"]:null;this.pointerId="pointerId"in e?e["pointerId"]:0;this.width="width"in e?e["width"]:0;this.height="height"in e?e["height"]:0;this.tiltX="tiltX"in e?e["tiltX"]:0;this.tiltY="tiltY"in e?e["tiltY"]:0;this.pointerType="pointerType"in e?e["pointerType"]:"";this.hwTimestamp="hwTimestamp"in e?e["hwTimestamp"]:0;this.isPrimary="isPrimary"in e?e["isPrimary"]:false;if(i.preventDefault){this.preventDefault=function(){i.preventDefault()}}};fn.inherits(Mh,mn);Mh.prototype.getButtons_=function(t){var i;if(t.buttons||Mh.HAS_BUTTONS){i=t.buttons}else{switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}}return i};Mh.prototype.getPressure_=function(t,i){var s=0;if(t.pressure){s=t.pressure}else{s=i?.5:0}return s};Mh.HAS_BUTTONS=false;(function(){try{var t=new MouseEvent("click",{buttons:1});Mh.HAS_BUTTONS=t.buttons===1}catch(t){}})();var _h=function(t,i){var s={touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel};dh.call(this,t,s);this.pointerMap=t.pointerMap;this.mouseSource=i;this.firstTouchId_=undefined;this.clickCount_=0;this.resetId_=undefined};fn.inherits(_h,dh);_h.DEDUP_TIMEOUT=2500;_h.CLICK_COUNT_TIMEOUT=200;_h.POINTER_TYPE="touch";_h.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier};_h.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;if(i===0||i===1&&mh.POINTER_ID.toString()in this.pointerMap){this.firstTouchId_=t.identifier;this.cancelResetClickCount_()}};_h.prototype.removePrimaryPointer_=function(t){if(t.isPrimary){this.firstTouchId_=undefined;this.resetClickCount_()}};_h.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),_h.CLICK_COUNT_TIMEOUT)};_h.prototype.resetClickCountHandler_=function(){this.clickCount_=0;this.resetId_=undefined};_h.prototype.cancelResetClickCount_=function(){if(this.resetId_!==undefined){clearTimeout(this.resetId_)}};_h.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);s.pointerId=i.identifier+2;s.bubbles=true;s.cancelable=true;s.detail=this.clickCount_;s.button=0;s.buttons=1;s.width=i.webkitRadiusX||i.radiusX||0;s.height=i.webkitRadiusY||i.radiusY||0;s.pressure=i.webkitForce||i.force||.5;s.isPrimary=this.isPrimaryTouch_(i);s.pointerType=_h.POINTER_TYPE;s.clientX=i.clientX;s.clientY=i.clientY;s.screenX=i.screenX;s.screenY=i.screenY;return s};_h.prototype.processTouches_=function(t,i){var s=Array.prototype.slice.call(t.changedTouches);var e=s.length;function r(){t.preventDefault()}var n,h;for(n=0;n<e;++n){h=this.touchToPointer_(t,s[n]);h.preventDefault=r;i.call(this,t,h)}};_h.prototype.findTouch_=function(t,i){var s=t.length;var e;for(var r=0;r<s;r++){e=t[r];if(e.identifier===i){return true}}return false};_h.prototype.vacuumTouches_=function(t){var i=t.touches;var s=Object.keys(this.pointerMap);var e=s.length;if(e>=i.length){var r=[];var n,h,a;for(n=0;n<e;++n){h=s[n];a=this.pointerMap[h];if(h!=mh.POINTER_ID&&!this.findTouch_(i,h-2)){r.push(a.out)}}for(n=0;n<r.length;++n){this.cancelOut_(t,r[n])}}};_h.prototype.touchstart=function(t){this.vacuumTouches_(t);this.setPrimaryTouch_(t.changedTouches[0]);this.dedupSynthMouse_(t);this.clickCount_++;this.processTouches_(t,this.overDown_)};_h.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target};this.dispatcher.over(i,t);this.dispatcher.enter(i,t);this.dispatcher.down(i,t)};_h.prototype.touchmove=function(t){t.preventDefault();this.processTouches_(t,this.moveOverOut_)};_h.prototype.moveOverOut_=function(t,i){var s=i;var e=this.pointerMap[s.pointerId];if(!e){return}var r=e.out;var n=e.outTarget;this.dispatcher.move(s,t);if(r&&n!==s.target){r.relatedTarget=s.target;s.relatedTarget=n;r.target=n;if(s.target){this.dispatcher.leaveOut(r,t);this.dispatcher.enterOver(s,t)}else{s.target=n;s.relatedTarget=null;this.cancelOut_(t,s)}}e.out=s;e.outTarget=s.target};_h.prototype.touchend=function(t){this.dedupSynthMouse_(t);this.processTouches_(t,this.upOut_)};_h.prototype.upOut_=function(t,i){this.dispatcher.up(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};_h.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)};_h.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};_h.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId];this.removePrimaryPointer_(t)};_h.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches;var s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var e=[s.clientX,s.clientY];i.push(e);setTimeout((function(){kn.remove(i,e)}),_h.DEDUP_TIMEOUT)}};var gh=function(t){pn.call(this);this.element_=t;this.pointerMap={};this.eventMap_={};this.eventSourceList_=[];this.registerSources()};fn.inherits(gh,pn);gh.prototype.registerSources=function(){if(rh.POINTER){this.registerSource("native",new zh(this))}else if(rh.MSPOINTER){this.registerSource("ms",new ph(this))}else{var t=new mh(this);this.registerSource("mouse",t);if(rh.TOUCH){this.registerSource("touch",new _h(this,t))}}this.register_()};gh.prototype.registerSource=function(t,i){var s=i;var e=s.getEvents();if(e){e.forEach((function(t){var i=s.getHandlerForEvent(t);if(i){this.eventMap_[t]=i.bind(s)}}),this);this.eventSourceList_.push(s)}};gh.prototype.register_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.addEvents_(i.getEvents())}};gh.prototype.unregister_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.removeEvents_(i.getEvents())}};gh.prototype.eventHandler_=function(t){var i=t.type;var s=this.eventMap_[i];if(s){s(t)}};gh.prototype.addEvents_=function(t){t.forEach((function(t){cn.listen(this.element_,t,this.eventHandler_,this)}),this)};gh.prototype.removeEvents_=function(t){t.forEach((function(t){cn.unlisten(this.element_,t,this.eventHandler_,this)}),this)};gh.prototype.cloneEvent=function(t,i){var s={},e;for(var r=0,n=gh.CLONE_PROPS.length;r<n;r++){e=gh.CLONE_PROPS[r][0];s[e]=t[e]||i[e]||gh.CLONE_PROPS[r][1]}return s};gh.prototype.down=function(t,i){this.fireEvent(ch.POINTERDOWN,t,i)};gh.prototype.move=function(t,i){this.fireEvent(ch.POINTERMOVE,t,i)};gh.prototype.up=function(t,i){this.fireEvent(ch.POINTERUP,t,i)};gh.prototype.enter=function(t,i){t.bubbles=false;this.fireEvent(ch.POINTERENTER,t,i)};gh.prototype.leave=function(t,i){t.bubbles=false;this.fireEvent(ch.POINTERLEAVE,t,i)};gh.prototype.over=function(t,i){t.bubbles=true;this.fireEvent(ch.POINTEROVER,t,i)};gh.prototype.out=function(t,i){t.bubbles=true;this.fireEvent(ch.POINTEROUT,t,i)};gh.prototype.cancel=function(t,i){this.fireEvent(ch.POINTERCANCEL,t,i)};gh.prototype.leaveOut=function(t,i){this.out(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.leave(t,i)}};gh.prototype.enterOver=function(t,i){this.over(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.enter(t,i)}};gh.prototype.contains_=function(t,i){if(!t||!i){return false}return t.contains(i)};gh.prototype.makeEvent=function(t,i,s){return new Mh(t,s,i)};gh.prototype.fireEvent=function(t,i,s){var e=this.makeEvent(t,i,s);this.dispatchEvent(e)};gh.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)};gh.prototype.wrapMouseEvent=function(t,i){var s=this.makeEvent(t,mh.prepareEvent(i,this),i);return s};gh.prototype.disposeInternal=function(){this.unregister_();pn.prototype.disposeInternal.call(this)};gh.CLONE_PROPS=[["bubbles",false],["cancelable",false],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",false],["altKey",false],["shiftKey",false],["metaKey",false],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",false],["type",""],["target",null],["currentTarget",null],["which",0]];var bh=function(t,i){pn.call(this);this.map_=t;this.clickTimeoutId_=0;this.dragging_=false;this.dragListenerKeys_=[];this.moveTolerance_=i?i*rh.DEVICE_PIXEL_RATIO:rh.DEVICE_PIXEL_RATIO;this.down_=null;var s=this.map_.getViewport();this.activePointers_=0;this.trackedTouches_={};this.pointerEventHandler_=new gh(s);this.documentPointerEventHandler_=null;this.pointerdownListenerKey_=cn.listen(this.pointerEventHandler_,ch.POINTERDOWN,this.handlePointerDown_,this);this.relayedListenerKey_=cn.listen(this.pointerEventHandler_,ch.POINTERMOVE,this.relayEvent_,this)};fn.inherits(bh,pn);bh.prototype.emulateClick_=function(t){var i=new vh(lh.CLICK,this.map_,t);this.dispatchEvent(i);if(this.clickTimeoutId_!==0){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=0;i=new vh(lh.DBLCLICK,this.map_,t);this.dispatchEvent(i)}else{this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new vh(lh.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)}};bh.prototype.updateActivePointers_=function(t){var i=t;if(i.type==lh.POINTERUP||i.type==lh.POINTERCANCEL){delete this.trackedTouches_[i.pointerId]}else if(i.type==lh.POINTERDOWN){this.trackedTouches_[i.pointerId]=true}this.activePointers_=Object.keys(this.trackedTouches_).length};bh.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new vh(lh.POINTERUP,this.map_,t);this.dispatchEvent(i);if(!i.propagationStopped&&!this.dragging_&&this.isMouseActionButton_(t)){this.emulateClick_(this.down_)}if(this.activePointers_===0){this.dragListenerKeys_.forEach(cn.unlistenByKey);this.dragListenerKeys_.length=0;this.dragging_=false;this.down_=null;this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}};bh.prototype.isMouseActionButton_=function(t){return t.button===0};bh.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new vh(lh.POINTERDOWN,this.map_,t);this.dispatchEvent(i);this.down_=t;if(this.dragListenerKeys_.length===0){this.documentPointerEventHandler_=new gh(document);this.dragListenerKeys_.push(cn.listen(this.documentPointerEventHandler_,lh.POINTERMOVE,this.handlePointerMove_,this),cn.listen(this.documentPointerEventHandler_,lh.POINTERUP,this.handlePointerUp_,this),cn.listen(this.pointerEventHandler_,lh.POINTERCANCEL,this.handlePointerUp_,this))}};bh.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=true;var i=new vh(lh.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()};bh.prototype.relayEvent_=function(t){var i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new vh(t.type,this.map_,t,i))};bh.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_};bh.prototype.disposeInternal=function(){if(this.relayedListenerKey_){cn.unlistenByKey(this.relayedListenerKey_);this.relayedListenerKey_=null}if(this.pointerdownListenerKey_){cn.unlistenByKey(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(cn.unlistenByKey);this.dragListenerKeys_.length=0;if(this.documentPointerEventHandler_){this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}if(this.pointerEventHandler_){this.pointerEventHandler_.dispose();this.pointerEventHandler_=null}pn.prototype.disposeInternal.call(this)};var xh={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var yh={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var wh={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};var kh=function(t,i){this.priorityFunction_=t;this.keyFunction_=i;this.elements_=[];this.priorities_=[];this.queuedElements_={}};kh.DROP=Infinity;kh.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;vn.clear(this.queuedElements_)};kh.prototype.dequeue=function(){var t=this.elements_;var i=this.priorities_;var s=t[0];if(t.length==1){t.length=0;i.length=0}else{t[0]=t.pop();i[0]=i.pop();this.siftUp_(0)}var e=this.keyFunction_(s);delete this.queuedElements_[e];return s};kh.prototype.enqueue=function(t){bn.assert(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);if(i!=kh.DROP){this.elements_.push(t);this.priorities_.push(i);this.queuedElements_[this.keyFunction_(t)]=true;this.siftDown_(0,this.elements_.length-1);return true}return false};kh.prototype.getCount=function(){return this.elements_.length};kh.prototype.getLeftChildIndex_=function(t){return t*2+1};kh.prototype.getRightChildIndex_=function(t){return t*2+2};kh.prototype.getParentIndex_=function(t){return t-1>>1};kh.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--){this.siftUp_(t)}};kh.prototype.isEmpty=function(){return this.elements_.length===0};kh.prototype.isKeyQueued=function(t){return t in this.queuedElements_};kh.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))};kh.prototype.siftUp_=function(t){var i=this.elements_;var s=this.priorities_;var e=i.length;var r=i[t];var n=s[t];var h=t;while(t<e>>1){var a=this.getLeftChildIndex_(t);var o=this.getRightChildIndex_(t);var f=o<e&&s[o]<s[a]?o:a;i[t]=i[f];s[t]=s[f];t=f}i[t]=r;s[t]=n;this.siftDown_(h,t)};kh.prototype.siftDown_=function(t,i){var s=this.elements_;var e=this.priorities_;var r=s[i];var n=e[i];while(i>t){var h=this.getParentIndex_(i);if(e[h]>n){s[i]=s[h];e[i]=e[h];i=h}else{break}}s[i]=r;e[i]=n};kh.prototype.reprioritize=function(){var t=this.priorityFunction_;var i=this.elements_;var s=this.priorities_;var e=0;var r=i.length;var n,h,a;for(h=0;h<r;++h){n=i[h];a=t(n);if(a==kh.DROP){delete this.queuedElements_[this.keyFunction_(n)]}else{s[e]=a;i[e++]=n}}i.length=e;s.length=e;this.heapify_()};var Eh=function(t,i){kh.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()}));this.tileChangeCallback_=i;this.tilesLoading_=0;this.tilesLoadingKeys_={}};fn.inherits(Eh,kh);Eh.prototype.enqueue=function(t){var i=kh.prototype.enqueue.call(this,t);if(i){var s=t[0];cn.listen(s,zn.CHANGE,this.handleTileChange,this)}return i};Eh.prototype.getTilesLoading=function(){return this.tilesLoading_};Eh.prototype.handleTileChange=function(t){var i=t.target;var s=i.getState();if(s===wh.LOADED||s===wh.ERROR||s===wh.EMPTY||s===wh.ABORT){cn.unlisten(i,zn.CHANGE,this.handleTileChange,this);var e=i.getKey();if(e in this.tilesLoadingKeys_){delete this.tilesLoadingKeys_[e];--this.tilesLoading_}this.tileChangeCallback_()}};Eh.prototype.loadMoreTiles=function(t,i){var s=0;var e=false;var r,n,h;while(this.tilesLoading_<t&&s<i&&this.getCount()>0){n=this.dequeue()[0];h=n.getKey();r=n.getState();if(r===wh.ABORT){e=true}else if(r===wh.IDLE&&!(h in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[h]=true;++this.tilesLoading_;++s;n.load()}}if(s===0&&e){this.tileChangeCallback_()}};var Ch={};Ch.createExtent=function(t){return function(i){if(i){return[xn.clamp(i[0],t[0],t[2]),xn.clamp(i[1],t[1],t[3])]}else{return undefined}}};Ch.none=function(t){return t};var Nh={};Nh.createSnapToResolutions=function(t){return function(i,s,e){if(i!==undefined){var r=kn.linearFindNearest(t,i,e);r=xn.clamp(r+s,0,t.length-1);var n=Math.floor(r);if(r!=n&&n<t.length-1){var h=t[n]/t[n+1];return t[n]/Math.pow(h,r-n)}else{return t[n]}}else{return undefined}}};Nh.createSnapToPower=function(t,i,s){return function(e,r,n){if(e!==undefined){var h=-n/2+.5;var a=Math.floor(Math.log(i/e)/Math.log(t)+h);var o=Math.max(a+r,0);if(s!==undefined){o=Math.min(o,s)}return i/Math.pow(t,o)}else{return undefined}}};var Ih={};Ih.disable=function(t,i){if(t!==undefined){return 0}else{return undefined}};Ih.none=function(t,i){if(t!==undefined){return t+i}else{return undefined}};Ih.createSnapToN=function(t){var i=2*Math.PI/t;return function(t,s){if(t!==undefined){t=Math.floor((t+s)/i+.5)*i;return t}else{return undefined}}};Ih.createSnapToZero=function(t){var i=t||xn.toRadians(5);return function(t,s){if(t!==undefined){if(Math.abs(t+s)<=i){return 0}else{return t+s}}else{return undefined}}};var Sh={ANIMATING:0,INTERACTING:1};var Oh={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Th={};Th.padNumber=function(t,i,s){var e=s!==undefined?t.toFixed(s):""+t;var r=e.indexOf(".");r=r===-1?e.length:r;return r>i?e:new Array(1+i-r).join("0")+e};Th.compareVersions=function(t,i){var s=(""+t).split(".");var e=(""+i).split(".");for(var r=0;r<Math.max(s.length,e.length);r++){var n=parseInt(s[r]||"0",10);var h=parseInt(e[r]||"0",10);if(n>h){return 1}if(h>n){return-1}}return 0};var Ah={};Ah.add=function(t,i){t[0]+=i[0];t[1]+=i[1];return t};Ah.closestOnCircle=function(t,i){var s=i.getRadius();var e=i.getCenter();var r=e[0];var n=e[1];var h=t[0];var a=t[1];var o=h-r;var f=a-n;if(o===0&&f===0){o=1}var u=Math.sqrt(o*o+f*f);var l,v;l=r+s*o/u;v=n+s*f/u;return[l,v]};Ah.closestOnSegment=function(t,i){var s=t[0];var e=t[1];var r=i[0];var n=i[1];var h=r[0];var a=r[1];var o=n[0];var f=n[1];var u=o-h;var l=f-a;var v=u===0&&l===0?0:(u*(s-h)+l*(e-a))/(u*u+l*l||0);var c,d;if(v<=0){c=h;d=a}else if(v>=1){c=o;d=f}else{c=h+v*u;d=a+v*l}return[c,d]};Ah.createStringXY=function(t){return function(i){return Ah.toStringXY(i,t)}};Ah.degreesToStringHDMS=function(t,i,s){var e=xn.modulo(i+180,360)-180;var r=Math.abs(3600*e);var n=s||0;var h=Math.pow(10,n);var a=Math.floor(r/3600);var o=Math.floor((r-a*3600)/60);var f=r-a*3600-o*60;f=Math.ceil(f*h)/h;if(f>=60){f=0;o+=1}if(o>=60){o=0;a+=1}return a+"° "+Th.padNumber(o,2)+"′ "+Th.padNumber(f,2,n)+"″"+(e==0?"":" "+t.charAt(e<0?1:0))};Ah.format=function(t,i,s){if(t){return i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s))}else{return""}};Ah.equals=function(t,i){var s=true;for(var e=t.length-1;e>=0;--e){if(t[e]!=i[e]){s=false;break}}return s};Ah.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);var r=t[0]*s-t[1]*e;var n=t[1]*s+t[0]*e;t[0]=r;t[1]=n;return t};Ah.scale=function(t,i){t[0]*=i;t[1]*=i;return t};Ah.sub=function(t,i){t[0]-=i[0];t[1]-=i[1];return t};Ah.squaredDistance=function(t,i){var s=t[0]-i[0];var e=t[1]-i[1];return s*s+e*e};Ah.distance=function(t,i){return Math.sqrt(Ah.squaredDistance(t,i))};Ah.squaredDistanceToSegment=function(t,i){return Ah.squaredDistance(t,Ah.closestOnSegment(t,i))};Ah.toStringHDMS=function(t,i){if(t){return Ah.degreesToStringHDMS("NS",t[1],i)+" "+Ah.degreesToStringHDMS("EW",t[0],i)}else{return""}};Ah.toStringXY=function(t,i){return Ah.format(t,"{x}, {y}",i)};var Rh={};Rh.easeIn=function(t){return Math.pow(t,3)};Rh.easeOut=function(t){return 1-Rh.easeIn(1-t)};Rh.inAndOut=function(t){return 3*t*t-2*t*t*t};Rh.linear=function(t){return t};Rh.upAndDown=function(t){if(t<.5){return Rh.inAndOut(2*t)}else{return 1-Rh.inAndOut(2*(t-.5))}};var Ph=function(t){_n.call(this);var i=vn.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimations_=this.updateAnimations_.bind(this);this.projection_=Wn.createProjection(i.projection,"EPSG:3857");this.applyOptions_(i)};fn.inherits(Ph,_n);Ph.prototype.applyOptions_=function(t){var i={};i[Oh.CENTER]=t.center!==undefined?t.center:null;var s=Ph.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution;this.minResolution_=s.minResolution;this.zoomFactor_=s.zoomFactor;this.resolutions_=t.resolutions;this.minZoom_=s.minZoom;var e=Ph.createCenterConstraint_(t);var r=s.constraint;var n=Ph.createRotationConstraint_(t);this.constraints_={center:e,resolution:r,rotation:n};if(t.resolution!==undefined){i[Oh.RESOLUTION]=t.resolution}else if(t.zoom!==undefined){i[Oh.RESOLUTION]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_);if(this.resolutions_){i[Oh.RESOLUTION]=xn.clamp(Number(this.getResolution()||i[Oh.RESOLUTION]),this.minResolution_,this.maxResolution_)}}i[Oh.ROTATION]=t.rotation!==undefined?t.rotation:0;this.setProperties(i);this.options_=t};Ph.prototype.getUpdatedOptions_=function(t){var i=vn.assign({},this.options_);if(i.resolution!==undefined){i.resolution=this.getResolution()}else{i.zoom=this.getZoom()}i.center=this.getCenter();i.rotation=this.getRotation();return vn.assign({},i,t)};Ph.prototype.animate=function(t){var i=arguments.length;var s;if(i>1&&typeof arguments[i-1]==="function"){s=arguments[i-1];--i}if(!this.isDef()){var e=arguments[i-1];if(e.center){this.setCenter(e.center)}if(e.zoom!==undefined){this.setZoom(e.zoom)}if(e.rotation!==undefined){this.setRotation(e.rotation)}if(s){s(true)}return}var r=Date.now();var n=this.getCenter().slice();var h=this.getResolution();var a=this.getRotation();var o=[];for(var f=0;f<i;++f){var u=arguments[f];var l={start:r,complete:false,anchor:u.anchor,duration:u.duration!==undefined?u.duration:1e3,easing:u.easing||Rh.inAndOut};if(u.center){l.sourceCenter=n;l.targetCenter=u.center;n=l.targetCenter}if(u.zoom!==undefined){l.sourceResolution=h;l.targetResolution=this.constrainResolution(this.maxResolution_,u.zoom-this.minZoom_,0);h=l.targetResolution}else if(u.resolution){l.sourceResolution=h;l.targetResolution=u.resolution;h=l.targetResolution}if(u.rotation!==undefined){l.sourceRotation=a;var v=xn.modulo(u.rotation-a+Math.PI,2*Math.PI)-Math.PI;l.targetRotation=a+v;a=l.targetRotation}l.callback=s;if(Ph.isNoopAnimation(l)){l.complete=true}else{r+=l.duration}o.push(l)}this.animations_.push(o);this.setHint(Sh.ANIMATING,1);this.updateAnimations_()};Ph.prototype.getAnimating=function(){return this.hints_[Sh.ANIMATING]>0};Ph.prototype.getInteracting=function(){return this.hints_[Sh.INTERACTING]>0};Ph.prototype.cancelAnimations=function(){this.setHint(Sh.ANIMATING,-this.hints_[Sh.ANIMATING]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];if(s[0].callback){s[0].callback(false)}}this.animations_.length=0};Ph.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==undefined){cancelAnimationFrame(this.updateAnimationKey_);this.updateAnimationKey_=undefined}if(!this.getAnimating()){return}var t=Date.now();var i=false;for(var s=this.animations_.length-1;s>=0;--s){var e=this.animations_[s];var r=true;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(a.complete){continue}var o=t-a.start;var f=a.duration>0?o/a.duration:1;if(f>=1){a.complete=true;f=1}else{r=false}var u=a.easing(f);if(a.sourceCenter){var l=a.sourceCenter[0];var v=a.sourceCenter[1];var c=a.targetCenter[0];var d=a.targetCenter[1];var m=l+u*(c-l);var p=v+u*(d-v);this.set(Oh.CENTER,[m,p])}if(a.sourceResolution&&a.targetResolution){var z=u===1?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){this.set(Oh.CENTER,this.calculateCenterZoom(z,a.anchor))}this.set(Oh.RESOLUTION,z)}if(a.sourceRotation!==undefined&&a.targetRotation!==undefined){var M=u===1?xn.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){this.set(Oh.CENTER,this.calculateCenterRotate(M,a.anchor))}this.set(Oh.ROTATION,M)}i=true;if(!a.complete){break}}if(r){this.animations_[s]=null;this.setHint(Sh.ANIMATING,-1);var _=e[0].callback;if(_){_(true)}}}this.animations_=this.animations_.filter(Boolean);if(i&&this.updateAnimationKey_===undefined){this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_)}};Ph.prototype.calculateCenterRotate=function(t,i){var s;var e=this.getCenter();if(e!==undefined){s=[e[0]-i[0],e[1]-i[1]];Ah.rotate(s,t-this.getRotation());Ah.add(s,i)}return s};Ph.prototype.calculateCenterZoom=function(t,i){var s;var e=this.getCenter();var r=this.getResolution();if(e!==undefined&&r!==undefined){var n=i[0]-t*(i[0]-e[0])/r;var h=i[1]-t*(i[1]-e[1])/r;s=[n,h]}return s};Ph.prototype.getSizeFromViewport_=function(){var t=[100,100];var i='.ol-viewport[data-view="'+fn.getUid(this)+'"]';var s=document.querySelector(i);if(s){var e=getComputedStyle(s);t[0]=parseInt(e.width,10);t[1]=parseInt(e.height,10)}return t};Ph.prototype.constrainCenter=function(t){return this.constraints_.center(t)};Ph.prototype.constrainResolution=function(t,i,s){var e=i||0;var r=s||0;return this.constraints_.resolution(t,e,r)};Ph.prototype.constrainRotation=function(t,i){var s=i||0;return this.constraints_.rotation(t,s)};Ph.prototype.getCenter=function(){return this.get(Oh.CENTER)};Ph.prototype.getConstraints=function(){return this.constraints_};Ph.prototype.getHints=function(t){if(t!==undefined){t[0]=this.hints_[0];t[1]=this.hints_[1];return t}else{return this.hints_.slice()}};Ph.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_();var s=this.getCenter();bn.assert(s,1);var e=this.getResolution();bn.assert(e!==undefined,2);var r=this.getRotation();bn.assert(r!==undefined,3);return Nn.getForViewAndSize(s,e,r,i)};Ph.prototype.getMaxResolution=function(){return this.maxResolution_};Ph.prototype.getMinResolution=function(){return this.minResolution_};Ph.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)};Ph.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))};Ph.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)};Ph.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))};Ph.prototype.getProjection=function(){return this.projection_};Ph.prototype.getResolution=function(){return this.get(Oh.RESOLUTION)};Ph.prototype.getResolutions=function(){return this.resolutions_};Ph.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_();var e=Nn.getWidth(t)/s[0];var r=Nn.getHeight(t)/s[1];return Math.max(e,r)};Ph.prototype.getResolutionForValueFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=s/Math.pow(i,t*r);return e}};Ph.prototype.getRotation=function(){return this.get(Oh.ROTATION)};Ph.prototype.getValueForResolutionFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=Math.log(s/t)/Math.log(i)/r;return e}};Ph.prototype.getState=function(){var t=this.getCenter();var i=this.getProjection();var s=this.getResolution();var e=this.getRotation();return{center:t.slice(),projection:i!==undefined?i:null,resolution:s,rotation:e,zoom:this.getZoom()}};Ph.prototype.getZoom=function(){var t;var i=this.getResolution();if(i!==undefined){t=this.getZoomForResolution(i)}return t};Ph.prototype.getZoomForResolution=function(t){var i=this.minZoom_||0;var s,e;if(this.resolutions_){var r=kn.linearFindNearest(this.resolutions_,t,1);i=r;s=this.resolutions_[r];if(r==this.resolutions_.length-1){e=2}else{e=s/this.resolutions_[r+1]}}else{s=this.maxResolution_;e=this.zoomFactor_}return i+Math.log(s/t)/Math.log(e)};Ph.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)};Ph.prototype.fit=function(t,i){var s=i||{};var e=s.size;if(!e){e=this.getSizeFromViewport_()}var r;if(!(t instanceof Vn)){bn.assert(Array.isArray(t),24);bn.assert(!Nn.isEmpty(t),25);r=sh.fromExtent(t)}else if(t.getType()===yn.CIRCLE){t=t.getExtent();r=sh.fromExtent(t);r.rotate(this.getRotation(),Nn.getCenter(t))}else{r=t}var n=s.padding!==undefined?s.padding:[0,0,0,0];var h=s.constrainResolution!==undefined?s.constrainResolution:true;var a=s.nearest!==undefined?s.nearest:false;var o;if(s.minResolution!==undefined){o=s.minResolution}else if(s.maxZoom!==undefined){o=this.constrainResolution(this.maxResolution_,s.maxZoom-this.minZoom_,0)}else{o=0}var f=r.getFlatCoordinates();var u=this.getRotation();var l=Math.cos(-u);var v=Math.sin(-u);var c=+Infinity;var d=+Infinity;var m=-Infinity;var p=-Infinity;var z=r.getStride();for(var M=0,_=f.length;M<_;M+=z){var g=f[M]*l-f[M+1]*v;var b=f[M]*v+f[M+1]*l;c=Math.min(c,g);d=Math.min(d,b);m=Math.max(m,g);p=Math.max(p,b)}var x=this.getResolutionForExtent([c,d,m,p],[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]);x=isNaN(x)?o:Math.max(x,o);if(h){var y=this.constrainResolution(x,0,0);if(!a&&y<x){y=this.constrainResolution(y,-1,0)}x=y}v=-v;var w=(c+m)/2;var k=(d+p)/2;w+=(n[1]-n[3])/2*x;k+=(n[0]-n[2])/2*x;var E=w*l-k*v;var C=k*l+w*v;var N=[E,C];var I=s.callback?s.callback:fn.nullFunction;if(s.duration!==undefined){this.animate({resolution:x,center:N,duration:s.duration,easing:s.easing},I)}else{this.setResolution(x);this.setCenter(N);setTimeout(I.bind(undefined,true),0)}};Ph.prototype.centerOn=function(t,i,s){var e=this.getRotation();var r=Math.cos(-e);var n=Math.sin(-e);var h=t[0]*r-t[1]*n;var a=t[1]*r+t[0]*n;var o=this.getResolution();h+=(i[0]/2-s[0])*o;a+=(s[1]-i[1]/2)*o;n=-n;var f=h*r-a*n;var u=a*r+h*n;this.setCenter([f,u])};Ph.prototype.isDef=function(){return!!this.getCenter()&&this.getResolution()!==undefined};Ph.prototype.rotate=function(t,i){if(i!==undefined){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)};Ph.prototype.setCenter=function(t){this.set(Oh.CENTER,t);if(this.getAnimating()){this.cancelAnimations()}};Ph.prototype.setHint=function(t,i){this.hints_[t]+=i;this.changed();return this.hints_[t]};Ph.prototype.setResolution=function(t){this.set(Oh.RESOLUTION,t);if(this.getAnimating()){this.cancelAnimations()}};Ph.prototype.setRotation=function(t){this.set(Oh.ROTATION,t);if(this.getAnimating()){this.cancelAnimations()}};Ph.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))};Ph.createCenterConstraint_=function(t){if(t.extent!==undefined){return Ch.createExtent(t.extent)}else{return Ch.none}};Ph.createResolutionConstraint_=function(t){var i;var s;var e;var r=28;var n=2;var h=t.minZoom!==undefined?t.minZoom:fn.DEFAULT_MIN_ZOOM;var a=t.maxZoom!==undefined?t.maxZoom:r;var o=t.zoomFactor!==undefined?t.zoomFactor:n;if(t.resolutions!==undefined){var f=t.resolutions;s=f[h];e=f[a]!==undefined?f[a]:f[f.length-1];i=Nh.createSnapToResolutions(f)}else{var u=Wn.createProjection(t.projection,"EPSG:3857");var l=u.getExtent();var v=!l?360*Wn.METERS_PER_UNIT[Tn.DEGREES]/u.getMetersPerUnit():Math.max(Nn.getWidth(l),Nn.getHeight(l));var c=v/fn.DEFAULT_TILE_SIZE/Math.pow(n,fn.DEFAULT_MIN_ZOOM);var d=c/Math.pow(n,r-fn.DEFAULT_MIN_ZOOM);s=t.maxResolution;if(s!==undefined){h=0}else{s=c/Math.pow(o,h)}e=t.minResolution;if(e===undefined){if(t.maxZoom!==undefined){if(t.maxResolution!==undefined){e=s/Math.pow(o,a)}else{e=c/Math.pow(o,a)}}else{e=d}}a=h+Math.floor(Math.log(s/e)/Math.log(o));e=s/Math.pow(o,a-h);i=Nh.createSnapToPower(o,s,a-h)}return{constraint:i,maxResolution:s,minResolution:e,minZoom:h,zoomFactor:o}};Ph.createRotationConstraint_=function(t){var i=t.enableRotation!==undefined?t.enableRotation:true;if(i){var s=t.constrainRotation;if(s===undefined||s===true){return Ih.createSnapToZero()}else if(s===false){return Ih.none}else if(typeof s==="number"){return Ih.createSnapToN(s)}else{return Ih.none}}else{return Ih.disable}};Ph.isNoopAnimation=function(t){if(t.sourceCenter&&t.targetCenter){if(!Ah.equals(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true};var Lh={};Lh.createCanvasContext2D=function(t,i){var s=document.createElement("CANVAS");if(t){s.width=t}if(i){s.height=i}return s.getContext("2d")};Lh.outerWidth=function(t){var i=t.offsetWidth;var s=getComputedStyle(t);i+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10);return i};Lh.outerHeight=function(t){var i=t.offsetHeight;var s=getComputedStyle(t);i+=parseInt(s.marginTop,10)+parseInt(s.marginBottom,10);return i};Lh.replaceNode=function(t,i){var s=i.parentNode;if(s){s.replaceChild(t,i)}};Lh.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null};Lh.removeChildren=function(t){while(t.lastChild){t.removeChild(t.lastChild)}};var Dh={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"};var Fh=function(t){_n.call(this);var i=vn.assign({},t);i[Dh.OPACITY]=t.opacity!==undefined?t.opacity:1;i[Dh.VISIBLE]=t.visible!==undefined?t.visible:true;i[Dh.Z_INDEX]=t.zIndex!==undefined?t.zIndex:0;i[Dh.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;i[Dh.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;this.setProperties(i);this.state_={layer:this,managed:true}};fn.inherits(Fh,_n);Fh.prototype.getType=function(){return this.type};Fh.prototype.getLayerState=function(){this.state_.opacity=xn.clamp(this.getOpacity(),0,1);this.state_.sourceState=this.getSourceState();this.state_.visible=this.getVisible();this.state_.extent=this.getExtent();this.state_.zIndex=this.getZIndex();this.state_.maxResolution=this.getMaxResolution();this.state_.minResolution=Math.max(this.getMinResolution(),0);return this.state_};Fh.prototype.getLayersArray=function(t){};Fh.prototype.getLayerStatesArray=function(t){};Fh.prototype.getExtent=function(){return this.get(Dh.EXTENT)};Fh.prototype.getMaxResolution=function(){return this.get(Dh.MAX_RESOLUTION)};Fh.prototype.getMinResolution=function(){return this.get(Dh.MIN_RESOLUTION)};Fh.prototype.getOpacity=function(){return this.get(Dh.OPACITY)};Fh.prototype.getSourceState=function(){};Fh.prototype.getVisible=function(){return this.get(Dh.VISIBLE)};Fh.prototype.getZIndex=function(){return this.get(Dh.Z_INDEX)};Fh.prototype.setExtent=function(t){this.set(Dh.EXTENT,t)};Fh.prototype.setMaxResolution=function(t){this.set(Dh.MAX_RESOLUTION,t)};Fh.prototype.setMinResolution=function(t){this.set(Dh.MIN_RESOLUTION,t)};Fh.prototype.setOpacity=function(t){this.set(Dh.OPACITY,t)};Fh.prototype.setVisible=function(t){this.set(Dh.VISIBLE,t)};Fh.prototype.setZIndex=function(t){this.set(Dh.Z_INDEX,t)};var Wh={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var Gh=function(t){var i=t||{};var s=vn.assign({},i);delete s.layers;var e=i.layers;Fh.call(this,s);this.layersListenerKeys_=[];this.listenerKeys_={};cn.listen(this,_n.getChangeEventType(Gh.Property_.LAYERS),this.handleLayersChanged_,this);if(e){if(Array.isArray(e)){e=new oh(e.slice(),{unique:true})}else{bn.assert(e instanceof oh,43);e=e}}else{e=new oh(undefined,{unique:true})}this.setLayers(e)};fn.inherits(Gh,Fh);Gh.prototype.handleLayerChange_=function(){this.changed()};Gh.prototype.handleLayersChanged_=function(t){this.layersListenerKeys_.forEach(cn.unlistenByKey);this.layersListenerKeys_.length=0;var i=this.getLayers();this.layersListenerKeys_.push(cn.listen(i,ah.ADD,this.handleLayersAdd_,this),cn.listen(i,ah.REMOVE,this.handleLayersRemove_,this));for(var s in this.listenerKeys_){this.listenerKeys_[s].forEach(cn.unlistenByKey)}vn.clear(this.listenerKeys_);var e=i.getArray();var r,n,h;for(r=0,n=e.length;r<n;r++){h=e[r];this.listenerKeys_[fn.getUid(h).toString()]=[cn.listen(h,ln.PROPERTYCHANGE,this.handleLayerChange_,this),cn.listen(h,zn.CHANGE,this.handleLayerChange_,this)]}this.changed()};Gh.prototype.handleLayersAdd_=function(t){var i=t.element;var s=fn.getUid(i).toString();this.listenerKeys_[s]=[cn.listen(i,ln.PROPERTYCHANGE,this.handleLayerChange_,this),cn.listen(i,zn.CHANGE,this.handleLayerChange_,this)];this.changed()};Gh.prototype.handleLayersRemove_=function(t){var i=t.element;var s=fn.getUid(i).toString();this.listenerKeys_[s].forEach(cn.unlistenByKey);delete this.listenerKeys_[s];this.changed()};Gh.prototype.getLayers=function(){return this.get(Gh.Property_.LAYERS)};Gh.prototype.setLayers=function(t){this.set(Gh.Property_.LAYERS,t)};Gh.prototype.getLayersArray=function(t){var i=t!==undefined?t:[];this.getLayers().forEach((function(t){t.getLayersArray(i)}));return i};Gh.prototype.getLayerStatesArray=function(t){var i=t!==undefined?t:[];var s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var e=this.getLayerState();var r,n,h;for(r=s,n=i.length;r<n;r++){h=i[r];h.opacity*=e.opacity;h.visible=h.visible&&e.visible;h.maxResolution=Math.min(h.maxResolution,e.maxResolution);h.minResolution=Math.max(h.minResolution,e.minResolution);if(e.extent!==undefined){if(h.extent!==undefined){h.extent=Nn.getIntersection(h.extent,e.extent)}else{h.extent=e.extent}}}return i};Gh.prototype.getSourceState=function(){return Wh.READY};Gh.Property_={LAYERS:"layers"};var jh={MAP_RENDERER:"MAP_RENDERER",LAYER_RENDERER:"LAYER_RENDERER"};var Vh={};Vh.mapRendererPlugins_=[];Vh.getMapRendererPlugins=function(){return Vh.mapRendererPlugins_};Vh.layerRendererPlugins_=[];Vh.getLayerRendererPlugins=function(){return Vh.layerRendererPlugins_};Vh.register=function(t,i){var s;switch(t){case jh.MAP_RENDERER:{s=Vh.mapRendererPlugins_;s.push(i);break}case jh.LAYER_RENDERER:{s=Vh.layerRendererPlugins_;s.push(i);break}default:{throw new Error("Unsupported plugin type: "+t)}}};Vh.registerMultiple=function(t,i){for(var s=0,e=i.length;s<e;++s){Vh.register(t,i[s])}};var Uh={CANVAS:"canvas",WEBGL:"webgl"};var Xh={};Xh.buffer=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]+2*i;s[1]=t[1]+2*i;return s};Xh.hasArea=function(t){return t[0]>0&&t[1]>0};Xh.scale=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]*i+.5|0;s[1]=t[1]*i+.5|0;return s};Xh.toSize=function(t,i){if(Array.isArray(t)){return t}else{if(i===undefined){i=[t,t]}else{i[0]=i[1]=t}return i}};var qh=function(t){_n.call(this);var i=qh.createOptionsInternal(t);this.loadTilesWhileAnimating_=t.loadTilesWhileAnimating!==undefined?t.loadTilesWhileAnimating:false;this.loadTilesWhileInteracting_=t.loadTilesWhileInteracting!==undefined?t.loadTilesWhileInteracting:false;this.pixelRatio_=t.pixelRatio!==undefined?t.pixelRatio:rh.DEVICE_PIXEL_RATIO;this.logos_=i.logos;this.animationDelay_=function(){this.animationDelayKey_=undefined;this.renderFrame_.call(this,Date.now())}.bind(this);this.coordinateToPixelTransform_=Gn.create();this.pixelToCoordinateTransform_=Gn.create();this.frameIndex_=0;this.frameState_=null;this.previousExtent_=null;this.viewPropertyListenerKey_=null;this.viewChangeListenerKey_=null;this.layerGroupPropertyListenerKeys_=null;this.viewport_=document.createElement("DIV");this.viewport_.className="ol-viewport"+(rh.TOUCH?" ol-touch":"");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.viewport_.style.msTouchAction="none";this.viewport_.style.touchAction="none";this.overlayContainer_=document.createElement("DIV");this.overlayContainer_.className="ol-overlaycontainer";this.viewport_.appendChild(this.overlayContainer_);this.overlayContainerStopEvent_=document.createElement("DIV");this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";var s=[zn.CLICK,zn.DBLCLICK,zn.MOUSEDOWN,zn.TOUCHSTART,zn.MSPOINTERDOWN,lh.POINTERDOWN,zn.MOUSEWHEEL,zn.WHEEL];for(var e=0,r=s.length;e<r;++e){cn.listen(this.overlayContainerStopEvent_,s[e],mn.stopPropagation)}this.viewport_.appendChild(this.overlayContainerStopEvent_);this.mapBrowserEventHandler_=new bh(this,t.moveTolerance);for(var n in lh){cn.listen(this.mapBrowserEventHandler_,lh[n],this.handleMapBrowserEvent,this)}this.keyboardEventTarget_=i.keyboardEventTarget;this.keyHandlerKeys_=null;cn.listen(this.viewport_,zn.WHEEL,this.handleBrowserEvent,this);cn.listen(this.viewport_,zn.MOUSEWHEEL,this.handleBrowserEvent,this);this.controls=i.controls||new oh;this.interactions=i.interactions||new oh;this.overlays_=i.overlays;this.overlayIdIndex_={};this.renderer_=i.mapRendererPlugin["create"](this.viewport_,this);this.focus_=null;this.postRenderFunctions_=[];this.tileQueue_=new Eh(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.skippedFeatureUids_={};cn.listen(this,_n.getChangeEventType(yh.LAYERGROUP),this.handleLayerGroupChanged_,this);cn.listen(this,_n.getChangeEventType(yh.VIEW),this.handleViewChanged_,this);cn.listen(this,_n.getChangeEventType(yh.SIZE),this.handleSizeChanged_,this);cn.listen(this,_n.getChangeEventType(yh.TARGET),this.handleTargetChanged_,this);this.setProperties(i.values);this.controls.forEach((function(t){t.setMap(this)}),this);cn.listen(this.controls,ah.ADD,(function(t){t.element.setMap(this)}),this);cn.listen(this.controls,ah.REMOVE,(function(t){t.element.setMap(null)}),this);this.interactions.forEach((function(t){t.setMap(this)}),this);cn.listen(this.interactions,ah.ADD,(function(t){t.element.setMap(this)}),this);cn.listen(this.interactions,ah.REMOVE,(function(t){t.element.setMap(null)}),this);this.overlays_.forEach(this.addOverlayInternal_,this);cn.listen(this.overlays_,ah.ADD,(function(t){this.addOverlayInternal_(t.element)}),this);cn.listen(this.overlays_,ah.REMOVE,(function(t){var i=t.element;var s=i.getId();if(s!==undefined){delete this.overlayIdIndex_[s.toString()]}t.element.setMap(null)}),this)};fn.inherits(qh,_n);qh.prototype.addControl=function(t){this.getControls().push(t)};qh.prototype.addInteraction=function(t){this.getInteractions().push(t)};qh.prototype.addLayer=function(t){var i=this.getLayerGroup().getLayers();i.push(t)};qh.prototype.addOverlay=function(t){this.getOverlays().push(t)};qh.prototype.addOverlayInternal_=function(t){var i=t.getId();if(i!==undefined){this.overlayIdIndex_[i.toString()]=t}t.setMap(this)};qh.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();cn.unlisten(this.viewport_,zn.WHEEL,this.handleBrowserEvent,this);cn.unlisten(this.viewport_,zn.MOUSEWHEEL,this.handleBrowserEvent,this);if(this.handleResize_!==undefined){window.removeEventListener(zn.RESIZE,this.handleResize_,false);this.handleResize_=undefined}if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_);this.animationDelayKey_=undefined}this.setTarget(null);_n.prototype.disposeInternal.call(this)};qh.prototype.forEachFeatureAtPixel=function(t,i,s){if(!this.frameState_){return}var e=this.getCoordinateFromPixel(t);s=s!==undefined?s:{};var r=s.hitTolerance!==undefined?s.hitTolerance*this.frameState_.pixelRatio:0;var n=s.layerFilter!==undefined?s.layerFilter:Sn.TRUE;return this.renderer_.forEachFeatureAtCoordinate(e,this.frameState_,r,i,null,n,null)};qh.prototype.getFeaturesAtPixel=function(t,i){var s=null;this.forEachFeatureAtPixel(t,(function(t){if(!s){s=[]}s.push(t)}),i);return s};qh.prototype.forEachLayerAtPixel=function(t,i,s,e,r){if(!this.frameState_){return}var n=s!==undefined?s:null;var h=e!==undefined?e:Sn.TRUE;var a=r!==undefined?r:null;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,n,h,a)};qh.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_){return false}var s=this.getCoordinateFromPixel(t);i=i!==undefined?i:{};var e=i.layerFilter!==undefined?i.layerFilter:Sn.TRUE;var r=i.hitTolerance!==undefined?i.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,r,e,null)};qh.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))};qh.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect();var s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]};qh.prototype.getTarget=function(){return this.get(yh.TARGET)};qh.prototype.getTargetElement=function(){var t=this.getTarget();if(t!==undefined){return typeof t==="string"?document.getElementById(t):t}else{return null}};qh.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;if(!i){return null}else{return Gn.apply(i.pixelToCoordinateTransform,t.slice())}};qh.prototype.getControls=function(){return this.controls};qh.prototype.getOverlays=function(){return this.overlays_};qh.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return i!==undefined?i:null};qh.prototype.getInteractions=function(){return this.interactions};qh.prototype.getLayerGroup=function(){return this.get(yh.LAYERGROUP)};qh.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t};qh.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;if(!i){return null}else{return Gn.apply(i.coordinateToPixelTransform,t.slice(0,2))}};qh.prototype.getRenderer=function(){return this.renderer_};qh.prototype.getSize=function(){return this.get(yh.SIZE)};qh.prototype.getView=function(){return this.get(yh.VIEW)};qh.prototype.getViewport=function(){return this.viewport_};qh.prototype.getOverlayContainer=function(){return this.overlayContainer_};qh.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_};qh.prototype.getTilePriority=function(t,i,s,e){var r=this.frameState_;if(!r||!(i in r.wantedTiles)){return kh.DROP}if(!r.wantedTiles[i][t.getKey()]){return kh.DROP}var n=s[0]-r.focus[0];var h=s[1]-r.focus[1];return 65536*Math.log(e)+Math.sqrt(n*n+h*h)/e};qh.prototype.handleBrowserEvent=function(t,i){var s=i||t.type;var e=new uh(s,this,t);this.handleMapBrowserEvent(e)};qh.prototype.handleMapBrowserEvent=function(t){if(!this.frameState_){return}this.focus_=t.coordinate;t.frameState=this.frameState_;var i=this.getInteractions().getArray();var s;if(this.dispatchEvent(t)!==false){for(s=i.length-1;s>=0;s--){var e=i[s];if(!e.getActive()){continue}var r=e.handleEvent(t);if(!r){break}}}};qh.prototype.handlePostRender=function(){var t=this.frameState_;var i=this.tileQueue_;if(!i.isEmpty()){var s=16;var e=s;if(t){var r=t.viewHints;if(r[Sh.ANIMATING]){s=this.loadTilesWhileAnimating_?8:0;e=2}if(r[Sh.INTERACTING]){s=this.loadTilesWhileInteracting_?8:0;e=2}}if(i.getTilesLoading()<s){i.reprioritize();i.loadMoreTiles(s,e)}}var n=this.postRenderFunctions_;var h,a;for(h=0,a=n.length;h<a;++h){n[h](this,t)}n.length=0};qh.prototype.handleSizeChanged_=function(){this.render()};qh.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()){t=this.getTargetElement()}if(this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i){cn.unlistenByKey(this.keyHandlerKeys_[i])}this.keyHandlerKeys_=null}if(!t){this.renderer_.removeLayerRenderers();Lh.removeNode(this.viewport_);if(this.handleResize_!==undefined){window.removeEventListener(zn.RESIZE,this.handleResize_,false);this.handleResize_=undefined}}else{t.appendChild(this.viewport_);var e=!this.keyboardEventTarget_?t:this.keyboardEventTarget_;this.keyHandlerKeys_=[cn.listen(e,zn.KEYDOWN,this.handleBrowserEvent,this),cn.listen(e,zn.KEYPRESS,this.handleBrowserEvent,this)];if(!this.handleResize_){this.handleResize_=this.updateSize.bind(this);window.addEventListener(zn.RESIZE,this.handleResize_,false)}}this.updateSize()};qh.prototype.handleTileChange_=function(){this.render()};qh.prototype.handleViewPropertyChanged_=function(){this.render()};qh.prototype.handleViewChanged_=function(){if(this.viewPropertyListenerKey_){cn.unlistenByKey(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){cn.unlistenByKey(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}var t=this.getView();if(t){this.viewport_.setAttribute("data-view",fn.getUid(t));this.viewPropertyListenerKey_=cn.listen(t,ln.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=cn.listen(t,zn.CHANGE,this.handleViewPropertyChanged_,this)}this.render()};qh.prototype.handleLayerGroupChanged_=function(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(cn.unlistenByKey);this.layerGroupPropertyListenerKeys_=null}var t=this.getLayerGroup();if(t){this.layerGroupPropertyListenerKeys_=[cn.listen(t,ln.PROPERTYCHANGE,this.render,this),cn.listen(t,zn.CHANGE,this.render,this)]}this.render()};qh.prototype.isRendered=function(){return!!this.frameState_};qh.prototype.renderSync=function(){if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_)}this.animationDelay_()};qh.prototype.render=function(){if(this.animationDelayKey_===undefined){this.animationDelayKey_=requestAnimationFrame(this.animationDelay_)}};qh.prototype.removeControl=function(t){return this.getControls().remove(t)};qh.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)};qh.prototype.removeLayer=function(t){var i=this.getLayerGroup().getLayers();return i.remove(t)};qh.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)};qh.prototype.renderFrame_=function(t){var i,s,e;var r=this.getSize();var n=this.getView();var h=Nn.createEmpty();var a=this.frameState_;var o=null;if(r!==undefined&&Xh.hasArea(r)&&n&&n.isDef()){var f=n.getHints(this.frameState_?this.frameState_.viewHints:undefined);var u=this.getLayerGroup().getLayerStatesArray();var l={};for(i=0,s=u.length;i<s;++i){l[fn.getUid(u[i].layer)]=u[i]}e=n.getState();var v=e.center;var c=e.resolution/this.pixelRatio_;v[0]=Math.round(v[0]/c)*c;v[1]=Math.round(v[1]/c)*c;o={animate:false,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:h,focus:!this.focus_?v:this.focus_,index:this.frameIndex_++,layerStates:l,layerStatesArray:u,logos:vn.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:f,wantedTiles:{}}}if(o){o.extent=Nn.getForViewAndSize(e.center,e.resolution,e.rotation,o.size,h)}this.frameState_=o;this.renderer_.renderFrame(o);if(o){if(o.animate){this.render()}Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions);if(a){var d=!this.previousExtent_||!Nn.isEmpty(this.previousExtent_)&&!Nn.equals(o.extent,this.previousExtent_);if(d){this.dispatchEvent(new fh(xh.MOVESTART,this,a));this.previousExtent_=Nn.createOrUpdateEmpty(this.previousExtent_)}}var m=this.previousExtent_&&!o.viewHints[Sh.ANIMATING]&&!o.viewHints[Sh.INTERACTING]&&!Nn.equals(o.extent,this.previousExtent_);if(m){this.dispatchEvent(new fh(xh.MOVEEND,this,o));Nn.clone(o.extent,this.previousExtent_)}}this.dispatchEvent(new fh(xh.POSTRENDER,this,o));setTimeout(this.handlePostRender.bind(this),0)};qh.prototype.setLayerGroup=function(t){this.set(yh.LAYERGROUP,t)};qh.prototype.setSize=function(t){this.set(yh.SIZE,t)};qh.prototype.setTarget=function(t){this.set(yh.TARGET,t)};qh.prototype.setView=function(t){this.set(yh.VIEW,t)};qh.prototype.skipFeature=function(t){var i=fn.getUid(t).toString();this.skippedFeatureUids_[i]=true;this.render()};qh.prototype.updateSize=function(){var t=this.getTargetElement();if(!t){this.setSize(undefined)}else{var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i["borderLeftWidth"])-parseFloat(i["paddingLeft"])-parseFloat(i["paddingRight"])-parseFloat(i["borderRightWidth"]),t.offsetHeight-parseFloat(i["borderTopWidth"])-parseFloat(i["paddingTop"])-parseFloat(i["paddingBottom"])-parseFloat(i["borderBottomWidth"])])}};qh.prototype.unskipFeature=function(t){var i=fn.getUid(t).toString();delete this.skippedFeatureUids_[i];this.render()};qh.DEFAULT_RENDERER_TYPES=[Uh.CANVAS,Uh.WEBGL];qh.LOGO_URL="data:image/png;base64,"+"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBI"+"WXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAA"+"AhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszW"+"WMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvY"+"asvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvX"+"H1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1Vk"+"bMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW"+"2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLP"+"VcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqT"+"acrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaar"+"ldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+Hi"+"zeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDn"+"BAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSF"+"hYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJ"+"REFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxC"+"Brb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe"+"0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8"+"a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7a"+"hgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCn"+"B3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDg"+"q82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC";qh.createOptionsInternal=function(t){var i=null;if(t.keyboardEventTarget!==undefined){i=typeof t.keyboardEventTarget==="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget}var s={};var e={};if(t.logo===undefined||typeof t.logo==="boolean"&&t.logo){e[qh.LOGO_URL]="https://openlayers.org/"}else{var r=t.logo;if(typeof r==="string"){e[r]=""}else if(r instanceof HTMLElement){e[fn.getUid(r).toString()]=r}else if(r){bn.assert(typeof r.href=="string",44);bn.assert(typeof r.src=="string",45);e[r.src]=r.href}}var n=t.layers instanceof Gh?t.layers:new Gh({layers:t.layers});s[yh.LAYERGROUP]=n;s[yh.TARGET]=t.target;s[yh.VIEW]=t.view!==undefined?t.view:new Ph;var h;if(t.renderer!==undefined){if(Array.isArray(t.renderer)){h=t.renderer}else if(typeof t.renderer==="string"){h=[t.renderer]}else{bn.assert(false,46)}if(h.indexOf("dom")>=0){h=h.concat(qh.DEFAULT_RENDERER_TYPES)}}else{h=qh.DEFAULT_RENDERER_TYPES}var a;var o=Vh.getMapRendererPlugins();t:for(var f=0,u=h.length;f<u;++f){var l=h[f];for(var v=0,c=o.length;v<c;++v){var d=o[v];if(d["handles"](l)){a=d;break t}}}if(!a){throw new Error("Unable to create a map renderer for types: "+h.join(", "))}var m;if(t.controls!==undefined){if(Array.isArray(t.controls)){m=new oh(t.controls.slice())}else{bn.assert(t.controls instanceof oh,47);m=t.controls}}var p;if(t.interactions!==undefined){if(Array.isArray(t.interactions)){p=new oh(t.interactions.slice())}else{bn.assert(t.interactions instanceof oh,48);p=t.interactions}}var z;if(t.overlays!==undefined){if(Array.isArray(t.overlays)){z=new oh(t.overlays.slice())}else{bn.assert(t.overlays instanceof oh,49);z=t.overlays}}else{z=new oh}return{controls:m,interactions:p,keyboardEventTarget:i,logos:e,overlays:z,mapRendererPlugin:a,values:s}};var Yh=function(t){_n.call(this);this.element=t.element?t.element:null;this.target_=null;this.map_=null;this.listenerKeys=[];this.render=t.render?t.render:fn.nullFunction;if(t.target){this.setTarget(t.target)}};fn.inherits(Yh,_n);Yh.prototype.disposeInternal=function(){Lh.removeNode(this.element);_n.prototype.disposeInternal.call(this)};Yh.prototype.getMap=function(){return this.map_};Yh.prototype.setMap=function(t){if(this.map_){Lh.removeNode(this.element)}for(var i=0,s=this.listenerKeys.length;i<s;++i){cn.unlistenByKey(this.listenerKeys[i])}this.listenerKeys.length=0;this.map_=t;if(this.map_){var e=this.target_?this.target_:t.getOverlayContainerStopEvent();e.appendChild(this.element);if(this.render!==fn.nullFunction){this.listenerKeys.push(cn.listen(t,xh.POSTRENDER,this.render,this))}t.render()}};Yh.prototype.setTarget=function(t){this.target_=typeof t==="string"?document.getElementById(t):t};var Bh={};Bh.CLASS_HIDDEN="ol-hidden";Bh.CLASS_SELECTABLE="ol-selectable";Bh.CLASS_UNSELECTABLE="ol-unselectable";Bh.CLASS_UNSUPPORTED="ol-unsupported";Bh.CLASS_CONTROL="ol-control";Bh.getFontFamilies=function(){var t;var i={};return function(s){if(!t){t=document.createElement("div").style}if(!(s in i)){t.font=s;var e=t.fontFamily;t.font="";if(!e){return null}i[s]=e.split(/,\s?/)}return i[s]}}();var Hh={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render"};var Jh=function(t){var i=vn.assign({},t);delete i.source;Fh.call(this,i);this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;if(t.map){this.setMap(t.map)}cn.listen(this,_n.getChangeEventType(Dh.SOURCE),this.handleSourcePropertyChange_,this);var s=t.source?t.source:null;this.setSource(s)};fn.inherits(Jh,Fh);Jh.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution};Jh.prototype.getLayersArray=function(t){var i=t?t:[];i.push(this);return i};Jh.prototype.getLayerStatesArray=function(t){var i=t?t:[];i.push(this.getLayerState());return i};Jh.prototype.getSource=function(){var t=this.get(Dh.SOURCE);return t||null};Jh.prototype.getSourceState=function(){var t=this.getSource();return!t?Wh.UNDEFINED:t.getState()};Jh.prototype.handleSourceChange_=function(){this.changed()};Jh.prototype.handleSourcePropertyChange_=function(){if(this.sourceChangeKey_){cn.unlistenByKey(this.sourceChangeKey_);this.sourceChangeKey_=null}var t=this.getSource();if(t){this.sourceChangeKey_=cn.listen(t,zn.CHANGE,this.handleSourceChange_,this)}this.changed()};Jh.prototype.setMap=function(t){if(this.mapPrecomposeKey_){cn.unlistenByKey(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){cn.unlistenByKey(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=cn.listen(t,Hh.PRECOMPOSE,(function(t){var i=this.getLayerState();i.managed=false;i.zIndex=Infinity;t.frameState.layerStatesArray.push(i);t.frameState.layerStates[fn.getUid(this)]=i}),this);this.mapRenderKey_=cn.listen(this,zn.CHANGE,t.render,t);this.changed()}};Jh.prototype.setSource=function(t){this.set(Dh.SOURCE,t)};var Zh=function(t){var i=t?t:{};this.ulElement_=document.createElement("UL");this.logoLi_=document.createElement("LI");this.ulElement_.appendChild(this.logoLi_);this.logoLi_.style.display="none";this.collapsed_=i.collapsed!==undefined?i.collapsed:true;this.collapsible_=i.collapsible!==undefined?i.collapsible:true;if(!this.collapsible_){this.collapsed_=false}var s=i.className!==undefined?i.className:"ol-attribution";var e=i.tipLabel!==undefined?i.tipLabel:"Attributions";var r=i.collapseLabel!==undefined?i.collapseLabel:"»";if(typeof r==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=r}else{this.collapseLabel_=r}var n=i.label!==undefined?i.label:"i";if(typeof n==="string"){this.label_=document.createElement("span");this.label_.textContent=n}else{this.label_=n}var h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;var a=document.createElement("button");a.setAttribute("type","button");a.title=e;a.appendChild(h);cn.listen(a,zn.CLICK,this.handleClick_,this);var o=s+" "+Bh.CLASS_UNSELECTABLE+" "+Bh.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible");var f=document.createElement("div");f.className=o;f.appendChild(this.ulElement_);f.appendChild(a);var u=i.render?i.render:Zh.render;Yh.call(this,{element:f,render:u,target:i.target});this.renderedAttributions_=[];this.renderedVisible_=true;this.logoElements_={}};fn.inherits(Zh,Yh);Zh.prototype.getSourceAttributions_=function(t){var i={};var s=[];var e=t.layerStatesArray;var r=t.viewState.resolution;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(!Jh.visibleAtResolution(a,r)){continue}var o=a.layer.getSource();if(!o){continue}var f=o.getAttributions2();if(!f){continue}var u=f(t);if(!u){continue}if(Array.isArray(u)){for(var l=0,v=u.length;l<v;++l){if(!(u[l]in i)){s.push(u[l]);i[u[l]]=true}}}else{if(!(u in i)){s.push(u);i[u]=true}}}return s};Zh.render=function(t){this.updateElement_(t.frameState)};Zh.prototype.updateElement_=function(t){if(!t){if(this.renderedVisible_){this.element.style.display="none";this.renderedVisible_=false}return}var i=this.getSourceAttributions_(t);if(kn.equals(i,this.renderedAttributions_)){return}while(this.ulElement_.lastChild!==this.logoLi_){this.ulElement_.removeChild(this.ulElement_.lastChild)}for(var s=0,e=i.length;s<e;++s){var r=document.createElement("LI");r.innerHTML=i[s];this.ulElement_.appendChild(r)}if(i.length===0&&this.renderedAttributions_.length>0){this.element.classList.add("ol-logo-only")}else if(this.renderedAttributions_.length===0&&i.length>0){this.element.classList.remove("ol-logo-only")}var n=i.length>0||!vn.isEmpty(t.logos);if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}this.renderedAttributions_=i;this.insertLogos_(t)};Zh.prototype.insertLogos_=function(t){var i;var s=t.logos;var e=this.logoElements_;for(i in e){if(!(i in s)){Lh.removeNode(e[i]);delete e[i]}}var r,n,h;for(h in s){var a=s[h];if(a instanceof HTMLElement){this.logoLi_.appendChild(a);e[h]=a}if(!(h in e)){r=new Image;r.src=h;if(a===""){n=r}else{n=document.createElement("a");n.href=a;n.appendChild(r)}this.logoLi_.appendChild(n);e[h]=n}}this.logoLi_.style.display=!vn.isEmpty(s)?"":"none"};Zh.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()};Zh.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed");if(this.collapsed_){Lh.replaceNode(this.collapseLabel_,this.label_)}else{Lh.replaceNode(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_};Zh.prototype.getCollapsible=function(){return this.collapsible_};Zh.prototype.setCollapsible=function(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(!t&&this.collapsed_){this.handleToggle_()}};Zh.prototype.setCollapsed=function(t){if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()};Zh.prototype.getCollapsed=function(){return this.collapsed_};var $h=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-rotate";var e=i.label!==undefined?i.label:"⇧";this.label_=null;if(typeof e==="string"){this.label_=document.createElement("span");this.label_.className="ol-compass";this.label_.textContent=e}else{this.label_=e;this.label_.classList.add("ol-compass")}var r=i.tipLabel?i.tipLabel:"Reset rotation";var n=document.createElement("button");n.className=s+"-reset";n.setAttribute("type","button");n.title=r;n.appendChild(this.label_);cn.listen(n,zn.CLICK,$h.prototype.handleClick_,this);var h=s+" "+Bh.CLASS_UNSELECTABLE+" "+Bh.CLASS_CONTROL;var a=document.createElement("div");a.className=h;a.appendChild(n);var o=i.render?i.render:$h.render;this.callResetNorth_=i.resetNorth?i.resetNorth:undefined;Yh.call(this,{element:a,render:o,target:i.target});this.duration_=i.duration!==undefined?i.duration:250;this.autoHide_=i.autoHide!==undefined?i.autoHide:true;this.rotation_=undefined;if(this.autoHide_){this.element.classList.add(Bh.CLASS_HIDDEN)}};fn.inherits($h,Yh);$h.prototype.handleClick_=function(t){t.preventDefault();if(this.callResetNorth_!==undefined){this.callResetNorth_()}else{this.resetNorth_()}};$h.prototype.resetNorth_=function(){var t=this.getMap();var i=t.getView();if(!i){return}if(i.getRotation()!==undefined){if(this.duration_>0){i.animate({rotation:0,duration:this.duration_,easing:Rh.easeOut})}else{i.setRotation(0)}}};$h.render=function(t){var i=t.frameState;if(!i){return}var s=i.viewState.rotation;if(s!=this.rotation_){var e="rotate("+s+"rad)";if(this.autoHide_){var r=this.element.classList.contains(Bh.CLASS_HIDDEN);if(!r&&s===0){this.element.classList.add(Bh.CLASS_HIDDEN)}else if(r&&s!==0){this.element.classList.remove(Bh.CLASS_HIDDEN)}}this.label_.style.msTransform=e;this.label_.style.webkitTransform=e;this.label_.style.transform=e}this.rotation_=s};var Kh=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-zoom";var e=i.delta!==undefined?i.delta:1;var r=i.zoomInLabel!==undefined?i.zoomInLabel:"+";var n=i.zoomOutLabel!==undefined?i.zoomOutLabel:"−";var h=i.zoomInTipLabel!==undefined?i.zoomInTipLabel:"Zoom in";var a=i.zoomOutTipLabel!==undefined?i.zoomOutTipLabel:"Zoom out";var o=document.createElement("button");o.className=s+"-in";o.setAttribute("type","button");o.title=h;o.appendChild(typeof r==="string"?document.createTextNode(r):r);cn.listen(o,zn.CLICK,Kh.prototype.handleClick_.bind(this,e));var f=document.createElement("button");f.className=s+"-out";f.setAttribute("type","button");f.title=a;f.appendChild(typeof n==="string"?document.createTextNode(n):n);cn.listen(f,zn.CLICK,Kh.prototype.handleClick_.bind(this,-e));var u=s+" "+Bh.CLASS_UNSELECTABLE+" "+Bh.CLASS_CONTROL;var l=document.createElement("div");l.className=u;l.appendChild(o);l.appendChild(f);Yh.call(this,{element:l,target:i.target});this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(Kh,Yh);Kh.prototype.handleClick_=function(t,i){i.preventDefault();this.zoomByDelta_(t)};Kh.prototype.zoomByDelta_=function(t){var i=this.getMap();var s=i.getView();if(!s){return}var e=s.getResolution();if(e){var r=s.constrainResolution(e,t);if(this.duration_>0){if(s.getAnimating()){s.cancelAnimations()}s.animate({resolution:r,duration:this.duration_,easing:Rh.easeOut})}else{s.setResolution(r)}}};var Qh={};Qh.defaults=function(t){var i=t?t:{};var s=new oh;var e=i.zoom!==undefined?i.zoom:true;if(e){s.push(new Kh(i.zoomOptions))}var r=i.rotate!==undefined?i.rotate:true;if(r){s.push(new $h(i.rotateOptions))}var n=i.attribution!==undefined?i.attribution:true;if(n){s.push(new Zh(i.attributionOptions))}return s};var ta=function(t,i,s){this.decay_=t;this.minVelocity_=i;this.delay_=s;this.points_=[];this.angle_=0;this.initialVelocity_=0};ta.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0};ta.prototype.update=function(t,i){this.points_.push(t,i,Date.now())};ta.prototype.end=function(){if(this.points_.length<6){return false}var t=Date.now()-this.delay_;var i=this.points_.length-3;if(this.points_[i+2]<t){return false}var s=i-3;while(s>0&&this.points_[s+2]>t){s-=3}var e=this.points_[i+2]-this.points_[s+2];if(e<1e3/60){return false}var r=this.points_[i]-this.points_[s];var n=this.points_[i+1]-this.points_[s+1];this.angle_=Math.atan2(n,r);this.initialVelocity_=Math.sqrt(r*r+n*n)/e;return this.initialVelocity_>this.minVelocity_};ta.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};ta.prototype.getAngle=function(){return this.angle_};var ia={ACTIVE:"active"};var sa=function(t){_n.call(this);this.map_=null;this.setActive(true);this.handleEvent=t.handleEvent};fn.inherits(sa,_n);sa.prototype.getActive=function(){return this.get(ia.ACTIVE)};sa.prototype.getMap=function(){return this.map_};sa.prototype.setActive=function(t){this.set(ia.ACTIVE,t)};sa.prototype.setMap=function(t){this.map_=t};sa.pan=function(t,i,s){var e=t.getCenter();if(e){var r=t.constrainCenter([e[0]+i[0],e[1]+i[1]]);if(s){t.animate({duration:s,easing:Rh.linear,center:r})}else{t.setCenter(r)}}};sa.rotate=function(t,i,s,e){i=t.constrainRotation(i,0);sa.rotateWithoutConstraints(t,i,s,e)};sa.rotateWithoutConstraints=function(t,i,s,e){if(i!==undefined){var r=t.getRotation();var n=t.getCenter();if(r!==undefined&&n&&e>0){t.animate({rotation:i,anchor:s,duration:e,easing:Rh.easeOut})}else{t.rotate(i,s)}}};sa.zoom=function(t,i,s,e,r){i=t.constrainResolution(i,0,r);sa.zoomWithoutConstraints(t,i,s,e)};sa.zoomByDelta=function(t,i,s,e){var r=t.getResolution();var n=t.constrainResolution(r,i,0);if(n!==undefined){var h=t.getResolutions();n=xn.clamp(n,t.getMinResolution()||h[h.length-1],t.getMaxResolution()||h[0])}if(s&&n!==undefined&&n!==r){var a=t.getCenter();var o=t.calculateCenterZoom(n,s);o=t.constrainCenter(o);s=[(n*a[0]-r*o[0])/(n-r),(n*a[1]-r*o[1])/(n-r)]}sa.zoomWithoutConstraints(t,n,s,e)};sa.zoomWithoutConstraints=function(t,i,s,e){if(i){var r=t.getResolution();var n=t.getCenter();if(r!==undefined&&n&&i!==r&&e){t.animate({resolution:i,anchor:s,duration:e,easing:Rh.easeOut})}else{if(s){var h=t.calculateCenterZoom(i,s);t.setCenter(h)}t.setResolution(i)}}};var ea=function(t){var i=t?t:{};this.delta_=i.delta?i.delta:1;sa.call(this,{handleEvent:ea.handleEvent});this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(ea,sa);ea.handleEvent=function(t){var i=false;var s=t.originalEvent;if(t.type==lh.DBLCLICK){var e=t.map;var r=t.coordinate;var n=s.shiftKey?-this.delta_:this.delta_;var h=e.getView();sa.zoomByDelta(h,n,r,this.duration_);t.preventDefault();i=true}return!i};var ra={};ra.altKeyOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};ra.altShiftKeysOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};ra.always=Sn.TRUE;ra.click=function(t){return t.type==lh.CLICK};ra.mouseActionButton=function(t){var i=t.originalEvent;return i.button==0&&!(rh.WEBKIT&&rh.MAC&&i.ctrlKey)};ra.never=Sn.FALSE;ra.pointerMove=function(t){return t.type=="pointermove"};ra.singleClick=function(t){return t.type==lh.SINGLECLICK};ra.doubleClick=function(t){return t.type==lh.DBLCLICK};ra.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};ra.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(rh.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey};ra.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};ra.targetNotEditable=function(t){var i=t.originalEvent.target;var s=i.tagName;return s!=="INPUT"&&s!=="SELECT"&&s!=="TEXTAREA"};ra.mouseOnly=function(t){bn.assert(t.pointerEvent,56);return t.pointerEvent.pointerType=="mouse"};ra.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&i.button===0};var na=function(t){var i=t?t:{};var s=i.handleEvent?i.handleEvent:na.handleEvent;sa.call(this,{handleEvent:s});this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:na.handleDownEvent;this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:na.handleDragEvent;this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:na.handleMoveEvent;this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:na.handleUpEvent;this.handlingDownUpSequence=false;this.trackedPointers_={};this.targetPointers=[]};fn.inherits(na,sa);na.centroid=function(t){var i=t.length;var s=0;var e=0;for(var r=0;r<i;r++){s+=t[r].clientX;e+=t[r].clientY}return[s/i,e/i]};na.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===lh.POINTERDOWN||i===lh.POINTERDRAG||i===lh.POINTERUP};na.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent;var s=i.pointerId.toString();if(t.type==lh.POINTERUP){delete this.trackedPointers_[s]}else if(t.type==lh.POINTERDOWN){this.trackedPointers_[s]=i}else if(s in this.trackedPointers_){this.trackedPointers_[s]=i}this.targetPointers=vn.getValues(this.trackedPointers_)}};na.handleDragEvent=fn.nullFunction;na.handleUpEvent=Sn.FALSE;na.handleDownEvent=Sn.FALSE;na.handleMoveEvent=fn.nullFunction;na.handleEvent=function(t){if(!(t instanceof vh)){return true}var i=false;this.updateTrackedPointers_(t);if(this.handlingDownUpSequence){if(t.type==lh.POINTERDRAG){this.handleDragEvent_(t)}else if(t.type==lh.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else{if(t.type==lh.POINTERDOWN){var e=this.handleDownEvent_(t);this.handlingDownUpSequence=e;i=this.shouldStopEvent(e)}else if(t.type==lh.POINTERMOVE){this.handleMoveEvent_(t)}}return!i};na.prototype.shouldStopEvent=function(t){return t};var ha=function(t){na.call(this,{handleDownEvent:ha.handleDownEvent_,handleDragEvent:ha.handleDragEvent_,handleUpEvent:ha.handleUpEvent_});var i=t?t:{};this.kinetic_=i.kinetic;this.lastCentroid=null;this.condition_=i.condition?i.condition:ra.noModifierKeys;this.noKinetic_=false};fn.inherits(ha,na);ha.handleDragEvent_=function(t){var i=this.targetPointers;var s=na.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_){this.kinetic_.update(s[0],s[1])}if(this.lastCentroid){var e=this.lastCentroid[0]-s[0];var r=s[1]-this.lastCentroid[1];var n=t.map;var h=n.getView();var a=h.getState();var o=[e,r];Ah.scale(o,a.resolution);Ah.rotate(o,a.rotation);Ah.add(o,a.center);o=h.constrainCenter(o);h.setCenter(o)}}else if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=s;this.lastPointersCount_=i.length};ha.handleUpEvent_=function(t){var i=t.map;var s=i.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var e=this.kinetic_.getDistance();var r=this.kinetic_.getAngle();var n=s.getCenter();var h=i.getPixelFromCoordinate(n);var a=i.getCoordinateFromPixel([h[0]-e*Math.cos(r),h[1]-e*Math.sin(r)]);s.animate({center:s.constrainCenter(a),duration:500,easing:Rh.easeOut})}s.setHint(Sh.INTERACTING,-1);return false}else{if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=null;return true}};ha.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map;var s=i.getView();this.lastCentroid=null;if(!this.handlingDownUpSequence){s.setHint(Sh.INTERACTING,1)}if(s.getAnimating()){s.setCenter(t.frameState.viewState.center)}if(this.kinetic_){this.kinetic_.begin()}this.noKinetic_=this.targetPointers.length>1;return true}else{return false}};ha.prototype.shouldStopEvent=Sn.FALSE;var aa=function(t){var i=t?t:{};na.call(this,{handleDownEvent:aa.handleDownEvent_,handleDragEvent:aa.handleDragEvent_,handleUpEvent:aa.handleUpEvent_});this.condition_=i.condition?i.condition:ra.altShiftKeysOnly;this.lastAngle_=undefined;this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(aa,na);aa.handleDragEvent_=function(t){if(!ra.mouseOnly(t)){return}var i=t.map;var s=i.getView();if(s.getConstraints().rotation===Ih.disable){return}var e=i.getSize();var r=t.pixel;var n=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(this.lastAngle_!==undefined){var h=n-this.lastAngle_;var a=s.getRotation();sa.rotateWithoutConstraints(s,a-h)}this.lastAngle_=n};aa.handleUpEvent_=function(t){if(!ra.mouseOnly(t)){return true}var i=t.map;var s=i.getView();s.setHint(Sh.INTERACTING,-1);var e=s.getRotation();sa.rotate(s,e,undefined,this.duration_);return false};aa.handleDownEvent_=function(t){if(!ra.mouseOnly(t)){return false}if(ra.mouseActionButton(t)&&this.condition_(t)){var i=t.map;i.getView().setHint(Sh.INTERACTING,1);this.lastAngle_=undefined;return true}else{return false}};aa.prototype.shouldStopEvent=Sn.FALSE;var oa=function(t){this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null};fn.inherits(oa,dn);oa.prototype.disposeInternal=function(){this.setMap(null)};oa.prototype.render_=function(){var t=this.startPixel_;var i=this.endPixel_;var s="px";var e=this.element_.style;e.left=Math.min(t[0],i[0])+s;e.top=Math.min(t[1],i[1])+s;e.width=Math.abs(i[0]-t[0])+s;e.height=Math.abs(i[1]-t[1])+s};oa.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t;if(this.map_){this.map_.getOverlayContainer().appendChild(this.element_)}};oa.prototype.setPixels=function(t,i){this.startPixel_=t;this.endPixel_=i;this.createOrUpdateGeometry();this.render_()};oa.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_;var i=this.endPixel_;var s=[t,[t[0],i[1]],i,[i[0],t[1]]];var e=s.map(this.map_.getCoordinateFromPixel,this.map_);e[4]=e[0].slice();if(!this.geometry_){this.geometry_=new sh([e])}else{this.geometry_.setCoordinates([e])}};oa.prototype.getGeometry=function(){return this.geometry_};var fa=function(t){na.call(this,{handleDownEvent:fa.handleDownEvent_,handleDragEvent:fa.handleDragEvent_,handleUpEvent:fa.handleUpEvent_});var i=t?t:{};this.box_=new oa(i.className||"ol-dragbox");this.minArea_=i.minArea!==undefined?i.minArea:64;this.startPixel_=null;this.condition_=i.condition?i.condition:ra.always;this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:fa.defaultBoxEndCondition};fn.inherits(fa,na);fa.defaultBoxEndCondition=function(t,i,s){var e=s[0]-i[0];var r=s[1]-i[1];return e*e+r*r>=this.minArea_};fa.handleDragEvent_=function(t){if(!ra.mouseOnly(t)){return}this.box_.setPixels(this.startPixel_,t.pixel);this.dispatchEvent(new fa.Event(fa.EventType_.BOXDRAG,t.coordinate,t))};fa.prototype.getGeometry=function(){return this.box_.getGeometry()};fa.prototype.onBoxEnd=fn.nullFunction;fa.handleUpEvent_=function(t){if(!ra.mouseOnly(t)){return true}this.box_.setMap(null);if(this.boxEndCondition_(t,this.startPixel_,t.pixel)){this.onBoxEnd(t);this.dispatchEvent(new fa.Event(fa.EventType_.BOXEND,t.coordinate,t))}return false};fa.handleDownEvent_=function(t){if(!ra.mouseOnly(t)){return false}if(ra.mouseActionButton(t)&&this.condition_(t)){this.startPixel_=t.pixel;this.box_.setMap(t.map);this.box_.setPixels(this.startPixel_,this.startPixel_);this.dispatchEvent(new fa.Event(fa.EventType_.BOXSTART,t.coordinate,t));return true}else{return false}};fa.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"};fa.Event=function(t,i,s){mn.call(this,t);this.coordinate=i;this.mapBrowserEvent=s};fn.inherits(fa.Event,mn);var ua=function(t){var i=t?t:{};var s=i.condition?i.condition:ra.shiftKeyOnly;this.duration_=i.duration!==undefined?i.duration:200;this.out_=i.out!==undefined?i.out:false;fa.call(this,{condition:s,className:i.className||"ol-dragzoom"})};fn.inherits(ua,fa);ua.prototype.onBoxEnd=function(){var t=this.getMap();var i=t.getView();var s=t.getSize();var e=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtent(s);var n=Nn.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(Nn.getBottomLeft(e)),t.getPixelFromCoordinate(Nn.getTopRight(e))]);var h=i.getResolutionForExtent(n,s);Nn.scaleFromCenter(r,1/h);e=r}var a=i.constrainResolution(i.getResolutionForExtent(e,s));var o=Nn.getCenter(e);o=i.constrainCenter(o);i.animate({resolution:a,center:o,duration:this.duration_,easing:Rh.easeOut})};var la={LEFT:37,UP:38,RIGHT:39,DOWN:40};var va=function(t){sa.call(this,{handleEvent:va.handleEvent});var i=t||{};this.defaultCondition_=function(t){return ra.noModifierKeys(t)&&ra.targetNotEditable(t)};this.condition_=i.condition!==undefined?i.condition:this.defaultCondition_;this.duration_=i.duration!==undefined?i.duration:100;this.pixelDelta_=i.pixelDelta!==undefined?i.pixelDelta:128};fn.inherits(va,sa);va.handleEvent=function(t){var i=false;if(t.type==zn.KEYDOWN){var s=t.originalEvent;var e=s.keyCode;if(this.condition_(t)&&(e==la.DOWN||e==la.LEFT||e==la.RIGHT||e==la.UP)){var r=t.map;var n=r.getView();var h=n.getResolution()*this.pixelDelta_;var a=0,o=0;if(e==la.DOWN){o=-h}else if(e==la.LEFT){a=-h}else if(e==la.RIGHT){a=h}else{o=h}var f=[a,o];Ah.rotate(f,n.getRotation());sa.pan(n,f,this.duration_);t.preventDefault();i=true}}return!i};var ca=function(t){sa.call(this,{handleEvent:ca.handleEvent});var i=t?t:{};this.condition_=i.condition?i.condition:ra.targetNotEditable;this.delta_=i.delta?i.delta:1;this.duration_=i.duration!==undefined?i.duration:100};fn.inherits(ca,sa);ca.handleEvent=function(t){var i=false;if(t.type==zn.KEYDOWN||t.type==zn.KEYPRESS){var s=t.originalEvent;var e=s.charCode;if(this.condition_(t)&&(e=="+".charCodeAt(0)||e=="-".charCodeAt(0))){var r=t.map;var n=e=="+".charCodeAt(0)?this.delta_:-this.delta_;var h=r.getView();sa.zoomByDelta(h,n,undefined,this.duration_);t.preventDefault();i=true}}return!i};var da=function(t){sa.call(this,{handleEvent:da.handleEvent});var i=t||{};this.delta_=0;this.duration_=i.duration!==undefined?i.duration:250;this.timeout_=i.timeout!==undefined?i.timeout:80;this.useAnchor_=i.useAnchor!==undefined?i.useAnchor:true;this.constrainResolution_=i.constrainResolution||false;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined;this.mode_=undefined;this.trackpadEventGap_=400;this.trackpadTimeoutId_=undefined;this.trackpadDeltaPerZoom_=300;this.trackpadZoomBuffer_=1.5};fn.inherits(da,sa);da.handleEvent=function(t){var i=t.type;if(i!==zn.WHEEL&&i!==zn.MOUSEWHEEL){return true}t.preventDefault();var s=t.map;var e=t.originalEvent;if(this.useAnchor_){this.lastAnchor_=t.coordinate}var r;if(t.type==zn.WHEEL){r=e.deltaY;if(rh.FIREFOX&&e.deltaMode===WheelEvent.DOM_DELTA_PIXEL){r/=rh.DEVICE_PIXEL_RATIO}if(e.deltaMode===WheelEvent.DOM_DELTA_LINE){r*=40}}else if(t.type==zn.MOUSEWHEEL){r=-e.wheelDeltaY;if(rh.SAFARI){r/=3}}if(r===0){return false}var n=Date.now();if(this.startTime_===undefined){this.startTime_=n}if(!this.mode_||n-this.startTime_>this.trackpadEventGap_){this.mode_=Math.abs(r)<4?da.Mode_.TRACKPAD:da.Mode_.WHEEL}if(this.mode_===da.Mode_.TRACKPAD){var h=s.getView();if(this.trackpadTimeoutId_){clearTimeout(this.trackpadTimeoutId_)}else{h.setHint(Sh.INTERACTING,1)}this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=h.getResolution()*Math.pow(2,r/this.trackpadDeltaPerZoom_);var o=h.getMinResolution();var f=h.getMaxResolution();var u=0;if(a<o){a=Math.max(a,o/this.trackpadZoomBuffer_);u=1}else if(a>f){a=Math.min(a,f*this.trackpadZoomBuffer_);u=-1}if(this.lastAnchor_){var l=h.calculateCenterZoom(a,this.lastAnchor_);h.setCenter(h.constrainCenter(l))}h.setResolution(a);if(u===0&&this.constrainResolution_){h.animate({resolution:h.constrainResolution(a,r>0?-1:1),easing:Rh.easeOut,anchor:this.lastAnchor_,duration:this.duration_})}if(u>0){h.animate({resolution:o,easing:Rh.easeOut,anchor:this.lastAnchor_,duration:500})}else if(u<0){h.animate({resolution:f,easing:Rh.easeOut,anchor:this.lastAnchor_,duration:500})}this.startTime_=n;return false}this.delta_+=r;var v=Math.max(this.timeout_-(n-this.startTime_),0);clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,s),v);return false};da.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=undefined;var t=this.getMap().getView();t.setHint(Sh.INTERACTING,-1)};da.prototype.handleWheelZoom_=function(t){var i=t.getView();if(i.getAnimating()){i.cancelAnimations()}var s=fn.MOUSEWHEELZOOM_MAXDELTA;var e=xn.clamp(this.delta_,-s,s);sa.zoomByDelta(i,-e,this.lastAnchor_,this.duration_);this.mode_=undefined;this.delta_=0;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined};da.prototype.setMouseAnchor=function(t){this.useAnchor_=t;if(!t){this.lastAnchor_=null}};da.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var ma=function(t){na.call(this,{handleDownEvent:ma.handleDownEvent_,handleDragEvent:ma.handleDragEvent_,handleUpEvent:ma.handleUpEvent_});var i=t||{};this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;this.threshold_=i.threshold!==undefined?i.threshold:.3;this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(ma,na);ma.handleDragEvent_=function(t){var i=0;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=Math.atan2(e.clientY-s.clientY,e.clientX-s.clientX);if(this.lastAngle_!==undefined){var n=r-this.lastAngle_;this.rotationDelta_+=n;if(!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_){this.rotating_=true}i=n}this.lastAngle_=r;var h=t.map;var a=h.getView();if(a.getConstraints().rotation===Ih.disable){return}var o=h.getViewport().getBoundingClientRect();var f=na.centroid(this.targetPointers);f[0]-=o.left;f[1]-=o.top;this.anchor_=h.getCoordinateFromPixel(f);if(this.rotating_){var u=a.getRotation();h.render();sa.rotateWithoutConstraints(a,u+i,this.anchor_)}};ma.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Sh.INTERACTING,-1);if(this.rotating_){var e=s.getRotation();sa.rotate(s,e,this.anchor_,this.duration_)}return false}else{return true}};ma.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;if(!this.handlingDownUpSequence){i.getView().setHint(Sh.INTERACTING,1)}return true}else{return false}};ma.prototype.shouldStopEvent=Sn.FALSE;var pa=function(t){na.call(this,{handleDownEvent:pa.handleDownEvent_,handleDragEvent:pa.handleDragEvent_,handleUpEvent:pa.handleUpEvent_});var i=t?t:{};this.constrainResolution_=i.constrainResolution||false;this.anchor_=null;this.duration_=i.duration!==undefined?i.duration:400;this.lastDistance_=undefined;this.lastScaleDelta_=1};fn.inherits(pa,na);pa.handleDragEvent_=function(t){var i=1;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=s.clientX-e.clientX;var n=s.clientY-e.clientY;var h=Math.sqrt(r*r+n*n);if(this.lastDistance_!==undefined){i=this.lastDistance_/h}this.lastDistance_=h;var a=t.map;var o=a.getView();var f=o.getResolution();var u=o.getMaxResolution();var l=o.getMinResolution();var v=f*i;if(v>u){i=u/f;v=u}else if(v<l){i=l/f;v=l}if(i!=1){this.lastScaleDelta_=i}var c=a.getViewport().getBoundingClientRect();var d=na.centroid(this.targetPointers);d[0]-=c.left;d[1]-=c.top;this.anchor_=a.getCoordinateFromPixel(d);a.render();sa.zoomWithoutConstraints(o,v,this.anchor_)};pa.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Sh.INTERACTING,-1);var e=s.getResolution();if(this.constrainResolution_||e<s.getMinResolution()||e>s.getMaxResolution()){var r=this.lastScaleDelta_-1;sa.zoom(s,e,this.anchor_,this.duration_,r)}return false}else{return true}};pa.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastDistance_=undefined;this.lastScaleDelta_=1;if(!this.handlingDownUpSequence){i.getView().setHint(Sh.INTERACTING,1)}return true}else{return false}};pa.prototype.shouldStopEvent=Sn.FALSE;var za={};za.defaults=function(t){var i=t?t:{};var s=new oh;var e=new ta(-.005,.05,100);var r=i.altShiftDragRotate!==undefined?i.altShiftDragRotate:true;if(r){s.push(new aa)}var n=i.doubleClickZoom!==undefined?i.doubleClickZoom:true;if(n){s.push(new ea({delta:i.zoomDelta,duration:i.zoomDuration}))}var h=i.dragPan!==undefined?i.dragPan:true;if(h){s.push(new ha({kinetic:e}))}var a=i.pinchRotate!==undefined?i.pinchRotate:true;if(a){s.push(new ma)}var o=i.pinchZoom!==undefined?i.pinchZoom:true;if(o){s.push(new pa({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var f=i.keyboard!==undefined?i.keyboard:true;if(f){s.push(new va);s.push(new ca({delta:i.zoomDelta,duration:i.zoomDuration}))}var u=i.mouseWheelZoom!==undefined?i.mouseWheelZoom:true;if(u){s.push(new da({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var l=i.shiftDragZoom!==undefined?i.shiftDragZoom:true;if(l){s.push(new ua({duration:i.zoomDuration}))}return s};var Ma=function(t,i,s,e){pn.call(this);this.extent=t;this.pixelRatio_=s;this.resolution=i;this.state=e};fn.inherits(Ma,pn);Ma.prototype.changed=function(){this.dispatchEvent(zn.CHANGE)};Ma.prototype.getExtent=function(){return this.extent};Ma.prototype.getImage=function(){};Ma.prototype.getPixelRatio=function(){return this.pixelRatio_};Ma.prototype.getResolution=function(){return this.resolution};Ma.prototype.getState=function(){return this.state};Ma.prototype.load=function(){};var _a={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var ga=function(t,i,s,e,r){this.loader_=r!==undefined?r:null;var n=r!==undefined?_a.IDLE:_a.LOADED;Ma.call(this,t,i,s,n);this.canvas_=e;this.error_=null};fn.inherits(ga,Ma);ga.prototype.getError=function(){return this.error_};ga.prototype.handleLoad_=function(t){if(t){this.error_=t;this.state=_a.ERROR}else{this.state=_a.LOADED}this.changed()};ga.prototype.load=function(){if(this.state==_a.IDLE){this.state=_a.LOADING;this.changed();this.loader_(this.handleLoad_.bind(this))}};ga.prototype.getImage=function(){return this.canvas_};var ba={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"};var xa={IMAGE:"image",VECTOR:"vector"};var ya=function(t,i,s,e,r){mn.call(this,t);this.vectorContext=i;this.frameState=s;this.context=e;this.glContext=r};fn.inherits(ya,mn);var wa=function(t){pn.call(this);this.highWaterMark=t!==undefined?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null};fn.inherits(wa,pn);wa.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark};wa.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(zn.CLEAR)};wa.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)};wa.prototype.forEach=function(t,i){var s=this.oldest_;while(s){t.call(i,s.value_,s.key_,this);s=s.newer}};wa.prototype.get=function(t){var i=this.entries_[t];bn.assert(i!==undefined,15);if(i===this.newest_){return i.value_}else if(i===this.oldest_){this.oldest_=this.oldest_.newer;this.oldest_.older=null}else{i.newer.older=i.older;i.older.newer=i.newer}i.newer=null;i.older=this.newest_;this.newest_.newer=i;this.newest_=i;return i.value_};wa.prototype.remove=function(t){var i=this.entries_[t];bn.assert(i!==undefined,15);if(i===this.newest_){this.newest_=i.older;if(this.newest_){this.newest_.newer=null}}else if(i===this.oldest_){this.oldest_=i.newer;if(this.oldest_){this.oldest_.older=null}}else{i.newer.older=i.older;i.older.newer=i.newer}delete this.entries_[t];--this.count_;return i.value_};wa.prototype.getCount=function(){return this.count_};wa.prototype.getKeys=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.key_}return t};wa.prototype.getValues=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.value_}return t};wa.prototype.peekLast=function(){return this.oldest_.value_};wa.prototype.peekLastKey=function(){return this.oldest_.key_};wa.prototype.peekFirstKey=function(){return this.newest_.key_};wa.prototype.pop=function(){var t=this.oldest_;delete this.entries_[t.key_];if(t.newer){t.newer.older=null}this.oldest_=t.newer;if(!this.oldest_){this.newest_=null}--this.count_;return t.value_};wa.prototype.replace=function(t,i){this.get(t);this.entries_[t].value_=i};wa.prototype.set=function(t,i){bn.assert(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};if(!this.newest_){this.oldest_=s}else{this.newest_.newer=s}this.newest_=s;this.entries_[t]=s;++this.count_};wa.prototype.prune=function(){while(this.canExpireCache()){this.pop()}};var ka={};ka.defaultFont="10px sans-serif";ka.defaultFillStyle=[0,0,0,1];ka.defaultLineCap="round";ka.defaultLineDash=[];ka.defaultLineDashOffset=0;ka.defaultLineJoin="round";ka.defaultMiterLimit=10;ka.defaultStrokeStyle=[0,0,0,1];ka.defaultTextAlign="center";ka.defaultTextBaseline="middle";ka.defaultPadding=[0,0,0,0];ka.defaultLineWidth=1;ka.labelCache=new wa;ka.checkedFonts_={};ka.measureContext_=null;ka.textHeights_={};ka.checkFont=function(){var t=60;var i=ka.checkedFonts_;var s=ka.labelCache;var e="32px monospace";var r="wmytzilWMYTZIL@#/&?$%10";var n,h;function a(t){var i=ka.getMeasureContext();i.font=e;h=i.measureText(r).width;var s=true;if(t!="monospace"){i.font="32px "+t+",monospace";var n=i.measureText(r).width;s=n!=h}return s}function o(){var e=true;for(var r in i){if(i[r]<t){if(a(r)){i[r]=t;vn.clear(ka.textHeights_);ka.measureContext_=null;s.clear()}else{++i[r];e=false}}}if(e){window.clearInterval(n);n=undefined}}return function(s){var e=Bh.getFontFamilies(s);if(!e){return}for(var r=0,h=e.length;r<h;++r){var f=e[r];if(!(f in i)){i[f]=t;if(!a(f)){i[f]=0;if(n===undefined){n=window.setInterval(o,32)}}}}}}();ka.getMeasureContext=function(){var t=ka.measureContext_;if(!t){t=ka.measureContext_=Lh.createCanvasContext2D(1,1)}return t};ka.measureTextHeight=function(){var t;var i=ka.textHeights_;return function(s){var e=i[s];if(e==undefined){if(!t){t=document.createElement("span");t.textContent="M";t.style.margin=t.style.padding="0 !important";t.style.position="absolute !important";t.style.left="-99999px !important"}t.style.font=s;document.body.appendChild(t);e=i[s]=t.offsetHeight;document.body.removeChild(t)}return e}}();ka.measureTextWidth=function(t,i){var s=ka.getMeasureContext();if(t!=s.font){s.font=t}return s.measureText(i).width};ka.rotateAtOffset=function(t,i,s,e){if(i!==0){t.translate(s,e);t.rotate(i);t.translate(-s,-e)}};ka.resetTransform_=Gn.create();ka.drawImage=function(t,i,s,e,r,n,h,a,o,f,u){var l;if(s!=1){l=t.globalAlpha;t.globalAlpha=l*s}if(i){t.setTransform.apply(t,i)}t.drawImage(e,r,n,h,a,o,f,h*u,a*u);if(l){t.globalAlpha=l}if(i){t.setTransform.apply(t,ka.resetTransform_)}};var Ea={};Ea.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i;Ea.NAMED_COLOR_RE_=/^([a-z]*)$/i;Ea.asArray=function(t){if(Array.isArray(t)){return t}else{return Ea.fromString(t)}};Ea.asString=function(t){if(typeof t==="string"){return t}else{return Ea.toString(t)}};Ea.fromNamed=function(t){var i=document.createElement("div");i.style.color=t;document.body.appendChild(i);var s=getComputedStyle(i).color;document.body.removeChild(i);return s};Ea.fromString=function(){var t=1024;var i={};var s=0;return function(e){var r;if(i.hasOwnProperty(e)){r=i[e]}else{if(s>=t){var n=0;var h;for(h in i){if((n++&3)===0){delete i[h];--s}}}r=Ea.fromStringInternal_(e);i[e]=r;++s}return r}}();Ea.fromStringInternal_=function(t){var i,s,e,r,n,h;if(Ea.NAMED_COLOR_RE_.exec(t)){t=Ea.fromNamed(t)}if(Ea.HEX_COLOR_RE_.exec(t)){var a=t.length-1;var o;if(a<=4){o=1}else{o=2}var f=a===4||a===8;i=parseInt(t.substr(1+0*o,o),16);s=parseInt(t.substr(1+1*o,o),16);e=parseInt(t.substr(1+2*o,o),16);if(f){r=parseInt(t.substr(1+3*o,o),16)}else{r=255}if(o==1){i=(i<<4)+i;s=(s<<4)+s;e=(e<<4)+e;if(f){r=(r<<4)+r}}n=[i,s,e,r/255]}else if(t.indexOf("rgba(")==0){h=t.slice(5,-1).split(",").map(Number);n=Ea.normalize(h)}else if(t.indexOf("rgb(")==0){h=t.slice(4,-1).split(",").map(Number);h.push(1);n=Ea.normalize(h)}else{bn.assert(false,14)}return n};Ea.normalize=function(t,i){var s=i||[];s[0]=xn.clamp(t[0]+.5|0,0,255);s[1]=xn.clamp(t[1]+.5|0,0,255);s[2]=xn.clamp(t[2]+.5|0,0,255);s[3]=xn.clamp(t[3],0,1);return s};Ea.toString=function(t){var i=t[0];if(i!=(i|0)){i=i+.5|0}var s=t[1];if(s!=(s|0)){s=s+.5|0}var e=t[2];if(e!=(e|0)){e=e+.5|0}var r=t[3]===undefined?1:t[3];return"rgba("+i+","+s+","+e+","+r+")"};var Ca={};Ca.asColorLike=function(t){if(Ca.isColorLike(t)){return t}else{return Ea.asString(t)}};Ca.isColorLike=function(t){return typeof t==="string"||t instanceof CanvasPattern||t instanceof CanvasGradient};var Na=function(){};Na.prototype.drawCustom=function(t,i,s){};Na.prototype.drawGeometry=function(t){};Na.prototype.setStyle=function(t){};Na.prototype.drawCircle=function(t,i){};Na.prototype.drawFeature=function(t,i){};Na.prototype.drawGeometryCollection=function(t,i){};Na.prototype.drawLineString=function(t,i){};Na.prototype.drawMultiLineString=function(t,i){};Na.prototype.drawMultiPoint=function(t,i){};Na.prototype.drawMultiPolygon=function(t,i){};Na.prototype.drawPoint=function(t,i){};Na.prototype.drawPolygon=function(t,i){};Na.prototype.drawText=function(t,i){};Na.prototype.setFillStrokeStyle=function(t,i){};Na.prototype.setImageStyle=function(t,i){};Na.prototype.setTextStyle=function(t,i){};var Ia=function(t,i,s,e,r){Na.call(this);this.context_=t;this.pixelRatio_=i;this.extent_=s;this.transform_=e;this.viewRotation_=r;this.contextFillState_=null;this.contextStrokeState_=null;this.contextTextState_=null;this.fillState_=null;this.strokeState_=null;this.image_=null;this.imageAnchorX_=0;this.imageAnchorY_=0;this.imageHeight_=0;this.imageOpacity_=0;this.imageOriginX_=0;this.imageOriginY_=0;this.imageRotateWithView_=false;this.imageRotation_=0;this.imageScale_=0;this.imageSnapToPixel_=false;this.imageWidth_=0;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=false;this.textRotation_=0;this.textScale_=0;this.textFillState_=null;this.textStrokeState_=null;this.textState_=null;this.pixelCoordinates_=[];this.tmpLocalTransform_=Gn.create()};fn.inherits(Ia,Na);Ia.prototype.drawImages_=function(t,i,s,e){if(!this.image_){return}var r=On.transform2D(t,i,s,2,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.tmpLocalTransform_;var a=n.globalAlpha;if(this.imageOpacity_!=1){n.globalAlpha=a*this.imageOpacity_}var o=this.imageRotation_;if(this.imageRotateWithView_){o+=this.viewRotation_}var f,u;for(f=0,u=r.length;f<u;f+=2){var l=r[f]-this.imageAnchorX_;var v=r[f+1]-this.imageAnchorY_;if(this.imageSnapToPixel_){l=Math.round(l);v=Math.round(v)}if(o!==0||this.imageScale_!=1){var c=l+this.imageAnchorX_;var d=v+this.imageAnchorY_;Gn.compose(h,c,d,this.imageScale_,this.imageScale_,o,-c,-d);n.setTransform.apply(n,h)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,l,v,this.imageWidth_,this.imageHeight_)}if(o!==0||this.imageScale_!=1){n.setTransform(1,0,0,1,0,0)}if(this.imageOpacity_!=1){n.globalAlpha=a}};Ia.prototype.drawText_=function(t,i,s,e){if(!this.textState_||this.text_===""){return}if(this.textFillState_){this.setContextFillState_(this.textFillState_)}if(this.textStrokeState_){this.setContextStrokeState_(this.textStrokeState_)}this.setContextTextState_(this.textState_);var r=On.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.textRotation_;if(this.textRotateWithView_){h+=this.viewRotation_}for(;i<s;i+=e){var a=r[i]+this.textOffsetX_;var o=r[i+1]+this.textOffsetY_;if(h!==0||this.textScale_!=1){var f=Gn.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,h,-a,-o);n.setTransform.apply(n,f)}if(this.textStrokeState_){n.strokeText(this.text_,a,o)}if(this.textFillState_){n.fillText(this.text_,a,o)}}if(h!==0||this.textScale_!=1){n.setTransform(1,0,0,1,0,0)}};Ia.prototype.moveToLineTo_=function(t,i,s,e,r){var n=this.context_;var h=On.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);n.moveTo(h[0],h[1]);var a=h.length;if(r){a-=2}for(var o=2;o<a;o+=2){n.lineTo(h[o],h[o+1])}if(r){n.closePath()}return s};Ia.prototype.drawRings_=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){i=this.moveToLineTo_(t,i,s[r],e,true)}return i};Ia.prototype.drawCircle=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.fillState_||this.strokeState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=Vn.transform2D(t,this.transform_,this.pixelCoordinates_);var s=i[2]-i[0];var e=i[3]-i[1];var r=Math.sqrt(s*s+e*e);var n=this.context_;n.beginPath();n.arc(i[0],i[1],r,0,2*Math.PI);if(this.fillState_){n.fill()}if(this.strokeState_){n.stroke()}}if(this.text_!==""){this.drawText_(t.getCenter(),0,2,2)}};Ia.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Ia.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case yn.POINT:this.drawPoint(t);break;case yn.LINE_STRING:this.drawLineString(t);break;case yn.POLYGON:this.drawPolygon(t);break;case yn.MULTI_POINT:this.drawMultiPoint(t);break;case yn.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case yn.MULTI_POLYGON:this.drawMultiPolygon(t);break;case yn.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case yn.CIRCLE:this.drawCircle(t);break}};Ia.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!Nn.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Ia.prototype.drawGeometryCollection=function(t){var i=t.getGeometriesArray();var s,e;for(s=0,e=i.length;s<e;++s){this.drawGeometry(i[s])}};Ia.prototype.drawPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Ia.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Ia.prototype.drawLineString=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_;var s=t.getFlatCoordinates();i.beginPath();this.moveToLineTo_(s,0,s.length,t.getStride(),false);i.stroke()}if(this.text_!==""){var e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}};Ia.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(!Nn.intersects(this.extent_,i)){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s=this.context_;var e=t.getFlatCoordinates();var r=0;var n=t.getEnds();var h=t.getStride();s.beginPath();var a,o;for(a=0,o=n.length;a<o;++a){r=this.moveToLineTo_(e,r,n[a],h,false)}s.stroke()}if(this.text_!==""){var f=t.getFlatMidpoints();this.drawText_(f,0,f.length,2)}};Ia.prototype.drawPolygon=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;i.beginPath();this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride());if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}};Ia.prototype.drawMultiPolygon=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;var s=t.getOrientedFlatCoordinates();var e=0;var r=t.getEndss();var n=t.getStride();var h,a;i.beginPath();for(h=0,a=r.length;h<a;++h){var o=r[h];e=this.drawRings_(s,e,o,n)}if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var f=t.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}};Ia.prototype.setContextFillState_=function(t){var i=this.context_;var s=this.contextFillState_;if(!s){i.fillStyle=t.fillStyle;this.contextFillState_={fillStyle:t.fillStyle}}else{if(s.fillStyle!=t.fillStyle){s.fillStyle=i.fillStyle=t.fillStyle}}};Ia.prototype.setContextStrokeState_=function(t){var i=this.context_;var s=this.contextStrokeState_;if(!s){i.lineCap=t.lineCap;if(rh.CANVAS_LINE_DASH){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineJoin=t.lineJoin;i.lineWidth=t.lineWidth;i.miterLimit=t.miterLimit;i.strokeStyle=t.strokeStyle;this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle}}else{if(s.lineCap!=t.lineCap){s.lineCap=i.lineCap=t.lineCap}if(rh.CANVAS_LINE_DASH){if(!kn.equals(s.lineDash,t.lineDash)){i.setLineDash(s.lineDash=t.lineDash)}if(s.lineDashOffset!=t.lineDashOffset){s.lineDashOffset=i.lineDashOffset=t.lineDashOffset}}if(s.lineJoin!=t.lineJoin){s.lineJoin=i.lineJoin=t.lineJoin}if(s.lineWidth!=t.lineWidth){s.lineWidth=i.lineWidth=t.lineWidth}if(s.miterLimit!=t.miterLimit){s.miterLimit=i.miterLimit=t.miterLimit}if(s.strokeStyle!=t.strokeStyle){s.strokeStyle=i.strokeStyle=t.strokeStyle}}};Ia.prototype.setContextTextState_=function(t){var i=this.context_;var s=this.contextTextState_;var e=t.textAlign?t.textAlign:ka.defaultTextAlign;if(!s){i.font=t.font;i.textAlign=e;i.textBaseline=t.textBaseline;this.contextTextState_={font:t.font,textAlign:e,textBaseline:t.textBaseline}}else{if(s.font!=t.font){s.font=i.font=t.font}if(s.textAlign!=e){s.textAlign=e}if(s.textBaseline!=t.textBaseline){s.textBaseline=i.textBaseline=t.textBaseline}}};Ia.prototype.setFillStrokeStyle=function(t,i){if(!t){this.fillState_=null}else{var s=t.getColor();this.fillState_={fillStyle:Ca.asColorLike(s?s:ka.defaultFillStyle)}}if(!i){this.strokeState_=null}else{var e=i.getColor();var r=i.getLineCap();var n=i.getLineDash();var h=i.getLineDashOffset();var a=i.getLineJoin();var o=i.getWidth();var f=i.getMiterLimit();this.strokeState_={lineCap:r!==undefined?r:ka.defaultLineCap,lineDash:n?n:ka.defaultLineDash,lineDashOffset:h?h:ka.defaultLineDashOffset,lineJoin:a!==undefined?a:ka.defaultLineJoin,lineWidth:this.pixelRatio_*(o!==undefined?o:ka.defaultLineWidth),miterLimit:f!==undefined?f:ka.defaultMiterLimit,strokeStyle:Ca.asColorLike(e?e:ka.defaultStrokeStyle)}}};Ia.prototype.setImageStyle=function(t){if(!t){this.image_=null}else{var i=t.getAnchor();var s=t.getImage(1);var e=t.getOrigin();var r=t.getSize();this.imageAnchorX_=i[0];this.imageAnchorY_=i[1];this.imageHeight_=r[1];this.image_=s;this.imageOpacity_=t.getOpacity();this.imageOriginX_=e[0];this.imageOriginY_=e[1];this.imageRotateWithView_=t.getRotateWithView();this.imageRotation_=t.getRotation();this.imageScale_=t.getScale()*this.pixelRatio_;this.imageSnapToPixel_=t.getSnapToPixel();this.imageWidth_=r[0]}};Ia.prototype.setTextStyle=function(t){if(!t){this.text_=""}else{var i=t.getFill();if(!i){this.textFillState_=null}else{var s=i.getColor();this.textFillState_={fillStyle:Ca.asColorLike(s?s:ka.defaultFillStyle)}}var e=t.getStroke();if(!e){this.textStrokeState_=null}else{var r=e.getColor();var n=e.getLineCap();var h=e.getLineDash();var a=e.getLineDashOffset();var o=e.getLineJoin();var f=e.getWidth();var u=e.getMiterLimit();this.textStrokeState_={lineCap:n!==undefined?n:ka.defaultLineCap,lineDash:h?h:ka.defaultLineDash,lineDashOffset:a?a:ka.defaultLineDashOffset,lineJoin:o!==undefined?o:ka.defaultLineJoin,lineWidth:f!==undefined?f:ka.defaultLineWidth,miterLimit:u!==undefined?u:ka.defaultMiterLimit,strokeStyle:Ca.asColorLike(r?r:ka.defaultStrokeStyle)}}var l=t.getFont();var v=t.getOffsetX();var c=t.getOffsetY();var d=t.getRotateWithView();var m=t.getRotation();var p=t.getScale();var z=t.getText();var M=t.getTextAlign();var _=t.getTextBaseline();this.textState_={font:l!==undefined?l:ka.defaultFont,textAlign:M!==undefined?M:ka.defaultTextAlign,textBaseline:_!==undefined?_:ka.defaultTextBaseline};this.text_=z!==undefined?z:"";this.textOffsetX_=v!==undefined?this.pixelRatio_*v:0;this.textOffsetY_=c!==undefined?this.pixelRatio_*c:0;this.textRotateWithView_=d!==undefined?d:false;this.textRotation_=m!==undefined?m:0;this.textScale_=this.pixelRatio_*(p!==undefined?p:1)}};var Sa=function(t){Mn.call(this);this.layer_=t};fn.inherits(Sa,Mn);Sa.prototype.forEachFeatureAtCoordinate=fn.nullFunction;Sa.prototype.hasFeatureAtCoordinate=Sn.FALSE;Sa.prototype.createLoadedTileFinder=function(t,i,s){return function(e,r){function n(t){if(!s[e]){s[e]={}}s[e][t.tileCoord.toString()]=t}return t.forEachLoadedTile(i,e,r,n)}};Sa.prototype.getLayer=function(){return this.layer_};Sa.prototype.handleImageChange_=function(t){var i=t.target;if(i.getState()===_a.LOADED){this.renderIfReadyAndVisible()}};Sa.prototype.loadImage=function(t){var i=t.getState();if(i!=_a.LOADED&&i!=_a.ERROR){cn.listen(t,zn.CHANGE,this.handleImageChange_,this)}if(i==_a.IDLE){t.load();i=t.getState()}return i==_a.LOADED};Sa.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();if(t.getVisible()&&t.getSourceState()==Wh.READY){this.changed()}};Sa.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var e=fn.getUid(t).toString();if(e in s.usedTiles){t.expireCache(s.viewState.projection,s.usedTiles[e])}}.bind(null,i);t.postRenderFunctions.push(s)}};Sa.prototype.updateLogos=function(t,i){var s=i.getLogo();if(s!==undefined){if(typeof s==="string"){t.logos[s]=""}else if(s){bn.assert(typeof s.href=="string",44);bn.assert(typeof s.src=="string",45);t.logos[s.src]=s.href}}};Sa.prototype.updateUsedTiles=function(t,i,s,e){var r=fn.getUid(i).toString();var n=s.toString();if(r in t){if(n in t[r]){t[r][n].extend(e)}else{t[r][n]=e}}else{t[r]={};t[r][n]=e}};Sa.prototype.manageTilePyramid=function(t,i,s,e,r,n,h,a,o,f){var u=fn.getUid(i).toString();if(!(u in t.wantedTiles)){t.wantedTiles[u]={}}var l=t.wantedTiles[u];var v=t.tileQueue;var c=s.getMinZoom();var d,m,p,z,M,_;for(_=c;_<=h;++_){m=s.getTileRangeForExtentAndZ(n,_,m);p=s.getResolution(_);for(z=m.minX;z<=m.maxX;++z){for(M=m.minY;M<=m.maxY;++M){if(h-_<=a){d=i.getTile(_,z,M,e,r);if(d.getState()==wh.IDLE){l[d.getKey()]=true;if(!v.isKeyQueued(d.getKey())){v.enqueue([d,u,s.getTileCoordCenter(d.tileCoord),p])}}if(o!==undefined){o.call(f,d)}}else{i.useTile(_,z,M,r)}}}}};var Oa=function(t){Sa.call(this,t);this.transform_=Gn.create()};fn.inherits(Oa,Sa);Oa.prototype.clip=function(t,i,s){var e=i.pixelRatio;var r=i.size[0]*e;var n=i.size[1]*e;var h=i.viewState.rotation;var a=Nn.getTopLeft(s);var o=Nn.getTopRight(s);var f=Nn.getBottomRight(s);var u=Nn.getBottomLeft(s);Gn.apply(i.coordinateToPixelTransform,a);Gn.apply(i.coordinateToPixelTransform,o);Gn.apply(i.coordinateToPixelTransform,f);Gn.apply(i.coordinateToPixelTransform,u);t.save();ka.rotateAtOffset(t,-h,r/2,n/2);t.beginPath();t.moveTo(a[0]*e,a[1]*e);t.lineTo(o[0]*e,o[1]*e);t.lineTo(f[0]*e,f[1]*e);t.lineTo(u[0]*e,u[1]*e);t.clip();ka.rotateAtOffset(t,h,r/2,n/2)};Oa.prototype.dispatchComposeEvent_=function(t,i,s,e){var r=this.getLayer();if(r.hasListener(t)){var n=s.size[0]*s.pixelRatio;var h=s.size[1]*s.pixelRatio;var a=s.viewState.rotation;ka.rotateAtOffset(i,-a,n/2,h/2);var o=e!==undefined?e:this.getTransform(s,0);var f=new Ia(i,s.pixelRatio,s.extent,o,s.viewState.rotation);var u=new ya(t,f,s,i,null);r.dispatchEvent(u);ka.rotateAtOffset(i,a,n/2,h/2)}};Oa.prototype.forEachLayerAtCoordinate=function(t,i,s,e){var r=this.forEachFeatureAtCoordinate(t,i,0,Sn.TRUE,this);if(r){return s.call(e,this.getLayer(),null)}else{return undefined}};Oa.prototype.postCompose=function(t,i,s,e){this.dispatchComposeEvent_(Hh.POSTCOMPOSE,t,i,e)};Oa.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(Hh.PRECOMPOSE,t,i,s)};Oa.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(Hh.RENDER,t,i,s)};Oa.prototype.getTransform=function(t,i){var s=t.viewState;var e=t.pixelRatio;var r=e*t.size[0]/2;var n=e*t.size[1]/2;var h=e/s.resolution;var a=-h;var o=-s.rotation;var f=-s.center[0]+i;var u=-s.center[1];return Gn.compose(this.transform_,r,n,h,a,o,f,u)};Oa.prototype.composeFrame=function(t,i,s){};Oa.prototype.prepareFrame=function(t,i){};var Ta=function(t){Oa.call(this,t);this.coordinateToCanvasPixelTransform=Gn.create();this.hitCanvasContext_=null};fn.inherits(Ta,Oa);Ta.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var e=this.getImage();if(e){var r=i.extent;var n=r!==undefined&&!Nn.containsExtent(r,t.extent)&&Nn.intersects(r,t.extent);if(n){this.clip(s,t,r)}var h=this.getImageTransform();var a=s.globalAlpha;s.globalAlpha=i.opacity;var o=h[4];var f=h[5];var u=e.width*h[0];var l=e.height*h[3];s.drawImage(e,0,0,+e.width,+e.height,Math.round(o),Math.round(f),Math.round(u),Math.round(l));s.globalAlpha=a;if(n){s.restore()}}this.postCompose(s,t,i)};Ta.prototype.getImage=function(){};Ta.prototype.getImageTransform=function(){};Ta.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};Ta.prototype.forEachLayerAtCoordinate=function(t,i,s,e){if(!this.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==fn.nullFunction){return Oa.prototype.forEachLayerAtCoordinate.apply(this,arguments)}else{var r=Gn.apply(this.coordinateToCanvasPixelTransform,t.slice());Ah.scale(r,i.viewState.resolution/this.renderedResolution);if(!this.hitCanvasContext_){this.hitCanvasContext_=Lh.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var n=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(n[3]>0){return s.call(e,this.getLayer(),n)}else{return undefined}}};var Aa=function(t){Ta.call(this,t);this.image_=null;this.imageTransform_=Gn.create();this.skippedFeatures_=[];this.vectorRenderer_=null};fn.inherits(Aa,Ta);Aa["handles"]=function(t,i){return t===Uh.CANVAS&&(i.getType()===ba.IMAGE||i.getType()===ba.VECTOR&&i.getRenderMode()===xa.IMAGE)};Aa["create"]=function(t,i){var s=new Aa(i);if(i.getType()===ba.VECTOR){var e=Vh.getLayerRendererPlugins();for(var r=0,n=e.length;r<n;++r){var h=e[r];if(h!==Aa&&h["handles"](Uh.CANVAS,i)){s.setVectorRenderer(h["create"](t,i))}}}return s};Aa.prototype.getImage=function(){return!this.image_?null:this.image_.getImage()};Aa.prototype.getImageTransform=function(){return this.imageTransform_};Aa.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.center;var h=r.resolution;var a;var o=this.getLayer();var f=o.getSource();var u=t.viewHints;var l=t.extent;if(i.extent!==undefined){l=Nn.getIntersection(l,i.extent)}if(!u[Sh.ANIMATING]&&!u[Sh.INTERACTING]&&!Nn.isEmpty(l)){var v=r.projection;if(!fn.ENABLE_RASTER_REPROJECTION){var c=f.getProjection();if(c){v=c}}var d=this.vectorRenderer_;if(d){var m=d.context;var p=vn.assign({},t,{size:[Nn.getWidth(l)/h,Nn.getHeight(l)/h],viewState:vn.assign({},t.viewState,{rotation:0})});var z=Object.keys(p.skippedFeatureUids).sort();if(d.prepareFrame(p,i)&&(d.replayGroupChanged||!kn.equals(z,this.skippedFeatures_))){m.canvas.width=p.size[0]*s;m.canvas.height=p.size[1]*s;d.composeFrame(p,i,m);this.image_=new ga(l,h,s,m.canvas);this.skippedFeatures_=z}}else{a=f.getImage(l,h,s,v);if(a){var M=this.loadImage(a);if(M){this.image_=a}}}}if(this.image_){a=this.image_;var _=a.getExtent();var g=a.getResolution();var b=a.getPixelRatio();var x=s*g/(h*b);var y=Gn.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,x,x,0,b*(_[0]-n[0])/g,b*(n[1]-_[3])/g);Gn.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-y[4],s*e[1]/2-y[5],s/h,-s/h,0,-n[0],-n[1]);this.updateLogos(t,f);this.renderedResolution=g*s/b}return!!this.image_};Aa.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(this.vectorRenderer_){return this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,e,r)}else{return Ta.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,e,r)}};Aa.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var Ra=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};Ra.getKey=function(t,i,s){var e=s?Ea.asString(s):"null";return i+":"+t+":"+e};Ra.prototype.clear=function(){this.cache_={};this.cacheSize_=0};Ra.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;var i,s;for(i in this.cache_){s=this.cache_[i];if((t++&3)===0&&!s.hasListener()){delete this.cache_[i];--this.cacheSize_}}}};Ra.prototype.get=function(t,i,s){var e=Ra.getKey(t,i,s);return e in this.cache_?this.cache_[e]:null};Ra.prototype.set=function(t,i,s,e){var r=Ra.getKey(t,i,s);this.cache_[r]=e;++this.cacheSize_};Ra.prototype.setSize=function(t){this.maxCacheSize_=t;this.expire()};var Pa={};Pa.iconImageCache=new Ra;var La=function(t,i){dn.call(this);this.map_=i;this.layerRenderers_={};this.layerRendererListeners_={}};fn.inherits(La,dn);La.prototype.calculateMatrices2D=function(t){var i=t.viewState;var s=t.coordinateToPixelTransform;var e=t.pixelToCoordinateTransform;Gn.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]);Gn.invert(Gn.setFromArray(e,s))};La.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_){this.removeLayerRendererByKey_(t).dispose()}};La.expireIconCache_=function(t,i){var s=Pa.iconImageCache;s.expire()};La.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;var o=i.viewState;var f=o.resolution;function u(t,s){var n=fn.getUid(t).toString();var h=i.layerStates[fn.getUid(s)].managed;if(!(n in i.skippedFeatureUids&&!h)){return e.call(r,t,h?s:null)}}var l=o.projection;var v=t;if(l.canWrapX()){var c=l.getExtent();var d=Nn.getWidth(c);var m=t[0];if(m<c[0]||m>c[2]){var p=Math.ceil((c[0]-m)/d);v=[m+d*p,t[1]]}}var z=i.layerStatesArray;var M=z.length;var _;for(_=M-1;_>=0;--_){var g=z[_];var b=g.layer;if(Jh.visibleAtResolution(g,f)&&n.call(h,b)){var x=this.getLayerRenderer(b);if(b.getSource()){a=x.forEachFeatureAtCoordinate(b.getSource().getWrapX()?v:t,i,s,u,r)}if(a){return a}}}return undefined};La.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){};La.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=this.forEachFeatureAtCoordinate(t,i,s,Sn.TRUE,this,e,r);return n!==undefined};La.prototype.getLayerRenderer=function(t){var i=fn.getUid(t).toString();if(i in this.layerRenderers_){return this.layerRenderers_[i]}else{var s=Vh.getLayerRendererPlugins();var e;var r=this.getType();for(var n=0,h=s.length;n<h;++n){var a=s[n];if(a["handles"](r,t)){e=a["create"](this,t);break}}if(e){this.layerRenderers_[i]=e;this.layerRendererListeners_[i]=cn.listen(e,zn.CHANGE,this.handleLayerRendererChange_,this)}else{throw new Error("Unable to create renderer for layer: "+t.getType())}return e}};La.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]};La.prototype.getLayerRenderers=function(){return this.layerRenderers_};La.prototype.getMap=function(){return this.map_};La.prototype.getType=function(){};La.prototype.handleLayerRendererChange_=function(){this.map_.render()};La.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];delete this.layerRenderers_[t];cn.unlistenByKey(this.layerRendererListeners_[t]);delete this.layerRendererListeners_[t];return i};La.prototype.renderFrame=fn.nullFunction;La.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_){if(!i||!(s in i.layerStates)){this.removeLayerRendererByKey_(s).dispose()}}};La.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(La.expireIconCache_)};La.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_){if(!(i in t.layerStates)){t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this));return}}};La.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var Da=function(t,i){La.call(this,t,i);this.context_=Lh.createCanvasContext2D();this.canvas_=this.context_.canvas;this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=Bh.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.renderedVisible_=true;this.transform_=Gn.create()};fn.inherits(Da,La);Da["handles"]=function(t){return t===Uh.CANVAS};Da["create"]=function(t,i){return new Da(t,i)};Da.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();var e=this.context_;if(s.hasListener(t)){var r=i.extent;var n=i.pixelRatio;var h=i.viewState;var a=h.rotation;var o=this.getTransform(i);var f=new Ia(e,n,r,o,a);var u=new ya(t,f,i,e,null);s.dispatchEvent(u)}};Da.prototype.getTransform=function(t){var i=t.viewState;var s=this.canvas_.width/2;var e=this.canvas_.height/2;var r=t.pixelRatio/i.resolution;var n=-r;var h=-i.rotation;var a=-i.center[0];var o=-i.center[1];return Gn.compose(this.transform_,s,e,r,n,h,a,o)};Da.prototype.getType=function(){return Uh.CANVAS};Da.prototype.renderFrame=function(t){if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return}var i=this.context_;var s=t.pixelRatio;var e=Math.round(t.size[0]*s);var r=Math.round(t.size[1]*s);if(this.canvas_.width!=e||this.canvas_.height!=r){this.canvas_.width=e;this.canvas_.height=r}else{i.clearRect(0,0,e,r)}var n=t.viewState.rotation;this.calculateMatrices2D(t);this.dispatchComposeEvent_(Hh.PRECOMPOSE,t);var h=t.layerStatesArray;kn.stableSort(h,La.sortByZIndex);if(n){i.save();ka.rotateAtOffset(i,n,e/2,r/2)}var a=t.viewState.resolution;var o,f,u,l,v;for(o=0,f=h.length;o<f;++o){v=h[o];u=v.layer;l=this.getLayerRenderer(u);if(!Jh.visibleAtResolution(v,a)||v.sourceState!=Wh.READY){continue}if(l.prepareFrame(t,v)){l.composeFrame(t,v,i)}}if(n){i.restore()}this.dispatchComposeEvent_(Hh.POSTCOMPOSE,t);if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};Da.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){var h;var a=i.viewState;var o=a.resolution;var f=i.layerStatesArray;var u=f.length;var l=Gn.apply(i.pixelToCoordinateTransform,t.slice());var v;for(v=u-1;v>=0;--v){var c=f[v];var d=c.layer;if(Jh.visibleAtResolution(c,o)&&r.call(n,d)){var m=this.getLayerRenderer(d);h=m.forEachLayerAtCoordinate(l,i,s,e);if(h){return h}}}return undefined};var Fa=function(t,i,s,e){this.minX=t;this.maxX=i;this.minY=s;this.maxY=e};Fa.createOrUpdate=function(t,i,s,e,r){if(r!==undefined){r.minX=t;r.maxX=i;r.minY=s;r.maxY=e;return r}else{return new Fa(t,i,s,e)}};Fa.prototype.contains=function(t){return this.containsXY(t[1],t[2])};Fa.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY};Fa.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY};Fa.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY};Fa.prototype.extend=function(t){if(t.minX<this.minX){this.minX=t.minX}if(t.maxX>this.maxX){this.maxX=t.maxX}if(t.minY<this.minY){this.minY=t.minY}if(t.maxY>this.maxY){this.maxY=t.maxY}};Fa.prototype.getHeight=function(){return this.maxY-this.minY+1};Fa.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};Fa.prototype.getWidth=function(){return this.maxX-this.minX+1};Fa.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Wa=function(t){Ta.call(this,t);this.context=this.context===null?null:Lh.createCanvasContext2D();this.renderedExtent_=null;this.renderedTiles=[];this.tmpExtent=Nn.createEmpty();this.tmpTileRange_=new Fa(0,0,0,0);this.imageTransform_=Gn.create();this.zDirection=0};fn.inherits(Wa,Ta);Wa["handles"]=function(t,i){return t===Uh.CANVAS&&i.getType()===ba.TILE};Wa["create"]=function(t,i){return new Wa(i)};Wa.prototype.isDrawableTile_=function(t){var i=t.getState();var s=this.getLayer().getUseInterimTilesOnError();return i==wh.LOADED||i==wh.EMPTY||i==wh.ERROR&&!s};Wa.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.projection;var h=r.resolution;var a=r.center;var o=this.getLayer();var f=o.getSource();var u=f.getRevision();var l=f.getTileGridForProjection(n);var v=l.getZForResolution(h,this.zDirection);var c=l.getResolution(v);var d=Math.round(h/c)||1;var m=t.extent;if(i.extent!==undefined){m=Nn.getIntersection(m,i.extent)}if(Nn.isEmpty(m)){return false}var p=l.getTileRangeForExtentAndZ(m,v);var z=l.getTileRangeExtent(v,p);var M=f.getTilePixelRatio(s);var _={};_[v]={};var g=this.createLoadedTileFinder(f,n,_);var b=this.tmpExtent;var x=this.tmpTileRange_;var y=false;var w,k,E;for(k=p.minX;k<=p.maxX;++k){for(E=p.minY;E<=p.maxY;++E){w=f.getTile(v,k,E,s,n);if(w.getState()==wh.ERROR){if(!o.getUseInterimTilesOnError()){w.setState(wh.LOADED)}else if(o.getPreload()>0){y=true}}if(!this.isDrawableTile_(w)){w=w.getInterimTile()}if(this.isDrawableTile_(w)){var C=fn.getUid(this);if(w.getState()==wh.LOADED){_[v][w.tileCoord.toString()]=w;var N=w.inTransition(C);if(!y&&(N||this.renderedTiles.indexOf(w)===-1)){y=true}}if(w.getAlpha(C,t.time)===1){continue}}var I=l.getTileCoordChildTileRange(w.tileCoord,x,b);var S=false;if(I){S=g(v+1,I)}if(!S){l.forEachTileCoordParentTileRange(w.tileCoord,g,null,x,b)}}}var O=c*s/M*d;var T=t.viewHints;var A=T[Sh.ANIMATING]||T[Sh.INTERACTING];if(!(this.renderedResolution&&Date.now()-t.time>16&&A)&&(y||!(this.renderedExtent_&&Nn.containsExtent(this.renderedExtent_,m))||this.renderedRevision!=u||d!=this.oversampling_||!A&&O!=this.renderedResolution)){var R=this.context;if(R){var P=f.getTilePixelSize(v,s,n);var L=Math.round(p.getWidth()*P[0]/d);var D=Math.round(p.getHeight()*P[1]/d);var F=R.canvas;if(F.width!=L||F.height!=D){this.oversampling_=d;F.width=L;F.height=D}else{if(this.renderedExtent_&&!Nn.equals(z,this.renderedExtent_)){R.clearRect(0,0,L,D)}d=this.oversampling_}}this.renderedTiles.length=0;var W=Object.keys(_).map(Number);W.sort((function(t,i){if(t===v){return 1}else if(i===v){return-1}else{return t>i?1:t<i?-1:0}}));var G,j,V,U,X,q;var Y,B,H,J,Z;for(X=0,q=W.length;X<q;++X){U=W[X];V=f.getTilePixelSize(U,s,n);G=l.getResolution(U);j=G/c;B=M*f.getGutter(n);H=_[U];for(var $ in H){w=H[$];Y=l.getTileCoordExtent(w.getTileCoord(),b);k=(Y[0]-z[0])/c*M/d;E=(z[3]-Y[3])/c*M/d;J=V[0]*j/d;Z=V[1]*j/d;this.drawTileImage(w,t,i,k,E,J,Z,B,v===U);this.renderedTiles.push(w)}}this.renderedRevision=u;this.renderedResolution=c*s/M*d;this.renderedExtent_=z}var K=this.renderedResolution/h;var Q=Gn.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,K,K,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);Gn.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-Q[4],s*e[1]/2-Q[5],s/h,-s/h,0,-a[0],-a[1]);this.updateUsedTiles(t.usedTiles,f,v,p);this.manageTilePyramid(t,f,l,s,n,m,v,o.getPreload());this.scheduleExpireCache(t,f);this.updateLogos(t,f);return this.renderedTiles.length>0};Wa.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t.getImage(this.getLayer());if(!f){return}var u=fn.getUid(this);var l=o?t.getAlpha(u,i.time):1;if(l===1&&!this.getLayer().getSource().getOpaque(i.viewState.projection)){this.context.clearRect(e,r,n,h)}var v=l!==this.context.globalAlpha;if(v){this.context.save();this.context.globalAlpha=l}this.context.drawImage(f,a,a,f.width-2*a,f.height-2*a,e,r,n,h);if(v){this.context.restore()}if(l!==1){i.animate=true}else if(o){t.endTransition(u)}};Wa.prototype.getImage=function(){var t=this.context;return t?t.canvas:null};Wa.prototype.getImageTransform=function(){return this.imageTransform_};var Ga=d((function(t,i){(function(i,s){t.exports=s()})(m,(function(){function t(t,s,r,n,h){i(t,s,r||0,n||t.length-1,h||e)}function i(t,e,r,n,h){while(n>r){if(n-r>600){var a=n-r+1;var o=e-r+1;var f=Math.log(a);var u=.5*Math.exp(2*f/3);var l=.5*Math.sqrt(f*u*(a-u)/a)*(o-a/2<0?-1:1);var v=Math.max(r,Math.floor(e-o*u/a+l));var c=Math.min(n,Math.floor(e+(a-o)*u/a+l));i(t,e,v,c,h)}var d=t[e];var m=r;var p=n;s(t,r,e);if(h(t[n],d)>0)s(t,r,n);while(m<p){s(t,m,p);m++;p--;while(h(t[m],d)<0)m++;while(h(t[p],d)>0)p--}if(h(t[r],d)===0)s(t,r,p);else{p++;s(t,p,n)}if(p<=e)r=p+1;if(e<=p)n=p-1}}function s(t,i,s){var e=t[i];t[i]=t[s];t[s]=e}function e(t,i){return t<i?-1:t>i?1:0}return t}))}));var ja=Va;function Va(t,i){if(!(this instanceof Va))return new Va(t,i);this._maxEntries=Math.max(4,t||9);this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4));if(i){this._initFormat(i)}this.clear()}Va.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],e=this.toBBox;if(!to(t,i))return s;var r=[],n,h,a,o;while(i){for(n=0,h=i.children.length;n<h;n++){a=i.children[n];o=i.leaf?e(a):a;if(to(t,o)){if(i.leaf)s.push(a);else if(Qa(t,o))this._all(a,s);else r.push(a)}}i=r.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!to(t,i))return false;var e=[],r,n,h,a;while(i){for(r=0,n=i.children.length;r<n;r++){h=i.children[r];a=i.leaf?s(h):h;if(to(t,a)){if(i.leaf||Qa(t,a))return true;e.push(h)}}i=e.pop()}return false},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++){this.insert(t[i])}return this}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length){this.data=e}else if(this.data.height===e.height){this._splitRoot(this.data,e)}else{if(this.data.height<e.height){var r=this.data;this.data=e;e=r}this._insert(e,this.data.height-e.height-1,true)}return this},insert:function(t){if(t)this._insert(t,this.data.height-1);return this},clear:function(){this.data=io([]);return this},remove:function(t,i){if(!t)return this;var s=this.data,e=this.toBBox(t),r=[],n=[],h,a,o,f;while(s||r.length){if(!s){s=r.pop();a=r[r.length-1];h=n.pop();f=true}if(s.leaf){o=Ua(t,s.children,i);if(o!==-1){s.children.splice(o,1);r.push(s);this._condense(r);return this}}if(!f&&!s.leaf&&Qa(s,e)){r.push(s);n.push(h);h=0;a=s;s=s.children[0]}else if(a){h++;s=a.children[h];f=false}else s=null}return this},toBBox:function(t){return t},compareMinX:Ba,compareMinY:Ha,toJSON:function(){return this.data},fromJSON:function(t){this.data=t;return this},_all:function(t,i){var s=[];while(t){if(t.leaf)i.push.apply(i,t.children);else s.push.apply(s,t.children);t=s.pop()}return i},_build:function(t,i,s,e){var r=s-i+1,n=this._maxEntries,h;if(r<=n){h=io(t.slice(i,s+1));Xa(h,this.toBBox);return h}if(!e){e=Math.ceil(Math.log(r)/Math.log(n));n=Math.ceil(r/Math.pow(n,e-1))}h=io([]);h.leaf=false;h.height=e;var a=Math.ceil(r/n),o=a*Math.ceil(Math.sqrt(n)),f,u,l,v;so(t,i,s,o,this.compareMinX);for(f=i;f<=s;f+=o){l=Math.min(f+o-1,s);so(t,f,l,a,this.compareMinY);for(u=f;u<=l;u+=a){v=Math.min(u+a-1,l);h.children.push(this._build(t,u,v,e-1))}}Xa(h,this.toBBox);return h},_chooseSubtree:function(t,i,s,e){var r,n,h,a,o,f,u,l;while(true){e.push(i);if(i.leaf||e.length-1===s)break;u=l=Infinity;for(r=0,n=i.children.length;r<n;r++){h=i.children[r];o=Ja(h);f=$a(t,h)-o;if(f<l){l=f;u=o<u?o:u;a=h}else if(f===l){if(o<u){u=o;a=h}}}i=a||i.children[0]}return i},_insert:function(t,i,s){var e=this.toBBox,r=s?t:e(t),n=[];var h=this._chooseSubtree(r,this.data,i,n);h.children.push(t);Ya(h,r);while(i>=0){if(n[i].children.length>this._maxEntries){this._split(n,i);i--}else break}this._adjustParentBBoxes(r,n,i)},_split:function(t,i){var s=t[i],e=s.children.length,r=this._minEntries;this._chooseSplitAxis(s,r,e);var n=this._chooseSplitIndex(s,r,e);var h=io(s.children.splice(n,s.children.length-n));h.height=s.height;h.leaf=s.leaf;Xa(s,this.toBBox);Xa(h,this.toBBox);if(i)t[i-1].children.push(h);else this._splitRoot(s,h)},_splitRoot:function(t,i){this.data=io([t,i]);this.data.height=t.height+1;this.data.leaf=false;Xa(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var e,r,n,h,a,o,f,u;o=f=Infinity;for(e=i;e<=s-i;e++){r=qa(t,0,e,this.toBBox);n=qa(t,e,s,this.toBBox);h=Ka(r,n);a=Ja(r)+Ja(n);if(h<o){o=h;u=e;f=a<f?a:f}else if(h===o){if(a<f){f=a;u=e}}}return u},_chooseSplitAxis:function(t,i,s){var e=t.leaf?this.compareMinX:Ba,r=t.leaf?this.compareMinY:Ha,n=this._allDistMargin(t,i,s,e),h=this._allDistMargin(t,i,s,r);if(n<h)t.children.sort(e)},_allDistMargin:function(t,i,s,e){t.children.sort(e);var r=this.toBBox,n=qa(t,0,i,r),h=qa(t,s-i,s,r),a=Za(n)+Za(h),o,f;for(o=i;o<s-i;o++){f=t.children[o];Ya(n,t.leaf?r(f):f);a+=Za(n)}for(o=s-i-1;o>=i;o--){f=t.children[o];Ya(h,t.leaf?r(f):f);a+=Za(h)}return a},_adjustParentBBoxes:function(t,i,s){for(var e=s;e>=0;e--){Ya(i[e],t)}},_condense:function(t){for(var i=t.length-1,s;i>=0;i--){if(t[i].children.length===0){if(i>0){s=t[i-1].children;s.splice(s.indexOf(t[i]),1)}else this.clear()}else Xa(t[i],this.toBBox)}},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0]));this.compareMinY=new Function("a","b",i.join(t[1]));this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function Ua(t,i,s){if(!s)return i.indexOf(t);for(var e=0;e<i.length;e++){if(s(t,i[e]))return e}return-1}function Xa(t,i){qa(t,0,t.children.length,i,t)}function qa(t,i,s,e,r){if(!r)r=io(null);r.minX=Infinity;r.minY=Infinity;r.maxX=-Infinity;r.maxY=-Infinity;for(var n=i,h;n<s;n++){h=t.children[n];Ya(r,t.leaf?e(h):h)}return r}function Ya(t,i){t.minX=Math.min(t.minX,i.minX);t.minY=Math.min(t.minY,i.minY);t.maxX=Math.max(t.maxX,i.maxX);t.maxY=Math.max(t.maxY,i.maxY);return t}function Ba(t,i){return t.minX-i.minX}function Ha(t,i){return t.minY-i.minY}function Ja(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Za(t){return t.maxX-t.minX+(t.maxY-t.minY)}function $a(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function Ka(t,i){var s=Math.max(t.minX,i.minX),e=Math.max(t.minY,i.minY),r=Math.min(t.maxX,i.maxX),n=Math.min(t.maxY,i.maxY);return Math.max(0,r-s)*Math.max(0,n-e)}function Qa(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function to(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function io(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function so(t,i,s,e,r){var n=[i,s],h;while(n.length){s=n.pop();i=n.pop();if(s-i<=e)continue;h=i+Math.ceil((s-i)/e/2)*e;Ga(t,h,i,s,r);n.push(i,h,h,s)}}var eo=function(){};eo.prototype.getReplay=function(t,i){};eo.prototype.isEmpty=function(){};var ro={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var no={};no.lineString=function(t,i,s,e){var r=t[i];var n=t[i+1];var h=0;var a;for(a=i+e;a<s;a+=e){var o=t[a];var f=t[a+1];h+=Math.sqrt((o-r)*(o-r)+(f-n)*(f-n));r=o;n=f}return h};no.linearRing=function(t,i,s,e){var r=no.lineString(t,i,s,e);var n=t[s-e]-t[i];var h=t[s-e+1]-t[i+1];r+=Math.sqrt(n*n+h*h);return r};var ho={};ho.lineString=function(t,i,s,e,r,n,h,a){var o=[];var f=t[i]>t[s-e];var u=r.length;var l=t[i];var v=t[i+1];i+=e;var c=t[i];var d=t[i+1];var m=0;var p=Math.sqrt(Math.pow(c-l,2)+Math.pow(d-v,2));var z="";var M=0;var _,g,b;for(var x=0;x<u;++x){g=f?u-x-1:x;var y=r.charAt(g);z=f?y+z:z+y;var w=n(z)-M;M+=w;var k=h+w/2;while(i<s-e&&m+p<k){l=c;v=d;i+=e;c=t[i];d=t[i+1];m+=p;p=Math.sqrt(Math.pow(c-l,2)+Math.pow(d-v,2))}var E=k-m;var C=Math.atan2(d-v,c-l);if(f){C+=C>0?-Math.PI:Math.PI}if(b!==undefined){var N=C-b;N+=N>Math.PI?-2*Math.PI:N<-Math.PI?2*Math.PI:0;if(Math.abs(N)>a){return null}}var I=E/p;var S=xn.lerp(l,c,I);var O=xn.lerp(v,d,I);if(b==C){if(f){_[0]=S;_[1]=O;_[2]=w/2}_[4]=z}else{z=y;M=w;_=[S,O,w/2,C,z];if(f){o.unshift(_)}else{o.push(_)}b=C}h+=w}return o};var ao={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12};var oo={};oo.ORDER=[ro.POLYGON,ro.CIRCLE,ro.LINE_STRING,ro.IMAGE,ro.TEXT,ro.DEFAULT];oo.TEXT_ALIGN={};oo.TEXT_ALIGN["left"]=0;oo.TEXT_ALIGN["end"]=0;oo.TEXT_ALIGN["center"]=.5;oo.TEXT_ALIGN["right"]=1;oo.TEXT_ALIGN["start"]=1;oo.TEXT_ALIGN["top"]=0;oo.TEXT_ALIGN["middle"]=.5;oo.TEXT_ALIGN["hanging"]=.2;oo.TEXT_ALIGN["alphabetic"]=.8;oo.TEXT_ALIGN["ideographic"]=.8;oo.TEXT_ALIGN["bottom"]=1;var fo=function(t,i,s,e,r,n){Na.call(this);this.declutterTree=n;this.tmpExtent_=Nn.createEmpty();this.tolerance=t;this.maxExtent=i;this.overlaps=r;this.pixelRatio=e;this.maxLineWidth=0;this.resolution=s;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_=null;this.bufferedMaxExtent_=null;this.instructions=[];this.coordinates=[];this.coordinateCache_={};this.renderedTransform_=Gn.create();this.hitDetectionInstructions=[];this.pixelCoordinates_=null;this.state={};this.viewRotation_=0;this.tmpLocalTransform_=Gn.create();this.resetTransform_=Gn.create()};fn.inherits(fo,Na);fo.prototype.replayTextBackground_=function(t,i,s,e,r,n,h){t.beginPath();t.moveTo.apply(t,i);t.lineTo.apply(t,s);t.lineTo.apply(t,e);t.lineTo.apply(t,r);t.lineTo.apply(t,i);if(n){this.fillOrigin_=n[2];this.fill_(t)}if(h){this.setStrokeStyle_(t,h);t.stroke()}};fo.prototype.replayImage_=function(t,i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z){var M=p||z;var _=this.tmpLocalTransform_;r*=v;n*=v;i-=r;s-=n;if(c){i=Math.round(i);s=Math.round(s)}var g=d+f>e.width?e.width-f:d;var b=a+u>e.height?e.height-u:a;var x=this.tmpExtent_;var y=m[3]+g*v+m[1];var w=m[0]+b*v+m[2];var k=i-m[3];var E=s-m[0];var C;var N;var I;var S;if(M||l!==0){C=[k,E];N=[k+y,E];I=[k+y,E+w];S=[k,E+w]}var O=null;if(l!==0){var T=i+r;var A=s+n;O=Gn.compose(_,T,A,1,1,l,-T,-A);Nn.createOrUpdateEmpty(x);Nn.extendCoordinate(x,Gn.apply(_,C));Nn.extendCoordinate(x,Gn.apply(_,N));Nn.extendCoordinate(x,Gn.apply(_,I));Nn.extendCoordinate(x,Gn.apply(_,S))}else{Nn.createOrUpdate(k,E,k+y,E+w,x)}var R=t.canvas;var P=x[0]<=R.width&&x[2]>=0&&x[1]<=R.height&&x[3]>=0;if(h){if(!P&&h[4]==1){return}Nn.extend(h,x);var L=P?[t,O?O.slice(0):null,o,e,f,u,g,b,i,s,v]:null;if(L&&M){L.push(p,z,C,N,I,S)}h.push(L)}else if(P){if(M){this.replayTextBackground_(t,C,N,I,S,p,z)}ka.drawImage(t,O,o,e,f,u,g,b,i,s,v)}};fo.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return i==1?t:t.map((function(t){return t*i}))};fo.prototype.appendFlatCoordinates=function(t,i,s,e,r,n){var h=this.coordinates.length;var a=this.getBufferedMaxExtent();if(n){i+=e}var o=[t[i],t[i+1]];var f=[NaN,NaN];var u=true;var l,v,c;for(l=i+e;l<s;l+=e){f[0]=t[l];f[1]=t[l+1];c=Nn.coordinateRelationship(a,f);if(c!==v){if(u){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else if(c===Cn.INTERSECTING){this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else{u=true}o[0]=f[0];o[1]=f[1];v=c}if(r&&u||l===i+e){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}return h};fo.prototype.drawCustomCoordinates_=function(t,i,s,e,r){for(var n=0,h=s.length;n<h;++n){var a=s[n];var o=this.appendFlatCoordinates(t,i,a,e,false,false);r.push(o);i=a}return i};fo.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var e=t.getType();var r=t.getStride();var n=this.coordinates.length;var h,a,o,f;var u;if(e==yn.MULTI_POLYGON){t=t;h=t.getOrientedFlatCoordinates();f=[];var l=t.getEndss();u=0;for(var v=0,c=l.length;v<c;++v){var d=[];u=this.drawCustomCoordinates_(h,u,l[v],r,d);f.push(d)}this.instructions.push([ao.CUSTOM,n,f,t,s,Yn.coordinatesss])}else if(e==yn.POLYGON||e==yn.MULTI_LINE_STRING){o=[];h=e==yn.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates();u=this.drawCustomCoordinates_(h,0,t.getEnds(),r,o);this.instructions.push([ao.CUSTOM,n,o,t,s,Yn.coordinatess])}else if(e==yn.LINE_STRING||e==yn.MULTI_POINT){h=t.getFlatCoordinates();a=this.appendFlatCoordinates(h,0,h.length,r,false,false);this.instructions.push([ao.CUSTOM,n,a,t,s,Yn.coordinates])}else if(e==yn.POINT){h=t.getFlatCoordinates();this.coordinates.push(h[0],h[1]);a=this.coordinates.length;this.instructions.push([ao.CUSTOM,n,a,t,s])}this.endGeometry(t,i)};fo.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[ao.BEGIN_GEOMETRY,i,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[ao.BEGIN_GEOMETRY,i,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)};fo.prototype.fill_=function(t){if(this.fillOrigin_){var i=Gn.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]);t.rotate(this.viewRotation_)}t.fill();if(this.fillOrigin_){t.setTransform.apply(t,ka.resetTransform_)}};fo.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1];t.lineWidth=i[2];t.lineCap=i[3];t.lineJoin=i[4];t.miterLimit=i[5];if(rh.CANVAS_LINE_DASH){t.lineDashOffset=i[7];t.setLineDash(i[6])}};fo.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(s==1||s==t.length-5){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(e)){this.declutterTree.insert(e);var r=ka.drawImage;for(var n=5,h=t.length;n<h;++n){var a=t[n];if(a){if(a.length>11){this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12])}r.apply(undefined,a)}}}t.length=5;Nn.createOrUpdateEmpty(t)}}};fo.prototype.replay_=function(t,i,s,e,r,n){var h;if(this.pixelCoordinates_&&kn.equals(i,this.renderedTransform_)){h=this.pixelCoordinates_}else{if(!this.pixelCoordinates_){this.pixelCoordinates_=[]}h=On.transform2D(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_);Gn.setFromArray(this.renderedTransform_,i)}var a=!vn.isEmpty(s);var o=0;var f=e.length;var u=0;var l;var v,c,d,m,p,z,M,_;var g=0;var b=0;var x=null;var y=null;var w=this.coordinateCache_;var k=this.viewRotation_;var E={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k};var C=this.instructions!=e||this.overlaps?0:200;while(o<f){var N=e[o];var I=N[0];var S,O,T;switch(I){case ao.BEGIN_GEOMETRY:S=N[1];if(a&&s[fn.getUid(S).toString()]||!S.getGeometry()){o=N[2]}else if(n!==undefined&&!Nn.intersects(n,S.getGeometry().getExtent())){o=N[2]+1}else{++o}break;case ao.BEGIN_PATH:if(g>C){this.fill_(t);g=0}if(b>C){t.stroke();b=0}if(!g&&!b){t.beginPath();d=m=NaN}++o;break;case ao.CIRCLE:u=N[1];var A=h[u];var R=h[u+1];var P=h[u+2];var L=h[u+3];var D=P-A;var F=L-R;var W=Math.sqrt(D*D+F*F);t.moveTo(A+W,R);t.arc(A,R,W,0,2*Math.PI,true);++o;break;case ao.CLOSE_PATH:t.closePath();++o;break;case ao.CUSTOM:u=N[1];l=N[2];var G=N[3];var j=N[4];var V=N.length==6?N[5]:undefined;E.geometry=G;E.feature=S;if(!(o in w)){w[o]=[]}var U=w[o];if(V){V(h,u,l,2,U)}else{U[0]=h[u];U[1]=h[u+1];U.length=2}j(U,E);++o;break;case ao.DRAW_IMAGE:u=N[1];l=N[2];_=N[3];v=N[4];c=N[5];M=r?null:N[6];var X=N[7];var q=N[8];var Y=N[9];var B=N[10];var H=N[11];var J=N[12];var Z=N[13];var $=N[14];var K=N[15];var Q,tt,it;if(N.length>16){Q=N[16];tt=N[17];it=N[18]}else{Q=ka.defaultPadding;tt=it=false}if(H){J+=k}for(;u<l;u+=2){this.replayImage_(t,h[u],h[u+1],_,v,c,M,X,q,Y,B,J,Z,$,K,Q,tt?x:null,it?y:null)}this.renderDeclutter_(M,S);++o;break;case ao.DRAW_CHARS:var st=N[1];var et=N[2];var rt=N[3];M=r?null:N[4];var nt=N[5];var ht=N[6];var at=N[7];var ot=N[8];var ft=N[9];var ut=N[10];var lt=N[11];var vt=N[12];var ct=N[13];var dt=N[14];var mt=no.lineString(h,st,et,2);var pt=ot(vt);if(nt||pt<=mt){var zt=this.textStates[ct].textAlign;var Mt=(mt-pt)*oo.TEXT_ALIGN[zt];var _t=ho.lineString(h,st,et,2,vt,ot,Mt,at);if(_t){var gt,bt,xt,yt,wt;if(ut){for(gt=0,bt=_t.length;gt<bt;++gt){wt=_t[gt];xt=wt[4];yt=this.getImage(xt,ct,"",ut);v=wt[2]+lt;c=rt*yt.height+(.5-rt)*2*lt-ft;this.replayImage_(t,wt[0],wt[1],yt,v,c,M,yt.height,1,0,0,wt[3],dt,false,yt.width,ka.defaultPadding,null,null)}}if(ht){for(gt=0,bt=_t.length;gt<bt;++gt){wt=_t[gt];xt=wt[4];yt=this.getImage(xt,ct,ht,"");v=wt[2];c=rt*yt.height-ft;this.replayImage_(t,wt[0],wt[1],yt,v,c,M,yt.height,1,0,0,wt[3],dt,false,yt.width,ka.defaultPadding,null,null)}}}}this.renderDeclutter_(M,S);++o;break;case ao.END_GEOMETRY:if(r!==undefined){S=N[1];var kt=r(S);if(kt){return kt}}++o;break;case ao.FILL:if(C){g++}else{this.fill_(t)}++o;break;case ao.MOVE_TO_LINE_TO:u=N[1];l=N[2];O=h[u];T=h[u+1];p=O+.5|0;z=T+.5|0;if(p!==d||z!==m){t.moveTo(O,T);d=p;m=z}for(u+=2;u<l;u+=2){O=h[u];T=h[u+1];p=O+.5|0;z=T+.5|0;if(u==l-2||p!==d||z!==m){t.lineTo(O,T);d=p;m=z}}++o;break;case ao.SET_FILL_STYLE:x=N;this.fillOrigin_=N[2];if(g){this.fill_(t);g=0;if(b){t.stroke();b=0}}t.fillStyle=N[1];++o;break;case ao.SET_STROKE_STYLE:y=N;if(b){t.stroke();b=0}this.setStrokeStyle_(t,N);++o;break;case ao.STROKE:if(C){b++}else{t.stroke()}++o;break;default:++o;break}}if(g){this.fill_(t)}if(b){t.stroke()}return undefined};fo.prototype.replay=function(t,i,s,e){this.viewRotation_=s;this.replay_(t,i,e,this.instructions,undefined,undefined)};fo.prototype.replayHitDetection=function(t,i,s,e,r,n){this.viewRotation_=s;return this.replay_(t,i,e,this.hitDetectionInstructions,r,n)};fo.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var i;var s=t.length;var e;var r;var n=-1;for(i=0;i<s;++i){e=t[i];r=e[0];if(r==ao.END_GEOMETRY){n=i}else if(r==ao.BEGIN_GEOMETRY){e[2]=i;kn.reverseSubArray(this.hitDetectionInstructions,n,i);n=-1}}};fo.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var e=t.getColor();s.fillStyle=Ca.asColorLike(e?e:ka.defaultFillStyle)}else{s.fillStyle=undefined}if(i){var r=i.getColor();s.strokeStyle=Ca.asColorLike(r?r:ka.defaultStrokeStyle);var n=i.getLineCap();s.lineCap=n!==undefined?n:ka.defaultLineCap;var h=i.getLineDash();s.lineDash=h?h.slice():ka.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a?a:ka.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=o!==undefined?o:ka.defaultLineJoin;var f=i.getWidth();s.lineWidth=f!==undefined?f:ka.defaultLineWidth;var u=i.getMiterLimit();s.miterLimit=u!==undefined?u:ka.defaultMiterLimit;if(s.lineWidth>this.maxLineWidth){this.maxLineWidth=s.lineWidth;this.bufferedMaxExtent_=null}}else{s.strokeStyle=undefined;s.lineCap=undefined;s.lineDash=null;s.lineDashOffset=undefined;s.lineJoin=undefined;s.lineWidth=undefined;s.miterLimit=undefined}};fo.prototype.applyFill=function(t,i){var s=t.fillStyle;var e=[ao.SET_FILL_STYLE,s];if(typeof s!=="string"){var r=i.getExtent();e.push([r[0],r[3]])}this.instructions.push(e)};fo.prototype.applyStroke=function(t){this.instructions.push([ao.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])};fo.prototype.updateFillStyle=function(t,i,s){var e=t.fillStyle;if(typeof e!=="string"||t.currentFillStyle!=e){i.call(this,t,s);t.currentFillStyle=e}};fo.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle;var e=t.lineCap;var r=t.lineDash;var n=t.lineDashOffset;var h=t.lineJoin;var a=t.lineWidth;var o=t.miterLimit;if(t.currentStrokeStyle!=s||t.currentLineCap!=e||r!=t.currentLineDash&&!kn.equals(t.currentLineDash,r)||t.currentLineDashOffset!=n||t.currentLineJoin!=h||t.currentLineWidth!=a||t.currentMiterLimit!=o){i.call(this,t);t.currentStrokeStyle=s;t.currentLineCap=e;t.currentLineDash=r;t.currentLineDashOffset=n;t.currentLineJoin=h;t.currentLineWidth=a;t.currentMiterLimit=o}};fo.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var s=[ao.END_GEOMETRY,i];this.instructions.push(s);this.hitDetectionInstructions.push(s)};fo.prototype.finish=fn.nullFunction;fo.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_){this.bufferedMaxExtent_=Nn.clone(this.maxExtent);if(this.maxLineWidth>0){var t=this.resolution*(this.maxLineWidth+1)/2;Nn.buffer(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}}return this.bufferedMaxExtent_};var uo=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n);this.declutterGroup_=null;this.hitDetectionImage_=null;this.image_=null;this.anchorX_=undefined;this.anchorY_=undefined;this.height_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.scale_=undefined;this.snapToPixel_=undefined;this.width_=undefined};fn.inherits(uo,fo);uo.prototype.drawCoordinates_=function(t,i,s,e){return this.appendFlatCoordinates(t,i,s,e,false,false)};uo.prototype.drawPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([ao.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([ao.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};uo.prototype.drawMultiPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([ao.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([ao.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};uo.prototype.finish=function(){this.reverseHitDetectionInstructions();this.anchorX_=undefined;this.anchorY_=undefined;this.hitDetectionImage_=null;this.image_=null;this.height_=undefined;this.scale_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.snapToPixel_=undefined;this.width_=undefined};uo.prototype.setImageStyle=function(t,i){var s=t.getAnchor();var e=t.getSize();var r=t.getHitDetectionImage(1);var n=t.getImage(1);var h=t.getOrigin();this.anchorX_=s[0];this.anchorY_=s[1];this.declutterGroup_=i;this.hitDetectionImage_=r;this.image_=n;this.height_=e[1];this.opacity_=t.getOpacity();this.originX_=h[0];this.originY_=h[1];this.rotateWithView_=t.getRotateWithView();this.rotation_=t.getRotation();this.scale_=t.getScale();this.snapToPixel_=t.getSnapToPixel();this.width_=e[0]};var lo=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n)};fn.inherits(lo,fo);lo.prototype.drawFlatCoordinates_=function(t,i,s,e){var r=this.coordinates.length;var n=this.appendFlatCoordinates(t,i,s,e,false,false);var h=[ao.MOVE_TO_LINE_TO,r,n];this.instructions.push(h);this.hitDetectionInstructions.push(h);return s};lo.prototype.drawLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[ao.BEGIN_PATH]);var n=t.getFlatCoordinates();var h=t.getStride();this.drawFlatCoordinates_(n,0,n.length,h);this.hitDetectionInstructions.push([ao.STROKE]);this.endGeometry(t,i)};lo.prototype.drawMultiLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[ao.BEGIN_PATH]);var n=t.getEnds();var h=t.getFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinates_(h,o,n[f],a)}this.hitDetectionInstructions.push([ao.STROKE]);this.endGeometry(t,i)};lo.prototype.finish=function(){var t=this.state;if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([ao.STROKE])}this.reverseHitDetectionInstructions();this.state=null};lo.prototype.applyStroke=function(t){if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([ao.STROKE]);t.lastStroke=this.coordinates.length}t.lastStroke=0;fo.prototype.applyStroke.call(this,t);this.instructions.push([ao.BEGIN_PATH])};var vo=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n)};fn.inherits(vo,fo);vo.prototype.drawFlatCoordinatess_=function(t,i,s,e){var r=this.state;var n=r.fillStyle!==undefined;var h=r.strokeStyle!=undefined;var a=s.length;var o=[ao.BEGIN_PATH];this.instructions.push(o);this.hitDetectionInstructions.push(o);for(var f=0;f<a;++f){var u=s[f];var l=this.coordinates.length;var v=this.appendFlatCoordinates(t,i,u,e,true,!h);var c=[ao.MOVE_TO_LINE_TO,l,v];this.instructions.push(c);this.hitDetectionInstructions.push(c);if(h){var d=[ao.CLOSE_PATH];this.instructions.push(d);this.hitDetectionInstructions.push(d)}i=u}var m=[ao.FILL];this.hitDetectionInstructions.push(m);if(n){this.instructions.push(m)}if(h){var p=[ao.STROKE];this.instructions.push(p);this.hitDetectionInstructions.push(p)}return i};vo.prototype.drawCircle=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_FILL_STYLE,Ea.asString(ka.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getFlatCoordinates();var h=t.getStride();var a=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,h,false,false);var o=[ao.BEGIN_PATH];var f=[ao.CIRCLE,a];this.instructions.push(o,f);this.hitDetectionInstructions.push(o,f);var u=[ao.FILL];this.hitDetectionInstructions.push(u);if(s.fillStyle!==undefined){this.instructions.push(u)}if(s.strokeStyle!==undefined){var l=[ao.STROKE];this.instructions.push(l);this.hitDetectionInstructions.push(l)}this.endGeometry(t,i)};vo.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_FILL_STYLE,Ea.asString(ka.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var e=t.getEnds();var r=t.getOrientedFlatCoordinates();var n=t.getStride();this.drawFlatCoordinatess_(r,0,e,n);this.endGeometry(t,i)};vo.prototype.drawMultiPolygon=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_FILL_STYLE,Ea.asString(ka.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getEndss();var h=t.getOrientedFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinatess_(h,o,n[f],a)}this.endGeometry(t,i)};vo.prototype.finish=function(){this.reverseHitDetectionInstructions();this.state=null;var t=this.tolerance;if(t!==0){var i=this.coordinates;var s,e;for(s=0,e=i.length;s<e;++s){i[s]=Bn.snap(i[s],t)}}};vo.prototype.setFillStrokeStyles_=function(t){var i=this.state;var s=i.fillStyle;if(s!==undefined){this.updateFillStyle(i,this.applyFill,t)}if(i.strokeStyle!==undefined){this.updateStrokeStyle(i,this.applyStroke)}};var co={};co.lineString=function(t,i,s,e,r){var n=s;var h=s;var a=0;var o=0;var f=s;var u,l,v,c,d,m,p,z,M,_;for(l=s;l<e;l+=r){var g=i[l];var b=i[l+1];if(d!==undefined){M=g-d;_=b-m;c=Math.sqrt(M*M+_*_);if(p!==undefined){o+=v;u=Math.acos((p*M+z*_)/(v*c));if(u>t){if(o>a){a=o;n=f;h=l}o=0;f=l-r}}v=c;p=M;z=_}d=g;m=b}o+=c;return o>a?[f,l]:[n,h]};var mo={POINT:"point",LINE:"line"};var po=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n);this.labels_=null;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=undefined;this.textRotation_=0;this.textFillState_=null;this.fillStates={};this.textStrokeState_=null;this.strokeStates={};this.textState_={};this.textStates={};this.textKey_="";this.fillKey_="";this.strokeKey_="";this.widths_={};var h=ka.labelCache;h.prune()};fn.inherits(po,fo);po.measureTextWidths=function(t,i,s){var e=i.length;var r=0;var n,h;for(h=0;h<e;++h){n=ka.measureTextWidth(t,i[h]);r=Math.max(r,n);s.push(n)}return r};po.prototype.drawText=function(t,i){var s=this.textFillState_;var e=this.textStrokeState_;var r=this.textState_;if(this.text_===""||!r||!s&&!e){return}var n=this.coordinates.length;var h=t.getType();var a=null;var o=2;var f=2;var u,l;if(r.placement===mo.LINE){if(!Nn.intersects(this.getBufferedMaxExtent(),t.getExtent())){return}var v;a=t.getFlatCoordinates();f=t.getStride();if(h==yn.LINE_STRING){v=[a.length]}else if(h==yn.MULTI_LINE_STRING){v=t.getEnds()}else if(h==yn.POLYGON){v=t.getEnds().slice(0,1)}else if(h==yn.MULTI_POLYGON){var c=t.getEndss();v=[];for(u=0,l=c.length;u<l;++u){v.push(c[u][0])}}this.beginGeometry(t,i);var d=r.textAlign;var m=0;var p;for(var z=0,M=v.length;z<M;++z){if(d==undefined){var _=co.lineString(r.maxAngle,a,m,v[z],f);m=_[0];p=_[1]}else{p=v[z]}for(u=m;u<p;u+=f){this.coordinates.push(a[u],a[u+1])}o=this.coordinates.length;m=v[z];this.drawChars_(n,o,this.declutterGroup_);n=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_);var b=g.width/this.pixelRatio;switch(h){case yn.POINT:case yn.MULTI_POINT:a=t.getFlatCoordinates();o=a.length;break;case yn.LINE_STRING:a=t.getFlatMidpoint();break;case yn.CIRCLE:a=t.getCenter();break;case yn.MULTI_LINE_STRING:a=t.getFlatMidpoints();o=a.length;break;case yn.POLYGON:a=t.getFlatInteriorPoint();if(!r.overflow&&a[2]/this.resolution<b){return}f=3;break;case yn.MULTI_POLYGON:var x=t.getFlatInteriorPoints();a=[];for(u=0,l=x.length;u<l;u+=3){if(r.overflow||x[u+2]/this.resolution>=b){a.push(x[u],x[u+1])}}o=a.length;if(o==0){return}break}o=this.appendFlatCoordinates(a,0,o,f,false,false);this.beginGeometry(t,i);if(r.backgroundFill||r.backgroundStroke){this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke);this.updateFillStyle(this.state,this.applyFill,t);this.updateStrokeStyle(this.state,this.applyStroke)}this.drawTextImage_(g,n,o);this.endGeometry(t,i)}};po.prototype.getImage=function(t,i,s,e){var r;var n=e+i+t+s+this.pixelRatio;var h=ka.labelCache;if(!h.containsKey(n)){var a=e?this.strokeStates[e]||this.textStrokeState_:null;var o=s?this.fillStates[s]||this.textFillState_:null;var f=this.textStates[i]||this.textState_;var u=this.pixelRatio;var l=f.scale*u;var v=oo.TEXT_ALIGN[f.textAlign||ka.defaultTextAlign];var c=e&&a.lineWidth?a.lineWidth:0;var d=t.split("\n");var m=d.length;var p=[];var z=po.measureTextWidths(f.font,d,p);var M=ka.measureTextHeight(f.font);var _=M*m;var g=z+c;var b=Lh.createCanvasContext2D(Math.ceil(g*l),Math.ceil((_+c)*l));r=b.canvas;h.set(n,r);if(l!=1){b.scale(l,l)}b.font=f.font;if(e){b.strokeStyle=a.strokeStyle;b.lineWidth=c*(rh.SAFARI?l:1);b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.miterLimit=a.miterLimit;if(rh.CANVAS_LINE_DASH&&a.lineDash.length){b.setLineDash(a.lineDash);b.lineDashOffset=a.lineDashOffset}}if(s){b.fillStyle=o.fillStyle}b.textBaseline="middle";b.textAlign="center";var x=.5-v;var y=v*r.width/l+x*c;var w;if(e){for(w=0;w<m;++w){b.strokeText(d[w],y+x*p[w],.5*(c+M)+w*M)}}if(s){for(w=0;w<m;++w){b.fillText(d[w],y+x*p[w],.5*(c+M)+w*M)}}}return h.get(n)};po.prototype.drawTextImage_=function(t,i,s){var e=this.textState_;var r=this.textStrokeState_;var n=this.pixelRatio;var h=oo.TEXT_ALIGN[e.textAlign||ka.defaultTextAlign];var a=oo.TEXT_ALIGN[e.textBaseline];var o=r&&r.lineWidth?r.lineWidth:0;var f=h*t.width/n+2*(.5-h)*o;var u=a*t.height/n+2*(.5-a)*o;this.instructions.push([ao.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,true,t.width,e.padding==ka.defaultPadding?ka.defaultPadding:e.padding.map((function(t){return t*n})),!!e.backgroundFill,!!e.backgroundStroke]);this.hitDetectionInstructions.push([ao.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,true,t.width,e.padding,!!e.backgroundFill,!!e.backgroundStroke])};po.prototype.drawChars_=function(t,i,s){var e=this.textStrokeState_;var r=this.textState_;var n=this.textFillState_;var h=this.strokeKey_;if(e){if(!(h in this.strokeStates)){this.strokeStates[h]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}}}var a=this.textKey_;if(!(this.textKey_ in this.textStates)){this.textStates[this.textKey_]={font:r.font,textAlign:r.textAlign||ka.defaultTextAlign,scale:r.scale}}var o=this.fillKey_;if(n){if(!(o in this.fillStates)){this.fillStates[o]={fillStyle:n.fillStyle}}}var f=this.pixelRatio;var u=oo.TEXT_ALIGN[r.textBaseline];var l=this.textOffsetY_*f;var v=this.text_;var c=r.font;var d=r.scale;var m=e?e.lineWidth*d/2:0;var p=this.widths_[c];if(!p){this.widths_[c]=p={}}this.instructions.push([ao.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=ka.measureTextWidth(c,t)}return i*d*f},l,h,m*f,v,a,1]);this.hitDetectionInstructions.push([ao.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=ka.measureTextWidth(c,t)}return i*d},l,h,m,v,a,1/f])};po.prototype.setTextStyle=function(t,i){var s,e,r;if(!t){this.text_=""}else{this.declutterGroup_=i;var n=t.getFill();if(!n){e=this.textFillState_=null}else{e=this.textFillState_;if(!e){e=this.textFillState_={}}e.fillStyle=Ca.asColorLike(n.getColor()||ka.defaultFillStyle)}var h=t.getStroke();if(!h){r=this.textStrokeState_=null}else{r=this.textStrokeState_;if(!r){r=this.textStrokeState_={}}var a=h.getLineDash();var o=h.getLineDashOffset();var f=h.getWidth();var u=h.getMiterLimit();r.lineCap=h.getLineCap()||ka.defaultLineCap;r.lineDash=a?a.slice():ka.defaultLineDash;r.lineDashOffset=o===undefined?ka.defaultLineDashOffset:o;r.lineJoin=h.getLineJoin()||ka.defaultLineJoin;r.lineWidth=f===undefined?ka.defaultLineWidth:f;r.miterLimit=u===undefined?ka.defaultMiterLimit:u;r.strokeStyle=Ca.asColorLike(h.getColor()||ka.defaultStrokeStyle)}s=this.textState_;var l=t.getFont()||ka.defaultFont;ka.checkFont(l);var v=t.getScale();s.overflow=t.getOverflow();s.font=l;s.maxAngle=t.getMaxAngle();s.placement=t.getPlacement();s.textAlign=t.getTextAlign();s.textBaseline=t.getTextBaseline()||ka.defaultTextBaseline;s.backgroundFill=t.getBackgroundFill();s.backgroundStroke=t.getBackgroundStroke();s.padding=t.getPadding()||ka.defaultPadding;s.scale=v===undefined?1:v;var c=t.getOffsetX();var d=t.getOffsetY();var m=t.getRotateWithView();var p=t.getRotation();this.text_=t.getText()||"";this.textOffsetX_=c===undefined?0:c;this.textOffsetY_=d===undefined?0:d;this.textRotateWithView_=m===undefined?false:m;this.textRotation_=p===undefined?0:p;this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:fn.getUid(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"";this.textKey_=s.font+s.scale+(s.textAlign||"?");this.fillKey_=e?typeof e.fillStyle=="string"?e.fillStyle:"|"+fn.getUid(e.fillStyle):""}};var zo=function(t,i,s,e,r,n,h){eo.call(this);this.declutterTree_=n;this.declutterGroup_=null;this.tolerance_=t;this.maxExtent_=i;this.overlaps_=r;this.pixelRatio_=e;this.resolution_=s;this.renderBuffer_=h;this.replaysByZIndex_={};this.hitDetectionContext_=Lh.createCanvasContext2D(1,1);this.hitDetectionTransform_=Gn.create()};fn.inherits(zo,eo);zo.circleArrayCache_={0:[[true]]};zo.fillCircleArrayRowToMiddle_=function(t,i,s){var e;var r=Math.floor(t.length/2);if(i>=r){for(e=r;e<i;e++){t[e][s]=true}}else if(i<r){for(e=i+1;e<r;e++){t[e][s]=true}}};zo.getCircleArray_=function(t){if(zo.circleArrayCache_[t]!==undefined){return zo.circleArrayCache_[t]}var i=t*2+1;var s=new Array(i);for(var e=0;e<i;e++){s[e]=new Array(i)}var r=t;var n=0;var h=0;while(r>=n){zo.fillCircleArrayRowToMiddle_(s,t+r,t+n);zo.fillCircleArrayRowToMiddle_(s,t+n,t+r);zo.fillCircleArrayRowToMiddle_(s,t-n,t+r);zo.fillCircleArrayRowToMiddle_(s,t-r,t+n);zo.fillCircleArrayRowToMiddle_(s,t-r,t-n);zo.fillCircleArrayRowToMiddle_(s,t-n,t-r);zo.fillCircleArrayRowToMiddle_(s,t+n,t-r);zo.fillCircleArrayRowToMiddle_(s,t+r,t-n);n++;h+=1+2*n;if(2*(h-r)+1>0){r-=1;h+=1-2*r}}zo.circleArrayCache_[t]=s;return s};zo.replayDeclutter=function(t,i,s){var e=Object.keys(t).map(Number).sort(kn.numberSafeCompareFunction);var r={};for(var n=0,h=e.length;n<h;++n){var a=t[e[n].toString()];for(var o=0,f=a.length;o<f;){var u=a[o++];var l=a[o++];u.replay(i,l,s,r)}}};zo.prototype.addDeclutter=function(t){var i=null;if(this.declutterTree_){if(t){i=this.declutterGroup_;i[4]++}else{i=this.declutterGroup_=Nn.createEmpty();i.push(1)}}return i};zo.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath();t.moveTo(s[0],s[1]);t.lineTo(s[2],s[3]);t.lineTo(s[4],s[5]);t.lineTo(s[6],s[7]);t.clip()};zo.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];for(var e=0,r=t.length;e<r;++e){if(t[e]in s){return true}}}return false};zo.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i=this.replaysByZIndex_[t];var s;for(s in i){i[s].finish()}}};zo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){e=Math.round(e);var a=e*2+1;var o=Gn.compose(this.hitDetectionTransform_,e+.5,e+.5,1/i,-1/i,-s,-t[0],-t[1]);var f=this.hitDetectionContext_;if(f.canvas.width!==a||f.canvas.height!==a){f.canvas.width=a;f.canvas.height=a}else{f.clearRect(0,0,a,a)}var u;if(this.renderBuffer_!==undefined){u=Nn.createEmpty();Nn.extendCoordinate(u,t);Nn.buffer(u,i*(this.renderBuffer_+e),u)}var l=zo.getCircleArray_(e);var v;if(this.declutterTree_){v=this.declutterTree_.all().map((function(t){return t.value}))}var c;function d(t){var i=f.getImageData(0,0,a,a).data;for(var s=0;s<a;s++){for(var e=0;e<a;e++){if(l[s][e]){if(i[(e*a+s)*4+3]>0){var r;if(!(v&&(c==ro.IMAGE||c==ro.TEXT))||v.indexOf(t)!==-1){r=n(t)}if(r){return r}else{f.clearRect(0,0,a,a);return undefined}}}}}}var m=Object.keys(this.replaysByZIndex_).map(Number);m.sort(kn.numberSafeCompareFunction);var p,z,M,_,g;for(p=m.length-1;p>=0;--p){var b=m[p].toString();M=this.replaysByZIndex_[b];for(z=oo.ORDER.length-1;z>=0;--z){c=oo.ORDER[z];_=M[c];if(_!==undefined){if(h&&(c==ro.IMAGE||c==ro.TEXT)){var x=h[b];if(!x){h[b]=[_,o.slice(0)]}else{x.push(_,o.slice(0))}}else{g=_.replayHitDetection(f,o,s,r,d,u);if(g){return g}}}}}return undefined};zo.prototype.getClipCoords=function(t){var i=this.maxExtent_;var s=i[0];var e=i[1];var r=i[2];var n=i[3];var h=[s,e,s,n,r,n,r,e];On.transform2D(h,0,8,2,t,h);return h};zo.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=zo.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_);e[i]=r}return r};zo.prototype.getReplays=function(){return this.replaysByZIndex_};zo.prototype.isEmpty=function(){return vn.isEmpty(this.replaysByZIndex_)};zo.prototype.replay=function(t,i,s,e,r,n){var h=Object.keys(this.replaysByZIndex_).map(Number);h.sort(kn.numberSafeCompareFunction);t.save();this.clip(t,i);var a=r?r:oo.ORDER;var o,f,u,l,v,c;for(o=0,f=h.length;o<f;++o){var d=h[o].toString();v=this.replaysByZIndex_[d];for(u=0,l=a.length;u<l;++u){var m=a[u];c=v[m];if(c!==undefined){if(n&&(m==ro.IMAGE||m==ro.TEXT)){var p=n[d];if(!p){n[d]=[c,i.slice(0)]}else{p.push(c,i.slice(0))}}else{c.replay(t,i,s,e)}}}}t.restore()};zo.BATCH_CONSTRUCTORS_={Circle:vo,Default:fo,Image:uo,LineString:lo,Polygon:vo,Text:po};var Mo={};Mo.defaultOrder=function(t,i){return fn.getUid(t)-fn.getUid(i)};Mo.getSquaredTolerance=function(t,i){var s=Mo.getTolerance(t,i);return s*s};Mo.getTolerance=function(t,i){return fn.SIMPLIFY_TOLERANCE*t/i};Mo.renderCircleGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),ro.CIRCLE);h.setFillStrokeStyle(r,n);h.drawCircle(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),ro.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Mo.renderFeature=function(t,i,s,e,r,n){var h=false;var a,o;a=s.getImage();if(a){o=a.getImageState();if(o==_a.LOADED||o==_a.ERROR){a.unlistenImageChange(r,n)}else{if(o==_a.IDLE){a.load()}o=a.getImageState();a.listenImageChange(r,n);h=true}}Mo.renderFeature_(t,i,s,e);return h};Mo.renderFeature_=function(t,i,s,e){var r=s.getGeometryFunction()(i);if(!r){return}var n=r.getSimplifiedGeometry(e);var h=s.getRenderer();if(h){Mo.renderGeometry_(t,n,s,i)}else{var a=Mo.GEOMETRY_RENDERERS_[n.getType()];a(t,n,s,i)}};Mo.renderGeometry_=function(t,i,s,e){if(i.getType()==yn.GEOMETRY_COLLECTION){var r=i.getGeometries();for(var n=0,h=r.length;n<h;++n){Mo.renderGeometry_(t,r[n],s,e)}return}var a=t.getReplay(s.getZIndex(),ro.DEFAULT);a.drawCustom(i,e,s.getRenderer())};Mo.renderGeometryCollectionGeometry_=function(t,i,s,e){var r=i.getGeometriesArray();var n,h;for(n=0,h=r.length;n<h;++n){var a=Mo.GEOMETRY_RENDERERS_[r[n].getType()];a(t,r[n],s,e)}};Mo.renderLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),ro.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Mo.renderMultiLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),ro.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawMultiLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Mo.renderMultiPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(n||r){var h=t.getReplay(s.getZIndex(),ro.POLYGON);h.setFillStrokeStyle(r,n);h.drawMultiPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),ro.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Mo.renderPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=_a.LOADED){return}var n=t.getReplay(s.getZIndex(),ro.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Mo.renderMultiPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=_a.LOADED){return}var n=t.getReplay(s.getZIndex(),ro.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawMultiPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Mo.renderPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),ro.POLYGON);h.setFillStrokeStyle(r,n);h.drawPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),ro.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Mo.GEOMETRY_RENDERERS_={Point:Mo.renderPointGeometry_,LineString:Mo.renderLineStringGeometry_,Polygon:Mo.renderPolygonGeometry_,MultiPoint:Mo.renderMultiPointGeometry_,MultiLineString:Mo.renderMultiLineStringGeometry_,MultiPolygon:Mo.renderMultiPolygonGeometry_,GeometryCollection:Mo.renderGeometryCollectionGeometry_,Circle:Mo.renderCircleGeometry_};var _o=function(t){Oa.call(this,t);this.declutterTree_=t.getDeclutter()?ja(9):null;this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=Nn.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.replayGroupChanged=true;this.context=Lh.createCanvasContext2D();cn.listen(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this)};fn.inherits(_o,Oa);_o["handles"]=function(t,i){return t===Uh.CANVAS&&i.getType()===ba.VECTOR};_o["create"]=function(t,i){return new _o(i)};_o.prototype.disposeInternal=function(){cn.unlisten(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this);Oa.prototype.disposeInternal.call(this)};_o.prototype.composeFrame=function(t,i,s){var e=t.extent;var r=t.pixelRatio;var n=i.managed?t.skippedFeatureUids:{};var h=t.viewState;var a=h.projection;var o=h.rotation;var f=a.getExtent();var u=this.getLayer().getSource();var l=this.getTransform(t,0);this.preCompose(s,t,l);var v=i.extent;var c=v!==undefined;if(c){this.clip(s,t,v)}var d=this.replayGroup_;if(d&&!d.isEmpty()){if(this.declutterTree_){this.declutterTree_.clear()}var m=this.getLayer();var p=0;var z=0;var M;var _=i.opacity!==1;var g=m.hasListener(Hh.RENDER);if(_||g){var b=s.canvas.width;var x=s.canvas.height;if(o){var y=Math.round(Math.sqrt(b*b+x*x));p=(y-b)/2;z=(y-x)/2;b=x=y}this.context.canvas.width=b;this.context.canvas.height=x;M=this.context}else{M=s}var w=M.globalAlpha;if(!_){M.globalAlpha=i.opacity}if(M!=s){M.translate(p,z)}var k=t.size[0]*r;var E=t.size[1]*r;ka.rotateAtOffset(M,-o,k/2,E/2);d.replay(M,l,o,n);if(u.getWrapX()&&a.canWrapX()&&!Nn.containsExtent(f,e)){var C=e[0];var N=Nn.getWidth(f);var I=0;var S;while(C<f[0]){--I;S=N*I;l=this.getTransform(t,S);d.replay(M,l,o,n);C+=N}I=0;C=e[2];while(C>f[2]){++I;S=N*I;l=this.getTransform(t,S);d.replay(M,l,o,n);C-=N}l=this.getTransform(t,0)}ka.rotateAtOffset(M,o,k/2,E/2);if(M!=s){if(g){this.dispatchRenderEvent(M,t,l)}if(_){var O=s.globalAlpha;s.globalAlpha=i.opacity;s.drawImage(M.canvas,-p,-z);s.globalAlpha=O}else{s.drawImage(M.canvas,-p,-z)}M.translate(-p,-z)}if(!_){M.globalAlpha=w}}if(c){s.restore()}this.postCompose(s,t,i,l)};_o.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_){return undefined}else{var n=i.viewState.resolution;var h=i.viewState.rotation;var a=this.getLayer();var o={};var f=this.replayGroup_.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=fn.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null);return f}};_o.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.replayGroup_){i.changed()}};_o.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};_o.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getSource();this.updateLogos(t,e);var r=t.viewHints[Sh.ANIMATING];var n=t.viewHints[Sh.INTERACTING];var h=s.getUpdateWhileAnimating();var a=s.getUpdateWhileInteracting();if(!this.dirty_&&(!h&&r)||!a&&n){return true}var o=t.extent;var f=t.viewState;var u=f.projection;var l=f.resolution;var v=t.pixelRatio;var c=s.getRevision();var d=s.getRenderBuffer();var m=s.getRenderOrder();if(m===undefined){m=Mo.defaultOrder}var p=Nn.buffer(o,d*l);var z=f.projection.getExtent();if(e.getWrapX()&&f.projection.canWrapX()&&!Nn.containsExtent(z,t.extent)){var M=Nn.getWidth(z);var _=Math.max(Nn.getWidth(p)/2,M);p[0]=z[0]-_;p[2]=z[2]+_}if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==c&&this.renderedRenderOrder_==m&&Nn.containsExtent(this.renderedExtent_,p)){this.replayGroupChanged=false;return true}this.replayGroup_=null;this.dirty_=false;var g=new zo(Mo.getTolerance(l,v),p,l,v,e.getOverlaps(),this.declutterTree_,s.getRenderBuffer());e.loadFeatures(p,l,u);var b=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,l)}else{e=s.getStyleFunction();if(e){i=e(t,l)}}if(i){var r=this.renderFeature(t,l,v,i,g);this.dirty_=this.dirty_||r}}.bind(this);if(m){var x=[];e.forEachFeatureInExtent(p,(function(t){x.push(t)}),this);x.sort(m);for(var y=0,w=x.length;y<w;++y){b(x[y])}}else{e.forEachFeatureInExtent(p,b,this)}g.finish();this.renderedResolution_=l;this.renderedRevision_=c;this.renderedRenderOrder_=m;this.renderedExtent_=p;this.replayGroup_=g;this.replayGroupChanged=true;return true};_o.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=0,a=e.length;h<a;++h){n=Mo.renderFeature(r,t,e[h],Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Mo.renderFeature(r,t,e,Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)}return n};var go={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var bo=function(t){this.context=null;Wa.call(this,t);this.declutterTree_=t.getDeclutter()?ja(9):null;this.dirty_=false;this.tmpTransform_=Gn.create();this.zDirection=t.getRenderMode()==go.VECTOR?1:0;cn.listen(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this)};fn.inherits(bo,Wa);bo["handles"]=function(t,i){return t===Uh.CANVAS&&i.getType()===ba.VECTOR_TILE};bo["create"]=function(t,i){return new bo(i)};bo.IMAGE_REPLAYS={image:[ro.POLYGON,ro.CIRCLE,ro.LINE_STRING,ro.IMAGE,ro.TEXT],hybrid:[ro.POLYGON,ro.LINE_STRING]};bo.VECTOR_REPLAYS={image:[ro.DEFAULT],hybrid:[ro.IMAGE,ro.TEXT,ro.DEFAULT],vector:oo.ORDER};bo.prototype.disposeInternal=function(){cn.unlisten(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this);Wa.prototype.disposeInternal.call(this)};bo.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getRevision();if(this.renderedLayerRevision_!=e){this.renderedTiles.length=0;var r=s.getRenderMode();if(!this.context&&r!=go.VECTOR){this.context=Lh.createCanvasContext2D()}if(this.context&&r==go.VECTOR){this.context=null}}this.renderedLayerRevision_=e;return Wa.prototype.prepareFrame.apply(this,arguments)};bo.prototype.createReplayGroup_=function(t,i){var s=this.getLayer();var e=i.pixelRatio;var r=i.viewState.projection;var n=s.getRevision();var h=s.getRenderOrder()||null;var a=t.getReplayState(s);if(!a.dirty&&a.renderedRevision==n&&a.renderedRenderOrder==h){return}var o=s.getSource();var f=o.getTileGrid();var u=o.getTileGridForProjection(r);var l=u.getResolution(t.tileCoord[0]);var v=u.getTileCoordExtent(t.wrappedTileCoord);for(var c=0,d=t.tileKeys.length;c<d;++c){var m=t.getTile(t.tileKeys[c]);if(m.getState()==wh.ERROR){continue}var p=m.tileCoord;var z=f.getTileCoordExtent(p);var M=Nn.getIntersection(v,z);var _=Nn.equals(z,M)?null:Nn.buffer(M,s.getRenderBuffer()*l);var g=m.getProjection();var b=false;if(!Wn.equivalent(r,g)){b=true;m.setProjection(r)}a.dirty=false;var x=new zo(0,M,l,e,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer());var y=Mo.getSquaredTolerance(l,e);var w=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,l)}else{e=s.getStyleFunction();if(e){i=e(t,l)}}if(i){var r=this.renderFeature(t,y,i,x);this.dirty_=this.dirty_||r;a.dirty=a.dirty||r}};var k=m.getFeatures();if(h&&h!==a.renderedRenderOrder){k.sort(h)}var E;for(var C=0,N=k.length;C<N;++C){E=k[C];if(b){if(g.getUnits()==Tn.TILE_PIXELS){g.setWorldExtent(z);g.setExtent(m.getExtent())}E.getGeometry().transform(g,r)}if(!_||Nn.intersects(_,E.getGeometry().getExtent())){w.call(this,E)}}x.finish();for(var I in x.getReplays()){}m.setReplayGroup(s,t.tileCoord.toString(),x)}a.renderedRevision=n;a.renderedRenderOrder=h};bo.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t;this.createReplayGroup_(f,i);if(this.context){this.renderTileImage_(f,i,s);Wa.prototype.drawTileImage.apply(this,arguments)}};bo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=i.viewState.resolution;var h=i.viewState.rotation;s=s==undefined?0:s;var a=this.getLayer();var o={};var f=this.renderedTiles;var u=a.getSource();var l=u.getTileGridForProjection(i.viewState.projection);var v,c;var d,m,p;var z,M,_;for(d=0,m=f.length;d<m;++d){z=f[d];M=z.wrappedTileCoord;_=l.getTileCoordExtent(M,this.tmpExtent);v=Nn.buffer(_,s*n,v);if(!Nn.containsCoordinate(v,t)){continue}for(var g=0,b=z.tileKeys.length;g<b;++g){var x=z.getTile(z.tileKeys[g]);if(x.getState()==wh.ERROR){continue}p=x.getReplayGroup(a,z.tileCoord.toString());c=c||p.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=fn.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null)}}return c};bo.prototype.getReplayTransform_=function(t,i){var s=this.getLayer();var e=s.getSource();var r=e.getTileGrid();var n=t.tileCoord;var h=r.getResolution(n[0]);var a=i.viewState;var o=i.pixelRatio;var f=a.resolution/o;var u=r.getTileCoordExtent(n,this.tmpExtent);var l=a.center;var v=Nn.getTopLeft(u);var c=i.size;var d=Math.round(o*c[0]/2);var m=Math.round(o*c[1]/2);return Gn.compose(this.tmpTransform_,d,m,h/f,h/f,a.rotation,(v[0]-l[0])/h,(l[1]-v[1])/h)};bo.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.renderedLayerRevision_!==undefined){i.changed()}};bo.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};bo.prototype.postCompose=function(t,i,s){var e=this.getLayer();var r=e.getDeclutter()?{}:null;var n=e.getSource();var h=e.getRenderMode();var a=bo.VECTOR_REPLAYS[h];var o=i.pixelRatio;var f=i.viewState.rotation;var u=i.size;var l,v;if(f){l=Math.round(o*u[0]/2);v=Math.round(o*u[1]/2);ka.rotateAtOffset(t,-f,l,v)}if(r){this.declutterTree_.clear()}var c=this.renderedTiles;var d=n.getTileGridForProjection(i.viewState.projection);var m=[];var p=[];for(var z=c.length-1;z>=0;--z){var M=c[z];if(M.getState()==wh.ABORT){continue}var _=M.tileCoord;var g=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(M.wrappedTileCoord)[0];var b=undefined;for(var x=0,y=M.tileKeys.length;x<y;++x){var w=M.getTile(M.tileKeys[x]);if(w.getState()==wh.ERROR){continue}var k=w.getReplayGroup(e,_.toString());if(h!=go.VECTOR&&!k.hasReplays(a)){continue}if(!b){b=this.getTransform(i,g)}var E=w.tileCoord[0];var C=k.getClipCoords(b);t.save();t.globalAlpha=s.opacity;for(var N=0,I=m.length;N<I;++N){var S=m[N];if(E<p[N]){t.beginPath();t.moveTo(C[0],C[1]);t.lineTo(C[2],C[3]);t.lineTo(C[4],C[5]);t.lineTo(C[6],C[7]);t.moveTo(S[6],S[7]);t.lineTo(S[4],S[5]);t.lineTo(S[2],S[3]);t.lineTo(S[0],S[1]);t.clip()}}k.replay(t,b,f,{},a,r);t.restore();m.push(C);p.push(E)}}if(r){zo.replayDeclutter(r,t,f)}if(f){ka.rotateAtOffset(t,f,l,v)}Wa.prototype.postCompose.apply(this,arguments)};bo.prototype.renderFeature=function(t,i,s,e){if(!s){return false}var r=false;if(Array.isArray(s)){for(var n=0,h=s.length;n<h;++n){r=Mo.renderFeature(e,t,s[n],i,this.handleStyleImageChange_,this)||r}}else{r=Mo.renderFeature(e,t,s,i,this.handleStyleImageChange_,this)}return r};bo.prototype.renderTileImage_=function(t,i,s){var e=this.getLayer();var r=t.getReplayState(e);var n=e.getRevision();var h=bo.IMAGE_REPLAYS[e.getRenderMode()];if(h&&r.renderedTileRevision!==n){r.renderedTileRevision=n;var a=t.wrappedTileCoord;var o=a[0];var f=i.pixelRatio;var u=e.getSource();var l=u.getTileGridForProjection(i.viewState.projection);var v=l.getResolution(o);var c=t.getContext(e);var d=u.getTilePixelSize(o,f,i.viewState.projection);c.canvas.width=d[0];c.canvas.height=d[1];var m=l.getTileCoordExtent(a);for(var p=0,z=t.tileKeys.length;p<z;++p){var M=t.getTile(t.tileKeys[p]);if(M.getState()==wh.ERROR){continue}var _=f/v;var g=Gn.reset(this.tmpTransform_);Gn.scale(g,_,-_);Gn.translate(g,-m[0],-m[3]);var b=M.getReplayGroup(e,t.tileCoord.toString());b.replay(c,g,0,{},h)}}};var xo=function(t){this.source_=t};xo.prototype.getType=function(){};xo.prototype.getSource=function(){return this.source_};xo.prototype.isAnimated=Sn.FALSE;var yo=function(t){xo.call(this,t)};fn.inherits(yo,xo);yo.prototype.getType=function(){return eh.FRAGMENT_SHADER};var wo=function(t){xo.call(this,t)};fn.inherits(wo,xo);wo.prototype.getType=function(){return eh.VERTEX_SHADER};var ko={};ko.fragment=new yo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}");ko.vertex=new wo(fn.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Eo=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_lineWidth":"k");this.u_pixelRatio=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_pixelRatio":"l");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"m");this.u_fillColor=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_fillColor":"n");this.u_strokeColor=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_strokeColor":"o");this.u_size=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_size":"p");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"e");this.a_instruction=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_instruction":"f");this.a_radius=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_radius":"g")};var Co={};Co.create=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]};Co.fromTransform=function(t,i){t[0]=i[0];t[1]=i[1];t[4]=i[2];t[5]=i[3];t[12]=i[4];t[13]=i[5];return t};var No=function(t,i){Na.call(this);this.tolerance=t;this.maxExtent=i;this.origin=Nn.getCenter(i);this.projectionMatrix_=Gn.create();this.offsetRotateMatrix_=Gn.create();this.offsetScaleMatrix_=Gn.create();this.tmpMat4_=Co.create();this.indices=[];this.indicesBuffer=null;this.startIndices=[];this.startIndicesFeature=[];this.vertices=[];this.verticesBuffer=null;this.lineStringReplay=undefined};fn.inherits(No,Na);No.prototype.getDeleteResourcesFunction=function(t){};No.prototype.finish=function(t){};No.prototype.setUpProgram=function(t,i,s,e){};No.prototype.shutDownProgram=function(t,i){};No.prototype.drawReplay=function(t,i,s,e){};No.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){};No.prototype.drawHitDetectionReplay=function(t,i,s,e,r,n){if(!r){return this.drawHitDetectionReplayAll(t,i,s,e)}else{return this.drawHitDetectionReplayOneByOne(t,i,s,e,n)}};No.prototype.drawHitDetectionReplayAll=function(t,i,s,e){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawReplay(t,i,s,true);var r=e(null);if(r){return r}else{return undefined}};No.prototype.replay=function(t,i,s,e,r,n,h,a,o,f,u){var l=t.getGL();var v,c,d,m,p,z,M,_;if(this.lineStringReplay){v=l.isEnabled(l.STENCIL_TEST);c=l.getParameter(l.STENCIL_FUNC);d=l.getParameter(l.STENCIL_VALUE_MASK);m=l.getParameter(l.STENCIL_REF);p=l.getParameter(l.STENCIL_WRITEMASK);z=l.getParameter(l.STENCIL_FAIL);M=l.getParameter(l.STENCIL_PASS_DEPTH_PASS);_=l.getParameter(l.STENCIL_PASS_DEPTH_FAIL);l.enable(l.STENCIL_TEST);l.clear(l.STENCIL_BUFFER_BIT);l.stencilMask(255);l.stencilFunc(l.ALWAYS,1,255);l.stencilOp(l.KEEP,l.KEEP,l.REPLACE);this.lineStringReplay.replay(t,i,s,e,r,n,h,a,o,f,u);l.stencilMask(0);l.stencilFunc(l.NOTEQUAL,1,255)}t.bindBuffer(eh.ARRAY_BUFFER,this.verticesBuffer);t.bindBuffer(eh.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var g=this.setUpProgram(l,t,r,n);var b=Gn.reset(this.projectionMatrix_);Gn.scale(b,2/(s*r[0]),2/(s*r[1]));Gn.rotate(b,-e);Gn.translate(b,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var x=Gn.reset(this.offsetScaleMatrix_);Gn.scale(x,2/r[0],2/r[1]);var y=Gn.reset(this.offsetRotateMatrix_);if(e!==0){Gn.rotate(y,-e)}l.uniformMatrix4fv(g.u_projectionMatrix,false,Co.fromTransform(this.tmpMat4_,b));l.uniformMatrix4fv(g.u_offsetScaleMatrix,false,Co.fromTransform(this.tmpMat4_,x));l.uniformMatrix4fv(g.u_offsetRotateMatrix,false,Co.fromTransform(this.tmpMat4_,y));l.uniform1f(g.u_opacity,h);var w;if(o===undefined){this.drawReplay(l,t,a,false)}else{w=this.drawHitDetectionReplay(l,t,a,o,f,u)}this.shutDownProgram(l,g);if(this.lineStringReplay){if(!v){l.disable(l.STENCIL_TEST)}l.clear(l.STENCIL_BUFFER_BIT);l.stencilFunc(c,m,d);l.stencilMask(p);l.stencilOp(z,_,M)}return w};No.prototype.drawElements=function(t,i,s,e){var r=i.hasOESElementIndexUint?eh.UNSIGNED_INT:eh.UNSIGNED_SHORT;var n=i.hasOESElementIndexUint?4:2;var h=e-s;var a=s*n;t.drawElements(eh.TRIANGLES,h,r,a)};var Io={};Io.defaultFont="10px sans-serif";Io.defaultFillStyle=[0,0,0,1];Io.defaultLineCap="round";Io.defaultLineDash=[];Io.defaultLineDashOffset=0;Io.defaultLineJoin="round";Io.defaultMiterLimit=10;Io.defaultStrokeStyle=[0,0,0,1];Io.defaultTextAlign=.5;Io.defaultTextBaseline=.5;Io.defaultLineWidth=1;Io.triangleIsCounterClockwise=function(t,i,s,e,r,n){var h=(s-t)*(n-i)-(r-t)*(e-i);return h<=Io.EPSILON&&h>=-Io.EPSILON?undefined:h>0};Io.EPSILON=Number.EPSILON||2220446049250313e-31;var So=function(t,i){this.arr_=t!==undefined?t:[];this.usage_=i!==undefined?i:So.Usage_.STATIC_DRAW};So.prototype.getArray=function(){return this.arr_};So.prototype.getUsage=function(){return this.usage_};So.Usage_={STATIC_DRAW:eh.STATIC_DRAW,STREAM_DRAW:eh.STREAM_DRAW,DYNAMIC_DRAW:eh.DYNAMIC_DRAW};var Oo=function(t,i){No.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.radius_=0;this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:undefined,lineWidth:undefined,changed:false}};fn.inherits(Oo,No);Oo.prototype.drawCoordinates_=function(t,i,s,e){var r=this.vertices.length;var n=this.indices.length;var h=r/4;var a,o;for(a=i,o=s;a<o;a+=e){this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=0;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=1;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=2;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=3;this.vertices[r++]=this.radius_;this.indices[n++]=h;this.indices[n++]=h+1;this.indices[n++]=h+2;this.indices[n++]=h+2;this.indices[n++]=h+3;this.indices[n++]=h;h+=4}};Oo.prototype.drawCircle=function(t,i){var s=t.getRadius();var e=t.getStride();if(s){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.radius_=s;var r=t.getFlatCoordinates();r=On.translate(r,0,2,e,-this.origin[0],-this.origin[1]);this.drawCoordinates_(r,0,2,e)}else{if(this.state_.changed){this.styles_.pop();if(this.styles_.length){var n=this.styles_[this.styles_.length-1];this.state_.fillColor=n[0];this.state_.strokeColor=n[1];this.state_.lineWidth=n[2];this.state_.changed=false}}}};Oo.prototype.finish=function(t){this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Oo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};Oo.prototype.setUpProgram=function(t,i,s,e){var r,n;r=ko.fragment;n=ko.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Eo(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,16,0);t.enableVertexAttribArray(a.a_instruction);t.vertexAttribPointer(a.a_instruction,1,eh.FLOAT,false,16,8);t.enableVertexAttribArray(a.a_radius);t.vertexAttribPointer(a.a_radius,1,eh.FLOAT,false,16,12);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};Oo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_instruction);t.disableVertexAttribArray(i.a_radius)};Oo.prototype.drawReplay=function(t,i,s,e){if(!vn.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var r,n,h,a;h=this.startIndices[this.startIndices.length-1];for(r=this.styleIndices_.length-1;r>=0;--r){n=this.styleIndices_[r];a=this.styles_[r];this.setFillStyle_(t,a[0]);this.setStrokeStyle_(t,a[1],a[2]);this.drawElements(t,i,n,h);h=n}}};Oo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o[0]);this.setStrokeStyle_(t,o[1],o[2]);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=fn.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Nn.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};Oo.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h[0]);this.setStrokeStyle_(t,h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=fn.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n)}r=n=a}};Oo.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)};Oo.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s)};Oo.prototype.setFillStrokeStyle=function(t,i){var s,e;if(i){var r=i.getLineDash();this.state_.lineDash=r?r:Io.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n?n:Io.defaultLineDashOffset;s=i.getColor();if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Ea.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Io.defaultStrokeStyle}else{s=Io.defaultStrokeStyle}e=i.getWidth();e=e!==undefined?e:Io.defaultLineWidth}else{s=[0,0,0,0];e=0}var h=t?t.getColor():[0,0,0,0];if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Ea.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Io.defaultFillStyle}else{h=Io.defaultFillStyle}if(!this.state_.strokeColor||!kn.equals(this.state_.strokeColor,s)||!this.state_.fillColor||!kn.equals(this.state_.fillColor,h)||this.state_.lineWidth!==e){this.state_.changed=true;this.state_.fillColor=h;this.state_.strokeColor=s;this.state_.lineWidth=e;this.styles_.push([h,s,e])}};var To={};To.fragment=new yo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");To.vertex=new wo(fn.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Ao=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"k");this.u_image=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_image":"l");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"c");this.a_texCoord=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_texCoord":"d");this.a_offsets=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_offsets":"e");this.a_opacity=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_opacity":"f");this.a_rotateWithView=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_rotateWithView":"g")};var Ro={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var Po=function(t,i){this.canvas_=t;this.gl_=i;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null;this.hasOESElementIndexUint=kn.includes(fn.WEBGL_EXTENSIONS,"OES_element_index_uint");if(this.hasOESElementIndexUint){i.getExtension("OES_element_index_uint")}cn.listen(this.canvas_,Ro.LOST,this.handleWebGLContextLost,this);cn.listen(this.canvas_,Ro.RESTORED,this.handleWebGLContextRestored,this)};fn.inherits(Po,dn);Po.prototype.bindBuffer=function(t,i){var s=this.getGL();var e=i.getArray();var r=String(fn.getUid(i));if(r in this.bufferCache_){var n=this.bufferCache_[r];s.bindBuffer(t,n.buffer)}else{var h=s.createBuffer();s.bindBuffer(t,h);var a;if(t==eh.ARRAY_BUFFER){a=new Float32Array(e)}else if(t==eh.ELEMENT_ARRAY_BUFFER){a=this.hasOESElementIndexUint?new Uint32Array(e):new Uint16Array(e)}s.bufferData(t,a,i.getUsage());this.bufferCache_[r]={buf:i,buffer:h}}};Po.prototype.deleteBuffer=function(t){var i=this.getGL();var s=String(fn.getUid(t));var e=this.bufferCache_[s];if(!i.isContextLost()){i.deleteBuffer(e.buffer)}delete this.bufferCache_[s]};Po.prototype.disposeInternal=function(){cn.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_){t.deleteBuffer(this.bufferCache_[i].buffer)}for(i in this.programCache_){t.deleteProgram(this.programCache_[i])}for(i in this.shaderCache_){t.deleteShader(this.shaderCache_[i])}t.deleteFramebuffer(this.hitDetectionFramebuffer_);t.deleteRenderbuffer(this.hitDetectionRenderbuffer_);t.deleteTexture(this.hitDetectionTexture_)}};Po.prototype.getCanvas=function(){return this.canvas_};Po.prototype.getGL=function(){return this.gl_};Po.prototype.getHitDetectionFramebuffer=function(){if(!this.hitDetectionFramebuffer_){this.initHitDetectionFramebuffer_()}return this.hitDetectionFramebuffer_};Po.prototype.getShader=function(t){var i=String(fn.getUid(t));if(i in this.shaderCache_){return this.shaderCache_[i]}else{var s=this.getGL();var e=s.createShader(t.getType());s.shaderSource(e,t.getSource());s.compileShader(e);this.shaderCache_[i]=e;return e}};Po.prototype.getProgram=function(t,i){var s=fn.getUid(t)+"/"+fn.getUid(i);if(s in this.programCache_){return this.programCache_[s]}else{var e=this.getGL();var r=e.createProgram();e.attachShader(r,this.getShader(t));e.attachShader(r,this.getShader(i));e.linkProgram(r);this.programCache_[s]=r;return r}};Po.prototype.handleWebGLContextLost=function(){vn.clear(this.bufferCache_);vn.clear(this.shaderCache_);vn.clear(this.programCache_);this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null};Po.prototype.handleWebGLContextRestored=function(){};Po.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_;var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=Po.createEmptyTexture(t,1,1);var e=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,e);t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e);t.bindTexture(t.TEXTURE_2D,null);t.bindRenderbuffer(t.RENDERBUFFER,null);t.bindFramebuffer(t.FRAMEBUFFER,null);this.hitDetectionFramebuffer_=i;this.hitDetectionTexture_=s;this.hitDetectionRenderbuffer_=e};Po.prototype.useProgram=function(t){if(t==this.currentProgram_){return false}else{var i=this.getGL();i.useProgram(t);this.currentProgram_=t;return true}};Po.createTexture_=function(t,i,s){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);if(i!==undefined){t.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_S,i)}if(s!==undefined){t.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_T,s)}return e};Po.createEmptyTexture=function(t,i,s,e,r){var n=Po.createTexture_(t,e,r);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null);return n};Po.createTexture=function(t,i,s,e){var r=Po.createTexture_(t,s,e);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i);return r};var Lo=function(t,i){No.call(this,t,i);this.anchorX=undefined;this.anchorY=undefined;this.groupIndices=[];this.hitDetectionGroupIndices=[];this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.defaultLocations=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.width=undefined};fn.inherits(Lo,No);Lo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.getTextures(true);var r=t.getGL();return function(){if(!r.isContextLost()){var n,h;for(n=0,h=e.length;n<h;++n){r.deleteTexture(e[n])}}t.deleteBuffer(i);t.deleteBuffer(s)}};Lo.prototype.drawCoordinates=function(t,i,s,e){var r=this.anchorX;var n=this.anchorY;var h=this.height;var a=this.imageHeight;var o=this.imageWidth;var f=this.opacity;var u=this.originX;var l=this.originY;var v=this.rotateWithView?1:0;var c=-this.rotation;var d=this.scale;var m=this.width;var p=Math.cos(c);var z=Math.sin(c);var M=this.indices.length;var _=this.vertices.length;var g,b,x,y,w,k;for(g=i;g<s;g+=e){w=t[g]-this.origin[0];k=t[g+1]-this.origin[1];b=_/8;x=-d*r;y=-d*(h-n);this.vertices[_++]=w;this.vertices[_++]=k;this.vertices[_++]=x*p-y*z;this.vertices[_++]=x*z+y*p;this.vertices[_++]=u/o;this.vertices[_++]=(l+h)/a;this.vertices[_++]=f;this.vertices[_++]=v;x=d*(m-r);y=-d*(h-n);this.vertices[_++]=w;this.vertices[_++]=k;this.vertices[_++]=x*p-y*z;this.vertices[_++]=x*z+y*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=(l+h)/a;this.vertices[_++]=f;this.vertices[_++]=v;x=d*(m-r);y=d*n;this.vertices[_++]=w;this.vertices[_++]=k;this.vertices[_++]=x*p-y*z;this.vertices[_++]=x*z+y*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=l/a;this.vertices[_++]=f;this.vertices[_++]=v;x=-d*r;y=d*n;this.vertices[_++]=w;this.vertices[_++]=k;this.vertices[_++]=x*p-y*z;this.vertices[_++]=x*z+y*p;this.vertices[_++]=u/o;this.vertices[_++]=l/a;this.vertices[_++]=f;this.vertices[_++]=v;this.indices[M++]=b;this.indices[M++]=b+1;this.indices[M++]=b+2;this.indices[M++]=b;this.indices[M++]=b+2;this.indices[M++]=b+3}return _};Lo.prototype.createTextures=function(t,i,s,e){var r,n,h,a;var o=i.length;for(a=0;a<o;++a){n=i[a];h=fn.getUid(n).toString();if(h in s){r=s[h]}else{r=Po.createTexture(e,n,eh.CLAMP_TO_EDGE,eh.CLAMP_TO_EDGE);s[h]=r}t[a]=r}};Lo.prototype.setUpProgram=function(t,i,s,e){var r=To.fragment;var n=To.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations){a=new Ao(t,h);this.defaultLocations=a}else{a=this.defaultLocations}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,32,0);t.enableVertexAttribArray(a.a_offsets);t.vertexAttribPointer(a.a_offsets,2,eh.FLOAT,false,32,8);t.enableVertexAttribArray(a.a_texCoord);t.vertexAttribPointer(a.a_texCoord,2,eh.FLOAT,false,32,16);t.enableVertexAttribArray(a.a_opacity);t.vertexAttribPointer(a.a_opacity,1,eh.FLOAT,false,32,24);t.enableVertexAttribArray(a.a_rotateWithView);t.vertexAttribPointer(a.a_rotateWithView,1,eh.FLOAT,false,32,28);return a};Lo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_offsets);t.disableVertexAttribArray(i.a_texCoord);t.disableVertexAttribArray(i.a_opacity);t.disableVertexAttribArray(i.a_rotateWithView)};Lo.prototype.drawReplay=function(t,i,s,e){var r=e?this.getHitDetectionTextures():this.getTextures();var n=e?this.hitDetectionGroupIndices:this.groupIndices;if(!vn.isEmpty(s)){this.drawReplaySkipping(t,i,s,r,n)}else{var h,a,o;for(h=0,a=r.length,o=0;h<a;++h){t.bindTexture(eh.TEXTURE_2D,r[h]);var f=n[h];this.drawElements(t,i,o,f);o=f}}};Lo.prototype.drawReplaySkipping=function(t,i,s,e,r){var n=0;var h,a;for(h=0,a=e.length;h<a;++h){t.bindTexture(eh.TEXTURE_2D,e[h]);var o=h>0?r[h-1]:0;var f=r[h];var u=o;var l=o;while(n<this.startIndices.length&&this.startIndices[n]<=f){var v=this.startIndicesFeature[n];var c=fn.getUid(v).toString();if(s[c]!==undefined){if(u!==l){this.drawElements(t,i,u,l)}u=n===this.startIndices.length-1?f:this.startIndices[n+1];l=u}else{l=n===this.startIndices.length-1?f:this.startIndices[n+1]}n++}if(u!==l){this.drawElements(t,i,u,l)}}};Lo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u;var l=this.startIndices.length-1;var v=this.getHitDetectionTextures();for(n=v.length-1;n>=0;--n){t.bindTexture(eh.TEXTURE_2D,v[n]);h=n>0?this.hitDetectionGroupIndices[n-1]:0;o=this.hitDetectionGroupIndices[n];while(l>=0&&this.startIndices[l]>=h){a=this.startIndices[l];f=this.startIndicesFeature[l];u=fn.getUid(f).toString();if(s[u]===undefined&&f.getGeometry()&&(r===undefined||Nn.intersects(r,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,a,o);var c=e(f);if(c){return c}}o=a;l--}}return undefined};Lo.prototype.finish=function(t){this.anchorX=undefined;this.anchorY=undefined;this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.indices=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.vertices=null;this.width=undefined};Lo.prototype.getTextures=function(t){};Lo.prototype.getHitDetectionTextures=function(){};var Do=function(t,i){Lo.call(this,t,i);this.images_=[];this.hitDetectionImages_=[];this.textures_=[];this.hitDetectionTextures_=[]};fn.inherits(Do,Lo);Do.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};Do.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};Do.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices.push(this.indices.length);this.verticesBuffer=new So(this.vertices);var s=this.indices;this.indicesBuffer=new So(s);var e={};this.createTextures(this.textures_,this.images_,e,i);this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,e,i);this.images_=null;this.hitDetectionImages_=null;Lo.prototype.finish.call(this,t)};Do.prototype.setImageStyle=function(t){var i=t.getAnchor();var s=t.getImage(1);var e=t.getImageSize();var r=t.getHitDetectionImage(1);var n=t.getOpacity();var h=t.getOrigin();var a=t.getRotateWithView();var o=t.getRotation();var f=t.getSize();var u=t.getScale();var l;if(this.images_.length===0){this.images_.push(s)}else{l=this.images_[this.images_.length-1];if(fn.getUid(l)!=fn.getUid(s)){this.groupIndices.push(this.indices.length);this.images_.push(s)}}if(this.hitDetectionImages_.length===0){this.hitDetectionImages_.push(r)}else{l=this.hitDetectionImages_[this.hitDetectionImages_.length-1];if(fn.getUid(l)!=fn.getUid(r)){this.hitDetectionGroupIndices.push(this.indices.length);this.hitDetectionImages_.push(r)}}this.anchorX=i[0];this.anchorY=i[1];this.height=f[1];this.imageHeight=e[1];this.imageWidth=e[0];this.opacity=n;this.originX=h[0];this.originY=h[1];this.rotation=o;this.rotateWithView=a;this.scale=u;this.width=f[0]};Do.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_};Do.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var Fo={};Fo.lineStringIsClosed=function(t,i,s,e){var r=s-e;if(t[i]===t[r]&&t[i+1]===t[r+1]&&(s-i)/e>3){return!!Un.linearRing(t,i,s,e)}return false};var Wo={};Wo.fragment=new yo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");Wo.vertex=new wo(fn.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var Go=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_lineWidth":"k");this.u_miterLimit=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_miterLimit":"l");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"m");this.u_color=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_color":"n");this.u_size=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_size":"o");this.u_pixelRatio=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_pixelRatio":"p");this.a_lastPos=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_lastPos":"d");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"e");this.a_nextPos=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_nextPos":"f");this.a_direction=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_direction":"g")};var jo=function(t,i){No.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:undefined,miterLimit:undefined,changed:false}};fn.inherits(jo,No);jo.prototype.drawCoordinates_=function(t,i,s,e){var r,n;var h=this.vertices.length;var a=this.indices.length;var o=this.state_.lineJoin==="bevel"?0:this.state_.lineJoin==="miter"?1:2;var f=this.state_.lineCap==="butt"?0:this.state_.lineCap==="square"?1:2;var u=Fo.lineStringIsClosed(t,i,s,e);var l,v,c;var d=a;var m=1;var p,z,M;for(r=i,n=s;r<n;r+=e){c=h/7;p=z;z=M||[t[r],t[r+1]];if(r===i){M=[t[r+e],t[r+e+1]];if(s-i===e*2&&kn.equals(z,M)){break}if(u){p=[t[s-e*2],t[s-e*2+1]];l=M}else{if(f){h=this.addVertices_([0,0],z,M,m*jo.Instruction_.BEGIN_LINE_CAP*f,h);h=this.addVertices_([0,0],z,M,-m*jo.Instruction_.BEGIN_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}h=this.addVertices_([0,0],z,M,m*jo.Instruction_.BEGIN_LINE*(f||1),h);h=this.addVertices_([0,0],z,M,-m*jo.Instruction_.BEGIN_LINE*(f||1),h);d=h/7-1;continue}}else if(r===s-e){if(u){M=l;break}else{p=p||[0,0];h=this.addVertices_(p,z,[0,0],m*jo.Instruction_.END_LINE*(f||1),h);h=this.addVertices_(p,z,[0,0],-m*jo.Instruction_.END_LINE*(f||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;if(f){h=this.addVertices_(p,z,[0,0],m*jo.Instruction_.END_LINE_CAP*f,h);h=this.addVertices_(p,z,[0,0],-m*jo.Instruction_.END_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}break}}else{M=[t[r+e],t[r+e+1]]}v=Io.triangleIsCounterClockwise(p[0],p[1],z[0],z[1],M[0],M[1])?-1:1;h=this.addVertices_(p,z,M,v*jo.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,z,M,v*jo.Instruction_.BEVEL_SECOND*(o||1),h);h=this.addVertices_(p,z,M,-v*jo.Instruction_.MITER_BOTTOM*(o||1),h);if(r>i){this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=m*v>0?d:d-1}this.indices[a++]=c;this.indices[a++]=c+2;this.indices[a++]=c+1;d=c+2;m=v;if(o){h=this.addVertices_(p,z,M,v*jo.Instruction_.MITER_TOP*o,h);this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c}}if(u){c=c||h/7;v=ih.linearRingIsClockwise([p[0],p[1],z[0],z[1],M[0],M[1]],0,6,2)?1:-1;h=this.addVertices_(p,z,M,v*jo.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,z,M,-v*jo.Instruction_.MITER_BOTTOM*(o||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;this.indices[a++]=m*v>0?d:d-1}};jo.prototype.addVertices_=function(t,i,s,e,r){this.vertices[r++]=t[0];this.vertices[r++]=t[1];this.vertices[r++]=i[0];this.vertices[r++]=i[1];this.vertices[r++]=s[0];this.vertices[r++]=s[1];this.vertices[r++]=e;return r};jo.prototype.isValid_=function(t,i,s,e){var r=s-i;if(r<e*2){return false}else if(r===e*2){var n=[t[i],t[i+1]];var h=[t[i+e],t[i+e+1]];return!kn.equals(n,h)}return true};jo.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates();var e=t.getStride();if(this.isValid_(s,0,s.length,e)){s=On.translate(s,0,s.length,e,-this.origin[0],-this.origin[1]);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);this.drawCoordinates_(s,0,s.length,e)}};jo.prototype.drawMultiLineString=function(t,i){var s=this.indices.length;var e=t.getEnds();e.unshift(0);var r=t.getFlatCoordinates();var n=t.getStride();var h,a;if(e.length>1){for(h=1,a=e.length;h<a;++h){if(this.isValid_(r,e[h-1],e[h],n)){var o=On.translate(r,e[h-1],e[h],n,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,n)}}}if(this.indices.length>s){this.startIndices.push(s);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}}};jo.prototype.drawPolygonCoordinates=function(t,i,s){if(!Fo.lineStringIsClosed(t,0,t.length,s)){t.push(t[0]);t.push(t[1])}this.drawCoordinates_(t,0,t.length,s);if(i.length){var e,r;for(e=0,r=i.length;e<r;++e){if(!Fo.lineStringIsClosed(i[e],0,i[e].length,s)){i[e].push(i[e][0]);i[e].push(i[e][1])}this.drawCoordinates_(i[e],0,i[e].length,s)}}};jo.prototype.setPolygonStyle=function(t,i){var s=i===undefined?this.indices.length:i;this.startIndices.push(s);this.startIndicesFeature.push(t);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}};jo.prototype.getCurrentIndex=function(){return this.indices.length};jo.prototype.finish=function(t){this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};jo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};jo.prototype.setUpProgram=function(t,i,s,e){var r,n;r=Wo.fragment;n=Wo.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Go(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_lastPos);t.vertexAttribPointer(a.a_lastPos,2,eh.FLOAT,false,28,0);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,28,8);t.enableVertexAttribArray(a.a_nextPos);t.vertexAttribPointer(a.a_nextPos,2,eh.FLOAT,false,28,16);t.enableVertexAttribArray(a.a_direction);t.vertexAttribPointer(a.a_direction,1,eh.FLOAT,false,28,24);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};jo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos);t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_nextPos);t.disableVertexAttribArray(i.a_direction)};jo.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!vn.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setStrokeStyle_(t,f[0],f[1],f[2]);this.drawElements(t,i,a,o);t.clear(t.DEPTH_BUFFER_BIT);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};jo.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setStrokeStyle_(t,h[0],h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=fn.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};jo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setStrokeStyle_(t,o[0],o[1],o[2]);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=fn.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Nn.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};jo.prototype.setStrokeStyle_=function(t,i,s,e){t.uniform4fv(this.defaultLocations_.u_color,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s);t.uniform1f(this.defaultLocations_.u_miterLimit,e)};jo.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=s!==undefined?s:Io.defaultLineCap;var e=i.getLineDash();this.state_.lineDash=e?e:Io.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r?r:Io.defaultLineDashOffset;var n=i.getLineJoin();this.state_.lineJoin=n!==undefined?n:Io.defaultLineJoin;var h=i.getColor();if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Ea.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Io.defaultStrokeStyle}else{h=Io.defaultStrokeStyle}var a=i.getWidth();a=a!==undefined?a:Io.defaultLineWidth;var o=i.getMiterLimit();o=o!==undefined?o:Io.defaultMiterLimit;if(!this.state_.strokeColor||!kn.equals(this.state_.strokeColor,h)||this.state_.lineWidth!==a||this.state_.miterLimit!==o){this.state_.changed=true;this.state_.strokeColor=h;this.state_.lineWidth=a;this.state_.miterLimit=o;this.styles_.push([h,a,o])}};jo.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var Vo={};Vo.fragment=new yo(fn.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");Vo.vertex=new wo(fn.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var Uo=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"b");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"c");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"d");this.u_color=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_color":"e");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"f");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"a")};var Xo=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.lineCap_=i.lineCap;this.lineDash_=i.lineDash!==undefined?i.lineDash:null;this.lineDashOffset_=i.lineDashOffset;this.lineJoin_=i.lineJoin;this.miterLimit_=i.miterLimit;this.width_=i.width;this.checksum_=undefined};Xo.prototype.clone=function(){var t=this.getColor();return new Xo({color:t&&t.slice?t.slice():t||undefined,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():undefined,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})};Xo.prototype.getColor=function(){return this.color_};Xo.prototype.getLineCap=function(){return this.lineCap_};Xo.prototype.getLineDash=function(){return this.lineDash_};Xo.prototype.getLineDashOffset=function(){return this.lineDashOffset_};Xo.prototype.getLineJoin=function(){return this.lineJoin_};Xo.prototype.getMiterLimit=function(){return this.miterLimit_};Xo.prototype.getWidth=function(){return this.width_};Xo.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};Xo.prototype.setLineCap=function(t){this.lineCap_=t;this.checksum_=undefined};Xo.prototype.setLineDash=function(t){this.lineDash_=t;this.checksum_=undefined};Xo.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t;this.checksum_=undefined};Xo.prototype.setLineJoin=function(t){this.lineJoin_=t;this.checksum_=undefined};Xo.prototype.setMiterLimit=function(t){this.miterLimit_=t;this.checksum_=undefined};Xo.prototype.setWidth=function(t){this.width_=t;this.checksum_=undefined};Xo.prototype.getChecksum=function(){if(this.checksum_===undefined){this.checksum_="s";if(this.color_){if(typeof this.color_==="string"){this.checksum_+=this.color_}else{this.checksum_+=fn.getUid(this.color_).toString()}}else{this.checksum_+="-"}this.checksum_+=","+(this.lineCap_!==undefined?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(this.lineDashOffset_!==undefined?this.lineDashOffset_:"-")+","+(this.lineJoin_!==undefined?this.lineJoin_:"-")+","+(this.miterLimit_!==undefined?this.miterLimit_.toString():"-")+","+(this.width_!==undefined?this.width_.toString():"-")}return this.checksum_};var qo=function(t){this.first_=undefined;this.last_=undefined;this.head_=undefined;this.circular_=t===undefined?true:t;this.length_=0};qo.prototype.insertItem=function(t){var i={prev:undefined,next:undefined,data:t};var s=this.head_;if(!s){this.first_=i;this.last_=i;if(this.circular_){i.next=i;i.prev=i}}else{var e=s.next;i.prev=s;i.next=e;s.next=i;if(e){e.prev=i}if(s===this.last_){this.last_=i}}this.head_=i;this.length_++};qo.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next;var s=t.prev;if(i){i.prev=s}if(s){s.next=i}this.head_=i||s;if(this.first_===this.last_){this.head_=undefined;this.first_=undefined;this.last_=undefined}else if(this.first_===t){this.first_=this.head_}else if(this.last_===t){this.last_=s?this.head_.prev:this.head_}this.length_--}};qo.prototype.firstItem=function(){this.head_=this.first_;if(this.head_){return this.head_.data}return undefined};qo.prototype.lastItem=function(){this.head_=this.last_;if(this.head_){return this.head_.data}return undefined};qo.prototype.nextItem=function(){if(this.head_&&this.head_.next){this.head_=this.head_.next;return this.head_.data}return undefined};qo.prototype.getNextItem=function(){if(this.head_&&this.head_.next){return this.head_.next.data}return undefined};qo.prototype.prevItem=function(){if(this.head_&&this.head_.prev){this.head_=this.head_.prev;return this.head_.data}return undefined};qo.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev){return this.head_.prev.data}return undefined};qo.prototype.getCurrItem=function(){if(this.head_){return this.head_.data}return undefined};qo.prototype.setFirstItem=function(){if(this.circular_&&this.head_){this.first_=this.head_;this.last_=this.head_.prev}};qo.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_;t.first_.prev=this.head_;i.prev=t.last_;t.last_.next=i;this.length_+=t.length_}else{this.head_=t.head_;this.first_=t.first_;this.last_=t.last_;this.length_=t.length_}t.head_=undefined;t.first_=undefined;t.last_=undefined;t.length_=0}};qo.prototype.getLength=function(){return this.length_};var Yo=function(t){this.rbush_=ja(t);this.items_={}};Yo.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s);this.items_[fn.getUid(i)]=s};Yo.prototype.load=function(t,i){var s=new Array(i.length);for(var e=0,r=i.length;e<r;e++){var n=t[e];var h=i[e];var a={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:h};s[e]=a;this.items_[fn.getUid(h)]=a}this.rbush_.load(s)};Yo.prototype.remove=function(t){var i=fn.getUid(t);var s=this.items_[i];delete this.items_[i];return this.rbush_.remove(s)!==null};Yo.prototype.update=function(t,i){var s=this.items_[fn.getUid(i)];var e=[s.minX,s.minY,s.maxX,s.maxY];if(!Nn.equals(e,t)){this.remove(i);this.insert(t,i)}};Yo.prototype.getAll=function(){var t=this.rbush_.all();return t.map((function(t){return t.value}))};Yo.prototype.getInExtent=function(t){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};var s=this.rbush_.search(i);return s.map((function(t){return t.value}))};Yo.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)};Yo.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)};Yo.prototype.forEach_=function(t,i,s){var e;for(var r=0,n=t.length;r<n;r++){e=i.call(s,t[r]);if(e){return e}}return e};Yo.prototype.isEmpty=function(){return vn.isEmpty(this.items_)};Yo.prototype.clear=function(){this.rbush_.clear();this.items_={}};Yo.prototype.getExtent=function(t){var i=this.rbush_.data;return Nn.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)};Yo.prototype.concat=function(t){this.rbush_.load(t.rbush_.all());for(var i in t.items_){this.items_[i|0]=t.items_[i|0]}};var Bo=function(t,i){No.call(this,t,i);this.lineStringReplay=new jo(t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={fillColor:null,changed:false}};fn.inherits(Bo,No);Bo.prototype.drawCoordinates_=function(t,i,s){var e=new qo;var r=new Yo;this.processFlatCoordinates_(t,s,e,r,true);var n=this.getMaxCoords_(e);if(i.length){var h,a;var o=[];for(h=0,a=i.length;h<a;++h){var f={list:new qo,maxCoords:undefined,rtree:new Yo};o.push(f);this.processFlatCoordinates_(i[h],s,f.list,f.rtree,false);this.classifyPoints_(f.list,f.rtree,true);f.maxCoords=this.getMaxCoords_(f.list)}o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]}));for(h=0;h<o.length;++h){var u=o[h].list;var l=u.firstItem();var v=l;var c;do{if(this.getIntersections_(v,r).length){c=true;break}v=u.nextItem()}while(l!==v);if(!c){if(this.bridgeHole_(u,o[h].maxCoords[0],e,n[0],r)){r.concat(o[h].rtree);this.classifyPoints_(e,r,false)}}}}else{this.classifyPoints_(e,r,false)}this.triangulate_(e,r)};Bo.prototype.processFlatCoordinates_=function(t,i,s,e,r){var n=ih.linearRingIsClockwise(t,0,t.length,i);var h,a;var o=this.vertices.length/2;var f;var u;var l;var v=[];var c=[];if(r===n){f=this.createPoint_(t[0],t[1],o++);u=f;for(h=i,a=t.length;h<a;h+=i){l=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,l,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)]);u=l}c.push(this.insertItem_(l,f,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)])}else{var d=t.length-i;f=this.createPoint_(t[d],t[d+1],o++);u=f;for(h=d-i,a=0;h>=a;h-=i){l=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,l,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)]);u=l}c.push(this.insertItem_(l,f,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)])}e.load(v,c)};Bo.prototype.getMaxCoords_=function(t){var i=t.firstItem();var s=i;var e=[s.p0.x,s.p0.y];do{s=t.nextItem();if(s.p0.x>e[0]){e=[s.p0.x,s.p0.y]}}while(s!==i);return e};Bo.prototype.classifyPoints_=function(t,i,s){var e=t.firstItem();var r=e;var n=t.nextItem();var h=false;do{var a=s?Io.triangleIsCounterClockwise(n.p1.x,n.p1.y,r.p1.x,r.p1.y,r.p0.x,r.p0.y):Io.triangleIsCounterClockwise(r.p0.x,r.p0.y,r.p1.x,r.p1.y,n.p1.x,n.p1.y);if(a===undefined){this.removeItem_(r,n,t,i);h=true;if(n===e){e=t.getNextItem()}n=r;t.prevItem()}else if(r.p1.reflex!==a){r.p1.reflex=a;h=true}r=n;n=t.nextItem()}while(r!==e);return h};Bo.prototype.bridgeHole_=function(t,i,s,e,r){var n=t.firstItem();while(n.p1.x!==i){n=t.nextItem()}var h=n.p1;var a={x:e,y:h.y,i:-1};var o=Infinity;var f,u,l;var v;var c=this.getIntersections_({p0:h,p1:a},r,true);for(f=0,u=c.length;f<u;++f){var d=c[f];var m=this.calculateIntersection_(h,a,d.p0,d.p1,true);var p=Math.abs(h.x-m[0]);if(p<o&&Io.triangleIsCounterClockwise(h.x,h.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)!==undefined){o=p;v={x:m[0],y:m[1],i:-1};n=d}}if(o===Infinity){return false}l=n.p1;if(o>0){var z=this.getPointsInTriangle_(h,v,n.p1,r);if(z.length){var M=Infinity;for(f=0,u=z.length;f<u;++f){var _=z[f];var g=Math.atan2(h.y-_.y,a.x-_.x);if(g<M||g===M&&_.x<l.x){M=g;l=_}}}}n=s.firstItem();while(n.p1.x!==l.x||n.p1.y!==l.y){n=s.nextItem()}var b={x:h.x,y:h.y,i:h.i,reflex:undefined};var x={x:n.p1.x,y:n.p1.y,i:n.p1.i,reflex:undefined};t.getNextItem().p0=b;this.insertItem_(h,n.p1,t,r);this.insertItem_(x,b,t,r);n.p1=x;t.setFirstItem();s.concat(t);return true};Bo.prototype.triangulate_=function(t,i){var s=false;var e=this.isSimple_(t,i);while(t.getLength()>3){if(e){if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i,true)){break}}}}else{if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i)){e=this.isSimple_(t,i);if(!e){this.splitPolygon_(t,i);break}else{s=!this.isClockwise_(t);this.classifyPoints_(t,i,s)}}}}}}if(t.getLength()===3){var r=this.indices.length;this.indices[r++]=t.getPrevItem().p0.i;this.indices[r++]=t.getCurrItem().p0.i;this.indices[r++]=t.getNextItem().p0.i}};Bo.prototype.clipEars_=function(t,i,s,e){var r=this.indices.length;var n=t.firstItem();var h=t.getPrevItem();var a=n;var o=t.nextItem();var f=t.getNextItem();var u,l,v;var c=false;do{u=a.p0;l=a.p1;v=o.p1;if(l.reflex===false){var d;if(s){d=this.getPointsInTriangle_(u,l,v,i,true).length===0}else{d=e?this.diagonalIsInside_(f.p1,v,l,u,h.p0):this.diagonalIsInside_(h.p0,u,l,v,f.p1)}if((s||this.getIntersections_({p0:u,p1:v},i).length===0)&&d){if(s||u.reflex===false||v.reflex===false||ih.linearRingIsClockwise([h.p0.x,h.p0.y,u.x,u.y,l.x,l.y,v.x,v.y,f.p1.x,f.p1.y],0,10,2)===!e){this.indices[r++]=u.i;this.indices[r++]=l.i;this.indices[r++]=v.i;this.removeItem_(a,o,t,i);if(o===n){n=f}c=true}}}h=t.getPrevItem();a=t.getCurrItem();o=t.nextItem();f=t.getNextItem()}while(a!==n&&t.getLength()>3);return c};Bo.prototype.resolveSelfIntersections_=function(t,i,s){var e=t.firstItem();t.nextItem();var r=e;var n=t.nextItem();var h=false;do{var a=this.calculateIntersection_(r.p0,r.p1,n.p0,n.p1,s);if(a){var o=false;var f=this.vertices.length;var u=this.indices.length;var l=f/2;var v=t.prevItem();t.removeItem();i.remove(v);o=v===e;var c;if(s){if(a[0]===r.p0.x&&a[1]===r.p0.y){t.prevItem();c=r.p0;n.p0=c;i.remove(r);o=o||r===e}else{c=n.p1;r.p1=c;i.remove(n);o=o||n===e}t.removeItem()}else{c=this.createPoint_(a[0],a[1],l);r.p1=c;n.p0=c;i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r);i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n)}this.indices[u++]=v.p0.i;this.indices[u++]=v.p1.i;this.indices[u++]=c.i;h=true;if(o){break}}r=t.getPrevItem();n=t.nextItem()}while(r!==e);return h};Bo.prototype.isSimple_=function(t,i){var s=t.firstItem();var e=s;do{if(this.getIntersections_(e,i).length){return false}e=t.nextItem()}while(e!==s);return true};Bo.prototype.isClockwise_=function(t){var i=t.getLength()*2;var s=new Array(i);var e=t.firstItem();var r=e;var n=0;do{s[n++]=r.p0.x;s[n++]=r.p0.y;r=t.nextItem()}while(r!==e);return ih.linearRingIsClockwise(s,0,i,2)};Bo.prototype.splitPolygon_=function(t,i){var s=t.firstItem();var e=s;do{var r=this.getIntersections_(e,i);if(r.length){var n=r[0];var h=this.vertices.length/2;var a=this.calculateIntersection_(e.p0,e.p1,n.p0,n.p1);var o=this.createPoint_(a[0],a[1],h);var f=new qo;var u=new Yo;this.insertItem_(o,e.p1,f,u);e.p1=o;i.update([Math.min(e.p0.x,o.x),Math.min(e.p0.y,o.y),Math.max(e.p0.x,o.x),Math.max(e.p0.y,o.y)],e);var l=t.nextItem();while(l!==n){this.insertItem_(l.p0,l.p1,f,u);i.remove(l);t.removeItem();l=t.getCurrItem()}this.insertItem_(n.p0,o,f,u);n.p0=o;i.update([Math.min(n.p1.x,o.x),Math.min(n.p1.y,o.y),Math.max(n.p1.x,o.x),Math.max(n.p1.y,o.y)],n);this.classifyPoints_(t,i,false);this.triangulate_(t,i);this.classifyPoints_(f,u,false);this.triangulate_(f,u);break}e=t.nextItem()}while(e!==s)};Bo.prototype.createPoint_=function(t,i,s){var e=this.vertices.length;this.vertices[e++]=t;this.vertices[e++]=i;var r={x:t,y:i,i:s,reflex:undefined};return r};Bo.prototype.insertItem_=function(t,i,s,e){var r={p0:t,p1:i};s.insertItem(r);if(e){e.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],r)}return r};Bo.prototype.removeItem_=function(t,i,s,e){if(s.getCurrItem()===i){s.removeItem();t.p1=i.p1;e.remove(i);e.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t)}};Bo.prototype.getPointsInTriangle_=function(t,i,s,e,r){var n,h,a,o;var f=[];var u=e.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(n=0,h=u.length;n<h;++n){for(a in u[n]){o=u[n][a];if(typeof o==="object"&&(!r||o.reflex)){if((o.x!==t.x||o.y!==t.y)&&(o.x!==i.x||o.y!==i.y)&&(o.x!==s.x||o.y!==s.y)&&f.indexOf(o)===-1&&Zn.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)){f.push(o)}}}}return f};Bo.prototype.getIntersections_=function(t,i,s){var e=t.p0;var r=t.p1;var n=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]);var h=[];var a,o;for(a=0,o=n.length;a<o;++a){var f=n[a];if(t!==f&&(s||f.p0!==r||f.p1!==e)&&this.calculateIntersection_(e,r,f.p0,f.p1,s)){h.push(f)}}return h};Bo.prototype.calculateIntersection_=function(t,i,s,e,r){var n=(e.y-s.y)*(i.x-t.x)-(e.x-s.x)*(i.y-t.y);if(n!==0){var h=((e.x-s.x)*(t.y-s.y)-(e.y-s.y)*(t.x-s.x))/n;var a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/n;if(!r&&h>Io.EPSILON&&h<1-Io.EPSILON&&a>Io.EPSILON&&a<1-Io.EPSILON||r&&h>=0&&h<=1&&a>=0&&a<=1){return[t.x+h*(i.x-t.x),t.y+h*(i.y-t.y)]}}return undefined};Bo.prototype.diagonalIsInside_=function(t,i,s,e,r){if(i.reflex===undefined||e.reflex===undefined){return false}var n=(s.x-e.x)*(i.y-e.y)>(s.y-e.y)*(i.x-e.x);var h=(r.x-e.x)*(i.y-e.y)<(r.y-e.y)*(i.x-e.x);var a=(t.x-i.x)*(e.y-i.y)>(t.y-i.y)*(e.x-i.x);var o=(s.x-i.x)*(e.y-i.y)<(s.y-i.y)*(e.x-i.x);var f=e.reflex?h||n:h&&n;var u=i.reflex?o||a:o&&a;return f&&u};Bo.prototype.drawMultiPolygon=function(t,i){var s=t.getEndss();var e=t.getStride();var r=this.indices.length;var n=this.lineStringReplay.getCurrentIndex();var h=t.getFlatCoordinates();var a,o,f,u;var l=0;for(a=0,o=s.length;a<o;++a){var v=s[a];if(v.length>0){var c=On.translate(h,l,v[0],e,-this.origin[0],-this.origin[1]);if(c.length){var d=[];var m;for(f=1,u=v.length;f<u;++f){if(v[f]!==v[f-1]){m=On.translate(h,v[f-1],v[f],e,-this.origin[0],-this.origin[1]);d.push(m)}}this.lineStringReplay.drawPolygonCoordinates(c,d,e);this.drawCoordinates_(c,d,e)}}l=v[v.length-1]}if(this.indices.length>r){this.startIndices.push(r);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(r);this.state_.changed=false}}if(this.lineStringReplay.getCurrentIndex()>n){this.lineStringReplay.setPolygonStyle(i,n)}};Bo.prototype.drawPolygon=function(t,i){var s=t.getEnds();var e=t.getStride();if(s.length>0){var r=t.getFlatCoordinates().map(Number);var n=On.translate(r,0,s[0],e,-this.origin[0],-this.origin[1]);if(n.length){var h=[];var a,o,f;for(a=1,o=s.length;a<o;++a){if(s[a]!==s[a-1]){f=On.translate(r,s[a-1],s[a],e,-this.origin[0],-this.origin[1]);h.push(f)}}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.lineStringReplay.setPolygonStyle(i);this.lineStringReplay.drawPolygonCoordinates(n,h,e);this.drawCoordinates_(n,h,e)}}};Bo.prototype.finish=function(t){this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);this.startIndices.push(this.indices.length);this.lineStringReplay.finish(t);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Bo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i);t.deleteBuffer(s);e()}};Bo.prototype.setUpProgram=function(t,i,s,e){var r,n;r=Vo.fragment;n=Vo.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Uo(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,8,0);return a};Bo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)};Bo.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!vn.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setFillStyle_(t,f);this.drawElements(t,i,a,o);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};Bo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=fn.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Nn.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};Bo.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=fn.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};Bo.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)};Bo.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Ea.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Io.defaultFillStyle}else{s=Io.defaultFillStyle}if(!this.state_.fillColor||!kn.equals(s,this.state_.fillColor)){this.state_.fillColor=s;this.state_.changed=true;this.styles_.push(s)}if(i){this.lineStringReplay.setFillStrokeStyle(null,i)}else{var e=new Xo({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,e)}};var Ho=function(t,i){this.space_=i;this.emptyBlocks_=[{x:0,y:0,width:t,height:t}];this.entries_={};this.context_=Lh.createCanvasContext2D(t,t);this.canvas_=this.context_.canvas};Ho.prototype.get=function(t){return this.entries_[t]||null};Ho.prototype.add=function(t,i,s,e,r){var n,h,a;for(h=0,a=this.emptyBlocks_.length;h<a;++h){n=this.emptyBlocks_[h];if(n.width>=i+this.space_&&n.height>=s+this.space_){var o={offsetX:n.x+this.space_,offsetY:n.y+this.space_,image:this.canvas_};this.entries_[t]=o;e.call(r,this.context_,n.x+this.space_,n.y+this.space_);this.split_(h,n,i+this.space_,s+this.space_);return o}}return null};Ho.prototype.split_=function(t,i,s,e){var r=i.width-s;var n=i.height-e;var h;var a;if(r>n){h={x:i.x+s,y:i.y,width:i.width-s,height:i.height};a={x:i.x,y:i.y+e,width:s,height:i.height-e};this.updateBlocks_(t,h,a)}else{h={x:i.x+s,y:i.y,width:i.width-s,height:e};a={x:i.x,y:i.y+e,width:i.width,height:i.height-e};this.updateBlocks_(t,h,a)}};Ho.prototype.updateBlocks_=function(t,i,s){var e=[t,1];if(i.width>0&&i.height>0){e.push(i)}if(s.width>0&&s.height>0){e.push(s)}this.emptyBlocks_.splice.apply(this.emptyBlocks_,e)};var Jo=function(t){var i=t||{};this.currentSize_=i.initialSize!==undefined?i.initialSize:fn.INITIAL_ATLAS_SIZE;this.maxSize_=i.maxSize!==undefined?i.maxSize:fn.MAX_ATLAS_SIZE!=-1?fn.MAX_ATLAS_SIZE:fn.WEBGL_MAX_TEXTURE_SIZE!==undefined?fn.WEBGL_MAX_TEXTURE_SIZE:2048;this.space_=i.space!==undefined?i.space:1;this.atlases_=[new Ho(this.currentSize_,this.space_)];this.currentHitSize_=this.currentSize_;this.hitAtlases_=[new Ho(this.currentHitSize_,this.space_)]};Jo.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i){return null}var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)};Jo.prototype.getInfo_=function(t,i){var s,e,r,n;for(r=0,n=t.length;r<n;++r){s=t[r];e=s.get(i);if(e){return e}}return null};Jo.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}};Jo.prototype.add=function(t,i,s,e,r,n){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_){return null}var h=this.add_(false,t,i,s,e,n);if(!h){return null}var a=r!==undefined?r:fn.nullFunction;var o=this.add_(true,t,i,s,a,n);return this.mergeInfos_(h,o)};Jo.prototype.add_=function(t,i,s,e,r,n){var h=t?this.hitAtlases_:this.atlases_;var a,o,f,u;for(f=0,u=h.length;f<u;++f){a=h[f];o=a.add(i,s,e,r,n);if(o){return o}else if(!o&&f===u-1){var l;if(t){l=Math.min(this.currentHitSize_*2,this.maxSize_);this.currentHitSize_=l}else{l=Math.min(this.currentSize_*2,this.maxSize_);this.currentSize_=l}a=new Ho(l,this.space_);h.push(a);++u}}return null};var Zo=function(t,i){Lo.call(this,t,i);this.images_=[];this.textures_=[];this.measureCanvas_=Lh.createCanvasContext2D(0,0).canvas;this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.atlases_={};this.currAtlas_=undefined;this.scale=1;this.opacity=1};fn.inherits(Zo,Lo);Zo.prototype.drawText=function(t,i){if(this.text_){var s=null;var e=0;var r=2;var n=2;switch(t.getType()){case yn.POINT:case yn.MULTI_POINT:s=t.getFlatCoordinates();r=s.length;n=t.getStride();break;case yn.CIRCLE:s=t.getCenter();break;case yn.LINE_STRING:s=t.getFlatMidpoint();break;case yn.MULTI_LINE_STRING:s=t.getFlatMidpoints();r=s.length;break;case yn.POLYGON:s=t.getFlatInteriorPoint();break;case yn.MULTI_POLYGON:s=t.getFlatInteriorPoints();r=s.length;break}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var h=this.currAtlas_;var a=this.text_.split("\n");var o=this.getTextSize_(a);var f,u,l,v,c,d,m,p;var z=Math.round(o[0]*this.textAlign_-this.offsetX_);var M=Math.round(o[1]*this.textBaseline_-this.offsetY_);var _=this.state_.lineWidth/2*this.state_.scale;for(f=0,u=a.length;f<u;++f){c=0;d=h.height*f;m=a[f].split("");for(l=0,v=m.length;l<v;++l){p=h.atlas.getInfo(m[l]);if(p){var g=p.image;this.anchorX=z-c;this.anchorY=M-d;this.originX=l===0?p.offsetX-_:p.offsetX;this.originY=p.offsetY;this.height=h.height;this.width=l===0||l===m.length-1?h.width[m[l]]+_:h.width[m[l]];this.imageHeight=g.height;this.imageWidth=g.width;var b;if(this.images_.length===0){this.images_.push(g)}else{b=this.images_[this.images_.length-1];if(fn.getUid(b)!=fn.getUid(g)){this.groupIndices.push(this.indices.length);this.images_.push(g)}}this.drawText_(s,e,r,n)}c+=this.width}}}};Zo.prototype.getTextSize_=function(t){var i=this;var s=this.currAtlas_;var e=t.length*s.height;var r=t.map((function(t){var e=0;var r,n;for(r=0,n=t.length;r<n;++r){var h=t[r];if(!s.width[h]){i.addCharToAtlas_(h)}e+=s.width[h]?s.width[h]:0}return e})).reduce((function(t,i){return Math.max(t,i)}));return[r,e]};Zo.prototype.drawText_=function(t,i,s,e){var r,n;for(r=i,n=s;r<n;r+=e){this.drawCoordinates(t,i,s,e)}};Zo.prototype.addCharToAtlas_=function(t){if(t.length===1){var i=this.currAtlas_;var s=this.state_;var e=this.measureCanvas_.getContext("2d");e.font=s.font;var r=Math.ceil(e.measureText(t).width*s.scale);var n=i.atlas.add(t,r,i.height,(function(i,e,r){i.font=s.font;i.fillStyle=s.fillColor;i.strokeStyle=s.strokeColor;i.lineWidth=s.lineWidth;i.lineCap=s.lineCap;i.lineJoin=s.lineJoin;i.miterLimit=s.miterLimit;i.textAlign="left";i.textBaseline="top";if(rh.CANVAS_LINE_DASH&&s.lineDash){i.setLineDash(s.lineDash);i.lineDashOffset=s.lineDashOffset}if(s.scale!==1){i.setTransform(s.scale,0,0,s.scale,0,0)}if(s.strokeColor){i.strokeText(t,e,r)}if(s.fillColor){i.fillText(t,e,r)}}));if(n){i.width[t]=r}}};Zo.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices=this.groupIndices;this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i);this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.images_=null;this.atlases_={};this.currAtlas_=undefined;Lo.prototype.finish.call(this,t)};Zo.prototype.setTextStyle=function(t){var i=this.state_;var s=t.getFill();var e=t.getStroke();if(!t||!t.getText()||!s&&!e){this.text_=""}else{if(!s){i.fillColor=null}else{var r=s.getColor();i.fillColor=Ca.asColorLike(r?r:Io.defaultFillStyle)}if(!e){i.strokeColor=null;i.lineWidth=0}else{var n=e.getColor();i.strokeColor=Ca.asColorLike(n?n:Io.defaultStrokeStyle);i.lineWidth=e.getWidth()||Io.defaultLineWidth;i.lineCap=e.getLineCap()||Io.defaultLineCap;i.lineDashOffset=e.getLineDashOffset()||Io.defaultLineDashOffset;i.lineJoin=e.getLineJoin()||Io.defaultLineJoin;i.miterLimit=e.getMiterLimit()||Io.defaultMiterLimit;var h=e.getLineDash();i.lineDash=h?h.slice():Io.defaultLineDash}i.font=t.getFont()||Io.defaultFont;i.scale=t.getScale()||1;this.text_=t.getText();var a=oo.TEXT_ALIGN[t.getTextAlign()];var o=oo.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=a===undefined?Io.defaultTextAlign:a;this.textBaseline_=o===undefined?Io.defaultTextBaseline:o;this.offsetX_=t.getOffsetX()||0;this.offsetY_=t.getOffsetY()||0;this.rotateWithView=!!t.getRotateWithView();this.rotation=t.getRotation()||0;this.currAtlas_=this.getAtlas_(i)}};Zo.prototype.getAtlas_=function(t){var i=[];var s;for(s in t){if(t[s]||t[s]===0){if(Array.isArray(t[s])){i=i.concat(t[s])}else{i.push(t[s])}}}var e=this.calculateHash_(i);if(!this.atlases_[e]){var r=this.measureCanvas_.getContext("2d");r.font=t.font;var n=Math.ceil((r.measureText("M").width*1.5+t.lineWidth/2)*t.scale);this.atlases_[e]={atlas:new Jo({space:t.lineWidth+1}),width:{},height:n}}return this.atlases_[e]};Zo.prototype.calculateHash_=function(t){var i,s;var e="";for(i=0,s=t.length;i<s;++i){e+=t[i]}return e};Zo.prototype.getTextures=function(t){return this.textures_};Zo.prototype.getHitDetectionTextures=function(){return this.textures_};var $o=function(t,i,s){eo.call(this);this.maxExtent_=i;this.tolerance_=t;this.renderBuffer_=s;this.replaysByZIndex_={}};fn.inherits($o,eo);$o.prototype.addDeclutter=function(t,i){};$o.prototype.getDeleteResourcesFunction=function(t){var i=[];var s;for(s in this.replaysByZIndex_){var e=this.replaysByZIndex_[s];var r;for(r in e){i.push(e[r].getDeleteResourcesFunction(t))}}return function(){var t=i.length;var s;for(var e=0;e<t;e++){s=i[e].apply(this,arguments)}return s}};$o.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];var e;for(e in s){s[e].finish(t)}}};$o.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=$o.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_);e[i]=r}return r};$o.prototype.isEmpty=function(){return vn.isEmpty(this.replaysByZIndex_)};$o.prototype.replay=function(t,i,s,e,r,n,h,a){var o=Object.keys(this.replaysByZIndex_).map(Number);o.sort(kn.numberSafeCompareFunction);var f,u,l,v,c,d;for(f=0,u=o.length;f<u;++f){c=this.replaysByZIndex_[o[f].toString()];for(l=0,v=oo.ORDER.length;l<v;++l){d=c[oo.ORDER[l]];if(d!==undefined){d.replay(t,i,s,e,r,n,h,a,undefined,false)}}}};$o.prototype.replayHitDetection_=function(t,i,s,e,r,n,h,a,o,f,u){var l=Object.keys(this.replaysByZIndex_).map(Number);l.sort((function(t,i){return i-t}));var v,c,d,m,p,z;for(v=0,c=l.length;v<c;++v){m=this.replaysByZIndex_[l[v].toString()];for(d=oo.ORDER.length-1;d>=0;--d){p=m[oo.ORDER[d]];if(p!==undefined){z=p.replay(t,i,s,e,r,n,h,a,o,f,u);if(z){return z}}}}return undefined};$o.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o,f){var u=i.getGL();u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer());var l;if(this.renderBuffer_!==undefined){l=Nn.buffer(Nn.createOrUpdateFromCoordinate(t),e*this.renderBuffer_)}return this.replayHitDetection_(i,t,e,r,$o.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,i);if(i[3]>0){var s=f(t);if(s){return s}}}),true,l)};$o.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o){var f=i.getGL();f.bindFramebuffer(f.FRAMEBUFFER,i.getHitDetectionFramebuffer());var u=this.replayHitDetection_(i,t,e,r,$o.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);f.readPixels(0,0,1,1,f.RGBA,f.UNSIGNED_BYTE,i);return i[3]>0}),false);return u!==undefined};$o.HIT_DETECTION_SIZE_=[1,1];$o.BATCH_CONSTRUCTORS_={Circle:Oo,Image:Do,LineString:jo,Polygon:Bo,Text:Zo};var Ko=function(t,i,s,e,r,n,h){Na.call(this);this.context_=t;this.center_=i;this.extent_=n;this.pixelRatio_=h;this.size_=r;this.rotation_=e;this.resolution_=s;this.imageStyle_=null;this.fillStyle_=null;this.strokeStyle_=null;this.textStyle_=null};fn.inherits(Ko,Na);Ko.prototype.drawText_=function(t,i){var s=this.context_;var e=t.getReplay(0,ro.TEXT);e.setTextStyle(this.textStyle_);e.drawText(i,null);e.finish(s);var r=1;var n={};var h;var a=false;e.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,r,n,h,a);e.getDeleteResourcesFunction(s)()};Ko.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Ko.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case yn.POINT:this.drawPoint(t,null);break;case yn.LINE_STRING:this.drawLineString(t,null);break;case yn.POLYGON:this.drawPolygon(t,null);break;case yn.MULTI_POINT:this.drawMultiPoint(t,null);break;case yn.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case yn.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case yn.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case yn.CIRCLE:this.drawCircle(t,null);break}};Ko.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!Nn.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Ko.prototype.drawGeometryCollection=function(t,i){var s=t.getGeometriesArray();var e,r;for(e=0,r=s.length;e<r;++e){this.drawGeometry(s[e])}};Ko.prototype.drawPoint=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.IMAGE);r.setImageStyle(this.imageStyle_);r.drawPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawMultiPoint=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.IMAGE);r.setImageStyle(this.imageStyle_);r.drawMultiPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawLineString=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawMultiLineString=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawMultiLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawPolygon=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawMultiPolygon=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawMultiPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawCircle=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.CIRCLE);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawCircle(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.setImageStyle=function(t){this.imageStyle_=t};Ko.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t;this.strokeStyle_=i};Ko.prototype.setTextStyle=function(t){this.textStyle_=t};var Qo={};Qo.fragment=new yo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}");Qo.vertex=new wo(fn.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var tf=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_texCoordMatrix":"d");this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"e");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"f");this.u_texture=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_texture":"g");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_texCoord":"c")};var sf=function(t,i){Sa.call(this,i);this.mapRenderer=t;this.arrayBuffer_=new So([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]);this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined;this.texCoordMatrix=Gn.create();this.projectionMatrix=Gn.create();this.tmpMat4_=Co.create();this.defaultLocations_=null};fn.inherits(sf,Sa);sf.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(this.framebufferDimension===undefined||this.framebufferDimension!=i){var e=function(t,i,s){if(!t.isContextLost()){t.deleteFramebuffer(i);t.deleteTexture(s)}}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(e);var r=Po.createEmptyTexture(s,i,i);var n=s.createFramebuffer();s.bindFramebuffer(eh.FRAMEBUFFER,n);s.framebufferTexture2D(eh.FRAMEBUFFER,eh.COLOR_ATTACHMENT0,eh.TEXTURE_2D,r,0);this.texture=r;this.framebuffer=n;this.framebufferDimension=i}else{s.bindFramebuffer(eh.FRAMEBUFFER,this.framebuffer)}};sf.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(Hh.PRECOMPOSE,s,t);s.bindBuffer(eh.ARRAY_BUFFER,this.arrayBuffer_);var e=s.getGL();var r=Qo.fragment;var n=Qo.vertex;var h=s.getProgram(r,n);var a;if(!this.defaultLocations_){a=new tf(e,h);this.defaultLocations_=a}else{a=this.defaultLocations_}if(s.useProgram(h)){e.enableVertexAttribArray(a.a_position);e.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,16,0);e.enableVertexAttribArray(a.a_texCoord);e.vertexAttribPointer(a.a_texCoord,2,eh.FLOAT,false,16,8);e.uniform1i(a.u_texture,0)}e.uniformMatrix4fv(a.u_texCoordMatrix,false,Co.fromTransform(this.tmpMat4_,this.getTexCoordMatrix()));e.uniformMatrix4fv(a.u_projectionMatrix,false,Co.fromTransform(this.tmpMat4_,this.getProjectionMatrix()));e.uniform1f(a.u_opacity,i.opacity);e.bindTexture(eh.TEXTURE_2D,this.getTexture());e.drawArrays(eh.TRIANGLE_STRIP,0,4);this.dispatchComposeEvent_(Hh.POSTCOMPOSE,s,t)};sf.prototype.dispatchComposeEvent_=function(t,i,s){var e=this.getLayer();if(e.hasListener(t)){var r=s.viewState;var n=r.resolution;var h=s.pixelRatio;var a=s.extent;var o=r.center;var f=r.rotation;var u=s.size;var l=new Ko(i,o,n,f,u,a,h);var v=new ya(t,l,s,null,i);e.dispatchEvent(v)}};sf.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix};sf.prototype.getTexture=function(){return this.texture};sf.prototype.getProjectionMatrix=function(){return this.projectionMatrix};sf.prototype.handleWebGLContextLost=function(){this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined};sf.prototype.prepareFrame=function(t,i,s){};sf.prototype.forEachLayerAtPixel=function(t,i,s,e){};var ef=function(t,i){sf.call(this,t,i);this.image_=null;this.hitCanvasContext_=null;this.hitTransformationMatrix_=null};fn.inherits(ef,sf);ef["handles"]=function(t,i){return t===Uh.WEBGL&&i.getType()===ba.IMAGE};ef["create"]=function(t,i){return new ef(t,i)};ef.prototype.createTexture_=function(t){var i=t.getImage();var s=this.mapRenderer.getGL();return Po.createTexture(s,i,eh.CLAMP_TO_EDGE,eh.CLAMP_TO_EDGE)};ef.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};ef.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer.getGL();var r=t.pixelRatio;var n=t.viewState;var h=n.center;var a=n.resolution;var o=n.rotation;var f=this.image_;var u=this.texture;var l=this.getLayer();var v=l.getSource();var c=t.viewHints;var d=t.extent;if(i.extent!==undefined){d=Nn.getIntersection(d,i.extent)}if(!c[Sh.ANIMATING]&&!c[Sh.INTERACTING]&&!Nn.isEmpty(d)){var m=n.projection;if(!fn.ENABLE_RASTER_REPROJECTION){var p=v.getProjection();if(p){m=p}}var z=v.getImage(d,a,r,m);if(z){var M=this.loadImage(z);if(M){f=z;u=this.createTexture_(z);if(this.texture){var _=function(t,i){if(!t.isContextLost()){t.deleteTexture(i)}}.bind(null,e,this.texture);t.postRenderFunctions.push(_)}}}}if(f){var g=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(g.width,g.height,r,h,a,o,f.getExtent());this.hitTransformationMatrix_=null;var b=this.texCoordMatrix;Gn.reset(b);Gn.scale(b,1,-1);Gn.translate(b,0,-1);this.image_=f;this.texture=u;this.updateLogos(t,v)}return!!f};ef.prototype.updateProjectionMatrix_=function(t,i,s,e,r,n,h){var a=t*r;var o=i*r;var f=this.projectionMatrix;Gn.reset(f);Gn.scale(f,s*2/a,s*2/o);Gn.rotate(f,-n);Gn.translate(f,h[0]-e[0],h[1]-e[1]);Gn.scale(f,(h[2]-h[0])/2,(h[3]-h[1])/2);Gn.translate(f,1,1)};ef.prototype.hasFeatureAtCoordinate=function(t,i){var s=this.forEachFeatureAtCoordinate(t,i,0,Sn.TRUE,this);return s!==undefined};ef.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.image_||!this.image_.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==fn.nullFunction){var r=Gn.apply(i.pixelToCoordinateTransform,t.slice());var n=this.forEachFeatureAtCoordinate(r,i,0,Sn.TRUE,this);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}}else{var h=[this.image_.getImage().width,this.image_.getImage().height];if(!this.hitTransformationMatrix_){this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,h)}var a=Gn.apply(this.hitTransformationMatrix_,t.slice());if(a[0]<0||a[0]>h[0]||a[1]<0||a[1]>h[1]){return undefined}if(!this.hitCanvasContext_){this.hitCanvasContext_=Lh.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.image_.getImage(),a[0],a[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}}};ef.prototype.getHitTransformationMatrix_=function(t,i){var s=Gn.create();Gn.translate(s,-1,-1);Gn.scale(s,2/t[0],2/t[1]);Gn.translate(s,0,t[1]);Gn.scale(s,1,-1);var e=Gn.invert(this.projectionMatrix.slice());var r=Gn.create();Gn.translate(r,0,i[1]);Gn.scale(r,1,-1);Gn.scale(r,i[0]/2,i[1]/2);Gn.translate(r,1,1);Gn.multiply(r,e);Gn.multiply(r,s);return r};var rf=function(t,i){La.call(this,t,i);this.canvas_=document.createElement("CANVAS");this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=Bh.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.clipTileCanvasWidth_=0;this.clipTileCanvasHeight_=0;this.clipTileContext_=Lh.createCanvasContext2D();this.renderedVisible_=true;this.gl_=eh.getContext(this.canvas_,{antialias:true,depth:true,failIfMajorPerformanceCaveat:true,preserveDrawingBuffer:false,stencil:true});this.context_=new Po(this.canvas_,this.gl_);cn.listen(this.canvas_,Ro.LOST,this.handleWebGLContextLost,this);cn.listen(this.canvas_,Ro.RESTORED,this.handleWebGLContextRestored,this);this.textureCache_=new wa;this.focus_=null;this.tileTextureQueue_=new kh(function(t){var i=t[1];var s=t[2];var e=i[0]-this.focus_[0];var r=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(e*e+r*r)/s}.bind(this),(function(t){return t[0].getKey()}));this.loadNextTileTexture_=function(t,i){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var s=this.tileTextureQueue_.dequeue();var e=s[0];var r=s[3];var n=s[4];this.bindTileTexture(e,r,n,eh.LINEAR,eh.LINEAR)}return false}.bind(this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()};fn.inherits(rf,La);rf["handles"]=function(t){return rh.WEBGL&&t===Uh.WEBGL};rf["create"]=function(t,i){return new rf(t,i)};rf.prototype.bindTileTexture=function(t,i,s,e,r){var n=this.getGL();var h=t.getKey();if(this.textureCache_.containsKey(h)){var a=this.textureCache_.get(h);n.bindTexture(eh.TEXTURE_2D,a.texture);if(a.magFilter!=e){n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MAG_FILTER,e);a.magFilter=e}if(a.minFilter!=r){n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MIN_FILTER,r);a.minFilter=r}}else{var o=n.createTexture();n.bindTexture(eh.TEXTURE_2D,o);if(s>0){var f=this.clipTileContext_.canvas;var u=this.clipTileContext_;if(this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]){f.width=i[0];f.height=i[1];this.clipTileCanvasWidth_=i[0];this.clipTileCanvasHeight_=i[1]}else{u.clearRect(0,0,i[0],i[1])}u.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]);n.texImage2D(eh.TEXTURE_2D,0,eh.RGBA,eh.RGBA,eh.UNSIGNED_BYTE,f)}else{n.texImage2D(eh.TEXTURE_2D,0,eh.RGBA,eh.RGBA,eh.UNSIGNED_BYTE,t.getImage())}n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MAG_FILTER,e);n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MIN_FILTER,r);n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_S,eh.CLAMP_TO_EDGE);n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_T,eh.CLAMP_TO_EDGE);this.textureCache_.set(h,{texture:o,magFilter:e,minFilter:r})}};rf.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var e=this.context_;var r=i.extent;var n=i.size;var h=i.viewState;var a=i.pixelRatio;var o=h.resolution;var f=h.center;var u=h.rotation;var l=new Ko(e,f,o,u,n,r,a);var v=new ya(t,l,i,null,e);s.dispatchEvent(v)}};rf.prototype.disposeInternal=function(){var t=this.getGL();if(!t.isContextLost()){this.textureCache_.forEach((function(i){if(i){t.deleteTexture(i.texture)}}))}this.context_.dispose();La.prototype.disposeInternal.call(this)};rf.prototype.expireCache_=function(t,i){var s=this.getGL();var e;while(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>fn.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){e=this.textureCache_.peekLast();if(!e){if(+this.textureCache_.peekLastKey()==i.index){break}else{--this.textureCacheFrameMarkerCount_}}else{s.deleteTexture(e.texture)}this.textureCache_.pop()}};rf.prototype.getContext=function(){return this.context_};rf.prototype.getGL=function(){return this.gl_};rf.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_};rf.prototype.getType=function(){return Uh.WEBGL};rf.prototype.handleWebGLContextLost=function(t){t.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i){var e=i[s];e.handleWebGLContextLost()}};rf.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()};rf.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(eh.TEXTURE0);t.blendFuncSeparate(eh.SRC_ALPHA,eh.ONE_MINUS_SRC_ALPHA,eh.ONE,eh.ONE_MINUS_SRC_ALPHA);t.disable(eh.CULL_FACE);t.disable(eh.DEPTH_TEST);t.disable(eh.SCISSOR_TEST);t.disable(eh.STENCIL_TEST)};rf.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())};rf.prototype.renderFrame=function(t){var i=this.getContext();var s=this.getGL();if(s.isContextLost()){return false}if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return false}this.focus_=t.focus;this.textureCache_.set((-t.index).toString(),null);++this.textureCacheFrameMarkerCount_;this.dispatchComposeEvent_(Hh.PRECOMPOSE,t);var e=[];var r=t.layerStatesArray;kn.stableSort(r,La.sortByZIndex);var n=t.viewState.resolution;var h,a,o,f;for(h=0,a=r.length;h<a;++h){f=r[h];if(Jh.visibleAtResolution(f,n)&&f.sourceState==Wh.READY){o=this.getLayerRenderer(f.layer);if(o.prepareFrame(t,f,i)){e.push(f)}}}var u=t.size[0]*t.pixelRatio;var l=t.size[1]*t.pixelRatio;if(this.canvas_.width!=u||this.canvas_.height!=l){this.canvas_.width=u;this.canvas_.height=l}s.bindFramebuffer(eh.FRAMEBUFFER,null);s.clearColor(0,0,0,0);s.clear(eh.COLOR_BUFFER_BIT);s.enable(eh.BLEND);s.viewport(0,0,this.canvas_.width,this.canvas_.height);for(h=0,a=e.length;h<a;++h){f=e[h];o=this.getLayerRenderer(f.layer);o.composeFrame(t,f,i)}if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.calculateMatrices2D(t);if(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>fn.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){t.postRenderFunctions.push(this.expireCache_.bind(this))}if(!this.tileTextureQueue_.isEmpty()){t.postRenderFunctions.push(this.loadNextTileTexture_);t.animate=true}this.dispatchComposeEvent_(Hh.POSTCOMPOSE,t);this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};rf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;if(this.getGL().isContextLost()){return false}var o=i.viewState;var f=i.layerStatesArray;var u=f.length;var l;for(l=u-1;l>=0;--l){var v=f[l];var c=v.layer;if(Jh.visibleAtResolution(v,o.resolution)&&n.call(h,c)){var d=this.getLayerRenderer(c);a=d.forEachFeatureAtCoordinate(t,i,s,e,r);if(a){return a}}}return undefined};rf.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=false;if(this.getGL().isContextLost()){return false}var h=i.viewState;var a=i.layerStatesArray;var o=a.length;var f;for(f=o-1;f>=0;--f){var u=a[f];var l=u.layer;if(Jh.visibleAtResolution(u,h.resolution)&&e.call(r,l)){var v=this.getLayerRenderer(l);n=v.hasFeatureAtCoordinate(t,i);if(n){return true}}}return n};rf.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){if(this.getGL().isContextLost()){return false}var h=i.viewState;var a;var o=i.layerStatesArray;var f=o.length;var u;for(u=f-1;u>=0;--u){var l=o[u];var v=l.layer;if(Jh.visibleAtResolution(l,h.resolution)&&r.call(e,v)){var c=this.getLayerRenderer(v);a=c.forEachLayerAtPixel(t,i,s,e);if(a){return a}}}return undefined};var nf={};nf.fragment=new yo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}");nf.vertex=new wo(fn.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var hf=function(t,i){this.u_tileOffset=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_tileOffset":"d");this.u_texture=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_texture":"e");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_texCoord":"c")};var af=function(t,i){sf.call(this,t,i);this.fragmentShader_=nf.fragment;this.vertexShader_=nf.vertex;this.locations_=null;this.renderArrayBuffer_=new So([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]);this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;this.tmpSize_=[0,0]};fn.inherits(af,sf);af["handles"]=function(t,i){return t===Uh.WEBGL&&i.getType()===ba.TILE};af["create"]=function(t,i){return new af(t,i)};af.prototype.disposeInternal=function(){var t=this.mapRenderer.getContext();t.deleteBuffer(this.renderArrayBuffer_);sf.prototype.disposeInternal.call(this)};af.prototype.createLoadedTileFinder=function(t,i,s){var e=this.mapRenderer;return function(r,n){function h(t){var i=e.isTileTextureLoaded(t);if(i){if(!s[r]){s[r]={}}s[r][t.tileCoord.toString()]=t}return i}return t.forEachLoadedTile(i,r,n,h)}};af.prototype.handleWebGLContextLost=function(){sf.prototype.handleWebGLContextLost.call(this);this.locations_=null};af.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer;var r=s.getGL();var n=t.viewState;var h=n.projection;var a=this.getLayer();var o=a.getSource();var f=o.getTileGridForProjection(h);var u=f.getZForResolution(n.resolution);var l=f.getResolution(u);var v=o.getTilePixelSize(u,t.pixelRatio,h);var c=v[0]/Xh.toSize(f.getTileSize(u),this.tmpSize_)[0];var d=l/c;var m=o.getTilePixelRatio(c)*o.getGutter(h);var p=n.center;var z=t.extent;var M=f.getTileRangeForExtentAndZ(z,u);var _;if(this.renderedTileRange_&&this.renderedTileRange_.equals(M)&&this.renderedRevision_==o.getRevision()){_=this.renderedFramebufferExtent_}else{var g=M.getSize();var b=Math.max(g[0]*v[0],g[1]*v[1]);var x=xn.roundUpToPowerOfTwo(b);var y=d*x;var w=f.getOrigin(u);var k=w[0]+M.minX*v[0]*d;var E=w[1]+M.minY*v[1]*d;_=[k,E,k+y,E+y];this.bindFramebuffer(t,x);r.viewport(0,0,x,x);r.clearColor(0,0,0,0);r.clear(eh.COLOR_BUFFER_BIT);r.disable(eh.BLEND);var C=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(C);if(!this.locations_){this.locations_=new hf(r,C)}s.bindBuffer(eh.ARRAY_BUFFER,this.renderArrayBuffer_);r.enableVertexAttribArray(this.locations_.a_position);r.vertexAttribPointer(this.locations_.a_position,2,eh.FLOAT,false,16,0);r.enableVertexAttribArray(this.locations_.a_texCoord);r.vertexAttribPointer(this.locations_.a_texCoord,2,eh.FLOAT,false,16,8);r.uniform1i(this.locations_.u_texture,0);var N={};N[u]={};var I=this.createLoadedTileFinder(o,h,N);var S=a.getUseInterimTilesOnError();var O=true;var T=Nn.createEmpty();var A=new Fa(0,0,0,0);var R,P,L,D,F;var W,G,j;for(W=M.minX;W<=M.maxX;++W){for(G=M.minY;G<=M.maxY;++G){D=o.getTile(u,W,G,c,h);if(i.extent!==undefined){j=f.getTileCoordExtent(D.tileCoord,T);if(!Nn.intersects(j,i.extent)){continue}}F=D.getState();P=F==wh.LOADED||F==wh.EMPTY||F==wh.ERROR&&!S;if(!P){D=D.getInterimTile()}F=D.getState();if(F==wh.LOADED){if(e.isTileTextureLoaded(D)){N[u][D.tileCoord.toString()]=D;continue}}else if(F==wh.EMPTY||F==wh.ERROR&&!S){continue}O=false;L=f.forEachTileCoordParentTileRange(D.tileCoord,I,null,A,T);if(!L){R=f.getTileCoordChildTileRange(D.tileCoord,A,T);if(R){I(u+1,R)}}}}var V=Object.keys(N).map(Number);V.sort(kn.numberSafeCompareFunction);var U=new Float32Array(4);var X,q,Y,B;for(X=0,q=V.length;X<q;++X){B=N[V[X]];for(Y in B){D=B[Y];j=f.getTileCoordExtent(D.tileCoord,T);U[0]=2*(j[2]-j[0])/y;U[1]=2*(j[3]-j[1])/y;U[2]=2*(j[0]-_[0])/y-1;U[3]=2*(j[1]-_[1])/y-1;r.uniform4fv(this.locations_.u_tileOffset,U);e.bindTileTexture(D,v,m*c,eh.LINEAR,eh.LINEAR);r.drawArrays(eh.TRIANGLE_STRIP,0,4)}}if(O){this.renderedTileRange_=M;this.renderedFramebufferExtent_=_;this.renderedRevision_=o.getRevision()}else{this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;t.animate=true}}this.updateUsedTiles(t.usedTiles,o,u,M);var H=e.getTileTextureQueue();this.manageTilePyramid(t,o,f,c,h,z,u,a.getPreload(),(function(t){if(t.getState()==wh.LOADED&&!e.isTileTextureLoaded(t)&&!H.isKeyQueued(t.getKey())){H.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),v,m*c])}}),this);this.scheduleExpireCache(t,o);this.updateLogos(t,o);var J=this.texCoordMatrix;Gn.reset(J);Gn.translate(J,(Math.round(p[0]/l)*l-_[0])/(_[2]-_[0]),(Math.round(p[1]/l)*l-_[1])/(_[3]-_[1]));if(n.rotation!==0){Gn.rotate(J,n.rotation)}Gn.scale(J,t.size[0]*n.resolution/(_[2]-_[0]),t.size[1]*n.resolution/(_[3]-_[1]));Gn.translate(J,-.5,-.5);return true};af.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.framebuffer){return undefined}var r=[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]];var n=Gn.apply(this.texCoordMatrix,r.slice());var h=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension];var a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);a.readPixels(h[0],h[1],1,1,a.RGBA,a.UNSIGNED_BYTE,o);if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}};var of=function(t,i){sf.call(this,t,i);this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=Nn.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.layerState_=null};fn.inherits(of,sf);of["handles"]=function(t,i){return t===Uh.WEBGL&&i.getType()===ba.VECTOR};of["create"]=function(t,i){return new of(t,i)};of.prototype.composeFrame=function(t,i,s){this.layerState_=i;var e=t.viewState;var r=this.replayGroup_;var n=t.size;var h=t.pixelRatio;var a=this.mapRenderer.getGL();if(r&&!r.isEmpty()){a.enable(a.SCISSOR_TEST);a.scissor(0,0,n[0]*h,n[1]*h);r.replay(s,e.center,e.resolution,e.rotation,n,h,i.opacity,i.managed?t.skippedFeatureUids:{});a.disable(a.SCISSOR_TEST)}};of.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)();this.replayGroup_=null}sf.prototype.disposeInternal.call(this)};of.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_||!this.layerState_){return undefined}else{var n=this.mapRenderer.getContext();var h=i.viewState;var a=this.getLayer();var o=this.layerState_;var f={};return this.replayGroup_.forEachFeatureAtCoordinate(t,n,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,o.opacity,{},(function(t){var i=fn.getUid(t).toString();if(!(i in f)){f[i]=true;return e.call(r,t,a)}}))}};of.prototype.hasFeatureAtCoordinate=function(t,i){if(!this.replayGroup_||!this.layerState_){return false}else{var s=this.mapRenderer.getContext();var e=i.viewState;var r=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,s,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,r.opacity,i.skippedFeatureUids)}};of.prototype.forEachLayerAtPixel=function(t,i,s,e){var r=Gn.apply(i.pixelToCoordinateTransform,t.slice());var n=this.hasFeatureAtCoordinate(r,i);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}};of.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};of.prototype.prepareFrame=function(t,i,s){var e=this.getLayer();var r=e.getSource();this.updateLogos(t,r);var n=t.viewHints[Sh.ANIMATING];var h=t.viewHints[Sh.INTERACTING];var a=e.getUpdateWhileAnimating();var o=e.getUpdateWhileInteracting();if(!this.dirty_&&(!a&&n)||!o&&h){return true}var f=t.extent;var u=t.viewState;var l=u.projection;var v=u.resolution;var c=t.pixelRatio;var d=e.getRevision();var m=e.getRenderBuffer();var p=e.getRenderOrder();if(p===undefined){p=Mo.defaultOrder}var z=Nn.buffer(f,m*v);if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&Nn.containsExtent(this.renderedExtent_,z)){return true}if(this.replayGroup_){t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s))}this.dirty_=false;var M=new $o(Mo.getTolerance(v,c),z,e.getRenderBuffer());r.loadFeatures(z,v,l);var _=function(t){var i;var s=t.getStyleFunction();if(s){i=s.call(t,v)}else{s=e.getStyleFunction();if(s){i=s(t,v)}}if(i){var r=this.renderFeature(t,v,c,i,M);this.dirty_=this.dirty_||r}};if(p){var g=[];r.forEachFeatureInExtent(z,(function(t){g.push(t)}),this);g.sort(p);g.forEach(_,this)}else{r.forEachFeatureInExtent(z,_,this)}M.finish(s);this.renderedResolution_=v;this.renderedRevision_=d;this.renderedRenderOrder_=p;this.renderedExtent_=z;this.replayGroup_=M;return true};of.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=e.length-1,a=0;h>=a;--h){n=Mo.renderFeature(r,t,e[h],Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Mo.renderFeature(r,t,e,Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}return n};if(fn.ENABLE_CANVAS){Vh.register(jh.MAP_RENDERER,Da);Vh.registerMultiple(jh.LAYER_RENDERER,[Aa,Wa,_o,bo])}if(fn.ENABLE_WEBGL){Vh.register(jh.MAP_RENDERER,rf);Vh.registerMultiple(jh.LAYER_RENDERER,[ef,af,of])}var ff=function(t){t=vn.assign({},t);if(!t.controls){t.controls=Qh.defaults()}if(!t.interactions){t.interactions=za.defaults()}qh.call(this,t)};fn.inherits(ff,qh);var uf={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var lf=function(t){_n.call(this);this.options=t;this.id=t.id;this.insertFirst=t.insertFirst!==undefined?t.insertFirst:true;this.stopEvent=t.stopEvent!==undefined?t.stopEvent:true;this.element=document.createElement("DIV");this.element.className=t.className!==undefined?t.className:"ol-overlay-container "+Bh.CLASS_SELECTABLE;this.element.style.position="absolute";this.autoPan=t.autoPan!==undefined?t.autoPan:false;this.autoPanAnimation=t.autoPanAnimation||{};this.autoPanMargin=t.autoPanMargin!==undefined?t.autoPanMargin:20;this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:true};this.mapPostrenderListenerKey=null;cn.listen(this,_n.getChangeEventType(lf.Property.ELEMENT),this.handleElementChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.MAP),this.handleMapChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.OFFSET),this.handleOffsetChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.POSITION),this.handlePositionChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.POSITIONING),this.handlePositioningChanged,this);if(t.element!==undefined){this.setElement(t.element)}this.setOffset(t.offset!==undefined?t.offset:[0,0]);this.setPositioning(t.positioning!==undefined?t.positioning:uf.TOP_LEFT);if(t.position!==undefined){this.setPosition(t.position)}};fn.inherits(lf,_n);lf.prototype.getElement=function(){return this.get(lf.Property.ELEMENT)};lf.prototype.getId=function(){return this.id};lf.prototype.getMap=function(){return this.get(lf.Property.MAP)};lf.prototype.getOffset=function(){return this.get(lf.Property.OFFSET)};lf.prototype.getPosition=function(){return this.get(lf.Property.POSITION)};lf.prototype.getPositioning=function(){return this.get(lf.Property.POSITIONING)};lf.prototype.handleElementChanged=function(){Lh.removeChildren(this.element);var t=this.getElement();if(t){this.element.appendChild(t)}};lf.prototype.handleMapChanged=function(){if(this.mapPostrenderListenerKey){Lh.removeNode(this.element);cn.unlistenByKey(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}var t=this.getMap();if(t){this.mapPostrenderListenerKey=cn.listen(t,xh.POSTRENDER,this.render,this);this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();if(this.insertFirst){i.insertBefore(this.element,i.childNodes[0]||null)}else{i.appendChild(this.element)}}};lf.prototype.render=function(){this.updatePixelPosition()};lf.prototype.handleOffsetChanged=function(){this.updatePixelPosition()};lf.prototype.handlePositionChanged=function(){this.updatePixelPosition();if(this.get(lf.Property.POSITION)&&this.autoPan){this.panIntoView()}};lf.prototype.handlePositioningChanged=function(){this.updatePixelPosition()};lf.prototype.setElement=function(t){this.set(lf.Property.ELEMENT,t)};lf.prototype.setMap=function(t){this.set(lf.Property.MAP,t)};lf.prototype.setOffset=function(t){this.set(lf.Property.OFFSET,t)};lf.prototype.setPosition=function(t){this.set(lf.Property.POSITION,t)};lf.prototype.panIntoView=function(){var t=this.getMap();if(!t||!t.getTargetElement()){return}var i=this.getRect(t.getTargetElement(),t.getSize());var s=this.getElement();var e=this.getRect(s,[Lh.outerWidth(s),Lh.outerHeight(s)]);var r=this.autoPanMargin;if(!Nn.containsExtent(i,e)){var n=e[0]-i[0];var h=i[2]-e[2];var a=e[1]-i[1];var o=i[3]-e[3];var f=[0,0];if(n<0){f[0]=n-r}else if(h<0){f[0]=Math.abs(h)+r}if(a<0){f[1]=a-r}else if(o<0){f[1]=Math.abs(o)+r}if(f[0]!==0||f[1]!==0){var u=t.getView().getCenter();var l=t.getPixelFromCoordinate(u);var v=[l[0]+f[0],l[1]+f[1]];t.getView().animate({center:t.getCoordinateFromPixel(v),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}};lf.prototype.getRect=function(t,i){var s=t.getBoundingClientRect();var e=s.left+window.pageXOffset;var r=s.top+window.pageYOffset;return[e,r,e+i[0],r+i[1]]};lf.prototype.setPositioning=function(t){this.set(lf.Property.POSITIONING,t)};lf.prototype.setVisible=function(t){if(this.rendered.visible!==t){this.element.style.display=t?"":"none";this.rendered.visible=t}};lf.prototype.updatePixelPosition=function(){var t=this.getMap();var i=this.getPosition();if(!t||!t.isRendered()||!i){this.setVisible(false);return}var s=t.getPixelFromCoordinate(i);var e=t.getSize();this.updateRenderedPosition(s,e)};lf.prototype.updateRenderedPosition=function(t,i){var s=this.element.style;var e=this.getOffset();var r=this.getPositioning();this.setVisible(true);var n=e[0];var h=e[1];if(r==uf.BOTTOM_RIGHT||r==uf.CENTER_RIGHT||r==uf.TOP_RIGHT){if(this.rendered.left_!==""){this.rendered.left_=s.left=""}var a=Math.round(i[0]-t[0]-n)+"px";if(this.rendered.right_!=a){this.rendered.right_=s.right=a}}else{if(this.rendered.right_!==""){this.rendered.right_=s.right=""}if(r==uf.BOTTOM_CENTER||r==uf.CENTER_CENTER||r==uf.TOP_CENTER){n-=this.element.offsetWidth/2}var o=Math.round(t[0]+n)+"px";if(this.rendered.left_!=o){this.rendered.left_=s.left=o}}if(r==uf.BOTTOM_LEFT||r==uf.BOTTOM_CENTER||r==uf.BOTTOM_RIGHT){if(this.rendered.top_!==""){this.rendered.top_=s.top=""}var f=Math.round(i[1]-t[1]-h)+"px";if(this.rendered.bottom_!=f){this.rendered.bottom_=s.bottom=f}}else{if(this.rendered.bottom_!==""){this.rendered.bottom_=s.bottom=""}if(r==uf.CENTER_LEFT||r==uf.CENTER_CENTER||r==uf.CENTER_RIGHT){h-=this.element.offsetHeight/2}var u=Math.round(t[1]+h)+"px";if(this.rendered.top_!=u){this.rendered.top_=s.top=u}}};lf.prototype.getOptions=function(){return this.options};lf.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var vf=function(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.snapToPixel_=t.snapToPixel};vf.prototype.getOpacity=function(){return this.opacity_};vf.prototype.getRotateWithView=function(){return this.rotateWithView_};vf.prototype.getRotation=function(){return this.rotation_};vf.prototype.getScale=function(){return this.scale_};vf.prototype.getSnapToPixel=function(){return this.snapToPixel_};vf.prototype.getAnchor=function(){};vf.prototype.getImage=function(t){};vf.prototype.getHitDetectionImage=function(t){};vf.prototype.getImageState=function(){};vf.prototype.getImageSize=function(){};vf.prototype.getHitDetectionImageSize=function(){};vf.prototype.getOrigin=function(){};vf.prototype.getSize=function(){};vf.prototype.setOpacity=function(t){this.opacity_=t};vf.prototype.setRotateWithView=function(t){this.rotateWithView_=t};vf.prototype.setRotation=function(t){this.rotation_=t};vf.prototype.setScale=function(t){this.scale_=t};vf.prototype.setSnapToPixel=function(t){this.snapToPixel_=t};vf.prototype.listenImageChange=function(t,i){};vf.prototype.load=function(){};vf.prototype.unlistenImageChange=function(t,i){};var cf=function(t){this.checksums_=null;this.canvas_=null;this.hitDetectionCanvas_=null;this.fill_=t.fill!==undefined?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius_=t.radius!==undefined?t.radius:t.radius1;this.radius2_=t.radius2;this.angle_=t.angle!==undefined?t.angle:0;this.stroke_=t.stroke!==undefined?t.stroke:null;this.anchor_=null;this.size_=null;this.imageSize_=null;this.hitDetectionImageSize_=null;this.atlasManager_=t.atlasManager;this.render_(this.atlasManager_);var i=t.snapToPixel!==undefined?t.snapToPixel:true;var s=t.rotateWithView!==undefined?t.rotateWithView:false;vf.call(this,{opacity:1,rotateWithView:s,rotation:t.rotation!==undefined?t.rotation:0,scale:1,snapToPixel:i})};fn.inherits(cf,vf);cf.prototype.clone=function(){var t=new cf({fill:this.getFill()?this.getFill().clone():undefined,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():undefined,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};cf.prototype.getAnchor=function(){return this.anchor_};cf.prototype.getAngle=function(){return this.angle_};cf.prototype.getFill=function(){return this.fill_};cf.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_};cf.prototype.getImage=function(t){return this.canvas_};cf.prototype.getImageSize=function(){return this.imageSize_};cf.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_};cf.prototype.getImageState=function(){return _a.LOADED};cf.prototype.getOrigin=function(){return this.origin_};cf.prototype.getPoints=function(){return this.points_};cf.prototype.getRadius=function(){return this.radius_};cf.prototype.getRadius2=function(){return this.radius2_};cf.prototype.getSize=function(){return this.size_};cf.prototype.getStroke=function(){return this.stroke_};cf.prototype.listenImageChange=function(t,i){};cf.prototype.load=function(){};cf.prototype.unlistenImageChange=function(t,i){};cf.prototype.render_=function(t){var i;var s="";var e="";var r=0;var n=null;var h=0;var a;var o=0;if(this.stroke_){a=this.stroke_.getColor();if(a===null){a=ka.defaultStrokeStyle}a=Ca.asColorLike(a);o=this.stroke_.getWidth();if(o===undefined){o=ka.defaultLineWidth}n=this.stroke_.getLineDash();h=this.stroke_.getLineDashOffset();if(!rh.CANVAS_LINE_DASH){n=null;h=0}e=this.stroke_.getLineJoin();if(e===undefined){e=ka.defaultLineJoin}s=this.stroke_.getLineCap();if(s===undefined){s=ka.defaultLineCap}r=this.stroke_.getMiterLimit();if(r===undefined){r=ka.defaultMiterLimit}}var f=2*(this.radius_+o)+1;var u={strokeStyle:a,strokeWidth:o,size:f,lineCap:s,lineDash:n,lineDashOffset:h,lineJoin:e,miterLimit:r};if(t===undefined){var l=Lh.createCanvasContext2D(f,f);this.canvas_=l.canvas;f=this.canvas_.width;i=f;this.draw_(u,l,0,0);this.createHitDetectionCanvas_(u)}else{f=Math.round(f);var v=!this.fill_;var c;if(v){c=this.drawHitDetectionCanvas_.bind(this,u)}var d=this.getChecksum();var m=t.add(d,f,f,this.draw_.bind(this,u),c);this.canvas_=m.image;this.origin_=[m.offsetX,m.offsetY];i=m.image.width;if(v){this.hitDetectionCanvas_=m.hitImage;this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]}else{this.hitDetectionCanvas_=this.canvas_;this.hitDetectionImageSize_=[i,i]}}this.anchor_=[f/2,f/2];this.size_=[f,f];this.imageSize_=[i,i]};cf.prototype.draw_=function(t,i,s,e){var r,n,h;i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var a=this.points_;if(a===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var o=this.radius2_!==undefined?this.radius2_:this.radius_;if(o!==this.radius_){a=2*a}for(r=0;r<=a;r++){n=r*2*Math.PI/a-Math.PI/2+this.angle_;h=r%2===0?this.radius_:o;i.lineTo(t.size/2+h*Math.cos(n),t.size/2+h*Math.sin(n))}}if(this.fill_){var f=this.fill_.getColor();if(f===null){f=ka.defaultFillStyle}i.fillStyle=Ca.asColorLike(f);i.fill()}if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineCap=t.lineCap;i.lineJoin=t.lineJoin;i.miterLimit=t.miterLimit;i.stroke()}i.closePath()};cf.prototype.createHitDetectionCanvas_=function(t){this.hitDetectionImageSize_=[t.size,t.size];if(this.fill_){this.hitDetectionCanvas_=this.canvas_;return}var i=Lh.createCanvasContext2D(t.size,t.size);this.hitDetectionCanvas_=i.canvas;this.drawHitDetectionCanvas_(t,i,0,0)};cf.prototype.drawHitDetectionCanvas_=function(t,i,s,e){i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var r=this.points_;if(r===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var n=this.radius2_!==undefined?this.radius2_:this.radius_;if(n!==this.radius_){r=2*r}var h,a,o;for(h=0;h<=r;h++){o=h*2*Math.PI/r-Math.PI/2+this.angle_;a=h%2===0?this.radius_:n;i.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}}i.fillStyle=ka.defaultFillStyle;i.fill();if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.stroke()}i.closePath()};cf.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-";var i=this.fill_?this.fill_.getChecksum():"-";var s=!this.checksums_||(t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]);if(s){var e="r"+t+i+(this.radius_!==undefined?this.radius_.toString():"-")+(this.radius2_!==undefined?this.radius2_.toString():"-")+(this.angle_!==undefined?this.angle_.toString():"-")+(this.points_!==undefined?this.points_.toString():"-");this.checksums_=[e,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var df=function(t){var i=t||{};cf.call(this,{points:Infinity,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};fn.inherits(df,cf);df.prototype.clone=function(){var t=new df({fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};df.prototype.setRadius=function(t){this.radius_=t;this.render_(this.atlasManager_)};var mf=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.checksum_=undefined};mf.prototype.clone=function(){var t=this.getColor();return new mf({color:t&&t.slice?t.slice():t||undefined})};mf.prototype.getColor=function(){return this.color_};mf.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};mf.prototype.getChecksum=function(){if(this.checksum_===undefined){if(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient){this.checksum_=fn.getUid(this.color_).toString()}else{this.checksum_="f"+(this.color_?Ea.asString(this.color_):"-")}}return this.checksum_};var pf=function(t){var i=t||{};this.geometry_=null;this.geometryFunction_=pf.defaultGeometryFunction;if(i.geometry!==undefined){this.setGeometry(i.geometry)}this.fill_=i.fill!==undefined?i.fill:null;this.image_=i.image!==undefined?i.image:null;this.renderer_=i.renderer!==undefined?i.renderer:null;this.stroke_=i.stroke!==undefined?i.stroke:null;this.text_=i.text!==undefined?i.text:null;this.zIndex_=i.zIndex};pf.prototype.clone=function(){var t=this.getGeometry();if(t&&t.clone){t=t.clone()}return new pf({geometry:t,fill:this.getFill()?this.getFill().clone():undefined,image:this.getImage()?this.getImage().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,text:this.getText()?this.getText().clone():undefined,zIndex:this.getZIndex()})};pf.prototype.getRenderer=function(){return this.renderer_};pf.prototype.setRenderer=function(t){this.renderer_=t};pf.prototype.getGeometry=function(){return this.geometry_};pf.prototype.getGeometryFunction=function(){return this.geometryFunction_};pf.prototype.getFill=function(){return this.fill_};pf.prototype.setFill=function(t){this.fill_=t};pf.prototype.getImage=function(){return this.image_};pf.prototype.setImage=function(t){this.image_=t};pf.prototype.getStroke=function(){return this.stroke_};pf.prototype.setStroke=function(t){this.stroke_=t};pf.prototype.getText=function(){return this.text_};pf.prototype.setText=function(t){this.text_=t};pf.prototype.getZIndex=function(){return this.zIndex_};pf.prototype.setGeometry=function(t){if(typeof t==="function"){this.geometryFunction_=t}else if(typeof t==="string"){this.geometryFunction_=function(i){return i.get(t)}}else if(!t){this.geometryFunction_=pf.defaultGeometryFunction}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t};pf.prototype.setZIndex=function(t){this.zIndex_=t};pf.createFunction=function(t){var i;if(typeof t==="function"){i=t}else{var s;if(Array.isArray(t)){s=t}else{bn.assert(t instanceof pf,41);s=[t]}i=function(){return s}}return i};pf.default_=null;pf.defaultFunction=function(t,i){if(!pf.default_){var s=new mf({color:"rgba(255,255,255,0.4)"});var e=new Xo({color:"#3399CC",width:1.25});pf.default_=[new pf({image:new df({fill:s,stroke:e,radius:5}),fill:s,stroke:e})]}return pf.default_};pf.createDefaultEditing=function(){var t={};var i=[255,255,255,1];var s=[0,153,255,1];var e=3;t[yn.POLYGON]=[new pf({fill:new mf({color:[255,255,255,.5]})})];t[yn.MULTI_POLYGON]=t[yn.POLYGON];t[yn.LINE_STRING]=[new pf({stroke:new Xo({color:i,width:e+2})}),new pf({stroke:new Xo({color:s,width:e})})];t[yn.MULTI_LINE_STRING]=t[yn.LINE_STRING];t[yn.CIRCLE]=t[yn.POLYGON].concat(t[yn.LINE_STRING]);t[yn.POINT]=[new pf({image:new df({radius:e*2,fill:new mf({color:s}),stroke:new Xo({color:i,width:e/2})}),zIndex:Infinity})];t[yn.MULTI_POINT]=t[yn.POINT];t[yn.GEOMETRY_COLLECTION]=t[yn.POLYGON].concat(t[yn.LINE_STRING],t[yn.POINT]);return t};pf.defaultGeometryFunction=function(t){return t.getGeometry()};var zf=function(t){_n.call(this);this.id_=undefined;this.geometryName_="geometry";this.style_=null;this.styleFunction_=undefined;this.geometryChangeKey_=null;cn.listen(this,_n.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);if(t!==undefined){if(t instanceof jn||!t){var i=t;this.setGeometry(i)}else{var s=t;this.setProperties(s)}}};fn.inherits(zf,_n);zf.prototype.clone=function(){var t=new zf(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();if(i){t.setGeometry(i.clone())}var s=this.getStyle();if(s){t.setStyle(s)}return t};zf.prototype.getGeometry=function(){return this.get(this.geometryName_)};zf.prototype.getId=function(){return this.id_};zf.prototype.getGeometryName=function(){return this.geometryName_};zf.prototype.getStyle=function(){return this.style_};zf.prototype.getStyleFunction=function(){return this.styleFunction_};zf.prototype.handleGeometryChange_=function(){this.changed()};zf.prototype.handleGeometryChanged_=function(){if(this.geometryChangeKey_){cn.unlistenByKey(this.geometryChangeKey_);this.geometryChangeKey_=null}var t=this.getGeometry();if(t){this.geometryChangeKey_=cn.listen(t,zn.CHANGE,this.handleGeometryChange_,this)}this.changed()};zf.prototype.setGeometry=function(t){this.set(this.geometryName_,t)};zf.prototype.setStyle=function(t){this.style_=t;this.styleFunction_=!t?undefined:zf.createStyleFunction(t);this.changed()};zf.prototype.setId=function(t){this.id_=t;this.changed()};zf.prototype.setGeometryName=function(t){cn.unlisten(this,_n.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.geometryName_=t;cn.listen(this,_n.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.handleGeometryChanged_()};zf.createStyleFunction=function(t){var i;if(typeof t==="function"){if(t.length==2){i=function(i){return t(this,i)}}else{i=t}}else{var s;if(Array.isArray(t)){s=t}else{bn.assert(t instanceof pf,41);s=[t]}i=function(){return s}}return i};var Mf={};Mf.createOrUpdate=function(t,i,s,e){if(e!==undefined){e[0]=t;e[1]=i;e[2]=s;return e}else{return[t,i,s]}};Mf.getKeyZXY=function(t,i,s){return t+"/"+i+"/"+s};Mf.getKey=function(t){return Mf.getKeyZXY(t[0],t[1],t[2])};Mf.fromKey=function(t){return t.split("/").map(Number)};Mf.hash=function(t){return(t[1]<<t[0])+t[2]};Mf.quadKey=function(t){var i=t[0];var s=new Array(i);var e=1<<i-1;var r,n;for(r=0;r<i;++r){n=48;if(t[1]&e){n+=1}if(t[2]&e){n+=2}s[r]=String.fromCharCode(n);e>>=1}return s.join("")};Mf.withinExtentAndZ=function(t,i){var s=t[0];var e=t[1];var r=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom()){return false}var n=i.getExtent();var h;if(!n){h=i.getFullTileRange(s)}else{h=i.getTileRangeForExtentAndZ(n,s)}if(!h){return true}else{return h.containsXY(e,r)}};var _f={};_f.createFromTemplate=function(t,i){var s=/\{z\}/g;var e=/\{x\}/g;var r=/\{y\}/g;var n=/\{-y\}/g;return function(h,a,o){if(!h){return undefined}else{return t.replace(s,h[0].toString()).replace(e,h[1].toString()).replace(r,(function(){var t=-h[2]-1;return t.toString()})).replace(n,(function(){var t=h[0];var s=i.getFullTileRange(t);bn.assert(s,55);var e=s.getHeight()+h[2];return e.toString()}))}}};_f.createFromTemplates=function(t,i){var s=t.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=_f.createFromTemplate(t[r],i)}return _f.createFromTileUrlFunctions(e)};_f.createFromTileUrlFunctions=function(t){if(t.length===1){return t[0]}return function(i,s,e){if(!i){return undefined}else{var r=Mf.hash(i);var n=xn.modulo(r,t.length);return t[n](i,s,e)}}};_f.nullTileUrlFunction=function(t,i,s){return undefined};_f.expandUrl=function(t){var i=[];var s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var e=s[1].charCodeAt(0);var r=s[2].charCodeAt(0);var n;for(n=e;n<=r;++n){i.push(t.replace(s[0],String.fromCharCode(n)))}return i}s=s=/\{(\d+)-(\d+)\}/.exec(t);if(s){var h=parseInt(s[2],10);for(var a=parseInt(s[1],10);a<=h;a++){i.push(t.replace(s[0],a.toString()))}return i}i.push(t);return i};var gf=function(t,i,s){pn.call(this);var e=s?s:{};this.tileCoord=t;this.state=i;this.interimTile=null;this.key="";this.transition_=e.transition===undefined?250:e.transition;this.transitionStarts_={}};fn.inherits(gf,pn);gf.prototype.changed=function(){this.dispatchEvent(zn.CHANGE)};gf.prototype.getKey=function(){return this.key+"/"+this.tileCoord};gf.prototype.getInterimTile=function(){if(!this.interimTile){return this}var t=this.interimTile;do{if(t.getState()==wh.LOADED){return t}t=t.interimTile}while(t);return this};gf.prototype.refreshInterimChain=function(){if(!this.interimTile){return}var t=this.interimTile;var i=this;do{if(t.getState()==wh.LOADED){t.interimTile=null;break}else if(t.getState()==wh.LOADING){i=t}else if(t.getState()==wh.IDLE){i.interimTile=t.interimTile}else{i=t}t=i.interimTile}while(t)};gf.prototype.getTileCoord=function(){return this.tileCoord};gf.prototype.getState=function(){return this.state};gf.prototype.setState=function(t){this.state=t;this.changed()};gf.prototype.load=function(){};gf.prototype.getAlpha=function(t,i){if(!this.transition_){return 1}var s=this.transitionStarts_[t];if(!s){s=i;this.transitionStarts_[t]=s}else if(s===-1){return 1}var e=i-s+1e3/60;if(e>=this.transition_){return 1}return Rh.easeIn(e/this.transition_)};gf.prototype.inTransition=function(t){if(!this.transition_){return false}return this.transitionStarts_[t]!==-1};gf.prototype.endTransition=function(t){if(this.transition_){this.transitionStarts_[t]=-1}};var bf=function(t,i,s,e,r,n){gf.call(this,t,i,n);this.crossOrigin_=e;this.src_=s;this.image_=new Image;if(e!==null){this.image_.crossOrigin=e}this.imageListenerKeys_=null;this.tileLoadFunction_=r};fn.inherits(bf,gf);bf.prototype.disposeInternal=function(){if(this.state==wh.LOADING){this.unlistenImage_();this.image_=bf.getBlankImage()}if(this.interimTile){this.interimTile.dispose()}this.state=wh.ABORT;this.changed();gf.prototype.disposeInternal.call(this)};bf.prototype.getImage=function(){return this.image_};bf.prototype.getKey=function(){return this.src_};bf.prototype.handleImageError_=function(){this.state=wh.ERROR;this.unlistenImage_();this.image_=bf.getBlankImage();this.changed()};bf.prototype.handleImageLoad_=function(){if(this.image_.naturalWidth&&this.image_.naturalHeight){this.state=wh.LOADED}else{this.state=wh.EMPTY}this.unlistenImage_();this.changed()};bf.prototype.load=function(){if(this.state==wh.ERROR){this.state=wh.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==wh.IDLE){this.state=wh.LOADING;this.changed();this.imageListenerKeys_=[cn.listenOnce(this.image_,zn.ERROR,this.handleImageError_,this),cn.listenOnce(this.image_,zn.LOAD,this.handleImageLoad_,this)];this.tileLoadFunction_(this,this.src_)}};bf.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(cn.unlistenByKey);this.imageListenerKeys_=null};bf.getBlankImage=function(){var t=Lh.createCanvasContext2D(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas};var xf=function(t){wa.call(this,t)};fn.inherits(xf,wa);xf.prototype.expireCache=function(t){var i,s;while(this.canExpireCache()){i=this.peekLast();s=i.tileCoord[0].toString();if(s in t&&t[s].contains(i.tileCoord)){break}else{this.pop().dispose()}}};xf.prototype.pruneExceptNewestZ=function(){if(this.getCount()===0){return}var t=this.peekFirstKey();var i=Mf.fromKey(t);var s=i[0];this.forEach((function(t){if(t.tileCoord[0]!==s){this.remove(Mf.getKey(t.tileCoord));t.dispose()}}),this)};var yf={};yf.calculateSourceResolution=function(t,i,s,e){var r=Wn.transform(s,i,t);var n=Wn.getPointResolution(i,e,s);var h=i.getMetersPerUnit();if(h!==undefined){n*=h}var a=t.getMetersPerUnit();if(a!==undefined){n/=a}var o=t.getExtent();if(!o||Nn.containsCoordinate(o,r)){var f=Wn.getPointResolution(t,n,r)/n;if(isFinite(f)&&f>0){n/=f}}return n};yf.enlargeClipPoint_=function(t,i,s,e){var r=s-t,n=e-i;var h=Math.sqrt(r*r+n*n);return[Math.round(s+r/h),Math.round(e+n/h)]};yf.render=function(t,i,s,e,r,n,h,a,o,f,u){var l=Lh.createCanvasContext2D(Math.round(s*t),Math.round(s*i));if(o.length===0){return l.canvas}l.scale(s,s);var v=Nn.createEmpty();o.forEach((function(t,i,s){Nn.extend(v,t.extent)}));var c=Nn.getWidth(v);var d=Nn.getHeight(v);var m=Lh.createCanvasContext2D(Math.round(s*c/e),Math.round(s*d/e));var p=s/e;o.forEach((function(t,i,s){var e=t.extent[0]-v[0];var r=-(t.extent[3]-v[3]);var n=Nn.getWidth(t.extent);var h=Nn.getHeight(t.extent);m.drawImage(t.image,f,f,t.image.width-2*f,t.image.height-2*f,e*p,r*p,n*p,h*p)}));var z=Nn.getTopLeft(h);a.getTriangles().forEach((function(t,i,r){var h=t.source,a=t.target;var o=h[0][0],f=h[0][1],u=h[1][0],c=h[1][1],d=h[2][0],p=h[2][1];var M=(a[0][0]-z[0])/n,_=-(a[0][1]-z[1])/n;var g=(a[1][0]-z[0])/n,b=-(a[1][1]-z[1])/n;var x=(a[2][0]-z[0])/n,y=-(a[2][1]-z[1])/n;var w=o,k=f;o=0;f=0;u-=w;c-=k;d-=w;p-=k;var E=[[u,c,0,0,g-M],[d,p,0,0,x-M],[0,0,u,c,b-_],[0,0,d,p,y-_]];var C=xn.solveLinearSystem(E);if(!C){return}l.save();l.beginPath();var N=(M+g+x)/3,I=(_+b+y)/3;var S=yf.enlargeClipPoint_(N,I,M,_);var O=yf.enlargeClipPoint_(N,I,g,b);var T=yf.enlargeClipPoint_(N,I,x,y);l.moveTo(O[0],O[1]);l.lineTo(S[0],S[1]);l.lineTo(T[0],T[1]);l.clip();l.transform(C[0],C[2],C[1],C[3],M,_);l.translate(v[0]-w,v[3]-k);l.scale(e/s,-e/s);l.drawImage(m.canvas,0,0);l.restore()}));if(u){l.save();l.strokeStyle="black";l.lineWidth=1;a.getTriangles().forEach((function(t,i,s){var e=t.target;var r=(e[0][0]-z[0])/n,h=-(e[0][1]-z[1])/n;var a=(e[1][0]-z[0])/n,o=-(e[1][1]-z[1])/n;var f=(e[2][0]-z[0])/n,u=-(e[2][1]-z[1])/n;l.beginPath();l.moveTo(a,o);l.lineTo(r,h);l.lineTo(f,u);l.closePath();l.stroke()}));l.restore()}return l.canvas};var wf=function(t,i,s,e,r){this.sourceProj_=t;this.targetProj_=i;var n={};var h=Wn.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];if(!n[i]){n[i]=h(t)}return n[i]};this.maxSourceExtent_=e;this.errorThresholdSquared_=r*r;this.triangles_=[];this.wrapsXInSource_=false;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!e&&!!this.sourceProj_.getExtent()&&Nn.getWidth(e)==Nn.getWidth(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?Nn.getWidth(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?Nn.getWidth(this.targetProj_.getExtent()):null;var a=Nn.getTopLeft(s);var o=Nn.getTopRight(s);var f=Nn.getBottomRight(s);var u=Nn.getBottomLeft(s);var l=this.transformInv_(a);var v=this.transformInv_(o);var c=this.transformInv_(f);var d=this.transformInv_(u);this.addQuad_(a,o,f,u,l,v,c,d,fn.RASTER_REPROJECTION_MAX_SUBDIVISION);if(this.wrapsXInSource_){var m=Infinity;this.triangles_.forEach((function(t,i,s){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])}));this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];if(i[0][0]-m>this.sourceWorldWidth_/2){i[0][0]-=this.sourceWorldWidth_}if(i[1][0]-m>this.sourceWorldWidth_/2){i[1][0]-=this.sourceWorldWidth_}if(i[2][0]-m>this.sourceWorldWidth_/2){i[2][0]-=this.sourceWorldWidth_}var s=Math.min(i[0][0],i[1][0],i[2][0]);var e=Math.max(i[0][0],i[1][0],i[2][0]);if(e-s<this.sourceWorldWidth_/2){t.source=i}}}),this)}n={}};wf.prototype.addTriangle_=function(t,i,s,e,r,n){this.triangles_.push({source:[e,r,n],target:[t,i,s]})};wf.prototype.addQuad_=function(t,i,s,e,r,n,h,a,o){var f=Nn.boundingExtent([r,n,h,a]);var u=this.sourceWorldWidth_?Nn.getWidth(f)/this.sourceWorldWidth_:null;var l=this.sourceWorldWidth_;var v=this.sourceProj_.canWrapX()&&u>.5&&u<1;var c=false;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=Nn.boundingExtent([t,i,s,e]);var m=Nn.getWidth(d)/this.targetWorldWidth_;c|=m>fn.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}if(!v&&this.sourceProj_.isGlobal()&&u){c|=u>fn.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}}if(!c&&this.maxSourceExtent_){if(!Nn.intersects(f,this.maxSourceExtent_)){return}}if(!c){if(!isFinite(r[0])||!isFinite(r[1])||!isFinite(n[0])||!isFinite(n[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(a[0])||!isFinite(a[1])){if(o>0){c=true}else{return}}}if(o>0){if(!c){var p=[(t[0]+s[0])/2,(t[1]+s[1])/2];var z=this.transformInv_(p);var M;if(v){var _=(xn.modulo(r[0],l)+xn.modulo(h[0],l))/2;M=_-xn.modulo(z[0],l)}else{M=(r[0]+h[0])/2-z[0]}var g=(r[1]+h[1])/2-z[1];var b=M*M+g*g;c=b>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var x=[(i[0]+s[0])/2,(i[1]+s[1])/2];var y=this.transformInv_(x);var w=[(e[0]+t[0])/2,(e[1]+t[1])/2];var k=this.transformInv_(w);this.addQuad_(t,i,x,w,r,n,y,k,o-1);this.addQuad_(w,x,s,e,k,y,h,a,o-1)}else{var E=[(t[0]+i[0])/2,(t[1]+i[1])/2];var C=this.transformInv_(E);var N=[(s[0]+e[0])/2,(s[1]+e[1])/2];var I=this.transformInv_(N);this.addQuad_(t,E,N,e,r,C,I,a,o-1);this.addQuad_(E,i,s,N,C,n,h,I,o-1)}return}}if(v){if(!this.canWrapXInSource_){return}this.wrapsXInSource_=true}this.addTriangle_(t,s,e,r,h,a);this.addTriangle_(t,i,s,r,n,h)};wf.prototype.calculateSourceExtent=function(){var t=Nn.createEmpty();this.triangles_.forEach((function(i,s,e){var r=i.source;Nn.extendCoordinate(t,r[0]);Nn.extendCoordinate(t,r[1]);Nn.extendCoordinate(t,r[2])}));return t};wf.prototype.getTriangles=function(){return this.triangles_};var kf=function(t,i,s,e,r,n,h,a,o,f,u){gf.call(this,r,wh.IDLE);this.renderEdges_=u!==undefined?u:false;this.pixelRatio_=h;this.gutter_=a;this.canvas_=null;this.sourceTileGrid_=i;this.targetTileGrid_=e;this.wrappedTileCoord_=n?n:r;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;var l=e.getTileCoordExtent(this.wrappedTileCoord_);var v=this.targetTileGrid_.getExtent();var c=this.sourceTileGrid_.getExtent();var d=v?Nn.getIntersection(l,v):l;if(Nn.getArea(d)===0){this.state=wh.EMPTY;return}var m=t.getExtent();if(m){if(!c){c=m}else{c=Nn.getIntersection(c,m)}}var p=e.getResolution(this.wrappedTileCoord_[0]);var z=Nn.getCenter(d);var M=yf.calculateSourceResolution(t,s,z,p);if(!isFinite(M)||M<=0){this.state=wh.EMPTY;return}var _=f!==undefined?f:fn.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;this.triangulation_=new wf(t,s,d,c,M*_);if(this.triangulation_.getTriangles().length===0){this.state=wh.EMPTY;return}this.sourceZ_=i.getZForResolution(M);var g=this.triangulation_.calculateSourceExtent();if(c){if(t.canWrapX()){g[1]=xn.clamp(g[1],c[1],c[3]);g[3]=xn.clamp(g[3],c[1],c[3])}else{g=Nn.getIntersection(g,c)}}if(!Nn.getArea(g)){this.state=wh.EMPTY}else{var b=i.getTileRangeForExtentAndZ(g,this.sourceZ_);for(var x=b.minX;x<=b.maxX;x++){for(var y=b.minY;y<=b.maxY;y++){var w=o(this.sourceZ_,x,y,h);if(w){this.sourceTiles_.push(w)}}}if(this.sourceTiles_.length===0){this.state=wh.EMPTY}}};fn.inherits(kf,gf);kf.prototype.disposeInternal=function(){if(this.state==wh.LOADING){this.unlistenSources_()}gf.prototype.disposeInternal.call(this)};kf.prototype.getImage=function(){return this.canvas_};kf.prototype.reproject_=function(){var t=[];this.sourceTiles_.forEach((function(i,s,e){if(i&&i.getState()==wh.LOADED){t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}}),this);this.sourceTiles_.length=0;if(t.length===0){this.state=wh.ERROR}else{var i=this.wrappedTileCoord_[0];var s=this.targetTileGrid_.getTileSize(i);var e=typeof s==="number"?s:s[0];var r=typeof s==="number"?s:s[1];var n=this.targetTileGrid_.getResolution(i);var h=this.sourceTileGrid_.getResolution(this.sourceZ_);var a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=yf.render(e,r,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),n,a,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=wh.LOADED}this.changed()};kf.prototype.load=function(){if(this.state==wh.IDLE){this.state=wh.LOADING;this.changed();var t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((function(i,s,e){var r=i.getState();if(r==wh.IDLE||r==wh.LOADING){t++;var n;n=cn.listen(i,zn.CHANGE,(function(s){var e=i.getState();if(e==wh.LOADED||e==wh.ERROR||e==wh.EMPTY){cn.unlistenByKey(n);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}),this);this.sourcesListenerKeys_.push(n)}}),this);this.sourceTiles_.forEach((function(t,i,s){var e=t.getState();if(e==wh.IDLE){t.load()}}));if(t===0){setTimeout(this.reproject_.bind(this),0)}}};kf.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(cn.unlistenByKey);this.sourcesListenerKeys_=null};var Ef=function(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;bn.assert(kn.isSorted(this.resolutions_,(function(t,i){return i-t}),true),17);var i;if(!t.origins){for(var s=0,e=this.resolutions_.length-1;s<e;++s){if(!i){i=this.resolutions_[s]/this.resolutions_[s+1]}else{if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=undefined;break}}}}this.zoomFactor_=i;this.maxZoom=this.resolutions_.length-1;this.origin_=t.origin!==undefined?t.origin:null;this.origins_=null;if(t.origins!==undefined){this.origins_=t.origins;bn.assert(this.origins_.length==this.resolutions_.length,20)}var r=t.extent;if(r!==undefined&&!this.origin_&&!this.origins_){this.origin_=Nn.getTopLeft(r)}bn.assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;if(t.tileSizes!==undefined){this.tileSizes_=t.tileSizes;bn.assert(this.tileSizes_.length==this.resolutions_.length,19)}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?fn.DEFAULT_TILE_SIZE:null;bn.assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=r!==undefined?r:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];if(t.sizes!==undefined){this.fullTileRanges_=t.sizes.map((function(t,i){var s=new Fa(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));return s}),this)}else if(r){this.calculateTileRanges_(r)}};Ef.tmpTileCoord_=[0,0,0];Ef.prototype.forEachTileCoord=function(t,i,s){var e=this.getTileRangeForExtentAndZ(t,i);for(var r=e.minX,n=e.maxX;r<=n;++r){for(var h=e.minY,a=e.maxY;h<=a;++h){s([i,r,h])}}};Ef.prototype.forEachTileCoordParentTileRange=function(t,i,s,e,r){var n,h,a;var o=null;var f=t[0]-1;if(this.zoomFactor_===2){h=t[1];a=t[2]}else{o=this.getTileCoordExtent(t,r)}while(f>=this.minZoom){if(this.zoomFactor_===2){h=Math.floor(h/2);a=Math.floor(a/2);n=Fa.createOrUpdate(h,h,a,a,e)}else{n=this.getTileRangeForExtentAndZ(o,f,e)}if(i.call(s,f,n)){return true}--f}return false};Ef.prototype.getExtent=function(){return this.extent_};Ef.prototype.getMaxZoom=function(){return this.maxZoom};Ef.prototype.getMinZoom=function(){return this.minZoom};Ef.prototype.getOrigin=function(t){if(this.origin_){return this.origin_}else{return this.origins_[t]}};Ef.prototype.getResolution=function(t){return this.resolutions_[t]};Ef.prototype.getResolutions=function(){return this.resolutions_};Ef.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){var e=t[1]*2;var r=t[2]*2;return Fa.createOrUpdate(e,e+1,r,r+1,i)}var n=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null};Ef.prototype.getTileRangeExtent=function(t,i,s){var e=this.getOrigin(t);var r=this.getResolution(t);var n=Xh.toSize(this.getTileSize(t),this.tmpSize_);var h=e[0]+i.minX*n[0]*r;var a=e[0]+(i.maxX+1)*n[0]*r;var o=e[1]+i.minY*n[1]*r;var f=e[1]+(i.maxY+1)*n[1]*r;return Nn.createOrUpdate(h,o,a,f,s)};Ef.prototype.getTileRangeForExtentAndZ=function(t,i,s){var e=Ef.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,false,e);var r=e[1];var n=e[2];this.getTileCoordForXYAndZ_(t[2],t[3],i,true,e);return Fa.createOrUpdate(r,e[1],n,e[2],s)};Ef.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]);var s=this.getResolution(t[0]);var e=Xh.toSize(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*e[0]*s,i[1]+(t[2]+.5)*e[1]*s]};Ef.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]);var e=this.getResolution(t[0]);var r=Xh.toSize(this.getTileSize(t[0]),this.tmpSize_);var n=s[0]+t[1]*r[0]*e;var h=s[1]+t[2]*r[1]*e;var a=n+r[0]*e;var o=h+r[1]*e;return Nn.createOrUpdate(n,h,a,o,i)};Ef.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,false,s)};Ef.prototype.getTileCoordForXYAndResolution_=function(t,i,s,e,r){var n=this.getZForResolution(s);var h=s/this.getResolution(n);var a=this.getOrigin(n);var o=Xh.toSize(this.getTileSize(n),this.tmpSize_);var f=e?.5:0;var u=e?0:.5;var l=Math.floor((t-a[0])/s+f);var v=Math.floor((i-a[1])/s+u);var c=h*l/o[0];var d=h*v/o[1];if(e){c=Math.ceil(c)-1;d=Math.ceil(d)-1}else{c=Math.floor(c);d=Math.floor(d)}return Mf.createOrUpdate(n,c,d,r)};Ef.prototype.getTileCoordForXYAndZ_=function(t,i,s,e,r){var n=this.getOrigin(s);var h=this.getResolution(s);var a=Xh.toSize(this.getTileSize(s),this.tmpSize_);var o=e?.5:0;var f=e?0:.5;var u=Math.floor((t-n[0])/h+o);var l=Math.floor((i-n[1])/h+f);var v=u/a[0];var c=l/a[1];if(e){v=Math.ceil(v)-1;c=Math.ceil(c)-1}else{v=Math.floor(v);c=Math.floor(c)}return Mf.createOrUpdate(s,v,c,r)};Ef.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,false,s)};Ef.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]};Ef.prototype.getTileSize=function(t){if(this.tileSize_){return this.tileSize_}else{return this.tileSizes_[t]}};Ef.prototype.getFullTileRange=function(t){if(!this.fullTileRanges_){return null}else{return this.fullTileRanges_[t]}};Ef.prototype.getZForResolution=function(t,i){var s=kn.linearFindNearest(this.resolutions_,t,i||0);return xn.clamp(s,this.minZoom,this.maxZoom)};Ef.prototype.calculateTileRanges_=function(t){var i=this.resolutions_.length;var s=new Array(i);for(var e=this.minZoom;e<i;++e){s[e]=this.getTileRangeForExtentAndZ(t,e)}this.fullTileRanges_=s};var Cf={};Cf.getForProjection=function(t){var i=t.getDefaultTileGrid();if(!i){i=Cf.createForProjection(t);t.setDefaultTileGrid(i)}return i};Cf.wrapX=function(t,i,s){var e=i[0];var r=t.getTileCoordCenter(i);var n=Cf.extentFromProjection(s);if(!Nn.containsCoordinate(n,r)){var h=Nn.getWidth(n);var a=Math.ceil((n[0]-r[0])/h);r[0]+=h*a;return t.getTileCoordForCoordAndZ(r,e)}else{return i}};Cf.createForExtent=function(t,i,s,e){var r=e!==undefined?e:En.TOP_LEFT;var n=Cf.resolutionsFromExtent(t,i,s);return new Ef({extent:t,origin:Nn.getCorner(t,r),resolutions:n,tileSize:s})};Cf.createXYZ=function(t){var i={};vn.assign(i,t!==undefined?t:{});if(i.extent===undefined){i.extent=Wn.get("EPSG:3857").getExtent()}i.resolutions=Cf.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize);delete i.maxZoom;return new Ef(i)};Cf.resolutionsFromExtent=function(t,i,s){var e=i!==undefined?i:fn.DEFAULT_MAX_ZOOM;var r=Nn.getHeight(t);var n=Nn.getWidth(t);var h=Xh.toSize(s!==undefined?s:fn.DEFAULT_TILE_SIZE);var a=Math.max(n/h[0],r/h[1]);var o=e+1;var f=new Array(o);for(var u=0;u<o;++u){f[u]=a/Math.pow(2,u)}return f};Cf.createForProjection=function(t,i,s,e){var r=Cf.extentFromProjection(t);return Cf.createForExtent(r,i,s,e)};Cf.extentFromProjection=function(t){t=Wn.get(t);var i=t.getExtent();if(!i){var s=180*Wn.METERS_PER_UNIT[Tn.DEGREES]/t.getMetersPerUnit();i=Nn.createOrUpdate(-s,-s,s,s)}return i};var Nf=function(t){this.html_=t.html;this.tileRanges_=t.tileRanges?t.tileRanges:null};Nf.prototype.getHTML=function(){return this.html_};Nf.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_){return true}var e,r,n,h;for(h in t){if(!(h in this.tileRanges_)){continue}n=t[h];var a;for(e=0,r=this.tileRanges_[h].length;e<r;++e){a=this.tileRanges_[h][e];if(a.intersects(n)){return true}var o=i.getTileRangeForExtentAndZ(Cf.extentFromProjection(s),parseInt(h,10));var f=o.getWidth();if(n.minX<o.minX||n.maxX>o.maxX){if(a.intersects(new Fa(xn.modulo(n.minX,f),xn.modulo(n.maxX,f),n.minY,n.maxY))){return true}if(n.getWidth()>f&&a.intersects(o)){return true}}}}return false};var If=function(t){_n.call(this);this.projection_=Wn.get(t.projection);this.attributions_=null;this.attributions2_=this.adaptAttributions_(t.attributions);this.logo_=t.logo;this.state_=t.state!==undefined?t.state:Wh.READY;this.wrapX_=t.wrapX!==undefined?t.wrapX:false};fn.inherits(If,_n);If.prototype.adaptAttributions_=function(t){if(!t){return null}if(t instanceof Nf){this.attributions_=[t];return function(i){return[t.getHTML()]}}if(Array.isArray(t)){if(t[0]instanceof Nf){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(t){return i}}this.attributions_=t.map((function(t){return new Nf({html:t})}));return function(i){return t}}if(typeof t==="function"){return t}this.attributions_=[new Nf({html:t})];return function(i){return[t]}};If.prototype.forEachFeatureAtCoordinate=fn.nullFunction;If.prototype.getAttributions=function(){return this.attributions_};If.prototype.getAttributions2=function(){return this.attributions2_};If.prototype.getLogo=function(){return this.logo_};If.prototype.getProjection=function(){return this.projection_};If.prototype.getResolutions=function(){};If.prototype.getState=function(){return this.state_};If.prototype.getWrapX=function(){return this.wrapX_};If.prototype.refresh=function(){this.changed()};If.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t);this.changed()};If.prototype.setLogo=function(t){this.logo_=t};If.prototype.setState=function(t){this.state_=t;this.changed()};var Sf=function(t){If.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX});this.opaque_=t.opaque!==undefined?t.opaque:false;this.tilePixelRatio_=t.tilePixelRatio!==undefined?t.tilePixelRatio:1;this.tileGrid=t.tileGrid!==undefined?t.tileGrid:null;this.tileCache=new xf(t.cacheSize);this.tmpSize=[0,0];this.key_="";this.tileOptions={transition:t.transition}};fn.inherits(Sf,If);Sf.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()};Sf.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);if(s){s.expireCache(i)}};Sf.prototype.forEachLoadedTile=function(t,i,s,e){var r=this.getTileCacheForProjection(t);if(!r){return false}var n=true;var h,a,o;for(var f=s.minX;f<=s.maxX;++f){for(var u=s.minY;u<=s.maxY;++u){a=Mf.getKeyZXY(i,f,u);o=false;if(r.containsKey(a)){h=r.get(a);o=h.getState()===wh.LOADED;if(o){o=e(h)!==false}}if(!o){n=false}}}return n};Sf.prototype.getGutter=function(t){return 0};Sf.prototype.getKey=function(){return this.key_};Sf.prototype.setKey=function(t){if(this.key_!==t){this.key_=t;this.changed()}};Sf.prototype.getOpaque=function(t){return this.opaque_};Sf.prototype.getResolutions=function(){return this.tileGrid.getResolutions()};Sf.prototype.getTile=function(t,i,s,e,r){};Sf.prototype.getTileGrid=function(){return this.tileGrid};Sf.prototype.getTileGridForProjection=function(t){if(!this.tileGrid){return Cf.getForProjection(t)}else{return this.tileGrid}};Sf.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();if(i&&!Wn.equivalent(i,t)){return null}else{return this.tileCache}};Sf.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_};Sf.prototype.getTilePixelSize=function(t,i,s){var e=this.getTileGridForProjection(s);var r=this.getTilePixelRatio(i);var n=Xh.toSize(e.getTileSize(t),this.tmpSize);if(r==1){return n}else{return Xh.scale(n,r,this.tmpSize)}};Sf.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=i!==undefined?i:this.getProjection();var e=this.getTileGridForProjection(s);if(this.getWrapX()&&s.isGlobal()){t=Cf.wrapX(e,t,s)}return Mf.withinExtentAndZ(t,e)?t:null};Sf.prototype.refresh=function(){this.tileCache.clear();this.changed()};Sf.prototype.useTile=fn.nullFunction;Sf.Event=function(t,i){mn.call(this,t);this.tile=i};fn.inherits(Sf.Event,mn);var Of={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var Tf=function(t){Sf.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition});this.tileLoadFunction=t.tileLoadFunction;this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.nullTileUrlFunction;this.urls=null;if(t.urls){this.setUrls(t.urls)}else if(t.url){this.setUrl(t.url)}if(t.tileUrlFunction){this.setTileUrlFunction(t.tileUrlFunction)}this.tileLoadingKeys_={}};fn.inherits(Tf,Sf);Tf.prototype.getTileLoadFunction=function(){return this.tileLoadFunction};Tf.prototype.getTileUrlFunction=function(){return this.tileUrlFunction};Tf.prototype.getUrls=function(){return this.urls};Tf.prototype.handleTileChange=function(t){var i=t.target;var s=fn.getUid(i);var e=i.getState();var r;if(e==wh.LOADING){this.tileLoadingKeys_[s]=true;r=Of.TILELOADSTART}else if(s in this.tileLoadingKeys_){delete this.tileLoadingKeys_[s];r=e==wh.ERROR?Of.TILELOADERROR:e==wh.LOADED||e==wh.ABORT?Of.TILELOADEND:undefined}if(r!=undefined){this.dispatchEvent(new Sf.Event(r,i))}};Tf.prototype.setTileLoadFunction=function(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()};Tf.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();if(typeof i!=="undefined"){this.setKey(i)}else{this.changed()}};Tf.prototype.setUrl=function(t){var i=this.urls=_f.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.createFromTemplates(i,this.tileGrid),t)};Tf.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.createFromTemplates(t,this.tileGrid),i)};Tf.prototype.useTile=function(t,i,s){var e=Mf.getKeyZXY(t,i,s);if(this.tileCache.containsKey(e)){this.tileCache.get(e)}};var Af=function(t){Tf.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Af.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition});this.crossOrigin=t.crossOrigin!==undefined?t.crossOrigin:null;this.tileClass=t.tileClass!==undefined?t.tileClass:bf;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=false};fn.inherits(Af,Tf);Af.prototype.canExpireCache=function(){if(!fn.ENABLE_RASTER_REPROJECTION){return Tf.prototype.canExpireCache.call(this)}if(this.tileCache.canExpireCache()){return true}else{for(var t in this.tileCacheForProjection){if(this.tileCacheForProjection[t].canExpireCache()){return true}}}return false};Af.prototype.expireCache=function(t,i){if(!fn.ENABLE_RASTER_REPROJECTION){Tf.prototype.expireCache.call(this,t,i);return}var s=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==s?i:{});for(var e in this.tileCacheForProjection){var r=this.tileCacheForProjection[e];r.expireCache(r==s?i:{})}};Af.prototype.getGutter=function(t){if(fn.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Wn.equivalent(this.getProjection(),t)){return 0}else{return this.getGutterInternal()}};Af.prototype.getGutterInternal=function(){return 0};Af.prototype.getOpaque=function(t){if(fn.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Wn.equivalent(this.getProjection(),t)){return false}else{return Tf.prototype.getOpaque.call(this,t)}};Af.prototype.getTileGridForProjection=function(t){if(!fn.ENABLE_RASTER_REPROJECTION){return Tf.prototype.getTileGridForProjection.call(this,t)}var i=this.getProjection();if(this.tileGrid&&(!i||Wn.equivalent(i,t))){return this.tileGrid}else{var s=fn.getUid(t).toString();if(!(s in this.tileGridForProjection)){this.tileGridForProjection[s]=Cf.getForProjection(t)}return this.tileGridForProjection[s]}};Af.prototype.getTileCacheForProjection=function(t){if(!fn.ENABLE_RASTER_REPROJECTION){return Tf.prototype.getTileCacheForProjection.call(this,t)}var i=this.getProjection();if(!i||Wn.equivalent(i,t)){return this.tileCache}else{var s=fn.getUid(t).toString();if(!(s in this.tileCacheForProjection)){this.tileCacheForProjection[s]=new xf(this.tileCache.highWaterMark)}return this.tileCacheForProjection[s]}};Af.prototype.createTile_=function(t,i,s,e,r,n){var h=[t,i,s];var a=this.getTileCoordForTileUrlFunction(h,r);var o=a?this.tileUrlFunction(a,e,r):undefined;var f=new this.tileClass(h,o!==undefined?wh.IDLE:wh.EMPTY,o!==undefined?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);f.key=n;cn.listen(f,zn.CHANGE,this.handleTileChange,this);return f};Af.prototype.getTile=function(t,i,s,e,r){var n=this.getProjection();if(!fn.ENABLE_RASTER_REPROJECTION||!n||!r||Wn.equivalent(n,r)){return this.getTileInternal(t,i,s,e,n||r)}else{var h=this.getTileCacheForProjection(r);var a=[t,i,s];var o;var f=Mf.getKey(a);if(h.containsKey(f)){o=h.get(f)}var u=this.getKey();if(o&&o.key==u){return o}else{var l=this.getTileGridForProjection(n);var v=this.getTileGridForProjection(r);var c=this.getTileCoordForTileUrlFunction(a,r);var d=new kf(n,l,r,v,a,c,this.getTilePixelRatio(e),this.getGutterInternal(),function(t,i,s,e){return this.getTileInternal(t,i,s,e,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);d.key=u;if(o){d.interimTile=o;d.refreshInterimChain();h.replace(f,d)}else{h.set(f,d)}return d}}};Af.prototype.getTileInternal=function(t,i,s,e,r){var n=null;var h=Mf.getKeyZXY(t,i,s);var a=this.getKey();if(!this.tileCache.containsKey(h)){n=this.createTile_(t,i,s,e,r,a);this.tileCache.set(h,n)}else{n=this.tileCache.get(h);if(n.key!=a){var o=n;n=this.createTile_(t,i,s,e,r,a);if(o.getState()==wh.IDLE){n.interimTile=o.interimTile}else{n.interimTile=o}n.refreshInterimChain();this.tileCache.replace(h,n)}}return n};Af.prototype.setRenderReprojectionEdges=function(t){if(!fn.ENABLE_RASTER_REPROJECTION||this.renderReprojectionEdges_==t){return}this.renderReprojectionEdges_=t;for(var i in this.tileCacheForProjection){this.tileCacheForProjection[i].clear()}this.changed()};Af.prototype.setTileGridForProjection=function(t,i){if(fn.ENABLE_RASTER_REPROJECTION){var s=Wn.get(t);if(s){var e=fn.getUid(s).toString();if(!(e in this.tileGridForProjection)){this.tileGridForProjection[e]=i}}}};Af.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var Rf={KVP:"KVP",REST:"REST"};var Pf=function(t){this.matrixIds_=t.matrixIds;Ef.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};fn.inherits(Pf,Ef);Pf.prototype.getMatrixId=function(t){return this.matrixIds_[t]};Pf.prototype.getMatrixIds=function(){return this.matrixIds_};Pf.createFromCapabilitiesMatrixSet=function(t,i,s){var e=[];var r=[];var n=[];var h=[];var a=[];var o=s!==undefined?s:[];var f="SupportedCRS";var u="TileMatrix";var l="Identifier";var v="ScaleDenominator";var c="TopLeftCorner";var d="TileWidth";var m="TileHeight";var p=t[f];var z=Wn.get(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Wn.get(p);var M=z.getMetersPerUnit();var _=z.getAxisOrientation().substr(0,2)=="ne";t[u].sort((function(t,i){return i[v]-t[v]}));t[u].forEach((function(t,i,s){var f;if(o.length>0){f=kn.find(o,(function(i,s,e){return t[l]==i[u]}))}else{f=true}if(f){r.push(t[l]);var p=t[v]*28e-5/M;var z=t[d];var g=t[m];if(_){n.push([t[c][1],t[c][0]])}else{n.push(t[c])}e.push(p);h.push(z==g?z:[z,g]);a.push([t["MatrixWidth"],-t["MatrixHeight"]])}}));return new Pf({extent:i,origins:n,resolutions:e,matrixIds:r,tileSizes:h,sizes:a})};var Lf={};Lf.appendParams=function(t,i){var s=[];Object.keys(i).forEach((function(t){if(i[t]!==null&&i[t]!==undefined){s.push(t+"="+encodeURIComponent(i[t]))}}));var e=s.join("&");t=t.replace(/[?&]$/,"");t=t.indexOf("?")===-1?t+"?":t+"&";return t+e};var Df=function(t){this.version_=t.version!==undefined?t.version:"1.0.0";this.format_=t.format!==undefined?t.format:"image/jpeg";this.dimensions_=t.dimensions!==undefined?t.dimensions:{};this.layer_=t.layer;this.matrixSet_=t.matrixSet;this.style_=t.style;var i=t.urls;if(i===undefined&&t.url!==undefined){i=_f.expandUrl(t.url)}this.requestEncoding_=t.requestEncoding!==undefined?t.requestEncoding:Rf.KVP;var s=this.requestEncoding_;var e=t.tileGrid;var r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};if(s==Rf.KVP){vn.assign(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_})}var n=this.dimensions_;this.createFromWMTSTemplate_=function(t){t=s==Rf.KVP?Lf.appendParams(t,r):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in r?r[i.toLowerCase()]:t}));return function(i,r,h){if(!i){return undefined}else{var a={TileMatrix:e.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};vn.assign(a,n);var o=t;if(s==Rf.KVP){o=Lf.appendParams(o,a)}else{o=o.replace(/\{(\w+?)\}/g,(function(t,i){return a[i]}))}return o}}};var h=i&&i.length>0?_f.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):_f.nullTileUrlFunction;Af.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:e,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:h,urls:i,wrapX:t.wrapX!==undefined?t.wrapX:false,transition:t.transition});this.setKey(this.getKeyForDimensions_())};fn.inherits(Df,Af);Df.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)};Df.prototype.getDimensions=function(){return this.dimensions_};Df.prototype.getFormat=function(){return this.format_};Df.prototype.getLayer=function(){return this.layer_};Df.prototype.getMatrixSet=function(){return this.matrixSet_};Df.prototype.getRequestEncoding=function(){return this.requestEncoding_};Df.prototype.getStyle=function(){return this.style_};Df.prototype.getVersion=function(){return this.version_};Df.prototype.getKeyForDimensions_=function(){var t=0;var i=[];for(var s in this.dimensions_){i[t++]=s+"-"+this.dimensions_[s]}return i.join("/")};Df.prototype.updateDimensions=function(t){vn.assign(this.dimensions_,t);this.setKey(this.getKeyForDimensions_())};Df.optionsFromCapabilities=function(t,i){var s=t["Contents"]["Layer"];var e=kn.find(s,(function(t,s,e){return t["Identifier"]==i["layer"]}));if(e===null){return null}var r=t["Contents"]["TileMatrixSet"];var n,h,a;if(e["TileMatrixSetLink"].length>1){if("projection"in i){n=kn.findIndex(e["TileMatrixSetLink"],(function(t,s,e){var n=kn.find(r,(function(i){return i["Identifier"]==t["TileMatrixSet"]}));var h=n["SupportedCRS"];var a=Wn.get(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Wn.get(h);var o=Wn.get(i["projection"]);if(a&&o){return Wn.equivalent(a,o)}else{return h==i["projection"]}}))}else{n=kn.findIndex(e["TileMatrixSetLink"],(function(t,s,e){return t["TileMatrixSet"]==i["matrixSet"]}))}}else{n=0}if(n<0){n=0}h=e["TileMatrixSetLink"][n]["TileMatrixSet"];a=e["TileMatrixSetLink"][n]["TileMatrixSetLimits"];var o=e["Format"][0];if("format"in i){o=i["format"]}n=kn.findIndex(e["Style"],(function(t,s,e){if("style"in i){return t["Title"]==i["style"]}else{return t["isDefault"]}}));if(n<0){n=0}var f=e["Style"][n]["Identifier"];var u={};if("Dimension"in e){e["Dimension"].forEach((function(t,i,s){var e=t["Identifier"];var r=t["Default"];if(r===undefined){r=t["Value"][0]}u[e]=r}))}var l=t["Contents"]["TileMatrixSet"];var v=kn.find(l,(function(t,i,s){return t["Identifier"]==h}));var c;var d=v["SupportedCRS"];if(d){c=Wn.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Wn.get(d)}if("projection"in i){var m=Wn.get(i["projection"]);if(m){if(!c||Wn.equivalent(m,c)){c=m}}}var p=e["WGS84BoundingBox"];var z,M;if(p!==undefined){var _=Wn.get("EPSG:4326").getExtent();M=p[0]==_[0]&&p[2]==_[2];z=Wn.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();if(g){if(!Nn.containsExtent(g,z)){z=undefined}}}var b=Pf.createFromCapabilitiesMatrixSet(v,z,a);var x=[];var y=i["requestEncoding"];y=y!==undefined?y:"";if("OperationsMetadata"in t&&"GetTile"in t["OperationsMetadata"]){var w=t["OperationsMetadata"]["GetTile"]["DCP"]["HTTP"]["Get"];for(var k=0,E=w.length;k<E;++k){if(w[k]["Constraint"]){var C=kn.find(w[k]["Constraint"],(function(t){return t["name"]=="GetEncoding"}));var N=C["AllowedValues"]["Value"];if(y===""){y=N[0]}if(y===Rf.KVP){if(kn.includes(N,Rf.KVP)){x.push(w[k]["href"])}}else{break}}else if(w[k]["href"]){y=Rf.KVP;x.push(w[k]["href"])}}}if(x.length===0){y=Rf.REST;e["ResourceURL"].forEach((function(t){if(t["resourceType"]==="tile"){o=t["format"];x.push(t["template"])}}))}return{urls:x,layer:i["layer"],matrixSet:h,format:o,projection:c,requestEncoding:y,tileGrid:b,style:f,dimensions:u,wrapX:M,crossOrigin:i["crossOrigin"]}};var Ff={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var Wf={};Wf.DOCUMENT=document.implementation.createDocument("","",null);Wf.createElementNS=function(t,i){return Wf.DOCUMENT.createElementNS(t,i)};Wf.getAllTextContent=function(t,i){return Wf.getAllTextContent_(t,i,[]).join("")};Wf.getAllTextContent_=function(t,i,s){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE){if(i){s.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""))}else{s.push(t.nodeValue)}}else{var e;for(e=t.firstChild;e;e=e.nextSibling){Wf.getAllTextContent_(e,i,s)}}return s};Wf.isDocument=function(t){return t instanceof Document};Wf.isNode=function(t){return t instanceof Node};Wf.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""};Wf.setAttributeNS=function(t,i,s,e){t.setAttributeNS(i,s,e)};Wf.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")};Wf.makeArrayExtender=function(t,i){return function(s,e){var r=t.call(i,s,e);if(r!==undefined){var n=e[e.length-1];kn.extend(n,r)}}};Wf.makeArrayPusher=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){var n=e[e.length-1];n.push(r)}}};Wf.makeReplacer=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){e[e.length-1]=r}}};Wf.makeObjectPropertyPusher=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;var o;if(a in h){o=h[a]}else{o=h[a]=[]}o.push(n)}}};Wf.makeObjectPropertySetter=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;h[a]=n}}};Wf.makeChildAppender=function(t,i){return function(s,e,r){t.call(i!==undefined?i:this,s,e,r);var n=r[r.length-1];var h=n.node;h.appendChild(s)}};Wf.makeArraySerializer=function(t,i){var s,e;return function(i,r,n){if(s===undefined){s={};var h={};h[i.localName]=t;s[i.namespaceURI]=h;e=Wf.makeSimpleNodeFactory(i.localName)}Wf.serialize(s,e,r,n)}};Wf.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,e,r){var n=e[e.length-1];var h=n.node;var a=s;if(a===undefined){a=r}var o=i;if(i===undefined){o=h.namespaceURI}return Wf.createElementNS(o,a)}};Wf.OBJECT_PROPERTY_NODE_FACTORY=Wf.makeSimpleNodeFactory();Wf.makeSequence=function(t,i){var s=i.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=t[i[r]]}return e};Wf.makeStructureNS=function(t,i,s){var e=s!==undefined?s:{};var r,n;for(r=0,n=t.length;r<n;++r){e[t[r]]=i}return e};Wf.parseNode=function(t,i,s,e){var r;for(r=i.firstElementChild;r;r=r.nextElementSibling){var n=t[r.namespaceURI];if(n!==undefined){var h=n[r.localName];if(h!==undefined){h.call(e,r,s)}}}};Wf.pushParseAndPop=function(t,i,s,e,r){e.push(t);Wf.parseNode(i,s,e,r);return e.pop()};Wf.serialize=function(t,i,s,e,r,n){var h=(r!==undefined?r:s).length;var a,o;for(var f=0;f<h;++f){a=s[f];if(a!==undefined){o=i.call(n,a,e,r!==undefined?r[f]:undefined);if(o!==undefined){t[o.namespaceURI][o.localName].call(n,o,a,e)}}}};Wf.pushSerializeAndPop=function(t,i,s,e,r,n,h){r.push(t);Wf.serialize(i,s,e,r,n,h);return r.pop()};var Gf={};Gf.loadFeaturesXhr=function(t,i,s,e){return function(r,n,h){var a=new XMLHttpRequest;a.open("GET",typeof t==="function"?t(r,n,h):t,true);if(i.getType()==Ff.ARRAY_BUFFER){a.responseType="arraybuffer"}a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=i.getType();var n;if(r==Ff.JSON||r==Ff.TEXT){n=a.responseText}else if(r==Ff.XML){n=a.responseXML;if(!n){n=Wf.parse(a.responseText)}}else if(r==Ff.ARRAY_BUFFER){n=a.response}if(n){s.call(this,i.readFeatures(n,{featureProjection:h}),i.readProjection(n),i.getLastExtent())}else{e.call(this)}}else{e.call(this)}}.bind(this);a.onerror=function(){e.call(this)}.bind(this);a.send()}};Gf.xhr=function(t,i){return Gf.loadFeaturesXhr(t,i,(function(t,i){this.addFeatures(t)}),fn.nullFunction)};var jf={};jf.all=function(t,i){return[[-Infinity,-Infinity,Infinity,Infinity]]};jf.bbox=function(t,i){return[t]};jf.tile=function(t){return function(i,s){var e=t.getZForResolution(s);var r=t.getTileRangeForExtentAndZ(i,e);var n=[];var h=[e,0,0];for(h[1]=r.minX;h[1]<=r.maxX;++h[1]){for(h[2]=r.minY;h[2]<=r.maxY;++h[2]){n.push(t.getTileCoordExtent(h))}}return n}};var Vf={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var Uf=function(t){var i=t||{};If.call(this,{attributions:i.attributions,logo:i.logo,projection:undefined,state:Wh.READY,wrapX:i.wrapX!==undefined?i.wrapX:true});this.loader_=fn.nullFunction;this.format_=i.format;this.overlaps_=i.overlaps==undefined?true:i.overlaps;this.url_=i.url;if(i.loader!==undefined){this.loader_=i.loader}else if(this.url_!==undefined){bn.assert(this.format_,7);this.loader_=Gf.xhr(this.url_,this.format_)}this.strategy_=i.strategy!==undefined?i.strategy:jf.all;var s=i.useSpatialIndex!==undefined?i.useSpatialIndex:true;this.featuresRtree_=s?new Yo:null;this.loadedExtentsRtree_=new Yo;this.nullGeometryFeatures_={};this.idIndex_={};this.undefIdIndex_={};this.featureChangeKeys_={};this.featuresCollection_=null;var e,r;if(i.features instanceof oh){e=i.features;r=e.getArray()}else if(Array.isArray(i.features)){r=i.features}if(!s&&e===undefined){e=new oh(r)}if(r!==undefined){this.addFeaturesInternal(r)}if(e!==undefined){this.bindFeaturesCollection_(e)}};fn.inherits(Uf,If);Uf.prototype.addFeature=function(t){this.addFeatureInternal(t);this.changed()};Uf.prototype.addFeatureInternal=function(t){var i=fn.getUid(t).toString();if(!this.addToIndex_(i,t)){return}this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var e=s.getExtent();if(this.featuresRtree_){this.featuresRtree_.insert(e,t)}}else{this.nullGeometryFeatures_[i]=t}this.dispatchEvent(new Uf.Event(Vf.ADDFEATURE,t))};Uf.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[cn.listen(i,zn.CHANGE,this.handleFeatureChange_,this),cn.listen(i,ln.PROPERTYCHANGE,this.handleFeatureChange_,this)]};Uf.prototype.addToIndex_=function(t,i){var s=true;var e=i.getId();if(e!==undefined){if(!(e.toString()in this.idIndex_)){this.idIndex_[e.toString()]=i}else{s=false}}else{bn.assert(!(t in this.undefIdIndex_),30);this.undefIdIndex_[t]=i}return s};Uf.prototype.addFeatures=function(t){this.addFeaturesInternal(t);this.changed()};Uf.prototype.addFeaturesInternal=function(t){var i,s,e,r;var n=[];var h=[];var a=[];for(s=0,e=t.length;s<e;s++){r=t[s];i=fn.getUid(r).toString();if(this.addToIndex_(i,r)){h.push(r)}}for(s=0,e=h.length;s<e;s++){r=h[s];i=fn.getUid(r).toString();this.setupChangeEvents_(i,r);var o=r.getGeometry();if(o){var f=o.getExtent();n.push(f);a.push(r)}else{this.nullGeometryFeatures_[i]=r}}if(this.featuresRtree_){this.featuresRtree_.load(n,a)}for(s=0,e=h.length;s<e;s++){this.dispatchEvent(new Uf.Event(Vf.ADDFEATURE,h[s]))}};Uf.prototype.bindFeaturesCollection_=function(t){var i=false;cn.listen(this,Vf.ADDFEATURE,(function(s){if(!i){i=true;t.push(s.feature);i=false}}));cn.listen(this,Vf.REMOVEFEATURE,(function(s){if(!i){i=true;t.remove(s.feature);i=false}}));cn.listen(t,ah.ADD,(function(t){if(!i){i=true;this.addFeature(t.element);i=false}}),this);cn.listen(t,ah.REMOVE,(function(t){if(!i){i=true;this.removeFeature(t.element);i=false}}),this);this.featuresCollection_=t};Uf.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_){var s=this.featureChangeKeys_[i];s.forEach(cn.unlistenByKey)}if(!this.featuresCollection_){this.featureChangeKeys_={};this.idIndex_={};this.undefIdIndex_={}}}else{if(this.featuresRtree_){this.featuresRtree_.forEach(this.removeFeatureInternal,this);for(var e in this.nullGeometryFeatures_){this.removeFeatureInternal(this.nullGeometryFeatures_[e])}}}if(this.featuresCollection_){this.featuresCollection_.clear()}if(this.featuresRtree_){this.featuresRtree_.clear()}this.loadedExtentsRtree_.clear();this.nullGeometryFeatures_={};var r=new Uf.Event(Vf.CLEAR);this.dispatchEvent(r);this.changed()};Uf.prototype.forEachFeature=function(t,i){if(this.featuresRtree_){return this.featuresRtree_.forEach(t,i)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(t,i)}};Uf.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){var e=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(e,(function(e){var r=e.getGeometry();if(r.intersectsCoordinate(t)){return i.call(s,e)}else{return undefined}}))};Uf.prototype.forEachFeatureInExtent=function(t,i,s){if(this.featuresRtree_){return this.featuresRtree_.forEachInExtent(t,i,s)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(i,s)}};Uf.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(e){var r=e.getGeometry();if(r.intersectsExtent(t)){var n=i.call(s,e);if(n){return n}}}))};Uf.prototype.getFeaturesCollection=function(){return this.featuresCollection_};Uf.prototype.getFeatures=function(){var t;if(this.featuresCollection_){t=this.featuresCollection_.getArray()}else if(this.featuresRtree_){t=this.featuresRtree_.getAll();if(!vn.isEmpty(this.nullGeometryFeatures_)){kn.extend(t,vn.getValues(this.nullGeometryFeatures_))}}return t};Uf.prototype.getFeaturesAtCoordinate=function(t){var i=[];this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)}));return i};Uf.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)};Uf.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0];var e=t[1];var r=null;var n=[NaN,NaN];var h=Infinity;var a=[-Infinity,-Infinity,Infinity,Infinity];var o=i?i:Sn.TRUE;this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry();var f=h;h=i.closestPointXY(s,e,n,h);if(h<f){r=t;var u=Math.sqrt(h);a[0]=s-u;a[1]=e-u;a[2]=s+u;a[3]=e+u}}}));return r};Uf.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)};Uf.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return i!==undefined?i:null};Uf.prototype.getFormat=function(){return this.format_};Uf.prototype.getOverlaps=function(){return this.overlaps_};Uf.prototype.getResolutions=function(){};Uf.prototype.getUrl=function(){return this.url_};Uf.prototype.handleFeatureChange_=function(t){var i=t.target;var s=fn.getUid(i).toString();var e=i.getGeometry();if(!e){if(!(s in this.nullGeometryFeatures_)){if(this.featuresRtree_){this.featuresRtree_.remove(i)}this.nullGeometryFeatures_[s]=i}}else{var r=e.getExtent();if(s in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[s];if(this.featuresRtree_){this.featuresRtree_.insert(r,i)}}else{if(this.featuresRtree_){this.featuresRtree_.update(r,i)}}}var n=i.getId();if(n!==undefined){var h=n.toString();if(s in this.undefIdIndex_){delete this.undefIdIndex_[s];this.idIndex_[h]=i}else{if(this.idIndex_[h]!==i){this.removeFromIdIndex_(i);this.idIndex_[h]=i}}}else{if(!(s in this.undefIdIndex_)){this.removeFromIdIndex_(i);this.undefIdIndex_[s]=i}}this.changed();this.dispatchEvent(new Uf.Event(Vf.CHANGEFEATURE,i))};Uf.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&vn.isEmpty(this.nullGeometryFeatures_)};Uf.prototype.loadFeatures=function(t,i,s){var e=this.loadedExtentsRtree_;var r=this.strategy_(t,i);var n,h;for(n=0,h=r.length;n<h;++n){var a=r[n];var o=e.forEachInExtent(a,(function(t){return Nn.containsExtent(t.extent,a)}));if(!o){this.loader_.call(this,a,i,s);e.insert(a,{extent:a.slice()})}}};Uf.prototype.removeLoadedExtent=function(t){var i=this.loadedExtentsRtree_;var s;i.forEachInExtent(t,(function(i){if(Nn.equals(i.extent,t)){s=i;return true}}));if(s){i.remove(s)}};Uf.prototype.removeFeature=function(t){var i=fn.getUid(t).toString();if(i in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[i]}else{if(this.featuresRtree_){this.featuresRtree_.remove(t)}}this.removeFeatureInternal(t);this.changed()};Uf.prototype.removeFeatureInternal=function(t){var i=fn.getUid(t).toString();this.featureChangeKeys_[i].forEach(cn.unlistenByKey);delete this.featureChangeKeys_[i];var s=t.getId();if(s!==undefined){delete this.idIndex_[s.toString()]}else{delete this.undefIdIndex_[i]}this.dispatchEvent(new Uf.Event(Vf.REMOVEFEATURE,t))};Uf.prototype.removeFromIdIndex_=function(t){var i=false;for(var s in this.idIndex_){if(this.idIndex_[s]===t){delete this.idIndex_[s];i=true;break}}return i};Uf.prototype.setLoader=function(t){this.loader_=t};Uf.Event=function(t,i){mn.call(this,t);this.feature=i};fn.inherits(Uf.Event,mn);var Xf={};Xf.lineString=function(t,i,s,e,r,n){var h=NaN;var a=NaN;var o=(s-i)/e;if(o===1){h=t[i];a=t[i+1]}else if(o==2){h=(1-r)*t[i]+r*t[i+e];a=(1-r)*t[i+1]+r*t[i+e+1]}else if(o!==0){var f=t[i];var u=t[i+1];var l=0;var v=[0];var c;for(c=i+e;c<s;c+=e){var d=t[c];var m=t[c+1];l+=Math.sqrt((d-f)*(d-f)+(m-u)*(m-u));v.push(l);f=d;u=m}var p=r*l;var z=kn.binarySearch(v,p);if(z<0){var M=(p-v[-z-2])/(v[-z-1]-v[-z-2]);var _=i+(-z-2)*e;h=xn.lerp(t[_],t[_+e],M);a=xn.lerp(t[_+1],t[_+e+1],M)}else{h=t[i+z*e];a=t[i+z*e+1]}}if(n){n[0]=h;n[1]=a;return n}else{return[h,a]}};Xf.lineStringCoordinateAtM=function(t,i,s,e,r,n){if(s==i){return null}var h;if(r<t[i+e-1]){if(n){h=t.slice(i,i+e);h[e-1]=r;return h}else{return null}}else if(t[s-1]<r){if(n){h=t.slice(s-e,s);h[e-1]=r;return h}else{return null}}if(r==t[i+e-1]){return t.slice(i,i+e)}var a=i/e;var o=s/e;while(a<o){var f=a+o>>1;if(r<t[(f+1)*e-1]){o=f}else{a=f+1}}var u=t[a*e-1];if(r==u){return t.slice((a-1)*e,(a-1)*e+e)}var l=t[(a+1)*e-1];var v=(r-u)/(l-u);h=[];var c;for(c=0;c<e-1;++c){h.push(xn.lerp(t[(a-1)*e+c],t[a*e+c],v))}h.push(r);return h};Xf.lineStringsCoordinateAtM=function(t,i,s,e,r,n,h){if(h){return Xf.lineStringCoordinateAtM(t,i,s[s.length-1],e,r,n)}var a;if(r<t[e-1]){if(n){a=t.slice(0,e);a[e-1]=r;return a}else{return null}}if(t[t.length-1]<r){if(n){a=t.slice(t.length-e);a[e-1]=r;return a}else{return null}}var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];if(i==u){continue}if(r<t[i+e-1]){return null}else if(r<=t[u-1]){return Xf.lineStringCoordinateAtM(t,i,u,e,r,false)}i=u}return null};var qf=function(t,i){Vn.call(this);this.flatMidpoint_=null;this.flatMidpointRevision_=-1;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};fn.inherits(qf,Vn);qf.prototype.appendCoordinate=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.slice()}else{kn.extend(this.flatCoordinates,t)}this.changed()};qf.prototype.clone=function(){var t=new qf(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};qf.prototype.closestPointXY=function(t,i,s,e){if(e<Nn.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Xn.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Xn.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,false,t,i,s,e)};qf.prototype.forEachSegment=function(t,i){return Kn.forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};qf.prototype.getCoordinateAtM=function(t,i){if(this.layout!=In.XYM&&this.layout!=In.XYZM){return null}var s=i!==undefined?i:false;return Xf.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,s)};qf.prototype.getCoordinates=function(){return Yn.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};qf.prototype.getCoordinateAt=function(t,i){return Xf.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};qf.prototype.getLength=function(){return no.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};qf.prototype.getFlatMidpoint=function(){if(this.flatMidpointRevision_!=this.getRevision()){this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_);this.flatMidpointRevision_=this.getRevision()}return this.flatMidpoint_};qf.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Bn.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new qf(null);s.setFlatCoordinates(In.XY,i);return s};qf.prototype.getType=function(){return yn.LINE_STRING};qf.prototype.intersectsExtent=function(t){return Qn.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};qf.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=qn.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};qf.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Yf={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var Bf=function(t){var i=t?t:{};var s=vn.assign({},i);delete s.preload;delete s.useInterimTilesOnError;Jh.call(this,s);this.setPreload(i.preload!==undefined?i.preload:0);this.setUseInterimTilesOnError(i.useInterimTilesOnError!==undefined?i.useInterimTilesOnError:true);this.type=ba.TILE};fn.inherits(Bf,Jh);Bf.prototype.getPreload=function(){return this.get(Yf.PRELOAD)};Bf.prototype.setPreload=function(t){this.set(Yf.PRELOAD,t)};Bf.prototype.getUseInterimTilesOnError=function(){return this.get(Yf.USE_INTERIM_TILES_ON_ERROR)};Bf.prototype.setUseInterimTilesOnError=function(t){this.set(Yf.USE_INTERIM_TILES_ON_ERROR,t)};var Hf=function(t){var i=t?t:{};var s=vn.assign({},i);delete s.style;delete s.renderBuffer;delete s.updateWhileAnimating;delete s.updateWhileInteracting;Jh.call(this,s);this.declutter_=i.declutter!==undefined?i.declutter:false;this.renderBuffer_=i.renderBuffer!==undefined?i.renderBuffer:100;this.style_=null;this.styleFunction_=undefined;this.setStyle(i.style);this.updateWhileAnimating_=i.updateWhileAnimating!==undefined?i.updateWhileAnimating:false;this.updateWhileInteracting_=i.updateWhileInteracting!==undefined?i.updateWhileInteracting:false;this.renderMode_=i.renderMode||xa.VECTOR;this.type=ba.VECTOR};fn.inherits(Hf,Jh);Hf.prototype.getDeclutter=function(){return this.declutter_};Hf.prototype.setDeclutter=function(t){this.declutter_=t};Hf.prototype.getRenderBuffer=function(){return this.renderBuffer_};Hf.prototype.getRenderOrder=function(){return this.get(Hf.Property_.RENDER_ORDER)};Hf.prototype.getStyle=function(){return this.style_};Hf.prototype.getStyleFunction=function(){return this.styleFunction_};Hf.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_};Hf.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_};Hf.prototype.setRenderOrder=function(t){this.set(Hf.Property_.RENDER_ORDER,t)};Hf.prototype.setStyle=function(t){this.style_=t!==undefined?t:pf.defaultFunction;this.styleFunction_=t===null?undefined:pf.createFunction(this.style_);this.changed()};Hf.prototype.getRenderMode=function(){return this.renderMode_};Hf.Property_={RENDER_ORDER:"renderOrder"};var Jf={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};var Zf=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV");this.innerElement_.className=s+"-inner";this.element_=document.createElement("DIV");this.element_.className=s+" "+Bh.CLASS_UNSELECTABLE;this.element_.appendChild(this.innerElement_);this.viewState_=null;this.minWidth_=i.minWidth!==undefined?i.minWidth:64;this.renderedVisible_=false;this.renderedWidth_=undefined;this.renderedHTML_="";var e=i.render?i.render:Zf.render;Yh.call(this,{element:this.element_,render:e,target:i.target});cn.listen(this,_n.getChangeEventType(Zf.Property_.UNITS),this.handleUnitsChanged_,this);this.setUnits(i.units||Jf.METRIC)};fn.inherits(Zf,Yh);Zf.LEADING_DIGITS=[1,2,5];Zf.prototype.getUnits=function(){return this.get(Zf.Property_.UNITS)};Zf.render=function(t){var i=t.frameState;if(!i){this.viewState_=null}else{this.viewState_=i.viewState}this.updateElement_()};Zf.prototype.handleUnitsChanged_=function(){this.updateElement_()};Zf.prototype.setUnits=function(t){this.set(Zf.Property_.UNITS,t)};Zf.prototype.updateElement_=function(){var t=this.viewState_;if(!t){if(this.renderedVisible_){this.element_.style.display="none";this.renderedVisible_=false}return}var i=t.center;var s=t.projection;var e=this.getUnits();var r=e==Jf.DEGREES?Tn.DEGREES:Tn.METERS;var n=Wn.getPointResolution(s,t.resolution,i,r);if(e!=Jf.DEGREES){n*=s.getMetersPerUnit()}var h=this.minWidth_*n;var a="";if(e==Jf.DEGREES){var o=Wn.METERS_PER_UNIT[Tn.DEGREES];if(s.getUnits()==Tn.DEGREES){h*=o}else{n/=o}if(h<o/60){a="″";n*=3600}else if(h<o){a="′";n*=60}else{a="°"}}else if(e==Jf.IMPERIAL){if(h<.9144){a="in";n/=.0254}else if(h<1609.344){a="ft";n/=.3048}else{a="mi";n/=1609.344}}else if(e==Jf.NAUTICAL){n/=1852;a="nm"}else if(e==Jf.METRIC){if(h<.001){a="μm";n*=1e6}else if(h<1){a="mm";n*=1e3}else if(h<1e3){a="m"}else{a="km";n/=1e3}}else if(e==Jf.US){if(h<.9144){a="in";n*=39.37}else if(h<1609.344){a="ft";n/=.30480061}else{a="mi";n/=1609.3472}}else{bn.assert(false,33)}var f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));var u,l;while(true){u=Zf.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3));l=Math.round(u/n);if(isNaN(l)){this.element_.style.display="none";this.renderedVisible_=false;return}else if(l>=this.minWidth_){break}++f}var v=u+" "+a;if(this.renderedHTML_!=v){this.innerElement_.innerHTML=v;this.renderedHTML_=v}if(this.renderedWidth_!=l){this.innerElement_.style.width=l+"px";this.renderedWidth_=l}if(!this.renderedVisible_){this.element_.style.display="";this.renderedVisible_=true}};Zf.Property_={UNITS:"units"};var $f={FRACTION:"fraction",PIXELS:"pixels"};var Kf=function(t,i,s,e,r,n){pn.call(this);this.hitDetectionImage_=null;this.image_=!t?new Image:t;if(e!==null){this.image_.crossOrigin=e}this.canvas_=n?document.createElement("CANVAS"):null;this.color_=n;this.imageListenerKeys_=null;this.imageState_=r;this.size_=s;this.src_=i;this.tainting_=false;if(this.imageState_==_a.LOADED){this.determineTainting_()}};fn.inherits(Kf,pn);Kf.get=function(t,i,s,e,r,n){var h=Pa.iconImageCache;var a=h.get(i,e,n);if(!a){a=new Kf(t,i,s,e,r,n);h.set(i,e,n,a)}return a};Kf.prototype.determineTainting_=function(){var t=Lh.createCanvasContext2D(1,1);try{t.drawImage(this.image_,0,0);t.getImageData(0,0,1,1)}catch(t){this.tainting_=true}};Kf.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(zn.CHANGE)};Kf.prototype.handleImageError_=function(){this.imageState_=_a.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()};Kf.prototype.handleImageLoad_=function(){this.imageState_=_a.LOADED;if(this.size_){this.image_.width=this.size_[0];this.image_.height=this.size_[1]}this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.determineTainting_();this.replaceColor_();this.dispatchChangeEvent_()};Kf.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_};Kf.prototype.getImageState=function(){return this.imageState_};Kf.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_){if(this.tainting_){var i=this.size_[0];var s=this.size_[1];var e=Lh.createCanvasContext2D(i,s);e.fillRect(0,0,i,s);this.hitDetectionImage_=e.canvas}else{this.hitDetectionImage_=this.image_}}return this.hitDetectionImage_};Kf.prototype.getSize=function(){return this.size_};Kf.prototype.getSrc=function(){return this.src_};Kf.prototype.load=function(){if(this.imageState_==_a.IDLE){this.imageState_=_a.LOADING;this.imageListenerKeys_=[cn.listenOnce(this.image_,zn.ERROR,this.handleImageError_,this),cn.listenOnce(this.image_,zn.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}};Kf.prototype.replaceColor_=function(){if(this.tainting_||this.color_===null){return}this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);var i=t.getImageData(0,0,this.image_.width,this.image_.height);var s=i.data;var e=this.color_[0]/255;var r=this.color_[1]/255;var n=this.color_[2]/255;for(var h=0,a=s.length;h<a;h+=4){s[h]*=e;s[h+1]*=r;s[h+2]*=n}t.putImageData(i,0,0)};Kf.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(cn.unlistenByKey);this.imageListenerKeys_=null};var Qf={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var tu=function(t){var i=t||{};this.anchor_=i.anchor!==undefined?i.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=i.anchorOrigin!==undefined?i.anchorOrigin:Qf.TOP_LEFT;this.anchorXUnits_=i.anchorXUnits!==undefined?i.anchorXUnits:$f.FRACTION;this.anchorYUnits_=i.anchorYUnits!==undefined?i.anchorYUnits:$f.FRACTION;this.crossOrigin_=i.crossOrigin!==undefined?i.crossOrigin:null;var s=i.img!==undefined?i.img:null;var e=i.imgSize!==undefined?i.imgSize:null;var r=i.src;bn.assert(!(r!==undefined&&s),4);bn.assert(!s||s&&e,5);if((r===undefined||r.length===0)&&s){r=s.src||fn.getUid(s).toString()}bn.assert(r!==undefined&&r.length>0,6);var n=i.src!==undefined?_a.IDLE:_a.LOADED;this.color_=i.color!==undefined?Ea.asArray(i.color):null;this.iconImage_=Kf.get(s,r,e,this.crossOrigin_,n,this.color_);this.offset_=i.offset!==undefined?i.offset:[0,0];this.offsetOrigin_=i.offsetOrigin!==undefined?i.offsetOrigin:Qf.TOP_LEFT;this.origin_=null;this.size_=i.size!==undefined?i.size:null;var h=i.opacity!==undefined?i.opacity:1;var a=i.rotateWithView!==undefined?i.rotateWithView:false;var o=i.rotation!==undefined?i.rotation:0;var f=i.scale!==undefined?i.scale:1;var u=i.snapToPixel!==undefined?i.snapToPixel:true;vf.call(this,{opacity:h,rotation:o,scale:f,snapToPixel:u,rotateWithView:a})};fn.inherits(tu,vf);tu.prototype.clone=function(){return new tu({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||undefined,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:this.size_!==null?this.size_.slice():undefined,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})};tu.prototype.getAnchor=function(){if(this.normalizedAnchor_){return this.normalizedAnchor_}var t=this.anchor_;var i=this.getSize();if(this.anchorXUnits_==$f.FRACTION||this.anchorYUnits_==$f.FRACTION){if(!i){return null}t=this.anchor_.slice();if(this.anchorXUnits_==$f.FRACTION){t[0]*=i[0]}if(this.anchorYUnits_==$f.FRACTION){t[1]*=i[1]}}if(this.anchorOrigin_!=Qf.TOP_LEFT){if(!i){return null}if(t===this.anchor_){t=this.anchor_.slice()}if(this.anchorOrigin_==Qf.TOP_RIGHT||this.anchorOrigin_==Qf.BOTTOM_RIGHT){t[0]=-t[0]+i[0]}if(this.anchorOrigin_==Qf.BOTTOM_LEFT||this.anchorOrigin_==Qf.BOTTOM_RIGHT){t[1]=-t[1]+i[1]}}this.normalizedAnchor_=t;return this.normalizedAnchor_};tu.prototype.getColor=function(){return this.color_};tu.prototype.getImage=function(t){return this.iconImage_.getImage(t)};tu.prototype.getImageSize=function(){return this.iconImage_.getSize()};tu.prototype.getHitDetectionImageSize=function(){return this.getImageSize()};tu.prototype.getImageState=function(){return this.iconImage_.getImageState()};tu.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)};tu.prototype.getOrigin=function(){if(this.origin_){return this.origin_}var t=this.offset_;if(this.offsetOrigin_!=Qf.TOP_LEFT){var i=this.getSize();var s=this.iconImage_.getSize();if(!i||!s){return null}t=t.slice();if(this.offsetOrigin_==Qf.TOP_RIGHT||this.offsetOrigin_==Qf.BOTTOM_RIGHT){t[0]=s[0]-i[0]-t[0]}if(this.offsetOrigin_==Qf.BOTTOM_LEFT||this.offsetOrigin_==Qf.BOTTOM_RIGHT){t[1]=s[1]-i[1]-t[1]}}this.origin_=t;return this.origin_};tu.prototype.getSrc=function(){return this.iconImage_.getSrc()};tu.prototype.getSize=function(){return!this.size_?this.iconImage_.getSize():this.size_};tu.prototype.listenImageChange=function(t,i){return cn.listen(this.iconImage_,zn.CHANGE,t,i)};tu.prototype.load=function(){this.iconImage_.load()};tu.prototype.unlistenImageChange=function(t,i){cn.unlisten(this.iconImage_,zn.CHANGE,t,i)};const iu=`<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const su=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden]{display:none}:host::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;position:relative;width:100%;aspect-ratio:1/1}stzh-olmap[hidden]{display:none}stzh-olmap::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media print{stzh-olmap{page-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap{}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall);right:auto;padding:var(--stzh-space-xxxsmall);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2)}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(var(--stzh-form-input-small-height) + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall));background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 + var(--stzh-space-xxxsmall))}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);margin-left:calc(4.75rem + var(--stzh-space-xxxsmall) + var(--stzh-space-xsmall))}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall) * 3 + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 + var(--stzh-space-xxxsmall))}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-small)}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-large)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';window.proj4=oi;window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const eu={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`};const ru=Object.assign(Object.assign({},eu),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`});const nu=Object.assign(Object.assign({},eu),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`});const hu=class{constructor(s){t(this,s);this.stzhInitialized=i(this,"stzhInitialized",7);this.stzhPostRender=i(this,"stzhPostRender",7);this.stzhMoveStart=i(this,"stzhMoveStart",7);this.stzhMoveEnd=i(this,"stzhMoveEnd",7);this.stzhMovePanZoom=i(this,"stzhMovePanZoom",7);this._layers={};this.geoPositionChanged=false;this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})};this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})};this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"})};this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleInsideModalOpen=()=>{if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}};this.handlePrintButtonClick=()=>{if(!this.printIframe){this.printIframe=document.createElement("iframe");Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"});this.element.append(this.printIframe)}this.printIframe.innerHTML="";const t=this.printIframe.contentWindow;const i=this.constructor.style.replace('@charset "UTF-8";',"");const s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let e;this.map.once("postcompose",(function(t){const i=t.context.canvas;e=i.toDataURL("image/png")}));this.map.renderSync();t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${e}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `;setTimeout((()=>{try{t.document.execCommand("print",false,null)}catch(i){t.print()}}),1e3)};this.localization=undefined;this.hostname="www.ogc.stadt-zuerich.ch";this.scaleControl=true;this.layerControl=true;this.printControl=true;this.locationControl=false;this.layer="streets";this.zoom=7;this.zoomLocation=7;this.center=[2683311,1247082];this.centerMarker=true;this.pinchRotateThreshold=.3;this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333];this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}}}layersWatcher(t){if(typeof t==="string"){this._layers=JSON.parse(t)}else{this._layers=t}}resolutionsWatcher(t){if(typeof t==="string"){this._resolutions=JSON.parse(t)}else{this._resolutions=t}}zoomWatcher(t){if(this.map){this.map.getView().setZoom(t)}}scaleControlWatcher(t){if(!this.map){return}if(t){this.scaleControlOl=new Zf({units:"metric"});this.map.addControl(this.scaleControlOl)}else{if(this.scaleControl){this.map.removeControl(this.scaleControlOl)}this.scaleControlOl=null}}printControlWatcher(t){if(!this.map){return}if(t){this.printControlElement=document.createElement("button");this.printControlElement.className="ol-print";this.printControlElement.ariaLabel=this.localization.printLabel;this.printControlElement.addEventListener("click",this.handlePrintButtonClick);this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>';this.printControlOl=new Yh({element:this.printControlElement});this.map.addControl(this.printControlOl)}else{if(this.printControlOl){this.map.removeControl(this.printControlOl)}this.printControlOl=null;this.printControlElement=null}}layerControlWatcher(t){if(!this.map||this.layersArray.length===1){return}if(t){this.layerControlElement=document.createElement("button");this.layerControlElement.className="ol-layer";this.layerControlElement.addEventListener("click",(()=>{this.layer=this.layer==="streets"?"satellite":"streets"}));this.layerControlImageElement=document.createElement("img");this.layerControlImageElement.className="ol-layer__thumbnail";this.layerControlImageElement.setAttribute("role","presentation");this.layerControlImageElement.setAttribute("alt","");this.layerControlTextElement=document.createElement("span");this.layerControlTextElement.className="ol-layer__text";this.layerControlElement.appendChild(this.layerControlImageElement);this.layerControlElement.appendChild(this.layerControlTextElement);this.layerControlOl=new Yh({element:this.layerControlElement});this.map.addControl(this.layerControlOl)}else{if(this.layerControlOl){this.map.removeControl(this.layerControlOl)}this.layerControlOl=null;this.layerControlElement=null;this.layerControlImageElement=null;this.layerControlTextElement=null}}locationControlWatcher(t){if(!this.map){return}if(t){this.locationControlElement=document.createElement("button");this.locationControlElement.className="ol-location";this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>';this.locationControlElement.addEventListener("click",(()=>{const t=this.geolocation.getTracking();if(t){this.disableLocationTracking().catch()}else{this.enableLocationTracking().catch()}}));this.locationControlOl=new Yh({element:this.locationControlElement});this.geolocation=new hh({projection:this.map.getView().getProjection()});this.positionMarkerOl=new zf;this.positionMarkerOl.setId("position");const t=new pf({image:new tu(nu)});this.positionMarkerOl.setStyle(t);this.positionLayer.getSource().addFeature(this.positionMarkerOl);this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new Jn(t));if(!this.geoPositionChanged&&Nn.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())){this.geoPositionChanged=true;this.map.getView().setCenter(t);if(this.zoomLocation){this.map.getView().setZoom(this.zoomLocation)}}}));this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null);this.setLocationControlState(t)}));this.geolocation.on("error",(()=>{this.setLocationControlState(false)}));this.map.addControl(this.locationControlOl)}else{this.disableLocationTracking().catch();if(this.locationControlOl){this.map.removeControl(this.locationControlOl)}if(this.positionMarkerOl){this.positionLayer.getSource().removeFeature(this.positionMarkerOl)}this.locationControlOl=null;this.locationControlElement=null;this.geolocation=null;this.positionMarkerOl=null}}layerWatcher(t){if(!this.map){return}Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(true);this.map.getView().set("projection",this.projections[t]);const e=this.layersArray.find((([t])=>t!==this.layer));if(e){if(this.layerControlImageElement){this.layerControlImageElement.src=e[1].thumbnailUrl}if(this.layerControlTextElement){let t="";if(i==="streets"){t=this.localization.streetsLayerTitle}else if(i==="satellite"){t=this.localization.satelliteLayerTitle}this.layerControlTextElement.textContent=e[1].title||t}}}else{s.setVisible(false)}}))}centerWatcher(t){if(typeof t==="string"){this._center=JSON.parse(t)}else{this._center=t}if(this.map){this.map.getView().setCenter(this._center);if(this.centerMarkerOl){this.centerMarkerOl.setGeometry(new Jn(this._center))}}}async centerMarkerWatcher(t){if(t){this.centerMarkerOl=await this.addIconMarker(this._center)}else if(this.centerMarkerOl){this.removeIconMarker(this.centerMarkerOl)}}async getMap(){return this.map}async getVisibleMarkers(){const t=this.iconLayer.getSource();const i=t.getFeatures();if(i.length===0){return[]}const s=this.map.getView().calculateExtent(this.map.getSize());return i.filter((t=>{const i=t.getGeometry().getExtent();return Nn.intersects(s,i)}))}async findMarkerById(t){const i=this.iconLayer.getSource().getFeatures();return i.find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new zf({geometry:new Jn(t)});const e=new pf({image:new tu(eu)});s.setProperties({id:i.id});s.setProperties({stzh:i});s.setStyle(e);this.iconLayer.getSource().addFeature(s);return s}async addIconMarkers(t){for(const i of t){await this.addIconMarker(i.coordinates,i.props)}return true}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource();const s=i.getFeatures();if(s.length===0){return}let e=Nn.createEmpty();s.forEach((t=>{Nn.extend(e,t.getGeometry().getExtent())}));this.map.getView().fit(e,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new pf({image:new tu(ru)}))}async setIconMarkerInactive(t){t.setStyle(new pf({image:new tu(eu)}))}async setAllIconMarkersInactive(){const t=this.iconLayer.getSource();const i=t.getFeatures();i.forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=true){this.setLocationControlState(true);if(t){this.geoPositionChanged=false}if(this.geolocation){this.geolocation.setTracking(true)}}async disableLocationTracking(){this.setLocationControlState(false);if(this.geolocation){this.geolocation.setTracking(false)}}async getDistance(t,i){const s=new qf([t,i]);const e=wn.getLength(s,{projection:this.map.getView().getProjection()});return e}handleLoad(){if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}}showPopover(t,i){if(i.imageUri){this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`}let s='<div class="stzh-olmap__popover-content">';if(i.title){s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`}if(i.text){s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`}if(i.data&&i.data.length){i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name=${t.icon}></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`}))}s+="</div>";this.popoverElement.innerHTML+=s;if(i.href){this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`}const e=new lf({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:false,autoPanAnimation:{duration:300}});this.map.addOverlay(e);this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent);const s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});const e=this.map.getTargetElement();if(s){e.style.cursor="pointer"}else{e.style.cursor=""}}))}setLocationControlState(t){if(this.positionLayer){this.positionLayer.setVisible(t)}if(this.locationControlElement){this.locationControlElement.classList.toggle("active",t)}}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel;t.name="plus";const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel;i.name="minus";const s=document.createElement("div");s.innerHTML=iu;const e=document.createElement("span");e.innerText=this.localization.rotateLabel;s.appendChild(e);const r=new ff({controls:Qh.defaults({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new oh([new aa,new ea,new ha,new ma({threshold:this.pinchRotateThreshold}),new pa,new va,new ca,new ua]),loadTilesWhileAnimating:true,loadTilesWhileInteracting:true,target:this.mapElement,logo:false});return r}createRasterLayer(t,i){return new Bf({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){if(!this.projections){this.projections={}}this.projections[t]=new Rn({code:"EPSG:2056",extent:i.extent});return this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:e,matrixSet:r,origin:n}=i;const h=[];for(let t=0;t<this._resolutions.length;t++){h.push(t)}const a=new Pf({origin:n,resolutions:this._resolutions,matrixIds:h,tileSize:[512,512]});return new Df({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:e,matrixSet:r,requestEncoding:"REST"})}createIconLayer(){return new Hf({source:new Uf({})})}initMap(){this.map=this.createMap();this.map.on("postrender",this.handlePostRender);this.map.on("movestart",this.handleMoveStart);this.map.on("moveend",this.handleMoveEnd);this.map.on("pointerdrag",this.handlePointerdrag);this.map.on("change:resolution",this.handleChangeResolution);this.layersArray=Object.entries(this._layers);if(this.layersArray.length>2){throw new Error("There are only two different layers allowed.")}this.rasterLayers={};this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname);this.rasterLayers[t]=this.createRasterLayer(t,i.options);this.map.addLayer(this.rasterLayers[t])}));this.positionLayer=this.createIconLayer();this.positionLayer.setVisible(false);this.map.addLayer(this.positionLayer);this.iconLayer=this.createIconLayer();this.map.addLayer(this.iconLayer);const t=new Ph({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});this.map.setView(t);this.scaleControlWatcher(this.scaleControl);this.printControlWatcher(this.printControl);this.locationControlWatcher(this.locationControl);this.layerControlWatcher(this.layerControl);this.layerWatcher(this.layer);this.centerWatcher(this.center);this.centerMarkerWatcher(this.centerMarker);this.initializeMarkerHover();this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch();this.popoverElement.innerHTML="";this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof Jn){this.setIconMarkerActive(t).catch();const i=t.getProperties();if(i.stzh){this.showPopover(i.geometry.flatCoordinates,i.stzh)}return true}}))}));requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})}))}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers);this.resolutionsWatcher(this.resolutions);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap")}}componentWillUpdate(){if(this.map){this.map.setTarget(null);this.map=null}}componentDidRender(){if(this.map){return}this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");if(t){t.addEventListener("stzhOpen",this.handleInsideModalOpen)}}disconnectedCallback(){if(this.map){this.map.setTarget(null);this.map=null}const t=this.element.closest("stzh-dialog");if(t){t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}}render(){const t={"stzh-olmap":true,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl};return s(e,null,s("div",{class:t},s("div",{ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),s("div",{ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return r(this)}static get watchers(){return{layers:["layersWatcher"],resolutions:["resolutionsWatcher"],zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};hu.style=su;const au=".sc-stzh-overlay-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-overlay-h{display:none}.sc-stzh-overlay-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-overlay-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-overlay-h *.sc-stzh-overlay,.sc-stzh-overlay-h *.sc-stzh-overlay::before,.sc-stzh-overlay-h *.sc-stzh-overlay::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-overlay-h .has-focus.sc-stzh-overlay{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-overlay-h .stzh-fylingfocus-focused.sc-stzh-overlay{outline-style:none !important}.sc-stzh-overlay-h .stzh-fylingfocus-focused.sc-stzh-overlay::-moz-focus-inner{border:0 !important}.sc-stzh-overlay-h{--backdrop-opacity:var(--stzh-overlay-backdrop-opacity);--backdrop-background-color:var(--stzh-overlay-backdrop-background-color)}.stzh-overlay.sc-stzh-overlay{display:none;z-index:var(--stzh-z-index-overlay);position:fixed;top:0;left:0;width:100%;height:100%;flex-direction:column;justify-content:stretch;align-items:stretch}.stzh-overlay__backdrop.sc-stzh-overlay{z-index:1;background-color:var(--backdrop-background-color);opacity:var(--backdrop-opacity);position:absolute;top:0;left:0;width:100%;height:100%}.stzh-overlay__content.sc-stzh-overlay{z-index:2;display:flex;flex-direction:column;align-items:center;position:relative;flex-grow:1;overflow:auto}.stzh-overlay__content-inner.sc-stzh-overlay{margin-top:auto;margin-bottom:auto;outline:none}.stzh-overlay--is-open.sc-stzh-overlay{display:flex}";const ou="stzh-overlay-open";const fu=class{constructor(s){t(this,s);this.stzhOpen=i(this,"stzhOpen",7);this.stzhClose=i(this,"stzhClose",7);this.open=false;this.stay=true;this.a11yLabel=""}async show(){this.open=true;this.stzhOpen.emit({component:"stzh-overlay"})}async hide(){this.open=false;this.stzhClose.emit({component:"stzh-overlay"})}getSiblings(){if(!this.parentElement){return[]}return Array.from(this.parentElement.children).filter((t=>t!==this.element))}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}dialogShown(){document.body.classList.add(ou);this.disableSiblings();if(this.trap){this.trap.activate()}}dialogHidden(){document.body.classList.remove(ou);this.enableSiblings();if(this.trap){this.trap.deactivate()}}connectedCallback(){if(!this.stay&&this.element.parentElement!==document.body){document.body.appendChild(this.element)}this.parentElement=this.element.parentElement}componentDidRender(){this.open?this.dialogShown():this.dialogHidden()}componentDidUpdate(){this.trap.updateContainerElements(this.element)}componentDidLoad(){this.trap=v(this.element,Object.assign({fallbackFocus:this.dialogElement},c()));if(this.open){this.dialogShown()}}disconnectedCallback(){this.dialogHidden()}render(){const t={"stzh-overlay":true,"stzh-overlay--is-open":this.open};return s(e,null,s("div",{class:t},s("div",{class:"stzh-overlay__backdrop"}),s("div",{class:"stzh-overlay__content"},s("div",{class:"stzh-overlay__content-inner",ref:t=>this.dialogElement=t,tabindex:"-1",role:"dialog","aria-label":this.a11yLabel||null,"aria-hidden":this.open?"false":"true"},s("slot",null)))))}get element(){return r(this)}};fu.style=au;export{_ as stzh_checkbox,x as stzh_header,hu as stzh_olmap,fu as stzh_overlay};
|
|
8
|
-
//# sourceMappingURL=p-
|
|
7
|
+
*/var yn=function(t){this.radius=t};yn.prototype.geodesicArea=function(t){return yn.getArea_(t,this.radius)};yn.prototype.haversineDistance=function(t,i){return yn.getDistance_(t,i,this.radius)};yn.prototype.offset=function(t,i,s){var e=xn.toRadians(t[1]);var r=xn.toRadians(t[0]);var n=i/this.radius;var h=Math.asin(Math.sin(e)*Math.cos(n)+Math.cos(e)*Math.sin(n)*Math.cos(s));var a=r+Math.atan2(Math.sin(s)*Math.sin(n)*Math.cos(e),Math.cos(n)-Math.sin(e)*Math.sin(h));return[xn.toDegrees(a),xn.toDegrees(h)]};yn.DEFAULT_RADIUS=6371008.8;yn.getLength=function(t,i){var s=i||{};var e=s.radius||yn.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,l,v;switch(n){case wn.POINT:case wn.MULTI_POINT:{break}case wn.LINE_STRING:case wn.LINEAR_RING:{a=t.getCoordinates();h=yn.getLength_(a,e);break}case wn.MULTI_LINE_STRING:case wn.POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){h+=yn.getLength_(a[f],e)}break}case wn.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];for(l=0,v=o.length;l<v;++l){h+=yn.getLength_(o[l],e)}}break}case wn.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=yn.getLength(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};yn.getLength_=function(t,i){var s=0;for(var e=0,r=t.length;e<r-1;++e){s+=yn.getDistance_(t[e],t[e+1],i)}return s};yn.getDistance_=function(t,i,s){var e=xn.toRadians(t[1]);var r=xn.toRadians(i[1]);var n=(r-e)/2;var h=xn.toRadians(i[0]-t[0])/2;var a=Math.sin(n)*Math.sin(n)+Math.sin(h)*Math.sin(h)*Math.cos(e)*Math.cos(r);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))};yn.getArea=function(t,i){var s=i||{};var e=s.radius||yn.DEFAULT_RADIUS;var r=s.projection||"EPSG:3857";t=t.clone().transform(r,"EPSG:4326");var n=t.getType();var h=0;var a,o,f,u,l,v;switch(n){case wn.POINT:case wn.MULTI_POINT:case wn.LINE_STRING:case wn.MULTI_LINE_STRING:case wn.LINEAR_RING:{break}case wn.POLYGON:{a=t.getCoordinates();h=Math.abs(yn.getArea_(a[0],e));for(f=1,u=a.length;f<u;++f){h-=Math.abs(yn.getArea_(a[f],e))}break}case wn.MULTI_POLYGON:{a=t.getCoordinates();for(f=0,u=a.length;f<u;++f){o=a[f];h+=Math.abs(yn.getArea_(o[0],e));for(l=1,v=o.length;l<v;++l){h-=Math.abs(yn.getArea_(o[l],e))}}break}case wn.GEOMETRY_COLLECTION:{var c=t.getGeometries();for(f=0,u=c.length;f<u;++f){h+=yn.getArea(c[f],i)}break}default:{throw new Error("Unsupported geometry type: "+n)}}return h};yn.getArea_=function(t,i){var s=0,e=t.length;var r=t[e-1][0];var n=t[e-1][1];for(var h=0;h<e;h++){var a=t[h][0],o=t[h][1];s+=xn.toRadians(a-r)*(2+Math.sin(xn.toRadians(n))+Math.sin(xn.toRadians(o)));r=a;n=o}return s*i*i/2};var kn={};kn.binarySearch=function(t,i,s){var e,r;var n=s||kn.numberSafeCompareFunction;var h=0;var a=t.length;var o=false;while(h<a){e=h+(a-h>>1);r=+n(t[e],i);if(r<0){h=e+1}else{a=e;o=!r}}return o?h:~h};kn.numberSafeCompareFunction=function(t,i){return t>i?1:t<i?-1:0};kn.includes=function(t,i){return t.indexOf(i)>=0};kn.linearFindNearest=function(t,i,s){var e=t.length;if(t[0]<=i){return 0}else if(i<=t[e-1]){return e-1}else{var r;if(s>0){for(r=1;r<e;++r){if(t[r]<i){return r-1}}}else if(s<0){for(r=1;r<e;++r){if(t[r]<=i){return r}}}else{for(r=1;r<e;++r){if(t[r]==i){return r}else if(t[r]<i){if(t[r-1]-i<i-t[r]){return r-1}else{return r}}}}return e-1}};kn.reverseSubArray=function(t,i,s){while(i<s){var e=t[i];t[i]=t[s];t[s]=e;++i;--s}};kn.extend=function(t,i){var s;var e=Array.isArray(i)?i:[i];var r=e.length;for(s=0;s<r;s++){t[t.length]=e[s]}};kn.remove=function(t,i){var s=t.indexOf(i);var e=s>-1;if(e){t.splice(s,1)}return e};kn.find=function(t,i){var s=t.length>>>0;var e;for(var r=0;r<s;r++){e=t[r];if(i(e,r,t)){return e}}return null};kn.equals=function(t,i){var s=t.length;if(s!==i.length){return false}for(var e=0;e<s;e++){if(t[e]!==i[e]){return false}}return true};kn.stableSort=function(t,i){var s=t.length;var e=Array(t.length);var r;for(r=0;r<s;r++){e[r]={index:r,value:t[r]}}e.sort((function(t,s){return i(t.value,s.value)||t.index-s.index}));for(r=0;r<t.length;r++){t[r]=e[r].value}};kn.findIndex=function(t,i){var s;var e=!t.every((function(e,r){s=r;return!i(e,r,t)}));return e?s:-1};kn.isSorted=function(t,i,s){var e=i||kn.numberSafeCompareFunction;return t.every((function(i,r){if(r===0){return true}var n=e(t[r-1],i);return!(n>0||s&&n===0)}))};var En={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var Cn={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};var Nn={};Nn.boundingExtent=function(t){var i=Nn.createEmpty();for(var s=0,e=t.length;s<e;++s){Nn.extendCoordinate(i,t[s])}return i};Nn.boundingExtentXYs_=function(t,i,s){var e=Math.min.apply(null,t);var r=Math.min.apply(null,i);var n=Math.max.apply(null,t);var h=Math.max.apply(null,i);return Nn.createOrUpdate(e,r,n,h,s)};Nn.buffer=function(t,i,s){if(s){s[0]=t[0]-i;s[1]=t[1]-i;s[2]=t[2]+i;s[3]=t[3]+i;return s}else{return[t[0]-i,t[1]-i,t[2]+i,t[3]+i]}};Nn.clone=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t.slice()}};Nn.closestSquaredDistanceXY=function(t,i,s){var e,r;if(i<t[0]){e=t[0]-i}else if(t[2]<i){e=i-t[2]}else{e=0}if(s<t[1]){r=t[1]-s}else if(t[3]<s){r=s-t[3]}else{r=0}return e*e+r*r};Nn.containsCoordinate=function(t,i){return Nn.containsXY(t,i[0],i[1])};Nn.containsExtent=function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]};Nn.containsXY=function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]};Nn.coordinateRelationship=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=i[0];var a=i[1];var o=Cn.UNKNOWN;if(h<s){o=o|Cn.LEFT}else if(h>r){o=o|Cn.RIGHT}if(a<e){o=o|Cn.BELOW}else if(a>n){o=o|Cn.ABOVE}if(o===Cn.UNKNOWN){o=Cn.INTERSECTING}return o};Nn.createEmpty=function(){return[Infinity,Infinity,-Infinity,-Infinity]};Nn.createOrUpdate=function(t,i,s,e,r){if(r){r[0]=t;r[1]=i;r[2]=s;r[3]=e;return r}else{return[t,i,s,e]}};Nn.createOrUpdateEmpty=function(t){return Nn.createOrUpdate(Infinity,Infinity,-Infinity,-Infinity,t)};Nn.createOrUpdateFromCoordinate=function(t,i){var s=t[0];var e=t[1];return Nn.createOrUpdate(s,e,s,e,i)};Nn.createOrUpdateFromCoordinates=function(t,i){var s=Nn.createOrUpdateEmpty(i);return Nn.extendCoordinates(s,t)};Nn.createOrUpdateFromFlatCoordinates=function(t,i,s,e,r){var n=Nn.createOrUpdateEmpty(r);return Nn.extendFlatCoordinates(n,t,i,s,e)};Nn.createOrUpdateFromRings=function(t,i){var s=Nn.createOrUpdateEmpty(i);return Nn.extendRings(s,t)};Nn.equals=function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]};Nn.extend=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[2]>t[2]){t[2]=i[2]}if(i[1]<t[1]){t[1]=i[1]}if(i[3]>t[3]){t[3]=i[3]}return t};Nn.extendCoordinate=function(t,i){if(i[0]<t[0]){t[0]=i[0]}if(i[0]>t[2]){t[2]=i[0]}if(i[1]<t[1]){t[1]=i[1]}if(i[1]>t[3]){t[3]=i[1]}};Nn.extendCoordinates=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){Nn.extendCoordinate(t,i[s])}return t};Nn.extendFlatCoordinates=function(t,i,s,e,r){for(;s<e;s+=r){Nn.extendXY(t,i[s],i[s+1])}return t};Nn.extendRings=function(t,i){var s,e;for(s=0,e=i.length;s<e;++s){Nn.extendCoordinates(t,i[s])}return t};Nn.extendXY=function(t,i,s){t[0]=Math.min(t[0],i);t[1]=Math.min(t[1],s);t[2]=Math.max(t[2],i);t[3]=Math.max(t[3],s)};Nn.forEachCorner=function(t,i,s){var e;e=i.call(s,Nn.getBottomLeft(t));if(e){return e}e=i.call(s,Nn.getBottomRight(t));if(e){return e}e=i.call(s,Nn.getTopRight(t));if(e){return e}e=i.call(s,Nn.getTopLeft(t));if(e){return e}return false};Nn.getArea=function(t){var i=0;if(!Nn.isEmpty(t)){i=Nn.getWidth(t)*Nn.getHeight(t)}return i};Nn.getBottomLeft=function(t){return[t[0],t[1]]};Nn.getBottomRight=function(t){return[t[2],t[1]]};Nn.getCenter=function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]};Nn.getCorner=function(t,i){var s;if(i===En.BOTTOM_LEFT){s=Nn.getBottomLeft(t)}else if(i===En.BOTTOM_RIGHT){s=Nn.getBottomRight(t)}else if(i===En.TOP_LEFT){s=Nn.getTopLeft(t)}else if(i===En.TOP_RIGHT){s=Nn.getTopRight(t)}else{bn.assert(false,13)}return s};Nn.getEnlargedArea=function(t,i){var s=Math.min(t[0],i[0]);var e=Math.min(t[1],i[1]);var r=Math.max(t[2],i[2]);var n=Math.max(t[3],i[3]);return(r-s)*(n-e)};Nn.getForViewAndSize=function(t,i,s,e,r){var n=i*e[0]/2;var h=i*e[1]/2;var a=Math.cos(s);var o=Math.sin(s);var f=n*a;var u=n*o;var l=h*a;var v=h*o;var c=t[0];var d=t[1];var m=c-f+v;var p=c-f-v;var z=c+f-v;var M=c+f+v;var _=d-u-l;var g=d-u+l;var b=d+u+l;var x=d+u-l;return Nn.createOrUpdate(Math.min(m,p,z,M),Math.min(_,g,b,x),Math.max(m,p,z,M),Math.max(_,g,b,x),r)};Nn.getHeight=function(t){return t[3]-t[1]};Nn.getIntersectionArea=function(t,i){var s=Nn.getIntersection(t,i);return Nn.getArea(s)};Nn.getIntersection=function(t,i,s){var e=s?s:Nn.createEmpty();if(Nn.intersects(t,i)){if(t[0]>i[0]){e[0]=t[0]}else{e[0]=i[0]}if(t[1]>i[1]){e[1]=t[1]}else{e[1]=i[1]}if(t[2]<i[2]){e[2]=t[2]}else{e[2]=i[2]}if(t[3]<i[3]){e[3]=t[3]}else{e[3]=i[3]}}return e};Nn.getMargin=function(t){return Nn.getWidth(t)+Nn.getHeight(t)};Nn.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]};Nn.getTopLeft=function(t){return[t[0],t[3]]};Nn.getTopRight=function(t){return[t[2],t[3]]};Nn.getWidth=function(t){return t[2]-t[0]};Nn.intersects=function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]};Nn.isEmpty=function(t){return t[2]<t[0]||t[3]<t[1]};Nn.returnOrUpdate=function(t,i){if(i){i[0]=t[0];i[1]=t[1];i[2]=t[2];i[3]=t[3];return i}else{return t}};Nn.scaleFromCenter=function(t,i){var s=(t[2]-t[0])/2*(i-1);var e=(t[3]-t[1])/2*(i-1);t[0]-=s;t[2]+=s;t[1]-=e;t[3]+=e};Nn.intersectsSegment=function(t,i,s){var e=false;var r=Nn.coordinateRelationship(t,i);var n=Nn.coordinateRelationship(t,s);if(r===Cn.INTERSECTING||n===Cn.INTERSECTING){e=true}else{var h=t[0];var a=t[1];var o=t[2];var f=t[3];var u=i[0];var l=i[1];var v=s[0];var c=s[1];var d=(c-l)/(v-u);var m,p;if(!!(n&Cn.ABOVE)&&!(r&Cn.ABOVE)){m=v-(c-f)/d;e=m>=h&&m<=o}if(!e&&!!(n&Cn.RIGHT)&&!(r&Cn.RIGHT)){p=c-(v-o)*d;e=p>=a&&p<=f}if(!e&&!!(n&Cn.BELOW)&&!(r&Cn.BELOW)){m=v-(c-a)/d;e=m>=h&&m<=o}if(!e&&!!(n&Cn.LEFT)&&!(r&Cn.LEFT)){p=c-(v-h)*d;e=p>=a&&p<=f}}return e};Nn.applyTransform=function(t,i,s){var e=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];i(e,e,2);var r=[e[0],e[2],e[4],e[6]];var n=[e[1],e[3],e[5],e[7]];return Nn.boundingExtentXYs_(r,n,s)};var In={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var Sn={};Sn.TRUE=function(){return true};Sn.FALSE=function(){return false};var On={};On.transform2D=function(t,i,s,e,r,n){var h=n?n:[];var a=0;var o;for(o=i;o<s;o+=e){var f=t[o];var u=t[o+1];h[a++]=r[0]*f+r[2]*u+r[4];h[a++]=r[1]*f+r[3]*u+r[5]}if(n&&h.length!=a){h.length=a}return h};On.rotate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=Math.cos(r);var f=Math.sin(r);var u=n[0];var l=n[1];var v=0;for(var c=i;c<s;c+=e){var d=t[c]-u;var m=t[c+1]-l;a[v++]=u+d*o-m*f;a[v++]=l+d*f+m*o;for(var p=c+2;p<c+e;++p){a[v++]=t[p]}}if(h&&a.length!=v){a.length=v}return a};On.scale=function(t,i,s,e,r,n,h,a){var o=a?a:[];var f=h[0];var u=h[1];var l=0;for(var v=i;v<s;v+=e){var c=t[v]-f;var d=t[v+1]-u;o[l++]=f+r*c;o[l++]=u+n*d;for(var m=v+2;m<v+e;++m){o[l++]=t[m]}}if(a&&o.length!=l){o.length=l}return o};On.translate=function(t,i,s,e,r,n,h){var a=h?h:[];var o=0;var f,u;for(f=i;f<s;f+=e){a[o++]=t[f]+r;a[o++]=t[f+1]+n;for(u=f+2;u<f+e;++u){a[o++]=t[u]}}if(h&&a.length!=o){a.length=o}return a};var Tn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};Tn.METERS_PER_UNIT={};Tn.METERS_PER_UNIT[Tn.DEGREES]=2*Math.PI*6370997/360;Tn.METERS_PER_UNIT[Tn.FEET]=.3048;Tn.METERS_PER_UNIT[Tn.METERS]=1;Tn.METERS_PER_UNIT[Tn.USFEET]=1200/3937;var An={};An.cache_=null;An.set=function(t){An.cache_=t};An.get=function(){return An.cache_||window["proj4"]};var Rn=function(t){this.code_=t.code;this.units_=t.units;this.extent_=t.extent!==undefined?t.extent:null;this.worldExtent_=t.worldExtent!==undefined?t.worldExtent:null;this.axisOrientation_=t.axisOrientation!==undefined?t.axisOrientation:"enu";this.global_=t.global!==undefined?t.global:false;this.canWrapX_=!!(this.global_&&this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(fn.ENABLE_PROJ4JS){var s=An.get();if(typeof s=="function"){var e=s.defs(i);if(e!==undefined){if(e.axis!==undefined&&t.axisOrientation===undefined){this.axisOrientation_=e.axis}if(t.metersPerUnit===undefined){this.metersPerUnit_=e.to_meter}if(t.units===undefined){this.units_=e.units}}}}};Rn.prototype.canWrapX=function(){return this.canWrapX_};Rn.prototype.getCode=function(){return this.code_};Rn.prototype.getExtent=function(){return this.extent_};Rn.prototype.getUnits=function(){return this.units_};Rn.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Tn.METERS_PER_UNIT[this.units_]};Rn.prototype.getWorldExtent=function(){return this.worldExtent_};Rn.prototype.getAxisOrientation=function(){return this.axisOrientation_};Rn.prototype.isGlobal=function(){return this.global_};Rn.prototype.setGlobal=function(t){this.global_=t;this.canWrapX_=!!(t&&this.extent_)};Rn.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_};Rn.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t};Rn.prototype.setExtent=function(t){this.extent_=t;this.canWrapX_=!!(this.global_&&t)};Rn.prototype.setWorldExtent=function(t){this.worldExtent_=t};Rn.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t};Rn.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Pn={};Pn.Projection_=function(t){Rn.call(this,{code:t,units:Tn.METERS,extent:Pn.EXTENT,global:true,worldExtent:Pn.WORLD_EXTENT,getPointResolution:function(t,i){return t/xn.cosh(i[1]/Pn.RADIUS)}})};fn.inherits(Pn.Projection_,Rn);Pn.RADIUS=6378137;Pn.HALF_SIZE=Math.PI*Pn.RADIUS;Pn.EXTENT=[-Pn.HALF_SIZE,-Pn.HALF_SIZE,Pn.HALF_SIZE,Pn.HALF_SIZE];Pn.WORLD_EXTENT=[-180,-85,180,85];Pn.PROJECTIONS=[new Pn.Projection_("EPSG:3857"),new Pn.Projection_("EPSG:102100"),new Pn.Projection_("EPSG:102113"),new Pn.Projection_("EPSG:900913"),new Pn.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Pn.Projection_("urn:ogc:def:crs:EPSG::3857"),new Pn.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")];Pn.fromEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}var h=Pn.HALF_SIZE;for(var a=0;a<e;a+=r){n[a]=h*t[a]/180;var o=Pn.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));if(o>h){o=h}else if(o<-h){o=-h}n[a+1]=o}return n};Pn.toEPSG4326=function(t,i,s){var e=t.length,r=s>1?s:2,n=i;if(n===undefined){if(r>2){n=t.slice()}else{n=new Array(e)}}for(var h=0;h<e;h+=r){n[h]=180*t[h]/Pn.HALF_SIZE;n[h+1]=360*Math.atan(Math.exp(t[h+1]/Pn.RADIUS))/Math.PI-90}return n};var Ln={};Ln.Projection_=function(t,i){Rn.call(this,{code:t,units:Tn.DEGREES,extent:Ln.EXTENT,axisOrientation:i,global:true,metersPerUnit:Ln.METERS_PER_UNIT,worldExtent:Ln.EXTENT})};fn.inherits(Ln.Projection_,Rn);Ln.RADIUS=6378137;Ln.EXTENT=[-180,-90,180,90];Ln.METERS_PER_UNIT=Math.PI*Ln.RADIUS/180;Ln.PROJECTIONS=[new Ln.Projection_("CRS:84"),new Ln.Projection_("EPSG:4326","neu"),new Ln.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new Ln.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Ln.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ln.Projection_("urn:ogc:def:crs:OGC:2:84"),new Ln.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ln.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var Dn={};Dn.cache_={};Dn.clear=function(){Dn.cache_={}};Dn.get=function(t){var i=Dn.cache_;return i[t]||null};Dn.add=function(t,i){var s=Dn.cache_;s[t]=i};var Fn={};Fn.cache_={};Fn.clear=function(){Fn.cache_={}};Fn.add=function(t,i,s){var e=t.getCode();var r=i.getCode();var n=Fn.cache_;if(!(e in n)){n[e]={}}n[e][r]=s};Fn.remove=function(t,i){var s=t.getCode();var e=i.getCode();var r=Fn.cache_;var n=r[s][e];delete r[s][e];if(vn.isEmpty(r[s])){delete r[s]}return n};Fn.get=function(t,i){var s;var e=Fn.cache_;if(t in e&&i in e[t]){s=e[t][i]}return s};var Wn={};Wn.METERS_PER_UNIT=Tn.METERS_PER_UNIT;Wn.SPHERE_=new yn(yn.DEFAULT_RADIUS);if(fn.ENABLE_PROJ4JS){Wn.setProj4=function(t){An.set(t)}}Wn.getPointResolution=function(t,i,s,e){t=Wn.get(t);var r;var n=t.getPointResolutionFunc();if(n){r=n(i,s)}else{var h=t.getUnits();if(h==Tn.DEGREES&&!e||e==Tn.DEGREES){r=i}else{var a=Wn.getTransformFromProjections(t,Wn.get("EPSG:4326"));var o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=a(o,o,2);var f=Wn.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4));var u=Wn.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8));r=(f+u)/2;var l=e?Tn.METERS_PER_UNIT[e]:t.getMetersPerUnit();if(l!==undefined){r/=l}}}return r};Wn.addEquivalentProjections=function(t){Wn.addProjections(t);t.forEach((function(i){t.forEach((function(t){if(i!==t){Fn.add(i,t,Wn.cloneTransform)}}))}))};Wn.addEquivalentTransforms=function(t,i,s,e){t.forEach((function(t){i.forEach((function(i){Fn.add(t,i,s);Fn.add(i,t,e)}))}))};Wn.addProjection=function(t){Dn.add(t.getCode(),t);Fn.add(t,t,Wn.cloneTransform)};Wn.addProjections=function(t){t.forEach(Wn.addProjection)};Wn.clearAllProjections=function(){Dn.clear();Fn.clear()};Wn.createProjection=function(t,i){if(!t){return Wn.get(i)}else if(typeof t==="string"){return Wn.get(t)}else{return t}};Wn.addCoordinateTransforms=function(t,i,s,e){var r=Wn.get(t);var n=Wn.get(i);Fn.add(r,n,Wn.createTransformFromCoordinateTransform(s));Fn.add(n,r,Wn.createTransformFromCoordinateTransform(e))};Wn.createTransformFromCoordinateTransform=function(t){return function(i,s,e){var r=i.length;var n=e!==undefined?e:2;var h=s!==undefined?s:new Array(r);var a,o,f;for(o=0;o<r;o+=n){a=t([i[o],i[o+1]]);h[o]=a[0];h[o+1]=a[1];for(f=n-1;f>=2;--f){h[o+f]=i[o+f]}}return h}};Wn.fromLonLat=function(t,i){return Wn.transform(t,"EPSG:4326",i!==undefined?i:"EPSG:3857")};Wn.toLonLat=function(t,i){var s=Wn.transform(t,i!==undefined?i:"EPSG:3857","EPSG:4326");var e=s[0];if(e<-180||e>180){s[0]=xn.modulo(e+180,360)-180}return s};Wn.get=function(t){var i=null;if(t instanceof Rn){i=t}else if(typeof t==="string"){var s=t;i=Dn.get(s);if(fn.ENABLE_PROJ4JS&&!i){var e=An.get();if(typeof e=="function"&&e.defs(s)!==undefined){i=new Rn({code:s});Wn.addProjection(i)}}}return i};Wn.equivalent=function(t,i){if(t===i){return true}var s=t.getUnits()===i.getUnits();if(t.getCode()===i.getCode()){return s}else{var e=Wn.getTransformFromProjections(t,i);return e===Wn.cloneTransform&&s}};Wn.getTransform=function(t,i){var s=Wn.get(t);var e=Wn.get(i);return Wn.getTransformFromProjections(s,e)};Wn.getTransformFromProjections=function(t,i){var s=t.getCode();var e=i.getCode();var r=Fn.get(s,e);if(fn.ENABLE_PROJ4JS&&!r){var n=An.get();if(typeof n=="function"){var h=n.defs(s);var a=n.defs(e);if(h!==undefined&&a!==undefined){if(h===a){Wn.addEquivalentProjections([i,t])}else{var o=n(e,s);Wn.addCoordinateTransforms(i,t,o.forward,o.inverse)}r=Fn.get(s,e)}}}if(!r){r=Wn.identityTransform}return r};Wn.identityTransform=function(t,i,s){if(i!==undefined&&t!==i){for(var e=0,r=t.length;e<r;++e){i[e]=t[e]}t=i}return t};Wn.cloneTransform=function(t,i,s){var e;if(i!==undefined){for(var r=0,n=t.length;r<n;++r){i[r]=t[r]}e=i}else{e=t.slice()}return e};Wn.transform=function(t,i,s){var e=Wn.getTransform(i,s);return e(t,undefined,t.length)};Wn.transformExtent=function(t,i,s){var e=Wn.getTransform(i,s);return Nn.applyTransform(t,e)};Wn.transformWithProjections=function(t,i,s){var e=Wn.getTransformFromProjections(i,s);return e(t)};Wn.addCommon=function(){Wn.addEquivalentProjections(Pn.PROJECTIONS);Wn.addEquivalentProjections(Ln.PROJECTIONS);Wn.addEquivalentTransforms(Ln.PROJECTIONS,Pn.PROJECTIONS,Pn.fromEPSG4326,Pn.toEPSG4326)};Wn.addCommon();var Gn={};Gn.tmp_=new Array(6);Gn.create=function(){return[1,0,0,1,0,0]};Gn.reset=function(t){return Gn.set(t,1,0,0,1,0,0)};Gn.multiply=function(t,i){var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];var o=i[0];var f=i[1];var u=i[2];var l=i[3];var v=i[4];var c=i[5];t[0]=s*o+r*f;t[1]=e*o+n*f;t[2]=s*u+r*l;t[3]=e*u+n*l;t[4]=s*v+r*c+h;t[5]=e*v+n*c+a;return t};Gn.set=function(t,i,s,e,r,n,h){t[0]=i;t[1]=s;t[2]=e;t[3]=r;t[4]=n;t[5]=h;return t};Gn.setFromArray=function(t,i){t[0]=i[0];t[1]=i[1];t[2]=i[2];t[3]=i[3];t[4]=i[4];t[5]=i[5];return t};Gn.apply=function(t,i){var s=i[0],e=i[1];i[0]=t[0]*s+t[2]*e+t[4];i[1]=t[1]*s+t[3]*e+t[5];return i};Gn.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);return Gn.multiply(t,Gn.set(Gn.tmp_,s,e,-e,s,0,0))};Gn.scale=function(t,i,s){return Gn.multiply(t,Gn.set(Gn.tmp_,i,0,0,s,0,0))};Gn.translate=function(t,i,s){return Gn.multiply(t,Gn.set(Gn.tmp_,1,0,0,1,i,s))};Gn.compose=function(t,i,s,e,r,n,h,a){var o=Math.sin(n);var f=Math.cos(n);t[0]=e*f;t[1]=r*o;t[2]=-e*o;t[3]=r*f;t[4]=h*e*f-a*e*o+i;t[5]=h*r*o+a*r*f+s;return t};Gn.invert=function(t){var i=Gn.determinant(t);bn.assert(i!==0,32);var s=t[0];var e=t[1];var r=t[2];var n=t[3];var h=t[4];var a=t[5];t[0]=n/i;t[1]=-e/i;t[2]=-r/i;t[3]=s/i;t[4]=(r*a-n*h)/i;t[5]=-(s*a-e*h)/i;return t};Gn.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var Vn=function(){_n.call(this);this.extent_=Nn.createEmpty();this.extentRevision_=-1;this.simplifiedGeometryCache={};this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.tmpTransform_=Gn.create()};fn.inherits(Vn,_n);Vn.prototype.clone=function(){};Vn.prototype.closestPointXY=function(t,i,s,e){};Vn.prototype.getClosestPoint=function(t,i){var s=i?i:[NaN,NaN];this.closestPointXY(t[0],t[1],s,Infinity);return s};Vn.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])};Vn.prototype.computeExtent=function(t){};Vn.prototype.containsXY=Sn.FALSE;Vn.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){this.extent_=this.computeExtent(this.extent_);this.extentRevision_=this.getRevision()}return Nn.returnOrUpdate(this.extent_,t)};Vn.prototype.rotate=function(t,i){};Vn.prototype.scale=function(t,i,s){};Vn.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)};Vn.prototype.getSimplifiedGeometry=function(t){};Vn.prototype.getType=function(){};Vn.prototype.applyTransform=function(t){};Vn.prototype.intersectsExtent=function(t){};Vn.prototype.translate=function(t,i){};Vn.prototype.transform=function(t,i){var s=this.tmpTransform_;t=Wn.get(t);var e=t.getUnits()==Tn.TILE_PIXELS?function(e,r,n){var h=t.getExtent();var a=t.getWorldExtent();var o=Nn.getHeight(a)/Nn.getHeight(h);Gn.compose(s,a[0],a[3],o,-o,0,0,0);On.transform2D(e,0,e.length,n,s,r);return Wn.getTransform(t,i)(e,r,n)}:Wn.getTransform(t,i);this.applyTransform(e);return this};var jn=function(){Vn.call(this);this.layout=In.XY;this.stride=2;this.flatCoordinates=null};fn.inherits(jn,Vn);jn.getLayoutForStride_=function(t){var i;if(t==2){i=In.XY}else if(t==3){i=In.XYZ}else if(t==4){i=In.XYZM}return i};jn.getStrideForLayout=function(t){var i;if(t==In.XY){i=2}else if(t==In.XYZ||t==In.XYM){i=3}else if(t==In.XYZM){i=4}return i};jn.prototype.containsXY=Sn.FALSE;jn.prototype.computeExtent=function(t){return Nn.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};jn.prototype.getCoordinates=function(){};jn.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)};jn.prototype.getFlatCoordinates=function(){return this.flatCoordinates};jn.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)};jn.prototype.getLayout=function(){return this.layout};jn.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()){vn.clear(this.simplifiedGeometryCache);this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=this.getRevision()}if(t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance){return this}var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i)){return this.simplifiedGeometryCache[i]}else{var s=this.getSimplifiedGeometryInternal(t);var e=s.getFlatCoordinates();if(e.length<this.flatCoordinates.length){this.simplifiedGeometryCache[i]=s;return s}else{this.simplifiedGeometryMaxMinSquaredTolerance=t;return this}}};jn.prototype.getSimplifiedGeometryInternal=function(t){return this};jn.prototype.getStride=function(){return this.stride};jn.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=jn.getStrideForLayout(t);this.layout=t;this.flatCoordinates=i};jn.prototype.setCoordinates=function(t,i){};jn.prototype.setLayout=function(t,i,s){var e;if(t){e=jn.getStrideForLayout(t)}else{var r;for(r=0;r<s;++r){if(i.length===0){this.layout=In.XY;this.stride=2;return}else{i=i[0]}}e=i.length;t=jn.getLayoutForStride_(e)}this.layout=t;this.stride=e};jn.prototype.applyTransform=function(t){if(this.flatCoordinates){t(this.flatCoordinates,this.flatCoordinates,this.stride);this.changed()}};jn.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();On.rotate(s,0,s.length,e,t,i,s);this.changed()}};jn.prototype.scale=function(t,i,s){var e=i;if(e===undefined){e=t}var r=s;if(!r){r=Nn.getCenter(this.getExtent())}var n=this.getFlatCoordinates();if(n){var h=this.getStride();On.scale(n,0,n.length,h,t,e,r,n);this.changed()}};jn.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var e=this.getStride();On.translate(s,0,s.length,e,t,i,s);this.changed()}};jn.transform2D=function(t,i,s){var e=t.getFlatCoordinates();if(!e){return null}else{var r=t.getStride();return On.transform2D(e,0,e.length,r,i,s)}};var Un={};Un.linearRing=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=h*a-n*o;n=a;h=o}return r/2};Un.linearRings=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=Un.linearRing(t,i,a,e);i=a}return r};Un.linearRingss=function(t,i,s,e){var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r+=Un.linearRings(t,i,a,e);i=a[a.length-1]}return r};var Xn={};Xn.point=function(t,i,s,e,r,n,h){var a=t[i];var o=t[i+1];var f=t[s]-a;var u=t[s+1]-o;var l,v;if(f===0&&u===0){v=i}else{var c=((r-a)*f+(n-o)*u)/(f*f+u*u);if(c>1){v=s}else if(c>0){for(l=0;l<e;++l){h[l]=xn.lerp(t[i+l],t[s+l],c)}h.length=e;return}else{v=i}}for(l=0;l<e;++l){h[l]=t[v+l]}h.length=e};Xn.getMaxSquaredDelta=function(t,i,s,e,r){var n=t[i];var h=t[i+1];for(i+=e;i<s;i+=e){var a=t[i];var o=t[i+1];var f=xn.squaredDistance(n,h,a,o);if(f>r){r=f}n=a;h=o}return r};Xn.getsMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=Xn.getMaxSquaredDelta(t,i,a,e,r);i=a}return r};Xn.getssMaxSquaredDelta=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];r=Xn.getsMaxSquaredDelta(t,i,a,e,r);i=a[a.length-1]}return r};Xn.getClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){if(i==s){return f}var l,v;if(r===0){v=xn.squaredDistance(h,a,t[i],t[i+1]);if(v<f){for(l=0;l<e;++l){o[l]=t[i+l]}o.length=e;return v}else{return f}}var c=u?u:[NaN,NaN];var d=i+e;while(d<s){Xn.point(t,d-e,d,e,h,a,c);v=xn.squaredDistance(h,a,c[0],c[1]);if(v<f){f=v;for(l=0;l<e;++l){o[l]=c[l]}o.length=e;d+=e}else{d+=e*Math.max((Math.sqrt(v)-Math.sqrt(f))/r|0,1)}}if(n){Xn.point(t,s-e,i,e,h,a,c);v=xn.squaredDistance(h,a,c[0],c[1]);if(v<f){f=v;for(l=0;l<e;++l){o[l]=c[l]}o.length=e}}return f};Xn.getsClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var l=u?u:[NaN,NaN];var v,c;for(v=0,c=s.length;v<c;++v){var d=s[v];f=Xn.getClosestPoint(t,i,d,e,r,n,h,a,o,f,l);i=d}return f};Xn.getssClosestPoint=function(t,i,s,e,r,n,h,a,o,f,u){var l=u?u:[NaN,NaN];var v,c;for(v=0,c=s.length;v<c;++v){var d=s[v];f=Xn.getsClosestPoint(t,i,d,e,r,n,h,a,o,f,l);i=d[d.length-1]}return f};var qn={};qn.coordinate=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){t[i++]=s[r]}return i};qn.coordinates=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){var h=s[r];var a;for(a=0;a<e;++a){t[i++]=h[a]}}return i};qn.coordinatess=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=qn.coordinates(t,i,s[a],e);n[h++]=f;i=f}n.length=h;return n};qn.coordinatesss=function(t,i,s,e,r){var n=r?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=qn.coordinatess(t,i,s[a],e,n[h]);n[h++]=f;i=f[f.length-1]}n.length=h;return n};var Yn={};Yn.coordinates=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a;for(a=i;a<s;a+=e){n[h++]=t.slice(a,a+e)}n.length=h;return n};Yn.coordinatess=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=Yn.coordinates(t,i,f,e,n[h]);i=f}n.length=h;return n};Yn.coordinatesss=function(t,i,s,e,r){var n=r!==undefined?r:[];var h=0;var a,o;for(a=0,o=s.length;a<o;++a){var f=s[a];n[h++]=Yn.coordinatess(t,i,f,e,n[h]);i=f[f.length-1]}n.length=h;return n};var Bn={};Bn.lineString=function(t,i,s,e,r,n,h){var a=h!==undefined?h:[];if(!n){s=Bn.radialDistance(t,i,s,e,r,a,0);t=a;i=0;e=2}a.length=Bn.douglasPeucker(t,i,s,e,r,a,0);return a};Bn.douglasPeucker=function(t,i,s,e,r,n,h){var a=(s-i)/e;if(a<3){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var o=new Array(a);o[0]=1;o[a-1]=1;var f=[i,s-e];var u=0;var l;while(f.length>0){var v=f.pop();var c=f.pop();var d=0;var m=t[c];var p=t[c+1];var z=t[v];var M=t[v+1];for(l=c+e;l<v;l+=e){var _=t[l];var g=t[l+1];var b=xn.squaredSegmentDistance(_,g,m,p,z,M);if(b>d){u=l;d=b}}if(d>r){o[(u-i)/e]=1;if(c+e<u){f.push(c,u)}if(u+e<v){f.push(u,v)}}}for(l=0;l<a;++l){if(o[l]){n[h++]=t[i+l*e];n[h++]=t[i+l*e+1]}}return h};Bn.douglasPeuckers=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=Bn.douglasPeucker(t,i,u,e,r,n,h);a.push(h);i=u}return h};Bn.douglasPeuckerss=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var l=[];h=Bn.douglasPeuckers(t,i,u,e,r,n,h,l);a.push(l);i=u[u.length-1]}return h};Bn.radialDistance=function(t,i,s,e,r,n,h){if(s<=i+e){for(;i<s;i+=e){n[h++]=t[i];n[h++]=t[i+1]}return h}var a=t[i];var o=t[i+1];n[h++]=a;n[h++]=o;var f=a;var u=o;for(i+=e;i<s;i+=e){f=t[i];u=t[i+1];if(xn.squaredDistance(a,o,f,u)>r){n[h++]=f;n[h++]=u;a=f;o=u}}if(f!=a||u!=o){n[h++]=f;n[h++]=u}return h};Bn.snap=function(t,i){return i*Math.round(t/i)};Bn.quantize=function(t,i,s,e,r,n,h){if(i==s){return h}var a=Bn.snap(t[i],r);var o=Bn.snap(t[i+1],r);i+=e;n[h++]=a;n[h++]=o;var f,u;do{f=Bn.snap(t[i],r);u=Bn.snap(t[i+1],r);i+=e;if(i==s){n[h++]=f;n[h++]=u;return h}}while(f==a&&u==o);while(i<s){var l,v;l=Bn.snap(t[i],r);v=Bn.snap(t[i+1],r);i+=e;if(l==f&&v==u){continue}var c=f-a;var d=u-o;var m=l-a;var p=v-o;if(c*p==d*m&&(c<0&&m<c||c==m||c>0&&m>c)&&(d<0&&p<d||d==p||d>0&&p>d)){f=l;u=v;continue}n[h++]=f;n[h++]=u;a=f;o=u;f=l;u=v}n[h++]=f;n[h++]=u;return h};Bn.quantizes=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];h=Bn.quantize(t,i,u,e,r,n,h);a.push(h);i=u}return h};Bn.quantizess=function(t,i,s,e,r,n,h,a){var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];var l=[];h=Bn.quantizes(t,i,u,e,r,n,h,l);a.push(l);i=u[u.length-1]}return h};var Hn=function(t,i){jn.call(this);this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};fn.inherits(Hn,jn);Hn.prototype.clone=function(){var t=new Hn(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};Hn.prototype.closestPointXY=function(t,i,s,e){if(e<Nn.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Xn.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Xn.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,i,s,e)};Hn.prototype.getArea=function(){return Un.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};Hn.prototype.getCoordinates=function(){return Yn.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};Hn.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Bn.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new Hn(null);s.setFlatCoordinates(In.XY,i);return s};Hn.prototype.getType=function(){return wn.LINEAR_RING};Hn.prototype.intersectsExtent=function(t){};Hn.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=qn.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};Hn.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Jn=function(t,i){jn.call(this);this.setCoordinates(t,i)};fn.inherits(Jn,jn);Jn.prototype.clone=function(){var t=new Jn(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};Jn.prototype.closestPointXY=function(t,i,s,e){var r=this.flatCoordinates;var n=xn.squaredDistance(t,i,r[0],r[1]);if(n<e){var h=this.stride;var a;for(a=0;a<h;++a){s[a]=r[a]}s.length=h;return n}else{return e}};Jn.prototype.getCoordinates=function(){return!this.flatCoordinates?[]:this.flatCoordinates.slice()};Jn.prototype.computeExtent=function(t){return Nn.createOrUpdateFromCoordinate(this.flatCoordinates,t)};Jn.prototype.getType=function(){return wn.POINT};Jn.prototype.intersectsExtent=function(t){return Nn.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])};Jn.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null)}else{this.setLayout(i,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=qn.coordinate(this.flatCoordinates,0,t,this.stride);this.changed()}};Jn.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Zn={};Zn.linearRingContainsExtent=function(t,i,s,e,r){var n=Nn.forEachCorner(r,(function(r){return!Zn.linearRingContainsXY(t,i,s,e,r[0],r[1])}));return!n};Zn.linearRingContainsXY=function(t,i,s,e,r,n){var h=0;var a=t[s-e];var o=t[s-e+1];for(;i<s;i+=e){var f=t[i];var u=t[i+1];if(o<=n){if(u>n&&(f-a)*(n-o)-(r-a)*(u-o)>0){h++}}else if(u<=n&&(f-a)*(n-o)-(r-a)*(u-o)<0){h--}a=f;o=u}return h!==0};Zn.linearRingsContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}if(!Zn.linearRingContainsXY(t,i,s[0],e,r,n)){return false}var h,a;for(h=1,a=s.length;h<a;++h){if(Zn.linearRingContainsXY(t,s[h-1],s[h],e,r,n)){return false}}return true};Zn.linearRingssContainsXY=function(t,i,s,e,r,n){if(s.length===0){return false}var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];if(Zn.linearRingsContainsXY(t,i,o,e,r,n)){return true}i=o[o.length-1]}return false};var $n={};$n.linearRings=function(t,i,s,e,r,n,h){var a,o,f,u,l,v,c;var d=r[n+1];var m=[];for(var p=0,z=s.length;p<z;++p){var M=s[p];u=t[M-e];v=t[M-e+1];for(a=i;a<M;a+=e){l=t[a];c=t[a+1];if(d<=v&&c<=d||v<=d&&d<=c){f=(d-v)/(c-v)*(l-u)+u;m.push(f)}u=l;v=c}}var _=NaN;var g=-Infinity;m.sort(kn.numberSafeCompareFunction);u=m[0];for(a=1,o=m.length;a<o;++a){l=m[a];var b=Math.abs(l-u);if(b>g){f=(u+l)/2;if(Zn.linearRingsContainsXY(t,i,s,e,f,d)){_=f;g=b}}u=l}if(isNaN(_)){_=r[n]}if(h){h.push(_,d,g);return h}else{return[_,d,g]}};$n.linearRingss=function(t,i,s,e,r){var n=[];var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];n=$n.linearRings(t,i,o,e,r,2*h,n);i=o[o.length-1]}return n};var Kn={};Kn.forEach=function(t,i,s,e,r,n){var h=[t[i],t[i+1]];var a=[];var o;for(;i+e<s;i+=e){a[0]=t[i+e];a[1]=t[i+e+1];o=r.call(n,h,a);if(o){return o}h[0]=a[0];h[1]=a[1]}return false};var Qn={};Qn.lineString=function(t,i,s,e,r){var n=Nn.extendFlatCoordinates(Nn.createEmpty(),t,i,s,e);if(!Nn.intersects(r,n)){return false}if(Nn.containsExtent(r,n)){return true}if(n[0]>=r[0]&&n[2]<=r[2]){return true}if(n[1]>=r[1]&&n[3]<=r[3]){return true}return Kn.forEach(t,i,s,e,(function(t,i){return Nn.intersectsSegment(r,t,i)}))};Qn.lineStrings=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(Qn.lineString(t,i,s[n],e,r)){return true}i=s[n]}return false};Qn.linearRing=function(t,i,s,e,r){if(Qn.lineString(t,i,s,e,r)){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[0],r[1])){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[0],r[3])){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[2],r[1])){return true}if(Zn.linearRingContainsXY(t,i,s,e,r[2],r[3])){return true}return false};Qn.linearRings=function(t,i,s,e,r){if(!Qn.linearRing(t,i,s[0],e,r)){return false}if(s.length===1){return true}var n,h;for(n=1,h=s.length;n<h;++n){if(Zn.linearRingContainsExtent(t,s[n-1],s[n],e,r)){return false}}return true};Qn.linearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];if(Qn.linearRings(t,i,a,e,r)){return true}i=a[a.length-1]}return false};var th={};th.coordinates=function(t,i,s,e){while(i<s-e){var r;for(r=0;r<e;++r){var n=t[i+r];t[i+r]=t[s-e+r];t[s-e+r]=n}i+=e;s-=e}};var ih={};ih.linearRingIsClockwise=function(t,i,s,e){var r=0;var n=t[s-e];var h=t[s-e+1];for(;i<s;i+=e){var a=t[i];var o=t[i+1];r+=(a-n)*(o+h);n=a;h=o}return r>0};ih.linearRingsAreOriented=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=ih.linearRingIsClockwise(t,i,o,e);if(h===0){if(n&&f||!n&&!f){return false}}else{if(n&&!f||!n&&f){return false}}i=o}return true};ih.linearRingssAreOriented=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){if(!ih.linearRingsAreOriented(t,i,s[n],e,r)){return false}}return true};ih.orientLinearRings=function(t,i,s,e,r){var n=r!==undefined?r:false;var h,a;for(h=0,a=s.length;h<a;++h){var o=s[h];var f=ih.linearRingIsClockwise(t,i,o,e);var u=h===0?n&&f||!n&&!f:n&&!f||!n&&f;if(u){th.coordinates(t,i,o,e)}i=o}return i};ih.orientLinearRingss=function(t,i,s,e,r){var n,h;for(n=0,h=s.length;n<h;++n){i=ih.orientLinearRings(t,i,s[n],e,r)}return i};var sh=function(t,i){jn.call(this);this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.orientedRevision_=-1;this.orientedFlatCoordinates_=null;this.setCoordinates(t,i)};fn.inherits(sh,jn);sh.prototype.appendLinearRing=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.getFlatCoordinates().slice()}else{kn.extend(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()};sh.prototype.clone=function(){var t=new sh(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice());return t};sh.prototype.closestPointXY=function(t,i,s,e){if(e<Nn.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Xn.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Xn.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,i,s,e)};sh.prototype.containsXY=function(t,i){return Zn.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)};sh.prototype.getArea=function(){return Un.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)};sh.prototype.getCoordinates=function(t){var i;if(t!==undefined){i=this.getOrientedFlatCoordinates().slice();ih.orientLinearRings(i,0,this.ends_,this.stride,t)}else{i=this.flatCoordinates}return Yn.coordinatess(i,0,this.ends_,this.stride)};sh.prototype.getEnds=function(){return this.ends_};sh.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Nn.getCenter(this.getExtent());this.flatInteriorPoint_=$n.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_};sh.prototype.getInteriorPoint=function(){return new Jn(this.getFlatInteriorPoint(),In.XYM)};sh.prototype.getLinearRingCount=function(){return this.ends_.length};sh.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t){return null}var i=new Hn(null);i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]));return i};sh.prototype.getLinearRings=function(){var t=this.layout;var i=this.flatCoordinates;var s=this.ends_;var e=[];var r=0;var n,h;for(n=0,h=s.length;n<h;++n){var a=s[n];var o=new Hn(null);o.setFlatCoordinates(t,i.slice(r,a));e.push(o);r=a}return e};sh.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;if(ih.linearRingsAreOriented(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=ih.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_};sh.prototype.getSimplifiedGeometryInternal=function(t){var i=[];var s=[];i.length=Bn.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var e=new sh(null);e.setFlatCoordinates(In.XY,i,s);return e};sh.prototype.getType=function(){return wn.POLYGON};sh.prototype.intersectsExtent=function(t){return Qn.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)};sh.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null,this.ends_)}else{this.setLayout(i,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}var s=qn.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=s.length===0?0:s[s.length-1];this.changed()}};sh.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i);this.ends_=s;this.changed()};sh.circular=function(t,i,s,e){var r=e?e:32;var n=[];var h;for(h=0;h<r;++h){kn.extend(n,t.offset(i,s,2*Math.PI*h/r))}n.push(n[0],n[1]);var a=new sh(null);a.setFlatCoordinates(In.XY,n,[n.length]);return a};sh.fromExtent=function(t){var i=t[0];var s=t[1];var e=t[2];var r=t[3];var n=[i,s,i,r,e,r,e,s,i,s];var h=new sh(null);h.setFlatCoordinates(In.XY,n,[n.length]);return h};sh.fromCircle=function(t,i,s){var e=i?i:32;var r=t.getStride();var n=t.getLayout();var h=new sh(null,n);var a=r*(e+1);var o=new Array(a);for(var f=0;f<a;f++){o[f]=0}var u=[o.length];h.setFlatCoordinates(n,o,u);sh.makeRegular(h,t.getCenter(),t.getRadius(),s);return h};sh.makeRegular=function(t,i,s,e){var r=t.getFlatCoordinates();var n=t.getLayout();var h=t.getStride();var a=t.getEnds();var o=r.length/h-1;var f=e?e:0;var u,l;for(var v=0;v<=o;++v){l=v*h;u=f+xn.modulo(v,o)*2*Math.PI/o;r[l]=i[0]+s*Math.cos(u);r[l+1]=i[1]+s*Math.sin(u)}t.setFlatCoordinates(n,r,a)};var eh={};eh.ONE=1;eh.SRC_ALPHA=770;eh.COLOR_ATTACHMENT0=36064;eh.COLOR_BUFFER_BIT=16384;eh.TRIANGLES=4;eh.TRIANGLE_STRIP=5;eh.ONE_MINUS_SRC_ALPHA=771;eh.ARRAY_BUFFER=34962;eh.ELEMENT_ARRAY_BUFFER=34963;eh.STREAM_DRAW=35040;eh.STATIC_DRAW=35044;eh.DYNAMIC_DRAW=35048;eh.CULL_FACE=2884;eh.BLEND=3042;eh.STENCIL_TEST=2960;eh.DEPTH_TEST=2929;eh.SCISSOR_TEST=3089;eh.UNSIGNED_BYTE=5121;eh.UNSIGNED_SHORT=5123;eh.UNSIGNED_INT=5125;eh.FLOAT=5126;eh.RGBA=6408;eh.FRAGMENT_SHADER=35632;eh.VERTEX_SHADER=35633;eh.LINK_STATUS=35714;eh.LINEAR=9729;eh.TEXTURE_MAG_FILTER=10240;eh.TEXTURE_MIN_FILTER=10241;eh.TEXTURE_WRAP_S=10242;eh.TEXTURE_WRAP_T=10243;eh.TEXTURE_2D=3553;eh.TEXTURE0=33984;eh.CLAMP_TO_EDGE=33071;eh.COMPILE_STATUS=35713;eh.FRAMEBUFFER=36160;eh.CONTEXT_IDS_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];eh.getContext=function(t,i){var s,e,r=eh.CONTEXT_IDS_.length;for(e=0;e<r;++e){try{s=t.getContext(eh.CONTEXT_IDS_[e],i);if(s){return s}}catch(t){}}return null};var rh={};var nh=typeof navigator!=="undefined"?navigator.userAgent.toLowerCase():"";rh.FIREFOX=nh.indexOf("firefox")!==-1;rh.SAFARI=nh.indexOf("safari")!==-1&&nh.indexOf("chrom")==-1;rh.WEBKIT=nh.indexOf("webkit")!==-1&&nh.indexOf("edge")==-1;rh.MAC=nh.indexOf("macintosh")!==-1;rh.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1;rh.CANVAS_LINE_DASH=false;rh.CANVAS=fn.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window)){return false}try{var t=document.createElement("CANVAS").getContext("2d");if(!t){return false}else{if(t.setLineDash!==undefined){rh.CANVAS_LINE_DASH=true}return true}}catch(t){return false}}();rh.DEVICE_ORIENTATION="DeviceOrientationEvent"in window;rh.GEOLOCATION="geolocation"in navigator;rh.TOUCH=fn.ASSUME_TOUCH||"ontouchstart"in window;rh.POINTER="PointerEvent"in window;rh.MSPOINTER=!!navigator.msPointerEnabled;(function(){if(fn.ENABLE_WEBGL){var t=false;var i;var s=[];if("WebGLRenderingContext"in window){try{var e=document.createElement("CANVAS");var r=eh.getContext(e,{failIfMajorPerformanceCaveat:true});if(r){t=true;i=r.getParameter(r.MAX_TEXTURE_SIZE);s=r.getSupportedExtensions()}}catch(t){}}rh.WEBGL=t;fn.WEBGL_EXTENSIONS=s;fn.WEBGL_MAX_TEXTURE_SIZE=i}})();var hh=function(t){_n.call(this);var i=t||{};this.position_=null;this.transform_=Wn.identityTransform;this.sphere_=new yn(Ln.RADIUS);this.watchId_=undefined;cn.listen(this,_n.getChangeEventType(un.PROJECTION),this.handleProjectionChanged_,this);cn.listen(this,_n.getChangeEventType(un.TRACKING),this.handleTrackingChanged_,this);if(i.projection!==undefined){this.setProjection(i.projection)}if(i.trackingOptions!==undefined){this.setTrackingOptions(i.trackingOptions)}this.setTracking(i.tracking!==undefined?i.tracking:false)};fn.inherits(hh,_n);hh.prototype.disposeInternal=function(){this.setTracking(false);_n.prototype.disposeInternal.call(this)};hh.prototype.handleProjectionChanged_=function(){var t=this.getProjection();if(t){this.transform_=Wn.getTransformFromProjections(Wn.get("EPSG:4326"),t);if(this.position_){this.set(un.POSITION,this.transform_(this.position_))}}};hh.prototype.handleTrackingChanged_=function(){if(rh.GEOLOCATION){var t=this.getTracking();if(t&&this.watchId_===undefined){this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions())}else if(!t&&this.watchId_!==undefined){navigator.geolocation.clearWatch(this.watchId_);this.watchId_=undefined}}};hh.prototype.positionChange_=function(t){var i=t.coords;this.set(un.ACCURACY,i.accuracy);this.set(un.ALTITUDE,i.altitude===null?undefined:i.altitude);this.set(un.ALTITUDE_ACCURACY,i.altitudeAccuracy===null?undefined:i.altitudeAccuracy);this.set(un.HEADING,i.heading===null?undefined:xn.toRadians(i.heading));if(!this.position_){this.position_=[i.longitude,i.latitude]}else{this.position_[0]=i.longitude;this.position_[1]=i.latitude}var s=this.transform_(this.position_);this.set(un.POSITION,s);this.set(un.SPEED,i.speed===null?undefined:i.speed);var e=sh.circular(this.sphere_,this.position_,i.accuracy);e.applyTransform(this.transform_);this.set(un.ACCURACY_GEOMETRY,e);this.changed()};hh.prototype.positionError_=function(t){t.type=zn.ERROR;this.setTracking(false);this.dispatchEvent(t)};hh.prototype.getAccuracy=function(){return this.get(un.ACCURACY)};hh.prototype.getAccuracyGeometry=function(){return this.get(un.ACCURACY_GEOMETRY)||null};hh.prototype.getAltitude=function(){return this.get(un.ALTITUDE)};hh.prototype.getAltitudeAccuracy=function(){return this.get(un.ALTITUDE_ACCURACY)};hh.prototype.getHeading=function(){return this.get(un.HEADING)};hh.prototype.getPosition=function(){return this.get(un.POSITION)};hh.prototype.getProjection=function(){return this.get(un.PROJECTION)};hh.prototype.getSpeed=function(){return this.get(un.SPEED)};hh.prototype.getTracking=function(){return this.get(un.TRACKING)};hh.prototype.getTrackingOptions=function(){return this.get(un.TRACKING_OPTIONS)};hh.prototype.setProjection=function(t){this.set(un.PROJECTION,Wn.get(t))};hh.prototype.setTracking=function(t){this.set(un.TRACKING,t)};hh.prototype.setTrackingOptions=function(t){this.set(un.TRACKING_OPTIONS,t)};var ah={ADD:"add",REMOVE:"remove"};var oh=function(t,i){_n.call(this);var s=i||{};this.unique_=!!s.unique;this.array_=t?t:[];if(this.unique_){for(var e=0,r=this.array_.length;e<r;++e){this.assertUnique_(this.array_[e],e)}}this.updateLength_()};fn.inherits(oh,_n);oh.prototype.clear=function(){while(this.getLength()>0){this.pop()}};oh.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i){this.push(t[i])}return this};oh.prototype.forEach=function(t,i){var s=i?t.bind(i):t;var e=this.array_;for(var r=0,n=e.length;r<n;++r){s(e[r],r,e)}};oh.prototype.getArray=function(){return this.array_};oh.prototype.item=function(t){return this.array_[t]};oh.prototype.getLength=function(){return this.get(oh.Property_.LENGTH)};oh.prototype.insertAt=function(t,i){if(this.unique_){this.assertUnique_(i)}this.array_.splice(t,0,i);this.updateLength_();this.dispatchEvent(new oh.Event(ah.ADD,i))};oh.prototype.pop=function(){return this.removeAt(this.getLength()-1)};oh.prototype.push=function(t){if(this.unique_){this.assertUnique_(t)}var i=this.getLength();this.insertAt(i,t);return this.getLength()};oh.prototype.remove=function(t){var i=this.array_;var s,e;for(s=0,e=i.length;s<e;++s){if(i[s]===t){return this.removeAt(s)}}return undefined};oh.prototype.removeAt=function(t){var i=this.array_[t];this.array_.splice(t,1);this.updateLength_();this.dispatchEvent(new oh.Event(ah.REMOVE,i));return i};oh.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){if(this.unique_){this.assertUnique_(i,t)}var e=this.array_[t];this.array_[t]=i;this.dispatchEvent(new oh.Event(ah.REMOVE,e));this.dispatchEvent(new oh.Event(ah.ADD,i))}else{var r;for(r=s;r<t;++r){this.insertAt(r,undefined)}this.insertAt(t,i)}};oh.prototype.updateLength_=function(){this.set(oh.Property_.LENGTH,this.array_.length)};oh.prototype.assertUnique_=function(t,i){for(var s=0,e=this.array_.length;s<e;++s){if(this.array_[s]===t&&s!==i){throw new gn(58)}}};oh.Property_={LENGTH:"length"};oh.Event=function(t,i){mn.call(this,t);this.element=i};fn.inherits(oh.Event,mn);var fh=function(t,i,s){mn.call(this,t);this.map=i;this.frameState=s!==undefined?s:null};fn.inherits(fh,mn);var uh=function(t,i,s,e,r){fh.call(this,t,i,r);this.originalEvent=s;this.pixel=i.getEventPixel(s);this.coordinate=i.getCoordinateFromPixel(this.pixel);this.dragging=e!==undefined?e:false};fn.inherits(uh,fh);uh.prototype.preventDefault=function(){fh.prototype.preventDefault.call(this);this.originalEvent.preventDefault()};uh.prototype.stopPropagation=function(){fh.prototype.stopPropagation.call(this);this.originalEvent.stopPropagation()};var lh={SINGLECLICK:"singleclick",CLICK:zn.CLICK,DBLCLICK:zn.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var vh=function(t,i,s,e,r){uh.call(this,t,i,s.originalEvent,e,r);this.pointerEvent=s};fn.inherits(vh,uh);var ch={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var dh=function(t,i){this.dispatcher=t;this.mapping_=i};dh.prototype.getEvents=function(){return Object.keys(this.mapping_)};dh.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var mh=function(t){var i={mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout};dh.call(this,t,i);this.pointerMap=t.pointerMap;this.lastTouches=[]};fn.inherits(mh,dh);mh.POINTER_ID=1;mh.POINTER_TYPE="mouse";mh.DEDUP_DIST=25;mh.prototype.isEventSimulatedFromTouch_=function(t){var i=this.lastTouches;var s=t.clientX,e=t.clientY;for(var r=0,n=i.length,h;r<n&&(h=i[r]);r++){var a=Math.abs(s-h[0]),o=Math.abs(e-h[1]);if(a<=mh.DEDUP_DIST&&o<=mh.DEDUP_DIST){return true}}return false};mh.prepareEvent=function(t,i){var s=i.cloneEvent(t,t);var e=s.preventDefault;s.preventDefault=function(){t.preventDefault();e()};s.pointerId=mh.POINTER_ID;s.isPrimary=true;s.pointerType=mh.POINTER_TYPE;return s};mh.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){if(mh.POINTER_ID.toString()in this.pointerMap){this.cancel(t)}var i=mh.prepareEvent(t,this.dispatcher);this.pointerMap[mh.POINTER_ID.toString()]=t;this.dispatcher.down(i,t)}};mh.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}};mh.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[mh.POINTER_ID.toString()];if(i&&i.button===t.button){var s=mh.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t);this.cleanupMouse()}}};mh.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}};mh.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}};mh.prototype.cancel=function(t){var i=mh.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t);this.cleanupMouse()};mh.prototype.cleanupMouse=function(){delete this.pointerMap[mh.POINTER_ID.toString()]};var ph=function(t){var i={MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture};dh.call(this,t,i);this.pointerMap=t.pointerMap;this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};fn.inherits(ph,dh);ph.prototype.prepareEvent_=function(t){var i=t;if(typeof t.pointerType==="number"){i=this.dispatcher.cloneEvent(t,t);i.pointerType=this.POINTER_TYPES[t.pointerType]}return i};ph.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]};ph.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)};ph.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)};ph.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t);this.cleanup(t.pointerId)};ph.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)};ph.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)};ph.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t);this.cleanup(t.pointerId)};ph.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)};ph.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var zh=function(t){var i={pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture};dh.call(this,t,i)};fn.inherits(zh,dh);zh.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};zh.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var Mh=function(t,i,s){mn.call(this,t);this.originalEvent=i;var e=s?s:{};this.buttons=this.getButtons_(e);this.pressure=this.getPressure_(e,this.buttons);this.bubbles="bubbles"in e?e["bubbles"]:false;this.cancelable="cancelable"in e?e["cancelable"]:false;this.view="view"in e?e["view"]:null;this.detail="detail"in e?e["detail"]:null;this.screenX="screenX"in e?e["screenX"]:0;this.screenY="screenY"in e?e["screenY"]:0;this.clientX="clientX"in e?e["clientX"]:0;this.clientY="clientY"in e?e["clientY"]:0;this.ctrlKey="ctrlKey"in e?e["ctrlKey"]:false;this.altKey="altKey"in e?e["altKey"]:false;this.shiftKey="shiftKey"in e?e["shiftKey"]:false;this.metaKey="metaKey"in e?e["metaKey"]:false;this.button="button"in e?e["button"]:0;this.relatedTarget="relatedTarget"in e?e["relatedTarget"]:null;this.pointerId="pointerId"in e?e["pointerId"]:0;this.width="width"in e?e["width"]:0;this.height="height"in e?e["height"]:0;this.tiltX="tiltX"in e?e["tiltX"]:0;this.tiltY="tiltY"in e?e["tiltY"]:0;this.pointerType="pointerType"in e?e["pointerType"]:"";this.hwTimestamp="hwTimestamp"in e?e["hwTimestamp"]:0;this.isPrimary="isPrimary"in e?e["isPrimary"]:false;if(i.preventDefault){this.preventDefault=function(){i.preventDefault()}}};fn.inherits(Mh,mn);Mh.prototype.getButtons_=function(t){var i;if(t.buttons||Mh.HAS_BUTTONS){i=t.buttons}else{switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}}return i};Mh.prototype.getPressure_=function(t,i){var s=0;if(t.pressure){s=t.pressure}else{s=i?.5:0}return s};Mh.HAS_BUTTONS=false;(function(){try{var t=new MouseEvent("click",{buttons:1});Mh.HAS_BUTTONS=t.buttons===1}catch(t){}})();var _h=function(t,i){var s={touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel};dh.call(this,t,s);this.pointerMap=t.pointerMap;this.mouseSource=i;this.firstTouchId_=undefined;this.clickCount_=0;this.resetId_=undefined};fn.inherits(_h,dh);_h.DEDUP_TIMEOUT=2500;_h.CLICK_COUNT_TIMEOUT=200;_h.POINTER_TYPE="touch";_h.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier};_h.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;if(i===0||i===1&&mh.POINTER_ID.toString()in this.pointerMap){this.firstTouchId_=t.identifier;this.cancelResetClickCount_()}};_h.prototype.removePrimaryPointer_=function(t){if(t.isPrimary){this.firstTouchId_=undefined;this.resetClickCount_()}};_h.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),_h.CLICK_COUNT_TIMEOUT)};_h.prototype.resetClickCountHandler_=function(){this.clickCount_=0;this.resetId_=undefined};_h.prototype.cancelResetClickCount_=function(){if(this.resetId_!==undefined){clearTimeout(this.resetId_)}};_h.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);s.pointerId=i.identifier+2;s.bubbles=true;s.cancelable=true;s.detail=this.clickCount_;s.button=0;s.buttons=1;s.width=i.webkitRadiusX||i.radiusX||0;s.height=i.webkitRadiusY||i.radiusY||0;s.pressure=i.webkitForce||i.force||.5;s.isPrimary=this.isPrimaryTouch_(i);s.pointerType=_h.POINTER_TYPE;s.clientX=i.clientX;s.clientY=i.clientY;s.screenX=i.screenX;s.screenY=i.screenY;return s};_h.prototype.processTouches_=function(t,i){var s=Array.prototype.slice.call(t.changedTouches);var e=s.length;function r(){t.preventDefault()}var n,h;for(n=0;n<e;++n){h=this.touchToPointer_(t,s[n]);h.preventDefault=r;i.call(this,t,h)}};_h.prototype.findTouch_=function(t,i){var s=t.length;var e;for(var r=0;r<s;r++){e=t[r];if(e.identifier===i){return true}}return false};_h.prototype.vacuumTouches_=function(t){var i=t.touches;var s=Object.keys(this.pointerMap);var e=s.length;if(e>=i.length){var r=[];var n,h,a;for(n=0;n<e;++n){h=s[n];a=this.pointerMap[h];if(h!=mh.POINTER_ID&&!this.findTouch_(i,h-2)){r.push(a.out)}}for(n=0;n<r.length;++n){this.cancelOut_(t,r[n])}}};_h.prototype.touchstart=function(t){this.vacuumTouches_(t);this.setPrimaryTouch_(t.changedTouches[0]);this.dedupSynthMouse_(t);this.clickCount_++;this.processTouches_(t,this.overDown_)};_h.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target};this.dispatcher.over(i,t);this.dispatcher.enter(i,t);this.dispatcher.down(i,t)};_h.prototype.touchmove=function(t){t.preventDefault();this.processTouches_(t,this.moveOverOut_)};_h.prototype.moveOverOut_=function(t,i){var s=i;var e=this.pointerMap[s.pointerId];if(!e){return}var r=e.out;var n=e.outTarget;this.dispatcher.move(s,t);if(r&&n!==s.target){r.relatedTarget=s.target;s.relatedTarget=n;r.target=n;if(s.target){this.dispatcher.leaveOut(r,t);this.dispatcher.enterOver(s,t)}else{s.target=n;s.relatedTarget=null;this.cancelOut_(t,s)}}e.out=s;e.outTarget=s.target};_h.prototype.touchend=function(t){this.dedupSynthMouse_(t);this.processTouches_(t,this.upOut_)};_h.prototype.upOut_=function(t,i){this.dispatcher.up(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};_h.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)};_h.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t);this.dispatcher.out(i,t);this.dispatcher.leave(i,t);this.cleanUpPointer_(i)};_h.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId];this.removePrimaryPointer_(t)};_h.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches;var s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var e=[s.clientX,s.clientY];i.push(e);setTimeout((function(){kn.remove(i,e)}),_h.DEDUP_TIMEOUT)}};var gh=function(t){pn.call(this);this.element_=t;this.pointerMap={};this.eventMap_={};this.eventSourceList_=[];this.registerSources()};fn.inherits(gh,pn);gh.prototype.registerSources=function(){if(rh.POINTER){this.registerSource("native",new zh(this))}else if(rh.MSPOINTER){this.registerSource("ms",new ph(this))}else{var t=new mh(this);this.registerSource("mouse",t);if(rh.TOUCH){this.registerSource("touch",new _h(this,t))}}this.register_()};gh.prototype.registerSource=function(t,i){var s=i;var e=s.getEvents();if(e){e.forEach((function(t){var i=s.getHandlerForEvent(t);if(i){this.eventMap_[t]=i.bind(s)}}),this);this.eventSourceList_.push(s)}};gh.prototype.register_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.addEvents_(i.getEvents())}};gh.prototype.unregister_=function(){var t=this.eventSourceList_.length;var i;for(var s=0;s<t;s++){i=this.eventSourceList_[s];this.removeEvents_(i.getEvents())}};gh.prototype.eventHandler_=function(t){var i=t.type;var s=this.eventMap_[i];if(s){s(t)}};gh.prototype.addEvents_=function(t){t.forEach((function(t){cn.listen(this.element_,t,this.eventHandler_,this)}),this)};gh.prototype.removeEvents_=function(t){t.forEach((function(t){cn.unlisten(this.element_,t,this.eventHandler_,this)}),this)};gh.prototype.cloneEvent=function(t,i){var s={},e;for(var r=0,n=gh.CLONE_PROPS.length;r<n;r++){e=gh.CLONE_PROPS[r][0];s[e]=t[e]||i[e]||gh.CLONE_PROPS[r][1]}return s};gh.prototype.down=function(t,i){this.fireEvent(ch.POINTERDOWN,t,i)};gh.prototype.move=function(t,i){this.fireEvent(ch.POINTERMOVE,t,i)};gh.prototype.up=function(t,i){this.fireEvent(ch.POINTERUP,t,i)};gh.prototype.enter=function(t,i){t.bubbles=false;this.fireEvent(ch.POINTERENTER,t,i)};gh.prototype.leave=function(t,i){t.bubbles=false;this.fireEvent(ch.POINTERLEAVE,t,i)};gh.prototype.over=function(t,i){t.bubbles=true;this.fireEvent(ch.POINTEROVER,t,i)};gh.prototype.out=function(t,i){t.bubbles=true;this.fireEvent(ch.POINTEROUT,t,i)};gh.prototype.cancel=function(t,i){this.fireEvent(ch.POINTERCANCEL,t,i)};gh.prototype.leaveOut=function(t,i){this.out(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.leave(t,i)}};gh.prototype.enterOver=function(t,i){this.over(t,i);if(!this.contains_(t.target,t.relatedTarget)){this.enter(t,i)}};gh.prototype.contains_=function(t,i){if(!t||!i){return false}return t.contains(i)};gh.prototype.makeEvent=function(t,i,s){return new Mh(t,s,i)};gh.prototype.fireEvent=function(t,i,s){var e=this.makeEvent(t,i,s);this.dispatchEvent(e)};gh.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)};gh.prototype.wrapMouseEvent=function(t,i){var s=this.makeEvent(t,mh.prepareEvent(i,this),i);return s};gh.prototype.disposeInternal=function(){this.unregister_();pn.prototype.disposeInternal.call(this)};gh.CLONE_PROPS=[["bubbles",false],["cancelable",false],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",false],["altKey",false],["shiftKey",false],["metaKey",false],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",false],["type",""],["target",null],["currentTarget",null],["which",0]];var bh=function(t,i){pn.call(this);this.map_=t;this.clickTimeoutId_=0;this.dragging_=false;this.dragListenerKeys_=[];this.moveTolerance_=i?i*rh.DEVICE_PIXEL_RATIO:rh.DEVICE_PIXEL_RATIO;this.down_=null;var s=this.map_.getViewport();this.activePointers_=0;this.trackedTouches_={};this.pointerEventHandler_=new gh(s);this.documentPointerEventHandler_=null;this.pointerdownListenerKey_=cn.listen(this.pointerEventHandler_,ch.POINTERDOWN,this.handlePointerDown_,this);this.relayedListenerKey_=cn.listen(this.pointerEventHandler_,ch.POINTERMOVE,this.relayEvent_,this)};fn.inherits(bh,pn);bh.prototype.emulateClick_=function(t){var i=new vh(lh.CLICK,this.map_,t);this.dispatchEvent(i);if(this.clickTimeoutId_!==0){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=0;i=new vh(lh.DBLCLICK,this.map_,t);this.dispatchEvent(i)}else{this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new vh(lh.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)}};bh.prototype.updateActivePointers_=function(t){var i=t;if(i.type==lh.POINTERUP||i.type==lh.POINTERCANCEL){delete this.trackedTouches_[i.pointerId]}else if(i.type==lh.POINTERDOWN){this.trackedTouches_[i.pointerId]=true}this.activePointers_=Object.keys(this.trackedTouches_).length};bh.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new vh(lh.POINTERUP,this.map_,t);this.dispatchEvent(i);if(!i.propagationStopped&&!this.dragging_&&this.isMouseActionButton_(t)){this.emulateClick_(this.down_)}if(this.activePointers_===0){this.dragListenerKeys_.forEach(cn.unlistenByKey);this.dragListenerKeys_.length=0;this.dragging_=false;this.down_=null;this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}};bh.prototype.isMouseActionButton_=function(t){return t.button===0};bh.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new vh(lh.POINTERDOWN,this.map_,t);this.dispatchEvent(i);this.down_=t;if(this.dragListenerKeys_.length===0){this.documentPointerEventHandler_=new gh(document);this.dragListenerKeys_.push(cn.listen(this.documentPointerEventHandler_,lh.POINTERMOVE,this.handlePointerMove_,this),cn.listen(this.documentPointerEventHandler_,lh.POINTERUP,this.handlePointerUp_,this),cn.listen(this.pointerEventHandler_,lh.POINTERCANCEL,this.handlePointerUp_,this))}};bh.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=true;var i=new vh(lh.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()};bh.prototype.relayEvent_=function(t){var i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new vh(t.type,this.map_,t,i))};bh.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_};bh.prototype.disposeInternal=function(){if(this.relayedListenerKey_){cn.unlistenByKey(this.relayedListenerKey_);this.relayedListenerKey_=null}if(this.pointerdownListenerKey_){cn.unlistenByKey(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(cn.unlistenByKey);this.dragListenerKeys_.length=0;if(this.documentPointerEventHandler_){this.documentPointerEventHandler_.dispose();this.documentPointerEventHandler_=null}if(this.pointerEventHandler_){this.pointerEventHandler_.dispose();this.pointerEventHandler_=null}pn.prototype.disposeInternal.call(this)};var xh={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};var wh={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var yh={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};var kh=function(t,i){this.priorityFunction_=t;this.keyFunction_=i;this.elements_=[];this.priorities_=[];this.queuedElements_={}};kh.DROP=Infinity;kh.prototype.clear=function(){this.elements_.length=0;this.priorities_.length=0;vn.clear(this.queuedElements_)};kh.prototype.dequeue=function(){var t=this.elements_;var i=this.priorities_;var s=t[0];if(t.length==1){t.length=0;i.length=0}else{t[0]=t.pop();i[0]=i.pop();this.siftUp_(0)}var e=this.keyFunction_(s);delete this.queuedElements_[e];return s};kh.prototype.enqueue=function(t){bn.assert(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);if(i!=kh.DROP){this.elements_.push(t);this.priorities_.push(i);this.queuedElements_[this.keyFunction_(t)]=true;this.siftDown_(0,this.elements_.length-1);return true}return false};kh.prototype.getCount=function(){return this.elements_.length};kh.prototype.getLeftChildIndex_=function(t){return t*2+1};kh.prototype.getRightChildIndex_=function(t){return t*2+2};kh.prototype.getParentIndex_=function(t){return t-1>>1};kh.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--){this.siftUp_(t)}};kh.prototype.isEmpty=function(){return this.elements_.length===0};kh.prototype.isKeyQueued=function(t){return t in this.queuedElements_};kh.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))};kh.prototype.siftUp_=function(t){var i=this.elements_;var s=this.priorities_;var e=i.length;var r=i[t];var n=s[t];var h=t;while(t<e>>1){var a=this.getLeftChildIndex_(t);var o=this.getRightChildIndex_(t);var f=o<e&&s[o]<s[a]?o:a;i[t]=i[f];s[t]=s[f];t=f}i[t]=r;s[t]=n;this.siftDown_(h,t)};kh.prototype.siftDown_=function(t,i){var s=this.elements_;var e=this.priorities_;var r=s[i];var n=e[i];while(i>t){var h=this.getParentIndex_(i);if(e[h]>n){s[i]=s[h];e[i]=e[h];i=h}else{break}}s[i]=r;e[i]=n};kh.prototype.reprioritize=function(){var t=this.priorityFunction_;var i=this.elements_;var s=this.priorities_;var e=0;var r=i.length;var n,h,a;for(h=0;h<r;++h){n=i[h];a=t(n);if(a==kh.DROP){delete this.queuedElements_[this.keyFunction_(n)]}else{s[e]=a;i[e++]=n}}i.length=e;s.length=e;this.heapify_()};var Eh=function(t,i){kh.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()}));this.tileChangeCallback_=i;this.tilesLoading_=0;this.tilesLoadingKeys_={}};fn.inherits(Eh,kh);Eh.prototype.enqueue=function(t){var i=kh.prototype.enqueue.call(this,t);if(i){var s=t[0];cn.listen(s,zn.CHANGE,this.handleTileChange,this)}return i};Eh.prototype.getTilesLoading=function(){return this.tilesLoading_};Eh.prototype.handleTileChange=function(t){var i=t.target;var s=i.getState();if(s===yh.LOADED||s===yh.ERROR||s===yh.EMPTY||s===yh.ABORT){cn.unlisten(i,zn.CHANGE,this.handleTileChange,this);var e=i.getKey();if(e in this.tilesLoadingKeys_){delete this.tilesLoadingKeys_[e];--this.tilesLoading_}this.tileChangeCallback_()}};Eh.prototype.loadMoreTiles=function(t,i){var s=0;var e=false;var r,n,h;while(this.tilesLoading_<t&&s<i&&this.getCount()>0){n=this.dequeue()[0];h=n.getKey();r=n.getState();if(r===yh.ABORT){e=true}else if(r===yh.IDLE&&!(h in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[h]=true;++this.tilesLoading_;++s;n.load()}}if(s===0&&e){this.tileChangeCallback_()}};var Ch={};Ch.createExtent=function(t){return function(i){if(i){return[xn.clamp(i[0],t[0],t[2]),xn.clamp(i[1],t[1],t[3])]}else{return undefined}}};Ch.none=function(t){return t};var Nh={};Nh.createSnapToResolutions=function(t){return function(i,s,e){if(i!==undefined){var r=kn.linearFindNearest(t,i,e);r=xn.clamp(r+s,0,t.length-1);var n=Math.floor(r);if(r!=n&&n<t.length-1){var h=t[n]/t[n+1];return t[n]/Math.pow(h,r-n)}else{return t[n]}}else{return undefined}}};Nh.createSnapToPower=function(t,i,s){return function(e,r,n){if(e!==undefined){var h=-n/2+.5;var a=Math.floor(Math.log(i/e)/Math.log(t)+h);var o=Math.max(a+r,0);if(s!==undefined){o=Math.min(o,s)}return i/Math.pow(t,o)}else{return undefined}}};var Ih={};Ih.disable=function(t,i){if(t!==undefined){return 0}else{return undefined}};Ih.none=function(t,i){if(t!==undefined){return t+i}else{return undefined}};Ih.createSnapToN=function(t){var i=2*Math.PI/t;return function(t,s){if(t!==undefined){t=Math.floor((t+s)/i+.5)*i;return t}else{return undefined}}};Ih.createSnapToZero=function(t){var i=t||xn.toRadians(5);return function(t,s){if(t!==undefined){if(Math.abs(t+s)<=i){return 0}else{return t+s}}else{return undefined}}};var Sh={ANIMATING:0,INTERACTING:1};var Oh={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Th={};Th.padNumber=function(t,i,s){var e=s!==undefined?t.toFixed(s):""+t;var r=e.indexOf(".");r=r===-1?e.length:r;return r>i?e:new Array(1+i-r).join("0")+e};Th.compareVersions=function(t,i){var s=(""+t).split(".");var e=(""+i).split(".");for(var r=0;r<Math.max(s.length,e.length);r++){var n=parseInt(s[r]||"0",10);var h=parseInt(e[r]||"0",10);if(n>h){return 1}if(h>n){return-1}}return 0};var Ah={};Ah.add=function(t,i){t[0]+=i[0];t[1]+=i[1];return t};Ah.closestOnCircle=function(t,i){var s=i.getRadius();var e=i.getCenter();var r=e[0];var n=e[1];var h=t[0];var a=t[1];var o=h-r;var f=a-n;if(o===0&&f===0){o=1}var u=Math.sqrt(o*o+f*f);var l,v;l=r+s*o/u;v=n+s*f/u;return[l,v]};Ah.closestOnSegment=function(t,i){var s=t[0];var e=t[1];var r=i[0];var n=i[1];var h=r[0];var a=r[1];var o=n[0];var f=n[1];var u=o-h;var l=f-a;var v=u===0&&l===0?0:(u*(s-h)+l*(e-a))/(u*u+l*l||0);var c,d;if(v<=0){c=h;d=a}else if(v>=1){c=o;d=f}else{c=h+v*u;d=a+v*l}return[c,d]};Ah.createStringXY=function(t){return function(i){return Ah.toStringXY(i,t)}};Ah.degreesToStringHDMS=function(t,i,s){var e=xn.modulo(i+180,360)-180;var r=Math.abs(3600*e);var n=s||0;var h=Math.pow(10,n);var a=Math.floor(r/3600);var o=Math.floor((r-a*3600)/60);var f=r-a*3600-o*60;f=Math.ceil(f*h)/h;if(f>=60){f=0;o+=1}if(o>=60){o=0;a+=1}return a+"° "+Th.padNumber(o,2)+"′ "+Th.padNumber(f,2,n)+"″"+(e==0?"":" "+t.charAt(e<0?1:0))};Ah.format=function(t,i,s){if(t){return i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s))}else{return""}};Ah.equals=function(t,i){var s=true;for(var e=t.length-1;e>=0;--e){if(t[e]!=i[e]){s=false;break}}return s};Ah.rotate=function(t,i){var s=Math.cos(i);var e=Math.sin(i);var r=t[0]*s-t[1]*e;var n=t[1]*s+t[0]*e;t[0]=r;t[1]=n;return t};Ah.scale=function(t,i){t[0]*=i;t[1]*=i;return t};Ah.sub=function(t,i){t[0]-=i[0];t[1]-=i[1];return t};Ah.squaredDistance=function(t,i){var s=t[0]-i[0];var e=t[1]-i[1];return s*s+e*e};Ah.distance=function(t,i){return Math.sqrt(Ah.squaredDistance(t,i))};Ah.squaredDistanceToSegment=function(t,i){return Ah.squaredDistance(t,Ah.closestOnSegment(t,i))};Ah.toStringHDMS=function(t,i){if(t){return Ah.degreesToStringHDMS("NS",t[1],i)+" "+Ah.degreesToStringHDMS("EW",t[0],i)}else{return""}};Ah.toStringXY=function(t,i){return Ah.format(t,"{x}, {y}",i)};var Rh={};Rh.easeIn=function(t){return Math.pow(t,3)};Rh.easeOut=function(t){return 1-Rh.easeIn(1-t)};Rh.inAndOut=function(t){return 3*t*t-2*t*t*t};Rh.linear=function(t){return t};Rh.upAndDown=function(t){if(t<.5){return Rh.inAndOut(2*t)}else{return 1-Rh.inAndOut(2*(t-.5))}};var Ph=function(t){_n.call(this);var i=vn.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimations_=this.updateAnimations_.bind(this);this.projection_=Wn.createProjection(i.projection,"EPSG:3857");this.applyOptions_(i)};fn.inherits(Ph,_n);Ph.prototype.applyOptions_=function(t){var i={};i[Oh.CENTER]=t.center!==undefined?t.center:null;var s=Ph.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution;this.minResolution_=s.minResolution;this.zoomFactor_=s.zoomFactor;this.resolutions_=t.resolutions;this.minZoom_=s.minZoom;var e=Ph.createCenterConstraint_(t);var r=s.constraint;var n=Ph.createRotationConstraint_(t);this.constraints_={center:e,resolution:r,rotation:n};if(t.resolution!==undefined){i[Oh.RESOLUTION]=t.resolution}else if(t.zoom!==undefined){i[Oh.RESOLUTION]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_);if(this.resolutions_){i[Oh.RESOLUTION]=xn.clamp(Number(this.getResolution()||i[Oh.RESOLUTION]),this.minResolution_,this.maxResolution_)}}i[Oh.ROTATION]=t.rotation!==undefined?t.rotation:0;this.setProperties(i);this.options_=t};Ph.prototype.getUpdatedOptions_=function(t){var i=vn.assign({},this.options_);if(i.resolution!==undefined){i.resolution=this.getResolution()}else{i.zoom=this.getZoom()}i.center=this.getCenter();i.rotation=this.getRotation();return vn.assign({},i,t)};Ph.prototype.animate=function(t){var i=arguments.length;var s;if(i>1&&typeof arguments[i-1]==="function"){s=arguments[i-1];--i}if(!this.isDef()){var e=arguments[i-1];if(e.center){this.setCenter(e.center)}if(e.zoom!==undefined){this.setZoom(e.zoom)}if(e.rotation!==undefined){this.setRotation(e.rotation)}if(s){s(true)}return}var r=Date.now();var n=this.getCenter().slice();var h=this.getResolution();var a=this.getRotation();var o=[];for(var f=0;f<i;++f){var u=arguments[f];var l={start:r,complete:false,anchor:u.anchor,duration:u.duration!==undefined?u.duration:1e3,easing:u.easing||Rh.inAndOut};if(u.center){l.sourceCenter=n;l.targetCenter=u.center;n=l.targetCenter}if(u.zoom!==undefined){l.sourceResolution=h;l.targetResolution=this.constrainResolution(this.maxResolution_,u.zoom-this.minZoom_,0);h=l.targetResolution}else if(u.resolution){l.sourceResolution=h;l.targetResolution=u.resolution;h=l.targetResolution}if(u.rotation!==undefined){l.sourceRotation=a;var v=xn.modulo(u.rotation-a+Math.PI,2*Math.PI)-Math.PI;l.targetRotation=a+v;a=l.targetRotation}l.callback=s;if(Ph.isNoopAnimation(l)){l.complete=true}else{r+=l.duration}o.push(l)}this.animations_.push(o);this.setHint(Sh.ANIMATING,1);this.updateAnimations_()};Ph.prototype.getAnimating=function(){return this.hints_[Sh.ANIMATING]>0};Ph.prototype.getInteracting=function(){return this.hints_[Sh.INTERACTING]>0};Ph.prototype.cancelAnimations=function(){this.setHint(Sh.ANIMATING,-this.hints_[Sh.ANIMATING]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];if(s[0].callback){s[0].callback(false)}}this.animations_.length=0};Ph.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==undefined){cancelAnimationFrame(this.updateAnimationKey_);this.updateAnimationKey_=undefined}if(!this.getAnimating()){return}var t=Date.now();var i=false;for(var s=this.animations_.length-1;s>=0;--s){var e=this.animations_[s];var r=true;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(a.complete){continue}var o=t-a.start;var f=a.duration>0?o/a.duration:1;if(f>=1){a.complete=true;f=1}else{r=false}var u=a.easing(f);if(a.sourceCenter){var l=a.sourceCenter[0];var v=a.sourceCenter[1];var c=a.targetCenter[0];var d=a.targetCenter[1];var m=l+u*(c-l);var p=v+u*(d-v);this.set(Oh.CENTER,[m,p])}if(a.sourceResolution&&a.targetResolution){var z=u===1?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){this.set(Oh.CENTER,this.calculateCenterZoom(z,a.anchor))}this.set(Oh.RESOLUTION,z)}if(a.sourceRotation!==undefined&&a.targetRotation!==undefined){var M=u===1?xn.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){this.set(Oh.CENTER,this.calculateCenterRotate(M,a.anchor))}this.set(Oh.ROTATION,M)}i=true;if(!a.complete){break}}if(r){this.animations_[s]=null;this.setHint(Sh.ANIMATING,-1);var _=e[0].callback;if(_){_(true)}}}this.animations_=this.animations_.filter(Boolean);if(i&&this.updateAnimationKey_===undefined){this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_)}};Ph.prototype.calculateCenterRotate=function(t,i){var s;var e=this.getCenter();if(e!==undefined){s=[e[0]-i[0],e[1]-i[1]];Ah.rotate(s,t-this.getRotation());Ah.add(s,i)}return s};Ph.prototype.calculateCenterZoom=function(t,i){var s;var e=this.getCenter();var r=this.getResolution();if(e!==undefined&&r!==undefined){var n=i[0]-t*(i[0]-e[0])/r;var h=i[1]-t*(i[1]-e[1])/r;s=[n,h]}return s};Ph.prototype.getSizeFromViewport_=function(){var t=[100,100];var i='.ol-viewport[data-view="'+fn.getUid(this)+'"]';var s=document.querySelector(i);if(s){var e=getComputedStyle(s);t[0]=parseInt(e.width,10);t[1]=parseInt(e.height,10)}return t};Ph.prototype.constrainCenter=function(t){return this.constraints_.center(t)};Ph.prototype.constrainResolution=function(t,i,s){var e=i||0;var r=s||0;return this.constraints_.resolution(t,e,r)};Ph.prototype.constrainRotation=function(t,i){var s=i||0;return this.constraints_.rotation(t,s)};Ph.prototype.getCenter=function(){return this.get(Oh.CENTER)};Ph.prototype.getConstraints=function(){return this.constraints_};Ph.prototype.getHints=function(t){if(t!==undefined){t[0]=this.hints_[0];t[1]=this.hints_[1];return t}else{return this.hints_.slice()}};Ph.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_();var s=this.getCenter();bn.assert(s,1);var e=this.getResolution();bn.assert(e!==undefined,2);var r=this.getRotation();bn.assert(r!==undefined,3);return Nn.getForViewAndSize(s,e,r,i)};Ph.prototype.getMaxResolution=function(){return this.maxResolution_};Ph.prototype.getMinResolution=function(){return this.minResolution_};Ph.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)};Ph.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))};Ph.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)};Ph.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))};Ph.prototype.getProjection=function(){return this.projection_};Ph.prototype.getResolution=function(){return this.get(Oh.RESOLUTION)};Ph.prototype.getResolutions=function(){return this.resolutions_};Ph.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_();var e=Nn.getWidth(t)/s[0];var r=Nn.getHeight(t)/s[1];return Math.max(e,r)};Ph.prototype.getResolutionForValueFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=s/Math.pow(i,t*r);return e}};Ph.prototype.getRotation=function(){return this.get(Oh.ROTATION)};Ph.prototype.getValueForResolutionFunction=function(t){var i=t||2;var s=this.maxResolution_;var e=this.minResolution_;var r=Math.log(s/e)/Math.log(i);return function(t){var e=Math.log(s/t)/Math.log(i)/r;return e}};Ph.prototype.getState=function(){var t=this.getCenter();var i=this.getProjection();var s=this.getResolution();var e=this.getRotation();return{center:t.slice(),projection:i!==undefined?i:null,resolution:s,rotation:e,zoom:this.getZoom()}};Ph.prototype.getZoom=function(){var t;var i=this.getResolution();if(i!==undefined){t=this.getZoomForResolution(i)}return t};Ph.prototype.getZoomForResolution=function(t){var i=this.minZoom_||0;var s,e;if(this.resolutions_){var r=kn.linearFindNearest(this.resolutions_,t,1);i=r;s=this.resolutions_[r];if(r==this.resolutions_.length-1){e=2}else{e=s/this.resolutions_[r+1]}}else{s=this.maxResolution_;e=this.zoomFactor_}return i+Math.log(s/t)/Math.log(e)};Ph.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)};Ph.prototype.fit=function(t,i){var s=i||{};var e=s.size;if(!e){e=this.getSizeFromViewport_()}var r;if(!(t instanceof jn)){bn.assert(Array.isArray(t),24);bn.assert(!Nn.isEmpty(t),25);r=sh.fromExtent(t)}else if(t.getType()===wn.CIRCLE){t=t.getExtent();r=sh.fromExtent(t);r.rotate(this.getRotation(),Nn.getCenter(t))}else{r=t}var n=s.padding!==undefined?s.padding:[0,0,0,0];var h=s.constrainResolution!==undefined?s.constrainResolution:true;var a=s.nearest!==undefined?s.nearest:false;var o;if(s.minResolution!==undefined){o=s.minResolution}else if(s.maxZoom!==undefined){o=this.constrainResolution(this.maxResolution_,s.maxZoom-this.minZoom_,0)}else{o=0}var f=r.getFlatCoordinates();var u=this.getRotation();var l=Math.cos(-u);var v=Math.sin(-u);var c=+Infinity;var d=+Infinity;var m=-Infinity;var p=-Infinity;var z=r.getStride();for(var M=0,_=f.length;M<_;M+=z){var g=f[M]*l-f[M+1]*v;var b=f[M]*v+f[M+1]*l;c=Math.min(c,g);d=Math.min(d,b);m=Math.max(m,g);p=Math.max(p,b)}var x=this.getResolutionForExtent([c,d,m,p],[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]);x=isNaN(x)?o:Math.max(x,o);if(h){var w=this.constrainResolution(x,0,0);if(!a&&w<x){w=this.constrainResolution(w,-1,0)}x=w}v=-v;var y=(c+m)/2;var k=(d+p)/2;y+=(n[1]-n[3])/2*x;k+=(n[0]-n[2])/2*x;var E=y*l-k*v;var C=k*l+y*v;var N=[E,C];var I=s.callback?s.callback:fn.nullFunction;if(s.duration!==undefined){this.animate({resolution:x,center:N,duration:s.duration,easing:s.easing},I)}else{this.setResolution(x);this.setCenter(N);setTimeout(I.bind(undefined,true),0)}};Ph.prototype.centerOn=function(t,i,s){var e=this.getRotation();var r=Math.cos(-e);var n=Math.sin(-e);var h=t[0]*r-t[1]*n;var a=t[1]*r+t[0]*n;var o=this.getResolution();h+=(i[0]/2-s[0])*o;a+=(s[1]-i[1]/2)*o;n=-n;var f=h*r-a*n;var u=a*r+h*n;this.setCenter([f,u])};Ph.prototype.isDef=function(){return!!this.getCenter()&&this.getResolution()!==undefined};Ph.prototype.rotate=function(t,i){if(i!==undefined){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)};Ph.prototype.setCenter=function(t){this.set(Oh.CENTER,t);if(this.getAnimating()){this.cancelAnimations()}};Ph.prototype.setHint=function(t,i){this.hints_[t]+=i;this.changed();return this.hints_[t]};Ph.prototype.setResolution=function(t){this.set(Oh.RESOLUTION,t);if(this.getAnimating()){this.cancelAnimations()}};Ph.prototype.setRotation=function(t){this.set(Oh.ROTATION,t);if(this.getAnimating()){this.cancelAnimations()}};Ph.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))};Ph.createCenterConstraint_=function(t){if(t.extent!==undefined){return Ch.createExtent(t.extent)}else{return Ch.none}};Ph.createResolutionConstraint_=function(t){var i;var s;var e;var r=28;var n=2;var h=t.minZoom!==undefined?t.minZoom:fn.DEFAULT_MIN_ZOOM;var a=t.maxZoom!==undefined?t.maxZoom:r;var o=t.zoomFactor!==undefined?t.zoomFactor:n;if(t.resolutions!==undefined){var f=t.resolutions;s=f[h];e=f[a]!==undefined?f[a]:f[f.length-1];i=Nh.createSnapToResolutions(f)}else{var u=Wn.createProjection(t.projection,"EPSG:3857");var l=u.getExtent();var v=!l?360*Wn.METERS_PER_UNIT[Tn.DEGREES]/u.getMetersPerUnit():Math.max(Nn.getWidth(l),Nn.getHeight(l));var c=v/fn.DEFAULT_TILE_SIZE/Math.pow(n,fn.DEFAULT_MIN_ZOOM);var d=c/Math.pow(n,r-fn.DEFAULT_MIN_ZOOM);s=t.maxResolution;if(s!==undefined){h=0}else{s=c/Math.pow(o,h)}e=t.minResolution;if(e===undefined){if(t.maxZoom!==undefined){if(t.maxResolution!==undefined){e=s/Math.pow(o,a)}else{e=c/Math.pow(o,a)}}else{e=d}}a=h+Math.floor(Math.log(s/e)/Math.log(o));e=s/Math.pow(o,a-h);i=Nh.createSnapToPower(o,s,a-h)}return{constraint:i,maxResolution:s,minResolution:e,minZoom:h,zoomFactor:o}};Ph.createRotationConstraint_=function(t){var i=t.enableRotation!==undefined?t.enableRotation:true;if(i){var s=t.constrainRotation;if(s===undefined||s===true){return Ih.createSnapToZero()}else if(s===false){return Ih.none}else if(typeof s==="number"){return Ih.createSnapToN(s)}else{return Ih.none}}else{return Ih.disable}};Ph.isNoopAnimation=function(t){if(t.sourceCenter&&t.targetCenter){if(!Ah.equals(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true};var Lh={};Lh.createCanvasContext2D=function(t,i){var s=document.createElement("CANVAS");if(t){s.width=t}if(i){s.height=i}return s.getContext("2d")};Lh.outerWidth=function(t){var i=t.offsetWidth;var s=getComputedStyle(t);i+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10);return i};Lh.outerHeight=function(t){var i=t.offsetHeight;var s=getComputedStyle(t);i+=parseInt(s.marginTop,10)+parseInt(s.marginBottom,10);return i};Lh.replaceNode=function(t,i){var s=i.parentNode;if(s){s.replaceChild(t,i)}};Lh.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null};Lh.removeChildren=function(t){while(t.lastChild){t.removeChild(t.lastChild)}};var Dh={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"};var Fh=function(t){_n.call(this);var i=vn.assign({},t);i[Dh.OPACITY]=t.opacity!==undefined?t.opacity:1;i[Dh.VISIBLE]=t.visible!==undefined?t.visible:true;i[Dh.Z_INDEX]=t.zIndex!==undefined?t.zIndex:0;i[Dh.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;i[Dh.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;this.setProperties(i);this.state_={layer:this,managed:true}};fn.inherits(Fh,_n);Fh.prototype.getType=function(){return this.type};Fh.prototype.getLayerState=function(){this.state_.opacity=xn.clamp(this.getOpacity(),0,1);this.state_.sourceState=this.getSourceState();this.state_.visible=this.getVisible();this.state_.extent=this.getExtent();this.state_.zIndex=this.getZIndex();this.state_.maxResolution=this.getMaxResolution();this.state_.minResolution=Math.max(this.getMinResolution(),0);return this.state_};Fh.prototype.getLayersArray=function(t){};Fh.prototype.getLayerStatesArray=function(t){};Fh.prototype.getExtent=function(){return this.get(Dh.EXTENT)};Fh.prototype.getMaxResolution=function(){return this.get(Dh.MAX_RESOLUTION)};Fh.prototype.getMinResolution=function(){return this.get(Dh.MIN_RESOLUTION)};Fh.prototype.getOpacity=function(){return this.get(Dh.OPACITY)};Fh.prototype.getSourceState=function(){};Fh.prototype.getVisible=function(){return this.get(Dh.VISIBLE)};Fh.prototype.getZIndex=function(){return this.get(Dh.Z_INDEX)};Fh.prototype.setExtent=function(t){this.set(Dh.EXTENT,t)};Fh.prototype.setMaxResolution=function(t){this.set(Dh.MAX_RESOLUTION,t)};Fh.prototype.setMinResolution=function(t){this.set(Dh.MIN_RESOLUTION,t)};Fh.prototype.setOpacity=function(t){this.set(Dh.OPACITY,t)};Fh.prototype.setVisible=function(t){this.set(Dh.VISIBLE,t)};Fh.prototype.setZIndex=function(t){this.set(Dh.Z_INDEX,t)};var Wh={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var Gh=function(t){var i=t||{};var s=vn.assign({},i);delete s.layers;var e=i.layers;Fh.call(this,s);this.layersListenerKeys_=[];this.listenerKeys_={};cn.listen(this,_n.getChangeEventType(Gh.Property_.LAYERS),this.handleLayersChanged_,this);if(e){if(Array.isArray(e)){e=new oh(e.slice(),{unique:true})}else{bn.assert(e instanceof oh,43);e=e}}else{e=new oh(undefined,{unique:true})}this.setLayers(e)};fn.inherits(Gh,Fh);Gh.prototype.handleLayerChange_=function(){this.changed()};Gh.prototype.handleLayersChanged_=function(t){this.layersListenerKeys_.forEach(cn.unlistenByKey);this.layersListenerKeys_.length=0;var i=this.getLayers();this.layersListenerKeys_.push(cn.listen(i,ah.ADD,this.handleLayersAdd_,this),cn.listen(i,ah.REMOVE,this.handleLayersRemove_,this));for(var s in this.listenerKeys_){this.listenerKeys_[s].forEach(cn.unlistenByKey)}vn.clear(this.listenerKeys_);var e=i.getArray();var r,n,h;for(r=0,n=e.length;r<n;r++){h=e[r];this.listenerKeys_[fn.getUid(h).toString()]=[cn.listen(h,ln.PROPERTYCHANGE,this.handleLayerChange_,this),cn.listen(h,zn.CHANGE,this.handleLayerChange_,this)]}this.changed()};Gh.prototype.handleLayersAdd_=function(t){var i=t.element;var s=fn.getUid(i).toString();this.listenerKeys_[s]=[cn.listen(i,ln.PROPERTYCHANGE,this.handleLayerChange_,this),cn.listen(i,zn.CHANGE,this.handleLayerChange_,this)];this.changed()};Gh.prototype.handleLayersRemove_=function(t){var i=t.element;var s=fn.getUid(i).toString();this.listenerKeys_[s].forEach(cn.unlistenByKey);delete this.listenerKeys_[s];this.changed()};Gh.prototype.getLayers=function(){return this.get(Gh.Property_.LAYERS)};Gh.prototype.setLayers=function(t){this.set(Gh.Property_.LAYERS,t)};Gh.prototype.getLayersArray=function(t){var i=t!==undefined?t:[];this.getLayers().forEach((function(t){t.getLayersArray(i)}));return i};Gh.prototype.getLayerStatesArray=function(t){var i=t!==undefined?t:[];var s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var e=this.getLayerState();var r,n,h;for(r=s,n=i.length;r<n;r++){h=i[r];h.opacity*=e.opacity;h.visible=h.visible&&e.visible;h.maxResolution=Math.min(h.maxResolution,e.maxResolution);h.minResolution=Math.max(h.minResolution,e.minResolution);if(e.extent!==undefined){if(h.extent!==undefined){h.extent=Nn.getIntersection(h.extent,e.extent)}else{h.extent=e.extent}}}return i};Gh.prototype.getSourceState=function(){return Wh.READY};Gh.Property_={LAYERS:"layers"};var Vh={MAP_RENDERER:"MAP_RENDERER",LAYER_RENDERER:"LAYER_RENDERER"};var jh={};jh.mapRendererPlugins_=[];jh.getMapRendererPlugins=function(){return jh.mapRendererPlugins_};jh.layerRendererPlugins_=[];jh.getLayerRendererPlugins=function(){return jh.layerRendererPlugins_};jh.register=function(t,i){var s;switch(t){case Vh.MAP_RENDERER:{s=jh.mapRendererPlugins_;s.push(i);break}case Vh.LAYER_RENDERER:{s=jh.layerRendererPlugins_;s.push(i);break}default:{throw new Error("Unsupported plugin type: "+t)}}};jh.registerMultiple=function(t,i){for(var s=0,e=i.length;s<e;++s){jh.register(t,i[s])}};var Uh={CANVAS:"canvas",WEBGL:"webgl"};var Xh={};Xh.buffer=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]+2*i;s[1]=t[1]+2*i;return s};Xh.hasArea=function(t){return t[0]>0&&t[1]>0};Xh.scale=function(t,i,s){if(s===undefined){s=[0,0]}s[0]=t[0]*i+.5|0;s[1]=t[1]*i+.5|0;return s};Xh.toSize=function(t,i){if(Array.isArray(t)){return t}else{if(i===undefined){i=[t,t]}else{i[0]=i[1]=t}return i}};var qh=function(t){_n.call(this);var i=qh.createOptionsInternal(t);this.loadTilesWhileAnimating_=t.loadTilesWhileAnimating!==undefined?t.loadTilesWhileAnimating:false;this.loadTilesWhileInteracting_=t.loadTilesWhileInteracting!==undefined?t.loadTilesWhileInteracting:false;this.pixelRatio_=t.pixelRatio!==undefined?t.pixelRatio:rh.DEVICE_PIXEL_RATIO;this.logos_=i.logos;this.animationDelay_=function(){this.animationDelayKey_=undefined;this.renderFrame_.call(this,Date.now())}.bind(this);this.coordinateToPixelTransform_=Gn.create();this.pixelToCoordinateTransform_=Gn.create();this.frameIndex_=0;this.frameState_=null;this.previousExtent_=null;this.viewPropertyListenerKey_=null;this.viewChangeListenerKey_=null;this.layerGroupPropertyListenerKeys_=null;this.viewport_=document.createElement("DIV");this.viewport_.className="ol-viewport"+(rh.TOUCH?" ol-touch":"");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.viewport_.style.msTouchAction="none";this.viewport_.style.touchAction="none";this.overlayContainer_=document.createElement("DIV");this.overlayContainer_.className="ol-overlaycontainer";this.viewport_.appendChild(this.overlayContainer_);this.overlayContainerStopEvent_=document.createElement("DIV");this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";var s=[zn.CLICK,zn.DBLCLICK,zn.MOUSEDOWN,zn.TOUCHSTART,zn.MSPOINTERDOWN,lh.POINTERDOWN,zn.MOUSEWHEEL,zn.WHEEL];for(var e=0,r=s.length;e<r;++e){cn.listen(this.overlayContainerStopEvent_,s[e],mn.stopPropagation)}this.viewport_.appendChild(this.overlayContainerStopEvent_);this.mapBrowserEventHandler_=new bh(this,t.moveTolerance);for(var n in lh){cn.listen(this.mapBrowserEventHandler_,lh[n],this.handleMapBrowserEvent,this)}this.keyboardEventTarget_=i.keyboardEventTarget;this.keyHandlerKeys_=null;cn.listen(this.viewport_,zn.WHEEL,this.handleBrowserEvent,this);cn.listen(this.viewport_,zn.MOUSEWHEEL,this.handleBrowserEvent,this);this.controls=i.controls||new oh;this.interactions=i.interactions||new oh;this.overlays_=i.overlays;this.overlayIdIndex_={};this.renderer_=i.mapRendererPlugin["create"](this.viewport_,this);this.focus_=null;this.postRenderFunctions_=[];this.tileQueue_=new Eh(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.skippedFeatureUids_={};cn.listen(this,_n.getChangeEventType(wh.LAYERGROUP),this.handleLayerGroupChanged_,this);cn.listen(this,_n.getChangeEventType(wh.VIEW),this.handleViewChanged_,this);cn.listen(this,_n.getChangeEventType(wh.SIZE),this.handleSizeChanged_,this);cn.listen(this,_n.getChangeEventType(wh.TARGET),this.handleTargetChanged_,this);this.setProperties(i.values);this.controls.forEach((function(t){t.setMap(this)}),this);cn.listen(this.controls,ah.ADD,(function(t){t.element.setMap(this)}),this);cn.listen(this.controls,ah.REMOVE,(function(t){t.element.setMap(null)}),this);this.interactions.forEach((function(t){t.setMap(this)}),this);cn.listen(this.interactions,ah.ADD,(function(t){t.element.setMap(this)}),this);cn.listen(this.interactions,ah.REMOVE,(function(t){t.element.setMap(null)}),this);this.overlays_.forEach(this.addOverlayInternal_,this);cn.listen(this.overlays_,ah.ADD,(function(t){this.addOverlayInternal_(t.element)}),this);cn.listen(this.overlays_,ah.REMOVE,(function(t){var i=t.element;var s=i.getId();if(s!==undefined){delete this.overlayIdIndex_[s.toString()]}t.element.setMap(null)}),this)};fn.inherits(qh,_n);qh.prototype.addControl=function(t){this.getControls().push(t)};qh.prototype.addInteraction=function(t){this.getInteractions().push(t)};qh.prototype.addLayer=function(t){var i=this.getLayerGroup().getLayers();i.push(t)};qh.prototype.addOverlay=function(t){this.getOverlays().push(t)};qh.prototype.addOverlayInternal_=function(t){var i=t.getId();if(i!==undefined){this.overlayIdIndex_[i.toString()]=t}t.setMap(this)};qh.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose();cn.unlisten(this.viewport_,zn.WHEEL,this.handleBrowserEvent,this);cn.unlisten(this.viewport_,zn.MOUSEWHEEL,this.handleBrowserEvent,this);if(this.handleResize_!==undefined){window.removeEventListener(zn.RESIZE,this.handleResize_,false);this.handleResize_=undefined}if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_);this.animationDelayKey_=undefined}this.setTarget(null);_n.prototype.disposeInternal.call(this)};qh.prototype.forEachFeatureAtPixel=function(t,i,s){if(!this.frameState_){return}var e=this.getCoordinateFromPixel(t);s=s!==undefined?s:{};var r=s.hitTolerance!==undefined?s.hitTolerance*this.frameState_.pixelRatio:0;var n=s.layerFilter!==undefined?s.layerFilter:Sn.TRUE;return this.renderer_.forEachFeatureAtCoordinate(e,this.frameState_,r,i,null,n,null)};qh.prototype.getFeaturesAtPixel=function(t,i){var s=null;this.forEachFeatureAtPixel(t,(function(t){if(!s){s=[]}s.push(t)}),i);return s};qh.prototype.forEachLayerAtPixel=function(t,i,s,e,r){if(!this.frameState_){return}var n=s!==undefined?s:null;var h=e!==undefined?e:Sn.TRUE;var a=r!==undefined?r:null;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,n,h,a)};qh.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_){return false}var s=this.getCoordinateFromPixel(t);i=i!==undefined?i:{};var e=i.layerFilter!==undefined?i.layerFilter:Sn.TRUE;var r=i.hitTolerance!==undefined?i.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,r,e,null)};qh.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))};qh.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect();var s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]};qh.prototype.getTarget=function(){return this.get(wh.TARGET)};qh.prototype.getTargetElement=function(){var t=this.getTarget();if(t!==undefined){return typeof t==="string"?document.getElementById(t):t}else{return null}};qh.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;if(!i){return null}else{return Gn.apply(i.pixelToCoordinateTransform,t.slice())}};qh.prototype.getControls=function(){return this.controls};qh.prototype.getOverlays=function(){return this.overlays_};qh.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return i!==undefined?i:null};qh.prototype.getInteractions=function(){return this.interactions};qh.prototype.getLayerGroup=function(){return this.get(wh.LAYERGROUP)};qh.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t};qh.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;if(!i){return null}else{return Gn.apply(i.coordinateToPixelTransform,t.slice(0,2))}};qh.prototype.getRenderer=function(){return this.renderer_};qh.prototype.getSize=function(){return this.get(wh.SIZE)};qh.prototype.getView=function(){return this.get(wh.VIEW)};qh.prototype.getViewport=function(){return this.viewport_};qh.prototype.getOverlayContainer=function(){return this.overlayContainer_};qh.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_};qh.prototype.getTilePriority=function(t,i,s,e){var r=this.frameState_;if(!r||!(i in r.wantedTiles)){return kh.DROP}if(!r.wantedTiles[i][t.getKey()]){return kh.DROP}var n=s[0]-r.focus[0];var h=s[1]-r.focus[1];return 65536*Math.log(e)+Math.sqrt(n*n+h*h)/e};qh.prototype.handleBrowserEvent=function(t,i){var s=i||t.type;var e=new uh(s,this,t);this.handleMapBrowserEvent(e)};qh.prototype.handleMapBrowserEvent=function(t){if(!this.frameState_){return}this.focus_=t.coordinate;t.frameState=this.frameState_;var i=this.getInteractions().getArray();var s;if(this.dispatchEvent(t)!==false){for(s=i.length-1;s>=0;s--){var e=i[s];if(!e.getActive()){continue}var r=e.handleEvent(t);if(!r){break}}}};qh.prototype.handlePostRender=function(){var t=this.frameState_;var i=this.tileQueue_;if(!i.isEmpty()){var s=16;var e=s;if(t){var r=t.viewHints;if(r[Sh.ANIMATING]){s=this.loadTilesWhileAnimating_?8:0;e=2}if(r[Sh.INTERACTING]){s=this.loadTilesWhileInteracting_?8:0;e=2}}if(i.getTilesLoading()<s){i.reprioritize();i.loadMoreTiles(s,e)}}var n=this.postRenderFunctions_;var h,a;for(h=0,a=n.length;h<a;++h){n[h](this,t)}n.length=0};qh.prototype.handleSizeChanged_=function(){this.render()};qh.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()){t=this.getTargetElement()}if(this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i){cn.unlistenByKey(this.keyHandlerKeys_[i])}this.keyHandlerKeys_=null}if(!t){this.renderer_.removeLayerRenderers();Lh.removeNode(this.viewport_);if(this.handleResize_!==undefined){window.removeEventListener(zn.RESIZE,this.handleResize_,false);this.handleResize_=undefined}}else{t.appendChild(this.viewport_);var e=!this.keyboardEventTarget_?t:this.keyboardEventTarget_;this.keyHandlerKeys_=[cn.listen(e,zn.KEYDOWN,this.handleBrowserEvent,this),cn.listen(e,zn.KEYPRESS,this.handleBrowserEvent,this)];if(!this.handleResize_){this.handleResize_=this.updateSize.bind(this);window.addEventListener(zn.RESIZE,this.handleResize_,false)}}this.updateSize()};qh.prototype.handleTileChange_=function(){this.render()};qh.prototype.handleViewPropertyChanged_=function(){this.render()};qh.prototype.handleViewChanged_=function(){if(this.viewPropertyListenerKey_){cn.unlistenByKey(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){cn.unlistenByKey(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}var t=this.getView();if(t){this.viewport_.setAttribute("data-view",fn.getUid(t));this.viewPropertyListenerKey_=cn.listen(t,ln.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=cn.listen(t,zn.CHANGE,this.handleViewPropertyChanged_,this)}this.render()};qh.prototype.handleLayerGroupChanged_=function(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(cn.unlistenByKey);this.layerGroupPropertyListenerKeys_=null}var t=this.getLayerGroup();if(t){this.layerGroupPropertyListenerKeys_=[cn.listen(t,ln.PROPERTYCHANGE,this.render,this),cn.listen(t,zn.CHANGE,this.render,this)]}this.render()};qh.prototype.isRendered=function(){return!!this.frameState_};qh.prototype.renderSync=function(){if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_)}this.animationDelay_()};qh.prototype.render=function(){if(this.animationDelayKey_===undefined){this.animationDelayKey_=requestAnimationFrame(this.animationDelay_)}};qh.prototype.removeControl=function(t){return this.getControls().remove(t)};qh.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)};qh.prototype.removeLayer=function(t){var i=this.getLayerGroup().getLayers();return i.remove(t)};qh.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)};qh.prototype.renderFrame_=function(t){var i,s,e;var r=this.getSize();var n=this.getView();var h=Nn.createEmpty();var a=this.frameState_;var o=null;if(r!==undefined&&Xh.hasArea(r)&&n&&n.isDef()){var f=n.getHints(this.frameState_?this.frameState_.viewHints:undefined);var u=this.getLayerGroup().getLayerStatesArray();var l={};for(i=0,s=u.length;i<s;++i){l[fn.getUid(u[i].layer)]=u[i]}e=n.getState();var v=e.center;var c=e.resolution/this.pixelRatio_;v[0]=Math.round(v[0]/c)*c;v[1]=Math.round(v[1]/c)*c;o={animate:false,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:h,focus:!this.focus_?v:this.focus_,index:this.frameIndex_++,layerStates:l,layerStatesArray:u,logos:vn.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:f,wantedTiles:{}}}if(o){o.extent=Nn.getForViewAndSize(e.center,e.resolution,e.rotation,o.size,h)}this.frameState_=o;this.renderer_.renderFrame(o);if(o){if(o.animate){this.render()}Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions);if(a){var d=!this.previousExtent_||!Nn.isEmpty(this.previousExtent_)&&!Nn.equals(o.extent,this.previousExtent_);if(d){this.dispatchEvent(new fh(xh.MOVESTART,this,a));this.previousExtent_=Nn.createOrUpdateEmpty(this.previousExtent_)}}var m=this.previousExtent_&&!o.viewHints[Sh.ANIMATING]&&!o.viewHints[Sh.INTERACTING]&&!Nn.equals(o.extent,this.previousExtent_);if(m){this.dispatchEvent(new fh(xh.MOVEEND,this,o));Nn.clone(o.extent,this.previousExtent_)}}this.dispatchEvent(new fh(xh.POSTRENDER,this,o));setTimeout(this.handlePostRender.bind(this),0)};qh.prototype.setLayerGroup=function(t){this.set(wh.LAYERGROUP,t)};qh.prototype.setSize=function(t){this.set(wh.SIZE,t)};qh.prototype.setTarget=function(t){this.set(wh.TARGET,t)};qh.prototype.setView=function(t){this.set(wh.VIEW,t)};qh.prototype.skipFeature=function(t){var i=fn.getUid(t).toString();this.skippedFeatureUids_[i]=true;this.render()};qh.prototype.updateSize=function(){var t=this.getTargetElement();if(!t){this.setSize(undefined)}else{var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i["borderLeftWidth"])-parseFloat(i["paddingLeft"])-parseFloat(i["paddingRight"])-parseFloat(i["borderRightWidth"]),t.offsetHeight-parseFloat(i["borderTopWidth"])-parseFloat(i["paddingTop"])-parseFloat(i["paddingBottom"])-parseFloat(i["borderBottomWidth"])])}};qh.prototype.unskipFeature=function(t){var i=fn.getUid(t).toString();delete this.skippedFeatureUids_[i];this.render()};qh.DEFAULT_RENDERER_TYPES=[Uh.CANVAS,Uh.WEBGL];qh.LOGO_URL="data:image/png;base64,"+"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBI"+"WXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAA"+"AhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszW"+"WMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvY"+"asvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvX"+"H1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1Vk"+"bMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW"+"2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLP"+"VcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqT"+"acrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaar"+"ldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+Hi"+"zeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDn"+"BAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSF"+"hYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJ"+"REFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxC"+"Brb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe"+"0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8"+"a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7a"+"hgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCn"+"B3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDg"+"q82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC";qh.createOptionsInternal=function(t){var i=null;if(t.keyboardEventTarget!==undefined){i=typeof t.keyboardEventTarget==="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget}var s={};var e={};if(t.logo===undefined||typeof t.logo==="boolean"&&t.logo){e[qh.LOGO_URL]="https://openlayers.org/"}else{var r=t.logo;if(typeof r==="string"){e[r]=""}else if(r instanceof HTMLElement){e[fn.getUid(r).toString()]=r}else if(r){bn.assert(typeof r.href=="string",44);bn.assert(typeof r.src=="string",45);e[r.src]=r.href}}var n=t.layers instanceof Gh?t.layers:new Gh({layers:t.layers});s[wh.LAYERGROUP]=n;s[wh.TARGET]=t.target;s[wh.VIEW]=t.view!==undefined?t.view:new Ph;var h;if(t.renderer!==undefined){if(Array.isArray(t.renderer)){h=t.renderer}else if(typeof t.renderer==="string"){h=[t.renderer]}else{bn.assert(false,46)}if(h.indexOf("dom")>=0){h=h.concat(qh.DEFAULT_RENDERER_TYPES)}}else{h=qh.DEFAULT_RENDERER_TYPES}var a;var o=jh.getMapRendererPlugins();t:for(var f=0,u=h.length;f<u;++f){var l=h[f];for(var v=0,c=o.length;v<c;++v){var d=o[v];if(d["handles"](l)){a=d;break t}}}if(!a){throw new Error("Unable to create a map renderer for types: "+h.join(", "))}var m;if(t.controls!==undefined){if(Array.isArray(t.controls)){m=new oh(t.controls.slice())}else{bn.assert(t.controls instanceof oh,47);m=t.controls}}var p;if(t.interactions!==undefined){if(Array.isArray(t.interactions)){p=new oh(t.interactions.slice())}else{bn.assert(t.interactions instanceof oh,48);p=t.interactions}}var z;if(t.overlays!==undefined){if(Array.isArray(t.overlays)){z=new oh(t.overlays.slice())}else{bn.assert(t.overlays instanceof oh,49);z=t.overlays}}else{z=new oh}return{controls:m,interactions:p,keyboardEventTarget:i,logos:e,overlays:z,mapRendererPlugin:a,values:s}};var Yh=function(t){_n.call(this);this.element=t.element?t.element:null;this.target_=null;this.map_=null;this.listenerKeys=[];this.render=t.render?t.render:fn.nullFunction;if(t.target){this.setTarget(t.target)}};fn.inherits(Yh,_n);Yh.prototype.disposeInternal=function(){Lh.removeNode(this.element);_n.prototype.disposeInternal.call(this)};Yh.prototype.getMap=function(){return this.map_};Yh.prototype.setMap=function(t){if(this.map_){Lh.removeNode(this.element)}for(var i=0,s=this.listenerKeys.length;i<s;++i){cn.unlistenByKey(this.listenerKeys[i])}this.listenerKeys.length=0;this.map_=t;if(this.map_){var e=this.target_?this.target_:t.getOverlayContainerStopEvent();e.appendChild(this.element);if(this.render!==fn.nullFunction){this.listenerKeys.push(cn.listen(t,xh.POSTRENDER,this.render,this))}t.render()}};Yh.prototype.setTarget=function(t){this.target_=typeof t==="string"?document.getElementById(t):t};var Bh={};Bh.CLASS_HIDDEN="ol-hidden";Bh.CLASS_SELECTABLE="ol-selectable";Bh.CLASS_UNSELECTABLE="ol-unselectable";Bh.CLASS_UNSUPPORTED="ol-unsupported";Bh.CLASS_CONTROL="ol-control";Bh.getFontFamilies=function(){var t;var i={};return function(s){if(!t){t=document.createElement("div").style}if(!(s in i)){t.font=s;var e=t.fontFamily;t.font="";if(!e){return null}i[s]=e.split(/,\s?/)}return i[s]}}();var Hh={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render"};var Jh=function(t){var i=vn.assign({},t);delete i.source;Fh.call(this,i);this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;if(t.map){this.setMap(t.map)}cn.listen(this,_n.getChangeEventType(Dh.SOURCE),this.handleSourcePropertyChange_,this);var s=t.source?t.source:null;this.setSource(s)};fn.inherits(Jh,Fh);Jh.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution};Jh.prototype.getLayersArray=function(t){var i=t?t:[];i.push(this);return i};Jh.prototype.getLayerStatesArray=function(t){var i=t?t:[];i.push(this.getLayerState());return i};Jh.prototype.getSource=function(){var t=this.get(Dh.SOURCE);return t||null};Jh.prototype.getSourceState=function(){var t=this.getSource();return!t?Wh.UNDEFINED:t.getState()};Jh.prototype.handleSourceChange_=function(){this.changed()};Jh.prototype.handleSourcePropertyChange_=function(){if(this.sourceChangeKey_){cn.unlistenByKey(this.sourceChangeKey_);this.sourceChangeKey_=null}var t=this.getSource();if(t){this.sourceChangeKey_=cn.listen(t,zn.CHANGE,this.handleSourceChange_,this)}this.changed()};Jh.prototype.setMap=function(t){if(this.mapPrecomposeKey_){cn.unlistenByKey(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){cn.unlistenByKey(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=cn.listen(t,Hh.PRECOMPOSE,(function(t){var i=this.getLayerState();i.managed=false;i.zIndex=Infinity;t.frameState.layerStatesArray.push(i);t.frameState.layerStates[fn.getUid(this)]=i}),this);this.mapRenderKey_=cn.listen(this,zn.CHANGE,t.render,t);this.changed()}};Jh.prototype.setSource=function(t){this.set(Dh.SOURCE,t)};var Zh=function(t){var i=t?t:{};this.ulElement_=document.createElement("UL");this.logoLi_=document.createElement("LI");this.ulElement_.appendChild(this.logoLi_);this.logoLi_.style.display="none";this.collapsed_=i.collapsed!==undefined?i.collapsed:true;this.collapsible_=i.collapsible!==undefined?i.collapsible:true;if(!this.collapsible_){this.collapsed_=false}var s=i.className!==undefined?i.className:"ol-attribution";var e=i.tipLabel!==undefined?i.tipLabel:"Attributions";var r=i.collapseLabel!==undefined?i.collapseLabel:"»";if(typeof r==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=r}else{this.collapseLabel_=r}var n=i.label!==undefined?i.label:"i";if(typeof n==="string"){this.label_=document.createElement("span");this.label_.textContent=n}else{this.label_=n}var h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;var a=document.createElement("button");a.setAttribute("type","button");a.title=e;a.appendChild(h);cn.listen(a,zn.CLICK,this.handleClick_,this);var o=s+" "+Bh.CLASS_UNSELECTABLE+" "+Bh.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible");var f=document.createElement("div");f.className=o;f.appendChild(this.ulElement_);f.appendChild(a);var u=i.render?i.render:Zh.render;Yh.call(this,{element:f,render:u,target:i.target});this.renderedAttributions_=[];this.renderedVisible_=true;this.logoElements_={}};fn.inherits(Zh,Yh);Zh.prototype.getSourceAttributions_=function(t){var i={};var s=[];var e=t.layerStatesArray;var r=t.viewState.resolution;for(var n=0,h=e.length;n<h;++n){var a=e[n];if(!Jh.visibleAtResolution(a,r)){continue}var o=a.layer.getSource();if(!o){continue}var f=o.getAttributions2();if(!f){continue}var u=f(t);if(!u){continue}if(Array.isArray(u)){for(var l=0,v=u.length;l<v;++l){if(!(u[l]in i)){s.push(u[l]);i[u[l]]=true}}}else{if(!(u in i)){s.push(u);i[u]=true}}}return s};Zh.render=function(t){this.updateElement_(t.frameState)};Zh.prototype.updateElement_=function(t){if(!t){if(this.renderedVisible_){this.element.style.display="none";this.renderedVisible_=false}return}var i=this.getSourceAttributions_(t);if(kn.equals(i,this.renderedAttributions_)){return}while(this.ulElement_.lastChild!==this.logoLi_){this.ulElement_.removeChild(this.ulElement_.lastChild)}for(var s=0,e=i.length;s<e;++s){var r=document.createElement("LI");r.innerHTML=i[s];this.ulElement_.appendChild(r)}if(i.length===0&&this.renderedAttributions_.length>0){this.element.classList.add("ol-logo-only")}else if(this.renderedAttributions_.length===0&&i.length>0){this.element.classList.remove("ol-logo-only")}var n=i.length>0||!vn.isEmpty(t.logos);if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}this.renderedAttributions_=i;this.insertLogos_(t)};Zh.prototype.insertLogos_=function(t){var i;var s=t.logos;var e=this.logoElements_;for(i in e){if(!(i in s)){Lh.removeNode(e[i]);delete e[i]}}var r,n,h;for(h in s){var a=s[h];if(a instanceof HTMLElement){this.logoLi_.appendChild(a);e[h]=a}if(!(h in e)){r=new Image;r.src=h;if(a===""){n=r}else{n=document.createElement("a");n.href=a;n.appendChild(r)}this.logoLi_.appendChild(n);e[h]=n}}this.logoLi_.style.display=!vn.isEmpty(s)?"":"none"};Zh.prototype.handleClick_=function(t){t.preventDefault();this.handleToggle_()};Zh.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed");if(this.collapsed_){Lh.replaceNode(this.collapseLabel_,this.label_)}else{Lh.replaceNode(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_};Zh.prototype.getCollapsible=function(){return this.collapsible_};Zh.prototype.setCollapsible=function(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(!t&&this.collapsed_){this.handleToggle_()}};Zh.prototype.setCollapsed=function(t){if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()};Zh.prototype.getCollapsed=function(){return this.collapsed_};var $h=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-rotate";var e=i.label!==undefined?i.label:"⇧";this.label_=null;if(typeof e==="string"){this.label_=document.createElement("span");this.label_.className="ol-compass";this.label_.textContent=e}else{this.label_=e;this.label_.classList.add("ol-compass")}var r=i.tipLabel?i.tipLabel:"Reset rotation";var n=document.createElement("button");n.className=s+"-reset";n.setAttribute("type","button");n.title=r;n.appendChild(this.label_);cn.listen(n,zn.CLICK,$h.prototype.handleClick_,this);var h=s+" "+Bh.CLASS_UNSELECTABLE+" "+Bh.CLASS_CONTROL;var a=document.createElement("div");a.className=h;a.appendChild(n);var o=i.render?i.render:$h.render;this.callResetNorth_=i.resetNorth?i.resetNorth:undefined;Yh.call(this,{element:a,render:o,target:i.target});this.duration_=i.duration!==undefined?i.duration:250;this.autoHide_=i.autoHide!==undefined?i.autoHide:true;this.rotation_=undefined;if(this.autoHide_){this.element.classList.add(Bh.CLASS_HIDDEN)}};fn.inherits($h,Yh);$h.prototype.handleClick_=function(t){t.preventDefault();if(this.callResetNorth_!==undefined){this.callResetNorth_()}else{this.resetNorth_()}};$h.prototype.resetNorth_=function(){var t=this.getMap();var i=t.getView();if(!i){return}if(i.getRotation()!==undefined){if(this.duration_>0){i.animate({rotation:0,duration:this.duration_,easing:Rh.easeOut})}else{i.setRotation(0)}}};$h.render=function(t){var i=t.frameState;if(!i){return}var s=i.viewState.rotation;if(s!=this.rotation_){var e="rotate("+s+"rad)";if(this.autoHide_){var r=this.element.classList.contains(Bh.CLASS_HIDDEN);if(!r&&s===0){this.element.classList.add(Bh.CLASS_HIDDEN)}else if(r&&s!==0){this.element.classList.remove(Bh.CLASS_HIDDEN)}}this.label_.style.msTransform=e;this.label_.style.webkitTransform=e;this.label_.style.transform=e}this.rotation_=s};var Kh=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-zoom";var e=i.delta!==undefined?i.delta:1;var r=i.zoomInLabel!==undefined?i.zoomInLabel:"+";var n=i.zoomOutLabel!==undefined?i.zoomOutLabel:"−";var h=i.zoomInTipLabel!==undefined?i.zoomInTipLabel:"Zoom in";var a=i.zoomOutTipLabel!==undefined?i.zoomOutTipLabel:"Zoom out";var o=document.createElement("button");o.className=s+"-in";o.setAttribute("type","button");o.title=h;o.appendChild(typeof r==="string"?document.createTextNode(r):r);cn.listen(o,zn.CLICK,Kh.prototype.handleClick_.bind(this,e));var f=document.createElement("button");f.className=s+"-out";f.setAttribute("type","button");f.title=a;f.appendChild(typeof n==="string"?document.createTextNode(n):n);cn.listen(f,zn.CLICK,Kh.prototype.handleClick_.bind(this,-e));var u=s+" "+Bh.CLASS_UNSELECTABLE+" "+Bh.CLASS_CONTROL;var l=document.createElement("div");l.className=u;l.appendChild(o);l.appendChild(f);Yh.call(this,{element:l,target:i.target});this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(Kh,Yh);Kh.prototype.handleClick_=function(t,i){i.preventDefault();this.zoomByDelta_(t)};Kh.prototype.zoomByDelta_=function(t){var i=this.getMap();var s=i.getView();if(!s){return}var e=s.getResolution();if(e){var r=s.constrainResolution(e,t);if(this.duration_>0){if(s.getAnimating()){s.cancelAnimations()}s.animate({resolution:r,duration:this.duration_,easing:Rh.easeOut})}else{s.setResolution(r)}}};var Qh={};Qh.defaults=function(t){var i=t?t:{};var s=new oh;var e=i.zoom!==undefined?i.zoom:true;if(e){s.push(new Kh(i.zoomOptions))}var r=i.rotate!==undefined?i.rotate:true;if(r){s.push(new $h(i.rotateOptions))}var n=i.attribution!==undefined?i.attribution:true;if(n){s.push(new Zh(i.attributionOptions))}return s};var ta=function(t,i,s){this.decay_=t;this.minVelocity_=i;this.delay_=s;this.points_=[];this.angle_=0;this.initialVelocity_=0};ta.prototype.begin=function(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0};ta.prototype.update=function(t,i){this.points_.push(t,i,Date.now())};ta.prototype.end=function(){if(this.points_.length<6){return false}var t=Date.now()-this.delay_;var i=this.points_.length-3;if(this.points_[i+2]<t){return false}var s=i-3;while(s>0&&this.points_[s+2]>t){s-=3}var e=this.points_[i+2]-this.points_[s+2];if(e<1e3/60){return false}var r=this.points_[i]-this.points_[s];var n=this.points_[i+1]-this.points_[s+1];this.angle_=Math.atan2(n,r);this.initialVelocity_=Math.sqrt(r*r+n*n)/e;return this.initialVelocity_>this.minVelocity_};ta.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_};ta.prototype.getAngle=function(){return this.angle_};var ia={ACTIVE:"active"};var sa=function(t){_n.call(this);this.map_=null;this.setActive(true);this.handleEvent=t.handleEvent};fn.inherits(sa,_n);sa.prototype.getActive=function(){return this.get(ia.ACTIVE)};sa.prototype.getMap=function(){return this.map_};sa.prototype.setActive=function(t){this.set(ia.ACTIVE,t)};sa.prototype.setMap=function(t){this.map_=t};sa.pan=function(t,i,s){var e=t.getCenter();if(e){var r=t.constrainCenter([e[0]+i[0],e[1]+i[1]]);if(s){t.animate({duration:s,easing:Rh.linear,center:r})}else{t.setCenter(r)}}};sa.rotate=function(t,i,s,e){i=t.constrainRotation(i,0);sa.rotateWithoutConstraints(t,i,s,e)};sa.rotateWithoutConstraints=function(t,i,s,e){if(i!==undefined){var r=t.getRotation();var n=t.getCenter();if(r!==undefined&&n&&e>0){t.animate({rotation:i,anchor:s,duration:e,easing:Rh.easeOut})}else{t.rotate(i,s)}}};sa.zoom=function(t,i,s,e,r){i=t.constrainResolution(i,0,r);sa.zoomWithoutConstraints(t,i,s,e)};sa.zoomByDelta=function(t,i,s,e){var r=t.getResolution();var n=t.constrainResolution(r,i,0);if(n!==undefined){var h=t.getResolutions();n=xn.clamp(n,t.getMinResolution()||h[h.length-1],t.getMaxResolution()||h[0])}if(s&&n!==undefined&&n!==r){var a=t.getCenter();var o=t.calculateCenterZoom(n,s);o=t.constrainCenter(o);s=[(n*a[0]-r*o[0])/(n-r),(n*a[1]-r*o[1])/(n-r)]}sa.zoomWithoutConstraints(t,n,s,e)};sa.zoomWithoutConstraints=function(t,i,s,e){if(i){var r=t.getResolution();var n=t.getCenter();if(r!==undefined&&n&&i!==r&&e){t.animate({resolution:i,anchor:s,duration:e,easing:Rh.easeOut})}else{if(s){var h=t.calculateCenterZoom(i,s);t.setCenter(h)}t.setResolution(i)}}};var ea=function(t){var i=t?t:{};this.delta_=i.delta?i.delta:1;sa.call(this,{handleEvent:ea.handleEvent});this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(ea,sa);ea.handleEvent=function(t){var i=false;var s=t.originalEvent;if(t.type==lh.DBLCLICK){var e=t.map;var r=t.coordinate;var n=s.shiftKey?-this.delta_:this.delta_;var h=e.getView();sa.zoomByDelta(h,n,r,this.duration_);t.preventDefault();i=true}return!i};var ra={};ra.altKeyOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};ra.altShiftKeysOnly=function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};ra.always=Sn.TRUE;ra.click=function(t){return t.type==lh.CLICK};ra.mouseActionButton=function(t){var i=t.originalEvent;return i.button==0&&!(rh.WEBKIT&&rh.MAC&&i.ctrlKey)};ra.never=Sn.FALSE;ra.pointerMove=function(t){return t.type=="pointermove"};ra.singleClick=function(t){return t.type==lh.SINGLECLICK};ra.doubleClick=function(t){return t.type==lh.DBLCLICK};ra.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey};ra.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(rh.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey};ra.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey};ra.targetNotEditable=function(t){var i=t.originalEvent.target;var s=i.tagName;return s!=="INPUT"&&s!=="SELECT"&&s!=="TEXTAREA"};ra.mouseOnly=function(t){bn.assert(t.pointerEvent,56);return t.pointerEvent.pointerType=="mouse"};ra.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&i.button===0};var na=function(t){var i=t?t:{};var s=i.handleEvent?i.handleEvent:na.handleEvent;sa.call(this,{handleEvent:s});this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:na.handleDownEvent;this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:na.handleDragEvent;this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:na.handleMoveEvent;this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:na.handleUpEvent;this.handlingDownUpSequence=false;this.trackedPointers_={};this.targetPointers=[]};fn.inherits(na,sa);na.centroid=function(t){var i=t.length;var s=0;var e=0;for(var r=0;r<i;r++){s+=t[r].clientX;e+=t[r].clientY}return[s/i,e/i]};na.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===lh.POINTERDOWN||i===lh.POINTERDRAG||i===lh.POINTERUP};na.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent;var s=i.pointerId.toString();if(t.type==lh.POINTERUP){delete this.trackedPointers_[s]}else if(t.type==lh.POINTERDOWN){this.trackedPointers_[s]=i}else if(s in this.trackedPointers_){this.trackedPointers_[s]=i}this.targetPointers=vn.getValues(this.trackedPointers_)}};na.handleDragEvent=fn.nullFunction;na.handleUpEvent=Sn.FALSE;na.handleDownEvent=Sn.FALSE;na.handleMoveEvent=fn.nullFunction;na.handleEvent=function(t){if(!(t instanceof vh)){return true}var i=false;this.updateTrackedPointers_(t);if(this.handlingDownUpSequence){if(t.type==lh.POINTERDRAG){this.handleDragEvent_(t)}else if(t.type==lh.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else{if(t.type==lh.POINTERDOWN){var e=this.handleDownEvent_(t);this.handlingDownUpSequence=e;i=this.shouldStopEvent(e)}else if(t.type==lh.POINTERMOVE){this.handleMoveEvent_(t)}}return!i};na.prototype.shouldStopEvent=function(t){return t};var ha=function(t){na.call(this,{handleDownEvent:ha.handleDownEvent_,handleDragEvent:ha.handleDragEvent_,handleUpEvent:ha.handleUpEvent_});var i=t?t:{};this.kinetic_=i.kinetic;this.lastCentroid=null;this.condition_=i.condition?i.condition:ra.noModifierKeys;this.noKinetic_=false};fn.inherits(ha,na);ha.handleDragEvent_=function(t){var i=this.targetPointers;var s=na.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_){this.kinetic_.update(s[0],s[1])}if(this.lastCentroid){var e=this.lastCentroid[0]-s[0];var r=s[1]-this.lastCentroid[1];var n=t.map;var h=n.getView();var a=h.getState();var o=[e,r];Ah.scale(o,a.resolution);Ah.rotate(o,a.rotation);Ah.add(o,a.center);o=h.constrainCenter(o);h.setCenter(o)}}else if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=s;this.lastPointersCount_=i.length};ha.handleUpEvent_=function(t){var i=t.map;var s=i.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var e=this.kinetic_.getDistance();var r=this.kinetic_.getAngle();var n=s.getCenter();var h=i.getPixelFromCoordinate(n);var a=i.getCoordinateFromPixel([h[0]-e*Math.cos(r),h[1]-e*Math.sin(r)]);s.animate({center:s.constrainCenter(a),duration:500,easing:Rh.easeOut})}s.setHint(Sh.INTERACTING,-1);return false}else{if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=null;return true}};ha.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map;var s=i.getView();this.lastCentroid=null;if(!this.handlingDownUpSequence){s.setHint(Sh.INTERACTING,1)}if(s.getAnimating()){s.setCenter(t.frameState.viewState.center)}if(this.kinetic_){this.kinetic_.begin()}this.noKinetic_=this.targetPointers.length>1;return true}else{return false}};ha.prototype.shouldStopEvent=Sn.FALSE;var aa=function(t){var i=t?t:{};na.call(this,{handleDownEvent:aa.handleDownEvent_,handleDragEvent:aa.handleDragEvent_,handleUpEvent:aa.handleUpEvent_});this.condition_=i.condition?i.condition:ra.altShiftKeysOnly;this.lastAngle_=undefined;this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(aa,na);aa.handleDragEvent_=function(t){if(!ra.mouseOnly(t)){return}var i=t.map;var s=i.getView();if(s.getConstraints().rotation===Ih.disable){return}var e=i.getSize();var r=t.pixel;var n=Math.atan2(e[1]/2-r[1],r[0]-e[0]/2);if(this.lastAngle_!==undefined){var h=n-this.lastAngle_;var a=s.getRotation();sa.rotateWithoutConstraints(s,a-h)}this.lastAngle_=n};aa.handleUpEvent_=function(t){if(!ra.mouseOnly(t)){return true}var i=t.map;var s=i.getView();s.setHint(Sh.INTERACTING,-1);var e=s.getRotation();sa.rotate(s,e,undefined,this.duration_);return false};aa.handleDownEvent_=function(t){if(!ra.mouseOnly(t)){return false}if(ra.mouseActionButton(t)&&this.condition_(t)){var i=t.map;i.getView().setHint(Sh.INTERACTING,1);this.lastAngle_=undefined;return true}else{return false}};aa.prototype.shouldStopEvent=Sn.FALSE;var oa=function(t){this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null};fn.inherits(oa,dn);oa.prototype.disposeInternal=function(){this.setMap(null)};oa.prototype.render_=function(){var t=this.startPixel_;var i=this.endPixel_;var s="px";var e=this.element_.style;e.left=Math.min(t[0],i[0])+s;e.top=Math.min(t[1],i[1])+s;e.width=Math.abs(i[0]-t[0])+s;e.height=Math.abs(i[1]-t[1])+s};oa.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t;if(this.map_){this.map_.getOverlayContainer().appendChild(this.element_)}};oa.prototype.setPixels=function(t,i){this.startPixel_=t;this.endPixel_=i;this.createOrUpdateGeometry();this.render_()};oa.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_;var i=this.endPixel_;var s=[t,[t[0],i[1]],i,[i[0],t[1]]];var e=s.map(this.map_.getCoordinateFromPixel,this.map_);e[4]=e[0].slice();if(!this.geometry_){this.geometry_=new sh([e])}else{this.geometry_.setCoordinates([e])}};oa.prototype.getGeometry=function(){return this.geometry_};var fa=function(t){na.call(this,{handleDownEvent:fa.handleDownEvent_,handleDragEvent:fa.handleDragEvent_,handleUpEvent:fa.handleUpEvent_});var i=t?t:{};this.box_=new oa(i.className||"ol-dragbox");this.minArea_=i.minArea!==undefined?i.minArea:64;this.startPixel_=null;this.condition_=i.condition?i.condition:ra.always;this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:fa.defaultBoxEndCondition};fn.inherits(fa,na);fa.defaultBoxEndCondition=function(t,i,s){var e=s[0]-i[0];var r=s[1]-i[1];return e*e+r*r>=this.minArea_};fa.handleDragEvent_=function(t){if(!ra.mouseOnly(t)){return}this.box_.setPixels(this.startPixel_,t.pixel);this.dispatchEvent(new fa.Event(fa.EventType_.BOXDRAG,t.coordinate,t))};fa.prototype.getGeometry=function(){return this.box_.getGeometry()};fa.prototype.onBoxEnd=fn.nullFunction;fa.handleUpEvent_=function(t){if(!ra.mouseOnly(t)){return true}this.box_.setMap(null);if(this.boxEndCondition_(t,this.startPixel_,t.pixel)){this.onBoxEnd(t);this.dispatchEvent(new fa.Event(fa.EventType_.BOXEND,t.coordinate,t))}return false};fa.handleDownEvent_=function(t){if(!ra.mouseOnly(t)){return false}if(ra.mouseActionButton(t)&&this.condition_(t)){this.startPixel_=t.pixel;this.box_.setMap(t.map);this.box_.setPixels(this.startPixel_,this.startPixel_);this.dispatchEvent(new fa.Event(fa.EventType_.BOXSTART,t.coordinate,t));return true}else{return false}};fa.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"};fa.Event=function(t,i,s){mn.call(this,t);this.coordinate=i;this.mapBrowserEvent=s};fn.inherits(fa.Event,mn);var ua=function(t){var i=t?t:{};var s=i.condition?i.condition:ra.shiftKeyOnly;this.duration_=i.duration!==undefined?i.duration:200;this.out_=i.out!==undefined?i.out:false;fa.call(this,{condition:s,className:i.className||"ol-dragzoom"})};fn.inherits(ua,fa);ua.prototype.onBoxEnd=function(){var t=this.getMap();var i=t.getView();var s=t.getSize();var e=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtent(s);var n=Nn.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(Nn.getBottomLeft(e)),t.getPixelFromCoordinate(Nn.getTopRight(e))]);var h=i.getResolutionForExtent(n,s);Nn.scaleFromCenter(r,1/h);e=r}var a=i.constrainResolution(i.getResolutionForExtent(e,s));var o=Nn.getCenter(e);o=i.constrainCenter(o);i.animate({resolution:a,center:o,duration:this.duration_,easing:Rh.easeOut})};var la={LEFT:37,UP:38,RIGHT:39,DOWN:40};var va=function(t){sa.call(this,{handleEvent:va.handleEvent});var i=t||{};this.defaultCondition_=function(t){return ra.noModifierKeys(t)&&ra.targetNotEditable(t)};this.condition_=i.condition!==undefined?i.condition:this.defaultCondition_;this.duration_=i.duration!==undefined?i.duration:100;this.pixelDelta_=i.pixelDelta!==undefined?i.pixelDelta:128};fn.inherits(va,sa);va.handleEvent=function(t){var i=false;if(t.type==zn.KEYDOWN){var s=t.originalEvent;var e=s.keyCode;if(this.condition_(t)&&(e==la.DOWN||e==la.LEFT||e==la.RIGHT||e==la.UP)){var r=t.map;var n=r.getView();var h=n.getResolution()*this.pixelDelta_;var a=0,o=0;if(e==la.DOWN){o=-h}else if(e==la.LEFT){a=-h}else if(e==la.RIGHT){a=h}else{o=h}var f=[a,o];Ah.rotate(f,n.getRotation());sa.pan(n,f,this.duration_);t.preventDefault();i=true}}return!i};var ca=function(t){sa.call(this,{handleEvent:ca.handleEvent});var i=t?t:{};this.condition_=i.condition?i.condition:ra.targetNotEditable;this.delta_=i.delta?i.delta:1;this.duration_=i.duration!==undefined?i.duration:100};fn.inherits(ca,sa);ca.handleEvent=function(t){var i=false;if(t.type==zn.KEYDOWN||t.type==zn.KEYPRESS){var s=t.originalEvent;var e=s.charCode;if(this.condition_(t)&&(e=="+".charCodeAt(0)||e=="-".charCodeAt(0))){var r=t.map;var n=e=="+".charCodeAt(0)?this.delta_:-this.delta_;var h=r.getView();sa.zoomByDelta(h,n,undefined,this.duration_);t.preventDefault();i=true}}return!i};var da=function(t){sa.call(this,{handleEvent:da.handleEvent});var i=t||{};this.delta_=0;this.duration_=i.duration!==undefined?i.duration:250;this.timeout_=i.timeout!==undefined?i.timeout:80;this.useAnchor_=i.useAnchor!==undefined?i.useAnchor:true;this.constrainResolution_=i.constrainResolution||false;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined;this.mode_=undefined;this.trackpadEventGap_=400;this.trackpadTimeoutId_=undefined;this.trackpadDeltaPerZoom_=300;this.trackpadZoomBuffer_=1.5};fn.inherits(da,sa);da.handleEvent=function(t){var i=t.type;if(i!==zn.WHEEL&&i!==zn.MOUSEWHEEL){return true}t.preventDefault();var s=t.map;var e=t.originalEvent;if(this.useAnchor_){this.lastAnchor_=t.coordinate}var r;if(t.type==zn.WHEEL){r=e.deltaY;if(rh.FIREFOX&&e.deltaMode===WheelEvent.DOM_DELTA_PIXEL){r/=rh.DEVICE_PIXEL_RATIO}if(e.deltaMode===WheelEvent.DOM_DELTA_LINE){r*=40}}else if(t.type==zn.MOUSEWHEEL){r=-e.wheelDeltaY;if(rh.SAFARI){r/=3}}if(r===0){return false}var n=Date.now();if(this.startTime_===undefined){this.startTime_=n}if(!this.mode_||n-this.startTime_>this.trackpadEventGap_){this.mode_=Math.abs(r)<4?da.Mode_.TRACKPAD:da.Mode_.WHEEL}if(this.mode_===da.Mode_.TRACKPAD){var h=s.getView();if(this.trackpadTimeoutId_){clearTimeout(this.trackpadTimeoutId_)}else{h.setHint(Sh.INTERACTING,1)}this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=h.getResolution()*Math.pow(2,r/this.trackpadDeltaPerZoom_);var o=h.getMinResolution();var f=h.getMaxResolution();var u=0;if(a<o){a=Math.max(a,o/this.trackpadZoomBuffer_);u=1}else if(a>f){a=Math.min(a,f*this.trackpadZoomBuffer_);u=-1}if(this.lastAnchor_){var l=h.calculateCenterZoom(a,this.lastAnchor_);h.setCenter(h.constrainCenter(l))}h.setResolution(a);if(u===0&&this.constrainResolution_){h.animate({resolution:h.constrainResolution(a,r>0?-1:1),easing:Rh.easeOut,anchor:this.lastAnchor_,duration:this.duration_})}if(u>0){h.animate({resolution:o,easing:Rh.easeOut,anchor:this.lastAnchor_,duration:500})}else if(u<0){h.animate({resolution:f,easing:Rh.easeOut,anchor:this.lastAnchor_,duration:500})}this.startTime_=n;return false}this.delta_+=r;var v=Math.max(this.timeout_-(n-this.startTime_),0);clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,s),v);return false};da.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=undefined;var t=this.getMap().getView();t.setHint(Sh.INTERACTING,-1)};da.prototype.handleWheelZoom_=function(t){var i=t.getView();if(i.getAnimating()){i.cancelAnimations()}var s=fn.MOUSEWHEELZOOM_MAXDELTA;var e=xn.clamp(this.delta_,-s,s);sa.zoomByDelta(i,-e,this.lastAnchor_,this.duration_);this.mode_=undefined;this.delta_=0;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined};da.prototype.setMouseAnchor=function(t){this.useAnchor_=t;if(!t){this.lastAnchor_=null}};da.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var ma=function(t){na.call(this,{handleDownEvent:ma.handleDownEvent_,handleDragEvent:ma.handleDragEvent_,handleUpEvent:ma.handleUpEvent_});var i=t||{};this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;this.threshold_=i.threshold!==undefined?i.threshold:.3;this.duration_=i.duration!==undefined?i.duration:250};fn.inherits(ma,na);ma.handleDragEvent_=function(t){var i=0;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=Math.atan2(e.clientY-s.clientY,e.clientX-s.clientX);if(this.lastAngle_!==undefined){var n=r-this.lastAngle_;this.rotationDelta_+=n;if(!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_){this.rotating_=true}i=n}this.lastAngle_=r;var h=t.map;var a=h.getView();if(a.getConstraints().rotation===Ih.disable){return}var o=h.getViewport().getBoundingClientRect();var f=na.centroid(this.targetPointers);f[0]-=o.left;f[1]-=o.top;this.anchor_=h.getCoordinateFromPixel(f);if(this.rotating_){var u=a.getRotation();h.render();sa.rotateWithoutConstraints(a,u+i,this.anchor_)}};ma.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Sh.INTERACTING,-1);if(this.rotating_){var e=s.getRotation();sa.rotate(s,e,this.anchor_,this.duration_)}return false}else{return true}};ma.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;if(!this.handlingDownUpSequence){i.getView().setHint(Sh.INTERACTING,1)}return true}else{return false}};ma.prototype.shouldStopEvent=Sn.FALSE;var pa=function(t){na.call(this,{handleDownEvent:pa.handleDownEvent_,handleDragEvent:pa.handleDragEvent_,handleUpEvent:pa.handleUpEvent_});var i=t?t:{};this.constrainResolution_=i.constrainResolution||false;this.anchor_=null;this.duration_=i.duration!==undefined?i.duration:400;this.lastDistance_=undefined;this.lastScaleDelta_=1};fn.inherits(pa,na);pa.handleDragEvent_=function(t){var i=1;var s=this.targetPointers[0];var e=this.targetPointers[1];var r=s.clientX-e.clientX;var n=s.clientY-e.clientY;var h=Math.sqrt(r*r+n*n);if(this.lastDistance_!==undefined){i=this.lastDistance_/h}this.lastDistance_=h;var a=t.map;var o=a.getView();var f=o.getResolution();var u=o.getMaxResolution();var l=o.getMinResolution();var v=f*i;if(v>u){i=u/f;v=u}else if(v<l){i=l/f;v=l}if(i!=1){this.lastScaleDelta_=i}var c=a.getViewport().getBoundingClientRect();var d=na.centroid(this.targetPointers);d[0]-=c.left;d[1]-=c.top;this.anchor_=a.getCoordinateFromPixel(d);a.render();sa.zoomWithoutConstraints(o,v,this.anchor_)};pa.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map;var s=i.getView();s.setHint(Sh.INTERACTING,-1);var e=s.getResolution();if(this.constrainResolution_||e<s.getMinResolution()||e>s.getMaxResolution()){var r=this.lastScaleDelta_-1;sa.zoom(s,e,this.anchor_,this.duration_,r)}return false}else{return true}};pa.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;this.anchor_=null;this.lastDistance_=undefined;this.lastScaleDelta_=1;if(!this.handlingDownUpSequence){i.getView().setHint(Sh.INTERACTING,1)}return true}else{return false}};pa.prototype.shouldStopEvent=Sn.FALSE;var za={};za.defaults=function(t){var i=t?t:{};var s=new oh;var e=new ta(-.005,.05,100);var r=i.altShiftDragRotate!==undefined?i.altShiftDragRotate:true;if(r){s.push(new aa)}var n=i.doubleClickZoom!==undefined?i.doubleClickZoom:true;if(n){s.push(new ea({delta:i.zoomDelta,duration:i.zoomDuration}))}var h=i.dragPan!==undefined?i.dragPan:true;if(h){s.push(new ha({kinetic:e}))}var a=i.pinchRotate!==undefined?i.pinchRotate:true;if(a){s.push(new ma)}var o=i.pinchZoom!==undefined?i.pinchZoom:true;if(o){s.push(new pa({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var f=i.keyboard!==undefined?i.keyboard:true;if(f){s.push(new va);s.push(new ca({delta:i.zoomDelta,duration:i.zoomDuration}))}var u=i.mouseWheelZoom!==undefined?i.mouseWheelZoom:true;if(u){s.push(new da({constrainResolution:i.constrainResolution,duration:i.zoomDuration}))}var l=i.shiftDragZoom!==undefined?i.shiftDragZoom:true;if(l){s.push(new ua({duration:i.zoomDuration}))}return s};var Ma=function(t,i,s,e){pn.call(this);this.extent=t;this.pixelRatio_=s;this.resolution=i;this.state=e};fn.inherits(Ma,pn);Ma.prototype.changed=function(){this.dispatchEvent(zn.CHANGE)};Ma.prototype.getExtent=function(){return this.extent};Ma.prototype.getImage=function(){};Ma.prototype.getPixelRatio=function(){return this.pixelRatio_};Ma.prototype.getResolution=function(){return this.resolution};Ma.prototype.getState=function(){return this.state};Ma.prototype.load=function(){};var _a={IDLE:0,LOADING:1,LOADED:2,ERROR:3};var ga=function(t,i,s,e,r){this.loader_=r!==undefined?r:null;var n=r!==undefined?_a.IDLE:_a.LOADED;Ma.call(this,t,i,s,n);this.canvas_=e;this.error_=null};fn.inherits(ga,Ma);ga.prototype.getError=function(){return this.error_};ga.prototype.handleLoad_=function(t){if(t){this.error_=t;this.state=_a.ERROR}else{this.state=_a.LOADED}this.changed()};ga.prototype.load=function(){if(this.state==_a.IDLE){this.state=_a.LOADING;this.changed();this.loader_(this.handleLoad_.bind(this))}};ga.prototype.getImage=function(){return this.canvas_};var ba={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"};var xa={IMAGE:"image",VECTOR:"vector"};var wa=function(t,i,s,e,r){mn.call(this,t);this.vectorContext=i;this.frameState=s;this.context=e;this.glContext=r};fn.inherits(wa,mn);var ya=function(t){pn.call(this);this.highWaterMark=t!==undefined?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null};fn.inherits(ya,pn);ya.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark};ya.prototype.clear=function(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null;this.dispatchEvent(zn.CLEAR)};ya.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)};ya.prototype.forEach=function(t,i){var s=this.oldest_;while(s){t.call(i,s.value_,s.key_,this);s=s.newer}};ya.prototype.get=function(t){var i=this.entries_[t];bn.assert(i!==undefined,15);if(i===this.newest_){return i.value_}else if(i===this.oldest_){this.oldest_=this.oldest_.newer;this.oldest_.older=null}else{i.newer.older=i.older;i.older.newer=i.newer}i.newer=null;i.older=this.newest_;this.newest_.newer=i;this.newest_=i;return i.value_};ya.prototype.remove=function(t){var i=this.entries_[t];bn.assert(i!==undefined,15);if(i===this.newest_){this.newest_=i.older;if(this.newest_){this.newest_.newer=null}}else if(i===this.oldest_){this.oldest_=i.newer;if(this.oldest_){this.oldest_.older=null}}else{i.newer.older=i.older;i.older.newer=i.newer}delete this.entries_[t];--this.count_;return i.value_};ya.prototype.getCount=function(){return this.count_};ya.prototype.getKeys=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.key_}return t};ya.prototype.getValues=function(){var t=new Array(this.count_);var i=0;var s;for(s=this.newest_;s;s=s.older){t[i++]=s.value_}return t};ya.prototype.peekLast=function(){return this.oldest_.value_};ya.prototype.peekLastKey=function(){return this.oldest_.key_};ya.prototype.peekFirstKey=function(){return this.newest_.key_};ya.prototype.pop=function(){var t=this.oldest_;delete this.entries_[t.key_];if(t.newer){t.newer.older=null}this.oldest_=t.newer;if(!this.oldest_){this.newest_=null}--this.count_;return t.value_};ya.prototype.replace=function(t,i){this.get(t);this.entries_[t].value_=i};ya.prototype.set=function(t,i){bn.assert(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};if(!this.newest_){this.oldest_=s}else{this.newest_.newer=s}this.newest_=s;this.entries_[t]=s;++this.count_};ya.prototype.prune=function(){while(this.canExpireCache()){this.pop()}};var ka={};ka.defaultFont="10px sans-serif";ka.defaultFillStyle=[0,0,0,1];ka.defaultLineCap="round";ka.defaultLineDash=[];ka.defaultLineDashOffset=0;ka.defaultLineJoin="round";ka.defaultMiterLimit=10;ka.defaultStrokeStyle=[0,0,0,1];ka.defaultTextAlign="center";ka.defaultTextBaseline="middle";ka.defaultPadding=[0,0,0,0];ka.defaultLineWidth=1;ka.labelCache=new ya;ka.checkedFonts_={};ka.measureContext_=null;ka.textHeights_={};ka.checkFont=function(){var t=60;var i=ka.checkedFonts_;var s=ka.labelCache;var e="32px monospace";var r="wmytzilWMYTZIL@#/&?$%10";var n,h;function a(t){var i=ka.getMeasureContext();i.font=e;h=i.measureText(r).width;var s=true;if(t!="monospace"){i.font="32px "+t+",monospace";var n=i.measureText(r).width;s=n!=h}return s}function o(){var e=true;for(var r in i){if(i[r]<t){if(a(r)){i[r]=t;vn.clear(ka.textHeights_);ka.measureContext_=null;s.clear()}else{++i[r];e=false}}}if(e){window.clearInterval(n);n=undefined}}return function(s){var e=Bh.getFontFamilies(s);if(!e){return}for(var r=0,h=e.length;r<h;++r){var f=e[r];if(!(f in i)){i[f]=t;if(!a(f)){i[f]=0;if(n===undefined){n=window.setInterval(o,32)}}}}}}();ka.getMeasureContext=function(){var t=ka.measureContext_;if(!t){t=ka.measureContext_=Lh.createCanvasContext2D(1,1)}return t};ka.measureTextHeight=function(){var t;var i=ka.textHeights_;return function(s){var e=i[s];if(e==undefined){if(!t){t=document.createElement("span");t.textContent="M";t.style.margin=t.style.padding="0 !important";t.style.position="absolute !important";t.style.left="-99999px !important"}t.style.font=s;document.body.appendChild(t);e=i[s]=t.offsetHeight;document.body.removeChild(t)}return e}}();ka.measureTextWidth=function(t,i){var s=ka.getMeasureContext();if(t!=s.font){s.font=t}return s.measureText(i).width};ka.rotateAtOffset=function(t,i,s,e){if(i!==0){t.translate(s,e);t.rotate(i);t.translate(-s,-e)}};ka.resetTransform_=Gn.create();ka.drawImage=function(t,i,s,e,r,n,h,a,o,f,u){var l;if(s!=1){l=t.globalAlpha;t.globalAlpha=l*s}if(i){t.setTransform.apply(t,i)}t.drawImage(e,r,n,h,a,o,f,h*u,a*u);if(l){t.globalAlpha=l}if(i){t.setTransform.apply(t,ka.resetTransform_)}};var Ea={};Ea.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i;Ea.NAMED_COLOR_RE_=/^([a-z]*)$/i;Ea.asArray=function(t){if(Array.isArray(t)){return t}else{return Ea.fromString(t)}};Ea.asString=function(t){if(typeof t==="string"){return t}else{return Ea.toString(t)}};Ea.fromNamed=function(t){var i=document.createElement("div");i.style.color=t;document.body.appendChild(i);var s=getComputedStyle(i).color;document.body.removeChild(i);return s};Ea.fromString=function(){var t=1024;var i={};var s=0;return function(e){var r;if(i.hasOwnProperty(e)){r=i[e]}else{if(s>=t){var n=0;var h;for(h in i){if((n++&3)===0){delete i[h];--s}}}r=Ea.fromStringInternal_(e);i[e]=r;++s}return r}}();Ea.fromStringInternal_=function(t){var i,s,e,r,n,h;if(Ea.NAMED_COLOR_RE_.exec(t)){t=Ea.fromNamed(t)}if(Ea.HEX_COLOR_RE_.exec(t)){var a=t.length-1;var o;if(a<=4){o=1}else{o=2}var f=a===4||a===8;i=parseInt(t.substr(1+0*o,o),16);s=parseInt(t.substr(1+1*o,o),16);e=parseInt(t.substr(1+2*o,o),16);if(f){r=parseInt(t.substr(1+3*o,o),16)}else{r=255}if(o==1){i=(i<<4)+i;s=(s<<4)+s;e=(e<<4)+e;if(f){r=(r<<4)+r}}n=[i,s,e,r/255]}else if(t.indexOf("rgba(")==0){h=t.slice(5,-1).split(",").map(Number);n=Ea.normalize(h)}else if(t.indexOf("rgb(")==0){h=t.slice(4,-1).split(",").map(Number);h.push(1);n=Ea.normalize(h)}else{bn.assert(false,14)}return n};Ea.normalize=function(t,i){var s=i||[];s[0]=xn.clamp(t[0]+.5|0,0,255);s[1]=xn.clamp(t[1]+.5|0,0,255);s[2]=xn.clamp(t[2]+.5|0,0,255);s[3]=xn.clamp(t[3],0,1);return s};Ea.toString=function(t){var i=t[0];if(i!=(i|0)){i=i+.5|0}var s=t[1];if(s!=(s|0)){s=s+.5|0}var e=t[2];if(e!=(e|0)){e=e+.5|0}var r=t[3]===undefined?1:t[3];return"rgba("+i+","+s+","+e+","+r+")"};var Ca={};Ca.asColorLike=function(t){if(Ca.isColorLike(t)){return t}else{return Ea.asString(t)}};Ca.isColorLike=function(t){return typeof t==="string"||t instanceof CanvasPattern||t instanceof CanvasGradient};var Na=function(){};Na.prototype.drawCustom=function(t,i,s){};Na.prototype.drawGeometry=function(t){};Na.prototype.setStyle=function(t){};Na.prototype.drawCircle=function(t,i){};Na.prototype.drawFeature=function(t,i){};Na.prototype.drawGeometryCollection=function(t,i){};Na.prototype.drawLineString=function(t,i){};Na.prototype.drawMultiLineString=function(t,i){};Na.prototype.drawMultiPoint=function(t,i){};Na.prototype.drawMultiPolygon=function(t,i){};Na.prototype.drawPoint=function(t,i){};Na.prototype.drawPolygon=function(t,i){};Na.prototype.drawText=function(t,i){};Na.prototype.setFillStrokeStyle=function(t,i){};Na.prototype.setImageStyle=function(t,i){};Na.prototype.setTextStyle=function(t,i){};var Ia=function(t,i,s,e,r){Na.call(this);this.context_=t;this.pixelRatio_=i;this.extent_=s;this.transform_=e;this.viewRotation_=r;this.contextFillState_=null;this.contextStrokeState_=null;this.contextTextState_=null;this.fillState_=null;this.strokeState_=null;this.image_=null;this.imageAnchorX_=0;this.imageAnchorY_=0;this.imageHeight_=0;this.imageOpacity_=0;this.imageOriginX_=0;this.imageOriginY_=0;this.imageRotateWithView_=false;this.imageRotation_=0;this.imageScale_=0;this.imageSnapToPixel_=false;this.imageWidth_=0;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=false;this.textRotation_=0;this.textScale_=0;this.textFillState_=null;this.textStrokeState_=null;this.textState_=null;this.pixelCoordinates_=[];this.tmpLocalTransform_=Gn.create()};fn.inherits(Ia,Na);Ia.prototype.drawImages_=function(t,i,s,e){if(!this.image_){return}var r=On.transform2D(t,i,s,2,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.tmpLocalTransform_;var a=n.globalAlpha;if(this.imageOpacity_!=1){n.globalAlpha=a*this.imageOpacity_}var o=this.imageRotation_;if(this.imageRotateWithView_){o+=this.viewRotation_}var f,u;for(f=0,u=r.length;f<u;f+=2){var l=r[f]-this.imageAnchorX_;var v=r[f+1]-this.imageAnchorY_;if(this.imageSnapToPixel_){l=Math.round(l);v=Math.round(v)}if(o!==0||this.imageScale_!=1){var c=l+this.imageAnchorX_;var d=v+this.imageAnchorY_;Gn.compose(h,c,d,this.imageScale_,this.imageScale_,o,-c,-d);n.setTransform.apply(n,h)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,l,v,this.imageWidth_,this.imageHeight_)}if(o!==0||this.imageScale_!=1){n.setTransform(1,0,0,1,0,0)}if(this.imageOpacity_!=1){n.globalAlpha=a}};Ia.prototype.drawText_=function(t,i,s,e){if(!this.textState_||this.text_===""){return}if(this.textFillState_){this.setContextFillState_(this.textFillState_)}if(this.textStrokeState_){this.setContextStrokeState_(this.textStrokeState_)}this.setContextTextState_(this.textState_);var r=On.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);var n=this.context_;var h=this.textRotation_;if(this.textRotateWithView_){h+=this.viewRotation_}for(;i<s;i+=e){var a=r[i]+this.textOffsetX_;var o=r[i+1]+this.textOffsetY_;if(h!==0||this.textScale_!=1){var f=Gn.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,h,-a,-o);n.setTransform.apply(n,f)}if(this.textStrokeState_){n.strokeText(this.text_,a,o)}if(this.textFillState_){n.fillText(this.text_,a,o)}}if(h!==0||this.textScale_!=1){n.setTransform(1,0,0,1,0,0)}};Ia.prototype.moveToLineTo_=function(t,i,s,e,r){var n=this.context_;var h=On.transform2D(t,i,s,e,this.transform_,this.pixelCoordinates_);n.moveTo(h[0],h[1]);var a=h.length;if(r){a-=2}for(var o=2;o<a;o+=2){n.lineTo(h[o],h[o+1])}if(r){n.closePath()}return s};Ia.prototype.drawRings_=function(t,i,s,e){var r,n;for(r=0,n=s.length;r<n;++r){i=this.moveToLineTo_(t,i,s[r],e,true)}return i};Ia.prototype.drawCircle=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.fillState_||this.strokeState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=jn.transform2D(t,this.transform_,this.pixelCoordinates_);var s=i[2]-i[0];var e=i[3]-i[1];var r=Math.sqrt(s*s+e*e);var n=this.context_;n.beginPath();n.arc(i[0],i[1],r,0,2*Math.PI);if(this.fillState_){n.fill()}if(this.strokeState_){n.stroke()}}if(this.text_!==""){this.drawText_(t.getCenter(),0,2,2)}};Ia.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Ia.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case wn.POINT:this.drawPoint(t);break;case wn.LINE_STRING:this.drawLineString(t);break;case wn.POLYGON:this.drawPolygon(t);break;case wn.MULTI_POINT:this.drawMultiPoint(t);break;case wn.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case wn.MULTI_POLYGON:this.drawMultiPolygon(t);break;case wn.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case wn.CIRCLE:this.drawCircle(t);break}};Ia.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!Nn.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Ia.prototype.drawGeometryCollection=function(t){var i=t.getGeometriesArray();var s,e;for(s=0,e=i.length;s<e;++s){this.drawGeometry(i[s])}};Ia.prototype.drawPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Ia.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates();var s=t.getStride();if(this.image_){this.drawImages_(i,0,i.length,s)}if(this.text_!==""){this.drawText_(i,0,i.length,s)}};Ia.prototype.drawLineString=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_;var s=t.getFlatCoordinates();i.beginPath();this.moveToLineTo_(s,0,s.length,t.getStride(),false);i.stroke()}if(this.text_!==""){var e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}};Ia.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(!Nn.intersects(this.extent_,i)){return}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s=this.context_;var e=t.getFlatCoordinates();var r=0;var n=t.getEnds();var h=t.getStride();s.beginPath();var a,o;for(a=0,o=n.length;a<o;++a){r=this.moveToLineTo_(e,r,n[a],h,false)}s.stroke()}if(this.text_!==""){var f=t.getFlatMidpoints();this.drawText_(f,0,f.length,2)}};Ia.prototype.drawPolygon=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;i.beginPath();this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride());if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}};Ia.prototype.drawMultiPolygon=function(t){if(!Nn.intersects(this.extent_,t.getExtent())){return}if(this.strokeState_||this.fillState_){if(this.fillState_){this.setContextFillState_(this.fillState_)}if(this.strokeState_){this.setContextStrokeState_(this.strokeState_)}var i=this.context_;var s=t.getOrientedFlatCoordinates();var e=0;var r=t.getEndss();var n=t.getStride();var h,a;i.beginPath();for(h=0,a=r.length;h<a;++h){var o=r[h];e=this.drawRings_(s,e,o,n)}if(this.fillState_){i.fill()}if(this.strokeState_){i.stroke()}}if(this.text_!==""){var f=t.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}};Ia.prototype.setContextFillState_=function(t){var i=this.context_;var s=this.contextFillState_;if(!s){i.fillStyle=t.fillStyle;this.contextFillState_={fillStyle:t.fillStyle}}else{if(s.fillStyle!=t.fillStyle){s.fillStyle=i.fillStyle=t.fillStyle}}};Ia.prototype.setContextStrokeState_=function(t){var i=this.context_;var s=this.contextStrokeState_;if(!s){i.lineCap=t.lineCap;if(rh.CANVAS_LINE_DASH){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineJoin=t.lineJoin;i.lineWidth=t.lineWidth;i.miterLimit=t.miterLimit;i.strokeStyle=t.strokeStyle;this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle}}else{if(s.lineCap!=t.lineCap){s.lineCap=i.lineCap=t.lineCap}if(rh.CANVAS_LINE_DASH){if(!kn.equals(s.lineDash,t.lineDash)){i.setLineDash(s.lineDash=t.lineDash)}if(s.lineDashOffset!=t.lineDashOffset){s.lineDashOffset=i.lineDashOffset=t.lineDashOffset}}if(s.lineJoin!=t.lineJoin){s.lineJoin=i.lineJoin=t.lineJoin}if(s.lineWidth!=t.lineWidth){s.lineWidth=i.lineWidth=t.lineWidth}if(s.miterLimit!=t.miterLimit){s.miterLimit=i.miterLimit=t.miterLimit}if(s.strokeStyle!=t.strokeStyle){s.strokeStyle=i.strokeStyle=t.strokeStyle}}};Ia.prototype.setContextTextState_=function(t){var i=this.context_;var s=this.contextTextState_;var e=t.textAlign?t.textAlign:ka.defaultTextAlign;if(!s){i.font=t.font;i.textAlign=e;i.textBaseline=t.textBaseline;this.contextTextState_={font:t.font,textAlign:e,textBaseline:t.textBaseline}}else{if(s.font!=t.font){s.font=i.font=t.font}if(s.textAlign!=e){s.textAlign=e}if(s.textBaseline!=t.textBaseline){s.textBaseline=i.textBaseline=t.textBaseline}}};Ia.prototype.setFillStrokeStyle=function(t,i){if(!t){this.fillState_=null}else{var s=t.getColor();this.fillState_={fillStyle:Ca.asColorLike(s?s:ka.defaultFillStyle)}}if(!i){this.strokeState_=null}else{var e=i.getColor();var r=i.getLineCap();var n=i.getLineDash();var h=i.getLineDashOffset();var a=i.getLineJoin();var o=i.getWidth();var f=i.getMiterLimit();this.strokeState_={lineCap:r!==undefined?r:ka.defaultLineCap,lineDash:n?n:ka.defaultLineDash,lineDashOffset:h?h:ka.defaultLineDashOffset,lineJoin:a!==undefined?a:ka.defaultLineJoin,lineWidth:this.pixelRatio_*(o!==undefined?o:ka.defaultLineWidth),miterLimit:f!==undefined?f:ka.defaultMiterLimit,strokeStyle:Ca.asColorLike(e?e:ka.defaultStrokeStyle)}}};Ia.prototype.setImageStyle=function(t){if(!t){this.image_=null}else{var i=t.getAnchor();var s=t.getImage(1);var e=t.getOrigin();var r=t.getSize();this.imageAnchorX_=i[0];this.imageAnchorY_=i[1];this.imageHeight_=r[1];this.image_=s;this.imageOpacity_=t.getOpacity();this.imageOriginX_=e[0];this.imageOriginY_=e[1];this.imageRotateWithView_=t.getRotateWithView();this.imageRotation_=t.getRotation();this.imageScale_=t.getScale()*this.pixelRatio_;this.imageSnapToPixel_=t.getSnapToPixel();this.imageWidth_=r[0]}};Ia.prototype.setTextStyle=function(t){if(!t){this.text_=""}else{var i=t.getFill();if(!i){this.textFillState_=null}else{var s=i.getColor();this.textFillState_={fillStyle:Ca.asColorLike(s?s:ka.defaultFillStyle)}}var e=t.getStroke();if(!e){this.textStrokeState_=null}else{var r=e.getColor();var n=e.getLineCap();var h=e.getLineDash();var a=e.getLineDashOffset();var o=e.getLineJoin();var f=e.getWidth();var u=e.getMiterLimit();this.textStrokeState_={lineCap:n!==undefined?n:ka.defaultLineCap,lineDash:h?h:ka.defaultLineDash,lineDashOffset:a?a:ka.defaultLineDashOffset,lineJoin:o!==undefined?o:ka.defaultLineJoin,lineWidth:f!==undefined?f:ka.defaultLineWidth,miterLimit:u!==undefined?u:ka.defaultMiterLimit,strokeStyle:Ca.asColorLike(r?r:ka.defaultStrokeStyle)}}var l=t.getFont();var v=t.getOffsetX();var c=t.getOffsetY();var d=t.getRotateWithView();var m=t.getRotation();var p=t.getScale();var z=t.getText();var M=t.getTextAlign();var _=t.getTextBaseline();this.textState_={font:l!==undefined?l:ka.defaultFont,textAlign:M!==undefined?M:ka.defaultTextAlign,textBaseline:_!==undefined?_:ka.defaultTextBaseline};this.text_=z!==undefined?z:"";this.textOffsetX_=v!==undefined?this.pixelRatio_*v:0;this.textOffsetY_=c!==undefined?this.pixelRatio_*c:0;this.textRotateWithView_=d!==undefined?d:false;this.textRotation_=m!==undefined?m:0;this.textScale_=this.pixelRatio_*(p!==undefined?p:1)}};var Sa=function(t){Mn.call(this);this.layer_=t};fn.inherits(Sa,Mn);Sa.prototype.forEachFeatureAtCoordinate=fn.nullFunction;Sa.prototype.hasFeatureAtCoordinate=Sn.FALSE;Sa.prototype.createLoadedTileFinder=function(t,i,s){return function(e,r){function n(t){if(!s[e]){s[e]={}}s[e][t.tileCoord.toString()]=t}return t.forEachLoadedTile(i,e,r,n)}};Sa.prototype.getLayer=function(){return this.layer_};Sa.prototype.handleImageChange_=function(t){var i=t.target;if(i.getState()===_a.LOADED){this.renderIfReadyAndVisible()}};Sa.prototype.loadImage=function(t){var i=t.getState();if(i!=_a.LOADED&&i!=_a.ERROR){cn.listen(t,zn.CHANGE,this.handleImageChange_,this)}if(i==_a.IDLE){t.load();i=t.getState()}return i==_a.LOADED};Sa.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();if(t.getVisible()&&t.getSourceState()==Wh.READY){this.changed()}};Sa.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var e=fn.getUid(t).toString();if(e in s.usedTiles){t.expireCache(s.viewState.projection,s.usedTiles[e])}}.bind(null,i);t.postRenderFunctions.push(s)}};Sa.prototype.updateLogos=function(t,i){var s=i.getLogo();if(s!==undefined){if(typeof s==="string"){t.logos[s]=""}else if(s){bn.assert(typeof s.href=="string",44);bn.assert(typeof s.src=="string",45);t.logos[s.src]=s.href}}};Sa.prototype.updateUsedTiles=function(t,i,s,e){var r=fn.getUid(i).toString();var n=s.toString();if(r in t){if(n in t[r]){t[r][n].extend(e)}else{t[r][n]=e}}else{t[r]={};t[r][n]=e}};Sa.prototype.manageTilePyramid=function(t,i,s,e,r,n,h,a,o,f){var u=fn.getUid(i).toString();if(!(u in t.wantedTiles)){t.wantedTiles[u]={}}var l=t.wantedTiles[u];var v=t.tileQueue;var c=s.getMinZoom();var d,m,p,z,M,_;for(_=c;_<=h;++_){m=s.getTileRangeForExtentAndZ(n,_,m);p=s.getResolution(_);for(z=m.minX;z<=m.maxX;++z){for(M=m.minY;M<=m.maxY;++M){if(h-_<=a){d=i.getTile(_,z,M,e,r);if(d.getState()==yh.IDLE){l[d.getKey()]=true;if(!v.isKeyQueued(d.getKey())){v.enqueue([d,u,s.getTileCoordCenter(d.tileCoord),p])}}if(o!==undefined){o.call(f,d)}}else{i.useTile(_,z,M,r)}}}}};var Oa=function(t){Sa.call(this,t);this.transform_=Gn.create()};fn.inherits(Oa,Sa);Oa.prototype.clip=function(t,i,s){var e=i.pixelRatio;var r=i.size[0]*e;var n=i.size[1]*e;var h=i.viewState.rotation;var a=Nn.getTopLeft(s);var o=Nn.getTopRight(s);var f=Nn.getBottomRight(s);var u=Nn.getBottomLeft(s);Gn.apply(i.coordinateToPixelTransform,a);Gn.apply(i.coordinateToPixelTransform,o);Gn.apply(i.coordinateToPixelTransform,f);Gn.apply(i.coordinateToPixelTransform,u);t.save();ka.rotateAtOffset(t,-h,r/2,n/2);t.beginPath();t.moveTo(a[0]*e,a[1]*e);t.lineTo(o[0]*e,o[1]*e);t.lineTo(f[0]*e,f[1]*e);t.lineTo(u[0]*e,u[1]*e);t.clip();ka.rotateAtOffset(t,h,r/2,n/2)};Oa.prototype.dispatchComposeEvent_=function(t,i,s,e){var r=this.getLayer();if(r.hasListener(t)){var n=s.size[0]*s.pixelRatio;var h=s.size[1]*s.pixelRatio;var a=s.viewState.rotation;ka.rotateAtOffset(i,-a,n/2,h/2);var o=e!==undefined?e:this.getTransform(s,0);var f=new Ia(i,s.pixelRatio,s.extent,o,s.viewState.rotation);var u=new wa(t,f,s,i,null);r.dispatchEvent(u);ka.rotateAtOffset(i,a,n/2,h/2)}};Oa.prototype.forEachLayerAtCoordinate=function(t,i,s,e){var r=this.forEachFeatureAtCoordinate(t,i,0,Sn.TRUE,this);if(r){return s.call(e,this.getLayer(),null)}else{return undefined}};Oa.prototype.postCompose=function(t,i,s,e){this.dispatchComposeEvent_(Hh.POSTCOMPOSE,t,i,e)};Oa.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(Hh.PRECOMPOSE,t,i,s)};Oa.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(Hh.RENDER,t,i,s)};Oa.prototype.getTransform=function(t,i){var s=t.viewState;var e=t.pixelRatio;var r=e*t.size[0]/2;var n=e*t.size[1]/2;var h=e/s.resolution;var a=-h;var o=-s.rotation;var f=-s.center[0]+i;var u=-s.center[1];return Gn.compose(this.transform_,r,n,h,a,o,f,u)};Oa.prototype.composeFrame=function(t,i,s){};Oa.prototype.prepareFrame=function(t,i){};var Ta=function(t){Oa.call(this,t);this.coordinateToCanvasPixelTransform=Gn.create();this.hitCanvasContext_=null};fn.inherits(Ta,Oa);Ta.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var e=this.getImage();if(e){var r=i.extent;var n=r!==undefined&&!Nn.containsExtent(r,t.extent)&&Nn.intersects(r,t.extent);if(n){this.clip(s,t,r)}var h=this.getImageTransform();var a=s.globalAlpha;s.globalAlpha=i.opacity;var o=h[4];var f=h[5];var u=e.width*h[0];var l=e.height*h[3];s.drawImage(e,0,0,+e.width,+e.height,Math.round(o),Math.round(f),Math.round(u),Math.round(l));s.globalAlpha=a;if(n){s.restore()}}this.postCompose(s,t,i)};Ta.prototype.getImage=function(){};Ta.prototype.getImageTransform=function(){};Ta.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};Ta.prototype.forEachLayerAtCoordinate=function(t,i,s,e){if(!this.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==fn.nullFunction){return Oa.prototype.forEachLayerAtCoordinate.apply(this,arguments)}else{var r=Gn.apply(this.coordinateToCanvasPixelTransform,t.slice());Ah.scale(r,i.viewState.resolution/this.renderedResolution);if(!this.hitCanvasContext_){this.hitCanvasContext_=Lh.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var n=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(n[3]>0){return s.call(e,this.getLayer(),n)}else{return undefined}}};var Aa=function(t){Ta.call(this,t);this.image_=null;this.imageTransform_=Gn.create();this.skippedFeatures_=[];this.vectorRenderer_=null};fn.inherits(Aa,Ta);Aa["handles"]=function(t,i){return t===Uh.CANVAS&&(i.getType()===ba.IMAGE||i.getType()===ba.VECTOR&&i.getRenderMode()===xa.IMAGE)};Aa["create"]=function(t,i){var s=new Aa(i);if(i.getType()===ba.VECTOR){var e=jh.getLayerRendererPlugins();for(var r=0,n=e.length;r<n;++r){var h=e[r];if(h!==Aa&&h["handles"](Uh.CANVAS,i)){s.setVectorRenderer(h["create"](t,i))}}}return s};Aa.prototype.getImage=function(){return!this.image_?null:this.image_.getImage()};Aa.prototype.getImageTransform=function(){return this.imageTransform_};Aa.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.center;var h=r.resolution;var a;var o=this.getLayer();var f=o.getSource();var u=t.viewHints;var l=t.extent;if(i.extent!==undefined){l=Nn.getIntersection(l,i.extent)}if(!u[Sh.ANIMATING]&&!u[Sh.INTERACTING]&&!Nn.isEmpty(l)){var v=r.projection;if(!fn.ENABLE_RASTER_REPROJECTION){var c=f.getProjection();if(c){v=c}}var d=this.vectorRenderer_;if(d){var m=d.context;var p=vn.assign({},t,{size:[Nn.getWidth(l)/h,Nn.getHeight(l)/h],viewState:vn.assign({},t.viewState,{rotation:0})});var z=Object.keys(p.skippedFeatureUids).sort();if(d.prepareFrame(p,i)&&(d.replayGroupChanged||!kn.equals(z,this.skippedFeatures_))){m.canvas.width=p.size[0]*s;m.canvas.height=p.size[1]*s;d.composeFrame(p,i,m);this.image_=new ga(l,h,s,m.canvas);this.skippedFeatures_=z}}else{a=f.getImage(l,h,s,v);if(a){var M=this.loadImage(a);if(M){this.image_=a}}}}if(this.image_){a=this.image_;var _=a.getExtent();var g=a.getResolution();var b=a.getPixelRatio();var x=s*g/(h*b);var w=Gn.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,x,x,0,b*(_[0]-n[0])/g,b*(n[1]-_[3])/g);Gn.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-w[4],s*e[1]/2-w[5],s/h,-s/h,0,-n[0],-n[1]);this.updateLogos(t,f);this.renderedResolution=g*s/b}return!!this.image_};Aa.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(this.vectorRenderer_){return this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,e,r)}else{return Ta.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,e,r)}};Aa.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var Ra=function(){this.cache_={};this.cacheSize_=0;this.maxCacheSize_=32};Ra.getKey=function(t,i,s){var e=s?Ea.asString(s):"null";return i+":"+t+":"+e};Ra.prototype.clear=function(){this.cache_={};this.cacheSize_=0};Ra.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;var i,s;for(i in this.cache_){s=this.cache_[i];if((t++&3)===0&&!s.hasListener()){delete this.cache_[i];--this.cacheSize_}}}};Ra.prototype.get=function(t,i,s){var e=Ra.getKey(t,i,s);return e in this.cache_?this.cache_[e]:null};Ra.prototype.set=function(t,i,s,e){var r=Ra.getKey(t,i,s);this.cache_[r]=e;++this.cacheSize_};Ra.prototype.setSize=function(t){this.maxCacheSize_=t;this.expire()};var Pa={};Pa.iconImageCache=new Ra;var La=function(t,i){dn.call(this);this.map_=i;this.layerRenderers_={};this.layerRendererListeners_={}};fn.inherits(La,dn);La.prototype.calculateMatrices2D=function(t){var i=t.viewState;var s=t.coordinateToPixelTransform;var e=t.pixelToCoordinateTransform;Gn.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]);Gn.invert(Gn.setFromArray(e,s))};La.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_){this.removeLayerRendererByKey_(t).dispose()}};La.expireIconCache_=function(t,i){var s=Pa.iconImageCache;s.expire()};La.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;var o=i.viewState;var f=o.resolution;function u(t,s){var n=fn.getUid(t).toString();var h=i.layerStates[fn.getUid(s)].managed;if(!(n in i.skippedFeatureUids&&!h)){return e.call(r,t,h?s:null)}}var l=o.projection;var v=t;if(l.canWrapX()){var c=l.getExtent();var d=Nn.getWidth(c);var m=t[0];if(m<c[0]||m>c[2]){var p=Math.ceil((c[0]-m)/d);v=[m+d*p,t[1]]}}var z=i.layerStatesArray;var M=z.length;var _;for(_=M-1;_>=0;--_){var g=z[_];var b=g.layer;if(Jh.visibleAtResolution(g,f)&&n.call(h,b)){var x=this.getLayerRenderer(b);if(b.getSource()){a=x.forEachFeatureAtCoordinate(b.getSource().getWrapX()?v:t,i,s,u,r)}if(a){return a}}}return undefined};La.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){};La.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=this.forEachFeatureAtCoordinate(t,i,s,Sn.TRUE,this,e,r);return n!==undefined};La.prototype.getLayerRenderer=function(t){var i=fn.getUid(t).toString();if(i in this.layerRenderers_){return this.layerRenderers_[i]}else{var s=jh.getLayerRendererPlugins();var e;var r=this.getType();for(var n=0,h=s.length;n<h;++n){var a=s[n];if(a["handles"](r,t)){e=a["create"](this,t);break}}if(e){this.layerRenderers_[i]=e;this.layerRendererListeners_[i]=cn.listen(e,zn.CHANGE,this.handleLayerRendererChange_,this)}else{throw new Error("Unable to create renderer for layer: "+t.getType())}return e}};La.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]};La.prototype.getLayerRenderers=function(){return this.layerRenderers_};La.prototype.getMap=function(){return this.map_};La.prototype.getType=function(){};La.prototype.handleLayerRendererChange_=function(){this.map_.render()};La.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];delete this.layerRenderers_[t];cn.unlistenByKey(this.layerRendererListeners_[t]);delete this.layerRendererListeners_[t];return i};La.prototype.renderFrame=fn.nullFunction;La.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_){if(!i||!(s in i.layerStates)){this.removeLayerRendererByKey_(s).dispose()}}};La.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(La.expireIconCache_)};La.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_){if(!(i in t.layerStates)){t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this));return}}};La.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var Da=function(t,i){La.call(this,t,i);this.context_=Lh.createCanvasContext2D();this.canvas_=this.context_.canvas;this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=Bh.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.renderedVisible_=true;this.transform_=Gn.create()};fn.inherits(Da,La);Da["handles"]=function(t){return t===Uh.CANVAS};Da["create"]=function(t,i){return new Da(t,i)};Da.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();var e=this.context_;if(s.hasListener(t)){var r=i.extent;var n=i.pixelRatio;var h=i.viewState;var a=h.rotation;var o=this.getTransform(i);var f=new Ia(e,n,r,o,a);var u=new wa(t,f,i,e,null);s.dispatchEvent(u)}};Da.prototype.getTransform=function(t){var i=t.viewState;var s=this.canvas_.width/2;var e=this.canvas_.height/2;var r=t.pixelRatio/i.resolution;var n=-r;var h=-i.rotation;var a=-i.center[0];var o=-i.center[1];return Gn.compose(this.transform_,s,e,r,n,h,a,o)};Da.prototype.getType=function(){return Uh.CANVAS};Da.prototype.renderFrame=function(t){if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return}var i=this.context_;var s=t.pixelRatio;var e=Math.round(t.size[0]*s);var r=Math.round(t.size[1]*s);if(this.canvas_.width!=e||this.canvas_.height!=r){this.canvas_.width=e;this.canvas_.height=r}else{i.clearRect(0,0,e,r)}var n=t.viewState.rotation;this.calculateMatrices2D(t);this.dispatchComposeEvent_(Hh.PRECOMPOSE,t);var h=t.layerStatesArray;kn.stableSort(h,La.sortByZIndex);if(n){i.save();ka.rotateAtOffset(i,n,e/2,r/2)}var a=t.viewState.resolution;var o,f,u,l,v;for(o=0,f=h.length;o<f;++o){v=h[o];u=v.layer;l=this.getLayerRenderer(u);if(!Jh.visibleAtResolution(v,a)||v.sourceState!=Wh.READY){continue}if(l.prepareFrame(t,v)){l.composeFrame(t,v,i)}}if(n){i.restore()}this.dispatchComposeEvent_(Hh.POSTCOMPOSE,t);if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};Da.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){var h;var a=i.viewState;var o=a.resolution;var f=i.layerStatesArray;var u=f.length;var l=Gn.apply(i.pixelToCoordinateTransform,t.slice());var v;for(v=u-1;v>=0;--v){var c=f[v];var d=c.layer;if(Jh.visibleAtResolution(c,o)&&r.call(n,d)){var m=this.getLayerRenderer(d);h=m.forEachLayerAtCoordinate(l,i,s,e);if(h){return h}}}return undefined};var Fa=function(t,i,s,e){this.minX=t;this.maxX=i;this.minY=s;this.maxY=e};Fa.createOrUpdate=function(t,i,s,e,r){if(r!==undefined){r.minX=t;r.maxX=i;r.minY=s;r.maxY=e;return r}else{return new Fa(t,i,s,e)}};Fa.prototype.contains=function(t){return this.containsXY(t[1],t[2])};Fa.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY};Fa.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY};Fa.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY};Fa.prototype.extend=function(t){if(t.minX<this.minX){this.minX=t.minX}if(t.maxX>this.maxX){this.maxX=t.maxX}if(t.minY<this.minY){this.minY=t.minY}if(t.maxY>this.maxY){this.maxY=t.maxY}};Fa.prototype.getHeight=function(){return this.maxY-this.minY+1};Fa.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};Fa.prototype.getWidth=function(){return this.maxX-this.minX+1};Fa.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Wa=function(t){Ta.call(this,t);this.context=this.context===null?null:Lh.createCanvasContext2D();this.renderedExtent_=null;this.renderedTiles=[];this.tmpExtent=Nn.createEmpty();this.tmpTileRange_=new Fa(0,0,0,0);this.imageTransform_=Gn.create();this.zDirection=0};fn.inherits(Wa,Ta);Wa["handles"]=function(t,i){return t===Uh.CANVAS&&i.getType()===ba.TILE};Wa["create"]=function(t,i){return new Wa(i)};Wa.prototype.isDrawableTile_=function(t){var i=t.getState();var s=this.getLayer().getUseInterimTilesOnError();return i==yh.LOADED||i==yh.EMPTY||i==yh.ERROR&&!s};Wa.prototype.prepareFrame=function(t,i){var s=t.pixelRatio;var e=t.size;var r=t.viewState;var n=r.projection;var h=r.resolution;var a=r.center;var o=this.getLayer();var f=o.getSource();var u=f.getRevision();var l=f.getTileGridForProjection(n);var v=l.getZForResolution(h,this.zDirection);var c=l.getResolution(v);var d=Math.round(h/c)||1;var m=t.extent;if(i.extent!==undefined){m=Nn.getIntersection(m,i.extent)}if(Nn.isEmpty(m)){return false}var p=l.getTileRangeForExtentAndZ(m,v);var z=l.getTileRangeExtent(v,p);var M=f.getTilePixelRatio(s);var _={};_[v]={};var g=this.createLoadedTileFinder(f,n,_);var b=this.tmpExtent;var x=this.tmpTileRange_;var w=false;var y,k,E;for(k=p.minX;k<=p.maxX;++k){for(E=p.minY;E<=p.maxY;++E){y=f.getTile(v,k,E,s,n);if(y.getState()==yh.ERROR){if(!o.getUseInterimTilesOnError()){y.setState(yh.LOADED)}else if(o.getPreload()>0){w=true}}if(!this.isDrawableTile_(y)){y=y.getInterimTile()}if(this.isDrawableTile_(y)){var C=fn.getUid(this);if(y.getState()==yh.LOADED){_[v][y.tileCoord.toString()]=y;var N=y.inTransition(C);if(!w&&(N||this.renderedTiles.indexOf(y)===-1)){w=true}}if(y.getAlpha(C,t.time)===1){continue}}var I=l.getTileCoordChildTileRange(y.tileCoord,x,b);var S=false;if(I){S=g(v+1,I)}if(!S){l.forEachTileCoordParentTileRange(y.tileCoord,g,null,x,b)}}}var O=c*s/M*d;var T=t.viewHints;var A=T[Sh.ANIMATING]||T[Sh.INTERACTING];if(!(this.renderedResolution&&Date.now()-t.time>16&&A)&&(w||!(this.renderedExtent_&&Nn.containsExtent(this.renderedExtent_,m))||this.renderedRevision!=u||d!=this.oversampling_||!A&&O!=this.renderedResolution)){var R=this.context;if(R){var P=f.getTilePixelSize(v,s,n);var L=Math.round(p.getWidth()*P[0]/d);var D=Math.round(p.getHeight()*P[1]/d);var F=R.canvas;if(F.width!=L||F.height!=D){this.oversampling_=d;F.width=L;F.height=D}else{if(this.renderedExtent_&&!Nn.equals(z,this.renderedExtent_)){R.clearRect(0,0,L,D)}d=this.oversampling_}}this.renderedTiles.length=0;var W=Object.keys(_).map(Number);W.sort((function(t,i){if(t===v){return 1}else if(i===v){return-1}else{return t>i?1:t<i?-1:0}}));var G,V,j,U,X,q;var Y,B,H,J,Z;for(X=0,q=W.length;X<q;++X){U=W[X];j=f.getTilePixelSize(U,s,n);G=l.getResolution(U);V=G/c;B=M*f.getGutter(n);H=_[U];for(var $ in H){y=H[$];Y=l.getTileCoordExtent(y.getTileCoord(),b);k=(Y[0]-z[0])/c*M/d;E=(z[3]-Y[3])/c*M/d;J=j[0]*V/d;Z=j[1]*V/d;this.drawTileImage(y,t,i,k,E,J,Z,B,v===U);this.renderedTiles.push(y)}}this.renderedRevision=u;this.renderedResolution=c*s/M*d;this.renderedExtent_=z}var K=this.renderedResolution/h;var Q=Gn.compose(this.imageTransform_,s*e[0]/2,s*e[1]/2,K,K,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);Gn.compose(this.coordinateToCanvasPixelTransform,s*e[0]/2-Q[4],s*e[1]/2-Q[5],s/h,-s/h,0,-a[0],-a[1]);this.updateUsedTiles(t.usedTiles,f,v,p);this.manageTilePyramid(t,f,l,s,n,m,v,o.getPreload());this.scheduleExpireCache(t,f);this.updateLogos(t,f);return this.renderedTiles.length>0};Wa.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t.getImage(this.getLayer());if(!f){return}var u=fn.getUid(this);var l=o?t.getAlpha(u,i.time):1;if(l===1&&!this.getLayer().getSource().getOpaque(i.viewState.projection)){this.context.clearRect(e,r,n,h)}var v=l!==this.context.globalAlpha;if(v){this.context.save();this.context.globalAlpha=l}this.context.drawImage(f,a,a,f.width-2*a,f.height-2*a,e,r,n,h);if(v){this.context.restore()}if(l!==1){i.animate=true}else if(o){t.endTransition(u)}};Wa.prototype.getImage=function(){var t=this.context;return t?t.canvas:null};Wa.prototype.getImageTransform=function(){return this.imageTransform_};var Ga=d((function(t,i){(function(i,s){t.exports=s()})(m,(function(){function t(t,s,r,n,h){i(t,s,r||0,n||t.length-1,h||e)}function i(t,e,r,n,h){while(n>r){if(n-r>600){var a=n-r+1;var o=e-r+1;var f=Math.log(a);var u=.5*Math.exp(2*f/3);var l=.5*Math.sqrt(f*u*(a-u)/a)*(o-a/2<0?-1:1);var v=Math.max(r,Math.floor(e-o*u/a+l));var c=Math.min(n,Math.floor(e+(a-o)*u/a+l));i(t,e,v,c,h)}var d=t[e];var m=r;var p=n;s(t,r,e);if(h(t[n],d)>0)s(t,r,n);while(m<p){s(t,m,p);m++;p--;while(h(t[m],d)<0)m++;while(h(t[p],d)>0)p--}if(h(t[r],d)===0)s(t,r,p);else{p++;s(t,p,n)}if(p<=e)r=p+1;if(e<=p)n=p-1}}function s(t,i,s){var e=t[i];t[i]=t[s];t[s]=e}function e(t,i){return t<i?-1:t>i?1:0}return t}))}));var Va=ja;function ja(t,i){if(!(this instanceof ja))return new ja(t,i);this._maxEntries=Math.max(4,t||9);this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4));if(i){this._initFormat(i)}this.clear()}ja.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],e=this.toBBox;if(!to(t,i))return s;var r=[],n,h,a,o;while(i){for(n=0,h=i.children.length;n<h;n++){a=i.children[n];o=i.leaf?e(a):a;if(to(t,o)){if(i.leaf)s.push(a);else if(Qa(t,o))this._all(a,s);else r.push(a)}}i=r.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!to(t,i))return false;var e=[],r,n,h,a;while(i){for(r=0,n=i.children.length;r<n;r++){h=i.children[r];a=i.leaf?s(h):h;if(to(t,a)){if(i.leaf||Qa(t,a))return true;e.push(h)}}i=e.pop()}return false},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++){this.insert(t[i])}return this}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length){this.data=e}else if(this.data.height===e.height){this._splitRoot(this.data,e)}else{if(this.data.height<e.height){var r=this.data;this.data=e;e=r}this._insert(e,this.data.height-e.height-1,true)}return this},insert:function(t){if(t)this._insert(t,this.data.height-1);return this},clear:function(){this.data=io([]);return this},remove:function(t,i){if(!t)return this;var s=this.data,e=this.toBBox(t),r=[],n=[],h,a,o,f;while(s||r.length){if(!s){s=r.pop();a=r[r.length-1];h=n.pop();f=true}if(s.leaf){o=Ua(t,s.children,i);if(o!==-1){s.children.splice(o,1);r.push(s);this._condense(r);return this}}if(!f&&!s.leaf&&Qa(s,e)){r.push(s);n.push(h);h=0;a=s;s=s.children[0]}else if(a){h++;s=a.children[h];f=false}else s=null}return this},toBBox:function(t){return t},compareMinX:Ba,compareMinY:Ha,toJSON:function(){return this.data},fromJSON:function(t){this.data=t;return this},_all:function(t,i){var s=[];while(t){if(t.leaf)i.push.apply(i,t.children);else s.push.apply(s,t.children);t=s.pop()}return i},_build:function(t,i,s,e){var r=s-i+1,n=this._maxEntries,h;if(r<=n){h=io(t.slice(i,s+1));Xa(h,this.toBBox);return h}if(!e){e=Math.ceil(Math.log(r)/Math.log(n));n=Math.ceil(r/Math.pow(n,e-1))}h=io([]);h.leaf=false;h.height=e;var a=Math.ceil(r/n),o=a*Math.ceil(Math.sqrt(n)),f,u,l,v;so(t,i,s,o,this.compareMinX);for(f=i;f<=s;f+=o){l=Math.min(f+o-1,s);so(t,f,l,a,this.compareMinY);for(u=f;u<=l;u+=a){v=Math.min(u+a-1,l);h.children.push(this._build(t,u,v,e-1))}}Xa(h,this.toBBox);return h},_chooseSubtree:function(t,i,s,e){var r,n,h,a,o,f,u,l;while(true){e.push(i);if(i.leaf||e.length-1===s)break;u=l=Infinity;for(r=0,n=i.children.length;r<n;r++){h=i.children[r];o=Ja(h);f=$a(t,h)-o;if(f<l){l=f;u=o<u?o:u;a=h}else if(f===l){if(o<u){u=o;a=h}}}i=a||i.children[0]}return i},_insert:function(t,i,s){var e=this.toBBox,r=s?t:e(t),n=[];var h=this._chooseSubtree(r,this.data,i,n);h.children.push(t);Ya(h,r);while(i>=0){if(n[i].children.length>this._maxEntries){this._split(n,i);i--}else break}this._adjustParentBBoxes(r,n,i)},_split:function(t,i){var s=t[i],e=s.children.length,r=this._minEntries;this._chooseSplitAxis(s,r,e);var n=this._chooseSplitIndex(s,r,e);var h=io(s.children.splice(n,s.children.length-n));h.height=s.height;h.leaf=s.leaf;Xa(s,this.toBBox);Xa(h,this.toBBox);if(i)t[i-1].children.push(h);else this._splitRoot(s,h)},_splitRoot:function(t,i){this.data=io([t,i]);this.data.height=t.height+1;this.data.leaf=false;Xa(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var e,r,n,h,a,o,f,u;o=f=Infinity;for(e=i;e<=s-i;e++){r=qa(t,0,e,this.toBBox);n=qa(t,e,s,this.toBBox);h=Ka(r,n);a=Ja(r)+Ja(n);if(h<o){o=h;u=e;f=a<f?a:f}else if(h===o){if(a<f){f=a;u=e}}}return u},_chooseSplitAxis:function(t,i,s){var e=t.leaf?this.compareMinX:Ba,r=t.leaf?this.compareMinY:Ha,n=this._allDistMargin(t,i,s,e),h=this._allDistMargin(t,i,s,r);if(n<h)t.children.sort(e)},_allDistMargin:function(t,i,s,e){t.children.sort(e);var r=this.toBBox,n=qa(t,0,i,r),h=qa(t,s-i,s,r),a=Za(n)+Za(h),o,f;for(o=i;o<s-i;o++){f=t.children[o];Ya(n,t.leaf?r(f):f);a+=Za(n)}for(o=s-i-1;o>=i;o--){f=t.children[o];Ya(h,t.leaf?r(f):f);a+=Za(h)}return a},_adjustParentBBoxes:function(t,i,s){for(var e=s;e>=0;e--){Ya(i[e],t)}},_condense:function(t){for(var i=t.length-1,s;i>=0;i--){if(t[i].children.length===0){if(i>0){s=t[i-1].children;s.splice(s.indexOf(t[i]),1)}else this.clear()}else Xa(t[i],this.toBBox)}},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0]));this.compareMinY=new Function("a","b",i.join(t[1]));this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function Ua(t,i,s){if(!s)return i.indexOf(t);for(var e=0;e<i.length;e++){if(s(t,i[e]))return e}return-1}function Xa(t,i){qa(t,0,t.children.length,i,t)}function qa(t,i,s,e,r){if(!r)r=io(null);r.minX=Infinity;r.minY=Infinity;r.maxX=-Infinity;r.maxY=-Infinity;for(var n=i,h;n<s;n++){h=t.children[n];Ya(r,t.leaf?e(h):h)}return r}function Ya(t,i){t.minX=Math.min(t.minX,i.minX);t.minY=Math.min(t.minY,i.minY);t.maxX=Math.max(t.maxX,i.maxX);t.maxY=Math.max(t.maxY,i.maxY);return t}function Ba(t,i){return t.minX-i.minX}function Ha(t,i){return t.minY-i.minY}function Ja(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Za(t){return t.maxX-t.minX+(t.maxY-t.minY)}function $a(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function Ka(t,i){var s=Math.max(t.minX,i.minX),e=Math.max(t.minY,i.minY),r=Math.min(t.maxX,i.maxX),n=Math.min(t.maxY,i.maxY);return Math.max(0,r-s)*Math.max(0,n-e)}function Qa(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function to(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function io(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function so(t,i,s,e,r){var n=[i,s],h;while(n.length){s=n.pop();i=n.pop();if(s-i<=e)continue;h=i+Math.ceil((s-i)/e/2)*e;Ga(t,h,i,s,r);n.push(i,h,h,s)}}var eo=function(){};eo.prototype.getReplay=function(t,i){};eo.prototype.isEmpty=function(){};var ro={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};var no={};no.lineString=function(t,i,s,e){var r=t[i];var n=t[i+1];var h=0;var a;for(a=i+e;a<s;a+=e){var o=t[a];var f=t[a+1];h+=Math.sqrt((o-r)*(o-r)+(f-n)*(f-n));r=o;n=f}return h};no.linearRing=function(t,i,s,e){var r=no.lineString(t,i,s,e);var n=t[s-e]-t[i];var h=t[s-e+1]-t[i+1];r+=Math.sqrt(n*n+h*h);return r};var ho={};ho.lineString=function(t,i,s,e,r,n,h,a){var o=[];var f=t[i]>t[s-e];var u=r.length;var l=t[i];var v=t[i+1];i+=e;var c=t[i];var d=t[i+1];var m=0;var p=Math.sqrt(Math.pow(c-l,2)+Math.pow(d-v,2));var z="";var M=0;var _,g,b;for(var x=0;x<u;++x){g=f?u-x-1:x;var w=r.charAt(g);z=f?w+z:z+w;var y=n(z)-M;M+=y;var k=h+y/2;while(i<s-e&&m+p<k){l=c;v=d;i+=e;c=t[i];d=t[i+1];m+=p;p=Math.sqrt(Math.pow(c-l,2)+Math.pow(d-v,2))}var E=k-m;var C=Math.atan2(d-v,c-l);if(f){C+=C>0?-Math.PI:Math.PI}if(b!==undefined){var N=C-b;N+=N>Math.PI?-2*Math.PI:N<-Math.PI?2*Math.PI:0;if(Math.abs(N)>a){return null}}var I=E/p;var S=xn.lerp(l,c,I);var O=xn.lerp(v,d,I);if(b==C){if(f){_[0]=S;_[1]=O;_[2]=y/2}_[4]=z}else{z=w;M=y;_=[S,O,y/2,C,z];if(f){o.unshift(_)}else{o.push(_)}b=C}h+=y}return o};var ao={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12};var oo={};oo.ORDER=[ro.POLYGON,ro.CIRCLE,ro.LINE_STRING,ro.IMAGE,ro.TEXT,ro.DEFAULT];oo.TEXT_ALIGN={};oo.TEXT_ALIGN["left"]=0;oo.TEXT_ALIGN["end"]=0;oo.TEXT_ALIGN["center"]=.5;oo.TEXT_ALIGN["right"]=1;oo.TEXT_ALIGN["start"]=1;oo.TEXT_ALIGN["top"]=0;oo.TEXT_ALIGN["middle"]=.5;oo.TEXT_ALIGN["hanging"]=.2;oo.TEXT_ALIGN["alphabetic"]=.8;oo.TEXT_ALIGN["ideographic"]=.8;oo.TEXT_ALIGN["bottom"]=1;var fo=function(t,i,s,e,r,n){Na.call(this);this.declutterTree=n;this.tmpExtent_=Nn.createEmpty();this.tolerance=t;this.maxExtent=i;this.overlaps=r;this.pixelRatio=e;this.maxLineWidth=0;this.resolution=s;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_=null;this.bufferedMaxExtent_=null;this.instructions=[];this.coordinates=[];this.coordinateCache_={};this.renderedTransform_=Gn.create();this.hitDetectionInstructions=[];this.pixelCoordinates_=null;this.state={};this.viewRotation_=0;this.tmpLocalTransform_=Gn.create();this.resetTransform_=Gn.create()};fn.inherits(fo,Na);fo.prototype.replayTextBackground_=function(t,i,s,e,r,n,h){t.beginPath();t.moveTo.apply(t,i);t.lineTo.apply(t,s);t.lineTo.apply(t,e);t.lineTo.apply(t,r);t.lineTo.apply(t,i);if(n){this.fillOrigin_=n[2];this.fill_(t)}if(h){this.setStrokeStyle_(t,h);t.stroke()}};fo.prototype.replayImage_=function(t,i,s,e,r,n,h,a,o,f,u,l,v,c,d,m,p,z){var M=p||z;var _=this.tmpLocalTransform_;r*=v;n*=v;i-=r;s-=n;if(c){i=Math.round(i);s=Math.round(s)}var g=d+f>e.width?e.width-f:d;var b=a+u>e.height?e.height-u:a;var x=this.tmpExtent_;var w=m[3]+g*v+m[1];var y=m[0]+b*v+m[2];var k=i-m[3];var E=s-m[0];var C;var N;var I;var S;if(M||l!==0){C=[k,E];N=[k+w,E];I=[k+w,E+y];S=[k,E+y]}var O=null;if(l!==0){var T=i+r;var A=s+n;O=Gn.compose(_,T,A,1,1,l,-T,-A);Nn.createOrUpdateEmpty(x);Nn.extendCoordinate(x,Gn.apply(_,C));Nn.extendCoordinate(x,Gn.apply(_,N));Nn.extendCoordinate(x,Gn.apply(_,I));Nn.extendCoordinate(x,Gn.apply(_,S))}else{Nn.createOrUpdate(k,E,k+w,E+y,x)}var R=t.canvas;var P=x[0]<=R.width&&x[2]>=0&&x[1]<=R.height&&x[3]>=0;if(h){if(!P&&h[4]==1){return}Nn.extend(h,x);var L=P?[t,O?O.slice(0):null,o,e,f,u,g,b,i,s,v]:null;if(L&&M){L.push(p,z,C,N,I,S)}h.push(L)}else if(P){if(M){this.replayTextBackground_(t,C,N,I,S,p,z)}ka.drawImage(t,O,o,e,f,u,g,b,i,s,v)}};fo.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return i==1?t:t.map((function(t){return t*i}))};fo.prototype.appendFlatCoordinates=function(t,i,s,e,r,n){var h=this.coordinates.length;var a=this.getBufferedMaxExtent();if(n){i+=e}var o=[t[i],t[i+1]];var f=[NaN,NaN];var u=true;var l,v,c;for(l=i+e;l<s;l+=e){f[0]=t[l];f[1]=t[l+1];c=Nn.coordinateRelationship(a,f);if(c!==v){if(u){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else if(c===Cn.INTERSECTING){this.coordinates[h++]=f[0];this.coordinates[h++]=f[1];u=false}else{u=true}o[0]=f[0];o[1]=f[1];v=c}if(r&&u||l===i+e){this.coordinates[h++]=o[0];this.coordinates[h++]=o[1]}return h};fo.prototype.drawCustomCoordinates_=function(t,i,s,e,r){for(var n=0,h=s.length;n<h;++n){var a=s[n];var o=this.appendFlatCoordinates(t,i,a,e,false,false);r.push(o);i=a}return i};fo.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var e=t.getType();var r=t.getStride();var n=this.coordinates.length;var h,a,o,f;var u;if(e==wn.MULTI_POLYGON){t=t;h=t.getOrientedFlatCoordinates();f=[];var l=t.getEndss();u=0;for(var v=0,c=l.length;v<c;++v){var d=[];u=this.drawCustomCoordinates_(h,u,l[v],r,d);f.push(d)}this.instructions.push([ao.CUSTOM,n,f,t,s,Yn.coordinatesss])}else if(e==wn.POLYGON||e==wn.MULTI_LINE_STRING){o=[];h=e==wn.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates();u=this.drawCustomCoordinates_(h,0,t.getEnds(),r,o);this.instructions.push([ao.CUSTOM,n,o,t,s,Yn.coordinatess])}else if(e==wn.LINE_STRING||e==wn.MULTI_POINT){h=t.getFlatCoordinates();a=this.appendFlatCoordinates(h,0,h.length,r,false,false);this.instructions.push([ao.CUSTOM,n,a,t,s,Yn.coordinates])}else if(e==wn.POINT){h=t.getFlatCoordinates();this.coordinates.push(h[0],h[1]);a=this.coordinates.length;this.instructions.push([ao.CUSTOM,n,a,t,s])}this.endGeometry(t,i)};fo.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[ao.BEGIN_GEOMETRY,i,0];this.instructions.push(this.beginGeometryInstruction1_);this.beginGeometryInstruction2_=[ao.BEGIN_GEOMETRY,i,0];this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)};fo.prototype.fill_=function(t){if(this.fillOrigin_){var i=Gn.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]);t.rotate(this.viewRotation_)}t.fill();if(this.fillOrigin_){t.setTransform.apply(t,ka.resetTransform_)}};fo.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1];t.lineWidth=i[2];t.lineCap=i[3];t.lineJoin=i[4];t.miterLimit=i[5];if(rh.CANVAS_LINE_DASH){t.lineDashOffset=i[7];t.setLineDash(i[6])}};fo.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(s==1||s==t.length-5){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(e)){this.declutterTree.insert(e);var r=ka.drawImage;for(var n=5,h=t.length;n<h;++n){var a=t[n];if(a){if(a.length>11){this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12])}r.apply(undefined,a)}}}t.length=5;Nn.createOrUpdateEmpty(t)}}};fo.prototype.replay_=function(t,i,s,e,r,n){var h;if(this.pixelCoordinates_&&kn.equals(i,this.renderedTransform_)){h=this.pixelCoordinates_}else{if(!this.pixelCoordinates_){this.pixelCoordinates_=[]}h=On.transform2D(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_);Gn.setFromArray(this.renderedTransform_,i)}var a=!vn.isEmpty(s);var o=0;var f=e.length;var u=0;var l;var v,c,d,m,p,z,M,_;var g=0;var b=0;var x=null;var w=null;var y=this.coordinateCache_;var k=this.viewRotation_;var E={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k};var C=this.instructions!=e||this.overlaps?0:200;while(o<f){var N=e[o];var I=N[0];var S,O,T;switch(I){case ao.BEGIN_GEOMETRY:S=N[1];if(a&&s[fn.getUid(S).toString()]||!S.getGeometry()){o=N[2]}else if(n!==undefined&&!Nn.intersects(n,S.getGeometry().getExtent())){o=N[2]+1}else{++o}break;case ao.BEGIN_PATH:if(g>C){this.fill_(t);g=0}if(b>C){t.stroke();b=0}if(!g&&!b){t.beginPath();d=m=NaN}++o;break;case ao.CIRCLE:u=N[1];var A=h[u];var R=h[u+1];var P=h[u+2];var L=h[u+3];var D=P-A;var F=L-R;var W=Math.sqrt(D*D+F*F);t.moveTo(A+W,R);t.arc(A,R,W,0,2*Math.PI,true);++o;break;case ao.CLOSE_PATH:t.closePath();++o;break;case ao.CUSTOM:u=N[1];l=N[2];var G=N[3];var V=N[4];var j=N.length==6?N[5]:undefined;E.geometry=G;E.feature=S;if(!(o in y)){y[o]=[]}var U=y[o];if(j){j(h,u,l,2,U)}else{U[0]=h[u];U[1]=h[u+1];U.length=2}V(U,E);++o;break;case ao.DRAW_IMAGE:u=N[1];l=N[2];_=N[3];v=N[4];c=N[5];M=r?null:N[6];var X=N[7];var q=N[8];var Y=N[9];var B=N[10];var H=N[11];var J=N[12];var Z=N[13];var $=N[14];var K=N[15];var Q,tt,it;if(N.length>16){Q=N[16];tt=N[17];it=N[18]}else{Q=ka.defaultPadding;tt=it=false}if(H){J+=k}for(;u<l;u+=2){this.replayImage_(t,h[u],h[u+1],_,v,c,M,X,q,Y,B,J,Z,$,K,Q,tt?x:null,it?w:null)}this.renderDeclutter_(M,S);++o;break;case ao.DRAW_CHARS:var st=N[1];var et=N[2];var rt=N[3];M=r?null:N[4];var nt=N[5];var ht=N[6];var at=N[7];var ot=N[8];var ft=N[9];var ut=N[10];var lt=N[11];var vt=N[12];var ct=N[13];var dt=N[14];var mt=no.lineString(h,st,et,2);var pt=ot(vt);if(nt||pt<=mt){var zt=this.textStates[ct].textAlign;var Mt=(mt-pt)*oo.TEXT_ALIGN[zt];var _t=ho.lineString(h,st,et,2,vt,ot,Mt,at);if(_t){var gt,bt,xt,wt,yt;if(ut){for(gt=0,bt=_t.length;gt<bt;++gt){yt=_t[gt];xt=yt[4];wt=this.getImage(xt,ct,"",ut);v=yt[2]+lt;c=rt*wt.height+(.5-rt)*2*lt-ft;this.replayImage_(t,yt[0],yt[1],wt,v,c,M,wt.height,1,0,0,yt[3],dt,false,wt.width,ka.defaultPadding,null,null)}}if(ht){for(gt=0,bt=_t.length;gt<bt;++gt){yt=_t[gt];xt=yt[4];wt=this.getImage(xt,ct,ht,"");v=yt[2];c=rt*wt.height-ft;this.replayImage_(t,yt[0],yt[1],wt,v,c,M,wt.height,1,0,0,yt[3],dt,false,wt.width,ka.defaultPadding,null,null)}}}}this.renderDeclutter_(M,S);++o;break;case ao.END_GEOMETRY:if(r!==undefined){S=N[1];var kt=r(S);if(kt){return kt}}++o;break;case ao.FILL:if(C){g++}else{this.fill_(t)}++o;break;case ao.MOVE_TO_LINE_TO:u=N[1];l=N[2];O=h[u];T=h[u+1];p=O+.5|0;z=T+.5|0;if(p!==d||z!==m){t.moveTo(O,T);d=p;m=z}for(u+=2;u<l;u+=2){O=h[u];T=h[u+1];p=O+.5|0;z=T+.5|0;if(u==l-2||p!==d||z!==m){t.lineTo(O,T);d=p;m=z}}++o;break;case ao.SET_FILL_STYLE:x=N;this.fillOrigin_=N[2];if(g){this.fill_(t);g=0;if(b){t.stroke();b=0}}t.fillStyle=N[1];++o;break;case ao.SET_STROKE_STYLE:w=N;if(b){t.stroke();b=0}this.setStrokeStyle_(t,N);++o;break;case ao.STROKE:if(C){b++}else{t.stroke()}++o;break;default:++o;break}}if(g){this.fill_(t)}if(b){t.stroke()}return undefined};fo.prototype.replay=function(t,i,s,e){this.viewRotation_=s;this.replay_(t,i,e,this.instructions,undefined,undefined)};fo.prototype.replayHitDetection=function(t,i,s,e,r,n){this.viewRotation_=s;return this.replay_(t,i,e,this.hitDetectionInstructions,r,n)};fo.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var i;var s=t.length;var e;var r;var n=-1;for(i=0;i<s;++i){e=t[i];r=e[0];if(r==ao.END_GEOMETRY){n=i}else if(r==ao.BEGIN_GEOMETRY){e[2]=i;kn.reverseSubArray(this.hitDetectionInstructions,n,i);n=-1}}};fo.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var e=t.getColor();s.fillStyle=Ca.asColorLike(e?e:ka.defaultFillStyle)}else{s.fillStyle=undefined}if(i){var r=i.getColor();s.strokeStyle=Ca.asColorLike(r?r:ka.defaultStrokeStyle);var n=i.getLineCap();s.lineCap=n!==undefined?n:ka.defaultLineCap;var h=i.getLineDash();s.lineDash=h?h.slice():ka.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a?a:ka.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=o!==undefined?o:ka.defaultLineJoin;var f=i.getWidth();s.lineWidth=f!==undefined?f:ka.defaultLineWidth;var u=i.getMiterLimit();s.miterLimit=u!==undefined?u:ka.defaultMiterLimit;if(s.lineWidth>this.maxLineWidth){this.maxLineWidth=s.lineWidth;this.bufferedMaxExtent_=null}}else{s.strokeStyle=undefined;s.lineCap=undefined;s.lineDash=null;s.lineDashOffset=undefined;s.lineJoin=undefined;s.lineWidth=undefined;s.miterLimit=undefined}};fo.prototype.applyFill=function(t,i){var s=t.fillStyle;var e=[ao.SET_FILL_STYLE,s];if(typeof s!=="string"){var r=i.getExtent();e.push([r[0],r[3]])}this.instructions.push(e)};fo.prototype.applyStroke=function(t){this.instructions.push([ao.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])};fo.prototype.updateFillStyle=function(t,i,s){var e=t.fillStyle;if(typeof e!=="string"||t.currentFillStyle!=e){i.call(this,t,s);t.currentFillStyle=e}};fo.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle;var e=t.lineCap;var r=t.lineDash;var n=t.lineDashOffset;var h=t.lineJoin;var a=t.lineWidth;var o=t.miterLimit;if(t.currentStrokeStyle!=s||t.currentLineCap!=e||r!=t.currentLineDash&&!kn.equals(t.currentLineDash,r)||t.currentLineDashOffset!=n||t.currentLineJoin!=h||t.currentLineWidth!=a||t.currentMiterLimit!=o){i.call(this,t);t.currentStrokeStyle=s;t.currentLineCap=e;t.currentLineDash=r;t.currentLineDashOffset=n;t.currentLineJoin=h;t.currentLineWidth=a;t.currentMiterLimit=o}};fo.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length;this.beginGeometryInstruction1_=null;this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length;this.beginGeometryInstruction2_=null;var s=[ao.END_GEOMETRY,i];this.instructions.push(s);this.hitDetectionInstructions.push(s)};fo.prototype.finish=fn.nullFunction;fo.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_){this.bufferedMaxExtent_=Nn.clone(this.maxExtent);if(this.maxLineWidth>0){var t=this.resolution*(this.maxLineWidth+1)/2;Nn.buffer(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}}return this.bufferedMaxExtent_};var uo=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n);this.declutterGroup_=null;this.hitDetectionImage_=null;this.image_=null;this.anchorX_=undefined;this.anchorY_=undefined;this.height_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.scale_=undefined;this.snapToPixel_=undefined;this.width_=undefined};fn.inherits(uo,fo);uo.prototype.drawCoordinates_=function(t,i,s,e){return this.appendFlatCoordinates(t,i,s,e,false,false)};uo.prototype.drawPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([ao.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([ao.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};uo.prototype.drawMultiPoint=function(t,i){if(!this.image_){return}this.beginGeometry(t,i);var s=t.getFlatCoordinates();var e=t.getStride();var r=this.coordinates.length;var n=this.drawCoordinates_(s,0,s.length,e);this.instructions.push([ao.DRAW_IMAGE,r,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]);this.hitDetectionInstructions.push([ao.DRAW_IMAGE,r,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]);this.endGeometry(t,i)};uo.prototype.finish=function(){this.reverseHitDetectionInstructions();this.anchorX_=undefined;this.anchorY_=undefined;this.hitDetectionImage_=null;this.image_=null;this.height_=undefined;this.scale_=undefined;this.opacity_=undefined;this.originX_=undefined;this.originY_=undefined;this.rotateWithView_=undefined;this.rotation_=undefined;this.snapToPixel_=undefined;this.width_=undefined};uo.prototype.setImageStyle=function(t,i){var s=t.getAnchor();var e=t.getSize();var r=t.getHitDetectionImage(1);var n=t.getImage(1);var h=t.getOrigin();this.anchorX_=s[0];this.anchorY_=s[1];this.declutterGroup_=i;this.hitDetectionImage_=r;this.image_=n;this.height_=e[1];this.opacity_=t.getOpacity();this.originX_=h[0];this.originY_=h[1];this.rotateWithView_=t.getRotateWithView();this.rotation_=t.getRotation();this.scale_=t.getScale();this.snapToPixel_=t.getSnapToPixel();this.width_=e[0]};var lo=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n)};fn.inherits(lo,fo);lo.prototype.drawFlatCoordinates_=function(t,i,s,e){var r=this.coordinates.length;var n=this.appendFlatCoordinates(t,i,s,e,false,false);var h=[ao.MOVE_TO_LINE_TO,r,n];this.instructions.push(h);this.hitDetectionInstructions.push(h);return s};lo.prototype.drawLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[ao.BEGIN_PATH]);var n=t.getFlatCoordinates();var h=t.getStride();this.drawFlatCoordinates_(n,0,n.length,h);this.hitDetectionInstructions.push([ao.STROKE]);this.endGeometry(t,i)};lo.prototype.drawMultiLineString=function(t,i){var s=this.state;var e=s.strokeStyle;var r=s.lineWidth;if(e===undefined||r===undefined){return}this.updateStrokeStyle(s,this.applyStroke);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[ao.BEGIN_PATH]);var n=t.getEnds();var h=t.getFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinates_(h,o,n[f],a)}this.hitDetectionInstructions.push([ao.STROKE]);this.endGeometry(t,i)};lo.prototype.finish=function(){var t=this.state;if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([ao.STROKE])}this.reverseHitDetectionInstructions();this.state=null};lo.prototype.applyStroke=function(t){if(t.lastStroke!=undefined&&t.lastStroke!=this.coordinates.length){this.instructions.push([ao.STROKE]);t.lastStroke=this.coordinates.length}t.lastStroke=0;fo.prototype.applyStroke.call(this,t);this.instructions.push([ao.BEGIN_PATH])};var vo=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n)};fn.inherits(vo,fo);vo.prototype.drawFlatCoordinatess_=function(t,i,s,e){var r=this.state;var n=r.fillStyle!==undefined;var h=r.strokeStyle!=undefined;var a=s.length;var o=[ao.BEGIN_PATH];this.instructions.push(o);this.hitDetectionInstructions.push(o);for(var f=0;f<a;++f){var u=s[f];var l=this.coordinates.length;var v=this.appendFlatCoordinates(t,i,u,e,true,!h);var c=[ao.MOVE_TO_LINE_TO,l,v];this.instructions.push(c);this.hitDetectionInstructions.push(c);if(h){var d=[ao.CLOSE_PATH];this.instructions.push(d);this.hitDetectionInstructions.push(d)}i=u}var m=[ao.FILL];this.hitDetectionInstructions.push(m);if(n){this.instructions.push(m)}if(h){var p=[ao.STROKE];this.instructions.push(p);this.hitDetectionInstructions.push(p)}return i};vo.prototype.drawCircle=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_FILL_STYLE,Ea.asString(ka.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getFlatCoordinates();var h=t.getStride();var a=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,h,false,false);var o=[ao.BEGIN_PATH];var f=[ao.CIRCLE,a];this.instructions.push(o,f);this.hitDetectionInstructions.push(o,f);var u=[ao.FILL];this.hitDetectionInstructions.push(u);if(s.fillStyle!==undefined){this.instructions.push(u)}if(s.strokeStyle!==undefined){var l=[ao.STROKE];this.instructions.push(l);this.hitDetectionInstructions.push(l)}this.endGeometry(t,i)};vo.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_FILL_STYLE,Ea.asString(ka.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var e=t.getEnds();var r=t.getOrientedFlatCoordinates();var n=t.getStride();this.drawFlatCoordinatess_(r,0,e,n);this.endGeometry(t,i)};vo.prototype.drawMultiPolygon=function(t,i){var s=this.state;var e=s.fillStyle;var r=s.strokeStyle;if(e===undefined&&r===undefined){return}this.setFillStrokeStyles_(t);this.beginGeometry(t,i);this.hitDetectionInstructions.push([ao.SET_FILL_STYLE,Ea.asString(ka.defaultFillStyle)]);if(s.strokeStyle!==undefined){this.hitDetectionInstructions.push([ao.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset])}var n=t.getEndss();var h=t.getOrientedFlatCoordinates();var a=t.getStride();var o=0;var f,u;for(f=0,u=n.length;f<u;++f){o=this.drawFlatCoordinatess_(h,o,n[f],a)}this.endGeometry(t,i)};vo.prototype.finish=function(){this.reverseHitDetectionInstructions();this.state=null;var t=this.tolerance;if(t!==0){var i=this.coordinates;var s,e;for(s=0,e=i.length;s<e;++s){i[s]=Bn.snap(i[s],t)}}};vo.prototype.setFillStrokeStyles_=function(t){var i=this.state;var s=i.fillStyle;if(s!==undefined){this.updateFillStyle(i,this.applyFill,t)}if(i.strokeStyle!==undefined){this.updateStrokeStyle(i,this.applyStroke)}};var co={};co.lineString=function(t,i,s,e,r){var n=s;var h=s;var a=0;var o=0;var f=s;var u,l,v,c,d,m,p,z,M,_;for(l=s;l<e;l+=r){var g=i[l];var b=i[l+1];if(d!==undefined){M=g-d;_=b-m;c=Math.sqrt(M*M+_*_);if(p!==undefined){o+=v;u=Math.acos((p*M+z*_)/(v*c));if(u>t){if(o>a){a=o;n=f;h=l}o=0;f=l-r}}v=c;p=M;z=_}d=g;m=b}o+=c;return o>a?[f,l]:[n,h]};var mo={POINT:"point",LINE:"line"};var po=function(t,i,s,e,r,n){fo.call(this,t,i,s,e,r,n);this.labels_=null;this.text_="";this.textOffsetX_=0;this.textOffsetY_=0;this.textRotateWithView_=undefined;this.textRotation_=0;this.textFillState_=null;this.fillStates={};this.textStrokeState_=null;this.strokeStates={};this.textState_={};this.textStates={};this.textKey_="";this.fillKey_="";this.strokeKey_="";this.widths_={};var h=ka.labelCache;h.prune()};fn.inherits(po,fo);po.measureTextWidths=function(t,i,s){var e=i.length;var r=0;var n,h;for(h=0;h<e;++h){n=ka.measureTextWidth(t,i[h]);r=Math.max(r,n);s.push(n)}return r};po.prototype.drawText=function(t,i){var s=this.textFillState_;var e=this.textStrokeState_;var r=this.textState_;if(this.text_===""||!r||!s&&!e){return}var n=this.coordinates.length;var h=t.getType();var a=null;var o=2;var f=2;var u,l;if(r.placement===mo.LINE){if(!Nn.intersects(this.getBufferedMaxExtent(),t.getExtent())){return}var v;a=t.getFlatCoordinates();f=t.getStride();if(h==wn.LINE_STRING){v=[a.length]}else if(h==wn.MULTI_LINE_STRING){v=t.getEnds()}else if(h==wn.POLYGON){v=t.getEnds().slice(0,1)}else if(h==wn.MULTI_POLYGON){var c=t.getEndss();v=[];for(u=0,l=c.length;u<l;++u){v.push(c[u][0])}}this.beginGeometry(t,i);var d=r.textAlign;var m=0;var p;for(var z=0,M=v.length;z<M;++z){if(d==undefined){var _=co.lineString(r.maxAngle,a,m,v[z],f);m=_[0];p=_[1]}else{p=v[z]}for(u=m;u<p;u+=f){this.coordinates.push(a[u],a[u+1])}o=this.coordinates.length;m=v[z];this.drawChars_(n,o,this.declutterGroup_);n=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_);var b=g.width/this.pixelRatio;switch(h){case wn.POINT:case wn.MULTI_POINT:a=t.getFlatCoordinates();o=a.length;break;case wn.LINE_STRING:a=t.getFlatMidpoint();break;case wn.CIRCLE:a=t.getCenter();break;case wn.MULTI_LINE_STRING:a=t.getFlatMidpoints();o=a.length;break;case wn.POLYGON:a=t.getFlatInteriorPoint();if(!r.overflow&&a[2]/this.resolution<b){return}f=3;break;case wn.MULTI_POLYGON:var x=t.getFlatInteriorPoints();a=[];for(u=0,l=x.length;u<l;u+=3){if(r.overflow||x[u+2]/this.resolution>=b){a.push(x[u],x[u+1])}}o=a.length;if(o==0){return}break}o=this.appendFlatCoordinates(a,0,o,f,false,false);this.beginGeometry(t,i);if(r.backgroundFill||r.backgroundStroke){this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke);this.updateFillStyle(this.state,this.applyFill,t);this.updateStrokeStyle(this.state,this.applyStroke)}this.drawTextImage_(g,n,o);this.endGeometry(t,i)}};po.prototype.getImage=function(t,i,s,e){var r;var n=e+i+t+s+this.pixelRatio;var h=ka.labelCache;if(!h.containsKey(n)){var a=e?this.strokeStates[e]||this.textStrokeState_:null;var o=s?this.fillStates[s]||this.textFillState_:null;var f=this.textStates[i]||this.textState_;var u=this.pixelRatio;var l=f.scale*u;var v=oo.TEXT_ALIGN[f.textAlign||ka.defaultTextAlign];var c=e&&a.lineWidth?a.lineWidth:0;var d=t.split("\n");var m=d.length;var p=[];var z=po.measureTextWidths(f.font,d,p);var M=ka.measureTextHeight(f.font);var _=M*m;var g=z+c;var b=Lh.createCanvasContext2D(Math.ceil(g*l),Math.ceil((_+c)*l));r=b.canvas;h.set(n,r);if(l!=1){b.scale(l,l)}b.font=f.font;if(e){b.strokeStyle=a.strokeStyle;b.lineWidth=c*(rh.SAFARI?l:1);b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.miterLimit=a.miterLimit;if(rh.CANVAS_LINE_DASH&&a.lineDash.length){b.setLineDash(a.lineDash);b.lineDashOffset=a.lineDashOffset}}if(s){b.fillStyle=o.fillStyle}b.textBaseline="middle";b.textAlign="center";var x=.5-v;var w=v*r.width/l+x*c;var y;if(e){for(y=0;y<m;++y){b.strokeText(d[y],w+x*p[y],.5*(c+M)+y*M)}}if(s){for(y=0;y<m;++y){b.fillText(d[y],w+x*p[y],.5*(c+M)+y*M)}}}return h.get(n)};po.prototype.drawTextImage_=function(t,i,s){var e=this.textState_;var r=this.textStrokeState_;var n=this.pixelRatio;var h=oo.TEXT_ALIGN[e.textAlign||ka.defaultTextAlign];var a=oo.TEXT_ALIGN[e.textBaseline];var o=r&&r.lineWidth?r.lineWidth:0;var f=h*t.width/n+2*(.5-h)*o;var u=a*t.height/n+2*(.5-a)*o;this.instructions.push([ao.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,true,t.width,e.padding==ka.defaultPadding?ka.defaultPadding:e.padding.map((function(t){return t*n})),!!e.backgroundFill,!!e.backgroundStroke]);this.hitDetectionInstructions.push([ao.DRAW_IMAGE,i,s,t,(f-this.textOffsetX_)*n,(u-this.textOffsetY_)*n,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,true,t.width,e.padding,!!e.backgroundFill,!!e.backgroundStroke])};po.prototype.drawChars_=function(t,i,s){var e=this.textStrokeState_;var r=this.textState_;var n=this.textFillState_;var h=this.strokeKey_;if(e){if(!(h in this.strokeStates)){this.strokeStates[h]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}}}var a=this.textKey_;if(!(this.textKey_ in this.textStates)){this.textStates[this.textKey_]={font:r.font,textAlign:r.textAlign||ka.defaultTextAlign,scale:r.scale}}var o=this.fillKey_;if(n){if(!(o in this.fillStates)){this.fillStates[o]={fillStyle:n.fillStyle}}}var f=this.pixelRatio;var u=oo.TEXT_ALIGN[r.textBaseline];var l=this.textOffsetY_*f;var v=this.text_;var c=r.font;var d=r.scale;var m=e?e.lineWidth*d/2:0;var p=this.widths_[c];if(!p){this.widths_[c]=p={}}this.instructions.push([ao.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=ka.measureTextWidth(c,t)}return i*d*f},l,h,m*f,v,a,1]);this.hitDetectionInstructions.push([ao.DRAW_CHARS,t,i,u,s,r.overflow,o,r.maxAngle,function(t){var i=p[t];if(!i){i=p[t]=ka.measureTextWidth(c,t)}return i*d},l,h,m,v,a,1/f])};po.prototype.setTextStyle=function(t,i){var s,e,r;if(!t){this.text_=""}else{this.declutterGroup_=i;var n=t.getFill();if(!n){e=this.textFillState_=null}else{e=this.textFillState_;if(!e){e=this.textFillState_={}}e.fillStyle=Ca.asColorLike(n.getColor()||ka.defaultFillStyle)}var h=t.getStroke();if(!h){r=this.textStrokeState_=null}else{r=this.textStrokeState_;if(!r){r=this.textStrokeState_={}}var a=h.getLineDash();var o=h.getLineDashOffset();var f=h.getWidth();var u=h.getMiterLimit();r.lineCap=h.getLineCap()||ka.defaultLineCap;r.lineDash=a?a.slice():ka.defaultLineDash;r.lineDashOffset=o===undefined?ka.defaultLineDashOffset:o;r.lineJoin=h.getLineJoin()||ka.defaultLineJoin;r.lineWidth=f===undefined?ka.defaultLineWidth:f;r.miterLimit=u===undefined?ka.defaultMiterLimit:u;r.strokeStyle=Ca.asColorLike(h.getColor()||ka.defaultStrokeStyle)}s=this.textState_;var l=t.getFont()||ka.defaultFont;ka.checkFont(l);var v=t.getScale();s.overflow=t.getOverflow();s.font=l;s.maxAngle=t.getMaxAngle();s.placement=t.getPlacement();s.textAlign=t.getTextAlign();s.textBaseline=t.getTextBaseline()||ka.defaultTextBaseline;s.backgroundFill=t.getBackgroundFill();s.backgroundStroke=t.getBackgroundStroke();s.padding=t.getPadding()||ka.defaultPadding;s.scale=v===undefined?1:v;var c=t.getOffsetX();var d=t.getOffsetY();var m=t.getRotateWithView();var p=t.getRotation();this.text_=t.getText()||"";this.textOffsetX_=c===undefined?0:c;this.textOffsetY_=d===undefined?0:d;this.textRotateWithView_=m===undefined?false:m;this.textRotation_=p===undefined?0:p;this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:fn.getUid(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"";this.textKey_=s.font+s.scale+(s.textAlign||"?");this.fillKey_=e?typeof e.fillStyle=="string"?e.fillStyle:"|"+fn.getUid(e.fillStyle):""}};var zo=function(t,i,s,e,r,n,h){eo.call(this);this.declutterTree_=n;this.declutterGroup_=null;this.tolerance_=t;this.maxExtent_=i;this.overlaps_=r;this.pixelRatio_=e;this.resolution_=s;this.renderBuffer_=h;this.replaysByZIndex_={};this.hitDetectionContext_=Lh.createCanvasContext2D(1,1);this.hitDetectionTransform_=Gn.create()};fn.inherits(zo,eo);zo.circleArrayCache_={0:[[true]]};zo.fillCircleArrayRowToMiddle_=function(t,i,s){var e;var r=Math.floor(t.length/2);if(i>=r){for(e=r;e<i;e++){t[e][s]=true}}else if(i<r){for(e=i+1;e<r;e++){t[e][s]=true}}};zo.getCircleArray_=function(t){if(zo.circleArrayCache_[t]!==undefined){return zo.circleArrayCache_[t]}var i=t*2+1;var s=new Array(i);for(var e=0;e<i;e++){s[e]=new Array(i)}var r=t;var n=0;var h=0;while(r>=n){zo.fillCircleArrayRowToMiddle_(s,t+r,t+n);zo.fillCircleArrayRowToMiddle_(s,t+n,t+r);zo.fillCircleArrayRowToMiddle_(s,t-n,t+r);zo.fillCircleArrayRowToMiddle_(s,t-r,t+n);zo.fillCircleArrayRowToMiddle_(s,t-r,t-n);zo.fillCircleArrayRowToMiddle_(s,t-n,t-r);zo.fillCircleArrayRowToMiddle_(s,t+n,t-r);zo.fillCircleArrayRowToMiddle_(s,t+r,t-n);n++;h+=1+2*n;if(2*(h-r)+1>0){r-=1;h+=1-2*r}}zo.circleArrayCache_[t]=s;return s};zo.replayDeclutter=function(t,i,s){var e=Object.keys(t).map(Number).sort(kn.numberSafeCompareFunction);var r={};for(var n=0,h=e.length;n<h;++n){var a=t[e[n].toString()];for(var o=0,f=a.length;o<f;){var u=a[o++];var l=a[o++];u.replay(i,l,s,r)}}};zo.prototype.addDeclutter=function(t){var i=null;if(this.declutterTree_){if(t){i=this.declutterGroup_;i[4]++}else{i=this.declutterGroup_=Nn.createEmpty();i.push(1)}}return i};zo.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath();t.moveTo(s[0],s[1]);t.lineTo(s[2],s[3]);t.lineTo(s[4],s[5]);t.lineTo(s[6],s[7]);t.clip()};zo.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];for(var e=0,r=t.length;e<r;++e){if(t[e]in s){return true}}}return false};zo.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i=this.replaysByZIndex_[t];var s;for(s in i){i[s].finish()}}};zo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){e=Math.round(e);var a=e*2+1;var o=Gn.compose(this.hitDetectionTransform_,e+.5,e+.5,1/i,-1/i,-s,-t[0],-t[1]);var f=this.hitDetectionContext_;if(f.canvas.width!==a||f.canvas.height!==a){f.canvas.width=a;f.canvas.height=a}else{f.clearRect(0,0,a,a)}var u;if(this.renderBuffer_!==undefined){u=Nn.createEmpty();Nn.extendCoordinate(u,t);Nn.buffer(u,i*(this.renderBuffer_+e),u)}var l=zo.getCircleArray_(e);var v;if(this.declutterTree_){v=this.declutterTree_.all().map((function(t){return t.value}))}var c;function d(t){var i=f.getImageData(0,0,a,a).data;for(var s=0;s<a;s++){for(var e=0;e<a;e++){if(l[s][e]){if(i[(e*a+s)*4+3]>0){var r;if(!(v&&(c==ro.IMAGE||c==ro.TEXT))||v.indexOf(t)!==-1){r=n(t)}if(r){return r}else{f.clearRect(0,0,a,a);return undefined}}}}}}var m=Object.keys(this.replaysByZIndex_).map(Number);m.sort(kn.numberSafeCompareFunction);var p,z,M,_,g;for(p=m.length-1;p>=0;--p){var b=m[p].toString();M=this.replaysByZIndex_[b];for(z=oo.ORDER.length-1;z>=0;--z){c=oo.ORDER[z];_=M[c];if(_!==undefined){if(h&&(c==ro.IMAGE||c==ro.TEXT)){var x=h[b];if(!x){h[b]=[_,o.slice(0)]}else{x.push(_,o.slice(0))}}else{g=_.replayHitDetection(f,o,s,r,d,u);if(g){return g}}}}}return undefined};zo.prototype.getClipCoords=function(t){var i=this.maxExtent_;var s=i[0];var e=i[1];var r=i[2];var n=i[3];var h=[s,e,s,n,r,n,r,e];On.transform2D(h,0,8,2,t,h);return h};zo.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=zo.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_);e[i]=r}return r};zo.prototype.getReplays=function(){return this.replaysByZIndex_};zo.prototype.isEmpty=function(){return vn.isEmpty(this.replaysByZIndex_)};zo.prototype.replay=function(t,i,s,e,r,n){var h=Object.keys(this.replaysByZIndex_).map(Number);h.sort(kn.numberSafeCompareFunction);t.save();this.clip(t,i);var a=r?r:oo.ORDER;var o,f,u,l,v,c;for(o=0,f=h.length;o<f;++o){var d=h[o].toString();v=this.replaysByZIndex_[d];for(u=0,l=a.length;u<l;++u){var m=a[u];c=v[m];if(c!==undefined){if(n&&(m==ro.IMAGE||m==ro.TEXT)){var p=n[d];if(!p){n[d]=[c,i.slice(0)]}else{p.push(c,i.slice(0))}}else{c.replay(t,i,s,e)}}}}t.restore()};zo.BATCH_CONSTRUCTORS_={Circle:vo,Default:fo,Image:uo,LineString:lo,Polygon:vo,Text:po};var Mo={};Mo.defaultOrder=function(t,i){return fn.getUid(t)-fn.getUid(i)};Mo.getSquaredTolerance=function(t,i){var s=Mo.getTolerance(t,i);return s*s};Mo.getTolerance=function(t,i){return fn.SIMPLIFY_TOLERANCE*t/i};Mo.renderCircleGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),ro.CIRCLE);h.setFillStrokeStyle(r,n);h.drawCircle(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),ro.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Mo.renderFeature=function(t,i,s,e,r,n){var h=false;var a,o;a=s.getImage();if(a){o=a.getImageState();if(o==_a.LOADED||o==_a.ERROR){a.unlistenImageChange(r,n)}else{if(o==_a.IDLE){a.load()}o=a.getImageState();a.listenImageChange(r,n);h=true}}Mo.renderFeature_(t,i,s,e);return h};Mo.renderFeature_=function(t,i,s,e){var r=s.getGeometryFunction()(i);if(!r){return}var n=r.getSimplifiedGeometry(e);var h=s.getRenderer();if(h){Mo.renderGeometry_(t,n,s,i)}else{var a=Mo.GEOMETRY_RENDERERS_[n.getType()];a(t,n,s,i)}};Mo.renderGeometry_=function(t,i,s,e){if(i.getType()==wn.GEOMETRY_COLLECTION){var r=i.getGeometries();for(var n=0,h=r.length;n<h;++n){Mo.renderGeometry_(t,r[n],s,e)}return}var a=t.getReplay(s.getZIndex(),ro.DEFAULT);a.drawCustom(i,e,s.getRenderer())};Mo.renderGeometryCollectionGeometry_=function(t,i,s,e){var r=i.getGeometriesArray();var n,h;for(n=0,h=r.length;n<h;++n){var a=Mo.GEOMETRY_RENDERERS_[r[n].getType()];a(t,r[n],s,e)}};Mo.renderLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),ro.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Mo.renderMultiLineStringGeometry_=function(t,i,s,e){var r=s.getStroke();if(r){var n=t.getReplay(s.getZIndex(),ro.LINE_STRING);n.setFillStrokeStyle(null,r);n.drawMultiLineString(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(false));a.drawText(i,e)}};Mo.renderMultiPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(n||r){var h=t.getReplay(s.getZIndex(),ro.POLYGON);h.setFillStrokeStyle(r,n);h.drawMultiPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),ro.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Mo.renderPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=_a.LOADED){return}var n=t.getReplay(s.getZIndex(),ro.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Mo.renderMultiPointGeometry_=function(t,i,s,e){var r=s.getImage();if(r){if(r.getImageState()!=_a.LOADED){return}var n=t.getReplay(s.getZIndex(),ro.IMAGE);n.setImageStyle(r,t.addDeclutter(false));n.drawMultiPoint(i,e)}var h=s.getText();if(h){var a=t.getReplay(s.getZIndex(),ro.TEXT);a.setTextStyle(h,t.addDeclutter(!!r));a.drawText(i,e)}};Mo.renderPolygonGeometry_=function(t,i,s,e){var r=s.getFill();var n=s.getStroke();if(r||n){var h=t.getReplay(s.getZIndex(),ro.POLYGON);h.setFillStrokeStyle(r,n);h.drawPolygon(i,e)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),ro.TEXT);o.setTextStyle(a,t.addDeclutter(false));o.drawText(i,e)}};Mo.GEOMETRY_RENDERERS_={Point:Mo.renderPointGeometry_,LineString:Mo.renderLineStringGeometry_,Polygon:Mo.renderPolygonGeometry_,MultiPoint:Mo.renderMultiPointGeometry_,MultiLineString:Mo.renderMultiLineStringGeometry_,MultiPolygon:Mo.renderMultiPolygonGeometry_,GeometryCollection:Mo.renderGeometryCollectionGeometry_,Circle:Mo.renderCircleGeometry_};var _o=function(t){Oa.call(this,t);this.declutterTree_=t.getDeclutter()?Va(9):null;this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=Nn.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.replayGroupChanged=true;this.context=Lh.createCanvasContext2D();cn.listen(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this)};fn.inherits(_o,Oa);_o["handles"]=function(t,i){return t===Uh.CANVAS&&i.getType()===ba.VECTOR};_o["create"]=function(t,i){return new _o(i)};_o.prototype.disposeInternal=function(){cn.unlisten(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this);Oa.prototype.disposeInternal.call(this)};_o.prototype.composeFrame=function(t,i,s){var e=t.extent;var r=t.pixelRatio;var n=i.managed?t.skippedFeatureUids:{};var h=t.viewState;var a=h.projection;var o=h.rotation;var f=a.getExtent();var u=this.getLayer().getSource();var l=this.getTransform(t,0);this.preCompose(s,t,l);var v=i.extent;var c=v!==undefined;if(c){this.clip(s,t,v)}var d=this.replayGroup_;if(d&&!d.isEmpty()){if(this.declutterTree_){this.declutterTree_.clear()}var m=this.getLayer();var p=0;var z=0;var M;var _=i.opacity!==1;var g=m.hasListener(Hh.RENDER);if(_||g){var b=s.canvas.width;var x=s.canvas.height;if(o){var w=Math.round(Math.sqrt(b*b+x*x));p=(w-b)/2;z=(w-x)/2;b=x=w}this.context.canvas.width=b;this.context.canvas.height=x;M=this.context}else{M=s}var y=M.globalAlpha;if(!_){M.globalAlpha=i.opacity}if(M!=s){M.translate(p,z)}var k=t.size[0]*r;var E=t.size[1]*r;ka.rotateAtOffset(M,-o,k/2,E/2);d.replay(M,l,o,n);if(u.getWrapX()&&a.canWrapX()&&!Nn.containsExtent(f,e)){var C=e[0];var N=Nn.getWidth(f);var I=0;var S;while(C<f[0]){--I;S=N*I;l=this.getTransform(t,S);d.replay(M,l,o,n);C+=N}I=0;C=e[2];while(C>f[2]){++I;S=N*I;l=this.getTransform(t,S);d.replay(M,l,o,n);C-=N}l=this.getTransform(t,0)}ka.rotateAtOffset(M,o,k/2,E/2);if(M!=s){if(g){this.dispatchRenderEvent(M,t,l)}if(_){var O=s.globalAlpha;s.globalAlpha=i.opacity;s.drawImage(M.canvas,-p,-z);s.globalAlpha=O}else{s.drawImage(M.canvas,-p,-z)}M.translate(-p,-z)}if(!_){M.globalAlpha=y}}if(c){s.restore()}this.postCompose(s,t,i,l)};_o.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_){return undefined}else{var n=i.viewState.resolution;var h=i.viewState.rotation;var a=this.getLayer();var o={};var f=this.replayGroup_.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=fn.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null);return f}};_o.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.replayGroup_){i.changed()}};_o.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};_o.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getSource();this.updateLogos(t,e);var r=t.viewHints[Sh.ANIMATING];var n=t.viewHints[Sh.INTERACTING];var h=s.getUpdateWhileAnimating();var a=s.getUpdateWhileInteracting();if(!this.dirty_&&(!h&&r)||!a&&n){return true}var o=t.extent;var f=t.viewState;var u=f.projection;var l=f.resolution;var v=t.pixelRatio;var c=s.getRevision();var d=s.getRenderBuffer();var m=s.getRenderOrder();if(m===undefined){m=Mo.defaultOrder}var p=Nn.buffer(o,d*l);var z=f.projection.getExtent();if(e.getWrapX()&&f.projection.canWrapX()&&!Nn.containsExtent(z,t.extent)){var M=Nn.getWidth(z);var _=Math.max(Nn.getWidth(p)/2,M);p[0]=z[0]-_;p[2]=z[2]+_}if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==c&&this.renderedRenderOrder_==m&&Nn.containsExtent(this.renderedExtent_,p)){this.replayGroupChanged=false;return true}this.replayGroup_=null;this.dirty_=false;var g=new zo(Mo.getTolerance(l,v),p,l,v,e.getOverlaps(),this.declutterTree_,s.getRenderBuffer());e.loadFeatures(p,l,u);var b=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,l)}else{e=s.getStyleFunction();if(e){i=e(t,l)}}if(i){var r=this.renderFeature(t,l,v,i,g);this.dirty_=this.dirty_||r}}.bind(this);if(m){var x=[];e.forEachFeatureInExtent(p,(function(t){x.push(t)}),this);x.sort(m);for(var w=0,y=x.length;w<y;++w){b(x[w])}}else{e.forEachFeatureInExtent(p,b,this)}g.finish();this.renderedResolution_=l;this.renderedRevision_=c;this.renderedRenderOrder_=m;this.renderedExtent_=p;this.replayGroup_=g;this.replayGroupChanged=true;return true};_o.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=0,a=e.length;h<a;++h){n=Mo.renderFeature(r,t,e[h],Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Mo.renderFeature(r,t,e,Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)}return n};var go={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var bo=function(t){this.context=null;Wa.call(this,t);this.declutterTree_=t.getDeclutter()?Va(9):null;this.dirty_=false;this.tmpTransform_=Gn.create();this.zDirection=t.getRenderMode()==go.VECTOR?1:0;cn.listen(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this)};fn.inherits(bo,Wa);bo["handles"]=function(t,i){return t===Uh.CANVAS&&i.getType()===ba.VECTOR_TILE};bo["create"]=function(t,i){return new bo(i)};bo.IMAGE_REPLAYS={image:[ro.POLYGON,ro.CIRCLE,ro.LINE_STRING,ro.IMAGE,ro.TEXT],hybrid:[ro.POLYGON,ro.LINE_STRING]};bo.VECTOR_REPLAYS={image:[ro.DEFAULT],hybrid:[ro.IMAGE,ro.TEXT,ro.DEFAULT],vector:oo.ORDER};bo.prototype.disposeInternal=function(){cn.unlisten(ka.labelCache,zn.CLEAR,this.handleFontsChanged_,this);Wa.prototype.disposeInternal.call(this)};bo.prototype.prepareFrame=function(t,i){var s=this.getLayer();var e=s.getRevision();if(this.renderedLayerRevision_!=e){this.renderedTiles.length=0;var r=s.getRenderMode();if(!this.context&&r!=go.VECTOR){this.context=Lh.createCanvasContext2D()}if(this.context&&r==go.VECTOR){this.context=null}}this.renderedLayerRevision_=e;return Wa.prototype.prepareFrame.apply(this,arguments)};bo.prototype.createReplayGroup_=function(t,i){var s=this.getLayer();var e=i.pixelRatio;var r=i.viewState.projection;var n=s.getRevision();var h=s.getRenderOrder()||null;var a=t.getReplayState(s);if(!a.dirty&&a.renderedRevision==n&&a.renderedRenderOrder==h){return}var o=s.getSource();var f=o.getTileGrid();var u=o.getTileGridForProjection(r);var l=u.getResolution(t.tileCoord[0]);var v=u.getTileCoordExtent(t.wrappedTileCoord);for(var c=0,d=t.tileKeys.length;c<d;++c){var m=t.getTile(t.tileKeys[c]);if(m.getState()==yh.ERROR){continue}var p=m.tileCoord;var z=f.getTileCoordExtent(p);var M=Nn.getIntersection(v,z);var _=Nn.equals(z,M)?null:Nn.buffer(M,s.getRenderBuffer()*l);var g=m.getProjection();var b=false;if(!Wn.equivalent(r,g)){b=true;m.setProjection(r)}a.dirty=false;var x=new zo(0,M,l,e,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer());var w=Mo.getSquaredTolerance(l,e);var y=function(t){var i;var e=t.getStyleFunction();if(e){i=e.call(t,l)}else{e=s.getStyleFunction();if(e){i=e(t,l)}}if(i){var r=this.renderFeature(t,w,i,x);this.dirty_=this.dirty_||r;a.dirty=a.dirty||r}};var k=m.getFeatures();if(h&&h!==a.renderedRenderOrder){k.sort(h)}var E;for(var C=0,N=k.length;C<N;++C){E=k[C];if(b){if(g.getUnits()==Tn.TILE_PIXELS){g.setWorldExtent(z);g.setExtent(m.getExtent())}E.getGeometry().transform(g,r)}if(!_||Nn.intersects(_,E.getGeometry().getExtent())){y.call(this,E)}}x.finish();for(var I in x.getReplays()){}m.setReplayGroup(s,t.tileCoord.toString(),x)}a.renderedRevision=n;a.renderedRenderOrder=h};bo.prototype.drawTileImage=function(t,i,s,e,r,n,h,a,o){var f=t;this.createReplayGroup_(f,i);if(this.context){this.renderTileImage_(f,i,s);Wa.prototype.drawTileImage.apply(this,arguments)}};bo.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=i.viewState.resolution;var h=i.viewState.rotation;s=s==undefined?0:s;var a=this.getLayer();var o={};var f=this.renderedTiles;var u=a.getSource();var l=u.getTileGridForProjection(i.viewState.projection);var v,c;var d,m,p;var z,M,_;for(d=0,m=f.length;d<m;++d){z=f[d];M=z.wrappedTileCoord;_=l.getTileCoordExtent(M,this.tmpExtent);v=Nn.buffer(_,s*n,v);if(!Nn.containsCoordinate(v,t)){continue}for(var g=0,b=z.tileKeys.length;g<b;++g){var x=z.getTile(z.tileKeys[g]);if(x.getState()==yh.ERROR){continue}p=x.getReplayGroup(a,z.tileCoord.toString());c=c||p.forEachFeatureAtCoordinate(t,n,h,s,{},(function(t){var i=fn.getUid(t).toString();if(!(i in o)){o[i]=true;return e.call(r,t,a)}}),null)}}return c};bo.prototype.getReplayTransform_=function(t,i){var s=this.getLayer();var e=s.getSource();var r=e.getTileGrid();var n=t.tileCoord;var h=r.getResolution(n[0]);var a=i.viewState;var o=i.pixelRatio;var f=a.resolution/o;var u=r.getTileCoordExtent(n,this.tmpExtent);var l=a.center;var v=Nn.getTopLeft(u);var c=i.size;var d=Math.round(o*c[0]/2);var m=Math.round(o*c[1]/2);return Gn.compose(this.tmpTransform_,d,m,h/f,h/f,a.rotation,(v[0]-l[0])/h,(l[1]-v[1])/h)};bo.prototype.handleFontsChanged_=function(t){var i=this.getLayer();if(i.getVisible()&&this.renderedLayerRevision_!==undefined){i.changed()}};bo.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};bo.prototype.postCompose=function(t,i,s){var e=this.getLayer();var r=e.getDeclutter()?{}:null;var n=e.getSource();var h=e.getRenderMode();var a=bo.VECTOR_REPLAYS[h];var o=i.pixelRatio;var f=i.viewState.rotation;var u=i.size;var l,v;if(f){l=Math.round(o*u[0]/2);v=Math.round(o*u[1]/2);ka.rotateAtOffset(t,-f,l,v)}if(r){this.declutterTree_.clear()}var c=this.renderedTiles;var d=n.getTileGridForProjection(i.viewState.projection);var m=[];var p=[];for(var z=c.length-1;z>=0;--z){var M=c[z];if(M.getState()==yh.ABORT){continue}var _=M.tileCoord;var g=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(M.wrappedTileCoord)[0];var b=undefined;for(var x=0,w=M.tileKeys.length;x<w;++x){var y=M.getTile(M.tileKeys[x]);if(y.getState()==yh.ERROR){continue}var k=y.getReplayGroup(e,_.toString());if(h!=go.VECTOR&&!k.hasReplays(a)){continue}if(!b){b=this.getTransform(i,g)}var E=y.tileCoord[0];var C=k.getClipCoords(b);t.save();t.globalAlpha=s.opacity;for(var N=0,I=m.length;N<I;++N){var S=m[N];if(E<p[N]){t.beginPath();t.moveTo(C[0],C[1]);t.lineTo(C[2],C[3]);t.lineTo(C[4],C[5]);t.lineTo(C[6],C[7]);t.moveTo(S[6],S[7]);t.lineTo(S[4],S[5]);t.lineTo(S[2],S[3]);t.lineTo(S[0],S[1]);t.clip()}}k.replay(t,b,f,{},a,r);t.restore();m.push(C);p.push(E)}}if(r){zo.replayDeclutter(r,t,f)}if(f){ka.rotateAtOffset(t,f,l,v)}Wa.prototype.postCompose.apply(this,arguments)};bo.prototype.renderFeature=function(t,i,s,e){if(!s){return false}var r=false;if(Array.isArray(s)){for(var n=0,h=s.length;n<h;++n){r=Mo.renderFeature(e,t,s[n],i,this.handleStyleImageChange_,this)||r}}else{r=Mo.renderFeature(e,t,s,i,this.handleStyleImageChange_,this)}return r};bo.prototype.renderTileImage_=function(t,i,s){var e=this.getLayer();var r=t.getReplayState(e);var n=e.getRevision();var h=bo.IMAGE_REPLAYS[e.getRenderMode()];if(h&&r.renderedTileRevision!==n){r.renderedTileRevision=n;var a=t.wrappedTileCoord;var o=a[0];var f=i.pixelRatio;var u=e.getSource();var l=u.getTileGridForProjection(i.viewState.projection);var v=l.getResolution(o);var c=t.getContext(e);var d=u.getTilePixelSize(o,f,i.viewState.projection);c.canvas.width=d[0];c.canvas.height=d[1];var m=l.getTileCoordExtent(a);for(var p=0,z=t.tileKeys.length;p<z;++p){var M=t.getTile(t.tileKeys[p]);if(M.getState()==yh.ERROR){continue}var _=f/v;var g=Gn.reset(this.tmpTransform_);Gn.scale(g,_,-_);Gn.translate(g,-m[0],-m[3]);var b=M.getReplayGroup(e,t.tileCoord.toString());b.replay(c,g,0,{},h)}}};var xo=function(t){this.source_=t};xo.prototype.getType=function(){};xo.prototype.getSource=function(){return this.source_};xo.prototype.isAnimated=Sn.FALSE;var wo=function(t){xo.call(this,t)};fn.inherits(wo,xo);wo.prototype.getType=function(){return eh.FRAGMENT_SHADER};var yo=function(t){xo.call(this,t)};fn.inherits(yo,xo);yo.prototype.getType=function(){return eh.VERTEX_SHADER};var ko={};ko.fragment=new wo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}");ko.vertex=new yo(fn.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Eo=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_lineWidth":"k");this.u_pixelRatio=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_pixelRatio":"l");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"m");this.u_fillColor=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_fillColor":"n");this.u_strokeColor=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_strokeColor":"o");this.u_size=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_size":"p");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"e");this.a_instruction=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_instruction":"f");this.a_radius=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_radius":"g")};var Co={};Co.create=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]};Co.fromTransform=function(t,i){t[0]=i[0];t[1]=i[1];t[4]=i[2];t[5]=i[3];t[12]=i[4];t[13]=i[5];return t};var No=function(t,i){Na.call(this);this.tolerance=t;this.maxExtent=i;this.origin=Nn.getCenter(i);this.projectionMatrix_=Gn.create();this.offsetRotateMatrix_=Gn.create();this.offsetScaleMatrix_=Gn.create();this.tmpMat4_=Co.create();this.indices=[];this.indicesBuffer=null;this.startIndices=[];this.startIndicesFeature=[];this.vertices=[];this.verticesBuffer=null;this.lineStringReplay=undefined};fn.inherits(No,Na);No.prototype.getDeleteResourcesFunction=function(t){};No.prototype.finish=function(t){};No.prototype.setUpProgram=function(t,i,s,e){};No.prototype.shutDownProgram=function(t,i){};No.prototype.drawReplay=function(t,i,s,e){};No.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){};No.prototype.drawHitDetectionReplay=function(t,i,s,e,r,n){if(!r){return this.drawHitDetectionReplayAll(t,i,s,e)}else{return this.drawHitDetectionReplayOneByOne(t,i,s,e,n)}};No.prototype.drawHitDetectionReplayAll=function(t,i,s,e){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawReplay(t,i,s,true);var r=e(null);if(r){return r}else{return undefined}};No.prototype.replay=function(t,i,s,e,r,n,h,a,o,f,u){var l=t.getGL();var v,c,d,m,p,z,M,_;if(this.lineStringReplay){v=l.isEnabled(l.STENCIL_TEST);c=l.getParameter(l.STENCIL_FUNC);d=l.getParameter(l.STENCIL_VALUE_MASK);m=l.getParameter(l.STENCIL_REF);p=l.getParameter(l.STENCIL_WRITEMASK);z=l.getParameter(l.STENCIL_FAIL);M=l.getParameter(l.STENCIL_PASS_DEPTH_PASS);_=l.getParameter(l.STENCIL_PASS_DEPTH_FAIL);l.enable(l.STENCIL_TEST);l.clear(l.STENCIL_BUFFER_BIT);l.stencilMask(255);l.stencilFunc(l.ALWAYS,1,255);l.stencilOp(l.KEEP,l.KEEP,l.REPLACE);this.lineStringReplay.replay(t,i,s,e,r,n,h,a,o,f,u);l.stencilMask(0);l.stencilFunc(l.NOTEQUAL,1,255)}t.bindBuffer(eh.ARRAY_BUFFER,this.verticesBuffer);t.bindBuffer(eh.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var g=this.setUpProgram(l,t,r,n);var b=Gn.reset(this.projectionMatrix_);Gn.scale(b,2/(s*r[0]),2/(s*r[1]));Gn.rotate(b,-e);Gn.translate(b,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var x=Gn.reset(this.offsetScaleMatrix_);Gn.scale(x,2/r[0],2/r[1]);var w=Gn.reset(this.offsetRotateMatrix_);if(e!==0){Gn.rotate(w,-e)}l.uniformMatrix4fv(g.u_projectionMatrix,false,Co.fromTransform(this.tmpMat4_,b));l.uniformMatrix4fv(g.u_offsetScaleMatrix,false,Co.fromTransform(this.tmpMat4_,x));l.uniformMatrix4fv(g.u_offsetRotateMatrix,false,Co.fromTransform(this.tmpMat4_,w));l.uniform1f(g.u_opacity,h);var y;if(o===undefined){this.drawReplay(l,t,a,false)}else{y=this.drawHitDetectionReplay(l,t,a,o,f,u)}this.shutDownProgram(l,g);if(this.lineStringReplay){if(!v){l.disable(l.STENCIL_TEST)}l.clear(l.STENCIL_BUFFER_BIT);l.stencilFunc(c,m,d);l.stencilMask(p);l.stencilOp(z,_,M)}return y};No.prototype.drawElements=function(t,i,s,e){var r=i.hasOESElementIndexUint?eh.UNSIGNED_INT:eh.UNSIGNED_SHORT;var n=i.hasOESElementIndexUint?4:2;var h=e-s;var a=s*n;t.drawElements(eh.TRIANGLES,h,r,a)};var Io={};Io.defaultFont="10px sans-serif";Io.defaultFillStyle=[0,0,0,1];Io.defaultLineCap="round";Io.defaultLineDash=[];Io.defaultLineDashOffset=0;Io.defaultLineJoin="round";Io.defaultMiterLimit=10;Io.defaultStrokeStyle=[0,0,0,1];Io.defaultTextAlign=.5;Io.defaultTextBaseline=.5;Io.defaultLineWidth=1;Io.triangleIsCounterClockwise=function(t,i,s,e,r,n){var h=(s-t)*(n-i)-(r-t)*(e-i);return h<=Io.EPSILON&&h>=-Io.EPSILON?undefined:h>0};Io.EPSILON=Number.EPSILON||2220446049250313e-31;var So=function(t,i){this.arr_=t!==undefined?t:[];this.usage_=i!==undefined?i:So.Usage_.STATIC_DRAW};So.prototype.getArray=function(){return this.arr_};So.prototype.getUsage=function(){return this.usage_};So.Usage_={STATIC_DRAW:eh.STATIC_DRAW,STREAM_DRAW:eh.STREAM_DRAW,DYNAMIC_DRAW:eh.DYNAMIC_DRAW};var Oo=function(t,i){No.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.radius_=0;this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:undefined,lineWidth:undefined,changed:false}};fn.inherits(Oo,No);Oo.prototype.drawCoordinates_=function(t,i,s,e){var r=this.vertices.length;var n=this.indices.length;var h=r/4;var a,o;for(a=i,o=s;a<o;a+=e){this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=0;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=1;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=2;this.vertices[r++]=this.radius_;this.vertices[r++]=t[a];this.vertices[r++]=t[a+1];this.vertices[r++]=3;this.vertices[r++]=this.radius_;this.indices[n++]=h;this.indices[n++]=h+1;this.indices[n++]=h+2;this.indices[n++]=h+2;this.indices[n++]=h+3;this.indices[n++]=h;h+=4}};Oo.prototype.drawCircle=function(t,i){var s=t.getRadius();var e=t.getStride();if(s){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.radius_=s;var r=t.getFlatCoordinates();r=On.translate(r,0,2,e,-this.origin[0],-this.origin[1]);this.drawCoordinates_(r,0,2,e)}else{if(this.state_.changed){this.styles_.pop();if(this.styles_.length){var n=this.styles_[this.styles_.length-1];this.state_.fillColor=n[0];this.state_.strokeColor=n[1];this.state_.lineWidth=n[2];this.state_.changed=false}}}};Oo.prototype.finish=function(t){this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Oo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};Oo.prototype.setUpProgram=function(t,i,s,e){var r,n;r=ko.fragment;n=ko.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Eo(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,16,0);t.enableVertexAttribArray(a.a_instruction);t.vertexAttribPointer(a.a_instruction,1,eh.FLOAT,false,16,8);t.enableVertexAttribArray(a.a_radius);t.vertexAttribPointer(a.a_radius,1,eh.FLOAT,false,16,12);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};Oo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_instruction);t.disableVertexAttribArray(i.a_radius)};Oo.prototype.drawReplay=function(t,i,s,e){if(!vn.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var r,n,h,a;h=this.startIndices[this.startIndices.length-1];for(r=this.styleIndices_.length-1;r>=0;--r){n=this.styleIndices_[r];a=this.styles_[r];this.setFillStyle_(t,a[0]);this.setStrokeStyle_(t,a[1],a[2]);this.drawElements(t,i,n,h);h=n}}};Oo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o[0]);this.setStrokeStyle_(t,o[1],o[2]);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=fn.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Nn.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};Oo.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h[0]);this.setStrokeStyle_(t,h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=fn.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n)}r=n=a}};Oo.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)};Oo.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s)};Oo.prototype.setFillStrokeStyle=function(t,i){var s,e;if(i){var r=i.getLineDash();this.state_.lineDash=r?r:Io.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n?n:Io.defaultLineDashOffset;s=i.getColor();if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Ea.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Io.defaultStrokeStyle}else{s=Io.defaultStrokeStyle}e=i.getWidth();e=e!==undefined?e:Io.defaultLineWidth}else{s=[0,0,0,0];e=0}var h=t?t.getColor():[0,0,0,0];if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Ea.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Io.defaultFillStyle}else{h=Io.defaultFillStyle}if(!this.state_.strokeColor||!kn.equals(this.state_.strokeColor,s)||!this.state_.fillColor||!kn.equals(this.state_.fillColor,h)||this.state_.lineWidth!==e){this.state_.changed=true;this.state_.fillColor=h;this.state_.strokeColor=s;this.state_.lineWidth=e;this.styles_.push([h,s,e])}};var To={};To.fragment=new wo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");To.vertex=new yo(fn.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Ao=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"k");this.u_image=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_image":"l");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"c");this.a_texCoord=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_texCoord":"d");this.a_offsets=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_offsets":"e");this.a_opacity=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_opacity":"f");this.a_rotateWithView=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_rotateWithView":"g")};var Ro={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var Po=function(t,i){this.canvas_=t;this.gl_=i;this.bufferCache_={};this.shaderCache_={};this.programCache_={};this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null;this.hasOESElementIndexUint=kn.includes(fn.WEBGL_EXTENSIONS,"OES_element_index_uint");if(this.hasOESElementIndexUint){i.getExtension("OES_element_index_uint")}cn.listen(this.canvas_,Ro.LOST,this.handleWebGLContextLost,this);cn.listen(this.canvas_,Ro.RESTORED,this.handleWebGLContextRestored,this)};fn.inherits(Po,dn);Po.prototype.bindBuffer=function(t,i){var s=this.getGL();var e=i.getArray();var r=String(fn.getUid(i));if(r in this.bufferCache_){var n=this.bufferCache_[r];s.bindBuffer(t,n.buffer)}else{var h=s.createBuffer();s.bindBuffer(t,h);var a;if(t==eh.ARRAY_BUFFER){a=new Float32Array(e)}else if(t==eh.ELEMENT_ARRAY_BUFFER){a=this.hasOESElementIndexUint?new Uint32Array(e):new Uint16Array(e)}s.bufferData(t,a,i.getUsage());this.bufferCache_[r]={buf:i,buffer:h}}};Po.prototype.deleteBuffer=function(t){var i=this.getGL();var s=String(fn.getUid(t));var e=this.bufferCache_[s];if(!i.isContextLost()){i.deleteBuffer(e.buffer)}delete this.bufferCache_[s]};Po.prototype.disposeInternal=function(){cn.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_){t.deleteBuffer(this.bufferCache_[i].buffer)}for(i in this.programCache_){t.deleteProgram(this.programCache_[i])}for(i in this.shaderCache_){t.deleteShader(this.shaderCache_[i])}t.deleteFramebuffer(this.hitDetectionFramebuffer_);t.deleteRenderbuffer(this.hitDetectionRenderbuffer_);t.deleteTexture(this.hitDetectionTexture_)}};Po.prototype.getCanvas=function(){return this.canvas_};Po.prototype.getGL=function(){return this.gl_};Po.prototype.getHitDetectionFramebuffer=function(){if(!this.hitDetectionFramebuffer_){this.initHitDetectionFramebuffer_()}return this.hitDetectionFramebuffer_};Po.prototype.getShader=function(t){var i=String(fn.getUid(t));if(i in this.shaderCache_){return this.shaderCache_[i]}else{var s=this.getGL();var e=s.createShader(t.getType());s.shaderSource(e,t.getSource());s.compileShader(e);this.shaderCache_[i]=e;return e}};Po.prototype.getProgram=function(t,i){var s=fn.getUid(t)+"/"+fn.getUid(i);if(s in this.programCache_){return this.programCache_[s]}else{var e=this.getGL();var r=e.createProgram();e.attachShader(r,this.getShader(t));e.attachShader(r,this.getShader(i));e.linkProgram(r);this.programCache_[s]=r;return r}};Po.prototype.handleWebGLContextLost=function(){vn.clear(this.bufferCache_);vn.clear(this.shaderCache_);vn.clear(this.programCache_);this.currentProgram_=null;this.hitDetectionFramebuffer_=null;this.hitDetectionTexture_=null;this.hitDetectionRenderbuffer_=null};Po.prototype.handleWebGLContextRestored=function(){};Po.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_;var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=Po.createEmptyTexture(t,1,1);var e=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,e);t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e);t.bindTexture(t.TEXTURE_2D,null);t.bindRenderbuffer(t.RENDERBUFFER,null);t.bindFramebuffer(t.FRAMEBUFFER,null);this.hitDetectionFramebuffer_=i;this.hitDetectionTexture_=s;this.hitDetectionRenderbuffer_=e};Po.prototype.useProgram=function(t){if(t==this.currentProgram_){return false}else{var i=this.getGL();i.useProgram(t);this.currentProgram_=t;return true}};Po.createTexture_=function(t,i,s){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);if(i!==undefined){t.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_S,i)}if(s!==undefined){t.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_T,s)}return e};Po.createEmptyTexture=function(t,i,s,e,r){var n=Po.createTexture_(t,e,r);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null);return n};Po.createTexture=function(t,i,s,e){var r=Po.createTexture_(t,s,e);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i);return r};var Lo=function(t,i){No.call(this,t,i);this.anchorX=undefined;this.anchorY=undefined;this.groupIndices=[];this.hitDetectionGroupIndices=[];this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.defaultLocations=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.width=undefined};fn.inherits(Lo,No);Lo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.getTextures(true);var r=t.getGL();return function(){if(!r.isContextLost()){var n,h;for(n=0,h=e.length;n<h;++n){r.deleteTexture(e[n])}}t.deleteBuffer(i);t.deleteBuffer(s)}};Lo.prototype.drawCoordinates=function(t,i,s,e){var r=this.anchorX;var n=this.anchorY;var h=this.height;var a=this.imageHeight;var o=this.imageWidth;var f=this.opacity;var u=this.originX;var l=this.originY;var v=this.rotateWithView?1:0;var c=-this.rotation;var d=this.scale;var m=this.width;var p=Math.cos(c);var z=Math.sin(c);var M=this.indices.length;var _=this.vertices.length;var g,b,x,w,y,k;for(g=i;g<s;g+=e){y=t[g]-this.origin[0];k=t[g+1]-this.origin[1];b=_/8;x=-d*r;w=-d*(h-n);this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=u/o;this.vertices[_++]=(l+h)/a;this.vertices[_++]=f;this.vertices[_++]=v;x=d*(m-r);w=-d*(h-n);this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=(l+h)/a;this.vertices[_++]=f;this.vertices[_++]=v;x=d*(m-r);w=d*n;this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=(u+m)/o;this.vertices[_++]=l/a;this.vertices[_++]=f;this.vertices[_++]=v;x=-d*r;w=d*n;this.vertices[_++]=y;this.vertices[_++]=k;this.vertices[_++]=x*p-w*z;this.vertices[_++]=x*z+w*p;this.vertices[_++]=u/o;this.vertices[_++]=l/a;this.vertices[_++]=f;this.vertices[_++]=v;this.indices[M++]=b;this.indices[M++]=b+1;this.indices[M++]=b+2;this.indices[M++]=b;this.indices[M++]=b+2;this.indices[M++]=b+3}return _};Lo.prototype.createTextures=function(t,i,s,e){var r,n,h,a;var o=i.length;for(a=0;a<o;++a){n=i[a];h=fn.getUid(n).toString();if(h in s){r=s[h]}else{r=Po.createTexture(e,n,eh.CLAMP_TO_EDGE,eh.CLAMP_TO_EDGE);s[h]=r}t[a]=r}};Lo.prototype.setUpProgram=function(t,i,s,e){var r=To.fragment;var n=To.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations){a=new Ao(t,h);this.defaultLocations=a}else{a=this.defaultLocations}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,32,0);t.enableVertexAttribArray(a.a_offsets);t.vertexAttribPointer(a.a_offsets,2,eh.FLOAT,false,32,8);t.enableVertexAttribArray(a.a_texCoord);t.vertexAttribPointer(a.a_texCoord,2,eh.FLOAT,false,32,16);t.enableVertexAttribArray(a.a_opacity);t.vertexAttribPointer(a.a_opacity,1,eh.FLOAT,false,32,24);t.enableVertexAttribArray(a.a_rotateWithView);t.vertexAttribPointer(a.a_rotateWithView,1,eh.FLOAT,false,32,28);return a};Lo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_offsets);t.disableVertexAttribArray(i.a_texCoord);t.disableVertexAttribArray(i.a_opacity);t.disableVertexAttribArray(i.a_rotateWithView)};Lo.prototype.drawReplay=function(t,i,s,e){var r=e?this.getHitDetectionTextures():this.getTextures();var n=e?this.hitDetectionGroupIndices:this.groupIndices;if(!vn.isEmpty(s)){this.drawReplaySkipping(t,i,s,r,n)}else{var h,a,o;for(h=0,a=r.length,o=0;h<a;++h){t.bindTexture(eh.TEXTURE_2D,r[h]);var f=n[h];this.drawElements(t,i,o,f);o=f}}};Lo.prototype.drawReplaySkipping=function(t,i,s,e,r){var n=0;var h,a;for(h=0,a=e.length;h<a;++h){t.bindTexture(eh.TEXTURE_2D,e[h]);var o=h>0?r[h-1]:0;var f=r[h];var u=o;var l=o;while(n<this.startIndices.length&&this.startIndices[n]<=f){var v=this.startIndicesFeature[n];var c=fn.getUid(v).toString();if(s[c]!==undefined){if(u!==l){this.drawElements(t,i,u,l)}u=n===this.startIndices.length-1?f:this.startIndices[n+1];l=u}else{l=n===this.startIndices.length-1?f:this.startIndices[n+1]}n++}if(u!==l){this.drawElements(t,i,u,l)}}};Lo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u;var l=this.startIndices.length-1;var v=this.getHitDetectionTextures();for(n=v.length-1;n>=0;--n){t.bindTexture(eh.TEXTURE_2D,v[n]);h=n>0?this.hitDetectionGroupIndices[n-1]:0;o=this.hitDetectionGroupIndices[n];while(l>=0&&this.startIndices[l]>=h){a=this.startIndices[l];f=this.startIndicesFeature[l];u=fn.getUid(f).toString();if(s[u]===undefined&&f.getGeometry()&&(r===undefined||Nn.intersects(r,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,a,o);var c=e(f);if(c){return c}}o=a;l--}}return undefined};Lo.prototype.finish=function(t){this.anchorX=undefined;this.anchorY=undefined;this.height=undefined;this.imageHeight=undefined;this.imageWidth=undefined;this.indices=null;this.opacity=undefined;this.originX=undefined;this.originY=undefined;this.rotateWithView=undefined;this.rotation=undefined;this.scale=undefined;this.vertices=null;this.width=undefined};Lo.prototype.getTextures=function(t){};Lo.prototype.getHitDetectionTextures=function(){};var Do=function(t,i){Lo.call(this,t,i);this.images_=[];this.hitDetectionImages_=[];this.textures_=[];this.hitDetectionTextures_=[]};fn.inherits(Do,Lo);Do.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};Do.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var s=t.getFlatCoordinates();var e=t.getStride();this.drawCoordinates(s,0,s.length,e)};Do.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices.push(this.indices.length);this.verticesBuffer=new So(this.vertices);var s=this.indices;this.indicesBuffer=new So(s);var e={};this.createTextures(this.textures_,this.images_,e,i);this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,e,i);this.images_=null;this.hitDetectionImages_=null;Lo.prototype.finish.call(this,t)};Do.prototype.setImageStyle=function(t){var i=t.getAnchor();var s=t.getImage(1);var e=t.getImageSize();var r=t.getHitDetectionImage(1);var n=t.getOpacity();var h=t.getOrigin();var a=t.getRotateWithView();var o=t.getRotation();var f=t.getSize();var u=t.getScale();var l;if(this.images_.length===0){this.images_.push(s)}else{l=this.images_[this.images_.length-1];if(fn.getUid(l)!=fn.getUid(s)){this.groupIndices.push(this.indices.length);this.images_.push(s)}}if(this.hitDetectionImages_.length===0){this.hitDetectionImages_.push(r)}else{l=this.hitDetectionImages_[this.hitDetectionImages_.length-1];if(fn.getUid(l)!=fn.getUid(r)){this.hitDetectionGroupIndices.push(this.indices.length);this.hitDetectionImages_.push(r)}}this.anchorX=i[0];this.anchorY=i[1];this.height=f[1];this.imageHeight=e[1];this.imageWidth=e[0];this.opacity=n;this.originX=h[0];this.originY=h[1];this.rotation=o;this.rotateWithView=a;this.scale=u;this.width=f[0]};Do.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_};Do.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var Fo={};Fo.lineStringIsClosed=function(t,i,s,e){var r=s-e;if(t[i]===t[r]&&t[i+1]===t[r+1]&&(s-i)/e>3){return!!Un.linearRing(t,i,s,e)}return false};var Wo={};Wo.fragment=new wo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");Wo.vertex=new yo(fn.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var Go=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"h");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"i");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"j");this.u_lineWidth=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_lineWidth":"k");this.u_miterLimit=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_miterLimit":"l");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"m");this.u_color=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_color":"n");this.u_size=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_size":"o");this.u_pixelRatio=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_pixelRatio":"p");this.a_lastPos=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_lastPos":"d");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"e");this.a_nextPos=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_nextPos":"f");this.a_direction=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_direction":"g")};var Vo=function(t,i){No.call(this,t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:undefined,miterLimit:undefined,changed:false}};fn.inherits(Vo,No);Vo.prototype.drawCoordinates_=function(t,i,s,e){var r,n;var h=this.vertices.length;var a=this.indices.length;var o=this.state_.lineJoin==="bevel"?0:this.state_.lineJoin==="miter"?1:2;var f=this.state_.lineCap==="butt"?0:this.state_.lineCap==="square"?1:2;var u=Fo.lineStringIsClosed(t,i,s,e);var l,v,c;var d=a;var m=1;var p,z,M;for(r=i,n=s;r<n;r+=e){c=h/7;p=z;z=M||[t[r],t[r+1]];if(r===i){M=[t[r+e],t[r+e+1]];if(s-i===e*2&&kn.equals(z,M)){break}if(u){p=[t[s-e*2],t[s-e*2+1]];l=M}else{if(f){h=this.addVertices_([0,0],z,M,m*Vo.Instruction_.BEGIN_LINE_CAP*f,h);h=this.addVertices_([0,0],z,M,-m*Vo.Instruction_.BEGIN_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}h=this.addVertices_([0,0],z,M,m*Vo.Instruction_.BEGIN_LINE*(f||1),h);h=this.addVertices_([0,0],z,M,-m*Vo.Instruction_.BEGIN_LINE*(f||1),h);d=h/7-1;continue}}else if(r===s-e){if(u){M=l;break}else{p=p||[0,0];h=this.addVertices_(p,z,[0,0],m*Vo.Instruction_.END_LINE*(f||1),h);h=this.addVertices_(p,z,[0,0],-m*Vo.Instruction_.END_LINE*(f||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;if(f){h=this.addVertices_(p,z,[0,0],m*Vo.Instruction_.END_LINE_CAP*f,h);h=this.addVertices_(p,z,[0,0],-m*Vo.Instruction_.END_LINE_CAP*f,h);this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=c+1;this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c+2}break}}else{M=[t[r+e],t[r+e+1]]}v=Io.triangleIsCounterClockwise(p[0],p[1],z[0],z[1],M[0],M[1])?-1:1;h=this.addVertices_(p,z,M,v*Vo.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,z,M,v*Vo.Instruction_.BEVEL_SECOND*(o||1),h);h=this.addVertices_(p,z,M,-v*Vo.Instruction_.MITER_BOTTOM*(o||1),h);if(r>i){this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+2;this.indices[a++]=c;this.indices[a++]=m*v>0?d:d-1}this.indices[a++]=c;this.indices[a++]=c+2;this.indices[a++]=c+1;d=c+2;m=v;if(o){h=this.addVertices_(p,z,M,v*Vo.Instruction_.MITER_TOP*o,h);this.indices[a++]=c+1;this.indices[a++]=c+3;this.indices[a++]=c}}if(u){c=c||h/7;v=ih.linearRingIsClockwise([p[0],p[1],z[0],z[1],M[0],M[1]],0,6,2)?1:-1;h=this.addVertices_(p,z,M,v*Vo.Instruction_.BEVEL_FIRST*(o||1),h);h=this.addVertices_(p,z,M,-v*Vo.Instruction_.MITER_BOTTOM*(o||1),h);this.indices[a++]=c;this.indices[a++]=d-1;this.indices[a++]=d;this.indices[a++]=c+1;this.indices[a++]=c;this.indices[a++]=m*v>0?d:d-1}};Vo.prototype.addVertices_=function(t,i,s,e,r){this.vertices[r++]=t[0];this.vertices[r++]=t[1];this.vertices[r++]=i[0];this.vertices[r++]=i[1];this.vertices[r++]=s[0];this.vertices[r++]=s[1];this.vertices[r++]=e;return r};Vo.prototype.isValid_=function(t,i,s,e){var r=s-i;if(r<e*2){return false}else if(r===e*2){var n=[t[i],t[i+1]];var h=[t[i+e],t[i+e+1]];return!kn.equals(n,h)}return true};Vo.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates();var e=t.getStride();if(this.isValid_(s,0,s.length,e)){s=On.translate(s,0,s.length,e,-this.origin[0],-this.origin[1]);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);this.drawCoordinates_(s,0,s.length,e)}};Vo.prototype.drawMultiLineString=function(t,i){var s=this.indices.length;var e=t.getEnds();e.unshift(0);var r=t.getFlatCoordinates();var n=t.getStride();var h,a;if(e.length>1){for(h=1,a=e.length;h<a;++h){if(this.isValid_(r,e[h-1],e[h],n)){var o=On.translate(r,e[h-1],e[h],n,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,n)}}}if(this.indices.length>s){this.startIndices.push(s);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}}};Vo.prototype.drawPolygonCoordinates=function(t,i,s){if(!Fo.lineStringIsClosed(t,0,t.length,s)){t.push(t[0]);t.push(t[1])}this.drawCoordinates_(t,0,t.length,s);if(i.length){var e,r;for(e=0,r=i.length;e<r;++e){if(!Fo.lineStringIsClosed(i[e],0,i[e].length,s)){i[e].push(i[e][0]);i[e].push(i[e][1])}this.drawCoordinates_(i[e],0,i[e].length,s)}}};Vo.prototype.setPolygonStyle=function(t,i){var s=i===undefined?this.indices.length:i;this.startIndices.push(s);this.startIndicesFeature.push(t);if(this.state_.changed){this.styleIndices_.push(s);this.state_.changed=false}};Vo.prototype.getCurrentIndex=function(){return this.indices.length};Vo.prototype.finish=function(t){this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);this.startIndices.push(this.indices.length);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Vo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;return function(){t.deleteBuffer(i);t.deleteBuffer(s)}};Vo.prototype.setUpProgram=function(t,i,s,e){var r,n;r=Wo.fragment;n=Wo.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Go(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_lastPos);t.vertexAttribPointer(a.a_lastPos,2,eh.FLOAT,false,28,0);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,28,8);t.enableVertexAttribArray(a.a_nextPos);t.vertexAttribPointer(a.a_nextPos,2,eh.FLOAT,false,28,16);t.enableVertexAttribArray(a.a_direction);t.vertexAttribPointer(a.a_direction,1,eh.FLOAT,false,28,24);t.uniform2fv(a.u_size,s);t.uniform1f(a.u_pixelRatio,e);return a};Vo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos);t.disableVertexAttribArray(i.a_position);t.disableVertexAttribArray(i.a_nextPos);t.disableVertexAttribArray(i.a_direction)};Vo.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!vn.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setStrokeStyle_(t,f[0],f[1],f[2]);this.drawElements(t,i,a,o);t.clear(t.DEPTH_BUFFER_BIT);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};Vo.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setStrokeStyle_(t,h[0],h[1],h[2]);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=fn.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};Vo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setStrokeStyle_(t,o[0],o[1],o[2]);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=fn.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Nn.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};Vo.prototype.setStrokeStyle_=function(t,i,s,e){t.uniform4fv(this.defaultLocations_.u_color,i);t.uniform1f(this.defaultLocations_.u_lineWidth,s);t.uniform1f(this.defaultLocations_.u_miterLimit,e)};Vo.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=s!==undefined?s:Io.defaultLineCap;var e=i.getLineDash();this.state_.lineDash=e?e:Io.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r?r:Io.defaultLineDashOffset;var n=i.getLineJoin();this.state_.lineJoin=n!==undefined?n:Io.defaultLineJoin;var h=i.getColor();if(!(h instanceof CanvasGradient)&&!(h instanceof CanvasPattern)){h=Ea.asArray(h).map((function(t,i){return i!=3?t/255:t}))||Io.defaultStrokeStyle}else{h=Io.defaultStrokeStyle}var a=i.getWidth();a=a!==undefined?a:Io.defaultLineWidth;var o=i.getMiterLimit();o=o!==undefined?o:Io.defaultMiterLimit;if(!this.state_.strokeColor||!kn.equals(this.state_.strokeColor,h)||this.state_.lineWidth!==a||this.state_.miterLimit!==o){this.state_.changed=true;this.state_.strokeColor=h;this.state_.lineWidth=a;this.state_.miterLimit=o;this.styles_.push([h,a,o])}};Vo.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var jo={};jo.fragment=new wo(fn.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}");jo.vertex=new yo(fn.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var Uo=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"b");this.u_offsetScaleMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetScaleMatrix":"c");this.u_offsetRotateMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_offsetRotateMatrix":"d");this.u_color=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_color":"e");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"f");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"a")};var Xo=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.lineCap_=i.lineCap;this.lineDash_=i.lineDash!==undefined?i.lineDash:null;this.lineDashOffset_=i.lineDashOffset;this.lineJoin_=i.lineJoin;this.miterLimit_=i.miterLimit;this.width_=i.width;this.checksum_=undefined};Xo.prototype.clone=function(){var t=this.getColor();return new Xo({color:t&&t.slice?t.slice():t||undefined,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():undefined,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})};Xo.prototype.getColor=function(){return this.color_};Xo.prototype.getLineCap=function(){return this.lineCap_};Xo.prototype.getLineDash=function(){return this.lineDash_};Xo.prototype.getLineDashOffset=function(){return this.lineDashOffset_};Xo.prototype.getLineJoin=function(){return this.lineJoin_};Xo.prototype.getMiterLimit=function(){return this.miterLimit_};Xo.prototype.getWidth=function(){return this.width_};Xo.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};Xo.prototype.setLineCap=function(t){this.lineCap_=t;this.checksum_=undefined};Xo.prototype.setLineDash=function(t){this.lineDash_=t;this.checksum_=undefined};Xo.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t;this.checksum_=undefined};Xo.prototype.setLineJoin=function(t){this.lineJoin_=t;this.checksum_=undefined};Xo.prototype.setMiterLimit=function(t){this.miterLimit_=t;this.checksum_=undefined};Xo.prototype.setWidth=function(t){this.width_=t;this.checksum_=undefined};Xo.prototype.getChecksum=function(){if(this.checksum_===undefined){this.checksum_="s";if(this.color_){if(typeof this.color_==="string"){this.checksum_+=this.color_}else{this.checksum_+=fn.getUid(this.color_).toString()}}else{this.checksum_+="-"}this.checksum_+=","+(this.lineCap_!==undefined?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(this.lineDashOffset_!==undefined?this.lineDashOffset_:"-")+","+(this.lineJoin_!==undefined?this.lineJoin_:"-")+","+(this.miterLimit_!==undefined?this.miterLimit_.toString():"-")+","+(this.width_!==undefined?this.width_.toString():"-")}return this.checksum_};var qo=function(t){this.first_=undefined;this.last_=undefined;this.head_=undefined;this.circular_=t===undefined?true:t;this.length_=0};qo.prototype.insertItem=function(t){var i={prev:undefined,next:undefined,data:t};var s=this.head_;if(!s){this.first_=i;this.last_=i;if(this.circular_){i.next=i;i.prev=i}}else{var e=s.next;i.prev=s;i.next=e;s.next=i;if(e){e.prev=i}if(s===this.last_){this.last_=i}}this.head_=i;this.length_++};qo.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next;var s=t.prev;if(i){i.prev=s}if(s){s.next=i}this.head_=i||s;if(this.first_===this.last_){this.head_=undefined;this.first_=undefined;this.last_=undefined}else if(this.first_===t){this.first_=this.head_}else if(this.last_===t){this.last_=s?this.head_.prev:this.head_}this.length_--}};qo.prototype.firstItem=function(){this.head_=this.first_;if(this.head_){return this.head_.data}return undefined};qo.prototype.lastItem=function(){this.head_=this.last_;if(this.head_){return this.head_.data}return undefined};qo.prototype.nextItem=function(){if(this.head_&&this.head_.next){this.head_=this.head_.next;return this.head_.data}return undefined};qo.prototype.getNextItem=function(){if(this.head_&&this.head_.next){return this.head_.next.data}return undefined};qo.prototype.prevItem=function(){if(this.head_&&this.head_.prev){this.head_=this.head_.prev;return this.head_.data}return undefined};qo.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev){return this.head_.prev.data}return undefined};qo.prototype.getCurrItem=function(){if(this.head_){return this.head_.data}return undefined};qo.prototype.setFirstItem=function(){if(this.circular_&&this.head_){this.first_=this.head_;this.last_=this.head_.prev}};qo.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_;t.first_.prev=this.head_;i.prev=t.last_;t.last_.next=i;this.length_+=t.length_}else{this.head_=t.head_;this.first_=t.first_;this.last_=t.last_;this.length_=t.length_}t.head_=undefined;t.first_=undefined;t.last_=undefined;t.length_=0}};qo.prototype.getLength=function(){return this.length_};var Yo=function(t){this.rbush_=Va(t);this.items_={}};Yo.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s);this.items_[fn.getUid(i)]=s};Yo.prototype.load=function(t,i){var s=new Array(i.length);for(var e=0,r=i.length;e<r;e++){var n=t[e];var h=i[e];var a={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:h};s[e]=a;this.items_[fn.getUid(h)]=a}this.rbush_.load(s)};Yo.prototype.remove=function(t){var i=fn.getUid(t);var s=this.items_[i];delete this.items_[i];return this.rbush_.remove(s)!==null};Yo.prototype.update=function(t,i){var s=this.items_[fn.getUid(i)];var e=[s.minX,s.minY,s.maxX,s.maxY];if(!Nn.equals(e,t)){this.remove(i);this.insert(t,i)}};Yo.prototype.getAll=function(){var t=this.rbush_.all();return t.map((function(t){return t.value}))};Yo.prototype.getInExtent=function(t){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};var s=this.rbush_.search(i);return s.map((function(t){return t.value}))};Yo.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)};Yo.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)};Yo.prototype.forEach_=function(t,i,s){var e;for(var r=0,n=t.length;r<n;r++){e=i.call(s,t[r]);if(e){return e}}return e};Yo.prototype.isEmpty=function(){return vn.isEmpty(this.items_)};Yo.prototype.clear=function(){this.rbush_.clear();this.items_={}};Yo.prototype.getExtent=function(t){var i=this.rbush_.data;return Nn.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)};Yo.prototype.concat=function(t){this.rbush_.load(t.rbush_.all());for(var i in t.items_){this.items_[i|0]=t.items_[i|0]}};var Bo=function(t,i){No.call(this,t,i);this.lineStringReplay=new Vo(t,i);this.defaultLocations_=null;this.styles_=[];this.styleIndices_=[];this.state_={fillColor:null,changed:false}};fn.inherits(Bo,No);Bo.prototype.drawCoordinates_=function(t,i,s){var e=new qo;var r=new Yo;this.processFlatCoordinates_(t,s,e,r,true);var n=this.getMaxCoords_(e);if(i.length){var h,a;var o=[];for(h=0,a=i.length;h<a;++h){var f={list:new qo,maxCoords:undefined,rtree:new Yo};o.push(f);this.processFlatCoordinates_(i[h],s,f.list,f.rtree,false);this.classifyPoints_(f.list,f.rtree,true);f.maxCoords=this.getMaxCoords_(f.list)}o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]}));for(h=0;h<o.length;++h){var u=o[h].list;var l=u.firstItem();var v=l;var c;do{if(this.getIntersections_(v,r).length){c=true;break}v=u.nextItem()}while(l!==v);if(!c){if(this.bridgeHole_(u,o[h].maxCoords[0],e,n[0],r)){r.concat(o[h].rtree);this.classifyPoints_(e,r,false)}}}}else{this.classifyPoints_(e,r,false)}this.triangulate_(e,r)};Bo.prototype.processFlatCoordinates_=function(t,i,s,e,r){var n=ih.linearRingIsClockwise(t,0,t.length,i);var h,a;var o=this.vertices.length/2;var f;var u;var l;var v=[];var c=[];if(r===n){f=this.createPoint_(t[0],t[1],o++);u=f;for(h=i,a=t.length;h<a;h+=i){l=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,l,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)]);u=l}c.push(this.insertItem_(l,f,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)])}else{var d=t.length-i;f=this.createPoint_(t[d],t[d+1],o++);u=f;for(h=d-i,a=0;h>=a;h-=i){l=this.createPoint_(t[h],t[h+1],o++);c.push(this.insertItem_(u,l,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)]);u=l}c.push(this.insertItem_(l,f,s));v.push([Math.min(u.x,l.x),Math.min(u.y,l.y),Math.max(u.x,l.x),Math.max(u.y,l.y)])}e.load(v,c)};Bo.prototype.getMaxCoords_=function(t){var i=t.firstItem();var s=i;var e=[s.p0.x,s.p0.y];do{s=t.nextItem();if(s.p0.x>e[0]){e=[s.p0.x,s.p0.y]}}while(s!==i);return e};Bo.prototype.classifyPoints_=function(t,i,s){var e=t.firstItem();var r=e;var n=t.nextItem();var h=false;do{var a=s?Io.triangleIsCounterClockwise(n.p1.x,n.p1.y,r.p1.x,r.p1.y,r.p0.x,r.p0.y):Io.triangleIsCounterClockwise(r.p0.x,r.p0.y,r.p1.x,r.p1.y,n.p1.x,n.p1.y);if(a===undefined){this.removeItem_(r,n,t,i);h=true;if(n===e){e=t.getNextItem()}n=r;t.prevItem()}else if(r.p1.reflex!==a){r.p1.reflex=a;h=true}r=n;n=t.nextItem()}while(r!==e);return h};Bo.prototype.bridgeHole_=function(t,i,s,e,r){var n=t.firstItem();while(n.p1.x!==i){n=t.nextItem()}var h=n.p1;var a={x:e,y:h.y,i:-1};var o=Infinity;var f,u,l;var v;var c=this.getIntersections_({p0:h,p1:a},r,true);for(f=0,u=c.length;f<u;++f){var d=c[f];var m=this.calculateIntersection_(h,a,d.p0,d.p1,true);var p=Math.abs(h.x-m[0]);if(p<o&&Io.triangleIsCounterClockwise(h.x,h.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)!==undefined){o=p;v={x:m[0],y:m[1],i:-1};n=d}}if(o===Infinity){return false}l=n.p1;if(o>0){var z=this.getPointsInTriangle_(h,v,n.p1,r);if(z.length){var M=Infinity;for(f=0,u=z.length;f<u;++f){var _=z[f];var g=Math.atan2(h.y-_.y,a.x-_.x);if(g<M||g===M&&_.x<l.x){M=g;l=_}}}}n=s.firstItem();while(n.p1.x!==l.x||n.p1.y!==l.y){n=s.nextItem()}var b={x:h.x,y:h.y,i:h.i,reflex:undefined};var x={x:n.p1.x,y:n.p1.y,i:n.p1.i,reflex:undefined};t.getNextItem().p0=b;this.insertItem_(h,n.p1,t,r);this.insertItem_(x,b,t,r);n.p1=x;t.setFirstItem();s.concat(t);return true};Bo.prototype.triangulate_=function(t,i){var s=false;var e=this.isSimple_(t,i);while(t.getLength()>3){if(e){if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i,true)){break}}}}else{if(!this.clipEars_(t,i,e,s)){if(!this.classifyPoints_(t,i,s)){if(!this.resolveSelfIntersections_(t,i)){e=this.isSimple_(t,i);if(!e){this.splitPolygon_(t,i);break}else{s=!this.isClockwise_(t);this.classifyPoints_(t,i,s)}}}}}}if(t.getLength()===3){var r=this.indices.length;this.indices[r++]=t.getPrevItem().p0.i;this.indices[r++]=t.getCurrItem().p0.i;this.indices[r++]=t.getNextItem().p0.i}};Bo.prototype.clipEars_=function(t,i,s,e){var r=this.indices.length;var n=t.firstItem();var h=t.getPrevItem();var a=n;var o=t.nextItem();var f=t.getNextItem();var u,l,v;var c=false;do{u=a.p0;l=a.p1;v=o.p1;if(l.reflex===false){var d;if(s){d=this.getPointsInTriangle_(u,l,v,i,true).length===0}else{d=e?this.diagonalIsInside_(f.p1,v,l,u,h.p0):this.diagonalIsInside_(h.p0,u,l,v,f.p1)}if((s||this.getIntersections_({p0:u,p1:v},i).length===0)&&d){if(s||u.reflex===false||v.reflex===false||ih.linearRingIsClockwise([h.p0.x,h.p0.y,u.x,u.y,l.x,l.y,v.x,v.y,f.p1.x,f.p1.y],0,10,2)===!e){this.indices[r++]=u.i;this.indices[r++]=l.i;this.indices[r++]=v.i;this.removeItem_(a,o,t,i);if(o===n){n=f}c=true}}}h=t.getPrevItem();a=t.getCurrItem();o=t.nextItem();f=t.getNextItem()}while(a!==n&&t.getLength()>3);return c};Bo.prototype.resolveSelfIntersections_=function(t,i,s){var e=t.firstItem();t.nextItem();var r=e;var n=t.nextItem();var h=false;do{var a=this.calculateIntersection_(r.p0,r.p1,n.p0,n.p1,s);if(a){var o=false;var f=this.vertices.length;var u=this.indices.length;var l=f/2;var v=t.prevItem();t.removeItem();i.remove(v);o=v===e;var c;if(s){if(a[0]===r.p0.x&&a[1]===r.p0.y){t.prevItem();c=r.p0;n.p0=c;i.remove(r);o=o||r===e}else{c=n.p1;r.p1=c;i.remove(n);o=o||n===e}t.removeItem()}else{c=this.createPoint_(a[0],a[1],l);r.p1=c;n.p0=c;i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r);i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n)}this.indices[u++]=v.p0.i;this.indices[u++]=v.p1.i;this.indices[u++]=c.i;h=true;if(o){break}}r=t.getPrevItem();n=t.nextItem()}while(r!==e);return h};Bo.prototype.isSimple_=function(t,i){var s=t.firstItem();var e=s;do{if(this.getIntersections_(e,i).length){return false}e=t.nextItem()}while(e!==s);return true};Bo.prototype.isClockwise_=function(t){var i=t.getLength()*2;var s=new Array(i);var e=t.firstItem();var r=e;var n=0;do{s[n++]=r.p0.x;s[n++]=r.p0.y;r=t.nextItem()}while(r!==e);return ih.linearRingIsClockwise(s,0,i,2)};Bo.prototype.splitPolygon_=function(t,i){var s=t.firstItem();var e=s;do{var r=this.getIntersections_(e,i);if(r.length){var n=r[0];var h=this.vertices.length/2;var a=this.calculateIntersection_(e.p0,e.p1,n.p0,n.p1);var o=this.createPoint_(a[0],a[1],h);var f=new qo;var u=new Yo;this.insertItem_(o,e.p1,f,u);e.p1=o;i.update([Math.min(e.p0.x,o.x),Math.min(e.p0.y,o.y),Math.max(e.p0.x,o.x),Math.max(e.p0.y,o.y)],e);var l=t.nextItem();while(l!==n){this.insertItem_(l.p0,l.p1,f,u);i.remove(l);t.removeItem();l=t.getCurrItem()}this.insertItem_(n.p0,o,f,u);n.p0=o;i.update([Math.min(n.p1.x,o.x),Math.min(n.p1.y,o.y),Math.max(n.p1.x,o.x),Math.max(n.p1.y,o.y)],n);this.classifyPoints_(t,i,false);this.triangulate_(t,i);this.classifyPoints_(f,u,false);this.triangulate_(f,u);break}e=t.nextItem()}while(e!==s)};Bo.prototype.createPoint_=function(t,i,s){var e=this.vertices.length;this.vertices[e++]=t;this.vertices[e++]=i;var r={x:t,y:i,i:s,reflex:undefined};return r};Bo.prototype.insertItem_=function(t,i,s,e){var r={p0:t,p1:i};s.insertItem(r);if(e){e.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],r)}return r};Bo.prototype.removeItem_=function(t,i,s,e){if(s.getCurrItem()===i){s.removeItem();t.p1=i.p1;e.remove(i);e.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t)}};Bo.prototype.getPointsInTriangle_=function(t,i,s,e,r){var n,h,a,o;var f=[];var u=e.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(n=0,h=u.length;n<h;++n){for(a in u[n]){o=u[n][a];if(typeof o==="object"&&(!r||o.reflex)){if((o.x!==t.x||o.y!==t.y)&&(o.x!==i.x||o.y!==i.y)&&(o.x!==s.x||o.y!==s.y)&&f.indexOf(o)===-1&&Zn.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)){f.push(o)}}}}return f};Bo.prototype.getIntersections_=function(t,i,s){var e=t.p0;var r=t.p1;var n=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]);var h=[];var a,o;for(a=0,o=n.length;a<o;++a){var f=n[a];if(t!==f&&(s||f.p0!==r||f.p1!==e)&&this.calculateIntersection_(e,r,f.p0,f.p1,s)){h.push(f)}}return h};Bo.prototype.calculateIntersection_=function(t,i,s,e,r){var n=(e.y-s.y)*(i.x-t.x)-(e.x-s.x)*(i.y-t.y);if(n!==0){var h=((e.x-s.x)*(t.y-s.y)-(e.y-s.y)*(t.x-s.x))/n;var a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/n;if(!r&&h>Io.EPSILON&&h<1-Io.EPSILON&&a>Io.EPSILON&&a<1-Io.EPSILON||r&&h>=0&&h<=1&&a>=0&&a<=1){return[t.x+h*(i.x-t.x),t.y+h*(i.y-t.y)]}}return undefined};Bo.prototype.diagonalIsInside_=function(t,i,s,e,r){if(i.reflex===undefined||e.reflex===undefined){return false}var n=(s.x-e.x)*(i.y-e.y)>(s.y-e.y)*(i.x-e.x);var h=(r.x-e.x)*(i.y-e.y)<(r.y-e.y)*(i.x-e.x);var a=(t.x-i.x)*(e.y-i.y)>(t.y-i.y)*(e.x-i.x);var o=(s.x-i.x)*(e.y-i.y)<(s.y-i.y)*(e.x-i.x);var f=e.reflex?h||n:h&&n;var u=i.reflex?o||a:o&&a;return f&&u};Bo.prototype.drawMultiPolygon=function(t,i){var s=t.getEndss();var e=t.getStride();var r=this.indices.length;var n=this.lineStringReplay.getCurrentIndex();var h=t.getFlatCoordinates();var a,o,f,u;var l=0;for(a=0,o=s.length;a<o;++a){var v=s[a];if(v.length>0){var c=On.translate(h,l,v[0],e,-this.origin[0],-this.origin[1]);if(c.length){var d=[];var m;for(f=1,u=v.length;f<u;++f){if(v[f]!==v[f-1]){m=On.translate(h,v[f-1],v[f],e,-this.origin[0],-this.origin[1]);d.push(m)}}this.lineStringReplay.drawPolygonCoordinates(c,d,e);this.drawCoordinates_(c,d,e)}}l=v[v.length-1]}if(this.indices.length>r){this.startIndices.push(r);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(r);this.state_.changed=false}}if(this.lineStringReplay.getCurrentIndex()>n){this.lineStringReplay.setPolygonStyle(i,n)}};Bo.prototype.drawPolygon=function(t,i){var s=t.getEnds();var e=t.getStride();if(s.length>0){var r=t.getFlatCoordinates().map(Number);var n=On.translate(r,0,s[0],e,-this.origin[0],-this.origin[1]);if(n.length){var h=[];var a,o,f;for(a=1,o=s.length;a<o;++a){if(s[a]!==s[a-1]){f=On.translate(r,s[a-1],s[a],e,-this.origin[0],-this.origin[1]);h.push(f)}}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);if(this.state_.changed){this.styleIndices_.push(this.indices.length);this.state_.changed=false}this.lineStringReplay.setPolygonStyle(i);this.lineStringReplay.drawPolygonCoordinates(n,h,e);this.drawCoordinates_(n,h,e)}}};Bo.prototype.finish=function(t){this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);this.startIndices.push(this.indices.length);this.lineStringReplay.finish(t);if(this.styleIndices_.length===0&&this.styles_.length>0){this.styles_=[]}this.vertices=null;this.indices=null};Bo.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer;var s=this.indicesBuffer;var e=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i);t.deleteBuffer(s);e()}};Bo.prototype.setUpProgram=function(t,i,s,e){var r,n;r=jo.fragment;n=jo.vertex;var h=i.getProgram(r,n);var a;if(!this.defaultLocations_){a=new Uo(t,h);this.defaultLocations_=a}else{a=this.defaultLocations_}i.useProgram(h);t.enableVertexAttribArray(a.a_position);t.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,8,0);return a};Bo.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)};Bo.prototype.drawReplay=function(t,i,s,e){var r=t.getParameter(t.DEPTH_FUNC);var n=t.getParameter(t.DEPTH_WRITEMASK);if(!e){t.enable(t.DEPTH_TEST);t.depthMask(true);t.depthFunc(t.NOTEQUAL)}if(!vn.isEmpty(s)){this.drawReplaySkipping_(t,i,s)}else{var h,a,o,f;o=this.startIndices[this.startIndices.length-1];for(h=this.styleIndices_.length-1;h>=0;--h){a=this.styleIndices_[h];f=this.styles_[h];this.setFillStyle_(t,f);this.drawElements(t,i,a,o);o=a}}if(!e){t.disable(t.DEPTH_TEST);t.clear(t.DEPTH_BUFFER_BIT);t.depthMask(n);t.depthFunc(r)}};Bo.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,e,r){var n,h,a,o,f,u,l,v;v=this.startIndices.length-2;a=this.startIndices[v+1];for(n=this.styleIndices_.length-1;n>=0;--n){o=this.styles_[n];this.setFillStyle_(t,o);f=this.styleIndices_[n];while(v>=0&&this.startIndices[v]>=f){h=this.startIndices[v];u=this.startIndicesFeature[v];l=fn.getUid(u).toString();if(s[l]===undefined&&u.getGeometry()&&(r===undefined||Nn.intersects(r,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);this.drawElements(t,i,h,a);var c=e(u);if(c){return c}}v--;a=h}}return undefined};Bo.prototype.drawReplaySkipping_=function(t,i,s){var e,r,n,h,a,o,f,u,l;u=this.startIndices.length-2;n=r=this.startIndices[u+1];for(e=this.styleIndices_.length-1;e>=0;--e){h=this.styles_[e];this.setFillStyle_(t,h);a=this.styleIndices_[e];while(u>=0&&this.startIndices[u]>=a){l=this.startIndices[u];o=this.startIndicesFeature[u];f=fn.getUid(o).toString();if(s[f]){if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}n=l}u--;r=l}if(r!==n){this.drawElements(t,i,r,n);t.clear(t.DEPTH_BUFFER_BIT)}r=n=a}};Bo.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)};Bo.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(!(s instanceof CanvasGradient)&&!(s instanceof CanvasPattern)){s=Ea.asArray(s).map((function(t,i){return i!=3?t/255:t}))||Io.defaultFillStyle}else{s=Io.defaultFillStyle}if(!this.state_.fillColor||!kn.equals(s,this.state_.fillColor)){this.state_.fillColor=s;this.state_.changed=true;this.styles_.push(s)}if(i){this.lineStringReplay.setFillStrokeStyle(null,i)}else{var e=new Xo({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,e)}};var Ho=function(t,i){this.space_=i;this.emptyBlocks_=[{x:0,y:0,width:t,height:t}];this.entries_={};this.context_=Lh.createCanvasContext2D(t,t);this.canvas_=this.context_.canvas};Ho.prototype.get=function(t){return this.entries_[t]||null};Ho.prototype.add=function(t,i,s,e,r){var n,h,a;for(h=0,a=this.emptyBlocks_.length;h<a;++h){n=this.emptyBlocks_[h];if(n.width>=i+this.space_&&n.height>=s+this.space_){var o={offsetX:n.x+this.space_,offsetY:n.y+this.space_,image:this.canvas_};this.entries_[t]=o;e.call(r,this.context_,n.x+this.space_,n.y+this.space_);this.split_(h,n,i+this.space_,s+this.space_);return o}}return null};Ho.prototype.split_=function(t,i,s,e){var r=i.width-s;var n=i.height-e;var h;var a;if(r>n){h={x:i.x+s,y:i.y,width:i.width-s,height:i.height};a={x:i.x,y:i.y+e,width:s,height:i.height-e};this.updateBlocks_(t,h,a)}else{h={x:i.x+s,y:i.y,width:i.width-s,height:e};a={x:i.x,y:i.y+e,width:i.width,height:i.height-e};this.updateBlocks_(t,h,a)}};Ho.prototype.updateBlocks_=function(t,i,s){var e=[t,1];if(i.width>0&&i.height>0){e.push(i)}if(s.width>0&&s.height>0){e.push(s)}this.emptyBlocks_.splice.apply(this.emptyBlocks_,e)};var Jo=function(t){var i=t||{};this.currentSize_=i.initialSize!==undefined?i.initialSize:fn.INITIAL_ATLAS_SIZE;this.maxSize_=i.maxSize!==undefined?i.maxSize:fn.MAX_ATLAS_SIZE!=-1?fn.MAX_ATLAS_SIZE:fn.WEBGL_MAX_TEXTURE_SIZE!==undefined?fn.WEBGL_MAX_TEXTURE_SIZE:2048;this.space_=i.space!==undefined?i.space:1;this.atlases_=[new Ho(this.currentSize_,this.space_)];this.currentHitSize_=this.currentSize_;this.hitAtlases_=[new Ho(this.currentHitSize_,this.space_)]};Jo.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i){return null}var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)};Jo.prototype.getInfo_=function(t,i){var s,e,r,n;for(r=0,n=t.length;r<n;++r){s=t[r];e=s.get(i);if(e){return e}}return null};Jo.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}};Jo.prototype.add=function(t,i,s,e,r,n){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_){return null}var h=this.add_(false,t,i,s,e,n);if(!h){return null}var a=r!==undefined?r:fn.nullFunction;var o=this.add_(true,t,i,s,a,n);return this.mergeInfos_(h,o)};Jo.prototype.add_=function(t,i,s,e,r,n){var h=t?this.hitAtlases_:this.atlases_;var a,o,f,u;for(f=0,u=h.length;f<u;++f){a=h[f];o=a.add(i,s,e,r,n);if(o){return o}else if(!o&&f===u-1){var l;if(t){l=Math.min(this.currentHitSize_*2,this.maxSize_);this.currentHitSize_=l}else{l=Math.min(this.currentSize_*2,this.maxSize_);this.currentSize_=l}a=new Ho(l,this.space_);h.push(a);++u}}return null};var Zo=function(t,i){Lo.call(this,t,i);this.images_=[];this.textures_=[];this.measureCanvas_=Lh.createCanvasContext2D(0,0).canvas;this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.atlases_={};this.currAtlas_=undefined;this.scale=1;this.opacity=1};fn.inherits(Zo,Lo);Zo.prototype.drawText=function(t,i){if(this.text_){var s=null;var e=0;var r=2;var n=2;switch(t.getType()){case wn.POINT:case wn.MULTI_POINT:s=t.getFlatCoordinates();r=s.length;n=t.getStride();break;case wn.CIRCLE:s=t.getCenter();break;case wn.LINE_STRING:s=t.getFlatMidpoint();break;case wn.MULTI_LINE_STRING:s=t.getFlatMidpoints();r=s.length;break;case wn.POLYGON:s=t.getFlatInteriorPoint();break;case wn.MULTI_POLYGON:s=t.getFlatInteriorPoints();r=s.length;break}this.startIndices.push(this.indices.length);this.startIndicesFeature.push(i);var h=this.currAtlas_;var a=this.text_.split("\n");var o=this.getTextSize_(a);var f,u,l,v,c,d,m,p;var z=Math.round(o[0]*this.textAlign_-this.offsetX_);var M=Math.round(o[1]*this.textBaseline_-this.offsetY_);var _=this.state_.lineWidth/2*this.state_.scale;for(f=0,u=a.length;f<u;++f){c=0;d=h.height*f;m=a[f].split("");for(l=0,v=m.length;l<v;++l){p=h.atlas.getInfo(m[l]);if(p){var g=p.image;this.anchorX=z-c;this.anchorY=M-d;this.originX=l===0?p.offsetX-_:p.offsetX;this.originY=p.offsetY;this.height=h.height;this.width=l===0||l===m.length-1?h.width[m[l]]+_:h.width[m[l]];this.imageHeight=g.height;this.imageWidth=g.width;var b;if(this.images_.length===0){this.images_.push(g)}else{b=this.images_[this.images_.length-1];if(fn.getUid(b)!=fn.getUid(g)){this.groupIndices.push(this.indices.length);this.images_.push(g)}}this.drawText_(s,e,r,n)}c+=this.width}}}};Zo.prototype.getTextSize_=function(t){var i=this;var s=this.currAtlas_;var e=t.length*s.height;var r=t.map((function(t){var e=0;var r,n;for(r=0,n=t.length;r<n;++r){var h=t[r];if(!s.width[h]){i.addCharToAtlas_(h)}e+=s.width[h]?s.width[h]:0}return e})).reduce((function(t,i){return Math.max(t,i)}));return[r,e]};Zo.prototype.drawText_=function(t,i,s,e){var r,n;for(r=i,n=s;r<n;r+=e){this.drawCoordinates(t,i,s,e)}};Zo.prototype.addCharToAtlas_=function(t){if(t.length===1){var i=this.currAtlas_;var s=this.state_;var e=this.measureCanvas_.getContext("2d");e.font=s.font;var r=Math.ceil(e.measureText(t).width*s.scale);var n=i.atlas.add(t,r,i.height,(function(i,e,r){i.font=s.font;i.fillStyle=s.fillColor;i.strokeStyle=s.strokeColor;i.lineWidth=s.lineWidth;i.lineCap=s.lineCap;i.lineJoin=s.lineJoin;i.miterLimit=s.miterLimit;i.textAlign="left";i.textBaseline="top";if(rh.CANVAS_LINE_DASH&&s.lineDash){i.setLineDash(s.lineDash);i.lineDashOffset=s.lineDashOffset}if(s.scale!==1){i.setTransform(s.scale,0,0,s.scale,0,0)}if(s.strokeColor){i.strokeText(t,e,r)}if(s.fillColor){i.fillText(t,e,r)}}));if(n){i.width[t]=r}}};Zo.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length);this.hitDetectionGroupIndices=this.groupIndices;this.verticesBuffer=new So(this.vertices);this.indicesBuffer=new So(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i);this.state_={strokeColor:null,lineCap:undefined,lineDash:null,lineDashOffset:undefined,lineJoin:undefined,lineWidth:0,miterLimit:undefined,fillColor:null,font:undefined,scale:undefined};this.text_="";this.textAlign_=undefined;this.textBaseline_=undefined;this.offsetX_=undefined;this.offsetY_=undefined;this.images_=null;this.atlases_={};this.currAtlas_=undefined;Lo.prototype.finish.call(this,t)};Zo.prototype.setTextStyle=function(t){var i=this.state_;var s=t.getFill();var e=t.getStroke();if(!t||!t.getText()||!s&&!e){this.text_=""}else{if(!s){i.fillColor=null}else{var r=s.getColor();i.fillColor=Ca.asColorLike(r?r:Io.defaultFillStyle)}if(!e){i.strokeColor=null;i.lineWidth=0}else{var n=e.getColor();i.strokeColor=Ca.asColorLike(n?n:Io.defaultStrokeStyle);i.lineWidth=e.getWidth()||Io.defaultLineWidth;i.lineCap=e.getLineCap()||Io.defaultLineCap;i.lineDashOffset=e.getLineDashOffset()||Io.defaultLineDashOffset;i.lineJoin=e.getLineJoin()||Io.defaultLineJoin;i.miterLimit=e.getMiterLimit()||Io.defaultMiterLimit;var h=e.getLineDash();i.lineDash=h?h.slice():Io.defaultLineDash}i.font=t.getFont()||Io.defaultFont;i.scale=t.getScale()||1;this.text_=t.getText();var a=oo.TEXT_ALIGN[t.getTextAlign()];var o=oo.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=a===undefined?Io.defaultTextAlign:a;this.textBaseline_=o===undefined?Io.defaultTextBaseline:o;this.offsetX_=t.getOffsetX()||0;this.offsetY_=t.getOffsetY()||0;this.rotateWithView=!!t.getRotateWithView();this.rotation=t.getRotation()||0;this.currAtlas_=this.getAtlas_(i)}};Zo.prototype.getAtlas_=function(t){var i=[];var s;for(s in t){if(t[s]||t[s]===0){if(Array.isArray(t[s])){i=i.concat(t[s])}else{i.push(t[s])}}}var e=this.calculateHash_(i);if(!this.atlases_[e]){var r=this.measureCanvas_.getContext("2d");r.font=t.font;var n=Math.ceil((r.measureText("M").width*1.5+t.lineWidth/2)*t.scale);this.atlases_[e]={atlas:new Jo({space:t.lineWidth+1}),width:{},height:n}}return this.atlases_[e]};Zo.prototype.calculateHash_=function(t){var i,s;var e="";for(i=0,s=t.length;i<s;++i){e+=t[i]}return e};Zo.prototype.getTextures=function(t){return this.textures_};Zo.prototype.getHitDetectionTextures=function(){return this.textures_};var $o=function(t,i,s){eo.call(this);this.maxExtent_=i;this.tolerance_=t;this.renderBuffer_=s;this.replaysByZIndex_={}};fn.inherits($o,eo);$o.prototype.addDeclutter=function(t,i){};$o.prototype.getDeleteResourcesFunction=function(t){var i=[];var s;for(s in this.replaysByZIndex_){var e=this.replaysByZIndex_[s];var r;for(r in e){i.push(e[r].getDeleteResourcesFunction(t))}}return function(){var t=i.length;var s;for(var e=0;e<t;e++){s=i[e].apply(this,arguments)}return s}};$o.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s=this.replaysByZIndex_[i];var e;for(e in s){s[e].finish(t)}}};$o.prototype.getReplay=function(t,i){var s=t!==undefined?t.toString():"0";var e=this.replaysByZIndex_[s];if(e===undefined){e={};this.replaysByZIndex_[s]=e}var r=e[i];if(r===undefined){var n=$o.BATCH_CONSTRUCTORS_[i];r=new n(this.tolerance_,this.maxExtent_);e[i]=r}return r};$o.prototype.isEmpty=function(){return vn.isEmpty(this.replaysByZIndex_)};$o.prototype.replay=function(t,i,s,e,r,n,h,a){var o=Object.keys(this.replaysByZIndex_).map(Number);o.sort(kn.numberSafeCompareFunction);var f,u,l,v,c,d;for(f=0,u=o.length;f<u;++f){c=this.replaysByZIndex_[o[f].toString()];for(l=0,v=oo.ORDER.length;l<v;++l){d=c[oo.ORDER[l]];if(d!==undefined){d.replay(t,i,s,e,r,n,h,a,undefined,false)}}}};$o.prototype.replayHitDetection_=function(t,i,s,e,r,n,h,a,o,f,u){var l=Object.keys(this.replaysByZIndex_).map(Number);l.sort((function(t,i){return i-t}));var v,c,d,m,p,z;for(v=0,c=l.length;v<c;++v){m=this.replaysByZIndex_[l[v].toString()];for(d=oo.ORDER.length-1;d>=0;--d){p=m[oo.ORDER[d]];if(p!==undefined){z=p.replay(t,i,s,e,r,n,h,a,o,f,u);if(z){return z}}}}return undefined};$o.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o,f){var u=i.getGL();u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer());var l;if(this.renderBuffer_!==undefined){l=Nn.buffer(Nn.createOrUpdateFromCoordinate(t),e*this.renderBuffer_)}return this.replayHitDetection_(i,t,e,r,$o.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,i);if(i[3]>0){var s=f(t);if(s){return s}}}),true,l)};$o.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r,n,h,a,o){var f=i.getGL();f.bindFramebuffer(f.FRAMEBUFFER,i.getHitDetectionFramebuffer());var u=this.replayHitDetection_(i,t,e,r,$o.HIT_DETECTION_SIZE_,h,a,o,(function(t){var i=new Uint8Array(4);f.readPixels(0,0,1,1,f.RGBA,f.UNSIGNED_BYTE,i);return i[3]>0}),false);return u!==undefined};$o.HIT_DETECTION_SIZE_=[1,1];$o.BATCH_CONSTRUCTORS_={Circle:Oo,Image:Do,LineString:Vo,Polygon:Bo,Text:Zo};var Ko=function(t,i,s,e,r,n,h){Na.call(this);this.context_=t;this.center_=i;this.extent_=n;this.pixelRatio_=h;this.size_=r;this.rotation_=e;this.resolution_=s;this.imageStyle_=null;this.fillStyle_=null;this.strokeStyle_=null;this.textStyle_=null};fn.inherits(Ko,Na);Ko.prototype.drawText_=function(t,i){var s=this.context_;var e=t.getReplay(0,ro.TEXT);e.setTextStyle(this.textStyle_);e.drawText(i,null);e.finish(s);var r=1;var n={};var h;var a=false;e.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,r,n,h,a);e.getDeleteResourcesFunction(s)()};Ko.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke());this.setImageStyle(t.getImage());this.setTextStyle(t.getText())};Ko.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case wn.POINT:this.drawPoint(t,null);break;case wn.LINE_STRING:this.drawLineString(t,null);break;case wn.POLYGON:this.drawPolygon(t,null);break;case wn.MULTI_POINT:this.drawMultiPoint(t,null);break;case wn.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case wn.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case wn.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case wn.CIRCLE:this.drawCircle(t,null);break}};Ko.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);if(!s||!Nn.intersects(this.extent_,s.getExtent())){return}this.setStyle(i);this.drawGeometry(s)};Ko.prototype.drawGeometryCollection=function(t,i){var s=t.getGeometriesArray();var e,r;for(e=0,r=s.length;e<r;++e){this.drawGeometry(s[e])}};Ko.prototype.drawPoint=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.IMAGE);r.setImageStyle(this.imageStyle_);r.drawPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawMultiPoint=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.IMAGE);r.setImageStyle(this.imageStyle_);r.drawMultiPoint(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawLineString=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawMultiLineString=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.LINE_STRING);r.setFillStrokeStyle(null,this.strokeStyle_);r.drawMultiLineString(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawPolygon=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawMultiPolygon=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.POLYGON);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawMultiPolygon(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.drawCircle=function(t,i){var s=this.context_;var e=new $o(1,this.extent_);var r=e.getReplay(0,ro.CIRCLE);r.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_);r.drawCircle(t,i);r.finish(s);var n=1;var h={};var a;var o=false;r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,n,h,a,o);r.getDeleteResourcesFunction(s)();if(this.textStyle_){this.drawText_(e,t)}};Ko.prototype.setImageStyle=function(t){this.imageStyle_=t};Ko.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t;this.strokeStyle_=i};Ko.prototype.setTextStyle=function(t){this.textStyle_=t};var Qo={};Qo.fragment=new wo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}");Qo.vertex=new yo(fn.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var tf=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_texCoordMatrix":"d");this.u_projectionMatrix=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_projectionMatrix":"e");this.u_opacity=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_opacity":"f");this.u_texture=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_texture":"g");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_texCoord":"c")};var sf=function(t,i){Sa.call(this,i);this.mapRenderer=t;this.arrayBuffer_=new So([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]);this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined;this.texCoordMatrix=Gn.create();this.projectionMatrix=Gn.create();this.tmpMat4_=Co.create();this.defaultLocations_=null};fn.inherits(sf,Sa);sf.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(this.framebufferDimension===undefined||this.framebufferDimension!=i){var e=function(t,i,s){if(!t.isContextLost()){t.deleteFramebuffer(i);t.deleteTexture(s)}}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(e);var r=Po.createEmptyTexture(s,i,i);var n=s.createFramebuffer();s.bindFramebuffer(eh.FRAMEBUFFER,n);s.framebufferTexture2D(eh.FRAMEBUFFER,eh.COLOR_ATTACHMENT0,eh.TEXTURE_2D,r,0);this.texture=r;this.framebuffer=n;this.framebufferDimension=i}else{s.bindFramebuffer(eh.FRAMEBUFFER,this.framebuffer)}};sf.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(Hh.PRECOMPOSE,s,t);s.bindBuffer(eh.ARRAY_BUFFER,this.arrayBuffer_);var e=s.getGL();var r=Qo.fragment;var n=Qo.vertex;var h=s.getProgram(r,n);var a;if(!this.defaultLocations_){a=new tf(e,h);this.defaultLocations_=a}else{a=this.defaultLocations_}if(s.useProgram(h)){e.enableVertexAttribArray(a.a_position);e.vertexAttribPointer(a.a_position,2,eh.FLOAT,false,16,0);e.enableVertexAttribArray(a.a_texCoord);e.vertexAttribPointer(a.a_texCoord,2,eh.FLOAT,false,16,8);e.uniform1i(a.u_texture,0)}e.uniformMatrix4fv(a.u_texCoordMatrix,false,Co.fromTransform(this.tmpMat4_,this.getTexCoordMatrix()));e.uniformMatrix4fv(a.u_projectionMatrix,false,Co.fromTransform(this.tmpMat4_,this.getProjectionMatrix()));e.uniform1f(a.u_opacity,i.opacity);e.bindTexture(eh.TEXTURE_2D,this.getTexture());e.drawArrays(eh.TRIANGLE_STRIP,0,4);this.dispatchComposeEvent_(Hh.POSTCOMPOSE,s,t)};sf.prototype.dispatchComposeEvent_=function(t,i,s){var e=this.getLayer();if(e.hasListener(t)){var r=s.viewState;var n=r.resolution;var h=s.pixelRatio;var a=s.extent;var o=r.center;var f=r.rotation;var u=s.size;var l=new Ko(i,o,n,f,u,a,h);var v=new wa(t,l,s,null,i);e.dispatchEvent(v)}};sf.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix};sf.prototype.getTexture=function(){return this.texture};sf.prototype.getProjectionMatrix=function(){return this.projectionMatrix};sf.prototype.handleWebGLContextLost=function(){this.texture=null;this.framebuffer=null;this.framebufferDimension=undefined};sf.prototype.prepareFrame=function(t,i,s){};sf.prototype.forEachLayerAtPixel=function(t,i,s,e){};var ef=function(t,i){sf.call(this,t,i);this.image_=null;this.hitCanvasContext_=null;this.hitTransformationMatrix_=null};fn.inherits(ef,sf);ef["handles"]=function(t,i){return t===Uh.WEBGL&&i.getType()===ba.IMAGE};ef["create"]=function(t,i){return new ef(t,i)};ef.prototype.createTexture_=function(t){var i=t.getImage();var s=this.mapRenderer.getGL();return Po.createTexture(s,i,eh.CLAMP_TO_EDGE,eh.CLAMP_TO_EDGE)};ef.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){var n=this.getLayer();var h=n.getSource();var a=i.viewState.resolution;var o=i.viewState.rotation;var f=i.skippedFeatureUids;return h.forEachFeatureAtCoordinate(t,a,o,s,f,(function(t){return e.call(r,t,n)}))};ef.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer.getGL();var r=t.pixelRatio;var n=t.viewState;var h=n.center;var a=n.resolution;var o=n.rotation;var f=this.image_;var u=this.texture;var l=this.getLayer();var v=l.getSource();var c=t.viewHints;var d=t.extent;if(i.extent!==undefined){d=Nn.getIntersection(d,i.extent)}if(!c[Sh.ANIMATING]&&!c[Sh.INTERACTING]&&!Nn.isEmpty(d)){var m=n.projection;if(!fn.ENABLE_RASTER_REPROJECTION){var p=v.getProjection();if(p){m=p}}var z=v.getImage(d,a,r,m);if(z){var M=this.loadImage(z);if(M){f=z;u=this.createTexture_(z);if(this.texture){var _=function(t,i){if(!t.isContextLost()){t.deleteTexture(i)}}.bind(null,e,this.texture);t.postRenderFunctions.push(_)}}}}if(f){var g=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(g.width,g.height,r,h,a,o,f.getExtent());this.hitTransformationMatrix_=null;var b=this.texCoordMatrix;Gn.reset(b);Gn.scale(b,1,-1);Gn.translate(b,0,-1);this.image_=f;this.texture=u;this.updateLogos(t,v)}return!!f};ef.prototype.updateProjectionMatrix_=function(t,i,s,e,r,n,h){var a=t*r;var o=i*r;var f=this.projectionMatrix;Gn.reset(f);Gn.scale(f,s*2/a,s*2/o);Gn.rotate(f,-n);Gn.translate(f,h[0]-e[0],h[1]-e[1]);Gn.scale(f,(h[2]-h[0])/2,(h[3]-h[1])/2);Gn.translate(f,1,1)};ef.prototype.hasFeatureAtCoordinate=function(t,i){var s=this.forEachFeatureAtCoordinate(t,i,0,Sn.TRUE,this);return s!==undefined};ef.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.image_||!this.image_.getImage()){return undefined}if(this.getLayer().getSource().forEachFeatureAtCoordinate!==fn.nullFunction){var r=Gn.apply(i.pixelToCoordinateTransform,t.slice());var n=this.forEachFeatureAtCoordinate(r,i,0,Sn.TRUE,this);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}}else{var h=[this.image_.getImage().width,this.image_.getImage().height];if(!this.hitTransformationMatrix_){this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,h)}var a=Gn.apply(this.hitTransformationMatrix_,t.slice());if(a[0]<0||a[0]>h[0]||a[1]<0||a[1]>h[1]){return undefined}if(!this.hitCanvasContext_){this.hitCanvasContext_=Lh.createCanvasContext2D(1,1)}this.hitCanvasContext_.clearRect(0,0,1,1);this.hitCanvasContext_.drawImage(this.image_.getImage(),a[0],a[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}}};ef.prototype.getHitTransformationMatrix_=function(t,i){var s=Gn.create();Gn.translate(s,-1,-1);Gn.scale(s,2/t[0],2/t[1]);Gn.translate(s,0,t[1]);Gn.scale(s,1,-1);var e=Gn.invert(this.projectionMatrix.slice());var r=Gn.create();Gn.translate(r,0,i[1]);Gn.scale(r,1,-1);Gn.scale(r,i[0]/2,i[1]/2);Gn.translate(r,1,1);Gn.multiply(r,e);Gn.multiply(r,s);return r};var rf=function(t,i){La.call(this,t,i);this.canvas_=document.createElement("CANVAS");this.canvas_.style.width="100%";this.canvas_.style.height="100%";this.canvas_.style.display="block";this.canvas_.className=Bh.CLASS_UNSELECTABLE;t.insertBefore(this.canvas_,t.childNodes[0]||null);this.clipTileCanvasWidth_=0;this.clipTileCanvasHeight_=0;this.clipTileContext_=Lh.createCanvasContext2D();this.renderedVisible_=true;this.gl_=eh.getContext(this.canvas_,{antialias:true,depth:true,failIfMajorPerformanceCaveat:true,preserveDrawingBuffer:false,stencil:true});this.context_=new Po(this.canvas_,this.gl_);cn.listen(this.canvas_,Ro.LOST,this.handleWebGLContextLost,this);cn.listen(this.canvas_,Ro.RESTORED,this.handleWebGLContextRestored,this);this.textureCache_=new ya;this.focus_=null;this.tileTextureQueue_=new kh(function(t){var i=t[1];var s=t[2];var e=i[0]-this.focus_[0];var r=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(e*e+r*r)/s}.bind(this),(function(t){return t[0].getKey()}));this.loadNextTileTexture_=function(t,i){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var s=this.tileTextureQueue_.dequeue();var e=s[0];var r=s[3];var n=s[4];this.bindTileTexture(e,r,n,eh.LINEAR,eh.LINEAR)}return false}.bind(this);this.textureCacheFrameMarkerCount_=0;this.initializeGL_()};fn.inherits(rf,La);rf["handles"]=function(t){return rh.WEBGL&&t===Uh.WEBGL};rf["create"]=function(t,i){return new rf(t,i)};rf.prototype.bindTileTexture=function(t,i,s,e,r){var n=this.getGL();var h=t.getKey();if(this.textureCache_.containsKey(h)){var a=this.textureCache_.get(h);n.bindTexture(eh.TEXTURE_2D,a.texture);if(a.magFilter!=e){n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MAG_FILTER,e);a.magFilter=e}if(a.minFilter!=r){n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MIN_FILTER,r);a.minFilter=r}}else{var o=n.createTexture();n.bindTexture(eh.TEXTURE_2D,o);if(s>0){var f=this.clipTileContext_.canvas;var u=this.clipTileContext_;if(this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]){f.width=i[0];f.height=i[1];this.clipTileCanvasWidth_=i[0];this.clipTileCanvasHeight_=i[1]}else{u.clearRect(0,0,i[0],i[1])}u.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]);n.texImage2D(eh.TEXTURE_2D,0,eh.RGBA,eh.RGBA,eh.UNSIGNED_BYTE,f)}else{n.texImage2D(eh.TEXTURE_2D,0,eh.RGBA,eh.RGBA,eh.UNSIGNED_BYTE,t.getImage())}n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MAG_FILTER,e);n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_MIN_FILTER,r);n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_S,eh.CLAMP_TO_EDGE);n.texParameteri(eh.TEXTURE_2D,eh.TEXTURE_WRAP_T,eh.CLAMP_TO_EDGE);this.textureCache_.set(h,{texture:o,magFilter:e,minFilter:r})}};rf.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var e=this.context_;var r=i.extent;var n=i.size;var h=i.viewState;var a=i.pixelRatio;var o=h.resolution;var f=h.center;var u=h.rotation;var l=new Ko(e,f,o,u,n,r,a);var v=new wa(t,l,i,null,e);s.dispatchEvent(v)}};rf.prototype.disposeInternal=function(){var t=this.getGL();if(!t.isContextLost()){this.textureCache_.forEach((function(i){if(i){t.deleteTexture(i.texture)}}))}this.context_.dispose();La.prototype.disposeInternal.call(this)};rf.prototype.expireCache_=function(t,i){var s=this.getGL();var e;while(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>fn.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){e=this.textureCache_.peekLast();if(!e){if(+this.textureCache_.peekLastKey()==i.index){break}else{--this.textureCacheFrameMarkerCount_}}else{s.deleteTexture(e.texture)}this.textureCache_.pop()}};rf.prototype.getContext=function(){return this.context_};rf.prototype.getGL=function(){return this.gl_};rf.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_};rf.prototype.getType=function(){return Uh.WEBGL};rf.prototype.handleWebGLContextLost=function(t){t.preventDefault();this.textureCache_.clear();this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i){var e=i[s];e.handleWebGLContextLost()}};rf.prototype.handleWebGLContextRestored=function(){this.initializeGL_();this.getMap().render()};rf.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(eh.TEXTURE0);t.blendFuncSeparate(eh.SRC_ALPHA,eh.ONE_MINUS_SRC_ALPHA,eh.ONE,eh.ONE_MINUS_SRC_ALPHA);t.disable(eh.CULL_FACE);t.disable(eh.DEPTH_TEST);t.disable(eh.SCISSOR_TEST);t.disable(eh.STENCIL_TEST)};rf.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())};rf.prototype.renderFrame=function(t){var i=this.getContext();var s=this.getGL();if(s.isContextLost()){return false}if(!t){if(this.renderedVisible_){this.canvas_.style.display="none";this.renderedVisible_=false}return false}this.focus_=t.focus;this.textureCache_.set((-t.index).toString(),null);++this.textureCacheFrameMarkerCount_;this.dispatchComposeEvent_(Hh.PRECOMPOSE,t);var e=[];var r=t.layerStatesArray;kn.stableSort(r,La.sortByZIndex);var n=t.viewState.resolution;var h,a,o,f;for(h=0,a=r.length;h<a;++h){f=r[h];if(Jh.visibleAtResolution(f,n)&&f.sourceState==Wh.READY){o=this.getLayerRenderer(f.layer);if(o.prepareFrame(t,f,i)){e.push(f)}}}var u=t.size[0]*t.pixelRatio;var l=t.size[1]*t.pixelRatio;if(this.canvas_.width!=u||this.canvas_.height!=l){this.canvas_.width=u;this.canvas_.height=l}s.bindFramebuffer(eh.FRAMEBUFFER,null);s.clearColor(0,0,0,0);s.clear(eh.COLOR_BUFFER_BIT);s.enable(eh.BLEND);s.viewport(0,0,this.canvas_.width,this.canvas_.height);for(h=0,a=e.length;h<a;++h){f=e[h];o=this.getLayerRenderer(f.layer);o.composeFrame(t,f,i)}if(!this.renderedVisible_){this.canvas_.style.display="";this.renderedVisible_=true}this.calculateMatrices2D(t);if(this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>fn.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK){t.postRenderFunctions.push(this.expireCache_.bind(this))}if(!this.tileTextureQueue_.isEmpty()){t.postRenderFunctions.push(this.loadNextTileTexture_);t.animate=true}this.dispatchComposeEvent_(Hh.POSTCOMPOSE,t);this.scheduleRemoveUnusedLayerRenderers(t);this.scheduleExpireIconCache(t)};rf.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r,n,h){var a;if(this.getGL().isContextLost()){return false}var o=i.viewState;var f=i.layerStatesArray;var u=f.length;var l;for(l=u-1;l>=0;--l){var v=f[l];var c=v.layer;if(Jh.visibleAtResolution(v,o.resolution)&&n.call(h,c)){var d=this.getLayerRenderer(c);a=d.forEachFeatureAtCoordinate(t,i,s,e,r);if(a){return a}}}return undefined};rf.prototype.hasFeatureAtCoordinate=function(t,i,s,e,r){var n=false;if(this.getGL().isContextLost()){return false}var h=i.viewState;var a=i.layerStatesArray;var o=a.length;var f;for(f=o-1;f>=0;--f){var u=a[f];var l=u.layer;if(Jh.visibleAtResolution(u,h.resolution)&&e.call(r,l)){var v=this.getLayerRenderer(l);n=v.hasFeatureAtCoordinate(t,i);if(n){return true}}}return n};rf.prototype.forEachLayerAtPixel=function(t,i,s,e,r,n){if(this.getGL().isContextLost()){return false}var h=i.viewState;var a;var o=i.layerStatesArray;var f=o.length;var u;for(u=f-1;u>=0;--u){var l=o[u];var v=l.layer;if(Jh.visibleAtResolution(l,h.resolution)&&r.call(e,v)){var c=this.getLayerRenderer(v);a=c.forEachLayerAtPixel(t,i,s,e);if(a){return a}}}return undefined};var nf={};nf.fragment=new wo(fn.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}");nf.vertex=new yo(fn.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var hf=function(t,i){this.u_tileOffset=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_tileOffset":"d");this.u_texture=t.getUniformLocation(i,fn.DEBUG_WEBGL?"u_texture":"e");this.a_position=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_position":"b");this.a_texCoord=t.getAttribLocation(i,fn.DEBUG_WEBGL?"a_texCoord":"c")};var af=function(t,i){sf.call(this,t,i);this.fragmentShader_=nf.fragment;this.vertexShader_=nf.vertex;this.locations_=null;this.renderArrayBuffer_=new So([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]);this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;this.tmpSize_=[0,0]};fn.inherits(af,sf);af["handles"]=function(t,i){return t===Uh.WEBGL&&i.getType()===ba.TILE};af["create"]=function(t,i){return new af(t,i)};af.prototype.disposeInternal=function(){var t=this.mapRenderer.getContext();t.deleteBuffer(this.renderArrayBuffer_);sf.prototype.disposeInternal.call(this)};af.prototype.createLoadedTileFinder=function(t,i,s){var e=this.mapRenderer;return function(r,n){function h(t){var i=e.isTileTextureLoaded(t);if(i){if(!s[r]){s[r]={}}s[r][t.tileCoord.toString()]=t}return i}return t.forEachLoadedTile(i,r,n,h)}};af.prototype.handleWebGLContextLost=function(){sf.prototype.handleWebGLContextLost.call(this);this.locations_=null};af.prototype.prepareFrame=function(t,i,s){var e=this.mapRenderer;var r=s.getGL();var n=t.viewState;var h=n.projection;var a=this.getLayer();var o=a.getSource();var f=o.getTileGridForProjection(h);var u=f.getZForResolution(n.resolution);var l=f.getResolution(u);var v=o.getTilePixelSize(u,t.pixelRatio,h);var c=v[0]/Xh.toSize(f.getTileSize(u),this.tmpSize_)[0];var d=l/c;var m=o.getTilePixelRatio(c)*o.getGutter(h);var p=n.center;var z=t.extent;var M=f.getTileRangeForExtentAndZ(z,u);var _;if(this.renderedTileRange_&&this.renderedTileRange_.equals(M)&&this.renderedRevision_==o.getRevision()){_=this.renderedFramebufferExtent_}else{var g=M.getSize();var b=Math.max(g[0]*v[0],g[1]*v[1]);var x=xn.roundUpToPowerOfTwo(b);var w=d*x;var y=f.getOrigin(u);var k=y[0]+M.minX*v[0]*d;var E=y[1]+M.minY*v[1]*d;_=[k,E,k+w,E+w];this.bindFramebuffer(t,x);r.viewport(0,0,x,x);r.clearColor(0,0,0,0);r.clear(eh.COLOR_BUFFER_BIT);r.disable(eh.BLEND);var C=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(C);if(!this.locations_){this.locations_=new hf(r,C)}s.bindBuffer(eh.ARRAY_BUFFER,this.renderArrayBuffer_);r.enableVertexAttribArray(this.locations_.a_position);r.vertexAttribPointer(this.locations_.a_position,2,eh.FLOAT,false,16,0);r.enableVertexAttribArray(this.locations_.a_texCoord);r.vertexAttribPointer(this.locations_.a_texCoord,2,eh.FLOAT,false,16,8);r.uniform1i(this.locations_.u_texture,0);var N={};N[u]={};var I=this.createLoadedTileFinder(o,h,N);var S=a.getUseInterimTilesOnError();var O=true;var T=Nn.createEmpty();var A=new Fa(0,0,0,0);var R,P,L,D,F;var W,G,V;for(W=M.minX;W<=M.maxX;++W){for(G=M.minY;G<=M.maxY;++G){D=o.getTile(u,W,G,c,h);if(i.extent!==undefined){V=f.getTileCoordExtent(D.tileCoord,T);if(!Nn.intersects(V,i.extent)){continue}}F=D.getState();P=F==yh.LOADED||F==yh.EMPTY||F==yh.ERROR&&!S;if(!P){D=D.getInterimTile()}F=D.getState();if(F==yh.LOADED){if(e.isTileTextureLoaded(D)){N[u][D.tileCoord.toString()]=D;continue}}else if(F==yh.EMPTY||F==yh.ERROR&&!S){continue}O=false;L=f.forEachTileCoordParentTileRange(D.tileCoord,I,null,A,T);if(!L){R=f.getTileCoordChildTileRange(D.tileCoord,A,T);if(R){I(u+1,R)}}}}var j=Object.keys(N).map(Number);j.sort(kn.numberSafeCompareFunction);var U=new Float32Array(4);var X,q,Y,B;for(X=0,q=j.length;X<q;++X){B=N[j[X]];for(Y in B){D=B[Y];V=f.getTileCoordExtent(D.tileCoord,T);U[0]=2*(V[2]-V[0])/w;U[1]=2*(V[3]-V[1])/w;U[2]=2*(V[0]-_[0])/w-1;U[3]=2*(V[1]-_[1])/w-1;r.uniform4fv(this.locations_.u_tileOffset,U);e.bindTileTexture(D,v,m*c,eh.LINEAR,eh.LINEAR);r.drawArrays(eh.TRIANGLE_STRIP,0,4)}}if(O){this.renderedTileRange_=M;this.renderedFramebufferExtent_=_;this.renderedRevision_=o.getRevision()}else{this.renderedTileRange_=null;this.renderedFramebufferExtent_=null;this.renderedRevision_=-1;t.animate=true}}this.updateUsedTiles(t.usedTiles,o,u,M);var H=e.getTileTextureQueue();this.manageTilePyramid(t,o,f,c,h,z,u,a.getPreload(),(function(t){if(t.getState()==yh.LOADED&&!e.isTileTextureLoaded(t)&&!H.isKeyQueued(t.getKey())){H.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),v,m*c])}}),this);this.scheduleExpireCache(t,o);this.updateLogos(t,o);var J=this.texCoordMatrix;Gn.reset(J);Gn.translate(J,(Math.round(p[0]/l)*l-_[0])/(_[2]-_[0]),(Math.round(p[1]/l)*l-_[1])/(_[3]-_[1]));if(n.rotation!==0){Gn.rotate(J,n.rotation)}Gn.scale(J,t.size[0]*n.resolution/(_[2]-_[0]),t.size[1]*n.resolution/(_[3]-_[1]));Gn.translate(J,-.5,-.5);return true};af.prototype.forEachLayerAtPixel=function(t,i,s,e){if(!this.framebuffer){return undefined}var r=[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]];var n=Gn.apply(this.texCoordMatrix,r.slice());var h=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension];var a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);a.readPixels(h[0],h[1],1,1,a.RGBA,a.UNSIGNED_BYTE,o);if(o[3]>0){return s.call(e,this.getLayer(),o)}else{return undefined}};var of=function(t,i){sf.call(this,t,i);this.dirty_=false;this.renderedRevision_=-1;this.renderedResolution_=NaN;this.renderedExtent_=Nn.createEmpty();this.renderedRenderOrder_=null;this.replayGroup_=null;this.layerState_=null};fn.inherits(of,sf);of["handles"]=function(t,i){return t===Uh.WEBGL&&i.getType()===ba.VECTOR};of["create"]=function(t,i){return new of(t,i)};of.prototype.composeFrame=function(t,i,s){this.layerState_=i;var e=t.viewState;var r=this.replayGroup_;var n=t.size;var h=t.pixelRatio;var a=this.mapRenderer.getGL();if(r&&!r.isEmpty()){a.enable(a.SCISSOR_TEST);a.scissor(0,0,n[0]*h,n[1]*h);r.replay(s,e.center,e.resolution,e.rotation,n,h,i.opacity,i.managed?t.skippedFeatureUids:{});a.disable(a.SCISSOR_TEST)}};of.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)();this.replayGroup_=null}sf.prototype.disposeInternal.call(this)};of.prototype.forEachFeatureAtCoordinate=function(t,i,s,e,r){if(!this.replayGroup_||!this.layerState_){return undefined}else{var n=this.mapRenderer.getContext();var h=i.viewState;var a=this.getLayer();var o=this.layerState_;var f={};return this.replayGroup_.forEachFeatureAtCoordinate(t,n,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,o.opacity,{},(function(t){var i=fn.getUid(t).toString();if(!(i in f)){f[i]=true;return e.call(r,t,a)}}))}};of.prototype.hasFeatureAtCoordinate=function(t,i){if(!this.replayGroup_||!this.layerState_){return false}else{var s=this.mapRenderer.getContext();var e=i.viewState;var r=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,s,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,r.opacity,i.skippedFeatureUids)}};of.prototype.forEachLayerAtPixel=function(t,i,s,e){var r=Gn.apply(i.pixelToCoordinateTransform,t.slice());var n=this.hasFeatureAtCoordinate(r,i);if(n){return s.call(e,this.getLayer(),null)}else{return undefined}};of.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()};of.prototype.prepareFrame=function(t,i,s){var e=this.getLayer();var r=e.getSource();this.updateLogos(t,r);var n=t.viewHints[Sh.ANIMATING];var h=t.viewHints[Sh.INTERACTING];var a=e.getUpdateWhileAnimating();var o=e.getUpdateWhileInteracting();if(!this.dirty_&&(!a&&n)||!o&&h){return true}var f=t.extent;var u=t.viewState;var l=u.projection;var v=u.resolution;var c=t.pixelRatio;var d=e.getRevision();var m=e.getRenderBuffer();var p=e.getRenderOrder();if(p===undefined){p=Mo.defaultOrder}var z=Nn.buffer(f,m*v);if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&Nn.containsExtent(this.renderedExtent_,z)){return true}if(this.replayGroup_){t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s))}this.dirty_=false;var M=new $o(Mo.getTolerance(v,c),z,e.getRenderBuffer());r.loadFeatures(z,v,l);var _=function(t){var i;var s=t.getStyleFunction();if(s){i=s.call(t,v)}else{s=e.getStyleFunction();if(s){i=s(t,v)}}if(i){var r=this.renderFeature(t,v,c,i,M);this.dirty_=this.dirty_||r}};if(p){var g=[];r.forEachFeatureInExtent(z,(function(t){g.push(t)}),this);g.sort(p);g.forEach(_,this)}else{r.forEachFeatureInExtent(z,_,this)}M.finish(s);this.renderedResolution_=v;this.renderedRevision_=d;this.renderedRenderOrder_=p;this.renderedExtent_=z;this.replayGroup_=M;return true};of.prototype.renderFeature=function(t,i,s,e,r){if(!e){return false}var n=false;if(Array.isArray(e)){for(var h=e.length-1,a=0;h>=a;--h){n=Mo.renderFeature(r,t,e[h],Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}}else{n=Mo.renderFeature(r,t,e,Mo.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||n}return n};if(fn.ENABLE_CANVAS){jh.register(Vh.MAP_RENDERER,Da);jh.registerMultiple(Vh.LAYER_RENDERER,[Aa,Wa,_o,bo])}if(fn.ENABLE_WEBGL){jh.register(Vh.MAP_RENDERER,rf);jh.registerMultiple(Vh.LAYER_RENDERER,[ef,af,of])}var ff=function(t){t=vn.assign({},t);if(!t.controls){t.controls=Qh.defaults()}if(!t.interactions){t.interactions=za.defaults()}qh.call(this,t)};fn.inherits(ff,qh);var uf={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};var lf=function(t){_n.call(this);this.options=t;this.id=t.id;this.insertFirst=t.insertFirst!==undefined?t.insertFirst:true;this.stopEvent=t.stopEvent!==undefined?t.stopEvent:true;this.element=document.createElement("DIV");this.element.className=t.className!==undefined?t.className:"ol-overlay-container "+Bh.CLASS_SELECTABLE;this.element.style.position="absolute";this.autoPan=t.autoPan!==undefined?t.autoPan:false;this.autoPanAnimation=t.autoPanAnimation||{};this.autoPanMargin=t.autoPanMargin!==undefined?t.autoPanMargin:20;this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:true};this.mapPostrenderListenerKey=null;cn.listen(this,_n.getChangeEventType(lf.Property.ELEMENT),this.handleElementChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.MAP),this.handleMapChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.OFFSET),this.handleOffsetChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.POSITION),this.handlePositionChanged,this);cn.listen(this,_n.getChangeEventType(lf.Property.POSITIONING),this.handlePositioningChanged,this);if(t.element!==undefined){this.setElement(t.element)}this.setOffset(t.offset!==undefined?t.offset:[0,0]);this.setPositioning(t.positioning!==undefined?t.positioning:uf.TOP_LEFT);if(t.position!==undefined){this.setPosition(t.position)}};fn.inherits(lf,_n);lf.prototype.getElement=function(){return this.get(lf.Property.ELEMENT)};lf.prototype.getId=function(){return this.id};lf.prototype.getMap=function(){return this.get(lf.Property.MAP)};lf.prototype.getOffset=function(){return this.get(lf.Property.OFFSET)};lf.prototype.getPosition=function(){return this.get(lf.Property.POSITION)};lf.prototype.getPositioning=function(){return this.get(lf.Property.POSITIONING)};lf.prototype.handleElementChanged=function(){Lh.removeChildren(this.element);var t=this.getElement();if(t){this.element.appendChild(t)}};lf.prototype.handleMapChanged=function(){if(this.mapPostrenderListenerKey){Lh.removeNode(this.element);cn.unlistenByKey(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}var t=this.getMap();if(t){this.mapPostrenderListenerKey=cn.listen(t,xh.POSTRENDER,this.render,this);this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();if(this.insertFirst){i.insertBefore(this.element,i.childNodes[0]||null)}else{i.appendChild(this.element)}}};lf.prototype.render=function(){this.updatePixelPosition()};lf.prototype.handleOffsetChanged=function(){this.updatePixelPosition()};lf.prototype.handlePositionChanged=function(){this.updatePixelPosition();if(this.get(lf.Property.POSITION)&&this.autoPan){this.panIntoView()}};lf.prototype.handlePositioningChanged=function(){this.updatePixelPosition()};lf.prototype.setElement=function(t){this.set(lf.Property.ELEMENT,t)};lf.prototype.setMap=function(t){this.set(lf.Property.MAP,t)};lf.prototype.setOffset=function(t){this.set(lf.Property.OFFSET,t)};lf.prototype.setPosition=function(t){this.set(lf.Property.POSITION,t)};lf.prototype.panIntoView=function(){var t=this.getMap();if(!t||!t.getTargetElement()){return}var i=this.getRect(t.getTargetElement(),t.getSize());var s=this.getElement();var e=this.getRect(s,[Lh.outerWidth(s),Lh.outerHeight(s)]);var r=this.autoPanMargin;if(!Nn.containsExtent(i,e)){var n=e[0]-i[0];var h=i[2]-e[2];var a=e[1]-i[1];var o=i[3]-e[3];var f=[0,0];if(n<0){f[0]=n-r}else if(h<0){f[0]=Math.abs(h)+r}if(a<0){f[1]=a-r}else if(o<0){f[1]=Math.abs(o)+r}if(f[0]!==0||f[1]!==0){var u=t.getView().getCenter();var l=t.getPixelFromCoordinate(u);var v=[l[0]+f[0],l[1]+f[1]];t.getView().animate({center:t.getCoordinateFromPixel(v),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}};lf.prototype.getRect=function(t,i){var s=t.getBoundingClientRect();var e=s.left+window.pageXOffset;var r=s.top+window.pageYOffset;return[e,r,e+i[0],r+i[1]]};lf.prototype.setPositioning=function(t){this.set(lf.Property.POSITIONING,t)};lf.prototype.setVisible=function(t){if(this.rendered.visible!==t){this.element.style.display=t?"":"none";this.rendered.visible=t}};lf.prototype.updatePixelPosition=function(){var t=this.getMap();var i=this.getPosition();if(!t||!t.isRendered()||!i){this.setVisible(false);return}var s=t.getPixelFromCoordinate(i);var e=t.getSize();this.updateRenderedPosition(s,e)};lf.prototype.updateRenderedPosition=function(t,i){var s=this.element.style;var e=this.getOffset();var r=this.getPositioning();this.setVisible(true);var n=e[0];var h=e[1];if(r==uf.BOTTOM_RIGHT||r==uf.CENTER_RIGHT||r==uf.TOP_RIGHT){if(this.rendered.left_!==""){this.rendered.left_=s.left=""}var a=Math.round(i[0]-t[0]-n)+"px";if(this.rendered.right_!=a){this.rendered.right_=s.right=a}}else{if(this.rendered.right_!==""){this.rendered.right_=s.right=""}if(r==uf.BOTTOM_CENTER||r==uf.CENTER_CENTER||r==uf.TOP_CENTER){n-=this.element.offsetWidth/2}var o=Math.round(t[0]+n)+"px";if(this.rendered.left_!=o){this.rendered.left_=s.left=o}}if(r==uf.BOTTOM_LEFT||r==uf.BOTTOM_CENTER||r==uf.BOTTOM_RIGHT){if(this.rendered.top_!==""){this.rendered.top_=s.top=""}var f=Math.round(i[1]-t[1]-h)+"px";if(this.rendered.bottom_!=f){this.rendered.bottom_=s.bottom=f}}else{if(this.rendered.bottom_!==""){this.rendered.bottom_=s.bottom=""}if(r==uf.CENTER_LEFT||r==uf.CENTER_CENTER||r==uf.CENTER_RIGHT){h-=this.element.offsetHeight/2}var u=Math.round(t[1]+h)+"px";if(this.rendered.top_!=u){this.rendered.top_=s.top=u}}};lf.prototype.getOptions=function(){return this.options};lf.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var vf=function(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.snapToPixel_=t.snapToPixel};vf.prototype.getOpacity=function(){return this.opacity_};vf.prototype.getRotateWithView=function(){return this.rotateWithView_};vf.prototype.getRotation=function(){return this.rotation_};vf.prototype.getScale=function(){return this.scale_};vf.prototype.getSnapToPixel=function(){return this.snapToPixel_};vf.prototype.getAnchor=function(){};vf.prototype.getImage=function(t){};vf.prototype.getHitDetectionImage=function(t){};vf.prototype.getImageState=function(){};vf.prototype.getImageSize=function(){};vf.prototype.getHitDetectionImageSize=function(){};vf.prototype.getOrigin=function(){};vf.prototype.getSize=function(){};vf.prototype.setOpacity=function(t){this.opacity_=t};vf.prototype.setRotateWithView=function(t){this.rotateWithView_=t};vf.prototype.setRotation=function(t){this.rotation_=t};vf.prototype.setScale=function(t){this.scale_=t};vf.prototype.setSnapToPixel=function(t){this.snapToPixel_=t};vf.prototype.listenImageChange=function(t,i){};vf.prototype.load=function(){};vf.prototype.unlistenImageChange=function(t,i){};var cf=function(t){this.checksums_=null;this.canvas_=null;this.hitDetectionCanvas_=null;this.fill_=t.fill!==undefined?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius_=t.radius!==undefined?t.radius:t.radius1;this.radius2_=t.radius2;this.angle_=t.angle!==undefined?t.angle:0;this.stroke_=t.stroke!==undefined?t.stroke:null;this.anchor_=null;this.size_=null;this.imageSize_=null;this.hitDetectionImageSize_=null;this.atlasManager_=t.atlasManager;this.render_(this.atlasManager_);var i=t.snapToPixel!==undefined?t.snapToPixel:true;var s=t.rotateWithView!==undefined?t.rotateWithView:false;vf.call(this,{opacity:1,rotateWithView:s,rotation:t.rotation!==undefined?t.rotation:0,scale:1,snapToPixel:i})};fn.inherits(cf,vf);cf.prototype.clone=function(){var t=new cf({fill:this.getFill()?this.getFill().clone():undefined,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():undefined,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};cf.prototype.getAnchor=function(){return this.anchor_};cf.prototype.getAngle=function(){return this.angle_};cf.prototype.getFill=function(){return this.fill_};cf.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_};cf.prototype.getImage=function(t){return this.canvas_};cf.prototype.getImageSize=function(){return this.imageSize_};cf.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_};cf.prototype.getImageState=function(){return _a.LOADED};cf.prototype.getOrigin=function(){return this.origin_};cf.prototype.getPoints=function(){return this.points_};cf.prototype.getRadius=function(){return this.radius_};cf.prototype.getRadius2=function(){return this.radius2_};cf.prototype.getSize=function(){return this.size_};cf.prototype.getStroke=function(){return this.stroke_};cf.prototype.listenImageChange=function(t,i){};cf.prototype.load=function(){};cf.prototype.unlistenImageChange=function(t,i){};cf.prototype.render_=function(t){var i;var s="";var e="";var r=0;var n=null;var h=0;var a;var o=0;if(this.stroke_){a=this.stroke_.getColor();if(a===null){a=ka.defaultStrokeStyle}a=Ca.asColorLike(a);o=this.stroke_.getWidth();if(o===undefined){o=ka.defaultLineWidth}n=this.stroke_.getLineDash();h=this.stroke_.getLineDashOffset();if(!rh.CANVAS_LINE_DASH){n=null;h=0}e=this.stroke_.getLineJoin();if(e===undefined){e=ka.defaultLineJoin}s=this.stroke_.getLineCap();if(s===undefined){s=ka.defaultLineCap}r=this.stroke_.getMiterLimit();if(r===undefined){r=ka.defaultMiterLimit}}var f=2*(this.radius_+o)+1;var u={strokeStyle:a,strokeWidth:o,size:f,lineCap:s,lineDash:n,lineDashOffset:h,lineJoin:e,miterLimit:r};if(t===undefined){var l=Lh.createCanvasContext2D(f,f);this.canvas_=l.canvas;f=this.canvas_.width;i=f;this.draw_(u,l,0,0);this.createHitDetectionCanvas_(u)}else{f=Math.round(f);var v=!this.fill_;var c;if(v){c=this.drawHitDetectionCanvas_.bind(this,u)}var d=this.getChecksum();var m=t.add(d,f,f,this.draw_.bind(this,u),c);this.canvas_=m.image;this.origin_=[m.offsetX,m.offsetY];i=m.image.width;if(v){this.hitDetectionCanvas_=m.hitImage;this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]}else{this.hitDetectionCanvas_=this.canvas_;this.hitDetectionImageSize_=[i,i]}}this.anchor_=[f/2,f/2];this.size_=[f,f];this.imageSize_=[i,i]};cf.prototype.draw_=function(t,i,s,e){var r,n,h;i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var a=this.points_;if(a===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var o=this.radius2_!==undefined?this.radius2_:this.radius_;if(o!==this.radius_){a=2*a}for(r=0;r<=a;r++){n=r*2*Math.PI/a-Math.PI/2+this.angle_;h=r%2===0?this.radius_:o;i.lineTo(t.size/2+h*Math.cos(n),t.size/2+h*Math.sin(n))}}if(this.fill_){var f=this.fill_.getColor();if(f===null){f=ka.defaultFillStyle}i.fillStyle=Ca.asColorLike(f);i.fill()}if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.lineCap=t.lineCap;i.lineJoin=t.lineJoin;i.miterLimit=t.miterLimit;i.stroke()}i.closePath()};cf.prototype.createHitDetectionCanvas_=function(t){this.hitDetectionImageSize_=[t.size,t.size];if(this.fill_){this.hitDetectionCanvas_=this.canvas_;return}var i=Lh.createCanvasContext2D(t.size,t.size);this.hitDetectionCanvas_=i.canvas;this.drawHitDetectionCanvas_(t,i,0,0)};cf.prototype.drawHitDetectionCanvas_=function(t,i,s,e){i.setTransform(1,0,0,1,0,0);i.translate(s,e);i.beginPath();var r=this.points_;if(r===Infinity){i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,true)}else{var n=this.radius2_!==undefined?this.radius2_:this.radius_;if(n!==this.radius_){r=2*r}var h,a,o;for(h=0;h<=r;h++){o=h*2*Math.PI/r-Math.PI/2+this.angle_;a=h%2===0?this.radius_:n;i.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}}i.fillStyle=ka.defaultFillStyle;i.fill();if(this.stroke_){i.strokeStyle=t.strokeStyle;i.lineWidth=t.strokeWidth;if(t.lineDash){i.setLineDash(t.lineDash);i.lineDashOffset=t.lineDashOffset}i.stroke()}i.closePath()};cf.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-";var i=this.fill_?this.fill_.getChecksum():"-";var s=!this.checksums_||(t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]);if(s){var e="r"+t+i+(this.radius_!==undefined?this.radius_.toString():"-")+(this.radius2_!==undefined?this.radius2_.toString():"-")+(this.angle_!==undefined?this.angle_.toString():"-")+(this.points_!==undefined?this.points_.toString():"-");this.checksums_=[e,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var df=function(t){var i=t||{};cf.call(this,{points:Infinity,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};fn.inherits(df,cf);df.prototype.clone=function(){var t=new df({fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});t.setOpacity(this.getOpacity());t.setScale(this.getScale());return t};df.prototype.setRadius=function(t){this.radius_=t;this.render_(this.atlasManager_)};var mf=function(t){var i=t||{};this.color_=i.color!==undefined?i.color:null;this.checksum_=undefined};mf.prototype.clone=function(){var t=this.getColor();return new mf({color:t&&t.slice?t.slice():t||undefined})};mf.prototype.getColor=function(){return this.color_};mf.prototype.setColor=function(t){this.color_=t;this.checksum_=undefined};mf.prototype.getChecksum=function(){if(this.checksum_===undefined){if(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient){this.checksum_=fn.getUid(this.color_).toString()}else{this.checksum_="f"+(this.color_?Ea.asString(this.color_):"-")}}return this.checksum_};var pf=function(t){var i=t||{};this.geometry_=null;this.geometryFunction_=pf.defaultGeometryFunction;if(i.geometry!==undefined){this.setGeometry(i.geometry)}this.fill_=i.fill!==undefined?i.fill:null;this.image_=i.image!==undefined?i.image:null;this.renderer_=i.renderer!==undefined?i.renderer:null;this.stroke_=i.stroke!==undefined?i.stroke:null;this.text_=i.text!==undefined?i.text:null;this.zIndex_=i.zIndex};pf.prototype.clone=function(){var t=this.getGeometry();if(t&&t.clone){t=t.clone()}return new pf({geometry:t,fill:this.getFill()?this.getFill().clone():undefined,image:this.getImage()?this.getImage().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,text:this.getText()?this.getText().clone():undefined,zIndex:this.getZIndex()})};pf.prototype.getRenderer=function(){return this.renderer_};pf.prototype.setRenderer=function(t){this.renderer_=t};pf.prototype.getGeometry=function(){return this.geometry_};pf.prototype.getGeometryFunction=function(){return this.geometryFunction_};pf.prototype.getFill=function(){return this.fill_};pf.prototype.setFill=function(t){this.fill_=t};pf.prototype.getImage=function(){return this.image_};pf.prototype.setImage=function(t){this.image_=t};pf.prototype.getStroke=function(){return this.stroke_};pf.prototype.setStroke=function(t){this.stroke_=t};pf.prototype.getText=function(){return this.text_};pf.prototype.setText=function(t){this.text_=t};pf.prototype.getZIndex=function(){return this.zIndex_};pf.prototype.setGeometry=function(t){if(typeof t==="function"){this.geometryFunction_=t}else if(typeof t==="string"){this.geometryFunction_=function(i){return i.get(t)}}else if(!t){this.geometryFunction_=pf.defaultGeometryFunction}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t};pf.prototype.setZIndex=function(t){this.zIndex_=t};pf.createFunction=function(t){var i;if(typeof t==="function"){i=t}else{var s;if(Array.isArray(t)){s=t}else{bn.assert(t instanceof pf,41);s=[t]}i=function(){return s}}return i};pf.default_=null;pf.defaultFunction=function(t,i){if(!pf.default_){var s=new mf({color:"rgba(255,255,255,0.4)"});var e=new Xo({color:"#3399CC",width:1.25});pf.default_=[new pf({image:new df({fill:s,stroke:e,radius:5}),fill:s,stroke:e})]}return pf.default_};pf.createDefaultEditing=function(){var t={};var i=[255,255,255,1];var s=[0,153,255,1];var e=3;t[wn.POLYGON]=[new pf({fill:new mf({color:[255,255,255,.5]})})];t[wn.MULTI_POLYGON]=t[wn.POLYGON];t[wn.LINE_STRING]=[new pf({stroke:new Xo({color:i,width:e+2})}),new pf({stroke:new Xo({color:s,width:e})})];t[wn.MULTI_LINE_STRING]=t[wn.LINE_STRING];t[wn.CIRCLE]=t[wn.POLYGON].concat(t[wn.LINE_STRING]);t[wn.POINT]=[new pf({image:new df({radius:e*2,fill:new mf({color:s}),stroke:new Xo({color:i,width:e/2})}),zIndex:Infinity})];t[wn.MULTI_POINT]=t[wn.POINT];t[wn.GEOMETRY_COLLECTION]=t[wn.POLYGON].concat(t[wn.LINE_STRING],t[wn.POINT]);return t};pf.defaultGeometryFunction=function(t){return t.getGeometry()};var zf=function(t){_n.call(this);this.id_=undefined;this.geometryName_="geometry";this.style_=null;this.styleFunction_=undefined;this.geometryChangeKey_=null;cn.listen(this,_n.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);if(t!==undefined){if(t instanceof Vn||!t){var i=t;this.setGeometry(i)}else{var s=t;this.setProperties(s)}}};fn.inherits(zf,_n);zf.prototype.clone=function(){var t=new zf(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();if(i){t.setGeometry(i.clone())}var s=this.getStyle();if(s){t.setStyle(s)}return t};zf.prototype.getGeometry=function(){return this.get(this.geometryName_)};zf.prototype.getId=function(){return this.id_};zf.prototype.getGeometryName=function(){return this.geometryName_};zf.prototype.getStyle=function(){return this.style_};zf.prototype.getStyleFunction=function(){return this.styleFunction_};zf.prototype.handleGeometryChange_=function(){this.changed()};zf.prototype.handleGeometryChanged_=function(){if(this.geometryChangeKey_){cn.unlistenByKey(this.geometryChangeKey_);this.geometryChangeKey_=null}var t=this.getGeometry();if(t){this.geometryChangeKey_=cn.listen(t,zn.CHANGE,this.handleGeometryChange_,this)}this.changed()};zf.prototype.setGeometry=function(t){this.set(this.geometryName_,t)};zf.prototype.setStyle=function(t){this.style_=t;this.styleFunction_=!t?undefined:zf.createStyleFunction(t);this.changed()};zf.prototype.setId=function(t){this.id_=t;this.changed()};zf.prototype.setGeometryName=function(t){cn.unlisten(this,_n.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.geometryName_=t;cn.listen(this,_n.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this);this.handleGeometryChanged_()};zf.createStyleFunction=function(t){var i;if(typeof t==="function"){if(t.length==2){i=function(i){return t(this,i)}}else{i=t}}else{var s;if(Array.isArray(t)){s=t}else{bn.assert(t instanceof pf,41);s=[t]}i=function(){return s}}return i};var Mf={};Mf.createOrUpdate=function(t,i,s,e){if(e!==undefined){e[0]=t;e[1]=i;e[2]=s;return e}else{return[t,i,s]}};Mf.getKeyZXY=function(t,i,s){return t+"/"+i+"/"+s};Mf.getKey=function(t){return Mf.getKeyZXY(t[0],t[1],t[2])};Mf.fromKey=function(t){return t.split("/").map(Number)};Mf.hash=function(t){return(t[1]<<t[0])+t[2]};Mf.quadKey=function(t){var i=t[0];var s=new Array(i);var e=1<<i-1;var r,n;for(r=0;r<i;++r){n=48;if(t[1]&e){n+=1}if(t[2]&e){n+=2}s[r]=String.fromCharCode(n);e>>=1}return s.join("")};Mf.withinExtentAndZ=function(t,i){var s=t[0];var e=t[1];var r=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom()){return false}var n=i.getExtent();var h;if(!n){h=i.getFullTileRange(s)}else{h=i.getTileRangeForExtentAndZ(n,s)}if(!h){return true}else{return h.containsXY(e,r)}};var _f={};_f.createFromTemplate=function(t,i){var s=/\{z\}/g;var e=/\{x\}/g;var r=/\{y\}/g;var n=/\{-y\}/g;return function(h,a,o){if(!h){return undefined}else{return t.replace(s,h[0].toString()).replace(e,h[1].toString()).replace(r,(function(){var t=-h[2]-1;return t.toString()})).replace(n,(function(){var t=h[0];var s=i.getFullTileRange(t);bn.assert(s,55);var e=s.getHeight()+h[2];return e.toString()}))}}};_f.createFromTemplates=function(t,i){var s=t.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=_f.createFromTemplate(t[r],i)}return _f.createFromTileUrlFunctions(e)};_f.createFromTileUrlFunctions=function(t){if(t.length===1){return t[0]}return function(i,s,e){if(!i){return undefined}else{var r=Mf.hash(i);var n=xn.modulo(r,t.length);return t[n](i,s,e)}}};_f.nullTileUrlFunction=function(t,i,s){return undefined};_f.expandUrl=function(t){var i=[];var s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var e=s[1].charCodeAt(0);var r=s[2].charCodeAt(0);var n;for(n=e;n<=r;++n){i.push(t.replace(s[0],String.fromCharCode(n)))}return i}s=s=/\{(\d+)-(\d+)\}/.exec(t);if(s){var h=parseInt(s[2],10);for(var a=parseInt(s[1],10);a<=h;a++){i.push(t.replace(s[0],a.toString()))}return i}i.push(t);return i};var gf=function(t,i,s){pn.call(this);var e=s?s:{};this.tileCoord=t;this.state=i;this.interimTile=null;this.key="";this.transition_=e.transition===undefined?250:e.transition;this.transitionStarts_={}};fn.inherits(gf,pn);gf.prototype.changed=function(){this.dispatchEvent(zn.CHANGE)};gf.prototype.getKey=function(){return this.key+"/"+this.tileCoord};gf.prototype.getInterimTile=function(){if(!this.interimTile){return this}var t=this.interimTile;do{if(t.getState()==yh.LOADED){return t}t=t.interimTile}while(t);return this};gf.prototype.refreshInterimChain=function(){if(!this.interimTile){return}var t=this.interimTile;var i=this;do{if(t.getState()==yh.LOADED){t.interimTile=null;break}else if(t.getState()==yh.LOADING){i=t}else if(t.getState()==yh.IDLE){i.interimTile=t.interimTile}else{i=t}t=i.interimTile}while(t)};gf.prototype.getTileCoord=function(){return this.tileCoord};gf.prototype.getState=function(){return this.state};gf.prototype.setState=function(t){this.state=t;this.changed()};gf.prototype.load=function(){};gf.prototype.getAlpha=function(t,i){if(!this.transition_){return 1}var s=this.transitionStarts_[t];if(!s){s=i;this.transitionStarts_[t]=s}else if(s===-1){return 1}var e=i-s+1e3/60;if(e>=this.transition_){return 1}return Rh.easeIn(e/this.transition_)};gf.prototype.inTransition=function(t){if(!this.transition_){return false}return this.transitionStarts_[t]!==-1};gf.prototype.endTransition=function(t){if(this.transition_){this.transitionStarts_[t]=-1}};var bf=function(t,i,s,e,r,n){gf.call(this,t,i,n);this.crossOrigin_=e;this.src_=s;this.image_=new Image;if(e!==null){this.image_.crossOrigin=e}this.imageListenerKeys_=null;this.tileLoadFunction_=r};fn.inherits(bf,gf);bf.prototype.disposeInternal=function(){if(this.state==yh.LOADING){this.unlistenImage_();this.image_=bf.getBlankImage()}if(this.interimTile){this.interimTile.dispose()}this.state=yh.ABORT;this.changed();gf.prototype.disposeInternal.call(this)};bf.prototype.getImage=function(){return this.image_};bf.prototype.getKey=function(){return this.src_};bf.prototype.handleImageError_=function(){this.state=yh.ERROR;this.unlistenImage_();this.image_=bf.getBlankImage();this.changed()};bf.prototype.handleImageLoad_=function(){if(this.image_.naturalWidth&&this.image_.naturalHeight){this.state=yh.LOADED}else{this.state=yh.EMPTY}this.unlistenImage_();this.changed()};bf.prototype.load=function(){if(this.state==yh.ERROR){this.state=yh.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==yh.IDLE){this.state=yh.LOADING;this.changed();this.imageListenerKeys_=[cn.listenOnce(this.image_,zn.ERROR,this.handleImageError_,this),cn.listenOnce(this.image_,zn.LOAD,this.handleImageLoad_,this)];this.tileLoadFunction_(this,this.src_)}};bf.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(cn.unlistenByKey);this.imageListenerKeys_=null};bf.getBlankImage=function(){var t=Lh.createCanvasContext2D(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas};var xf=function(t){ya.call(this,t)};fn.inherits(xf,ya);xf.prototype.expireCache=function(t){var i,s;while(this.canExpireCache()){i=this.peekLast();s=i.tileCoord[0].toString();if(s in t&&t[s].contains(i.tileCoord)){break}else{this.pop().dispose()}}};xf.prototype.pruneExceptNewestZ=function(){if(this.getCount()===0){return}var t=this.peekFirstKey();var i=Mf.fromKey(t);var s=i[0];this.forEach((function(t){if(t.tileCoord[0]!==s){this.remove(Mf.getKey(t.tileCoord));t.dispose()}}),this)};var wf={};wf.calculateSourceResolution=function(t,i,s,e){var r=Wn.transform(s,i,t);var n=Wn.getPointResolution(i,e,s);var h=i.getMetersPerUnit();if(h!==undefined){n*=h}var a=t.getMetersPerUnit();if(a!==undefined){n/=a}var o=t.getExtent();if(!o||Nn.containsCoordinate(o,r)){var f=Wn.getPointResolution(t,n,r)/n;if(isFinite(f)&&f>0){n/=f}}return n};wf.enlargeClipPoint_=function(t,i,s,e){var r=s-t,n=e-i;var h=Math.sqrt(r*r+n*n);return[Math.round(s+r/h),Math.round(e+n/h)]};wf.render=function(t,i,s,e,r,n,h,a,o,f,u){var l=Lh.createCanvasContext2D(Math.round(s*t),Math.round(s*i));if(o.length===0){return l.canvas}l.scale(s,s);var v=Nn.createEmpty();o.forEach((function(t,i,s){Nn.extend(v,t.extent)}));var c=Nn.getWidth(v);var d=Nn.getHeight(v);var m=Lh.createCanvasContext2D(Math.round(s*c/e),Math.round(s*d/e));var p=s/e;o.forEach((function(t,i,s){var e=t.extent[0]-v[0];var r=-(t.extent[3]-v[3]);var n=Nn.getWidth(t.extent);var h=Nn.getHeight(t.extent);m.drawImage(t.image,f,f,t.image.width-2*f,t.image.height-2*f,e*p,r*p,n*p,h*p)}));var z=Nn.getTopLeft(h);a.getTriangles().forEach((function(t,i,r){var h=t.source,a=t.target;var o=h[0][0],f=h[0][1],u=h[1][0],c=h[1][1],d=h[2][0],p=h[2][1];var M=(a[0][0]-z[0])/n,_=-(a[0][1]-z[1])/n;var g=(a[1][0]-z[0])/n,b=-(a[1][1]-z[1])/n;var x=(a[2][0]-z[0])/n,w=-(a[2][1]-z[1])/n;var y=o,k=f;o=0;f=0;u-=y;c-=k;d-=y;p-=k;var E=[[u,c,0,0,g-M],[d,p,0,0,x-M],[0,0,u,c,b-_],[0,0,d,p,w-_]];var C=xn.solveLinearSystem(E);if(!C){return}l.save();l.beginPath();var N=(M+g+x)/3,I=(_+b+w)/3;var S=wf.enlargeClipPoint_(N,I,M,_);var O=wf.enlargeClipPoint_(N,I,g,b);var T=wf.enlargeClipPoint_(N,I,x,w);l.moveTo(O[0],O[1]);l.lineTo(S[0],S[1]);l.lineTo(T[0],T[1]);l.clip();l.transform(C[0],C[2],C[1],C[3],M,_);l.translate(v[0]-y,v[3]-k);l.scale(e/s,-e/s);l.drawImage(m.canvas,0,0);l.restore()}));if(u){l.save();l.strokeStyle="black";l.lineWidth=1;a.getTriangles().forEach((function(t,i,s){var e=t.target;var r=(e[0][0]-z[0])/n,h=-(e[0][1]-z[1])/n;var a=(e[1][0]-z[0])/n,o=-(e[1][1]-z[1])/n;var f=(e[2][0]-z[0])/n,u=-(e[2][1]-z[1])/n;l.beginPath();l.moveTo(a,o);l.lineTo(r,h);l.lineTo(f,u);l.closePath();l.stroke()}));l.restore()}return l.canvas};var yf=function(t,i,s,e,r){this.sourceProj_=t;this.targetProj_=i;var n={};var h=Wn.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];if(!n[i]){n[i]=h(t)}return n[i]};this.maxSourceExtent_=e;this.errorThresholdSquared_=r*r;this.triangles_=[];this.wrapsXInSource_=false;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!e&&!!this.sourceProj_.getExtent()&&Nn.getWidth(e)==Nn.getWidth(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?Nn.getWidth(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?Nn.getWidth(this.targetProj_.getExtent()):null;var a=Nn.getTopLeft(s);var o=Nn.getTopRight(s);var f=Nn.getBottomRight(s);var u=Nn.getBottomLeft(s);var l=this.transformInv_(a);var v=this.transformInv_(o);var c=this.transformInv_(f);var d=this.transformInv_(u);this.addQuad_(a,o,f,u,l,v,c,d,fn.RASTER_REPROJECTION_MAX_SUBDIVISION);if(this.wrapsXInSource_){var m=Infinity;this.triangles_.forEach((function(t,i,s){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])}));this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];if(i[0][0]-m>this.sourceWorldWidth_/2){i[0][0]-=this.sourceWorldWidth_}if(i[1][0]-m>this.sourceWorldWidth_/2){i[1][0]-=this.sourceWorldWidth_}if(i[2][0]-m>this.sourceWorldWidth_/2){i[2][0]-=this.sourceWorldWidth_}var s=Math.min(i[0][0],i[1][0],i[2][0]);var e=Math.max(i[0][0],i[1][0],i[2][0]);if(e-s<this.sourceWorldWidth_/2){t.source=i}}}),this)}n={}};yf.prototype.addTriangle_=function(t,i,s,e,r,n){this.triangles_.push({source:[e,r,n],target:[t,i,s]})};yf.prototype.addQuad_=function(t,i,s,e,r,n,h,a,o){var f=Nn.boundingExtent([r,n,h,a]);var u=this.sourceWorldWidth_?Nn.getWidth(f)/this.sourceWorldWidth_:null;var l=this.sourceWorldWidth_;var v=this.sourceProj_.canWrapX()&&u>.5&&u<1;var c=false;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=Nn.boundingExtent([t,i,s,e]);var m=Nn.getWidth(d)/this.targetWorldWidth_;c|=m>fn.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}if(!v&&this.sourceProj_.isGlobal()&&u){c|=u>fn.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}}if(!c&&this.maxSourceExtent_){if(!Nn.intersects(f,this.maxSourceExtent_)){return}}if(!c){if(!isFinite(r[0])||!isFinite(r[1])||!isFinite(n[0])||!isFinite(n[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(a[0])||!isFinite(a[1])){if(o>0){c=true}else{return}}}if(o>0){if(!c){var p=[(t[0]+s[0])/2,(t[1]+s[1])/2];var z=this.transformInv_(p);var M;if(v){var _=(xn.modulo(r[0],l)+xn.modulo(h[0],l))/2;M=_-xn.modulo(z[0],l)}else{M=(r[0]+h[0])/2-z[0]}var g=(r[1]+h[1])/2-z[1];var b=M*M+g*g;c=b>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var x=[(i[0]+s[0])/2,(i[1]+s[1])/2];var w=this.transformInv_(x);var y=[(e[0]+t[0])/2,(e[1]+t[1])/2];var k=this.transformInv_(y);this.addQuad_(t,i,x,y,r,n,w,k,o-1);this.addQuad_(y,x,s,e,k,w,h,a,o-1)}else{var E=[(t[0]+i[0])/2,(t[1]+i[1])/2];var C=this.transformInv_(E);var N=[(s[0]+e[0])/2,(s[1]+e[1])/2];var I=this.transformInv_(N);this.addQuad_(t,E,N,e,r,C,I,a,o-1);this.addQuad_(E,i,s,N,C,n,h,I,o-1)}return}}if(v){if(!this.canWrapXInSource_){return}this.wrapsXInSource_=true}this.addTriangle_(t,s,e,r,h,a);this.addTriangle_(t,i,s,r,n,h)};yf.prototype.calculateSourceExtent=function(){var t=Nn.createEmpty();this.triangles_.forEach((function(i,s,e){var r=i.source;Nn.extendCoordinate(t,r[0]);Nn.extendCoordinate(t,r[1]);Nn.extendCoordinate(t,r[2])}));return t};yf.prototype.getTriangles=function(){return this.triangles_};var kf=function(t,i,s,e,r,n,h,a,o,f,u){gf.call(this,r,yh.IDLE);this.renderEdges_=u!==undefined?u:false;this.pixelRatio_=h;this.gutter_=a;this.canvas_=null;this.sourceTileGrid_=i;this.targetTileGrid_=e;this.wrappedTileCoord_=n?n:r;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;var l=e.getTileCoordExtent(this.wrappedTileCoord_);var v=this.targetTileGrid_.getExtent();var c=this.sourceTileGrid_.getExtent();var d=v?Nn.getIntersection(l,v):l;if(Nn.getArea(d)===0){this.state=yh.EMPTY;return}var m=t.getExtent();if(m){if(!c){c=m}else{c=Nn.getIntersection(c,m)}}var p=e.getResolution(this.wrappedTileCoord_[0]);var z=Nn.getCenter(d);var M=wf.calculateSourceResolution(t,s,z,p);if(!isFinite(M)||M<=0){this.state=yh.EMPTY;return}var _=f!==undefined?f:fn.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;this.triangulation_=new yf(t,s,d,c,M*_);if(this.triangulation_.getTriangles().length===0){this.state=yh.EMPTY;return}this.sourceZ_=i.getZForResolution(M);var g=this.triangulation_.calculateSourceExtent();if(c){if(t.canWrapX()){g[1]=xn.clamp(g[1],c[1],c[3]);g[3]=xn.clamp(g[3],c[1],c[3])}else{g=Nn.getIntersection(g,c)}}if(!Nn.getArea(g)){this.state=yh.EMPTY}else{var b=i.getTileRangeForExtentAndZ(g,this.sourceZ_);for(var x=b.minX;x<=b.maxX;x++){for(var w=b.minY;w<=b.maxY;w++){var y=o(this.sourceZ_,x,w,h);if(y){this.sourceTiles_.push(y)}}}if(this.sourceTiles_.length===0){this.state=yh.EMPTY}}};fn.inherits(kf,gf);kf.prototype.disposeInternal=function(){if(this.state==yh.LOADING){this.unlistenSources_()}gf.prototype.disposeInternal.call(this)};kf.prototype.getImage=function(){return this.canvas_};kf.prototype.reproject_=function(){var t=[];this.sourceTiles_.forEach((function(i,s,e){if(i&&i.getState()==yh.LOADED){t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}}),this);this.sourceTiles_.length=0;if(t.length===0){this.state=yh.ERROR}else{var i=this.wrappedTileCoord_[0];var s=this.targetTileGrid_.getTileSize(i);var e=typeof s==="number"?s:s[0];var r=typeof s==="number"?s:s[1];var n=this.targetTileGrid_.getResolution(i);var h=this.sourceTileGrid_.getResolution(this.sourceZ_);var a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=wf.render(e,r,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),n,a,this.triangulation_,t,this.gutter_,this.renderEdges_);this.state=yh.LOADED}this.changed()};kf.prototype.load=function(){if(this.state==yh.IDLE){this.state=yh.LOADING;this.changed();var t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((function(i,s,e){var r=i.getState();if(r==yh.IDLE||r==yh.LOADING){t++;var n;n=cn.listen(i,zn.CHANGE,(function(s){var e=i.getState();if(e==yh.LOADED||e==yh.ERROR||e==yh.EMPTY){cn.unlistenByKey(n);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}),this);this.sourcesListenerKeys_.push(n)}}),this);this.sourceTiles_.forEach((function(t,i,s){var e=t.getState();if(e==yh.IDLE){t.load()}}));if(t===0){setTimeout(this.reproject_.bind(this),0)}}};kf.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(cn.unlistenByKey);this.sourcesListenerKeys_=null};var Ef=function(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;bn.assert(kn.isSorted(this.resolutions_,(function(t,i){return i-t}),true),17);var i;if(!t.origins){for(var s=0,e=this.resolutions_.length-1;s<e;++s){if(!i){i=this.resolutions_[s]/this.resolutions_[s+1]}else{if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=undefined;break}}}}this.zoomFactor_=i;this.maxZoom=this.resolutions_.length-1;this.origin_=t.origin!==undefined?t.origin:null;this.origins_=null;if(t.origins!==undefined){this.origins_=t.origins;bn.assert(this.origins_.length==this.resolutions_.length,20)}var r=t.extent;if(r!==undefined&&!this.origin_&&!this.origins_){this.origin_=Nn.getTopLeft(r)}bn.assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18);this.tileSizes_=null;if(t.tileSizes!==undefined){this.tileSizes_=t.tileSizes;bn.assert(this.tileSizes_.length==this.resolutions_.length,19)}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?fn.DEFAULT_TILE_SIZE:null;bn.assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22);this.extent_=r!==undefined?r:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];if(t.sizes!==undefined){this.fullTileRanges_=t.sizes.map((function(t,i){var s=new Fa(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));return s}),this)}else if(r){this.calculateTileRanges_(r)}};Ef.tmpTileCoord_=[0,0,0];Ef.prototype.forEachTileCoord=function(t,i,s){var e=this.getTileRangeForExtentAndZ(t,i);for(var r=e.minX,n=e.maxX;r<=n;++r){for(var h=e.minY,a=e.maxY;h<=a;++h){s([i,r,h])}}};Ef.prototype.forEachTileCoordParentTileRange=function(t,i,s,e,r){var n,h,a;var o=null;var f=t[0]-1;if(this.zoomFactor_===2){h=t[1];a=t[2]}else{o=this.getTileCoordExtent(t,r)}while(f>=this.minZoom){if(this.zoomFactor_===2){h=Math.floor(h/2);a=Math.floor(a/2);n=Fa.createOrUpdate(h,h,a,a,e)}else{n=this.getTileRangeForExtentAndZ(o,f,e)}if(i.call(s,f,n)){return true}--f}return false};Ef.prototype.getExtent=function(){return this.extent_};Ef.prototype.getMaxZoom=function(){return this.maxZoom};Ef.prototype.getMinZoom=function(){return this.minZoom};Ef.prototype.getOrigin=function(t){if(this.origin_){return this.origin_}else{return this.origins_[t]}};Ef.prototype.getResolution=function(t){return this.resolutions_[t]};Ef.prototype.getResolutions=function(){return this.resolutions_};Ef.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){var e=t[1]*2;var r=t[2]*2;return Fa.createOrUpdate(e,e+1,r,r+1,i)}var n=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(n,t[0]+1,i)}return null};Ef.prototype.getTileRangeExtent=function(t,i,s){var e=this.getOrigin(t);var r=this.getResolution(t);var n=Xh.toSize(this.getTileSize(t),this.tmpSize_);var h=e[0]+i.minX*n[0]*r;var a=e[0]+(i.maxX+1)*n[0]*r;var o=e[1]+i.minY*n[1]*r;var f=e[1]+(i.maxY+1)*n[1]*r;return Nn.createOrUpdate(h,o,a,f,s)};Ef.prototype.getTileRangeForExtentAndZ=function(t,i,s){var e=Ef.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,false,e);var r=e[1];var n=e[2];this.getTileCoordForXYAndZ_(t[2],t[3],i,true,e);return Fa.createOrUpdate(r,e[1],n,e[2],s)};Ef.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]);var s=this.getResolution(t[0]);var e=Xh.toSize(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*e[0]*s,i[1]+(t[2]+.5)*e[1]*s]};Ef.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]);var e=this.getResolution(t[0]);var r=Xh.toSize(this.getTileSize(t[0]),this.tmpSize_);var n=s[0]+t[1]*r[0]*e;var h=s[1]+t[2]*r[1]*e;var a=n+r[0]*e;var o=h+r[1]*e;return Nn.createOrUpdate(n,h,a,o,i)};Ef.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,false,s)};Ef.prototype.getTileCoordForXYAndResolution_=function(t,i,s,e,r){var n=this.getZForResolution(s);var h=s/this.getResolution(n);var a=this.getOrigin(n);var o=Xh.toSize(this.getTileSize(n),this.tmpSize_);var f=e?.5:0;var u=e?0:.5;var l=Math.floor((t-a[0])/s+f);var v=Math.floor((i-a[1])/s+u);var c=h*l/o[0];var d=h*v/o[1];if(e){c=Math.ceil(c)-1;d=Math.ceil(d)-1}else{c=Math.floor(c);d=Math.floor(d)}return Mf.createOrUpdate(n,c,d,r)};Ef.prototype.getTileCoordForXYAndZ_=function(t,i,s,e,r){var n=this.getOrigin(s);var h=this.getResolution(s);var a=Xh.toSize(this.getTileSize(s),this.tmpSize_);var o=e?.5:0;var f=e?0:.5;var u=Math.floor((t-n[0])/h+o);var l=Math.floor((i-n[1])/h+f);var v=u/a[0];var c=l/a[1];if(e){v=Math.ceil(v)-1;c=Math.ceil(c)-1}else{v=Math.floor(v);c=Math.floor(c)}return Mf.createOrUpdate(s,v,c,r)};Ef.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,false,s)};Ef.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]};Ef.prototype.getTileSize=function(t){if(this.tileSize_){return this.tileSize_}else{return this.tileSizes_[t]}};Ef.prototype.getFullTileRange=function(t){if(!this.fullTileRanges_){return null}else{return this.fullTileRanges_[t]}};Ef.prototype.getZForResolution=function(t,i){var s=kn.linearFindNearest(this.resolutions_,t,i||0);return xn.clamp(s,this.minZoom,this.maxZoom)};Ef.prototype.calculateTileRanges_=function(t){var i=this.resolutions_.length;var s=new Array(i);for(var e=this.minZoom;e<i;++e){s[e]=this.getTileRangeForExtentAndZ(t,e)}this.fullTileRanges_=s};var Cf={};Cf.getForProjection=function(t){var i=t.getDefaultTileGrid();if(!i){i=Cf.createForProjection(t);t.setDefaultTileGrid(i)}return i};Cf.wrapX=function(t,i,s){var e=i[0];var r=t.getTileCoordCenter(i);var n=Cf.extentFromProjection(s);if(!Nn.containsCoordinate(n,r)){var h=Nn.getWidth(n);var a=Math.ceil((n[0]-r[0])/h);r[0]+=h*a;return t.getTileCoordForCoordAndZ(r,e)}else{return i}};Cf.createForExtent=function(t,i,s,e){var r=e!==undefined?e:En.TOP_LEFT;var n=Cf.resolutionsFromExtent(t,i,s);return new Ef({extent:t,origin:Nn.getCorner(t,r),resolutions:n,tileSize:s})};Cf.createXYZ=function(t){var i={};vn.assign(i,t!==undefined?t:{});if(i.extent===undefined){i.extent=Wn.get("EPSG:3857").getExtent()}i.resolutions=Cf.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize);delete i.maxZoom;return new Ef(i)};Cf.resolutionsFromExtent=function(t,i,s){var e=i!==undefined?i:fn.DEFAULT_MAX_ZOOM;var r=Nn.getHeight(t);var n=Nn.getWidth(t);var h=Xh.toSize(s!==undefined?s:fn.DEFAULT_TILE_SIZE);var a=Math.max(n/h[0],r/h[1]);var o=e+1;var f=new Array(o);for(var u=0;u<o;++u){f[u]=a/Math.pow(2,u)}return f};Cf.createForProjection=function(t,i,s,e){var r=Cf.extentFromProjection(t);return Cf.createForExtent(r,i,s,e)};Cf.extentFromProjection=function(t){t=Wn.get(t);var i=t.getExtent();if(!i){var s=180*Wn.METERS_PER_UNIT[Tn.DEGREES]/t.getMetersPerUnit();i=Nn.createOrUpdate(-s,-s,s,s)}return i};var Nf=function(t){this.html_=t.html;this.tileRanges_=t.tileRanges?t.tileRanges:null};Nf.prototype.getHTML=function(){return this.html_};Nf.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_){return true}var e,r,n,h;for(h in t){if(!(h in this.tileRanges_)){continue}n=t[h];var a;for(e=0,r=this.tileRanges_[h].length;e<r;++e){a=this.tileRanges_[h][e];if(a.intersects(n)){return true}var o=i.getTileRangeForExtentAndZ(Cf.extentFromProjection(s),parseInt(h,10));var f=o.getWidth();if(n.minX<o.minX||n.maxX>o.maxX){if(a.intersects(new Fa(xn.modulo(n.minX,f),xn.modulo(n.maxX,f),n.minY,n.maxY))){return true}if(n.getWidth()>f&&a.intersects(o)){return true}}}}return false};var If=function(t){_n.call(this);this.projection_=Wn.get(t.projection);this.attributions_=null;this.attributions2_=this.adaptAttributions_(t.attributions);this.logo_=t.logo;this.state_=t.state!==undefined?t.state:Wh.READY;this.wrapX_=t.wrapX!==undefined?t.wrapX:false};fn.inherits(If,_n);If.prototype.adaptAttributions_=function(t){if(!t){return null}if(t instanceof Nf){this.attributions_=[t];return function(i){return[t.getHTML()]}}if(Array.isArray(t)){if(t[0]instanceof Nf){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(t){return i}}this.attributions_=t.map((function(t){return new Nf({html:t})}));return function(i){return t}}if(typeof t==="function"){return t}this.attributions_=[new Nf({html:t})];return function(i){return[t]}};If.prototype.forEachFeatureAtCoordinate=fn.nullFunction;If.prototype.getAttributions=function(){return this.attributions_};If.prototype.getAttributions2=function(){return this.attributions2_};If.prototype.getLogo=function(){return this.logo_};If.prototype.getProjection=function(){return this.projection_};If.prototype.getResolutions=function(){};If.prototype.getState=function(){return this.state_};If.prototype.getWrapX=function(){return this.wrapX_};If.prototype.refresh=function(){this.changed()};If.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t);this.changed()};If.prototype.setLogo=function(t){this.logo_=t};If.prototype.setState=function(t){this.state_=t;this.changed()};var Sf=function(t){If.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX});this.opaque_=t.opaque!==undefined?t.opaque:false;this.tilePixelRatio_=t.tilePixelRatio!==undefined?t.tilePixelRatio:1;this.tileGrid=t.tileGrid!==undefined?t.tileGrid:null;this.tileCache=new xf(t.cacheSize);this.tmpSize=[0,0];this.key_="";this.tileOptions={transition:t.transition}};fn.inherits(Sf,If);Sf.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()};Sf.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);if(s){s.expireCache(i)}};Sf.prototype.forEachLoadedTile=function(t,i,s,e){var r=this.getTileCacheForProjection(t);if(!r){return false}var n=true;var h,a,o;for(var f=s.minX;f<=s.maxX;++f){for(var u=s.minY;u<=s.maxY;++u){a=Mf.getKeyZXY(i,f,u);o=false;if(r.containsKey(a)){h=r.get(a);o=h.getState()===yh.LOADED;if(o){o=e(h)!==false}}if(!o){n=false}}}return n};Sf.prototype.getGutter=function(t){return 0};Sf.prototype.getKey=function(){return this.key_};Sf.prototype.setKey=function(t){if(this.key_!==t){this.key_=t;this.changed()}};Sf.prototype.getOpaque=function(t){return this.opaque_};Sf.prototype.getResolutions=function(){return this.tileGrid.getResolutions()};Sf.prototype.getTile=function(t,i,s,e,r){};Sf.prototype.getTileGrid=function(){return this.tileGrid};Sf.prototype.getTileGridForProjection=function(t){if(!this.tileGrid){return Cf.getForProjection(t)}else{return this.tileGrid}};Sf.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();if(i&&!Wn.equivalent(i,t)){return null}else{return this.tileCache}};Sf.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_};Sf.prototype.getTilePixelSize=function(t,i,s){var e=this.getTileGridForProjection(s);var r=this.getTilePixelRatio(i);var n=Xh.toSize(e.getTileSize(t),this.tmpSize);if(r==1){return n}else{return Xh.scale(n,r,this.tmpSize)}};Sf.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=i!==undefined?i:this.getProjection();var e=this.getTileGridForProjection(s);if(this.getWrapX()&&s.isGlobal()){t=Cf.wrapX(e,t,s)}return Mf.withinExtentAndZ(t,e)?t:null};Sf.prototype.refresh=function(){this.tileCache.clear();this.changed()};Sf.prototype.useTile=fn.nullFunction;Sf.Event=function(t,i){mn.call(this,t);this.tile=i};fn.inherits(Sf.Event,mn);var Of={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var Tf=function(t){Sf.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition});this.tileLoadFunction=t.tileLoadFunction;this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.nullTileUrlFunction;this.urls=null;if(t.urls){this.setUrls(t.urls)}else if(t.url){this.setUrl(t.url)}if(t.tileUrlFunction){this.setTileUrlFunction(t.tileUrlFunction)}this.tileLoadingKeys_={}};fn.inherits(Tf,Sf);Tf.prototype.getTileLoadFunction=function(){return this.tileLoadFunction};Tf.prototype.getTileUrlFunction=function(){return this.tileUrlFunction};Tf.prototype.getUrls=function(){return this.urls};Tf.prototype.handleTileChange=function(t){var i=t.target;var s=fn.getUid(i);var e=i.getState();var r;if(e==yh.LOADING){this.tileLoadingKeys_[s]=true;r=Of.TILELOADSTART}else if(s in this.tileLoadingKeys_){delete this.tileLoadingKeys_[s];r=e==yh.ERROR?Of.TILELOADERROR:e==yh.LOADED||e==yh.ABORT?Of.TILELOADEND:undefined}if(r!=undefined){this.dispatchEvent(new Sf.Event(r,i))}};Tf.prototype.setTileLoadFunction=function(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()};Tf.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();if(typeof i!=="undefined"){this.setKey(i)}else{this.changed()}};Tf.prototype.setUrl=function(t){var i=this.urls=_f.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.createFromTemplates(i,this.tileGrid),t)};Tf.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.createFromTemplates(t,this.tileGrid),i)};Tf.prototype.useTile=function(t,i,s){var e=Mf.getKeyZXY(t,i,s);if(this.tileCache.containsKey(e)){this.tileCache.get(e)}};var Af=function(t){Tf.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Af.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition});this.crossOrigin=t.crossOrigin!==undefined?t.crossOrigin:null;this.tileClass=t.tileClass!==undefined?t.tileClass:bf;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=false};fn.inherits(Af,Tf);Af.prototype.canExpireCache=function(){if(!fn.ENABLE_RASTER_REPROJECTION){return Tf.prototype.canExpireCache.call(this)}if(this.tileCache.canExpireCache()){return true}else{for(var t in this.tileCacheForProjection){if(this.tileCacheForProjection[t].canExpireCache()){return true}}}return false};Af.prototype.expireCache=function(t,i){if(!fn.ENABLE_RASTER_REPROJECTION){Tf.prototype.expireCache.call(this,t,i);return}var s=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==s?i:{});for(var e in this.tileCacheForProjection){var r=this.tileCacheForProjection[e];r.expireCache(r==s?i:{})}};Af.prototype.getGutter=function(t){if(fn.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Wn.equivalent(this.getProjection(),t)){return 0}else{return this.getGutterInternal()}};Af.prototype.getGutterInternal=function(){return 0};Af.prototype.getOpaque=function(t){if(fn.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Wn.equivalent(this.getProjection(),t)){return false}else{return Tf.prototype.getOpaque.call(this,t)}};Af.prototype.getTileGridForProjection=function(t){if(!fn.ENABLE_RASTER_REPROJECTION){return Tf.prototype.getTileGridForProjection.call(this,t)}var i=this.getProjection();if(this.tileGrid&&(!i||Wn.equivalent(i,t))){return this.tileGrid}else{var s=fn.getUid(t).toString();if(!(s in this.tileGridForProjection)){this.tileGridForProjection[s]=Cf.getForProjection(t)}return this.tileGridForProjection[s]}};Af.prototype.getTileCacheForProjection=function(t){if(!fn.ENABLE_RASTER_REPROJECTION){return Tf.prototype.getTileCacheForProjection.call(this,t)}var i=this.getProjection();if(!i||Wn.equivalent(i,t)){return this.tileCache}else{var s=fn.getUid(t).toString();if(!(s in this.tileCacheForProjection)){this.tileCacheForProjection[s]=new xf(this.tileCache.highWaterMark)}return this.tileCacheForProjection[s]}};Af.prototype.createTile_=function(t,i,s,e,r,n){var h=[t,i,s];var a=this.getTileCoordForTileUrlFunction(h,r);var o=a?this.tileUrlFunction(a,e,r):undefined;var f=new this.tileClass(h,o!==undefined?yh.IDLE:yh.EMPTY,o!==undefined?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);f.key=n;cn.listen(f,zn.CHANGE,this.handleTileChange,this);return f};Af.prototype.getTile=function(t,i,s,e,r){var n=this.getProjection();if(!fn.ENABLE_RASTER_REPROJECTION||!n||!r||Wn.equivalent(n,r)){return this.getTileInternal(t,i,s,e,n||r)}else{var h=this.getTileCacheForProjection(r);var a=[t,i,s];var o;var f=Mf.getKey(a);if(h.containsKey(f)){o=h.get(f)}var u=this.getKey();if(o&&o.key==u){return o}else{var l=this.getTileGridForProjection(n);var v=this.getTileGridForProjection(r);var c=this.getTileCoordForTileUrlFunction(a,r);var d=new kf(n,l,r,v,a,c,this.getTilePixelRatio(e),this.getGutterInternal(),function(t,i,s,e){return this.getTileInternal(t,i,s,e,n)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);d.key=u;if(o){d.interimTile=o;d.refreshInterimChain();h.replace(f,d)}else{h.set(f,d)}return d}}};Af.prototype.getTileInternal=function(t,i,s,e,r){var n=null;var h=Mf.getKeyZXY(t,i,s);var a=this.getKey();if(!this.tileCache.containsKey(h)){n=this.createTile_(t,i,s,e,r,a);this.tileCache.set(h,n)}else{n=this.tileCache.get(h);if(n.key!=a){var o=n;n=this.createTile_(t,i,s,e,r,a);if(o.getState()==yh.IDLE){n.interimTile=o.interimTile}else{n.interimTile=o}n.refreshInterimChain();this.tileCache.replace(h,n)}}return n};Af.prototype.setRenderReprojectionEdges=function(t){if(!fn.ENABLE_RASTER_REPROJECTION||this.renderReprojectionEdges_==t){return}this.renderReprojectionEdges_=t;for(var i in this.tileCacheForProjection){this.tileCacheForProjection[i].clear()}this.changed()};Af.prototype.setTileGridForProjection=function(t,i){if(fn.ENABLE_RASTER_REPROJECTION){var s=Wn.get(t);if(s){var e=fn.getUid(s).toString();if(!(e in this.tileGridForProjection)){this.tileGridForProjection[e]=i}}}};Af.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var Rf={KVP:"KVP",REST:"REST"};var Pf=function(t){this.matrixIds_=t.matrixIds;Ef.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};fn.inherits(Pf,Ef);Pf.prototype.getMatrixId=function(t){return this.matrixIds_[t]};Pf.prototype.getMatrixIds=function(){return this.matrixIds_};Pf.createFromCapabilitiesMatrixSet=function(t,i,s){var e=[];var r=[];var n=[];var h=[];var a=[];var o=s!==undefined?s:[];var f="SupportedCRS";var u="TileMatrix";var l="Identifier";var v="ScaleDenominator";var c="TopLeftCorner";var d="TileWidth";var m="TileHeight";var p=t[f];var z=Wn.get(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Wn.get(p);var M=z.getMetersPerUnit();var _=z.getAxisOrientation().substr(0,2)=="ne";t[u].sort((function(t,i){return i[v]-t[v]}));t[u].forEach((function(t,i,s){var f;if(o.length>0){f=kn.find(o,(function(i,s,e){return t[l]==i[u]}))}else{f=true}if(f){r.push(t[l]);var p=t[v]*28e-5/M;var z=t[d];var g=t[m];if(_){n.push([t[c][1],t[c][0]])}else{n.push(t[c])}e.push(p);h.push(z==g?z:[z,g]);a.push([t["MatrixWidth"],-t["MatrixHeight"]])}}));return new Pf({extent:i,origins:n,resolutions:e,matrixIds:r,tileSizes:h,sizes:a})};var Lf={};Lf.appendParams=function(t,i){var s=[];Object.keys(i).forEach((function(t){if(i[t]!==null&&i[t]!==undefined){s.push(t+"="+encodeURIComponent(i[t]))}}));var e=s.join("&");t=t.replace(/[?&]$/,"");t=t.indexOf("?")===-1?t+"?":t+"&";return t+e};var Df=function(t){this.version_=t.version!==undefined?t.version:"1.0.0";this.format_=t.format!==undefined?t.format:"image/jpeg";this.dimensions_=t.dimensions!==undefined?t.dimensions:{};this.layer_=t.layer;this.matrixSet_=t.matrixSet;this.style_=t.style;var i=t.urls;if(i===undefined&&t.url!==undefined){i=_f.expandUrl(t.url)}this.requestEncoding_=t.requestEncoding!==undefined?t.requestEncoding:Rf.KVP;var s=this.requestEncoding_;var e=t.tileGrid;var r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};if(s==Rf.KVP){vn.assign(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_})}var n=this.dimensions_;this.createFromWMTSTemplate_=function(t){t=s==Rf.KVP?Lf.appendParams(t,r):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in r?r[i.toLowerCase()]:t}));return function(i,r,h){if(!i){return undefined}else{var a={TileMatrix:e.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};vn.assign(a,n);var o=t;if(s==Rf.KVP){o=Lf.appendParams(o,a)}else{o=o.replace(/\{(\w+?)\}/g,(function(t,i){return a[i]}))}return o}}};var h=i&&i.length>0?_f.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):_f.nullTileUrlFunction;Af.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:e,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:h,urls:i,wrapX:t.wrapX!==undefined?t.wrapX:false,transition:t.transition});this.setKey(this.getKeyForDimensions_())};fn.inherits(Df,Af);Df.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_f.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)};Df.prototype.getDimensions=function(){return this.dimensions_};Df.prototype.getFormat=function(){return this.format_};Df.prototype.getLayer=function(){return this.layer_};Df.prototype.getMatrixSet=function(){return this.matrixSet_};Df.prototype.getRequestEncoding=function(){return this.requestEncoding_};Df.prototype.getStyle=function(){return this.style_};Df.prototype.getVersion=function(){return this.version_};Df.prototype.getKeyForDimensions_=function(){var t=0;var i=[];for(var s in this.dimensions_){i[t++]=s+"-"+this.dimensions_[s]}return i.join("/")};Df.prototype.updateDimensions=function(t){vn.assign(this.dimensions_,t);this.setKey(this.getKeyForDimensions_())};Df.optionsFromCapabilities=function(t,i){var s=t["Contents"]["Layer"];var e=kn.find(s,(function(t,s,e){return t["Identifier"]==i["layer"]}));if(e===null){return null}var r=t["Contents"]["TileMatrixSet"];var n,h,a;if(e["TileMatrixSetLink"].length>1){if("projection"in i){n=kn.findIndex(e["TileMatrixSetLink"],(function(t,s,e){var n=kn.find(r,(function(i){return i["Identifier"]==t["TileMatrixSet"]}));var h=n["SupportedCRS"];var a=Wn.get(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Wn.get(h);var o=Wn.get(i["projection"]);if(a&&o){return Wn.equivalent(a,o)}else{return h==i["projection"]}}))}else{n=kn.findIndex(e["TileMatrixSetLink"],(function(t,s,e){return t["TileMatrixSet"]==i["matrixSet"]}))}}else{n=0}if(n<0){n=0}h=e["TileMatrixSetLink"][n]["TileMatrixSet"];a=e["TileMatrixSetLink"][n]["TileMatrixSetLimits"];var o=e["Format"][0];if("format"in i){o=i["format"]}n=kn.findIndex(e["Style"],(function(t,s,e){if("style"in i){return t["Title"]==i["style"]}else{return t["isDefault"]}}));if(n<0){n=0}var f=e["Style"][n]["Identifier"];var u={};if("Dimension"in e){e["Dimension"].forEach((function(t,i,s){var e=t["Identifier"];var r=t["Default"];if(r===undefined){r=t["Value"][0]}u[e]=r}))}var l=t["Contents"]["TileMatrixSet"];var v=kn.find(l,(function(t,i,s){return t["Identifier"]==h}));var c;var d=v["SupportedCRS"];if(d){c=Wn.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Wn.get(d)}if("projection"in i){var m=Wn.get(i["projection"]);if(m){if(!c||Wn.equivalent(m,c)){c=m}}}var p=e["WGS84BoundingBox"];var z,M;if(p!==undefined){var _=Wn.get("EPSG:4326").getExtent();M=p[0]==_[0]&&p[2]==_[2];z=Wn.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();if(g){if(!Nn.containsExtent(g,z)){z=undefined}}}var b=Pf.createFromCapabilitiesMatrixSet(v,z,a);var x=[];var w=i["requestEncoding"];w=w!==undefined?w:"";if("OperationsMetadata"in t&&"GetTile"in t["OperationsMetadata"]){var y=t["OperationsMetadata"]["GetTile"]["DCP"]["HTTP"]["Get"];for(var k=0,E=y.length;k<E;++k){if(y[k]["Constraint"]){var C=kn.find(y[k]["Constraint"],(function(t){return t["name"]=="GetEncoding"}));var N=C["AllowedValues"]["Value"];if(w===""){w=N[0]}if(w===Rf.KVP){if(kn.includes(N,Rf.KVP)){x.push(y[k]["href"])}}else{break}}else if(y[k]["href"]){w=Rf.KVP;x.push(y[k]["href"])}}}if(x.length===0){w=Rf.REST;e["ResourceURL"].forEach((function(t){if(t["resourceType"]==="tile"){o=t["format"];x.push(t["template"])}}))}return{urls:x,layer:i["layer"],matrixSet:h,format:o,projection:c,requestEncoding:w,tileGrid:b,style:f,dimensions:u,wrapX:M,crossOrigin:i["crossOrigin"]}};var Ff={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var Wf={};Wf.DOCUMENT=document.implementation.createDocument("","",null);Wf.createElementNS=function(t,i){return Wf.DOCUMENT.createElementNS(t,i)};Wf.getAllTextContent=function(t,i){return Wf.getAllTextContent_(t,i,[]).join("")};Wf.getAllTextContent_=function(t,i,s){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE){if(i){s.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""))}else{s.push(t.nodeValue)}}else{var e;for(e=t.firstChild;e;e=e.nextSibling){Wf.getAllTextContent_(e,i,s)}}return s};Wf.isDocument=function(t){return t instanceof Document};Wf.isNode=function(t){return t instanceof Node};Wf.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""};Wf.setAttributeNS=function(t,i,s,e){t.setAttributeNS(i,s,e)};Wf.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")};Wf.makeArrayExtender=function(t,i){return function(s,e){var r=t.call(i,s,e);if(r!==undefined){var n=e[e.length-1];kn.extend(n,r)}}};Wf.makeArrayPusher=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){var n=e[e.length-1];n.push(r)}}};Wf.makeReplacer=function(t,i){return function(s,e){var r=t.call(i!==undefined?i:this,s,e);if(r!==undefined){e[e.length-1]=r}}};Wf.makeObjectPropertyPusher=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;var o;if(a in h){o=h[a]}else{o=h[a]=[]}o.push(n)}}};Wf.makeObjectPropertySetter=function(t,i,s){return function(e,r){var n=t.call(s!==undefined?s:this,e,r);if(n!==undefined){var h=r[r.length-1];var a=i!==undefined?i:e.localName;h[a]=n}}};Wf.makeChildAppender=function(t,i){return function(s,e,r){t.call(i!==undefined?i:this,s,e,r);var n=r[r.length-1];var h=n.node;h.appendChild(s)}};Wf.makeArraySerializer=function(t,i){var s,e;return function(i,r,n){if(s===undefined){s={};var h={};h[i.localName]=t;s[i.namespaceURI]=h;e=Wf.makeSimpleNodeFactory(i.localName)}Wf.serialize(s,e,r,n)}};Wf.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,e,r){var n=e[e.length-1];var h=n.node;var a=s;if(a===undefined){a=r}var o=i;if(i===undefined){o=h.namespaceURI}return Wf.createElementNS(o,a)}};Wf.OBJECT_PROPERTY_NODE_FACTORY=Wf.makeSimpleNodeFactory();Wf.makeSequence=function(t,i){var s=i.length;var e=new Array(s);for(var r=0;r<s;++r){e[r]=t[i[r]]}return e};Wf.makeStructureNS=function(t,i,s){var e=s!==undefined?s:{};var r,n;for(r=0,n=t.length;r<n;++r){e[t[r]]=i}return e};Wf.parseNode=function(t,i,s,e){var r;for(r=i.firstElementChild;r;r=r.nextElementSibling){var n=t[r.namespaceURI];if(n!==undefined){var h=n[r.localName];if(h!==undefined){h.call(e,r,s)}}}};Wf.pushParseAndPop=function(t,i,s,e,r){e.push(t);Wf.parseNode(i,s,e,r);return e.pop()};Wf.serialize=function(t,i,s,e,r,n){var h=(r!==undefined?r:s).length;var a,o;for(var f=0;f<h;++f){a=s[f];if(a!==undefined){o=i.call(n,a,e,r!==undefined?r[f]:undefined);if(o!==undefined){t[o.namespaceURI][o.localName].call(n,o,a,e)}}}};Wf.pushSerializeAndPop=function(t,i,s,e,r,n,h){r.push(t);Wf.serialize(i,s,e,r,n,h);return r.pop()};var Gf={};Gf.loadFeaturesXhr=function(t,i,s,e){return function(r,n,h){var a=new XMLHttpRequest;a.open("GET",typeof t==="function"?t(r,n,h):t,true);if(i.getType()==Ff.ARRAY_BUFFER){a.responseType="arraybuffer"}a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=i.getType();var n;if(r==Ff.JSON||r==Ff.TEXT){n=a.responseText}else if(r==Ff.XML){n=a.responseXML;if(!n){n=Wf.parse(a.responseText)}}else if(r==Ff.ARRAY_BUFFER){n=a.response}if(n){s.call(this,i.readFeatures(n,{featureProjection:h}),i.readProjection(n),i.getLastExtent())}else{e.call(this)}}else{e.call(this)}}.bind(this);a.onerror=function(){e.call(this)}.bind(this);a.send()}};Gf.xhr=function(t,i){return Gf.loadFeaturesXhr(t,i,(function(t,i){this.addFeatures(t)}),fn.nullFunction)};var Vf={};Vf.all=function(t,i){return[[-Infinity,-Infinity,Infinity,Infinity]]};Vf.bbox=function(t,i){return[t]};Vf.tile=function(t){return function(i,s){var e=t.getZForResolution(s);var r=t.getTileRangeForExtentAndZ(i,e);var n=[];var h=[e,0,0];for(h[1]=r.minX;h[1]<=r.maxX;++h[1]){for(h[2]=r.minY;h[2]<=r.maxY;++h[2]){n.push(t.getTileCoordExtent(h))}}return n}};var jf={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};var Uf=function(t){var i=t||{};If.call(this,{attributions:i.attributions,logo:i.logo,projection:undefined,state:Wh.READY,wrapX:i.wrapX!==undefined?i.wrapX:true});this.loader_=fn.nullFunction;this.format_=i.format;this.overlaps_=i.overlaps==undefined?true:i.overlaps;this.url_=i.url;if(i.loader!==undefined){this.loader_=i.loader}else if(this.url_!==undefined){bn.assert(this.format_,7);this.loader_=Gf.xhr(this.url_,this.format_)}this.strategy_=i.strategy!==undefined?i.strategy:Vf.all;var s=i.useSpatialIndex!==undefined?i.useSpatialIndex:true;this.featuresRtree_=s?new Yo:null;this.loadedExtentsRtree_=new Yo;this.nullGeometryFeatures_={};this.idIndex_={};this.undefIdIndex_={};this.featureChangeKeys_={};this.featuresCollection_=null;var e,r;if(i.features instanceof oh){e=i.features;r=e.getArray()}else if(Array.isArray(i.features)){r=i.features}if(!s&&e===undefined){e=new oh(r)}if(r!==undefined){this.addFeaturesInternal(r)}if(e!==undefined){this.bindFeaturesCollection_(e)}};fn.inherits(Uf,If);Uf.prototype.addFeature=function(t){this.addFeatureInternal(t);this.changed()};Uf.prototype.addFeatureInternal=function(t){var i=fn.getUid(t).toString();if(!this.addToIndex_(i,t)){return}this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var e=s.getExtent();if(this.featuresRtree_){this.featuresRtree_.insert(e,t)}}else{this.nullGeometryFeatures_[i]=t}this.dispatchEvent(new Uf.Event(jf.ADDFEATURE,t))};Uf.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[cn.listen(i,zn.CHANGE,this.handleFeatureChange_,this),cn.listen(i,ln.PROPERTYCHANGE,this.handleFeatureChange_,this)]};Uf.prototype.addToIndex_=function(t,i){var s=true;var e=i.getId();if(e!==undefined){if(!(e.toString()in this.idIndex_)){this.idIndex_[e.toString()]=i}else{s=false}}else{bn.assert(!(t in this.undefIdIndex_),30);this.undefIdIndex_[t]=i}return s};Uf.prototype.addFeatures=function(t){this.addFeaturesInternal(t);this.changed()};Uf.prototype.addFeaturesInternal=function(t){var i,s,e,r;var n=[];var h=[];var a=[];for(s=0,e=t.length;s<e;s++){r=t[s];i=fn.getUid(r).toString();if(this.addToIndex_(i,r)){h.push(r)}}for(s=0,e=h.length;s<e;s++){r=h[s];i=fn.getUid(r).toString();this.setupChangeEvents_(i,r);var o=r.getGeometry();if(o){var f=o.getExtent();n.push(f);a.push(r)}else{this.nullGeometryFeatures_[i]=r}}if(this.featuresRtree_){this.featuresRtree_.load(n,a)}for(s=0,e=h.length;s<e;s++){this.dispatchEvent(new Uf.Event(jf.ADDFEATURE,h[s]))}};Uf.prototype.bindFeaturesCollection_=function(t){var i=false;cn.listen(this,jf.ADDFEATURE,(function(s){if(!i){i=true;t.push(s.feature);i=false}}));cn.listen(this,jf.REMOVEFEATURE,(function(s){if(!i){i=true;t.remove(s.feature);i=false}}));cn.listen(t,ah.ADD,(function(t){if(!i){i=true;this.addFeature(t.element);i=false}}),this);cn.listen(t,ah.REMOVE,(function(t){if(!i){i=true;this.removeFeature(t.element);i=false}}),this);this.featuresCollection_=t};Uf.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_){var s=this.featureChangeKeys_[i];s.forEach(cn.unlistenByKey)}if(!this.featuresCollection_){this.featureChangeKeys_={};this.idIndex_={};this.undefIdIndex_={}}}else{if(this.featuresRtree_){this.featuresRtree_.forEach(this.removeFeatureInternal,this);for(var e in this.nullGeometryFeatures_){this.removeFeatureInternal(this.nullGeometryFeatures_[e])}}}if(this.featuresCollection_){this.featuresCollection_.clear()}if(this.featuresRtree_){this.featuresRtree_.clear()}this.loadedExtentsRtree_.clear();this.nullGeometryFeatures_={};var r=new Uf.Event(jf.CLEAR);this.dispatchEvent(r);this.changed()};Uf.prototype.forEachFeature=function(t,i){if(this.featuresRtree_){return this.featuresRtree_.forEach(t,i)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(t,i)}};Uf.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){var e=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(e,(function(e){var r=e.getGeometry();if(r.intersectsCoordinate(t)){return i.call(s,e)}else{return undefined}}))};Uf.prototype.forEachFeatureInExtent=function(t,i,s){if(this.featuresRtree_){return this.featuresRtree_.forEachInExtent(t,i,s)}else if(this.featuresCollection_){return this.featuresCollection_.forEach(i,s)}};Uf.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(e){var r=e.getGeometry();if(r.intersectsExtent(t)){var n=i.call(s,e);if(n){return n}}}))};Uf.prototype.getFeaturesCollection=function(){return this.featuresCollection_};Uf.prototype.getFeatures=function(){var t;if(this.featuresCollection_){t=this.featuresCollection_.getArray()}else if(this.featuresRtree_){t=this.featuresRtree_.getAll();if(!vn.isEmpty(this.nullGeometryFeatures_)){kn.extend(t,vn.getValues(this.nullGeometryFeatures_))}}return t};Uf.prototype.getFeaturesAtCoordinate=function(t){var i=[];this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)}));return i};Uf.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)};Uf.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0];var e=t[1];var r=null;var n=[NaN,NaN];var h=Infinity;var a=[-Infinity,-Infinity,Infinity,Infinity];var o=i?i:Sn.TRUE;this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry();var f=h;h=i.closestPointXY(s,e,n,h);if(h<f){r=t;var u=Math.sqrt(h);a[0]=s-u;a[1]=e-u;a[2]=s+u;a[3]=e+u}}}));return r};Uf.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)};Uf.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return i!==undefined?i:null};Uf.prototype.getFormat=function(){return this.format_};Uf.prototype.getOverlaps=function(){return this.overlaps_};Uf.prototype.getResolutions=function(){};Uf.prototype.getUrl=function(){return this.url_};Uf.prototype.handleFeatureChange_=function(t){var i=t.target;var s=fn.getUid(i).toString();var e=i.getGeometry();if(!e){if(!(s in this.nullGeometryFeatures_)){if(this.featuresRtree_){this.featuresRtree_.remove(i)}this.nullGeometryFeatures_[s]=i}}else{var r=e.getExtent();if(s in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[s];if(this.featuresRtree_){this.featuresRtree_.insert(r,i)}}else{if(this.featuresRtree_){this.featuresRtree_.update(r,i)}}}var n=i.getId();if(n!==undefined){var h=n.toString();if(s in this.undefIdIndex_){delete this.undefIdIndex_[s];this.idIndex_[h]=i}else{if(this.idIndex_[h]!==i){this.removeFromIdIndex_(i);this.idIndex_[h]=i}}}else{if(!(s in this.undefIdIndex_)){this.removeFromIdIndex_(i);this.undefIdIndex_[s]=i}}this.changed();this.dispatchEvent(new Uf.Event(jf.CHANGEFEATURE,i))};Uf.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&vn.isEmpty(this.nullGeometryFeatures_)};Uf.prototype.loadFeatures=function(t,i,s){var e=this.loadedExtentsRtree_;var r=this.strategy_(t,i);var n,h;for(n=0,h=r.length;n<h;++n){var a=r[n];var o=e.forEachInExtent(a,(function(t){return Nn.containsExtent(t.extent,a)}));if(!o){this.loader_.call(this,a,i,s);e.insert(a,{extent:a.slice()})}}};Uf.prototype.removeLoadedExtent=function(t){var i=this.loadedExtentsRtree_;var s;i.forEachInExtent(t,(function(i){if(Nn.equals(i.extent,t)){s=i;return true}}));if(s){i.remove(s)}};Uf.prototype.removeFeature=function(t){var i=fn.getUid(t).toString();if(i in this.nullGeometryFeatures_){delete this.nullGeometryFeatures_[i]}else{if(this.featuresRtree_){this.featuresRtree_.remove(t)}}this.removeFeatureInternal(t);this.changed()};Uf.prototype.removeFeatureInternal=function(t){var i=fn.getUid(t).toString();this.featureChangeKeys_[i].forEach(cn.unlistenByKey);delete this.featureChangeKeys_[i];var s=t.getId();if(s!==undefined){delete this.idIndex_[s.toString()]}else{delete this.undefIdIndex_[i]}this.dispatchEvent(new Uf.Event(jf.REMOVEFEATURE,t))};Uf.prototype.removeFromIdIndex_=function(t){var i=false;for(var s in this.idIndex_){if(this.idIndex_[s]===t){delete this.idIndex_[s];i=true;break}}return i};Uf.prototype.setLoader=function(t){this.loader_=t};Uf.Event=function(t,i){mn.call(this,t);this.feature=i};fn.inherits(Uf.Event,mn);var Xf={};Xf.lineString=function(t,i,s,e,r,n){var h=NaN;var a=NaN;var o=(s-i)/e;if(o===1){h=t[i];a=t[i+1]}else if(o==2){h=(1-r)*t[i]+r*t[i+e];a=(1-r)*t[i+1]+r*t[i+e+1]}else if(o!==0){var f=t[i];var u=t[i+1];var l=0;var v=[0];var c;for(c=i+e;c<s;c+=e){var d=t[c];var m=t[c+1];l+=Math.sqrt((d-f)*(d-f)+(m-u)*(m-u));v.push(l);f=d;u=m}var p=r*l;var z=kn.binarySearch(v,p);if(z<0){var M=(p-v[-z-2])/(v[-z-1]-v[-z-2]);var _=i+(-z-2)*e;h=xn.lerp(t[_],t[_+e],M);a=xn.lerp(t[_+1],t[_+e+1],M)}else{h=t[i+z*e];a=t[i+z*e+1]}}if(n){n[0]=h;n[1]=a;return n}else{return[h,a]}};Xf.lineStringCoordinateAtM=function(t,i,s,e,r,n){if(s==i){return null}var h;if(r<t[i+e-1]){if(n){h=t.slice(i,i+e);h[e-1]=r;return h}else{return null}}else if(t[s-1]<r){if(n){h=t.slice(s-e,s);h[e-1]=r;return h}else{return null}}if(r==t[i+e-1]){return t.slice(i,i+e)}var a=i/e;var o=s/e;while(a<o){var f=a+o>>1;if(r<t[(f+1)*e-1]){o=f}else{a=f+1}}var u=t[a*e-1];if(r==u){return t.slice((a-1)*e,(a-1)*e+e)}var l=t[(a+1)*e-1];var v=(r-u)/(l-u);h=[];var c;for(c=0;c<e-1;++c){h.push(xn.lerp(t[(a-1)*e+c],t[a*e+c],v))}h.push(r);return h};Xf.lineStringsCoordinateAtM=function(t,i,s,e,r,n,h){if(h){return Xf.lineStringCoordinateAtM(t,i,s[s.length-1],e,r,n)}var a;if(r<t[e-1]){if(n){a=t.slice(0,e);a[e-1]=r;return a}else{return null}}if(t[t.length-1]<r){if(n){a=t.slice(t.length-e);a[e-1]=r;return a}else{return null}}var o,f;for(o=0,f=s.length;o<f;++o){var u=s[o];if(i==u){continue}if(r<t[i+e-1]){return null}else if(r<=t[u-1]){return Xf.lineStringCoordinateAtM(t,i,u,e,r,false)}i=u}return null};var qf=function(t,i){jn.call(this);this.flatMidpoint_=null;this.flatMidpointRevision_=-1;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.setCoordinates(t,i)};fn.inherits(qf,jn);qf.prototype.appendCoordinate=function(t){if(!this.flatCoordinates){this.flatCoordinates=t.slice()}else{kn.extend(this.flatCoordinates,t)}this.changed()};qf.prototype.clone=function(){var t=new qf(null);t.setFlatCoordinates(this.layout,this.flatCoordinates.slice());return t};qf.prototype.closestPointXY=function(t,i,s,e){if(e<Nn.closestSquaredDistanceXY(this.getExtent(),t,i)){return e}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Xn.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Xn.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,false,t,i,s,e)};qf.prototype.forEachSegment=function(t,i){return Kn.forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};qf.prototype.getCoordinateAtM=function(t,i){if(this.layout!=In.XYM&&this.layout!=In.XYZM){return null}var s=i!==undefined?i:false;return Xf.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,s)};qf.prototype.getCoordinates=function(){return Yn.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};qf.prototype.getCoordinateAt=function(t,i){return Xf.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)};qf.prototype.getLength=function(){return no.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)};qf.prototype.getFlatMidpoint=function(){if(this.flatMidpointRevision_!=this.getRevision()){this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_);this.flatMidpointRevision_=this.getRevision()}return this.flatMidpoint_};qf.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Bn.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new qf(null);s.setFlatCoordinates(In.XY,i);return s};qf.prototype.getType=function(){return wn.LINE_STRING};qf.prototype.intersectsExtent=function(t){return Qn.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)};qf.prototype.setCoordinates=function(t,i){if(!t){this.setFlatCoordinates(In.XY,null)}else{this.setLayout(i,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=qn.coordinates(this.flatCoordinates,0,t,this.stride);this.changed()}};qf.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i);this.changed()};var Yf={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var Bf=function(t){var i=t?t:{};var s=vn.assign({},i);delete s.preload;delete s.useInterimTilesOnError;Jh.call(this,s);this.setPreload(i.preload!==undefined?i.preload:0);this.setUseInterimTilesOnError(i.useInterimTilesOnError!==undefined?i.useInterimTilesOnError:true);this.type=ba.TILE};fn.inherits(Bf,Jh);Bf.prototype.getPreload=function(){return this.get(Yf.PRELOAD)};Bf.prototype.setPreload=function(t){this.set(Yf.PRELOAD,t)};Bf.prototype.getUseInterimTilesOnError=function(){return this.get(Yf.USE_INTERIM_TILES_ON_ERROR)};Bf.prototype.setUseInterimTilesOnError=function(t){this.set(Yf.USE_INTERIM_TILES_ON_ERROR,t)};var Hf=function(t){var i=t?t:{};var s=vn.assign({},i);delete s.style;delete s.renderBuffer;delete s.updateWhileAnimating;delete s.updateWhileInteracting;Jh.call(this,s);this.declutter_=i.declutter!==undefined?i.declutter:false;this.renderBuffer_=i.renderBuffer!==undefined?i.renderBuffer:100;this.style_=null;this.styleFunction_=undefined;this.setStyle(i.style);this.updateWhileAnimating_=i.updateWhileAnimating!==undefined?i.updateWhileAnimating:false;this.updateWhileInteracting_=i.updateWhileInteracting!==undefined?i.updateWhileInteracting:false;this.renderMode_=i.renderMode||xa.VECTOR;this.type=ba.VECTOR};fn.inherits(Hf,Jh);Hf.prototype.getDeclutter=function(){return this.declutter_};Hf.prototype.setDeclutter=function(t){this.declutter_=t};Hf.prototype.getRenderBuffer=function(){return this.renderBuffer_};Hf.prototype.getRenderOrder=function(){return this.get(Hf.Property_.RENDER_ORDER)};Hf.prototype.getStyle=function(){return this.style_};Hf.prototype.getStyleFunction=function(){return this.styleFunction_};Hf.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_};Hf.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_};Hf.prototype.setRenderOrder=function(t){this.set(Hf.Property_.RENDER_ORDER,t)};Hf.prototype.setStyle=function(t){this.style_=t!==undefined?t:pf.defaultFunction;this.styleFunction_=t===null?undefined:pf.createFunction(this.style_);this.changed()};Hf.prototype.getRenderMode=function(){return this.renderMode_};Hf.Property_={RENDER_ORDER:"renderOrder"};var Jf={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};var Zf=function(t){var i=t?t:{};var s=i.className!==undefined?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV");this.innerElement_.className=s+"-inner";this.element_=document.createElement("DIV");this.element_.className=s+" "+Bh.CLASS_UNSELECTABLE;this.element_.appendChild(this.innerElement_);this.viewState_=null;this.minWidth_=i.minWidth!==undefined?i.minWidth:64;this.renderedVisible_=false;this.renderedWidth_=undefined;this.renderedHTML_="";var e=i.render?i.render:Zf.render;Yh.call(this,{element:this.element_,render:e,target:i.target});cn.listen(this,_n.getChangeEventType(Zf.Property_.UNITS),this.handleUnitsChanged_,this);this.setUnits(i.units||Jf.METRIC)};fn.inherits(Zf,Yh);Zf.LEADING_DIGITS=[1,2,5];Zf.prototype.getUnits=function(){return this.get(Zf.Property_.UNITS)};Zf.render=function(t){var i=t.frameState;if(!i){this.viewState_=null}else{this.viewState_=i.viewState}this.updateElement_()};Zf.prototype.handleUnitsChanged_=function(){this.updateElement_()};Zf.prototype.setUnits=function(t){this.set(Zf.Property_.UNITS,t)};Zf.prototype.updateElement_=function(){var t=this.viewState_;if(!t){if(this.renderedVisible_){this.element_.style.display="none";this.renderedVisible_=false}return}var i=t.center;var s=t.projection;var e=this.getUnits();var r=e==Jf.DEGREES?Tn.DEGREES:Tn.METERS;var n=Wn.getPointResolution(s,t.resolution,i,r);if(e!=Jf.DEGREES){n*=s.getMetersPerUnit()}var h=this.minWidth_*n;var a="";if(e==Jf.DEGREES){var o=Wn.METERS_PER_UNIT[Tn.DEGREES];if(s.getUnits()==Tn.DEGREES){h*=o}else{n/=o}if(h<o/60){a="″";n*=3600}else if(h<o){a="′";n*=60}else{a="°"}}else if(e==Jf.IMPERIAL){if(h<.9144){a="in";n/=.0254}else if(h<1609.344){a="ft";n/=.3048}else{a="mi";n/=1609.344}}else if(e==Jf.NAUTICAL){n/=1852;a="nm"}else if(e==Jf.METRIC){if(h<.001){a="μm";n*=1e6}else if(h<1){a="mm";n*=1e3}else if(h<1e3){a="m"}else{a="km";n/=1e3}}else if(e==Jf.US){if(h<.9144){a="in";n*=39.37}else if(h<1609.344){a="ft";n/=.30480061}else{a="mi";n/=1609.3472}}else{bn.assert(false,33)}var f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));var u,l;while(true){u=Zf.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3));l=Math.round(u/n);if(isNaN(l)){this.element_.style.display="none";this.renderedVisible_=false;return}else if(l>=this.minWidth_){break}++f}var v=u+" "+a;if(this.renderedHTML_!=v){this.innerElement_.innerHTML=v;this.renderedHTML_=v}if(this.renderedWidth_!=l){this.innerElement_.style.width=l+"px";this.renderedWidth_=l}if(!this.renderedVisible_){this.element_.style.display="";this.renderedVisible_=true}};Zf.Property_={UNITS:"units"};var $f={FRACTION:"fraction",PIXELS:"pixels"};var Kf=function(t,i,s,e,r,n){pn.call(this);this.hitDetectionImage_=null;this.image_=!t?new Image:t;if(e!==null){this.image_.crossOrigin=e}this.canvas_=n?document.createElement("CANVAS"):null;this.color_=n;this.imageListenerKeys_=null;this.imageState_=r;this.size_=s;this.src_=i;this.tainting_=false;if(this.imageState_==_a.LOADED){this.determineTainting_()}};fn.inherits(Kf,pn);Kf.get=function(t,i,s,e,r,n){var h=Pa.iconImageCache;var a=h.get(i,e,n);if(!a){a=new Kf(t,i,s,e,r,n);h.set(i,e,n,a)}return a};Kf.prototype.determineTainting_=function(){var t=Lh.createCanvasContext2D(1,1);try{t.drawImage(this.image_,0,0);t.getImageData(0,0,1,1)}catch(t){this.tainting_=true}};Kf.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(zn.CHANGE)};Kf.prototype.handleImageError_=function(){this.imageState_=_a.ERROR;this.unlistenImage_();this.dispatchChangeEvent_()};Kf.prototype.handleImageLoad_=function(){this.imageState_=_a.LOADED;if(this.size_){this.image_.width=this.size_[0];this.image_.height=this.size_[1]}this.size_=[this.image_.width,this.image_.height];this.unlistenImage_();this.determineTainting_();this.replaceColor_();this.dispatchChangeEvent_()};Kf.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_};Kf.prototype.getImageState=function(){return this.imageState_};Kf.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_){if(this.tainting_){var i=this.size_[0];var s=this.size_[1];var e=Lh.createCanvasContext2D(i,s);e.fillRect(0,0,i,s);this.hitDetectionImage_=e.canvas}else{this.hitDetectionImage_=this.image_}}return this.hitDetectionImage_};Kf.prototype.getSize=function(){return this.size_};Kf.prototype.getSrc=function(){return this.src_};Kf.prototype.load=function(){if(this.imageState_==_a.IDLE){this.imageState_=_a.LOADING;this.imageListenerKeys_=[cn.listenOnce(this.image_,zn.ERROR,this.handleImageError_,this),cn.listenOnce(this.image_,zn.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}};Kf.prototype.replaceColor_=function(){if(this.tainting_||this.color_===null){return}this.canvas_.width=this.image_.width;this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);var i=t.getImageData(0,0,this.image_.width,this.image_.height);var s=i.data;var e=this.color_[0]/255;var r=this.color_[1]/255;var n=this.color_[2]/255;for(var h=0,a=s.length;h<a;h+=4){s[h]*=e;s[h+1]*=r;s[h+2]*=n}t.putImageData(i,0,0)};Kf.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(cn.unlistenByKey);this.imageListenerKeys_=null};var Qf={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var tu=function(t){var i=t||{};this.anchor_=i.anchor!==undefined?i.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=i.anchorOrigin!==undefined?i.anchorOrigin:Qf.TOP_LEFT;this.anchorXUnits_=i.anchorXUnits!==undefined?i.anchorXUnits:$f.FRACTION;this.anchorYUnits_=i.anchorYUnits!==undefined?i.anchorYUnits:$f.FRACTION;this.crossOrigin_=i.crossOrigin!==undefined?i.crossOrigin:null;var s=i.img!==undefined?i.img:null;var e=i.imgSize!==undefined?i.imgSize:null;var r=i.src;bn.assert(!(r!==undefined&&s),4);bn.assert(!s||s&&e,5);if((r===undefined||r.length===0)&&s){r=s.src||fn.getUid(s).toString()}bn.assert(r!==undefined&&r.length>0,6);var n=i.src!==undefined?_a.IDLE:_a.LOADED;this.color_=i.color!==undefined?Ea.asArray(i.color):null;this.iconImage_=Kf.get(s,r,e,this.crossOrigin_,n,this.color_);this.offset_=i.offset!==undefined?i.offset:[0,0];this.offsetOrigin_=i.offsetOrigin!==undefined?i.offsetOrigin:Qf.TOP_LEFT;this.origin_=null;this.size_=i.size!==undefined?i.size:null;var h=i.opacity!==undefined?i.opacity:1;var a=i.rotateWithView!==undefined?i.rotateWithView:false;var o=i.rotation!==undefined?i.rotation:0;var f=i.scale!==undefined?i.scale:1;var u=i.snapToPixel!==undefined?i.snapToPixel:true;vf.call(this,{opacity:h,rotation:o,scale:f,snapToPixel:u,rotateWithView:a})};fn.inherits(tu,vf);tu.prototype.clone=function(){return new tu({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||undefined,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:this.size_!==null?this.size_.slice():undefined,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})};tu.prototype.getAnchor=function(){if(this.normalizedAnchor_){return this.normalizedAnchor_}var t=this.anchor_;var i=this.getSize();if(this.anchorXUnits_==$f.FRACTION||this.anchorYUnits_==$f.FRACTION){if(!i){return null}t=this.anchor_.slice();if(this.anchorXUnits_==$f.FRACTION){t[0]*=i[0]}if(this.anchorYUnits_==$f.FRACTION){t[1]*=i[1]}}if(this.anchorOrigin_!=Qf.TOP_LEFT){if(!i){return null}if(t===this.anchor_){t=this.anchor_.slice()}if(this.anchorOrigin_==Qf.TOP_RIGHT||this.anchorOrigin_==Qf.BOTTOM_RIGHT){t[0]=-t[0]+i[0]}if(this.anchorOrigin_==Qf.BOTTOM_LEFT||this.anchorOrigin_==Qf.BOTTOM_RIGHT){t[1]=-t[1]+i[1]}}this.normalizedAnchor_=t;return this.normalizedAnchor_};tu.prototype.getColor=function(){return this.color_};tu.prototype.getImage=function(t){return this.iconImage_.getImage(t)};tu.prototype.getImageSize=function(){return this.iconImage_.getSize()};tu.prototype.getHitDetectionImageSize=function(){return this.getImageSize()};tu.prototype.getImageState=function(){return this.iconImage_.getImageState()};tu.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)};tu.prototype.getOrigin=function(){if(this.origin_){return this.origin_}var t=this.offset_;if(this.offsetOrigin_!=Qf.TOP_LEFT){var i=this.getSize();var s=this.iconImage_.getSize();if(!i||!s){return null}t=t.slice();if(this.offsetOrigin_==Qf.TOP_RIGHT||this.offsetOrigin_==Qf.BOTTOM_RIGHT){t[0]=s[0]-i[0]-t[0]}if(this.offsetOrigin_==Qf.BOTTOM_LEFT||this.offsetOrigin_==Qf.BOTTOM_RIGHT){t[1]=s[1]-i[1]-t[1]}}this.origin_=t;return this.origin_};tu.prototype.getSrc=function(){return this.iconImage_.getSrc()};tu.prototype.getSize=function(){return!this.size_?this.iconImage_.getSize():this.size_};tu.prototype.listenImageChange=function(t,i){return cn.listen(this.iconImage_,zn.CHANGE,t,i)};tu.prototype.load=function(){this.iconImage_.load()};tu.prototype.unlistenImageChange=function(t,i){cn.unlisten(this.iconImage_,zn.CHANGE,t,i)};const iu=`<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const su=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden]{display:none}:host::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;position:relative;width:100%;aspect-ratio:1/1}stzh-olmap[hidden]{display:none}stzh-olmap::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media print{stzh-olmap{page-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap{}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall);right:auto;padding:var(--stzh-space-xxxsmall);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2)}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(var(--stzh-form-input-small-height) + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall));background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 + var(--stzh-space-xxxsmall))}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);margin-left:calc(4.75rem + var(--stzh-space-xxxsmall) + var(--stzh-space-xsmall))}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall) * 3 + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall) + var(--stzh-space-xxxsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2 + var(--stzh-space-xxxsmall))}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-small)}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-large)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';window.proj4=oi;window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const eu={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`};const ru=Object.assign(Object.assign({},eu),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`});const nu=Object.assign(Object.assign({},eu),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`});const hu=class{constructor(s){t(this,s);this.stzhInitialized=i(this,"stzhInitialized",7);this.stzhPostRender=i(this,"stzhPostRender",7);this.stzhMoveStart=i(this,"stzhMoveStart",7);this.stzhMoveEnd=i(this,"stzhMoveEnd",7);this.stzhMovePanZoom=i(this,"stzhMovePanZoom",7);this._layers={};this.geoPositionChanged=false;this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})};this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})};this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"})};this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})};this.handleInsideModalOpen=()=>{if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}};this.handlePrintButtonClick=()=>{if(!this.printIframe){this.printIframe=document.createElement("iframe");Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"});this.element.append(this.printIframe)}this.printIframe.innerHTML="";const t=this.printIframe.contentWindow;const i=this.constructor.style.replace('@charset "UTF-8";',"");const s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let e;this.map.once("postcompose",(function(t){const i=t.context.canvas;e=i.toDataURL("image/png")}));this.map.renderSync();t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${e}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `;setTimeout((()=>{try{t.document.execCommand("print",false,null)}catch(i){t.print()}}),1e3)};this.localization=undefined;this.hostname="www.ogc.stadt-zuerich.ch";this.scaleControl=true;this.layerControl=true;this.printControl=true;this.locationControl=false;this.layer="streets";this.zoom=7;this.zoomLocation=7;this.center=[2683311,1247082];this.centerMarker=true;this.pinchRotateThreshold=.3;this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333];this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}}}layersWatcher(t){if(typeof t==="string"){this._layers=JSON.parse(t)}else{this._layers=t}}resolutionsWatcher(t){if(typeof t==="string"){this._resolutions=JSON.parse(t)}else{this._resolutions=t}}zoomWatcher(t){if(this.map){this.map.getView().setZoom(t)}}scaleControlWatcher(t){if(!this.map){return}if(t){this.scaleControlOl=new Zf({units:"metric"});this.map.addControl(this.scaleControlOl)}else{if(this.scaleControl){this.map.removeControl(this.scaleControlOl)}this.scaleControlOl=null}}printControlWatcher(t){if(!this.map){return}if(t){this.printControlElement=document.createElement("button");this.printControlElement.className="ol-print";this.printControlElement.ariaLabel=this.localization.printLabel;this.printControlElement.addEventListener("click",this.handlePrintButtonClick);this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>';this.printControlOl=new Yh({element:this.printControlElement});this.map.addControl(this.printControlOl)}else{if(this.printControlOl){this.map.removeControl(this.printControlOl)}this.printControlOl=null;this.printControlElement=null}}layerControlWatcher(t){if(!this.map||this.layersArray.length===1){return}if(t){this.layerControlElement=document.createElement("button");this.layerControlElement.className="ol-layer";this.layerControlElement.addEventListener("click",(()=>{this.layer=this.layer==="streets"?"satellite":"streets"}));this.layerControlImageElement=document.createElement("img");this.layerControlImageElement.className="ol-layer__thumbnail";this.layerControlImageElement.setAttribute("role","presentation");this.layerControlImageElement.setAttribute("alt","");this.layerControlTextElement=document.createElement("span");this.layerControlTextElement.className="ol-layer__text";this.layerControlElement.appendChild(this.layerControlImageElement);this.layerControlElement.appendChild(this.layerControlTextElement);this.layerControlOl=new Yh({element:this.layerControlElement});this.map.addControl(this.layerControlOl)}else{if(this.layerControlOl){this.map.removeControl(this.layerControlOl)}this.layerControlOl=null;this.layerControlElement=null;this.layerControlImageElement=null;this.layerControlTextElement=null}}locationControlWatcher(t){if(!this.map){return}if(t){this.locationControlElement=document.createElement("button");this.locationControlElement.className="ol-location";this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>';this.locationControlElement.addEventListener("click",(()=>{const t=this.geolocation.getTracking();if(t){this.disableLocationTracking().catch()}else{this.enableLocationTracking().catch()}}));this.locationControlOl=new Yh({element:this.locationControlElement});this.geolocation=new hh({projection:this.map.getView().getProjection()});this.positionMarkerOl=new zf;this.positionMarkerOl.setId("position");const t=new pf({image:new tu(nu)});this.positionMarkerOl.setStyle(t);this.positionLayer.getSource().addFeature(this.positionMarkerOl);this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new Jn(t));if(!this.geoPositionChanged&&Nn.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())){this.geoPositionChanged=true;this.map.getView().setCenter(t);if(this.zoomLocation){this.map.getView().setZoom(this.zoomLocation)}}}));this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null);this.setLocationControlState(t)}));this.geolocation.on("error",(()=>{this.setLocationControlState(false)}));this.map.addControl(this.locationControlOl)}else{this.disableLocationTracking().catch();if(this.locationControlOl){this.map.removeControl(this.locationControlOl)}if(this.positionMarkerOl){this.positionLayer.getSource().removeFeature(this.positionMarkerOl)}this.locationControlOl=null;this.locationControlElement=null;this.geolocation=null;this.positionMarkerOl=null}}layerWatcher(t){if(!this.map){return}Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(true);this.map.getView().set("projection",this.projections[t]);const e=this.layersArray.find((([t])=>t!==this.layer));if(e){if(this.layerControlImageElement){this.layerControlImageElement.src=e[1].thumbnailUrl}if(this.layerControlTextElement){let t="";if(i==="streets"){t=this.localization.streetsLayerTitle}else if(i==="satellite"){t=this.localization.satelliteLayerTitle}this.layerControlTextElement.textContent=e[1].title||t}}}else{s.setVisible(false)}}))}centerWatcher(t){if(typeof t==="string"){this._center=JSON.parse(t)}else{this._center=t}if(this.map){this.map.getView().setCenter(this._center);if(this.centerMarkerOl){this.centerMarkerOl.setGeometry(new Jn(this._center))}}}async centerMarkerWatcher(t){if(t){this.centerMarkerOl=await this.addIconMarker(this._center)}else if(this.centerMarkerOl){this.removeIconMarker(this.centerMarkerOl)}}async getMap(){return this.map}async getVisibleMarkers(){const t=this.iconLayer.getSource();const i=t.getFeatures();if(i.length===0){return[]}const s=this.map.getView().calculateExtent(this.map.getSize());return i.filter((t=>{const i=t.getGeometry().getExtent();return Nn.intersects(s,i)}))}async findMarkerById(t){const i=this.iconLayer.getSource().getFeatures();return i.find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new zf({geometry:new Jn(t)});const e=new pf({image:new tu(eu)});s.setProperties({id:i.id});s.setProperties({stzh:i});s.setStyle(e);this.iconLayer.getSource().addFeature(s);return s}async addIconMarkers(t){for(const i of t){await this.addIconMarker(i.coordinates,i.props)}return true}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource();const s=i.getFeatures();if(s.length===0){return}let e=Nn.createEmpty();s.forEach((t=>{Nn.extend(e,t.getGeometry().getExtent())}));this.map.getView().fit(e,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new pf({image:new tu(ru)}))}async setIconMarkerInactive(t){t.setStyle(new pf({image:new tu(eu)}))}async setAllIconMarkersInactive(){const t=this.iconLayer.getSource();const i=t.getFeatures();i.forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=true){this.setLocationControlState(true);if(t){this.geoPositionChanged=false}if(this.geolocation){this.geolocation.setTracking(true)}}async disableLocationTracking(){this.setLocationControlState(false);if(this.geolocation){this.geolocation.setTracking(false)}}async getDistance(t,i){const s=new qf([t,i]);const e=yn.getLength(s,{projection:this.map.getView().getProjection()});return e}handleLoad(){if(this.map){requestAnimationFrame((()=>{this.map.updateSize()}))}}showPopover(t,i){if(i.imageUri){this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`}let s='<div class="stzh-olmap__popover-content">';if(i.title){s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`}if(i.text){s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`}if(i.data&&i.data.length){i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name=${t.icon}></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`}))}s+="</div>";this.popoverElement.innerHTML+=s;if(i.href){this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`}const e=new lf({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:false,autoPanAnimation:{duration:300}});this.map.addOverlay(e);this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent);const s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});const e=this.map.getTargetElement();if(s){e.style.cursor="pointer"}else{e.style.cursor=""}}))}setLocationControlState(t){if(this.positionLayer){this.positionLayer.setVisible(t)}if(this.locationControlElement){this.locationControlElement.classList.toggle("active",t)}}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel;t.name="plus";const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel;i.name="minus";const s=document.createElement("div");s.innerHTML=iu;const e=document.createElement("span");e.innerText=this.localization.rotateLabel;s.appendChild(e);const r=new ff({controls:Qh.defaults({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new oh([new aa,new ea,new ha,new ma({threshold:this.pinchRotateThreshold}),new pa,new va,new ca,new ua]),loadTilesWhileAnimating:true,loadTilesWhileInteracting:true,target:this.mapElement,logo:false});return r}createRasterLayer(t,i){return new Bf({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){if(!this.projections){this.projections={}}this.projections[t]=new Rn({code:"EPSG:2056",extent:i.extent});return this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:e,matrixSet:r,origin:n}=i;const h=[];for(let t=0;t<this._resolutions.length;t++){h.push(t)}const a=new Pf({origin:n,resolutions:this._resolutions,matrixIds:h,tileSize:[512,512]});return new Df({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:e,matrixSet:r,requestEncoding:"REST"})}createIconLayer(){return new Hf({source:new Uf({})})}initMap(){this.map=this.createMap();this.map.on("postrender",this.handlePostRender);this.map.on("movestart",this.handleMoveStart);this.map.on("moveend",this.handleMoveEnd);this.map.on("pointerdrag",this.handlePointerdrag);this.map.on("change:resolution",this.handleChangeResolution);this.layersArray=Object.entries(this._layers);if(this.layersArray.length>2){throw new Error("There are only two different layers allowed.")}this.rasterLayers={};this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname);this.rasterLayers[t]=this.createRasterLayer(t,i.options);this.map.addLayer(this.rasterLayers[t])}));this.positionLayer=this.createIconLayer();this.positionLayer.setVisible(false);this.map.addLayer(this.positionLayer);this.iconLayer=this.createIconLayer();this.map.addLayer(this.iconLayer);const t=new Ph({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});this.map.setView(t);this.scaleControlWatcher(this.scaleControl);this.printControlWatcher(this.printControl);this.locationControlWatcher(this.locationControl);this.layerControlWatcher(this.layerControl);this.layerWatcher(this.layer);this.centerWatcher(this.center);this.centerMarkerWatcher(this.centerMarker);this.initializeMarkerHover();this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch();this.popoverElement.innerHTML="";this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof Jn){this.setIconMarkerActive(t).catch();const i=t.getProperties();if(i.stzh){this.showPopover(i.geometry.flatCoordinates,i.stzh)}return true}}))}));requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})}))}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers);this.resolutionsWatcher(this.resolutions);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap")}}componentWillUpdate(){if(this.map){this.map.setTarget(null);this.map=null}}componentDidRender(){if(this.map){return}this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");if(t){t.addEventListener("stzhOpen",this.handleInsideModalOpen)}}disconnectedCallback(){if(this.map){this.map.setTarget(null);this.map=null}const t=this.element.closest("stzh-dialog");if(t){t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}}render(){const t={"stzh-olmap":true,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl};return s(e,null,s("div",{class:t},s("div",{ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),s("div",{ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return r(this)}static get watchers(){return{layers:["layersWatcher"],resolutions:["resolutionsWatcher"],zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};hu.style=su;export{_ as stzh_checkbox,x as stzh_header,hu as stzh_olmap};
|
|
8
|
+
//# sourceMappingURL=p-72c9db89.entry.js.map
|