-
Notifications
You must be signed in to change notification settings - Fork 13
/
d4d-volunteer-map.html
23 lines (22 loc) · 466 KB
/
d4d-volunteer-map.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgewogIC8vIElmIHdpbmRvdy5IVE1MV2lkZ2V0cyBpcyBhbHJlYWR5IGRlZmluZWQsIHRoZW4gdXNlIGl0OyBvdGhlcndpc2UgY3JlYXRlIGEKICAvLyBuZXcgb2JqZWN0LiBUaGlzIGFsbG93cyBwcmVjZWRpbmcgY29kZSB0byBzZXQgb3B0aW9ucyB0aGF0IGFmZmVjdCB0aGUKICAvLyBpbml0aWFsaXphdGlvbiBwcm9jZXNzICh0aG91Z2ggbm9uZSBjdXJyZW50bHkgZXhpc3QpLgogIHdpbmRvdy5IVE1MV2lkZ2V0cyA9IHdpbmRvdy5IVE1MV2lkZ2V0cyB8fCB7fTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gYSB2aWV3ZXIgcGFuZS4gSWYgbm90LCB3ZSdyZSBpbiBhIHdlYiBicm93c2VyLgogIHZhciB2aWV3ZXJNb2RlID0gd2luZG93LkhUTUxXaWRnZXRzLnZpZXdlck1vZGUgPQogICAgICAvXGJ2aWV3ZXJfcGFuZT0xXGIvLnRlc3Qod2luZG93LmxvY2F0aW9uKTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gU2hpbnkgbW9kZS4gSWYgbm90LCBpdCdzIGEgc3RhdGljIGRvY3VtZW50LgogIC8vIE5vdGUgdGhhdCBzdGF0aWMgd2lkZ2V0cyBjYW4gYXBwZWFyIGluIGJvdGggU2hpbnkgYW5kIHN0YXRpYyBtb2RlcywgYnV0CiAgLy8gb2J2aW91c2x5LCBTaGlueSB3aWRnZXRzIGNhbiBvbmx5IGFwcGVhciBpbiBTaGlueSBhc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sKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvckRpdgogICAgICAgICAgICAgIC5jc3MoInRvcCIsIGVsLm9mZnNldFRvcCkKICAgICAgICAgICAgICAuY3NzKCJsZWZ0IiwgZWwub2Zmc2V0TGVmdCkKICAgICAgICAgICAgICAuY3NzKCJtYXhXaWR0aCIsIGVsLm9mZnNldFdpZHRoKQogICAgICAgICAgICAgIC5jc3MoImhlaWdodCIsIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICB9LCA1MDApOwogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIGNsZWFyRXJyb3I6IGZ1bmN0aW9uKGVsKSB7CiAgICAgIHZhciAkZWwgPSAkKGVsKTsKICAgICAgdmFyIGRpc3BsYXkgPSAkZWwuZGF0YSgicmVzdG9yZS1kaXNwbGF5LW1vZGUiKTsKICAgICAgJGVsLmRhdGEoInJlc3RvcmUtZGlzcGxheS1tb2RlIiwgbnVsbCk7CgogICAgICBpZiAoZGlzcGxheSA9PT0gImlubGluZSIgfHwgZGlzcGxheSA9PT0gImlubGluZS1ibG9jayIpIHsKICAgICAgICBpZiAoZGlzcGxheSkKICAgICAgICAgICRlbC5jc3MoImRpc3BsYXkiLCBkaXNwbGF5KTsKICAgICAgICAkKGVsLm5leHRTaWJsaW5nKS5maWx0ZXIoIi5odG1sd2lkZ2V0cy1lcnJvciIpLnJlbW92ZSgpOwogICAgICB9IGVsc2UgaWYgKGRpc3BsYXkgPT09ICJibG9jayIpewogICAgICAgICRlbC5jc3MoInZpc2liaWxpdHkiLCAiaW5oZXJpdCIpOwogICAgICAgICQoZWwubmV4dFNpYmxpbmcpLmZpbHRlcigiLmh0bWx3aWRnZXRzLWVycm9yIikucmVtb3ZlKCk7CiAgICAgIH0KICAgIH0sCiAgICBzaXppbmc6IHt9CiAgfTsKCiAgLy8gQ2FsbGVkIGJ5IHdpZGdldCBiaW5kaW5ncyB0byByZWdpc3RlciBhIG5ldyB0eXBlIG9mIHdpZGdldC4gVGhl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VyVmFsdWUgdG8gaGFuZGxlIGluaXRpYWxpemF0aW9uLCB3aGljaCB1bmZvcnR1bmF0ZWx5IGlzbid0CiAgICAgIC8vIHN1cHBvcnRlZCBuYXRpdmVseSBieSBTaGlueSBhdCB0aGUgdGltZSBvZiB0aGlzIHdyaXRpbmcuCgogICAgICBzaGlueUJpbmRpbmcucmVuZGVyVmFsdWUgPSBmdW5jdGlvbihlbCwgZGF0YSkgewogICAgICAgIC8vIFJlc29sdmUgc3RyaW5ncyBtYXJrZWQgYXMgamF2YXNjcmlwdCBsaXRlcmFscyB0byBvYmplY3RzCiAgICAgICAgaWYgKCEoZGF0YS5ldmFscyBpbnN0YW5jZW9mIEFycmF5KSkgZGF0YS5ldmFscyA9IFtkYXRhLmV2YWxzXTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgZGF0YS5ldmFscyAmJiBpIDwgZGF0YS5ldmFscy5sZW5ndGg7IGkrKykgewogICAgICAgICAgd2luZG93LkhUTUxXaWRnZXRzLmV2YWx1YXRlU3RyaW5nTWVtYmVyKGRhdGEueCwgZGF0YS5ldmFsc1tpXSk7CiAgICAgICAgfQogICAgICAgIGlmICghYmluZGluZ0RlZi5yZW5kZXJPbk51bGxWYWx1ZSkgewogICAgICAgICAgaWYgKGRhdGEueCA9PT0gbnVsbCkgewogICAgICAgICAgICBlbC5zdHlsZS52aXNpYmlsaXR5ID0gImhpZGRlbiI7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnZpc2liaWxpdHkgPSAiaW5oZXJpdCI7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghZWxlbWVudERhdGEoZWwsICJpbml0aWFsaXplZCIpKSB7CiAgICAgICAgICBpbml0U2l6aW5nKGVsKTsKCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRpYWxpemVkIiwgdHJ1ZSk7CiAgICAgICAgICBpZiAoYmluZGluZ0RlZi5pb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G1sLXdpZGdldC1zdGF0aWMtYm91bmQiKSkKICAgICAgICAgIHJldHVybjsKICAgICAgICBlbC5jbGFzc05hbWUgPSBlbC5jbGFzc05hbWUgKyAiIGh0bWwtd2lkZ2V0LXN0YXRpYy1ib3VuZCI7CgogICAgICAgIHZhciBpbml0UmVzdWx0OwogICAgICAgIGlmIChiaW5kaW5nLmluaXRpYWxpemUpIHsKICAgICAgICAgIGluaXRSZXN1bHQgPSBiaW5kaW5nLmluaXRpYWxpemUoZWwsCiAgICAgICAgICAgIHNpemVPYmogPyBzaXplT2JqLmdldFdpZHRoKCkgOiBlbC5vZmZzZXRXaWR0aCwKICAgICAgICAgICAgc2l6ZU9iaiA/IHNpemVPYmouZ2V0SGVpZ2h0KCkgOiBlbC5vZmZzZXRIZWlnaHQKICAgICAgICAgICk7CiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiwgaW5pdFJlc3VsdCk7CiAgICAgICAgfQoKICAgICAgICBpZiAoYmluZGluZy5yZXNpemUpIHsKICAgICAgICAgIHZhciBsYXN0U2l6ZSA9IHt9OwogICAgICAgICAgdmFyIHJlc2l6ZUhhbmRsZXIgPSBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgIHZhciBzaXplID0gewogICAgICAgICAgICAgIHc6IHNpemVPYmogPyBzaXplT2JqLmdldFdpZHRoKCkgOiBlbC5vZmZzZXRXaWR0aCwKICAgICAgICAgICAgICBoOiBzaXplT2JqID8gc2l6ZU9iai5nZXRIZWlnaHQoKSA6IGVsLm9mZnNldEhlaWdodAogICAgICAgICAgICB9OwogICAgICAgICAgICBpZiAoc2l6ZS53ID09PSAwICYmIHNpemUuaCA9PT0gMCkKICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIGlmIChzaXplLncgPT09IGxhc3RTaXplLncgJiYgc2l6ZS5oID09PSBsYXN0U2l6ZS5oKQogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgbGFzdFNpemUgPSBzaXpl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ane%2C%0A%2Eleaflet%2Doverlay%2Dpane%20svg%2C%0A%2Eleaflet%2Dzoom%2Dbox%2C%0A%2Eleaflet%2Dimage%2Dlayer%2C%0A%2Eleaflet%2Dlayer%20%7B%0Aposition%3A%20absolute%3B%0Aleft%3A%200%3B%0Atop%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20%7B%0Aoverflow%3A%20hidden%3B%0A%2Dms%2Dtouch%2Daction%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dmarker%2Dicon%2C%0A%2Eleaflet%2Dmarker%2Dshadow%20%7B%0A%2Dwebkit%2Duser%2Dselect%3A%20none%3B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0Auser%2Dselect%3A%20none%3B%0A%2Dwebkit%2Duser%2Ddrag%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dmarker%2Dicon%2C%0A%2Eleaflet%2Dmarker%2Dshadow%20%7B%0Adisplay%3A%20block%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20img%20%7B%0Amax%2Dwidth%3A%20none%20%21important%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20img%2Eleaflet%2Dimage%2Dlayer%20%7B%0Amax%2Dwidth%3A%2015000px%20%21important%3B%0A%7D%0A%2Eleaflet%2Dtile%20%7B%0Afilter%3A%20inherit%3B%0Avisibility%3A%20hidden%3B%0A%7D%0A%2Eleaflet%2Dtile%2Dloaded%20%7B%0Avisibility%3A%20inherit%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Dbox%20%7B%0Awidth%3A%200%3B%0Aheight%3A%200%3B%0A%7D%0A%0A%2Eleaflet%2Doverlay%2Dpane%20svg%20%7B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtile%2Dpane%20%7B%20z%2Dindex%3A%202%3B%20%7D%0A%2Eleaflet%2Dobjects%2Dpane%20%7B%20z%2Dindex%3A%203%3B%20%7D%0A%2Eleaflet%2Doverlay%2Dpane%20%7B%20z%2Dindex%3A%204%3B%20%7D%0A%2Eleaflet%2Dshadow%2Dpane%20%7B%20z%2Dindex%3A%205%3B%20%7D%0A%2Eleaflet%2Dmarker%2Dpane%20%7B%20z%2Dindex%3A%206%3B%20%7D%0A%2Eleaflet%2Dpopup%2Dpane%20%7B%20z%2Dindex%3A%207%3B%20%7D%0A%2Eleaflet%2Dvml%2Dshape%20%7B%0Awidth%3A%201px%3B%0Aheight%3A%201px%3B%0A%7D%0A%2Elvml%20%7B%0Abehavior%3A%20url%28%23default%23VML%29%3B%0Adisplay%3A%20inline%2Dblock%3B%0Aposition%3A%20absolute%3B%0A%7D%0A%0A%2Eleaflet%2Dcontrol%20%7B%0Aposition%3A%20relative%3B%0Az%2Dindex%3A%207%3B%0Apointer%2Devents%3A%20auto%3B%0A%7D%0A%2Eleaflet%2Dtop%2C%0A%2Eleaflet%2Dbottom%20%7B%0Aposition%3A%20absolute%3B%0Az%2Dindex%3A%201000%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtop%20%7B%0Atop%3A%200%3B%0A%7D%0A%2Eleaflet%2Dright%20%7B%0Aright%3A%200%3B%0A%7D%0A%2Eleaflet%2Dbottom%20%7B%0Abottom%3A%200%3B%0A%7D%0A%2Eleaflet%2Dleft%20%7B%0Aleft%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontrol%20%7B%0Afloat%3A%20left%3B%0Aclear%3A%20both%3B%0A%7D%0A%2Eleaflet%2Dright%20%2Eleaflet%2Dcontrol%20%7B%0Afloat%3A%20right%3B%0A%7D%0A%2Eleaflet%2Dtop%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dtop%3A%2010px%3B%0A%7D%0A%2Eleaflet%2Dbottom%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dbottom%3A%2010px%3B%0A%7D%0A%2Eleaflet%2Dleft%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dleft%3A%2010px%3B%0A%7D%0A%2Eleaflet%2Dright%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dright%3A%2010px%3B%0A%7D%0A%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dpopup%20%7B%0Aopacity%3A%200%3B%0A%2Dwebkit%2Dtransition%3A%20opacity%200%2E2s%20linear%3B%0A%2Dmoz%2Dtransition%3A%20opacity%200%2E2s%20linear%3B%0A%2Do%2Dtransition%3A%20opacity%200%2E2s%20linear%3B%0Atransition%3A%20opacity%200%2E2s%20linear%3B%0A%7D%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dtile%2Dloaded%2C%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dmap%2Dpane%20%2Eleaflet%2Dpopup%20%7B%0Aopacity%3A%201%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dzoom%2Danimated%20%7B%0A%2Dwebkit%2Dtransition%3A%20%2Dwebkit%2Dtransform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0A%2Dmoz%2Dtransition%3A%20%2Dmoz%2Dtransform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0A%2Do%2Dtransition%3A%20%2Do%2Dtransform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0Atransition%3A%20transform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dpan%2Danim%20%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dtouching%20%2Eleaflet%2Dzoom%2Danimated%20%7B%0A%2Dwebkit%2Dtransition%3A%20none%3B%0A%2Dmoz%2Dtransition%3A%20none%3B%0A%2Do%2Dtransition%3A%20none%3B%0Atransition%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dzoom%2Dhide%20%7B%0Avisibility%3A%20hidden%3B%0A%7D%0A%0A%2Eleaflet%2Dclickable%20%7B%0Acursor%3A%20pointer%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20%7B%0Acursor%3A%20%2Dwebkit%2Dgrab%3B%0Acursor%3A%20%2Dmoz%2Dgrab%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dpane%2C%0A%2Eleaflet%2Dcontrol%20%7B%0Acursor%3A%20auto%3B%0A%7D%0A%2Eleaflet%2Ddragging%20%2Eleaflet%2Dcontainer%2C%0A%2Eleaflet%2Ddragging%20%2Eleaflet%2Dclickable%20%7B%0Acursor%3A%20move%3B%0Acursor%3A%20%2Dwebkit%2Dgrabbing%3B%0Acursor%3A%20%2Dmoz%2Dgrabbing%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20%7B%0Abackground%3A%20%23ddd%3B%0Aoutline%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%20%7B%0Acolor%3A%20%230078A8%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%2Eleaflet%2Dactive%20%7B%0Aoutline%3A%202px%20solid%20orange%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Dbox%20%7B%0Aborder%3A%202px%20dotted%20%2338f%3B%0Abackground%3A%20rgba%28255%2C255%2C255%2C0%2E5%29%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20%7B%0Afont%3A%2012px%2F1%2E5%20%22Helvetica%20Neue%22%2C%20Arial%2C%20Helvetica%2C%20sans%2Dserif%3B%0A%7D%0A%0A%2Eleaflet%2Dbar%20%7B%0Abox%2Dshadow%3A%200%201px%205px%20rgba%280%2C0%2C0%2C0%2E65%29%3B%0Aborder%2Dradius%3A%204px%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%2C%0A%2Eleaflet%2Dbar%20a%3Ahover%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0Awidth%3A%2026px%3B%0Aheight%3A%2026px%3B%0Aline%2Dheight%3A%2026px%3B%0Adisplay%3A%20block%3B%0Atext%2Dalign%3A%20center%3B%0Atext%2Ddecoration%3A%20none%3B%0Acolor%3A%20black%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%2C%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Abackground%2Dposition%3A%2050%25%2050%25%3B%0Abackground%2Drepeat%3A%20no%2Drepeat%3B%0Adisplay%3A%20block%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%3Ahover%20%7B%0Abackground%2Dcolor%3A%20%23f4f4f4%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%3Afirst%2Dchild%20%7B%0Aborder%2Dtop%2Dleft%2Dradius%3A%204px%3B%0Aborder%2Dtop%2Dright%2Dradius%3A%204px%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%3Alast%2Dchild%20%7B%0Aborder%2Dbottom%2Dleft%2Dradius%3A%204px%3B%0Aborder%2Dbottom%2Dright%2Dradius%3A%204px%3B%0Aborder%2Dbottom%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%2Eleaflet%2Ddisabled%20%7B%0Acursor%3A%20default%3B%0Abackground%2Dcolor%3A%20%23f4f4f4%3B%0Acolor%3A%20%23bbb%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dbar%20a%20%7B%0Awidth%3A%2030px%3B%0Aheight%3A%2030px%3B%0Aline%2Dheight%3A%2030px%3B%0A%7D%0A%0A%2Eleaflet%2Dcontrol%2Dzoom%2Din%2C%0A%2Eleaflet%2Dcontrol%2Dzoom%2Dout%20%7B%0Afont%3A%20bold%2018px%20%27Lucida%20Console%27%2C%20Monaco%2C%20monospace%3B%0Atext%2Dindent%3A%201px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dzoom%2Dout%20%7B%0Afont%2Dsize%3A%2020px%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dzoom%2Din%20%7B%0Afont%2Dsize%3A%2022px%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dzoom%2Dout%20%7B%0Afont%2Dsize%3A%2024px%3B%0A%7D%0A%0A%2Eleaflet%2Dcontrol%2Dlayers%20%7B%0Abox%2Dshadow%3A%200%201px%205px%20rgba%280%2C0%2C0%2C0%2E4%29%3B%0Abackground%3A%20%23fff%3B%0Aborder%2Dradius%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAVbSURBVEiJrZZfSFt3FMe%2Fv3tvbmLUZleNKSHE%2FLGRiNbGRovTtrA9lcFkpcOnMvawwhhjrb3soQ8djGFhXMQNRqEvY3R9kJVuPpRRWQebcdKYxkaHqcHchKJ2rVo1WhNz%2F%2Fz2UOLUadVuv9fvOedzfuec3x9CKcV%2B1qVLlwgAdHV17cuR7AfU29tb43a73wWAVCr1Q0dHx8T%2FCuru7i5ubGw843K5ms1mMwBgdXUV6XQ6HI1Gb3Z2dj7%2Fz6C%2Bvr6T1dXVp6xWa%2Bl2%2Buzs7PLk5OTP7e3tv70S6Pr1647q6uoOt9vtYRjmpcnouo5UKiVPTk72nj17dmpPIEmS%2BIaGhnaPx3O8tLSU3ahRSotyudzrAGAymf4ghGQ36svLy5osywOxWKxPFMX8jqBbt241ejyed%2Bx2e9nWjPL5fK2iKC2UUiMAEELWDAbDEM%2Fz41ttZ2Zmnsmy%2FOPp06ejm0DXrl2rqK2tPeNyuQ7zPL9pi5qmVaytrZ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9mWEolEHYABAMesVmt%2FqhhB1ykWi4UBcBzAbwHICwoKLjc2NtaKxeINX18JIZicnMTY2Bh4%2Fs6xGk3T0Gq1KC8vT7l5cBwXuX79et%2Fs7OzjAKIAfg3gtNVqTXvBltGFl8ViKQXwBwA%2FBPCdVqsd1mg0Sd90V7XKLgAZMwXAPwH8zGq1Cj7Iz%2BqO1WKxZMyudErGFKvV2p1pnqwvjbNhVzKlYko27Xroa%2F1s2LWqdEzJRpv2JUkm7BLKlGy0qZ%2FGCGFXJkzJRlvyNVYydkkkktxMmZKNtuzzsvvZBYADEEEGTMlGW%2F4B4Dp2ARkyJRv9F9vsxWD%2F43R9AAAAAElFTkSuQmCC%29%3B%0Abackground%2Dsize%3A%2026px%2026px%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Awidth%3A%2044px%3B%0Aheight%3A%2044px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%20%2Eleaflet%2Dcontrol%2Dlayers%2Dlist%2C%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dexpanded%20%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Adisplay%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dexpanded%20%2Eleaflet%2Dcontrol%2Dlayers%2Dlist%20%7B%0Adisplay%3A%20block%3B%0Aposition%3A%20relative%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dexpanded%20%7B%0Apadding%3A%206px%2010px%206px%206px%3B%0Acolor%3A%20%23333%3B%0Abackground%3A%20%23fff%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dselector%20%7B%0Amargin%2Dtop%3A%202px%3B%0Aposition%3A%20relative%3B%0Atop%3A%201px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%20label%20%7B%0Adisplay%3A%20block%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dseparator%20%7B%0Aheight%3A%200%3B%0Aborder%2Dtop%3A%201px%20solid%20%23ddd%3B%0Amargin%3A%205px%20%2D10px%205px%20%2D6px%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dcontrol%2Dattribution%20%7B%0Abackground%3A%20%23fff%3B%0Abackground%3A%20rgba%28255%2C%20255%2C%20255%2C%200%2E7%29%3B%0Amargin%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dattribution%2C%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%20%7B%0Apadding%3A%200%205px%3B%0Acolor%3A%20%23333%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dattribution%20a%20%7B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dattribution%20a%3Ahover%20%7B%0Atext%2Ddecoration%3A%20underline%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dcontrol%2Dattribution%2C%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dcontrol%2Dscale%20%7B%0Afont%2Dsize%3A%2011px%3B%0A%7D%0A%2Eleaflet%2Dleft%20%2Eleaflet%2Dcontrol%2Dscale%20%7B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dbottom%20%2Eleaflet%2Dcontrol%2Dscale%20%7B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%20%7B%0Aborder%3A%202px%20solid%20%23777%3B%0Aborder%2Dtop%3A%20none%3B%0Aline%2Dheight%3A%201%2E1%3B%0Apadding%3A%202px%205px%201px%3B%0Afont%2Dsize%3A%2011px%3B%0Awhite%2Dspace%3A%20nowrap%3B%0Aoverflow%3A%20hidden%3B%0A%2Dmoz%2Dbox%2Dsizing%3A%20content%2Dbox%3B%0Abox%2Dsizing%3A%20content%2Dbox%3B%0Abackground%3A%20%23fff%3B%0Abackground%3A%20rgba%28255%2C%20255%2C%20255%2C%200%2E5%29%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%3Anot%28%3Afirst%2Dchild%29%20%7B%0Aborder%2Dtop%3A%202px%20solid%20%23777%3B%0Aborder%2Dbottom%3A%20none%3B%0Amargin%2Dtop%3A%20%2D2px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%3Anot%28%3Afirst%2Dchild%29%3Anot%28%3Alast%2Dchild%29%20%7B%0Aborder%2Dbottom%3A%202px%20solid%20%23777%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dattribution%2C%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dlayers%2C%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dbar%20%7B%0Abox%2Dshadow%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dlayers%2C%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dbar%20%7B%0Aborder%3A%202px%20solid%20rgba%280%2C0%2C0%2C0%2E2%29%3B%0Abackground%2Dclip%3A%20padding%2Dbox%3B%0A%7D%0A%0A%2Eleaflet%2Dpopup%20%7B%0Aposition%3A%20absolute%3B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%20%7B%0Apadding%3A%201px%3B%0Atext%2Dalign%3A%20left%3B%0Aborder%2Dradius%3A%2012px%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%20%7B%0Amargin%3A%2013px%2019px%3B%0Aline%2Dheight%3A%201%2E4%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%20p%20%7B%0Amargin%3A%2018px%200%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dtip%2Dcontainer%20%7B%0Amargin%3A%200%20auto%3B%0Awidth%3A%2040px%3B%0Aheight%3A%2020px%3B%0Aposition%3A%20relative%3B%0Aoverflow%3A%20hidden%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dtip%20%7B%0Awidth%3A%2017px%3B%0Aheight%3A%2017px%3B%0Apadding%3A%201px%3B%0Amargin%3A%20%2D10px%20auto%200%3B%0A%2Dwebkit%2Dtransform%3A%20rotate%2845deg%29%3B%0A%2Dmoz%2Dtransform%3A%20rotate%2845deg%29%3B%0A%2Dms%2Dtransform%3A%20rotate%2845deg%29%3B%0A%2Do%2Dtransform%3A%20rotate%2845deg%29%3B%0Atransform%3A%20rotate%2845deg%29%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%2C%0A%2Eleaflet%2Dpopup%2Dtip%20%7B%0Abackground%3A%20white%3B%0Abox%2Dshadow%3A%200%203px%2014px%20rgba%280%2C0%2C0%2C0%2E4%29%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%2Eleaflet%2Dpopup%2Dclose%2Dbutton%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A%200%3B%0Aright%3A%200%3B%0Apadding%3A%204px%204px%200%200%3B%0Atext%2Dalign%3A%20center%3B%0Awidth%3A%2018px%3B%0Aheight%3A%2014px%3B%0Afont%3A%2016px%2F14px%20Tahoma%2C%20Verdana%2C%20sans%2Dserif%3B%0Acolor%3A%20%23c3c3c3%3B%0Atext%2Ddecoration%3A%20none%3B%0Afont%2Dweight%3A%20bold%3B%0Abackground%3A%20transparent%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%2Eleaflet%2Dpopup%2Dclose%2Dbutton%3Ahover%20%7B%0Acolor%3A%20%23999%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dscrolled%20%7B%0Aoverflow%3A%20auto%3B%0Aborder%2Dbottom%3A%201px%20solid%20%23ddd%3B%0Aborder%2Dtop%3A%201px%20solid%20%23ddd%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%20%7B%0Azoom%3A%201%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dtip%20%7B%0Awidth%3A%2024px%3B%0Amargin%3A%200%20auto%3B%0A%2Dms%2Dfilter%3A%20%22progid%3ADXImageTransform%2EMicrosoft%2EMatrix%28M11%3D0%2E70710678%2C%20M12%3D0%2E70710678%2C%20M21%3D%2D0%2E70710678%2C%20M22%3D0%2E70710678%29%22%3B%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2EMatrix%28M11%3D0%2E70710678%2C%20M12%3D0%2E70710678%2C%20M21%3D%2D0%2E70710678%2C%20M22%3D0%2E70710678%29%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dtip%2Dcontainer%20%7B%0Amargin%2Dtop%3A%20%2D1px%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dcontrol%2Dzoom%2C%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dcontrol%2Dlayers%2C%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%2C%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dtip%20%7B%0Aborder%3A%201px%20solid%20%23999%3B%0A%7D%0A%0A%2Eleaflet%2Ddiv%2Dicon%20%7B%0Abackground%3A%20%23fff%3B%0Aborder%3A%201px%20solid%20%23666%3B%0A%7D%0A" rel="stylesheet" />
<script src="data:application/x-javascript;base64,LyoKIExlYWZsZXQsIGEgSmF2YVNjcmlwdCBsaWJyYXJ5IGZvciBtb2JpbGUtZnJpZW5kbHkgaW50ZXJhY3RpdmUgbWFwcy4gaHR0cDovL2xlYWZsZXRqcy5jb20KIChjKSAyMDEwLTIwMTMsIFZsYWRpbWlyIEFnYWZvbmtpbgogKGMpIDIwMTAtMjAxMSwgQ2xvdWRNYWRlCiovCiFmdW5jdGlvbih0LGUsaSl7dmFyIG49dC5MLG89e307by52ZXJzaW9uPSIwLjcuMyIsIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUmJiJvYmplY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2FnZXx8KDE9PT1lPyJwZXJtaXNzaW9uIGRlbmllZCI6Mj09PWU/InBvc2l0aW9uIHVuYXZhaWxhYmxlIjoidGltZW91dCIpO3RoaXMuX2xvY2F0ZU9wdGlvbnMuc2V0VmlldyYmIXRoaXMuX2xvYWRlZCYmdGhpcy5maXRXb3JsZCgpLHRoaXMuZmlyZSgibG9jYXRpb25lcnJvciIse2NvZGU6ZSxtZXNzYWdlOiJHZW9sb2NhdGlvbiBlcnJvcjogIitpKyIuIn0pfSxfaGFuZGxlR2VvbG9jYXRpb25SZXNwb25zZTpmdW5jdGlvbih0KXt2YXIgZT10LmNvb3Jkcy5sYXRpdHVkZSxpPXQuY29vcmRzLmxvbmdpdHVkZSxuPW5ldyBvLkxhdExuZyhlLGkpLHM9MTgwKnQuY29vcmRzLmFjY3VyYWN5LzQwMDc1MDE3LGE9cy9NYXRoLmNvcyhvLkxhdExuZy5ERUdfVE9fUkFEKmUpLHI9by5sYXRMbmdCb3VuZHMoW2UtcyxpLWFdLFtlK3MsaSthXSksaD10aGlzLl9sb2NhdGVPcHRpb25zO2lmKGguc2V0Vmlldyl7dmFyIGw9TWF0aC5taW4odGhpcy5nZXRCb3VuZHNab29tKHIpLGgubWF4Wm9vbSk7dGhpcy5zZXRWaWV3KG4sbCl9dmFyIHU9e2xhdGxuZzpuLGJvdW5kczpyLHRpbWVzdGFtcDp0LnRpbWVzdGFtcH07Zm9yKHZhciBjIGluIHQuY29vcmRzKSJudW1iZXIiPT10eXBlb2YgdC5jb29yZHNbY10mJih1W2NdPXQuY29vcmRzW2NdKTt0aGlzLmZpcmUoImxvY2F0aW9uZm91bmQiLHUpfX0pfSh3aW5kb3csZG9jdW1lbnQpOw=="></script>
<link href="data:text/css;charset=utf-8,%0Aimg%2Eleaflet%2Dtile%20%7B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Aborder%2Dradius%3A%200%3B%0Aborder%3A%20none%3B%0A%7D%0A%2Einfo%20%7B%0Apadding%3A%206px%208px%3B%0Afont%3A%2014px%2F16px%20Arial%2C%20Helvetica%2C%20sans%2Dserif%3B%0Abackground%3A%20white%3B%0Abackground%3A%20rgba%28255%2C255%2C255%2C0%2E8%29%3B%0Abox%2Dshadow%3A%200%200%2015px%20rgba%280%2C0%2C0%2C0%2E2%29%3B%0Aborder%2Dradius%3A%205px%3B%0A%7D%0A%2Elegend%20%7B%0Aline%2Dheight%3A%2018px%3B%0Acolor%3A%20%23555%3B%0A%7D%0A%2Elegend%20svg%20text%20%7B%0Afill%3A%20%23555%3B%0A%7D%0A%2Elegend%20svg%20line%20%7B%0Astroke%3A%20%23555%3B%0A%7D%0A%2Elegend%20i%20%7B%0Awidth%3A%2018px%3B%0Aheight%3A%2018px%3B%0Afloat%3A%20left%3B%0Amargin%2Dright%3A%208px%3B%0Aopacity%3A%200%2E7%3B%0A%7D%0A" rel="stylesheet" />
<script src="data:application/x-javascript;base64,ZnVuY3Rpb24gcmVjeWNsZSh2YWx1ZXMsIGxlbmd0aCwgaW5QbGFjZSkgewogIGlmIChsZW5ndGggPT09IDAgJiYgIWluUGxhY2UpCiAgICByZXR1cm4gW107CgogIGlmICghKHZhbHVlcyBpbnN0YW5jZW9mIEFycmF5KSkgewogICAgaWYgKGluUGxhY2UpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJDYW4ndCBkbyBpbi1wbGFjZSByZWN5Y2xpbmcgb2YgYSBub24tQXJyYXkgdmFsdWUiKTsKICAgIH0KICAgIHZhbHVlcyA9IFt2YWx1ZXNdOwogIH0KICBpZiAodHlwZW9mKGxlbmd0aCkgPT09ICd1bmRlZmluZWQnKQogICAgbGVuZ3RoID0gdmFsdWVzLmxlbmd0aDsKCiAgdmFyIGRlc3QgPSBpblBsYWNlID8gdmFsdWVzIDogW107CiAgdmFyIG9yaWdMZW5ndGggPSB2YWx1ZXMubGVuZ3RoOwogIHdoaWxlIChkZXN0Lmxlbmd0aCA8IGxlbmd0aCkgewogICAgZGVzdC5wdXNoKHZhbHVlc1t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0aGlzLl9ieUdyb3VwW2dyb3VwXSA9IHRoaXMuX2J5R3JvdXBbZ3JvdXBdIHx8IHt9OwogICAgICBnID0gdGhpcy5fZ3JvdXBDb250YWluZXJzW2dyb3VwXSA9IEwubGF5ZXJHcm91cCgpOwogICAgICBnLmdyb3VwbmFtZSA9IGdyb3VwOwogICAgICBnLmFkZFRvKHRoaXMuX21hcCk7CiAgICB9CiAgICByZXR1cm4gZzsKICB9OwogIExheWVyTWFuYWdlci5wcm90b3R5cGUuZ2V0R3JvdXBOYW1lRnJvbUxheWVyR3JvdXAgPSBmdW5jdGlvbihsYXllckdyb3VwKSB7CiAgICByZXR1cm4gbGF5ZXJHcm91cC5ncm91cG5hbWU7CiAgfTsKICBMYXllck1hbmFnZXIucHJvdG90eXBlLmdldFZpc2libGVHcm91cHMgPSBmdW5jdGlvbigpIHsKICAgIHZhciBzZWxmID0gdGhpczsKICAgIHZhciByZXN1bHQgPSBbXTsKICAgICQuZWFjaCh0aGlzLl9ncm91cENvbnRhaW5lcnMsIGZ1bmN0aW9uKGssIHYpIHsKICAgICAgaWYgKHNlbGYuX21hcC5oYXNMYXllcih2KSkgewogICAgICAgIHJlc3VsdC5wdXNoKGspOwogICAgICB9CiAgICB9KTsKICAgIHJldHVybiByZXN1bHQ7CiAgfTsKICBMYXllck1hbmFnZXIucHJvdG90eXBlLmNsZWFyR3JvdXAgPSBmdW5jdGlvbihncm91cCkgewogICAgdmFyIHNlbGYgPSB0aGlzOwoKICAgIC8vIEZpbmQgYWxsIGxheWVycyBpbiBfYnlHcm91cFtncm91cF0KICAgIHZhciBncm91cFRhYmxlID0gdGhpcy5fYnlHcm91cFtncm91cF07CiAgICBpZiAoIWdyb3VwVGFibGUpIHsKICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQoKICAgIC8vIFJlbW92ZSBhbGwgbGF5ZXJzLiBNYWtlIGNvcHkgb2Yga2V5cyB0byBhdm9pZCBtdXRhdGluZyB0aGUgY29sbGVjdGlvbgogICAgLy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tcCA9IEwuVXRpbC5zdGFtcChsYXllcik7CiAgICB9CgogICAgdmFyIGxheWVySW5mbyA9IHRoaXMuX2J5U3RhbXBbc3RhbXBdOwogICAgaWYgKCFsYXllckluZm8pIHsKICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQoKICAgIGxheWVySW5mby5jb250YWluZXIucmVtb3ZlTGF5ZXIoc3RhbXApOwogICAgaWYgKHR5cGVvZihsYXllckluZm8uZ3JvdXApID09PSAic3RyaW5nIikgewogICAgICBkZWxldGUgdGhpcy5fYnlHcm91cFtsYXllckluZm8uZ3JvdXBdW3N0YW1wXTsKICAgIH0KICAgIGlmICh0eXBlb2YobGF5ZXJJbmZvLmxheWVySWQpID09PSAic3RyaW5nIikgewogICAgICBkZWxldGUgdGhpcy5fYnlMYXllcklkW3RoaXMuX2xheWVySWRLZXkobGF5ZXJJbmZvLmNhdGVnb3J5LCBsYXllckluZm8ubGF5ZXJJZCldOwogICAgfQogICAgZGVsZXRlIHRoaXMuX2J5Q2F0ZWdvcnlbbGF5ZXJJbmZvLmNhdGVnb3J5XVtzdGFtcF07CiAgICBkZWxldGUgdGhpcy5fYnlTdGFtcFtzdGFtcF07CiAgfTsKICBMYXllck1hbmFnZXIucHJvdG90eXBlLl9sYXllcklkS2V5ID0gZnVuY3Rpb24oY2F0ZWdvcnksIGxheWVySWQpIHsKICAgIHJldHVybiBjYXRlZ29yeSArICJcbiIgKyBsYXllcklkOwogIH07CgogIGZ1bmN0aW9uIENvbnRyb2xTdG9yZShtYXApIHsKICAgIHRoaXMuX2NvbnRyb2xzTm9JZCA9IFtdOwogICAgdGhpcy5fY29udHJvbHNCeUlkID0ge307CiAgICB0aGlzLl9tYXAgPSBtYXAKICB9CgogIENvbnRyb2xTdG9yZS5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24oY29udHJvbCwgaWQsIGh0bWwpIHsKICAgIGlmICh0eXBlb2YoaWQpICE9PSAndW5kZWZpbmVkJyAmJiBpZCAhPT0gbnVsbCkgewogICAgICBpZiAodGhpcy5fY29udHJvbHNCeUlkW2lkXSkgewogICAgICAgIHRoaXMuX21hcC5yZW1vdmVDb250cm9sKHRoaXMuX2NvbnRyb2xzQnlJZFtpZF0pOwogICAgICB9CiAgICAgIHRoaXMuX2NvbnRyb2xzQnlJZFtpZF0gPSBjb250cm9sOwogICAgfSBlbHNlIHsKICAgICAgdGhpcy5fY29udHJvbHNOb0lkLnB1c2goY29udHJvbCkKICAgIH0KICAgIHRoaXMuX21hcC5hZGRDb250cm9sKGNvbnRyb2wpOwogIH07CgogIENvbnRyb2xTdG9yZS5wcm90b3R5cGUucmVtb3ZlID0gZnVuY3Rpb24oaWQpIHsKICAgIGlmICh0aGlzLl9jb250cm9sc0J5SWRbaWRdKSB7CiAgICAgIHZhciBjb250cm9sID0gdGhpcy5fY29udHJvbHNCeUlkW2lkXTsKICAgICAgdGhpcy5fbWFwLnJlbW92ZUNvbnRyb2woY29udHJvbCk7CiAgICAgIGRlbGV0ZSB0aGlzLl9jb250cm9sc0J5SWRbaWRdOwogICAgfQogIH07CgogIENvbnRyb2xTdG9yZS5wcm90b3R5cGUuY2xlYXIgPSBmdW5jdGlvbigpIHsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5fY29udHJvbHNOb0lkLmxlbmd0aDsgaSsrKSB7CiAgICAgIHZhciBjb250cm9sID0gdGhpcy5fY29udHJvbHNOb0lkW2ldOwogICAgICB0aGlzLl9tYXAucmVtb3ZlQ29udHJvbChjb250cm9sKTsKICAgIH07CiAgICB0aGlzLl9jb250cm9sc05vSWQgPSBbXTsKCiAgICBmb3IgKHZhciBrZXkgaW4gdGhpcy5fY29udHJvbHNCeUlkKSB7CiAgICAgIHZhciBjb250cm9sID0gdGhpcy5fY29udHJvbHNCeUlkW2tleV07CiAgICAgIHRoaXMuX21hcC5yZW1vdmVDb250cm9sKGNvbnRyb2wpCiAgICB9CiAgICB0aGlzLl9jb250cm9sc0J5SWQgPSB7fQogIH0KCiAgZnVuY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ZXJJZCwgZ3JvdXAsIGV2ZW50TmFtZSwgZXh0cmFJbmZvKSB7CiAgICByZXR1cm4gZnVuY3Rpb24oZSkgewogICAgICBpZiAoIUhUTUxXaWRnZXRzLnNoaW55TW9kZSkgcmV0dXJuOwoKICAgICAgdmFyIGV2ZW50SW5mbyA9ICQuZXh0ZW5kKAogICAgICAgIHsKICAgICAgICAgIGlkOiBsYXllcklkLAogICAgICAgICAgJy5ub25jZSc6IE1hdGgucmFuZG9tKCkgIC8vIGZvcmNlIHJlYWN0aXZpdHkKICAgICAgICB9LAogICAgICAgIGdyb3VwICE9PSBudWxsID8ge2dyb3VwOiBncm91cH0gOiBudWxsLAogICAgICAgIGUudGFyZ2V0LmdldExhdExuZyA/IGUudGFyZ2V0LmdldExhdExuZygpIDogZS5sYXRsbmcsCiAgICAgICAgZXh0cmFJbmZvCiAgICAgICk7CgogICAgICBTaGlueS5vbklucHV0Q2hhbmdlKG1hcElkICsgJ18nICsgZXZlbnROYW1lLCBldmVudEluZm8pOwogICAgfTsKICB9CgogIC8vIFNlbmQgdXBkYXRlZCBib3VuZHMgYmFjayB0byBhcHAuIFRha2VzIGEgbGVhZmxldCBldmVudCBvYmplY3QgYXMgaW5wdXQuCiAgZnVuY3Rpb24gdXBkYXRlQm91bmRzKG1hcCkgewogICAgdmFyIGlkID0gbWFwLmdldENvbnRhaW5lcigpLmlkOwogICAgdmFyIGJvdW5kcyA9IG1hcC5nZXRCb3VuZHMoKTsKCiAgICBTaGlueS5vbklucHV0Q2hhbmdlKGlkICsgJ19ib3VuZHMnLCB7CiAgICAgIG5vcnRoOiBib3VuZHMuZ2V0Tm9ydGhFYXN0KCkubGF0LAogICAgICBlYXN0OiBib3VuZHMuZ2V0Tm9ydGhFYXN0KCkubG5nLAogICAgICBzb3V0aDogYm91bmRzLmdldFNvdXRoV2VzdCgpLmxhdCwKICAgICAgd2VzdDogYm91bmRzLmdldFNvdXRoV2VzdCgpLmxuZwogICAgfSk7CiAgICBTaGlueS5v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VzdGVyIiwgY2x1c3RlcklkLCBncm91cCk7CiAgICAgIH0KICAgIH0pLmNhbGwobWFwKTsKICB9CgogIG1ldGhvZHMuYWRkTWFya2VycyA9IGZ1bmN0aW9uKGxhdCwgbG5nLCBpY29uLCBsYXllcklkLCBncm91cCwgb3B0aW9ucywgcG9wdXAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMsIGNsdXN0ZXJJZCkgewogICAgaWYgKGljb24pIHsKICAgICAgLy8gVW5wYWNrIGljb25zCiAgICAgIGljb24uaWNvblVybCAgICAgICAgID0gdW5wYWNrU3RyaW5ncyhpY29uLmljb25VcmwpOwogICAgICBpY29uLmljb25SZXRpbmFVcmwgICA9IHVucGFja1N0cmluZ3MoaWNvbi5pY29uUmV0aW5hVXJsKTsKICAgICAgaWNvbi5zaGFkb3dVcmwgICAgICAgPSB1bnBhY2tTdHJpbmdzKGljb24uc2hhZG93VXJsKTsKICAgICAgaWNvbi5zaGFkb3dSZXRpbmFVcmwgPSB1bnBhY2tTdHJpbmdzKGljb24uc2hhZG93UmV0aW5hVXJsKTsKCiAgICAgIC8vIFRoaXMgY2JpbmRzIHRoZSBpY29uIFVSTHMgYW5kIGFueSBvdGhlciBpY29uIG9wdGlvbnM7IHRoZXkncmUgYWxsCiAgICAgIC8vIHByZXNlbnQgb24gdGhlIGljb24gb2JqZWN0LgogICAgICB2YXIgaWNvbmRmID0gZGF0YWZyYW1lLmNyZWF0ZSgpLmNiaW5kKGljb24pOwoKICAgICAgLy8gQ29uc3RydWN0cyBhbiBpY29uIGZyb20gYSBzcGVjaWZpZWQgcm93IG9mIHRoZSBpY29uIGRhdGFmcmFtZS4KICAgICAgdmFyIGdldEljb24gPSBmdW5jdGlvbihpKSB7CiAgICAgICAgdmFyIG9wdHMgPSBpY29uZGYuZ2V0KGkpOwogICAgICAgIGlmICghb3B0cy5pY29uVXJsKSB7CiAgICAgICAgICByZXR1cm4gbmV3IEwuSWNvbi5EZ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G9kcy5jbGVhck1hcmtlckNsdXN0ZXJzID0gZnVuY3Rpb24oKSB7CiAgICB0aGlzLmxheWVyTWFuYWdlci5jbGVhckxheWVycygiY2x1c3RlciIpOwogIH07CgogIG1ldGhvZHMucmVtb3ZlU2hhcGUgPSBmdW5jdGlvbihsYXllcklkKSB7CiAgICB0aGlzLmxheWVyTWFuYWdlci5yZW1vdmVMYXllcigic2hhcGUiLCBsYXllcklkKTsKICB9OwoKICBtZXRob2RzLmNsZWFyU2hhcGVzID0gZnVuY3Rpb24oKSB7CiAgICB0aGlzLmxheWVyTWFuYWdlci5jbGVhckxheWVycygic2hhcGUiKTsKICB9OwoKICBtZXRob2RzLmFkZFJlY3RhbmdsZXMgPSBmdW5jdGlvbihsYXQxLCBsbmcxLCBsYXQyLCBsbmcyLCBsYXllcklkLCBncm91cCwgb3B0aW9ucywgcG9wdXApIHsKICAgIHZhciBkZiA9IGRhdGFmcmFtZS5jcmVhdGUoKQogICAgICAuY29sKCdsYXQxJywgbGF0MSkKICAgICAgLmNvbCgnbG5nMScsIGxuZzEpCiAgICAgIC5jb2woJ2xhdDInLCBsYXQyKQogICAgICAuY29sKCdsbmcyJywgbG5nMikKICAgICAgLmNvbCgnbGF5ZXJJZCcsIGxheWVySWQpCiAgICAgIC5jb2woJ2dyb3VwJywgZ3JvdXApCiAgICAgIC5jb2woJ3BvcHVwJywgcG9wdXApCiAgICAgIC5jYmluZChvcHRpb25zKTsKCiAgICBhZGRMYXllcnModGhpcywgInNoYXBlIiwgZGYsIGZ1bmN0aW9uKGRmLCBpKSB7CiAgICAgIHJldHVybiBMLnJlY3RhbmdsZShbCiAgICAgICAgICBbZGYuZ2V0KGksICdsYXQxJyksIGRmLmdldChpLCAnbG5nMScpXSwKICAgICAgICAgIFtkZi5nZXQoaSwgJ2xhdDInKSwgZGYuZ2V0KGksICdsbmcyJyldCiAgICAgICAgXSwKICAgICAgICBkZi5nZXQoaSkpOwogICAgfSk7CiAgfTsKCiAgLyoKICAgKiB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nRpcmUgZG9jLgoKICAgICAgaWYgKHdpbmRvdy5TaGlueSAmJiBTaGlueS5pbml0aWFsaXplSW5wdXRzKSB7CiAgICAgICAgU2hpbnkucmVuZGVySHRtbChodG1sLCB0aGlzLl9kaXYpOwogICAgICAgIFNoaW55LmluaXRpYWxpemVJbnB1dHModGhpcy5fZGl2KTsKICAgICAgICBTaGlueS5iaW5kQWxsKHRoaXMuX2Rpdik7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgdGhpcy5fZGl2LmlubmVySFRNTCA9IGh0bWw7CiAgICAgIH0KCiAgICAgIHJldHVybiB0aGlzLl9kaXY7CiAgICB9CiAgICBmdW5jdGlvbiBvblJlbW92ZShtYXApIHsKICAgICAgaWYgKHdpbmRvdy5TaGlueSAmJiBTaGlueS51bmJpbmRBbGwpIHsKICAgICAgICBTaGlueS51bmJpbmRBbGwodGhpcy5fZGl2KTsKICAgICAgfQogICAgfQogICAgdmFyIENvbnRyb2wgPSBMLkNvbnRyb2wuZXh0ZW5kKHsKICAgICAgb3B0aW9uczoge3Bvc2l0aW9uOiBwb3NpdGlvbn0sCiAgICAgIG9uQWRkOiBvbkFkZCwKICAgICAgb25SZW1vdmU6IG9uUmVtb3ZlCiAgICB9KQogICAgdGhpcy5jb250cm9scy5hZGQobmV3IENvbnRyb2wsIGxheWVySWQsIGh0bWwpOwogIH07CgogIG1ldGhvZHMucmVtb3ZlQ29udHJvbCA9IGZ1bmN0aW9uKGxheWVySWQpIHsKICAgIHRoaXMuY29udHJvbHMucmVtb3ZlKGxheWVySWQpOwogIH07CgogIG1ldGhvZHMuY2xlYXJDb250cm9scyA9IGZ1bmN0aW9uKCkgewogICAgdGhpcy5jb250cm9scy5jbGVhcigpOwogIH07CgogIG1ldGhvZHMuYWRkTGVnZW5kID0gZnVuY3Rpb24ob3B0aW9ucykgewogICAgdmFyIGxlZ2VuZCA9IEwuY29udHJvbCh7cG9zaXRpb246IG9wdGlvbnMucG9zaXRpb259KTsKICAgIHZhciBncmF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dG8gc2V0IHdpZHRoIG9mIHN2ZywgYW5kIHJpZ2h0LWp1c3RpZnkgdGV4dAogICAgICAgIHZhciBtYXhMYmxXaWR0aCA9IDA7CgogICAgICAgIC8vIENyZWF0ZSB0aWNrIG1hcmtzIGFuZCBsYWJlbHMKICAgICAgICAkLmVhY2gobGFiZWxzLCBmdW5jdGlvbihpLCBsYWJlbCkgewogICAgICAgICAgdmFyIHkgPSB0aWNrT2Zmc2V0ICsgaSpzaW5nbGVCaW5IZWlnaHQgKyAwLjU7CgogICAgICAgICAgdmFyIHRoaXNMYWJlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhucywgJ3RleHQnKTsKICAgICAgICAgICQodGhpc0xhYmVsKQogICAgICAgICAgICAudGV4dChsYWJlbHNbaV0pCiAgICAgICAgICAgIC5hdHRyKCd5JywgeSkKICAgICAgICAgICAgLmF0dHIoJ2R4JywgbGFiZWxQYWRkaW5nKQogICAgICAgICAgICAuYXR0cignZHknLCAnMC41ZXgnKTsKICAgICAgICAgIGcuYXBwZW5kQ2hpbGQodGhpc0xhYmVsKTsKICAgICAgICAgIG1heExibFdpZHRoID0gTWF0aC5tYXgobWF4TGJsV2lkdGgsIHRoaXNMYWJlbC5nZXRDb21wdXRlZFRleHRMZW5ndGgoKSk7CgogICAgICAgICAgdmFyIHRoaXNUaWNrID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKG5zLCAnbGluZScpOwogICAgICAgICAgJCh0aGlzVGljaykKICAgICAgICAgICAgLmF0dHIoJ3gxJywgMCkKICAgICAgICAgICAgLmF0dHIoJ3gyJywgdGlja1dpZHRoKQogICAgICAgICAgICAuYXR0cigneTEnLCB5KQogICAgICAgICAgICAuYXR0cigneTInLCB5KQogICAgICAgICAgICAuYXR0cignc3Ryb2tlLXdpZHRoJywgMSk7CiAgICAgICAgICBnLmFwcGVuZENoaWxkKHRoaXNUaWNrKTsKICAgICAgICB9KTsKCiAgICAgICAgLy8gTm93IHRoYXQgd2Uga25vdyB0aGUgbWF4IGxhYmVsIHdpZHRoLCB3ZSBjYW4gcmlnaHQtanVzdGlmeQogICAgICAgICQoc3ZnKS5maW5kKCd0ZXh0JykKICAgICAgICAgIC5hdHRyKCdkeCcsIGxhYmVsUGFkZGluZyArIG1heExibFdpZHRoKQogICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ2VuZCcpOwogICAgICAgIC8vIEZpbmFsIHNpemUgZm9yIDxzdmc+CiAgICAgICAgJChzdmcpLmNzcyh7CiAgICAgICAgICB3aWR0aDogKG1heExibFdpZHRoICsgbGFiZWxQYWRkaW5nKSArICJweCIsCiAgICAgICAgICBoZWlnaHQ6IHRvdGFsSGVpZ2h0ICsgdk1hcmdpbioyICsgInB4IgogICAgICAgIH0pOwoKICAgICAgICBpZiAob3B0aW9ucy5uYV9jb2xvcikgewogICAgICAgICAgJChkaXYpLmFwcGVuZCgnPGRpdj48aSBzdHlsZT0iYmFja2dyb3VuZDonICsgb3B0aW9ucy5uYV9jb2xvciArCiAgICAgICAgICAgICAgICAgICAgICAgICciPjwvaT4gJyArIG9wdGlvbnMubmFfbGFiZWwgKyAnPC9kaXY+Jyk7CiAgICAgICAgfQogICAgICB9IGVsc2UgewogICAgICAgIGlmIChvcHRpb25zLm5hX2NvbG9yKSB7CiAgICAgICAgICBjb2xvcnMucHVzaChvcHRpb25zLm5hX2NvbG9yKTsKICAgICAgICAgIGxhYmVscy5wdXNoKG9wdGlvbnMubmFfbGFiZWwpOwogICAgICAgIH0KICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbG9ycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgbGVnZW5kSFRNTCArPSAnPGkgc3R5bGU9ImJhY2tncm91bmQ6JyArIGNvbG9yc1tpXSArICc7b3BhY2l0eTonICsKICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vcGFjaXR5ICsgJyI+PC9pPiAnICsgbGFiZWxzW2ldICsgJzxici8+JzsKICAgICAg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BpeGVscwogICAgICAgICAgICAgICAgZXh0ZW50LnggKiAyNTYsCiAgICAgICAgICAgICAgICBleHRlbnQueSAqIDI1NgogICAgICAgICAgICAgICk7CiAgICAgICAgICAgIH0pOwoKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIFVzZSBtYW51YWwgbmVhcmVzdC1uZWlnaGJvciBpbnRlcnBvbGF0aW9uCgogICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIHNvdXJjZSBpbWFnZSBwaXhlbCBjb29yZGluYXRlcyB0aGF0IGNvcnJlc3BvbmQgd2l0aAogICAgICAgICAgICAvLyB0aGUgdG9wLWxlZnQgYW5kIGJvdHRvbS1yaWdodCBvZiB0aGlzIHRpbGUuIChJZiB0aGUgc291cmNlIGltYWdlCiAgICAgICAgICAgIC8vIG9ubHkgcGFydGlhbGx5IG92ZXJsYXBzIHRoZSB0aWxlLCB3ZSB1c2UgbWF4L21pbiB0byBsaW1pdCB0aGUKICAgICAgICAgICAgLy8gc291cmNlU3RhcnQvRW5kIHRvIG9ubHkgcmVmbGVjdCB0aGUgb3ZlcmxhcHBpbmcgcG9ydGlvbi4pCiAgICAgICAgICAgIHZhciBzb3VyY2VTdGFydCA9IHsKICAgICAgICAgICAgICB4OiBNYXRoLm1heCgwLCBNYXRoLmZsb29yKCh0aWxlUG9pbnQueCAtIHRvcExlZnQueCkgKiBpbWdSZXMueCkpLAogICAgICAgICAgICAgIHk6IE1hdGgubWF4KDAsIE1hdGguZmxvb3IoKHRpbGVQb2ludC55IC0gdG9wTGVmdC55KSAqIGltZ1Jlcy55KSkKICAgICAgICAgICAgfTsKICAgICAgICAgICAgdmFyIHNvdXJjZUVuZCA9IHsKICAgICAgICAgICAgICB4OiBNYXRoLm1pbih3LCBNYXRoLmNlaWwoKHRpbGVQb2ludC54ICsgMSAtIHRvcExlZnQueCkgKiBpbWdSZXMueCkpLAogICAgICAgICAgICAgIHk6IE1hdGgubWluKGgsIE1hdGguY2VpbCgodGlsZVBvaW50LnkgKyAxIC0gdG9wTGVmdC55KSAqIGltZ1Jlcy55KSkKICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIC8vIFRoZSBzaXplLCBpbiBkZXN0IHBpeGVscywgdGhhdCBlYWNoIHNvdXJjZSBwaXhlbCBzaG91bGQgb2NjdXB5LgogICAgICAgICAgICAvLyBUaGlzIG1pZ2h0IGJlIGdyZWF0ZXIgb3IgbGVzcyB0aGFuIDEgKGUuZy4gaWYgeCBhbmQgeSByZXNvbHV0aW9uCiAgICAgICAgICAgIC8vIGFyZSB2ZXJ5IGRpZmZlcmVudCkuCiAgICAgICAgICAgIHZhciBwaXhlbFNpemUgPSB7CiAgICAgICAgICAgICAgeDogMjU2IC8gaW1nUmVzLngsCiAgICAgICAgICAgICAgeTogMjU2IC8gaW1nUmVzLnkKICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIC8vIEZvciBlYWNoIHBpeGVsIGluIHRoZSBzb3VyY2UgaW1hZ2UgdGhhdCBvdmVybGFwcyB0aGUgdGlsZS4uLgogICAgICAgICAgICBmb3IgKHZhciByb3cgPSBzb3VyY2VTdGFydC55OyByb3cgPCBzb3VyY2VFbmQueTsgcm93KyspIHsKICAgICAgICAgICAgICBmb3IgKHZhciBjb2wgPSBzb3VyY2VTdGFydC54OyBjb2wgPCBzb3VyY2VFbmQueDsgY29sKyspIHsKICAgICAgICAgICAgICAgIC8vIC4uLmV4dHJhY3QgdGhlIHBpeGVsIGRhdGEuLi4KICAgICAgICAgICAgICAgIHZhciBpID0gKChyb3cgKiB3KSArIGNvbCkgKiA0OwogICAgICAgICAgICAgICAgdmFyIHIgPSBpbWdEYXRhW2ldOwogICAgICAgICAgICAgICAgdmFyIGcgPSBpbWdEYXRhW2krMV07CiAgICAgICAgICAgICAgICB2YXIgYiA9IGltZ0RhdGFbaSsyXTsKICAgICAgICAgICAgICAgIHZhciBhID0gaW1nRGF0YVtpKzNdOwogICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9ICJyZ2JhKCIgKyBbcixnLGIsYS8yNTVdLmpvaW4oIiwiKSArICIpIjsKCiAgICAgICAgICAgICAgICAvLyAuLi5jYWxjdWxhdGUgdGhlIGNvcnJlc3BvbmRpbmcgcGl4ZWwgY29vcmQgaW4gdGhlIGRlc3QgaW1hZ2UKICAgICAgICAgICAgICAgIC8vIHdoZXJlIGl0IHNob3VsZCBiZSBkcmF3bi4uLgogICAgICAgICAgICAgICAgdmFyIHBpeGVsUG9zID0gewogICAgICAgICAgICAgICAgICB4OiAoKChjb2wgLyBpbWdSZXMueCkgKyB0b3BMZWZ0LngpIC0gdGlsZVBvaW50LngpICogMjU2LAogICAgICAgICAgICAgICAgICB5OiAoKChyb3cgLyBpbWdSZXMueSkgKyB0b3BMZWZ0LnkpIC0gdGlsZVBvaW50LnkpICogMjU2CiAgICAgICAgICAgICAgICB9OwoKICAgICAgICAgICAgICAgIC8vIC4uLmFuZCBkcmF3IGEgcmVjdGFuZ2xlIHRoZXJlLgogICAgICAgICAgICAgICAgY3R4LmZpbGxSZWN0KAogICAgICAgICAgICAgICAgICBNYXRoLnJvdW5kKHBpeGVsUG9zLngpLAogICAgICAgICAgICAgICAgICBNYXRoLnJvdW5kKHBpeGVsUG9zLnkpLAogICAgICAgICAgICAgICAgICAvLyBMb29rcyBjcmF6eSwgYnV0IHRoaXMgaXMgbmVjZXNzYXJ5IHRvIHByZXZlbnQgcm91bmRpbmcgZnJvbQogICAgICAgICAgICAgICAgICAvLyBjYXVzaW5nIG92ZXJsYXAgYmV0d2VlbiB0aGlzIHJlY3QgYW5kIGl0cyBuZWlnaGJvcnMuIFRoZQogICAgICAgICAgICAgICAgICAvLyBtaW51ZW5kIGlzIHRoZSBsb2NhdGlvbiBvZiB0aGUgbmV4dCBwaXhlbCwgd2hpbGUgdGhlCiAgICAgICAgICAgICAgICAgIC8vIHN1YnRyYWhlbmQgaXMgdGhlIHBvc2l0aW9uIG9mIHRoZSBjdXJyZW50IHBpeGVsICh0byB0dX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BhZDsKICAgICAgICAgICAgZGF0YS5saW1pdHMubG5nWzFdID0gZGF0YS5saW1pdHMubG5nWzFdICsgcGFkOwogICAgICAgICAgfQogICAgICAgICAgbWFwLmZpdEJvdW5kcyhbCiAgICAgICAgICAgIFsgZGF0YS5saW1pdHMubGF0WzBdLCBkYXRhLmxpbWl0cy5sbmdbMF0gXSwKICAgICAgICAgICAgWyBkYXRhLmxpbWl0cy5sYXRbMV0sIGRhdGEubGltaXRzLmxuZ1sxXSBdCiAgICAgICAgICBdKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgbWFwLmZpdFdvcmxkKCk7CiAgICAgICAgfQogICAgICB9CgogICAgICBmb3IgKHZhciBpID0gMDsgZGF0YS5jYWxscyAmJiBpIDwgZGF0YS5jYWxscy5sZW5ndGg7IGkrKykgewogICAgICAgIHZhciBjYWxsID0gZGF0YS5jYWxsc1tpXTsKICAgICAgICBpZiAobWV0aG9kc1tjYWxsLm1ldGhvZF0pCiAgICAgICAgICBtZXRob2RzW2NhbGwubWV0aG9kXS5hcHBseShtYXAsIGNhbGwuYXJncyk7CiAgICAgICAgZWxzZQogICAgICAgICAgY29uc29sZS5sb2coIlVua25vd24gbWV0aG9kICIgKyBjYWxsLm1ldGhvZCk7CiAgICAgIH0KCiAgICAgIG1hcC5sZWFmbGV0ci5oYXNSZW5kZXJlZCA9IHRydWU7CgogICAgICBpZiAoIUhUTUxXaWRnZXRzLnNoaW55TW9kZSkgcmV0dXJuOwoKICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsgdXBkYXRlQm91bmRzKG1hcCk7IH0sIDEpOwogICAgfSwKICAgIHJlc2l6ZTogZnVuY3Rpb24oZWwsIHdpZHRoLCBoZWlnaHQsIG1hcCkgewogICAgICBtYXAuaW52YWxpZGF0ZVNpemUoKTsKICAgICAgaWYgKG1hcC5sZWFmbGV0ci5wZW5kaW5nUmVuZGVyRGF0YSkgewogICAgICAgIHRoaXMucmVuZGVyVmFsdWUoZWwsIG1hcC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EwuVGlsZUxheWVyLlByb3ZpZGVyKHByb3ZpZGVyLCBvcHRpb25zKTsKCX07Cn0oKSk7Cg=="></script>
<script src="data:application/x-javascript;base64,TGVhZmxldFdpZGdldC5tZXRob2RzLmFkZFByb3ZpZGVyVGlsZXMgPSBmdW5jdGlvbihwcm92aWRlciwgbGF5ZXJJZCwgZ3JvdXAsIG9wdGlvbnMpIHsKICB0aGlzLmxheWVyTWFuYWdlci5hZGRMYXllcihMLnRpbGVMYXllci5wcm92aWRlcihwcm92aWRlciwgb3B0aW9ucyksICJ0aWxlIiwgbGF5ZXJJZCwgZ3JvdXApOwp9Owo="></script>
</head>
<body style="background-color:white;">
<div id="htmlwidget_container">
<div id="htmlwidget-2373" class="leaflet html-widget" style="width:100%;height:400px;">
</div>
</div>
<script type="application/json" data-for="htmlwidget-2373">{"x":{"calls":[{"method":"addProviderTiles","args":["OpenStreetMap.BlackAndWhite",null,null,{"minZoom":0,"maxZoom":18,"maxNativeZoom":null,"tileSize":256,"subdomains":"abc","errorTileUrl":"","tms":false,"continuousWorld":false,"noWrap":false,"zoomOffset":0,"zoomReverse":false,"opacity":1,"zIndex":null,"unloadInvisibleTiles":null,"updateWhenIdle":null,"detectRetina":false,"reuseTiles":false}]},{"method":"addMarkers","args":[[-31.9505269,-37.813611,-43.5320544,13.7563309,22.4162632,25.2048493,26.6617635,28.5383355,28.7040592,29.6516344,29.7604267,29.9716905,30.267153,30.627977,33.7489954,34.0522342,34.7464809,35.2270869,35.6869752,35.9131996,36.0103561,36.0726354,36.1626638,37.5482697,37.5629917,37.8271784,38.2526647,38.5204001,38.6270025,38.8403909,38.8799697,38.9071923,39.165325,39.5480789,39.7392358,39.768403,39.9525839,39.9611755,40.4167754,40.6781784,40.7127837,40.7172296,40.7281575,40.7544843,41.6861794,41.7508391,41.8781136,42.3317642,42.3600825,43.0389025,43.0481221,43.0630734,43.8231096,44.977753,45.8080597,45.9635895,47.0378741,47.6062095,47.6739881,47.6779496,48.8048649,49.2827291,52.1765777,52.2042666,53.544389,53.7422689,59.3322187,60.3912628],[115.8604572,144.963056,172.6362254,100.5017651,114.2109318,55.2707828,-80.2683571,-81.3792365,77.1024902,-82.3248262,-95.3698028,-95.6937856,-97.7430608,-96.3344068,-84.3879824,-118.2436849,-92.2895948,-80.8431267,-105.937799,-79.0558445,-84.2696449,-79.7919754,-86.7816016,-121.9885719,-122.3255254,-122.2913078,-85.7584557,-78.8375257,-90.1994042,-77.4288769,-77.1067698,-77.0368707,-86.5263857,-104.9739333,-104.990251,-86.158068,-75.1652215,-82.9987942,-3.7037902,-73.9441579,-74.0059413,-97.3531033,-74.0776417,-86.3566659,-72.5450779,-88.1535352,-87.6297982,-71.1211635,-71.0588801,-87.9064736,-76.1474244,-86.2283864,-111.7924237,-93.2650108,9.0851765,-66.6431151,-122.9006951,-122.3320708,-122.121512,9.1732384,2.1203554,-123.1207375,4.5006415,0.1149085,-113.4909267,-0.3493495,18.0517112,5.3220544],{"iconUrl":{"data":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAelQTFRFAAAA7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rwk7Rw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xpGS08GRMSU2TT89YuNA4k8XZyjYrGyM0GXNyXfLyCxYW5tsuLFIOxJTPLlaLKJFS1HdgDiotK6+oRFfBmBdrUlVtX1Nbl1zfYO/QGIKhIH5hU7OiVUuuXWsbyBftaAoYO2w767u6DXt6BfvAodDUgeaJsv4Jpn0LJ05inNwbDjLBewqagqnToqcrtMxgBILkmQrAwMpEUcCYnTVlVq4qxPOM2dazFy6cY4asgtG0Zq7JXFjYMTLOtXWcZ4eioDIlBDlHMYpI1bqi2qGkhMqfvyDNjEA2ZocoAAANsaN7DTXqJQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMS0yOFQxNzoyODowNSswMDowMJaS3+MAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDEtMjhUMTc6Mjg6MDUrMDA6MDDnz2dfAAAARnRFWHRzb2Z0d2FyZQBJbWFnZU1hZ2ljayA2LjcuOC05IDIwMTQtMDUtMTIgUTE2IGh0dHA6Ly93d3cuaW1hZ2VtYWdpY2sub3Jn3IbtAAAAABh0RVh0VGh1bWI6OkRvY3VtZW50OjpQYWdlcwAxp/+7LwAAABh0RVh0VGh1bWI6OkltYWdlOjpoZWlnaHQAMTkyDwByhQAAABd0RVh0VGh1bWI6OkltYWdlOjpXaWR0aAAxOTLTrCEIAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADE0ODU2MjQ0ODUxZZKGAAAAD3RFWHRUaHVtYjo6U2l6ZQAwQkKUoj7sAAAAVnRFWHRUaHVtYjo6VVJJAGZpbGU6Ly8vbW50bG9nL2Zhdmljb25zLzIwMTctMDEtMjgvZjZhZTM5OWUxMmM4MDljYmVmOWYzMDU1ODM5NjhjODguaWNvLnBuZyAhaVwAAAAASUVORK5CYII=","index":0},"iconAnchorX":16,"iconAnchorY":16},null,null,{"clickable":true,"draggable":false,"keyboard":true,"title":"","alt":"","zIndexOffset":0,"opacity":1,"riseOnHover":false,"riseOffset":250},["<strong>Address: \u003c/strong>Perth, Western Australia, Australia<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Melbourne, Victoria, Australia<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>Christchurch, Canterbury, New Zealand<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Bangkok, Bangkok, Thailand<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Hong Kong, NA, China<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Dubai, Dubai, United Arab Emirates<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Wellington, Florida, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Orlando, FL, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Delhi, Delhi, India<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>Gainesville, Florida, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Houston, Texas, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Cypress, Texas, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Austin, Texas, United States of America<br><strong>Number of Volunteers: \u003c/strong>6","<strong>Address: \u003c/strong>College Station, Texas, United States of America<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Atlanta, GA, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Los Angeles, CA, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Little Rock, AR, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Charlotte, NC, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Santa Fe, NM, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Chapel Hill, NC, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Oak Ridge, TN, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Greensboro, NC, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Nashville, Tennessee, USA<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>Fremont, CA, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>San Mateo, CA, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>SF Bay Area, California, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Louisville, KY, USA<br><strong>Number of Volunteers: \u003c/strong>3","<strong>Address: \u003c/strong>Linville, VA, United States<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>St. Louis, MO, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Centreville, Virginia, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Arlington, VA, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Washington DC, DC, USA<br><strong>Number of Volunteers: \u003c/strong>5","<strong>Address: \u003c/strong>Bloomington, IN, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Highlands Ranch, Colorado, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Denver, Colorado, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Indianapolis, Indiana, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Philadelphia, PA, United States<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>Columbus, OH, United States<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>Madrid, NA, Spain<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Brooklyn, NY, USA<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>New York, NY, USA<br><strong>Number of Volunteers: \u003c/strong>7","<strong>Address: \u003c/strong>Cordova, NA, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Jersey City, NJ, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Logansport, Indiana, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Glastonbury, CT, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Naperville, IL, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Chicago, Illinois, USA<br><strong>Number of Volunteers: \u003c/strong>4","<strong>Address: \u003c/strong>Brookline, Massachusetts, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Boston, Massachusetts, United States<br><strong>Number of Volunteers: \u003c/strong>4","<strong>Address: \u003c/strong>Milwaukee, Wisconsin, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Syracuse, NY, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Grand Haven, Michigan, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Rexburg, Idaho, US<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Minneapolis, Minnesota, United States of America<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Como, Lombardia, Italy<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>fredericton, New Brunswick, Canada<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Olympia, WA, United States<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Seattle, WA, USA<br><strong>Number of Volunteers: \u003c/strong>3","<strong>Address: \u003c/strong>Redmond, WA, USA<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Konstanz, NA, Germany<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Versailles, NA, France<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Vancouver, BC, Canada<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Leiden, NA, the Netherlands<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Cambridge, NA, United Kingdom<br><strong>Number of Volunteers: \u003c/strong>2","<strong>Address: \u003c/strong>Edmonton, Alberta, Canada<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Cambridge, NA, UK<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Stockholm, NA, Sweden<br><strong>Number of Volunteers: \u003c/strong>1","<strong>Address: \u003c/strong>Bergen, NA, Norway<br><strong>Number of Volunteers: \u003c/strong>1"],null,null]}],"limits":{"lat":[-43.5320544,60.3912628],"lng":[-123.1207375,172.6362254]}},"evals":[],"jsHooks":[]}</script>
<script type="application/htmlwidget-sizing" data-for="htmlwidget-2373">{"viewer":{"width":"100%","height":400,"padding":0,"fill":true},"browser":{"width":"100%","height":400,"padding":0,"fill":true}}</script>
</body>
</html>